Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correctly load plotly and vega libraries #309

merged 12 commits into from Mar 16, 2019

Correctly load plotly and vega libraries #309

merged 12 commits into from Mar 16, 2019


Copy link

@philippjfr philippjfr commented Mar 15, 2019

Previously I used some horrible code to load plotly and vega dynamically when the models are used. Not only is this horrible, it also doesn't seem to work when exported in a notebook. This PR instead uses the __javascript__ variable on the models, which loads vega and plotly js when the extension is loaded. To avoid it being loaded all the time these models are no longer imported by default, instead the corresponding Pane objects do the import dynamically. This works fine in server and commandline use cases but in the notebook the models need to be imported before the extension is run. Therefore I have added the ability to load these models via the extension, much like in holoviews. So you can now do pn.extension('vega') and it will load vega js in the notebook.

Copy link

@codecov-io codecov-io commented Mar 16, 2019

Codecov Report

Merging #309 into master will increase coverage by 0.17%.
The diff coverage is 73.46%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #309      +/-   ##
+ Coverage    89.1%   89.28%   +0.17%     
  Files          63       65       +2     
  Lines        6583     6617      +34     
+ Hits         5866     5908      +42     
+ Misses        717      709       -8
Impacted Files Coverage Δ
panel/models/ 100% <ø> (ø) ⬆️ 0% <0%> (ø) ⬆️
panel/tests/ 96.61% <100%> (ø) ⬆️
panel/tests/ 97.46% <100%> (ø) ⬆️
panel/pane/ 90.8% <100%> (+0.21%) ⬆️
panel/models/ 100% <100%> (ø)
panel/models/ 100% <100%> (ø)
panel/ 66.77% <20%> (-0.47%) ⬇️
panel/pane/ 86.95% <57.14%> (-3.52%) ⬇️
panel/pane/ 78.37% <70%> (-1.93%) ⬇️
... and 6 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b7c3a49...a6e9898. Read the comment docs.

@philippjfr philippjfr merged commit 966ca9a into master Mar 16, 2019
3 checks passed
@philippjfr philippjfr deleted the load_extensions branch Sep 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet

Successfully merging this pull request may close these issues.

None yet

3 participants