Commit d14beab0 authored by Jan Pöppel's avatar Jan Pöppel
Browse files

updadted study viz

parent 94ebc6fa
......@@ -93,6 +93,10 @@ class StudyReview extends Component {
let answersI = answers["individual"];
let answersC_Controlled = answers["collapsed_control"];
let answersI_Controlled = answers["individual_control"];
const answerOrder = ["R", "B", "O", "Y", "U", "Yes", "No"];
console.log("answersC: ", answersC[curMap][curStep])
if (answersC[curMap][curStep]) {
......@@ -102,10 +106,16 @@ class StudyReview extends Component {
}
let data = [];
for (var answer in answersC[curMap][this.curQP]) {
data.push({"x": answer, "y": answersC[curMap][this.curQP][answer]})
if (answersC[curMap][this.curQP]) {
for (var i=0;i<answerOrder.length; i++) {
var answer = answerOrder[i];
if (answersC[curMap][this.curQP][answer]) {
data.push({"x": answer, "y": answersC[curMap][this.curQP][answer]})
}
}
}
console.log("Data: ", data)
if (data) {
bars.push(<VerticalBarSeries key={"collapsed"}
data={data}
......@@ -113,8 +123,13 @@ class StudyReview extends Component {
}
data = [];
for (var answer in answersC_Controlled[curMap][this.curQP]) {
data.push({"x": answer, "y": answersC_Controlled[curMap][this.curQP][answer]})
if (answersC_Controlled[curMap][this.curQP]) {
for (var i=0;i<answerOrder.length; i++) {
var answer = answerOrder[i];
if (answer in answersC_Controlled[curMap][this.curQP]) {
data.push({"x": answer, "y": answersC_Controlled[curMap][this.curQP][answer]})
}
}
}
if (data) {
......@@ -127,13 +142,18 @@ class StudyReview extends Component {
let barsI = [];
for (var variant in answersI) {
console.log("variant: ", variant)
console.log("variant1: ", variant)
if (variant === "null") {
continue;
}
let data = [];
for (var answer in answersI[variant][curMap][this.curQP]) {
data.push({"x": answer, "y": answersI[variant][curMap][this.curQP][answer]})
if (answersI[variant][curMap][this.curQP]) {
for (var i=0;i<answerOrder.length; i++) {
var answer = answerOrder[i];
if (answer in answersI[variant][curMap][this.curQP]) {
data.push({"x": answer, "y": answersI[variant][curMap][this.curQP][answer]})
}
}
}
if (data) {
barsI.push(<VerticalBarSeries key={variant}
......@@ -143,14 +163,19 @@ class StudyReview extends Component {
}
let barsIControlled = [];
for (var variant in answersI) {
console.log("variant: ", variant)
for (var variant in answersI_Controlled) {
console.log("variant2: ", variant)
if (variant === "null") {
continue;
}
let data = [];
for (var answer in answersI_Controlled[variant][curMap][this.curQP]) {
data.push({"x": answer, "y": answersI_Controlled[variant][curMap][this.curQP][answer]})
if (answersI_Controlled[variant][curMap][this.curQP]) {
for (var i=0;i<answerOrder.length; i++) {
var answer = answerOrder[i];
if (answer in answersI_Controlled[variant][curMap][this.curQP]) {
data.push({"x": answer, "y": answersI_Controlled[variant][curMap][this.curQP][answer]})
}
}
}
if (data) {
barsIControlled.push(<VerticalBarSeries key={variant}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment