Public
Edited
Aug 29, 2024
1 fork
1 star
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
d3.range(start, end, Math.ceil((end - start) / distributorDomain)).map((e) => ({
pos: e,
val: data.filter((d) => e > d.start && e < d.end).length
}))
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
viewof distributorDomain = Inputs.range([50, 1000], {
value: 100,
step: 10,
label: "Possible value"
})
Insert cell
Insert cell
stackEnSac = data.reduce((a, b, _, all) => {
let pos = 0;
// find lowest position in wich the data fits
a.every((f) => {
if (
a
.filter((x) => x.pos === pos)
.every((x) => !(x.start <= b.end && x.end >= b.start))
) {
return false;
} else {
pos++;
return true;
}
});
return [...a, { ...b, pos }];
}, [])
Insert cell
start = new Date(end.getTime() - maxDuration)
Insert cell
end = new Date()
Insert cell
maxDuration = 1000 * 60 * 60 * 12
Insert cell
import { chartEditor, Keyframe, Curve } from "@nhogs/easing-graphs-editor"
Insert cell
import { distributor } from "@pernifloss/distribution-data-generator"
Insert cell

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more