SortaGrapher - easy <canvas> graphs
SortaGrapher!
This is a short Repl I wrote in a night or so :D
SortaGrapher makes it easy to add graphs to your project.
Quick Setup
Find the entire user guide here: https://replit.com/@sortagames/SortaGrapher/readme.md
First, import the module:
import Grapher from 'https://sortagrapher.sortagames.repl.co/lib.js'
Then, create a new graph:
let myGraph = new Grapher(75,75); // width/height in pixels // add the canvas! document.body.appendChild(myGraph.canvas)
Make a data logger:
let logger = new myGraph.Reader(20); // max. data points to show
And finally, graph stuff:
// Only accepts values from 0-1. // You may need to use .the optional scaling function: // logger.mapNumber(myValue,minimum,maximum); logger.log(myValue);
Tip: This uses SortaCanvas, so if you want to draw objects, such as text, along with the graph, use myGraph.sortacanvas
.
Enjoy!
Here it is!
maurofeliz
Awesome.
klondike solitaire
Whippingdot
Everyone's heartbeat
POG
Brendan23
awesome!
cewl!
@Baconman321 ay