Published
Edited
Apr 21, 2022
Insert cell
Insert cell
0
Insert cell
-0
Insert cell
Insert cell
String(0)
Insert cell
String(-0)
Insert cell
Insert cell
Insert cell
1 / 0
Insert cell
1 / -0
Insert cell
distinguish = (d) => (d === 0 ? (1 / d) === Infinity ? "0" : "-0" : String(d))
Insert cell
distinguish(0)
Insert cell
distinguish(-0)
Insert cell
Plot.plot({
width: 240,
x: { transform: distinguish },
color: { transform: distinguish },
marks: [Plot.dot([-1, -0, 0, 1], { x: (d) => d, stroke: (d) => d })]
})
Insert cell
Insert cell
Object.is(0, 0)
Insert cell
Object.is(0, -0)
Insert cell
Object.is(-0, -0)
Insert cell
Object.is(-0, 0)
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