Public
Edited
Apr 21, 2024
Insert cell
Insert cell
viewof Ax = Inputs.range([-4, 4], {label: "Ax", step: 1})
Insert cell
viewof Bx = Inputs.range([-4, 4], {label: "Bx", step: 1})
Insert cell
Insert cell
JXG = await require('https://cdnjs.cloudflare.com/ajax/libs/jsxgraph/1.8.0/jsxgraphcore.js').catch(() => window.JXG)
Insert cell
{
// Initialize the JSXGraph board within this div
const board = JXG.JSXGraph.initBoard('jxgbox', {
boundingbox: [-5, 5, 5, -5],
axis: true
});
// Create some geometric elements
const p1 = board.create('point', [Ax, Bx], {name: 'A', color: 'blue'});
const p2 = board.create('point', [-2, -2], {name: 'B', color: 'red'});
const line = board.create('line', [p1, p2], {strokeWidth: 2});
// Optional return
return board;
}
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