Graphique de discours (Plotly) intégrer ! [image|616x500](upload://yffctWFiXHM44cODU8IlioEzbDC.p

:information_source: Summary Embed Plotly graphs into posts from an equation
:hammer_and_wrench: Repository GitHub - NateDhaliwal/discourse-graph-embed
:question: Install Guide How to install a theme or theme component
:open_book: New to Discourse Themes? Beginner’s guide to using Discourse Themes

Install this theme component

This component allows users to add graphs using Plotly.js to their topics and replies.

To use this, click the image (:chart_increasing:) icon in the formatting toolbar. Then, simply edit the equation inside the [wrap][/wrap]. (By sheer coincidence, I found out that backticks in the wrap didn’t affect anything)

For example:

Also, you can hover on the graph to find coordinates of points:

I originally tried to use a Desmos embed but that didn’t work out that well. Plotly is a great library (and open-source too!) that can do this, paired with MathJS (also open-source) to run the calculations.

Plotly allows you to also use things like sin, cosine and tangent, as well as logarithms (base 10) and others.

:warning: NOTE: Graphs of trigonometric functions (e.g. sin, cos, tan) are not ‘curved’ and they end up kind of pointy.

I hope this is useful!

5 « J'aime »

The icon is quite… should I describe it pale :joy:

1 « J'aime »

I’ve pushed a fix. Does it work now?

1 « J'aime »

Beautifully. Thanks.

1 « J'aime »