Skip to content

maslenkou/figma-graph-calculator

Repository files navigation

Main preview image
 

Figma Graph Visualiser

Visualise any math functions by rendering their graphs right on the Figma canvas! Turn any mathematical expressions and functions into editable Bezier curves in seconds. Simply enter the function you want to visualise (e.g., sin(x+1)*cos(x)^2), press Insert, and enjoy the rendered graph right in your Figma file canvas.
 

👩‍🏫  How to use

Simple as that:

  1. Select the frame you want to insert your chart in.
  2. Run the plugin.
  3. Enter the function you want to visualize.
  4. Press the Insert button.
  5. Voila.

✍️  Supported input syntax

I work hard to implement the support for every function, expression, and syntax from math.js. Still, not everything works well, but here is a table containing all the supported and tested syntax you can already use:

Syntax Description
sin(x) Sine of x
sinh(x) Hyperbolic sine of x
cos(x) Cosine of x
cosh(x) Hyperbolic cosine of x
tan(x) Tangent of x
tanh(x) Hyperbolic tangent of x
cot(x) Cotangent of x
coth(x) The hyperbolic cotangent of x
random() A random number between 0 and 1
pow(x, y) or x^y X to the power of Y
cube(x) Cube of x (x^3 or x*x*x)
cbrt(x) The cubic root of x
abs(x) The absolute value of x
sqrt(x) Calculate the square root of a value
log(x) Calculate the logarithm of a value
ceil(x) Round a value towards plus infinity
floor(x) Round a value towards minus infinity
round(x) Round a value towards the nearest rounded value
sign(x) Compute the sign of a value
e Euler's number (approx. 2.718)
pi PI (approx. 3.14)

☹️  Limitations and known issues

A few known issues and limitations:

  • Although the plugin can already preview discontinuous and periodical functions like f(x) = tan(x), it cannot render them properly.
  • Not every graph type is rendered and scaled as it should, especially functions with abrupt changes like f(x) = 1/x.
  • Math.js evaluate works weird, atan(x) works fine, when at the same time asin(x) throws an error.

🪲  Bug reports or feature requests

If you have a bug report or a feature request, please don’t hesitate to add a new issue, or write a message to my email address or Telegram.


🫡  Support

My best reward and motivation are you giving this project a star ⭐️ or contributing to its development.

 

👩‍⚖️  Licensing

This project is licensed under the MIT License. See the LICENSE file for more details.

About

A plugin for visualising graphs of mathematical functions on Figma canvas

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published