question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Ability to use local js instead of CDN

See original GitHub issue

I 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:closed
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
jakevdpcommented, Apr 13, 2020

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).

0reactions
jakevdpcommented, Apr 13, 2020

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found