Public
Edited
Jan 9, 2024
Insert cell
Insert cell
Insert cell
Insert cell
import {nerdamer} from '@nicola/nerdamer-fork'
Insert cell
Insert cell
Plotly = require("https://cdn.plot.ly/plotly-latest.min.js")
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
eq = `x^3+${a}*x^2+${b}*x+${c}`
Insert cell
Insert cell
tex`${nerdamer(eq).toTeX()}`
Insert cell
Insert cell
tex`${nerdamer('diff('+eq+', x)').toTeX()}`
Insert cell
Insert cell
tex`${nerdamer('integrate('+eq+',x)').toTeX()}`
Insert cell
Insert cell
Insert cell
f1 = nerdamer(eq).buildFunction(['x'])
Insert cell
f2 = nerdamer('diff('+eq+',x)').buildFunction(['x'])
Insert cell
f3 = nerdamer('integrate('+eq+',x)').buildFunction(['x'])
Insert cell
Insert cell
{
for (var i=-6, x=[]; i <= 6; i += 0.1) x.push(i);
var d1 = {
name: 'f1', mode: 'lines', type: 'scatter',
x: x, y: x.map(f1)
};
var d2 = {
name: 'f2', mode: 'lines', type: 'scatter',
x: x, y: x.map(f2)
};
var d3 = {
name: 'f3', mode: 'lines', type: 'scatter',
x: x, y: x.map(f3)
};
const div = DOM.element('div');
Plotly.newPlot(div, [d1, d2, d3], {width: width, height: width, yaxis: {range: [-8, 8]}});
return div;
}
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