From e8ed513bddd3c0efaae019d677f9cd66d5229903 Mon Sep 17 00:00:00 2001 From: Vlad Babich Date: Thu, 29 Feb 2024 14:21:15 -0700 Subject: [PATCH] Fix widget arg type in the event handler, export DashboardPlugin as a named export next to the default WidgetPlugin --- .../plotly-express/src/js/src/DashboardPlugin.tsx | 12 ++++++------ plugins/plotly-express/src/js/src/index.ts | 5 +++++ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/plugins/plotly-express/src/js/src/DashboardPlugin.tsx b/plugins/plotly-express/src/js/src/DashboardPlugin.tsx index b60676e78..e0db8db6b 100644 --- a/plugins/plotly-express/src/js/src/DashboardPlugin.tsx +++ b/plugins/plotly-express/src/js/src/DashboardPlugin.tsx @@ -6,7 +6,7 @@ import { PanelEvent, useListener, } from '@deephaven/dashboard'; -import type { VariableDefinition } from '@deephaven/jsapi-types'; +import type { VariableDescriptor } from '@deephaven/jsapi-types'; import PlotlyExpressChartPanel from './PlotlyExpressChartPanel.js'; import type { PlotlyChartWidget } from './PlotlyExpressChartUtils.js'; @@ -27,9 +27,9 @@ export function DashboardPlugin( fetch: () => Promise; metadata?: Record; panelId?: string; - widget: VariableDefinition; + widget: VariableDescriptor; }) => { - const { type, title } = widget; + const { type, name } = widget; if (type !== 'deephaven.plot.express.DeephavenFigure') { return; } @@ -42,13 +42,13 @@ export function DashboardPlugin( id: panelId, metadata: { ...metadata, - name: title, - figure: title, + name, + figure: name, type, }, fetch, }, - title, + title: name, id: panelId, }; diff --git a/plugins/plotly-express/src/js/src/index.ts b/plugins/plotly-express/src/js/src/index.ts index 80db0344d..312a2bc95 100644 --- a/plugins/plotly-express/src/js/src/index.ts +++ b/plugins/plotly-express/src/js/src/index.ts @@ -1,3 +1,8 @@ +import { PlotlyExpressPlugin } from './PlotlyExpressPlugin.js'; + +// Export legacy dashboard plugin as named export for backwards compatibility export * from './DashboardPlugin.js'; export * from './PlotlyExpressChartModel.js'; export * from './PlotlyExpressChartUtils.js'; + +export default PlotlyExpressPlugin;