plot1 = {
const p = new Facet("container1", {
appendPadding: [0, 0, 16, 0],
padding: 16,
type: "matrix",
fields: ["x", "y", "z", "price"],
data: data0,
meta: {
clarity: { sync: true },
x: { sync: true, nice: true },
y: { nice: true },
z: { nice: true },
price: { nice: true }
},
axes: {},
eachView: (view, facet) => {
if (facet.rowIndex === facet.columnIndex) {
return {
type: "histogram",
options: {
data: facet.data,
binField: facet.columnField,
binNumber: 30,
stackField: "clarity",
isStack: true,
columnStyle: { stroke: null }
}
};
}
return {
type: "scatter",
options: {
data: facet.data,
xField: facet.columnField,
yField: facet.rowField,
colorField: "clarity",
shape: "circle",
pointStyle: { fillOpacity: 0.3, stroke: null },
size: 3
}
};
}
});
p.render();
return p;
}