tupleblog/tupleblog.github.io

Adding html plot to a post

bluenex opened this issue · 0 comments

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:

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>