gitbook-plugin-plotly

Plugin for GitBook to render Plotly charts

APACHE-2.0 License

Stars
1
Committers
4

Plotly plugin for GitBook

Plugin for GitBook to render Plotly charts

This plugin is based on code from gitbook-plugin-mermaid.

How to install it?

You can use install via NPM:

npm install gitbook-plugin-plotly

And use it for your book with in the book.json:

{
    "plugins": ["plotly"]
}

How to use it?

There are two options how can be graph put into the gitbook. To use embedded graph, put in your book block as:

{% plotly %}
{
  "a": "b"
}
{% endplotly %}

Plugin will pick up block body and replace it with generated svg diagram. To load graph from file, put in your book block as:

{% plotly src="./diagram.plotly" %}
{% endplotly %}

If not absolute, plugin will resolve path given in src attribute relative to the current book page, load its content and generate svg diagram.