Skip to content

ja0n/plotter.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

plotter.js

A library for plotting math functions on <canvas> (HTML element).

Live Demo

Usage

It's easy as pie. Firstly you need the files:

Then

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <script src="plotter.js"></script>
    <script>
      window.onload = function() {
        var plotter = new Plotter('graph');
        plotter.addFunction('x', { lineColor: 'red' });
        plotter.addFunction('x * x', { lineColor: 'blue' });
      };
    </script>
  </head>
  <body>
    <canvas id="graph" width="500" height="380"></canvas>
  </body>
</html>

For more details see examples folder.

Development

Clone this repo

git clone https://github.com/ja0n/plotter.js.git

Install dev dependencies

npm install

Run dev server

npm run serve

And open http://localhost:8090/

Or build files

npm run build

About

A library for plotting math functions into <canvas> elements

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published