Graphs
Interactive Graphs
Plotly
Sometimes the books may include interactive graphs created in tools like Plotly using a dataset provided by the author.
To have the charts display in PDF exports, we included a static image of the chart (from screenshot) and used custom CSS classes to display the H5P embed in web pages but not in PDF, and vice versa for the static image. For example:
[in the page HTML]
<div class=”web-only”></div>
<div class=”non-web”><img src=’image.jpg” /></div>
[in Web custom styles]
.web-only { display: block; }
.non-web {display: none; }
[in PDF and EPUB custom styles]
.web-only { display: none; }
.non-web { display: block; }
For print versions, take a download of the interactive graph from Plotly and replace in the PDF version with the static image.