scikit-hep / vegascope

View Vega/Vega-Lite plots in your web browser from local or remote Python processes.
BSD 3-Clause "New" or "Revised" License
35 stars 4 forks source link

Update JS libraries #3

Closed jakevdp closed 6 years ago

jakevdp commented 6 years ago

Is there any reason you're using older versions of the JS libraries? In particular, recent releases of vega-embed incorporate vega-tooltip so that the tooltip channel in vega-lite behaves properly.

If you're open to it, I'll prepare a PR updating the JS.

jpivarski commented 6 years ago

I'll update them, thanks. (Sorry I missed this earlier— I made this repo before changing settings to automatically watch all repos I create.)

Ideally, I'd like to use the versions from the CDN if available

<script src="https://cdn.jsdelivr.net/npm/vega@3"></script>
<script src="https://cdn.jsdelivr.net/npm/vega-lite@2"></script>
<script src="https://cdn.jsdelivr.net/npm/vega-embed@3"></script>

and only fall back to the embedded ones if these URLs can't be reached. I was having trouble even using the CDN ones (possibly because the browser didn't like to run JS from one server in HTML from another).

I embeded the minified JS too get it working and justified that to myself by the fact that it handles another use-case: when the user is disconnected from the wider internet, which is possibly the reason they can't use Jupyter.

If you have any suggestions, I'm open to ideas. Locking VegaScope to a particular version of Vega is one of the uglier things about it.

jpivarski commented 6 years ago

Fixed by 60e4fed5a2a1eddf4eff61765c95af9d31096ff1 : new Vega/Vega-Lite/Vega-Embed versions embedded within the vegascope.py file and added manual control over version number. The default is to get fixed versions from cdn.jsdelivr.net: vega="3.3.1", vegalite="2.5.2", vegaembed="3.15.0".

jpivarski commented 6 years ago

Version 1.0.10 on PyPI has it.