Published
Edited
Dec 2, 2019
Insert cell
md`# MathLine`
Insert cell
math = require('mathjs')
Insert cell
Plotly = require('plotly.js-dist')
Insert cell
{
const X = math.range(-8, 8, 0.01).toArray()
const Y = X.map(function (x) {
return math.sin(x)
})
const data = [{
x: X,
y: Y,
type: 'line'
}]

const div = DOM.element('div')
Plotly.newPlot(div, data)
return div
}
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