Skip to content

Commit

Permalink
Rename imports to match vl-convert's bundling convention (for future …
Browse files Browse the repository at this point in the history
…offline support)
  • Loading branch information
jonmmease committed Dec 16, 2023
1 parent 5a4bdd1 commit 059c6a5
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions altair/jupyter/js/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import embed from "https://esm.sh/vega-embed@6?deps=vega@5&[email protected]";
import debounce from "https://esm.sh/[email protected]/debounce";
import vegaEmbed from "https://esm.sh/vega-embed@6?deps=vega@5&[email protected]";
import lodashDebounce from "https://esm.sh/[email protected]/debounce";

export async function render({ model, el }) {
let finalize;
Expand Down Expand Up @@ -33,7 +33,7 @@ export async function render({ model, el }) {

let api;
try {
api = await embed(el, spec);
api = await vegaEmbed(el, spec);
} catch (error) {
showError(error)
return;
Expand All @@ -59,7 +59,7 @@ export async function render({ model, el }) {
model.set("_vl_selections", newSelections);
model.save_changes();
};
api.view.addSignalListener(selectionName, debounce(selectionHandler, wait, debounceOpts));
api.view.addSignalListener(selectionName, lodashDebounce(selectionHandler, wait, debounceOpts));

initialSelections[selectionName] = {
value: cleanJson(api.view.signal(selectionName) ?? {}),
Expand All @@ -76,7 +76,7 @@ export async function render({ model, el }) {
model.set("_params", newParams);
model.save_changes();
};
api.view.addSignalListener(paramName, debounce(paramHandler, wait, debounceOpts));
api.view.addSignalListener(paramName, lodashDebounce(paramHandler, wait, debounceOpts));

initialParams[paramName] = api.view.signal(paramName) ?? null
}
Expand All @@ -103,7 +103,7 @@ export async function render({ model, el }) {
}]);
model.save_changes();
};
addDataListener(api.view, watch.name, watch.scope, debounce(dataHandler, wait, debounceOpts))
addDataListener(api.view, watch.name, watch.scope, lodashDebounce(dataHandler, wait, debounceOpts))

} else if (watch.namespace === "signal") {
const signalHandler = (_, value) => {
Expand All @@ -116,7 +116,7 @@ export async function render({ model, el }) {
model.save_changes();
};

addSignalListener(api.view, watch.name, watch.scope, debounce(signalHandler, wait, debounceOpts))
addSignalListener(api.view, watch.name, watch.scope, lodashDebounce(signalHandler, wait, debounceOpts))
}
}

Expand Down

0 comments on commit 059c6a5

Please sign in to comment.