-
Notifications
You must be signed in to change notification settings - Fork 104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
plotly.min.js bloats binary size #176
Comments
I also ran into this while working on plotly.rs-based plotting support for Numbat (sharkdp/numbat#464). I looked a little bit into how {% cfg(feature = "plotly-js-vendored") -%} <!-- this does not exist, AFAIS -->
{% if remote_plotly_js -%} <!-- the runtime switch that is already present -->
<script src="https://cdn.plot.ly/plotly-2.12.1.min.js"></script>
{% else -%}
<script type="text/javascript">{% include "plotly.min.js" %}</script>
{% endif -%}
{% else %}
<script src="https://cdn.plot.ly/plotly-2.12.1.min.js"></script>
{% endcfg %} So I guess the only way to do this would be to duplicate https://github.com/plotly/plotly.rs/blob/main/plotly/templates/plot.html into a new Or does someone see a way to solve this using askama? |
Hi @sharkdp , TBH I don't know if it is possible via I agree with your proposal as well. If you have already the code for that, please submit a PR and we can merge it until we find an alternative way. |
Templates like this one include
plotly.min.js
such that static plots can be output correctly. For binaries using plotly that only output plots using the CDN distributed version of plotly, this unnecessarily increases the binary size.Would it make sense to add a Cargo feature that allows to skip the inclusion of the minified plotly version (~2.5 MB)? For example
plotly-vendoredjs
with a default oftrue
that can be set tofalse
?Or is there already a way to accomplish the desired behavior of not unnecessarily including the minified plotly version into the __TEXT,__const section of the binary?
The text was updated successfully, but these errors were encountered: