After some reverse engineering, I found out how lets-plot loads its dependencies. It does more or less what I expected - loads and cached the script. The important problem is that it won't work without internet. I think, that those JS files should be loaded locally. @Anatoly Nikitin, I left an issue on the github about that.
In let's-plot python package there are three options:
- load JS dynamically once (works in Jupyter, Kaggle, PyCharm)
- Embed lets-plot JS into the notebook once (works in Jupyter in offline mode)
- Output static HTML containing a script tag to load the library and plot data in each output cell (works in Datalore, Google colab)
I'm planning to do the same thing in the Kotlin variant.
a
altavir
06/02/2020, 7:02 PM
@Igor Alshannikov It would be nice. I think that there should be two ways to load statics:
• Via module descriptor.
• Via command in notebook runtime.
As I said earlier, the usual way to store such things on JVM is in resources, so it should be made easy to load single files or directories from resource sub-directory. This way, it will work both in on-line and off-line mode and without version conflicts.
i
Igor Alshannikov
06/02/2020, 7:10 PM
@altavir I was thinking about some lets-plot-specific solution. But using module descriptors for specifying resources would be probably nice, but this is indeed up to @Anatoly Nikitin