Skip to content

Commit c695b8d

Browse files
committed
Update according to rabbit comments
1 parent 75ce3a2 commit c695b8d

File tree

1 file changed

+3
-3
lines changed
  • src/webviews/webview-side/vega-renderer

1 file changed

+3
-3
lines changed

src/webviews/webview-side/vega-renderer/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,10 @@ interface Metadata {
1111
}
1212

1313
/**
14-
* Renderer for Vega/Vega-Lite charts (application/vnd.vega.v5+json).
15-
* Currently renders static text representation of the chart spec.
14+
* Renderer for Vega charts (application/vnd.vega.v5+json).
1615
*/
1716
export const activate: ActivationFunction = (_context: RendererContext<unknown>) => {
18-
const elementsCache: Record<string, HTMLElement> = {};
17+
const elementsCache: Record<string, HTMLElement | undefined> = {};
1918
return {
2019
renderOutputItem(outputItem: OutputItem, element: HTMLElement) {
2120
console.log(`Vega renderer - rendering output item: ${outputItem.id}`);
@@ -52,6 +51,7 @@ export const activate: ActivationFunction = (_context: RendererContext<unknown>)
5251
disposeOutputItem(id?: string) {
5352
if (id && elementsCache[id]) {
5453
ReactDOM.unmountComponentAtNode(elementsCache[id]);
54+
elementsCache[id] = undefined;
5555
}
5656
}
5757
};

0 commit comments

Comments
 (0)