Open
Description
How to add interactive lightning-viz plot to a post
Get html
and js
of a plot
Because a single html file for a plot is pretty big (1.5-2 MB) we will separate it into html
and js
.
From tuple_code:
js = viz.load_embed()
base = viz._html
What we need to do more with js
and base
from snippet above:
- Add quote to
id
of obj in base. (see detail in tuplecode/manee/ipynb) - Add a link to generated
js
file (very big) intohtml
file (small).- However, we can't hotlink directly to GitHub so we need rawgit.
After you run the last cell of manee ipynb in tuplecode, you get plot.html
and plot.js
.
Copy html of plot
Then copy plot.html
to _plots
folder inside _posts
in tupleblog.
Include plot into a post
Use include_relative
for this:
<center>{% include_relative _plots/example_plot.html %}</center>
Metadata
Metadata
Assignees
Labels
No labels