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

new vega lite version #1525

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions folium/features.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,8 @@ def render(self, **kwargs):
self._embed_vegalite_v2(figure)
elif vegalite_major_version == '3':
self._embed_vegalite_v3(figure)
elif vegalite_major_version == '4':
self._embed_vegalite_v4(figure)
else:
# Version 2 is assumed as the default, if no version is given in the schema.
self._embed_vegalite_v2(figure)
Expand All @@ -273,6 +275,13 @@ def _get_vegalite_major_versions(self, spec):

return major_version

def _embed_vegalite_v4(self, figure):
self._vega_embed()

figure.header.add_child(JavascriptLink('https://cdn.jsdelivr.net/npm//vega@5'), name='vega')
figure.header.add_child(JavascriptLink('https://cdn.jsdelivr.net/npm/vega-lite@4'), name='vega-lite')
figure.header.add_child(JavascriptLink('https://cdn.jsdelivr.net/npm/vega-embed@6'), name='vega-embed')

def _embed_vegalite_v3(self, figure):
self._vega_embed()

Expand Down