Skip to content

EquationIO/graph-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

api

Equation IO API for the web

Draft API:

var EquationIO = require('equation-io-api');

var Graph = EquationIO.Graph;

var div = document.createElement('div');
// It needs to be in the DOM hierarchy, but we can make it hidden to avoid artefacts before it finishes loading:
div.style.opacity = 0.0;
document.body.appendChild(div);

var graph = new Graph({width: 800, height: 600});

graph.init(div, function (err) {
  console.log('loaded');
  div.style.opacity = 1.0;
});

// To implement later:
// graph.context.c = 30;

// Change what is displayed by modifying the .equations array:

graph.equations.push({
  latex: 'y = \\sin x',
  color: 'red'
});

graph.equations.push({
  latex: 'y = \\cos x',
  color: 'blue'
});


// And then call .update()

graph.update(function (err) {
  if (err) alert(err.message);
  console.log('Graph should now have two curves');
});

About

DRAFT: Equation IO API for the web (client side javascript)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published