Public
Edited
Jun 3, 2023
Insert cell
Insert cell
result = FileAttachment("result@1.json").json()
Insert cell
Plot.plot({
marks: [
Plot.dot(result, {x: "buyVolume", y: "sellVolume", stroke: "trend", filter: x => x.trend == "up"})
],
width,
})
Insert cell
Plot.plot({
color: {legend: true},
marks: [
Plot.rect(result, Plot.bin({
fill: data => {
const countUp = data.filter(x => x.trend == "up").length
return countUp / data.length
}
}, {
x: "buyVolume",
y: {value: "sellVolume"},
})),
Plot.text(result, Plot.bin({
text: data => {
const countUp = data.filter(x => x.trend == "up").length
return (countUp / data.length).toFixed(2) + `(${data.length})`
},
}, {
x: "buyVolume",
y: {value: "sellVolume"},
fontSize: "6px"
})),
],
width,
})
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