Public
Edited
Jul 17, 2023
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
data = {
var data = [];
datatype;

marketplace.forEach((mkt) => {
const plat = rawdata[mkt];

function pushToData(type, view) {
if (plat.hasOwnProperty(type)) {
plat[type].forEach((d) => {
if (datatype === "Volume") {
if (d.sum[valueTranslator]) {
d.value = d.sum[valueTranslator];
} else {
d.value = 0;
}
} else {
d.value = d.count;
}
d.type = `${mkt} - ${view}`;
data.push(d);
});
}
}

//I don't need no switch statement in my life
views.forEach((view) => {
if (view.indexOf("Primary") + 1) {
pushToData("primary", view);
} else if (view.indexOf("Secondary") + 1) {
pushToData("secondary", view);
} else if (view.indexOf("Total") + 1) {
pushToData("total", view);
}
});
});

return data;
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
fxhashPrimary = getFXdata({
_in: [
"FX_MINT",
"FX_MINT_V2",
"FX_MINT_V3",
"FX_MINT_V4",
"FX_MINT_WITH_TICKET"
]
})
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
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