forked from vega/altair
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'altair-viz:main' into main
- Loading branch information
Showing
14 changed files
with
79,835 additions
and
99,314 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,11 @@ | ||
import vegaEmbed from "https://esm.sh/vega-embed@6?deps=vega@5&[email protected]"; | ||
import lodashDebounce from "https://esm.sh/[email protected]/debounce"; | ||
|
||
// Note: For offline support, the import lines above are removed and the remaining script | ||
// is bundled using vl-convert's javascript_bundle function. See the documentation of | ||
// the javascript_bundle function for details on the available imports and their names. | ||
// If an additional import is required in the future, it will need to be added to vl-convert | ||
// in order to preserve offline support. | ||
export async function render({ model, el }) { | ||
let finalize; | ||
|
||
|
@@ -30,10 +35,11 @@ export async function render({ model, el }) { | |
model.save_changes(); | ||
return; | ||
} | ||
let embedOptions = structuredClone(model.get("embed_options")) ?? undefined; | ||
|
||
let api; | ||
try { | ||
api = await vegaEmbed(el, spec); | ||
api = await vegaEmbed(el, spec, embedOptions); | ||
} catch (error) { | ||
showError(error) | ||
return; | ||
|
@@ -134,6 +140,7 @@ export async function render({ model, el }) { | |
} | ||
|
||
model.on('change:spec', reembed); | ||
model.on('change:embed_options', reembed); | ||
model.on('change:debounce_wait', reembed); | ||
model.on('change:max_wait', reembed); | ||
await reembed(); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.