Vector.js

Vector is an open source javascript library for creating interactive graphics. View the repository, run the tests, or meet the team.

Plot Tutorial

let scale = 300/Math.PI;
let plot = interactive.plot(600, 300, Math.cos, {
  originX: 0,
  originY: 150,
  scaleX: scale,
  scaleY: scale,
  controls: false, /* experimental */
  displayPoint: false, /* experimental */
  zoomable: false /* experimental */
});

Visualize Multiple Functions

let scale = 300/Math.PI;
let secant = (x) => { return 1/Math.cos(x) };
let plot = interactive.plot(600, 600, secant, {
  originX: 0,
  originY: 300,
  scaleX: scale,
  scaleY: scale,
  zoomable: false,
  controls: false
});
plot.graph(Math.cos);