Is there any way to use plotly.offline to store (numpy) data in a div or HTML as a binary blob then have plotly js render it properly?
The HTML file has bits that look like…
“z”: [[0.2866461675771665, 0.36531080671829425, -0.2904632669675007, -0.36149370732795966, -0.049367492181059396, -0.08192231566757988, 0.6849181745604624, 1.268579555423972, 0.2944241042103686, -0.2851544876150079, -0.9762164627387184, 0.1527361407626408] …
I’m trying to reduce the size of my HTML files that have several image plots each with 10^5 - 10^6 data points.
I’ve taken to stripping some of the precision so the json (string)-encoded data have fewer digits, but this seems silly.
Not quite, but I actually have an open pull request in the Plotly.js project that would be the first step: See https://github.com/plotly/plotly.js/pull/2911
But, your example here reminds me that this PR doesn’t yet cover the 2-dimensional case. I’ll add a note over there.
Thanks for the quick reply. I searched plotly.py before posting but not plotly.js; I’m glad to see it’s in-progress.
Should one of us create an issue in plotly.py to make this visible there as well?
Sure, that would be great if you would create an issue to track this on the plotly.py side.
It will probably be a couple of months before I have a chance to work on this, but feel free to dig in yourself if you’re interested in the meantime!