Published
Edited
Mar 9, 2022
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
q5 = joinedData.filter((element, index) => {
return element.question == "Q19";
})
Insert cell
q6 = joinedData.filter((element, index) => {
return element.question == "Q20";
})
Insert cell
Insert cell
theme = backGroundData.filter((d) => d.theme == "splice")
Insert cell
themep = theme.map((d) => {
return { ...d, year5p: d.year5 * 100, year7p: d.year7 * 100 };
})
Insert cell
yearData = {
if (yearGroup == "Year 5") {
return themep.map((d) => {
return {
q: d.q,
answer: d.answer,
distractors: d.distractors,
cohort: d.year5p
};
});
} else {
return themep.map((d) => {
return {
q: d.q,
answer: d.answer,
distractors: d.distractors,
cohort: d.year7p
};
});
}
}
Insert cell
Insert cell
reducer = (previousValue, currentValue) => previousValue + currentValue
Insert cell
itemData = {
if (itemFile) {
return itemFile.csv({ typed: true });
} else {
return [];
}
}
Insert cell
parsedItemData = itemData
.map((d, i) => {
return {
q: i + 1,
class: d["your class"] * 100
};
})
.filter((d) => d.q > 14)
Insert cell
schoolData = {
if (responsesFile) {
return responsesFile.csv({ typed: true });
} else {
return [];
}
}
Insert cell
responsesFile
Insert cell
parsedData = {
return schoolData.map((d) => {
return {
question: d.question,
response: d.response,
class: d.response_pctg
};
});
}
Insert cell
mergeById = (a1, a2) =>
a1.map((itm) => ({
...a2.find(
(item) =>
item.question === itm.question && item.response === itm.response && item
),
...itm
}))
Insert cell
joinedData = mergeById(frequencies, parsedData)
Insert cell
mergeByQ = (a1, a2) =>
a1.map((itm) => ({
...a2.find((item) => item.q === itm.q && item),
...itm
}))
Insert cell
joinedIA = mergeByQ(yearData, parsedItemData)
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more