Public
Edited
Sep 29, 2020
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
kav=function(d){if (d % 4==0) return true; else return false}
Insert cell
c(a(),b())
Insert cell
x=new Set([0,1,2,3,4,5,6,7,8,9,10,11,12])
Insert cell
d3 = require("d3@6")
Insert cell
result=d3.filter(x,kav)
Insert cell
myline = d3.line()
Insert cell
xdata=d3.range(0,100)

Insert cell
val=d3.map(xdata,d3.randomUniform(5,10))
Insert cell
x.age=232
Insert cell

results=xdata.map(indx => ({"indx":indx,"value":val[indx]}))



Insert cell
line=d3.line()
.x(d => d.indx*5)
.y(d => d.value*15)
Insert cell
linescript=line(results)

Insert cell
html`<svg viewBox="0 0 ${width} ${height}">
<path d="${linescript}" fill="none" stroke="steelblue" stroke-width="1.5" stroke-miterlimit="1"></path>
</svg>`
Insert cell
margin = ({top: 20, right: 30, bottom: 30, left: 40})
Insert cell
height=240
Insert cell
xAxis = g => g
.attr("transform", `translate(0,${height - margin.bottom})`)
.call(d3.axisBottom(x).ticks(width / 80).tickSizeOuter(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