Ability to use local js instead of CDN
See original GitHub issueI think because of restrictions and firewall on my work laptop whenever I try plotting anything in Juyterlab, I get the following error -
Error loading script: https://cdn.jsdelivr.net/npm//vega@5?noext
I can however download those vega js libraries and have them locally. So I was wondering if it is possible to configure altair to provide paths to local js libraries instead of using a CDN?
If not, then I’d like to help. Maybe we can have this as a configuration or subclass the code responsible for adding these CDNs to change the path to local files. Let me know the code that is responsible for that I would take a look.
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Is it better to use CDN for js and similar resources vs local?
It is still beneficial to use a CDN, and it is still for your users' benefit, but the benefit is in reduced latency...
Read more >CDN vs Local - CDNetworks
Although the choice between local and CDN hosting depends entirely on your business needs, all signs point to CDNs being a better option....
Read more >Local Vs CDN | Why Choosing CDN Is A Better Idea?
In the local vs CDN equation, it's clear that CDN has more capacity and stronger reach, but that's not to say local web...
Read more >How to Import JavaScript and CSS from a Public CDN
npm downloads the library from a CDN and adds it to the project locally. We don't have to be using npm and JavaScript...
Read more >Providing Local JS and CSS Resources for CDN Fallbacks
I think you perhaps misunderstand how larger sites which might need this kind of resilience use CDNs. it's not just a matter of...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
You can do this in a couple ways: You can use altair_viewer for offline viewing on any frontend; see https://altair-viz.github.io/user_guide/display_frontends.html#altair-viewer. if you are on Jupyter Notebook or JupyterLab, another approach is to use the appropriate frontend extension (see https://altair-viz.github.io/user_guide/display_frontends.html#displaying-in-jupyterlab).
Frontend extensions are tricky (it’s one of the reasons we moved away from requiring them). Make certain you’ve installed the extension in the environment used by the kernel manager, not the kernel used by the runtime (though they are often the same) and be sure to restart your jupyterlab process after updating extensions. If you’re still having trouble gettig the extension installed, try asking in the Jupyter forums.