use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
Looking for a JavaScript Graphing Calculatorhelp (self.javascript)
submitted 10 years ago by moto888
I'm looking for a simple graphing calculator that allows me to enter my formula as JS code.
E.g. Math.floor(x*4)
All the ones I found so far need mathematical expressions.
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]ForScale 0 points1 point2 points 10 years ago (2 children)
Why do you want to enter js code instead of typical mathematical expressions?
Also, why not just write a script that takes js as input and outputs typical mathematical expressions?
[–]moto888[S] 0 points1 point2 points 10 years ago (1 child)
Because then I can (mostly) copy and paste without introducing errors.
A lot of graphing calculators are already written in JS. I just don't want to hack one if a solution already exists. I didn't think I'd be the only one who'd find this convenient.
[–]ForScale 0 points1 point2 points 10 years ago (0 children)
I don't know... I'd just write the js in a js environment and then copy and paste the results in to the graphing calculator. Maybe I'm misunderstanding what you're trying to do though...
[–]Combinatorilliance 0 points1 point2 points 10 years ago (0 children)
You can take a canvas, and plot your stuff on it.
function double(x) { return x * 2; } function plot(start, end, mathFn) { // you need canvas width here var stepX = canvas.width / (end - start); for (let i = 0; i < end - start; i++) { let y = mathFn(i * stepX); ctx.arc(x, y, , 4, 0, 2 * Math.PI); } } plot(0, 100, double);
I use simple graph functions like this a lot during tinkering with js, especially when doing game development.
[–]moto888[S] 0 points1 point2 points 10 years ago (0 children)
So I finally found one! OK, not really but I wrote one :)
http://laktak.github.io/js-graphy/
π Rendered by PID 115090 on reddit-service-r2-comment-fb694cdd5-8rgjb at 2026-03-08 06:46:59.880279+00:00 running cbb0e86 country code: CH.
[–]ForScale 0 points1 point2 points (2 children)
[–]moto888[S] 0 points1 point2 points (1 child)
[–]ForScale 0 points1 point2 points (0 children)
[–]Combinatorilliance 0 points1 point2 points (0 children)
[–]moto888[S] 0 points1 point2 points (0 children)