@deephaven/js-plugin-plotly-express 0.13.0 → 0.13.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +3 -3
- package/dist/DashboardPlugin.d.ts +0 -4
- package/dist/DashboardPlugin.d.ts.map +0 -1
- package/dist/DashboardPlugin.js +0 -39
- package/dist/DashboardPlugin.js.map +0 -1
- package/dist/PlotlyExpressChart.d.ts +0 -5
- package/dist/PlotlyExpressChart.d.ts.map +0 -1
- package/dist/PlotlyExpressChart.js +0 -38
- package/dist/PlotlyExpressChart.js.map +0 -1
- package/dist/PlotlyExpressChartModel.d.ts +0 -118
- package/dist/PlotlyExpressChartModel.d.ts.map +0 -1
- package/dist/PlotlyExpressChartModel.js +0 -474
- package/dist/PlotlyExpressChartModel.js.map +0 -1
- package/dist/PlotlyExpressChartPanel.d.ts +0 -5
- package/dist/PlotlyExpressChartPanel.d.ts.map +0 -1
- package/dist/PlotlyExpressChartPanel.js +0 -36
- package/dist/PlotlyExpressChartPanel.js.map +0 -1
- package/dist/PlotlyExpressChartUtils.d.ts +0 -123
- package/dist/PlotlyExpressChartUtils.d.ts.map +0 -1
- package/dist/PlotlyExpressChartUtils.js +0 -176
- package/dist/PlotlyExpressChartUtils.js.map +0 -1
- package/dist/PlotlyExpressPlugin.d.ts +0 -5
- package/dist/PlotlyExpressPlugin.d.ts.map +0 -1
- package/dist/PlotlyExpressPlugin.js +0 -14
- package/dist/PlotlyExpressPlugin.js.map +0 -1
- package/dist/index.d.ts +0 -6
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -7
- package/dist/index.js.map +0 -1
- package/dist/useHandleSceneTicks.d.ts +0 -4
- package/dist/useHandleSceneTicks.d.ts.map +0 -1
- package/dist/useHandleSceneTicks.js +0 -36
- package/dist/useHandleSceneTicks.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deephaven/js-plugin-plotly-express",
|
|
3
|
-
"version": "0.13.
|
|
3
|
+
"version": "0.13.1",
|
|
4
4
|
"description": "Deephaven plotly express plugin",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Deephaven",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"homepage": "https://github.com/deephaven/deephaven-plugins",
|
|
33
33
|
"scripts": {
|
|
34
34
|
"start": "vite build --watch",
|
|
35
|
-
"build": "
|
|
35
|
+
"build": "vite build",
|
|
36
36
|
"update-dh-packages": "node ../../../../tools/update-dh-packages.mjs"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
@@ -75,5 +75,5 @@
|
|
|
75
75
|
"files": [
|
|
76
76
|
"dist"
|
|
77
77
|
],
|
|
78
|
-
"gitHead": "
|
|
78
|
+
"gitHead": "ce5e3f17f34c71481c4588c868bae4b9835d2664"
|
|
79
79
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DashboardPlugin.d.ts","sourceRoot":"","sources":["../src/DashboardPlugin.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,6BAA6B,EAI9B,MAAM,sBAAsB,CAAC;AAK9B,wBAAgB,eAAe,CAC7B,KAAK,EAAE,6BAA6B,GACnC,GAAG,CAAC,OAAO,GAAG,IAAI,CA4DpB;AAED,eAAe,eAAe,CAAC"}
|
package/dist/DashboardPlugin.js
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { useCallback, useEffect } from 'react';
|
|
2
|
-
import { nanoid } from 'nanoid';
|
|
3
|
-
import { LayoutUtils, PanelEvent, useListener, } from '@deephaven/dashboard';
|
|
4
|
-
import PlotlyExpressChartPanel from './PlotlyExpressChartPanel.js';
|
|
5
|
-
export function DashboardPlugin(props) {
|
|
6
|
-
const { id, layout, registerComponent } = props;
|
|
7
|
-
const handlePanelOpen = useCallback(async ({ dragEvent, fetch, metadata = {}, panelId = nanoid(), widget, }) => {
|
|
8
|
-
const { type, name } = widget;
|
|
9
|
-
if (type !== 'deephaven.plot.express.DeephavenFigure') {
|
|
10
|
-
return;
|
|
11
|
-
}
|
|
12
|
-
const config = {
|
|
13
|
-
type: 'react-component',
|
|
14
|
-
component: 'PlotlyPanel',
|
|
15
|
-
props: {
|
|
16
|
-
localDashboardId: id,
|
|
17
|
-
id: panelId,
|
|
18
|
-
metadata: Object.assign(Object.assign(Object.assign({}, metadata), widget), { figure: name }),
|
|
19
|
-
fetch,
|
|
20
|
-
},
|
|
21
|
-
title: name !== null && name !== void 0 ? name : undefined,
|
|
22
|
-
id: panelId,
|
|
23
|
-
};
|
|
24
|
-
const { root } = layout;
|
|
25
|
-
LayoutUtils.openComponent({ root, config, dragEvent });
|
|
26
|
-
}, [id, layout]);
|
|
27
|
-
useEffect(function registerComponentsAndReturnCleanup() {
|
|
28
|
-
const cleanups = [
|
|
29
|
-
registerComponent('PlotlyPanel', PlotlyExpressChartPanel),
|
|
30
|
-
];
|
|
31
|
-
return () => {
|
|
32
|
-
cleanups.forEach(cleanup => cleanup());
|
|
33
|
-
};
|
|
34
|
-
}, [registerComponent]);
|
|
35
|
-
useListener(layout.eventHub, PanelEvent.OPEN, handlePanelOpen);
|
|
36
|
-
return null;
|
|
37
|
-
}
|
|
38
|
-
export default DashboardPlugin;
|
|
39
|
-
//# sourceMappingURL=DashboardPlugin.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DashboardPlugin.js","sourceRoot":"","sources":["../src/DashboardPlugin.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAEL,WAAW,EACX,UAAU,EACV,WAAW,GACZ,MAAM,sBAAsB,CAAC;AAE9B,OAAO,uBAAuB,MAAM,8BAA8B,CAAC;AAGnE,MAAM,UAAU,eAAe,CAC7B,KAAoC;IAEpC,MAAM,EAAE,EAAE,EAAE,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AED,eAAe,eAAe,CAAC"}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { dh } from '@deephaven/jsapi-types';
|
|
2
|
-
import { type WidgetComponentProps } from '@deephaven/plugin';
|
|
3
|
-
export declare function PlotlyExpressChart(props: WidgetComponentProps<dh.Widget>): JSX.Element | null;
|
|
4
|
-
export default PlotlyExpressChart;
|
|
5
|
-
//# sourceMappingURL=PlotlyExpressChart.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PlotlyExpressChart.d.ts","sourceRoot":"","sources":["../src/PlotlyExpressChart.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,KAAK,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAM9D,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,oBAAoB,CAAC,EAAE,CAAC,MAAM,CAAC,GACrC,GAAG,CAAC,OAAO,GAAG,IAAI,CAsCpB;AAED,eAAe,kBAAkB,CAAC"}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useEffect, useRef, useState } from 'react';
|
|
3
|
-
import { useSelector } from 'react-redux';
|
|
4
|
-
import Plotly from 'plotly.js-dist-min';
|
|
5
|
-
import { Chart } from '@deephaven/chart';
|
|
6
|
-
import { useApi } from '@deephaven/jsapi-bootstrap';
|
|
7
|
-
import { getSettings } from '@deephaven/redux';
|
|
8
|
-
import PlotlyExpressChartModel from './PlotlyExpressChartModel.js';
|
|
9
|
-
import { useHandleSceneTicks } from './useHandleSceneTicks.js';
|
|
10
|
-
export function PlotlyExpressChart(props) {
|
|
11
|
-
const dh = useApi();
|
|
12
|
-
const { fetch } = props;
|
|
13
|
-
const containerRef = useRef(null);
|
|
14
|
-
const [model, setModel] = useState();
|
|
15
|
-
const settings = useSelector((getSettings));
|
|
16
|
-
const [widgetRevision, setWidgetRevision] = useState(0); // Used to force a clean chart state on widget change
|
|
17
|
-
useEffect(() => {
|
|
18
|
-
let cancelled = false;
|
|
19
|
-
async function init() {
|
|
20
|
-
const widgetData = await fetch();
|
|
21
|
-
if (!cancelled) {
|
|
22
|
-
setModel(new PlotlyExpressChartModel(dh, widgetData, fetch));
|
|
23
|
-
setWidgetRevision(r => r + 1);
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
init();
|
|
27
|
-
return () => {
|
|
28
|
-
cancelled = true;
|
|
29
|
-
};
|
|
30
|
-
}, [dh, fetch]);
|
|
31
|
-
useHandleSceneTicks(model, containerRef.current);
|
|
32
|
-
return model ? (_jsx(Chart
|
|
33
|
-
// eslint-disable-next-line react/jsx-props-no-spreading, @typescript-eslint/ban-ts-comment
|
|
34
|
-
// @ts-ignore
|
|
35
|
-
, { containerRef: containerRef, model: model, settings: settings, Plotly: Plotly }, widgetRevision)) : null;
|
|
36
|
-
}
|
|
37
|
-
export default PlotlyExpressChart;
|
|
38
|
-
//# sourceMappingURL=PlotlyExpressChart.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PlotlyExpressChart.js","sourceRoot":"","sources":["../src/PlotlyExpressChart.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,MAAM,MAAM,oBAAoB,CAAC;AACxC,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAGzC,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACpD,OAAO,EAAE,WAAW,EAAkB,MAAM,kBAAkB,CAAC;AAC/D,OAAO,uBAAuB,MAAM,8BAA8B,CAAC;AACnE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAE/D,MAAM,UAAU,kBAAkB,CAChC,KAAsC;IA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-1,118 +0,0 @@
|
|
|
1
|
-
import type { Layout, Data } from 'plotly.js';
|
|
2
|
-
import type { dh as DhType } from '@deephaven/jsapi-types';
|
|
3
|
-
import { ChartModel, ChartUtils } from '@deephaven/chart';
|
|
4
|
-
import { RenderOptions } from '@deephaven/chart/dist/ChartModel';
|
|
5
|
-
import { DownsampleInfo, PlotlyChartWidgetData } from './PlotlyExpressChartUtils';
|
|
6
|
-
export declare class PlotlyExpressChartModel extends ChartModel {
|
|
7
|
-
/**
|
|
8
|
-
* The size at which the chart will automatically downsample the data if it can be downsampled.
|
|
9
|
-
* If it cannot be downsampled, but the size is below MAX_FETCH_SIZE,
|
|
10
|
-
* the chart will show a confirmation to fetch the data since it might be a slow operation.
|
|
11
|
-
*/
|
|
12
|
-
static AUTO_DOWNSAMPLE_SIZE: number;
|
|
13
|
-
/**
|
|
14
|
-
* The maximum number of items that can be fetched from a table.
|
|
15
|
-
* If a table is larger than this, the chart will not be fetched.
|
|
16
|
-
* This is to prevent the chart from fetching too much data and crashing the browser.
|
|
17
|
-
*/
|
|
18
|
-
static MAX_FETCH_SIZE: number;
|
|
19
|
-
static canFetch(table: DhType.Table): boolean;
|
|
20
|
-
constructor(dh: typeof DhType, widget: DhType.Widget, refetch: () => Promise<DhType.Widget>);
|
|
21
|
-
isSubscribed: boolean;
|
|
22
|
-
chartUtils: ChartUtils;
|
|
23
|
-
refetch: () => Promise<DhType.Widget>;
|
|
24
|
-
widget?: DhType.Widget;
|
|
25
|
-
widgetUnsubscribe?: () => void;
|
|
26
|
-
/**
|
|
27
|
-
* Map of table index to Table object.
|
|
28
|
-
*/
|
|
29
|
-
tableReferenceMap: Map<number, DhType.Table>;
|
|
30
|
-
/**
|
|
31
|
-
* Map of downsampled table indexes to original Table object.
|
|
32
|
-
*/
|
|
33
|
-
downsampleMap: Map<number, DownsampleInfo>;
|
|
34
|
-
/**
|
|
35
|
-
* Map of table index to TableSubscription object.
|
|
36
|
-
*/
|
|
37
|
-
tableSubscriptionMap: Map<number, DhType.TableSubscription>;
|
|
38
|
-
/**
|
|
39
|
-
* Map of table index to cleanup function for the subscription.
|
|
40
|
-
*/
|
|
41
|
-
subscriptionCleanupMap: Map<number, () => void>;
|
|
42
|
-
/**
|
|
43
|
-
* Map of table index to map of column names to array of paths where the data should be replaced.
|
|
44
|
-
*/
|
|
45
|
-
tableColumnReplacementMap: Map<number, Map<string, string[]>>;
|
|
46
|
-
/**
|
|
47
|
-
* Map of table index to ChartData object. Used to handle data delta updates.
|
|
48
|
-
*/
|
|
49
|
-
chartDataMap: Map<number, DhType.plot.ChartData>;
|
|
50
|
-
/**
|
|
51
|
-
* Map of table index to object where the keys are column names and the values are arrays of data.
|
|
52
|
-
* This data is the full array of data for the column since ChartData doesn't have a clean way to get it at any time.
|
|
53
|
-
*/
|
|
54
|
-
tableDataMap: Map<number, {
|
|
55
|
-
[key: string]: unknown[];
|
|
56
|
-
}>;
|
|
57
|
-
plotlyData: Data[];
|
|
58
|
-
layout: Partial<Layout>;
|
|
59
|
-
isPaused: boolean;
|
|
60
|
-
hasPendingUpdate: boolean;
|
|
61
|
-
hasInitialLoadCompleted: boolean;
|
|
62
|
-
isDownsamplingDisabled: boolean;
|
|
63
|
-
/**
|
|
64
|
-
* Set of traces that are originally WebGL and can be replaced with non-WebGL traces.
|
|
65
|
-
* These need to be replaced if WebGL is disabled and re-enabled if WebGL is enabled again.
|
|
66
|
-
*/
|
|
67
|
-
webGlTraceIndices: Set<number>;
|
|
68
|
-
/**
|
|
69
|
-
* The WebGl warning is only shown once per chart. When the user acknowledges the warning, it will not be shown again.
|
|
70
|
-
*/
|
|
71
|
-
hasAcknowledgedWebGlWarning: boolean;
|
|
72
|
-
getData(): Partial<Data>[];
|
|
73
|
-
getLayout(): Partial<Layout>;
|
|
74
|
-
close(): void;
|
|
75
|
-
subscribe(callback: (event: CustomEvent) => void): Promise<void>;
|
|
76
|
-
unsubscribe(callback: (event: CustomEvent) => void): void;
|
|
77
|
-
setRenderOptions(renderOptions: RenderOptions): void;
|
|
78
|
-
/**
|
|
79
|
-
* Handle the WebGL option being set in the render options.
|
|
80
|
-
* If WebGL is enabled, traces have their original types as given.
|
|
81
|
-
* If WebGL is disabled, replace traces that require WebGL with non-WebGL traces if possible.
|
|
82
|
-
* Also, show a dismissible warning per-chart if there are WebGL traces that cannot be replaced.
|
|
83
|
-
* @param webgl The new WebGL value. True if WebGL is enabled.
|
|
84
|
-
* @param prevWebgl The previous WebGL value
|
|
85
|
-
*/
|
|
86
|
-
handleWebGlAllowed(webgl?: boolean, prevWebgl?: boolean): void;
|
|
87
|
-
fireBlockerClear(isAcknowledged?: boolean): void;
|
|
88
|
-
updateLayout(data: PlotlyChartWidgetData): void;
|
|
89
|
-
handleWidgetUpdated(data: PlotlyChartWidgetData, references: DhType.Widget['exportedObjects']): void;
|
|
90
|
-
handleFigureUpdated(event: CustomEvent<DhType.SubscriptionTableData>, tableId: number): void;
|
|
91
|
-
addTable(id: number, table: DhType.Table): Promise<void>;
|
|
92
|
-
updateDownsampledTable(id: number): Promise<void>;
|
|
93
|
-
setDownsamplingDisabled(isDownsamplingDisabled: boolean): void;
|
|
94
|
-
/**
|
|
95
|
-
* Gets info on how to downsample a table for plotting.
|
|
96
|
-
* @param tableId The tableId to get downsample info for
|
|
97
|
-
* @param table The table to get downsample info for
|
|
98
|
-
* @returns DownsampleInfo if table can be downsampled.
|
|
99
|
-
* A string of the reason if the table cannot be downsampled.
|
|
100
|
-
* Null if the table does not need downsampling.
|
|
101
|
-
*/
|
|
102
|
-
getDownsampleInfo(tableId: number, table: DhType.Table): DownsampleInfo | string;
|
|
103
|
-
subscribeTable(id: number): void;
|
|
104
|
-
removeTable(id: number): void;
|
|
105
|
-
fireUpdate(data: unknown): void;
|
|
106
|
-
setDimensions(rect: DOMRect): void;
|
|
107
|
-
pauseUpdates(): void;
|
|
108
|
-
resumeUpdates(): void;
|
|
109
|
-
shouldPauseOnUserInteraction(): boolean;
|
|
110
|
-
hasScene(): boolean;
|
|
111
|
-
hasGeo(): boolean;
|
|
112
|
-
hasMapbox(): boolean;
|
|
113
|
-
hasPolar(): boolean;
|
|
114
|
-
getPlotWidth(): number;
|
|
115
|
-
getPlotHeight(): number;
|
|
116
|
-
}
|
|
117
|
-
export default PlotlyExpressChartModel;
|
|
118
|
-
//# sourceMappingURL=PlotlyExpressChartModel.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PlotlyExpressChartModel.d.ts","sourceRoot":"","sources":["../src/PlotlyExpressChartModel.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,IAAI,EAAwB,MAAM,WAAW,CAAC;AACpE,OAAO,KAAK,EAAE,EAAE,IAAI,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE1D,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACjE,OAAO,EACL,cAAc,EACd,qBAAqB,EAatB,MAAM,2BAA2B,CAAC;AAInC,qBAAa,uBAAwB,SAAQ,UAAU;IACrD;;;;OAIG;IACH,MAAM,CAAC,oBAAoB,SAAU;IAErC;;;;OAIG;IACH,MAAM,CAAC,cAAc,SAAa;IAElC,MAAM,CAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,KAAK,GAAG,OAAO;gBAK3C,EAAE,EAAE,OAAO,MAAM,EACjB,MAAM,EAAE,MAAM,CAAC,MAAM,EACrB,OAAO,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC;IAkBvC,YAAY,UAAS;IAErB,UAAU,EAAE,UAAU,CAAC;IAEvB,OAAO,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAEtC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,CAAC;IAEvB,iBAAiB,CAAC,EAAE,MAAM,IAAI,CAAC;IAE/B;;OAEG;IACH,iBAAiB,EAA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}
|
|
@@ -1,474 +0,0 @@
|
|
|
1
|
-
import { ChartModel, ChartUtils } from '@deephaven/chart';
|
|
2
|
-
import Log from '@deephaven/log';
|
|
3
|
-
import { areSameAxisRange, downsample, getDataMappings, getPathParts, getReplaceableWebGlTraceIndices, getWidgetData, isAutoAxis, isLineSeries, isLinearAxis, removeColorsFromData, setWebGlTraceType, hasUnreplaceableWebGlTraces, } from './PlotlyExpressChartUtils';
|
|
4
|
-
const log = Log.module('@deephaven/js-plugin-plotly-express.ChartModel');
|
|
5
|
-
export class PlotlyExpressChartModel extends ChartModel {
|
|
6
|
-
static canFetch(table) {
|
|
7
|
-
return table.size <= PlotlyExpressChartModel.MAX_FETCH_SIZE;
|
|
8
|
-
}
|
|
9
|
-
constructor(dh, widget, refetch) {
|
|
10
|
-
super(dh);
|
|
11
|
-
this.isSubscribed = false;
|
|
12
|
-
/**
|
|
13
|
-
* Map of table index to Table object.
|
|
14
|
-
*/
|
|
15
|
-
this.tableReferenceMap = new Map();
|
|
16
|
-
/**
|
|
17
|
-
* Map of downsampled table indexes to original Table object.
|
|
18
|
-
*/
|
|
19
|
-
this.downsampleMap = new Map();
|
|
20
|
-
/**
|
|
21
|
-
* Map of table index to TableSubscription object.
|
|
22
|
-
*/
|
|
23
|
-
this.tableSubscriptionMap = new Map();
|
|
24
|
-
/**
|
|
25
|
-
* Map of table index to cleanup function for the subscription.
|
|
26
|
-
*/
|
|
27
|
-
this.subscriptionCleanupMap = new Map();
|
|
28
|
-
/**
|
|
29
|
-
* Map of table index to map of column names to array of paths where the data should be replaced.
|
|
30
|
-
*/
|
|
31
|
-
this.tableColumnReplacementMap = new Map();
|
|
32
|
-
/**
|
|
33
|
-
* Map of table index to ChartData object. Used to handle data delta updates.
|
|
34
|
-
*/
|
|
35
|
-
this.chartDataMap = new Map();
|
|
36
|
-
/**
|
|
37
|
-
* Map of table index to object where the keys are column names and the values are arrays of data.
|
|
38
|
-
* This data is the full array of data for the column since ChartData doesn't have a clean way to get it at any time.
|
|
39
|
-
*/
|
|
40
|
-
this.tableDataMap = new Map();
|
|
41
|
-
this.plotlyData = [];
|
|
42
|
-
this.layout = {};
|
|
43
|
-
this.isPaused = false;
|
|
44
|
-
this.hasPendingUpdate = false;
|
|
45
|
-
this.hasInitialLoadCompleted = false;
|
|
46
|
-
this.isDownsamplingDisabled = false;
|
|
47
|
-
/**
|
|
48
|
-
* Set of traces that are originally WebGL and can be replaced with non-WebGL traces.
|
|
49
|
-
* These need to be replaced if WebGL is disabled and re-enabled if WebGL is enabled again.
|
|
50
|
-
*/
|
|
51
|
-
this.webGlTraceIndices = new Set();
|
|
52
|
-
/**
|
|
53
|
-
* The WebGl warning is only shown once per chart. When the user acknowledges the warning, it will not be shown again.
|
|
54
|
-
*/
|
|
55
|
-
this.hasAcknowledgedWebGlWarning = false;
|
|
56
|
-
this.widget = widget;
|
|
57
|
-
this.refetch = refetch;
|
|
58
|
-
this.chartUtils = new ChartUtils(dh);
|
|
59
|
-
this.handleFigureUpdated = this.handleFigureUpdated.bind(this);
|
|
60
|
-
this.handleWidgetUpdated = this.handleWidgetUpdated.bind(this);
|
|
61
|
-
// Chart only fetches the model layout once on init, so it needs to be set
|
|
62
|
-
// before the widget is subscribed to.
|
|
63
|
-
this.updateLayout(getWidgetData(widget));
|
|
64
|
-
this.setTitle(this.getDefaultTitle());
|
|
65
|
-
}
|
|
66
|
-
getData() {
|
|
67
|
-
const hydratedData = [...this.plotlyData];
|
|
68
|
-
this.tableColumnReplacementMap.forEach((columnReplacements, tableId) => {
|
|
69
|
-
const tableData = this.tableDataMap.get(tableId);
|
|
70
|
-
if (tableData == null) {
|
|
71
|
-
throw new Error(`No tableData for table ID ${tableId}`);
|
|
72
|
-
}
|
|
73
|
-
// Replace placeholder arrays with actual data
|
|
74
|
-
columnReplacements.forEach((paths, columnName) => {
|
|
75
|
-
paths.forEach(destination => {
|
|
76
|
-
var _a;
|
|
77
|
-
// The JSON pointer starts w/ /plotly/data and we don't need that part
|
|
78
|
-
const parts = getPathParts(destination);
|
|
79
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
80
|
-
let selector = hydratedData;
|
|
81
|
-
for (let i = 0; i < parts.length; i += 1) {
|
|
82
|
-
if (i !== parts.length - 1) {
|
|
83
|
-
selector = selector[parts[i]];
|
|
84
|
-
}
|
|
85
|
-
else {
|
|
86
|
-
selector[parts[i]] = (_a = tableData[columnName]) !== null && _a !== void 0 ? _a : [];
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
});
|
|
90
|
-
});
|
|
91
|
-
});
|
|
92
|
-
return hydratedData;
|
|
93
|
-
}
|
|
94
|
-
getLayout() {
|
|
95
|
-
return this.layout;
|
|
96
|
-
}
|
|
97
|
-
close() {
|
|
98
|
-
var _a;
|
|
99
|
-
super.close();
|
|
100
|
-
(_a = this.widget) === null || _a === void 0 ? void 0 : _a.close();
|
|
101
|
-
this.widget = undefined;
|
|
102
|
-
}
|
|
103
|
-
async subscribe(callback) {
|
|
104
|
-
if (this.isSubscribed) {
|
|
105
|
-
log.debug('already subscribed');
|
|
106
|
-
return;
|
|
107
|
-
}
|
|
108
|
-
log.debug('subscribing');
|
|
109
|
-
super.subscribe(callback);
|
|
110
|
-
if (this.widget == null) {
|
|
111
|
-
this.widget = await this.refetch();
|
|
112
|
-
}
|
|
113
|
-
const widgetData = getWidgetData(this.widget);
|
|
114
|
-
this.handleWidgetUpdated(widgetData, this.widget.exportedObjects);
|
|
115
|
-
this.isSubscribed = true;
|
|
116
|
-
this.widgetUnsubscribe = this.widget.addEventListener(this.dh.Widget.EVENT_MESSAGE, ({ detail }) => {
|
|
117
|
-
this.handleWidgetUpdated(JSON.parse(detail.getDataAsString()), detail.exportedObjects);
|
|
118
|
-
});
|
|
119
|
-
this.tableReferenceMap.forEach((_, id) => this.subscribeTable(id));
|
|
120
|
-
// If there are no tables to fetch data from, the chart is ready to render
|
|
121
|
-
// Normally this event only fires once at least 1 table has fetched data
|
|
122
|
-
// Without this, the chart shows an infinite loader if there are no tables
|
|
123
|
-
if (this.tableColumnReplacementMap.size === 0) {
|
|
124
|
-
this.fireUpdate(this.getData());
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
unsubscribe(callback) {
|
|
128
|
-
var _a, _b;
|
|
129
|
-
if (!this.isSubscribed) {
|
|
130
|
-
return;
|
|
131
|
-
}
|
|
132
|
-
super.unsubscribe(callback);
|
|
133
|
-
(_a = this.widgetUnsubscribe) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
134
|
-
this.isSubscribed = false;
|
|
135
|
-
this.tableReferenceMap.forEach((_, id) => this.removeTable(id));
|
|
136
|
-
(_b = this.widget) === null || _b === void 0 ? void 0 : _b.close();
|
|
137
|
-
this.widget = undefined;
|
|
138
|
-
}
|
|
139
|
-
setRenderOptions(renderOptions) {
|
|
140
|
-
var _a;
|
|
141
|
-
this.handleWebGlAllowed(renderOptions.webgl, (_a = this.renderOptions) === null || _a === void 0 ? void 0 : _a.webgl);
|
|
142
|
-
super.setRenderOptions(renderOptions);
|
|
143
|
-
}
|
|
144
|
-
/**
|
|
145
|
-
* Handle the WebGL option being set in the render options.
|
|
146
|
-
* If WebGL is enabled, traces have their original types as given.
|
|
147
|
-
* If WebGL is disabled, replace traces that require WebGL with non-WebGL traces if possible.
|
|
148
|
-
* Also, show a dismissible warning per-chart if there are WebGL traces that cannot be replaced.
|
|
149
|
-
* @param webgl The new WebGL value. True if WebGL is enabled.
|
|
150
|
-
* @param prevWebgl The previous WebGL value
|
|
151
|
-
*/
|
|
152
|
-
handleWebGlAllowed(webgl = true, prevWebgl = true) {
|
|
153
|
-
setWebGlTraceType(this.plotlyData, webgl, this.webGlTraceIndices);
|
|
154
|
-
const needsBlocker = hasUnreplaceableWebGlTraces(this.plotlyData);
|
|
155
|
-
// If WebGL is disabled and there are traces that require WebGL, show a warning that is dismissible on a per-chart basis
|
|
156
|
-
if (needsBlocker && !webgl && !this.hasAcknowledgedWebGlWarning) {
|
|
157
|
-
this.fireBlocker([
|
|
158
|
-
'WebGL is disabled but this chart cannot render without it. Check the Advanced section in the settings to enable WebGL or click below to render with WebGL for this chart.',
|
|
159
|
-
]);
|
|
160
|
-
}
|
|
161
|
-
else if (webgl && !prevWebgl && needsBlocker) {
|
|
162
|
-
// clear the blocker but not the acknowledged flag in case WebGL is disabled again
|
|
163
|
-
this.fireBlockerClear(false);
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
fireBlockerClear(isAcknowledged = true) {
|
|
167
|
-
super.fireBlockerClear();
|
|
168
|
-
this.hasAcknowledgedWebGlWarning =
|
|
169
|
-
isAcknowledged || this.hasAcknowledgedWebGlWarning;
|
|
170
|
-
}
|
|
171
|
-
updateLayout(data) {
|
|
172
|
-
const { figure } = data;
|
|
173
|
-
const { plotly } = figure;
|
|
174
|
-
const { layout: plotlyLayout = {} } = plotly;
|
|
175
|
-
// @deephaven/chart Chart component mutates the layout
|
|
176
|
-
// If we want updates like the zoom range, we must only set the layout once on init
|
|
177
|
-
if (Object.keys(this.layout).length > 0) {
|
|
178
|
-
return;
|
|
179
|
-
}
|
|
180
|
-
this.layout = Object.assign({}, plotlyLayout);
|
|
181
|
-
}
|
|
182
|
-
handleWidgetUpdated(data, references) {
|
|
183
|
-
var _a, _b, _c, _d;
|
|
184
|
-
log.debug('handleWidgetUpdated', data, references);
|
|
185
|
-
const { figure, new_references: newReferences, removed_references: removedReferences, } = data;
|
|
186
|
-
const { plotly, deephaven } = figure;
|
|
187
|
-
const { layout: plotlyLayout = {} } = plotly;
|
|
188
|
-
this.tableColumnReplacementMap = getDataMappings(data);
|
|
189
|
-
this.plotlyData = plotly.data;
|
|
190
|
-
if (!deephaven.is_user_set_template) {
|
|
191
|
-
removeColorsFromData((_c = (_b = (_a = plotlyLayout === null || plotlyLayout === void 0 ? void 0 : plotlyLayout.template) === null || _a === void 0 ? void 0 : _a.layout) === null || _b === void 0 ? void 0 : _b.colorway) !== null && _c !== void 0 ? _c : [], this.plotlyData);
|
|
192
|
-
}
|
|
193
|
-
// Retrieve the indexes of traces that require WebGL so they can be replaced if WebGL is disabled
|
|
194
|
-
this.webGlTraceIndices = getReplaceableWebGlTraceIndices(this.plotlyData);
|
|
195
|
-
this.handleWebGlAllowed((_d = this.renderOptions) === null || _d === void 0 ? void 0 : _d.webgl);
|
|
196
|
-
newReferences.forEach(async (id, i) => {
|
|
197
|
-
this.tableDataMap.set(id, {}); // Plot may render while tables are being fetched. Set this to avoid a render error
|
|
198
|
-
const table = (await references[i].fetch());
|
|
199
|
-
this.addTable(id, table);
|
|
200
|
-
});
|
|
201
|
-
removedReferences.forEach(id => this.removeTable(id));
|
|
202
|
-
}
|
|
203
|
-
handleFigureUpdated(event, tableId) {
|
|
204
|
-
const chartData = this.chartDataMap.get(tableId);
|
|
205
|
-
const tableData = this.tableDataMap.get(tableId);
|
|
206
|
-
if (chartData == null) {
|
|
207
|
-
log.warn('Unknown chartData for this event. Skipping update');
|
|
208
|
-
return;
|
|
209
|
-
}
|
|
210
|
-
if (tableData == null) {
|
|
211
|
-
log.warn('No tableData for this event. Skipping update');
|
|
212
|
-
return;
|
|
213
|
-
}
|
|
214
|
-
const { detail: figureUpdateEvent } = event;
|
|
215
|
-
chartData.update(figureUpdateEvent);
|
|
216
|
-
figureUpdateEvent.columns.forEach(column => {
|
|
217
|
-
const columnData = chartData.getColumn(column.name, this.chartUtils.unwrapValue, figureUpdateEvent);
|
|
218
|
-
tableData[column.name] = columnData;
|
|
219
|
-
});
|
|
220
|
-
if (this.isPaused) {
|
|
221
|
-
this.hasPendingUpdate = true;
|
|
222
|
-
return;
|
|
223
|
-
}
|
|
224
|
-
this.fireUpdate(this.getData());
|
|
225
|
-
}
|
|
226
|
-
async addTable(id, table) {
|
|
227
|
-
if (this.tableReferenceMap.has(id)) {
|
|
228
|
-
return;
|
|
229
|
-
}
|
|
230
|
-
let tableToAdd = table;
|
|
231
|
-
const downsampleInfo = this.getDownsampleInfo(id, table);
|
|
232
|
-
const needsDownsample = table.size > PlotlyExpressChartModel.AUTO_DOWNSAMPLE_SIZE;
|
|
233
|
-
const canDownsample = typeof downsampleInfo !== 'string';
|
|
234
|
-
const canFetch = PlotlyExpressChartModel.canFetch(table);
|
|
235
|
-
const shouldDownsample = needsDownsample && !this.isDownsamplingDisabled;
|
|
236
|
-
if (!canDownsample) {
|
|
237
|
-
if (!canFetch) {
|
|
238
|
-
log.debug(`Table ${id} too big to fetch ${table.size} items`);
|
|
239
|
-
this.fireDownsampleFail(`Too many items to plot: ${Number(table.size).toLocaleString()} items.`);
|
|
240
|
-
return;
|
|
241
|
-
}
|
|
242
|
-
if (shouldDownsample) {
|
|
243
|
-
this.fireDownsampleFail(downsampleInfo);
|
|
244
|
-
return;
|
|
245
|
-
}
|
|
246
|
-
}
|
|
247
|
-
if (canDownsample && needsDownsample) {
|
|
248
|
-
this.downsampleMap.set(id, downsampleInfo);
|
|
249
|
-
try {
|
|
250
|
-
this.fireDownsampleStart(null);
|
|
251
|
-
tableToAdd = await downsample(this.dh, downsampleInfo);
|
|
252
|
-
this.fireDownsampleFinish(null);
|
|
253
|
-
}
|
|
254
|
-
catch (e) {
|
|
255
|
-
this.fireDownsampleFail(e);
|
|
256
|
-
return;
|
|
257
|
-
}
|
|
258
|
-
}
|
|
259
|
-
this.tableReferenceMap.set(id, tableToAdd);
|
|
260
|
-
this.tableDataMap.set(id, {});
|
|
261
|
-
if (this.isSubscribed) {
|
|
262
|
-
this.subscribeTable(id);
|
|
263
|
-
}
|
|
264
|
-
}
|
|
265
|
-
async updateDownsampledTable(id) {
|
|
266
|
-
var _a, _b;
|
|
267
|
-
const oldDownsampleInfo = this.downsampleMap.get(id);
|
|
268
|
-
if (oldDownsampleInfo == null) {
|
|
269
|
-
log.error(`No table found for id ${id}`);
|
|
270
|
-
return;
|
|
271
|
-
}
|
|
272
|
-
const downsampleInfo = this.getDownsampleInfo(id, oldDownsampleInfo.originalTable);
|
|
273
|
-
if (typeof downsampleInfo === 'string') {
|
|
274
|
-
this.fireDownsampleFail(downsampleInfo);
|
|
275
|
-
return;
|
|
276
|
-
}
|
|
277
|
-
if (areSameAxisRange(downsampleInfo.range, oldDownsampleInfo.range) &&
|
|
278
|
-
downsampleInfo.width === oldDownsampleInfo.width) {
|
|
279
|
-
log.debug('Range and width are the same, skipping downsample');
|
|
280
|
-
return;
|
|
281
|
-
}
|
|
282
|
-
log.debug('Updating downsampled table', downsampleInfo);
|
|
283
|
-
this.fireDownsampleStart(null);
|
|
284
|
-
(_a = this.subscriptionCleanupMap.get(id)) === null || _a === void 0 ? void 0 : _a();
|
|
285
|
-
(_b = this.tableSubscriptionMap.get(id)) === null || _b === void 0 ? void 0 : _b.close();
|
|
286
|
-
this.subscriptionCleanupMap.delete(id);
|
|
287
|
-
this.tableSubscriptionMap.delete(id);
|
|
288
|
-
this.tableReferenceMap.delete(id);
|
|
289
|
-
this.addTable(id, oldDownsampleInfo.originalTable);
|
|
290
|
-
}
|
|
291
|
-
setDownsamplingDisabled(isDownsamplingDisabled) {
|
|
292
|
-
this.isDownsamplingDisabled = isDownsamplingDisabled;
|
|
293
|
-
if (isDownsamplingDisabled && this.widget != null) {
|
|
294
|
-
const widgetData = getWidgetData(this.widget);
|
|
295
|
-
this.handleWidgetUpdated(widgetData, this.widget.exportedObjects);
|
|
296
|
-
this.fireDownsampleFinish(null);
|
|
297
|
-
}
|
|
298
|
-
}
|
|
299
|
-
/**
|
|
300
|
-
* Gets info on how to downsample a table for plotting.
|
|
301
|
-
* @param tableId The tableId to get downsample info for
|
|
302
|
-
* @param table The table to get downsample info for
|
|
303
|
-
* @returns DownsampleInfo if table can be downsampled.
|
|
304
|
-
* A string of the reason if the table cannot be downsampled.
|
|
305
|
-
* Null if the table does not need downsampling.
|
|
306
|
-
*/
|
|
307
|
-
getDownsampleInfo(tableId, table) {
|
|
308
|
-
var _a, _b, _c;
|
|
309
|
-
const downsampleFailMessage = `Plotting ${Number(table.size).toLocaleString()} items may be slow.\nAre you sure you want to continue?`;
|
|
310
|
-
const replacementMap = this.tableColumnReplacementMap.get(tableId);
|
|
311
|
-
if (!replacementMap) {
|
|
312
|
-
return 'Nothing to downsample';
|
|
313
|
-
}
|
|
314
|
-
const areAllLines = [...replacementMap.values()]
|
|
315
|
-
.flat()
|
|
316
|
-
.map(path => getPathParts(path)[0])
|
|
317
|
-
.every(seriesIndex => {
|
|
318
|
-
const series = this.plotlyData[parseInt(seriesIndex, 10)];
|
|
319
|
-
return series != null && isLineSeries(series);
|
|
320
|
-
});
|
|
321
|
-
if (!areAllLines) {
|
|
322
|
-
log.debug('Cannot downsample non-line series');
|
|
323
|
-
return downsampleFailMessage;
|
|
324
|
-
}
|
|
325
|
-
let xCol = '';
|
|
326
|
-
let xAxis;
|
|
327
|
-
const yCols = [];
|
|
328
|
-
const replacementEntries = [...replacementMap.entries()];
|
|
329
|
-
for (let i = 0; i < replacementEntries.length; i += 1) {
|
|
330
|
-
const [columnName, paths] = replacementEntries[i];
|
|
331
|
-
const pathParts = paths.map(getPathParts);
|
|
332
|
-
for (let j = 0; j < pathParts.length; j += 1) {
|
|
333
|
-
const [seriesIdx, xOrY] = pathParts[j];
|
|
334
|
-
const series = this.plotlyData[parseInt(seriesIdx, 10)];
|
|
335
|
-
if (xOrY === 'x') {
|
|
336
|
-
if (xCol !== '' && columnName !== xCol) {
|
|
337
|
-
log.debug('Cannot downsample multiple x columns');
|
|
338
|
-
return downsampleFailMessage;
|
|
339
|
-
}
|
|
340
|
-
xCol = columnName;
|
|
341
|
-
const axisName = `${series.xaxis[0]}axis${(_a = series.xaxis[1]) !== null && _a !== void 0 ? _a : ''}`;
|
|
342
|
-
xAxis = this.layout[axisName]; // The cast makes TS happy
|
|
343
|
-
if (xAxis != null && !isLinearAxis(xAxis) && !isAutoAxis(xAxis)) {
|
|
344
|
-
return 'Cannot downsample non-linear x axis';
|
|
345
|
-
}
|
|
346
|
-
}
|
|
347
|
-
else {
|
|
348
|
-
yCols.push(columnName);
|
|
349
|
-
const axisName = `${series.yaxis[0]}axis${(_b = series.yaxis[1]) !== null && _b !== void 0 ? _b : ''}`;
|
|
350
|
-
const yAxis = this.layout[axisName]; // The cast makes TS happy
|
|
351
|
-
if (yAxis != null && !isLinearAxis(yAxis) && !isAutoAxis(yAxis)) {
|
|
352
|
-
return 'Cannot downsample non-linear y axis';
|
|
353
|
-
}
|
|
354
|
-
}
|
|
355
|
-
}
|
|
356
|
-
}
|
|
357
|
-
if (xAxis == null) {
|
|
358
|
-
return 'Cannot downsample without an x axis';
|
|
359
|
-
}
|
|
360
|
-
// Copy the range in case plotly mutates it
|
|
361
|
-
const range = xAxis.autorange === false ? [...((_c = xAxis.range) !== null && _c !== void 0 ? _c : [])] : null;
|
|
362
|
-
return {
|
|
363
|
-
type: 'linear',
|
|
364
|
-
originalTable: table,
|
|
365
|
-
xCol,
|
|
366
|
-
yCols,
|
|
367
|
-
width: this.getPlotWidth(),
|
|
368
|
-
range,
|
|
369
|
-
rangeType: xAxis.type === 'date' ? 'date' : 'number',
|
|
370
|
-
};
|
|
371
|
-
}
|
|
372
|
-
subscribeTable(id) {
|
|
373
|
-
const table = this.tableReferenceMap.get(id);
|
|
374
|
-
const columnReplacements = this.tableColumnReplacementMap.get(id);
|
|
375
|
-
if (table != null &&
|
|
376
|
-
columnReplacements != null &&
|
|
377
|
-
columnReplacements.size > 0 &&
|
|
378
|
-
!this.tableSubscriptionMap.has(id)) {
|
|
379
|
-
this.chartDataMap.set(id, new this.dh.plot.ChartData(table));
|
|
380
|
-
const columnNames = new Set(columnReplacements.keys());
|
|
381
|
-
const columns = table.columns.filter(({ name }) => columnNames.has(name));
|
|
382
|
-
const subscription = table.subscribe(columns);
|
|
383
|
-
this.tableSubscriptionMap.set(id, subscription);
|
|
384
|
-
this.subscriptionCleanupMap.set(id, subscription.addEventListener(this.dh.Table.EVENT_UPDATED, e => this.handleFigureUpdated(e, id)));
|
|
385
|
-
}
|
|
386
|
-
}
|
|
387
|
-
removeTable(id) {
|
|
388
|
-
var _a, _b;
|
|
389
|
-
(_a = this.subscriptionCleanupMap.get(id)) === null || _a === void 0 ? void 0 : _a();
|
|
390
|
-
(_b = this.tableSubscriptionMap.get(id)) === null || _b === void 0 ? void 0 : _b.close();
|
|
391
|
-
this.tableReferenceMap.delete(id);
|
|
392
|
-
this.downsampleMap.delete(id);
|
|
393
|
-
this.subscriptionCleanupMap.delete(id);
|
|
394
|
-
this.tableSubscriptionMap.delete(id);
|
|
395
|
-
this.chartDataMap.delete(id);
|
|
396
|
-
this.tableDataMap.delete(id);
|
|
397
|
-
this.tableColumnReplacementMap.delete(id);
|
|
398
|
-
}
|
|
399
|
-
fireUpdate(data) {
|
|
400
|
-
super.fireUpdate(data);
|
|
401
|
-
this.hasPendingUpdate = false;
|
|
402
|
-
// TODO: This will fire on first call to `fireUpdate` even though other data
|
|
403
|
-
// may still be loading. We should consider making this smarter to fire after
|
|
404
|
-
// all initial data has loaded.
|
|
405
|
-
// https://github.com/deephaven/deephaven-plugins/issues/267
|
|
406
|
-
if (!this.hasInitialLoadCompleted) {
|
|
407
|
-
this.fireLoadFinished();
|
|
408
|
-
this.hasInitialLoadCompleted = true;
|
|
409
|
-
}
|
|
410
|
-
}
|
|
411
|
-
setDimensions(rect) {
|
|
412
|
-
super.setDimensions(rect);
|
|
413
|
-
ChartUtils.getLayoutRanges(this.layout);
|
|
414
|
-
this.downsampleMap.forEach((_, id) => {
|
|
415
|
-
this.updateDownsampledTable(id);
|
|
416
|
-
});
|
|
417
|
-
}
|
|
418
|
-
pauseUpdates() {
|
|
419
|
-
this.isPaused = true;
|
|
420
|
-
}
|
|
421
|
-
resumeUpdates() {
|
|
422
|
-
this.isPaused = false;
|
|
423
|
-
if (this.hasPendingUpdate) {
|
|
424
|
-
this.fireUpdate(this.getData());
|
|
425
|
-
}
|
|
426
|
-
}
|
|
427
|
-
shouldPauseOnUserInteraction() {
|
|
428
|
-
return (this.hasScene() || this.hasGeo() || this.hasMapbox() || this.hasPolar());
|
|
429
|
-
}
|
|
430
|
-
hasScene() {
|
|
431
|
-
return this.plotlyData.some(d => 'scene' in d && d.scene != null);
|
|
432
|
-
}
|
|
433
|
-
hasGeo() {
|
|
434
|
-
return this.plotlyData.some(d => 'geo' in d && d.geo != null);
|
|
435
|
-
}
|
|
436
|
-
hasMapbox() {
|
|
437
|
-
return this.plotlyData.some(({ type }) => type === null || type === void 0 ? void 0 : type.includes('mapbox'));
|
|
438
|
-
}
|
|
439
|
-
hasPolar() {
|
|
440
|
-
return this.plotlyData.some(({ type }) => type === null || type === void 0 ? void 0 : type.includes('polar'));
|
|
441
|
-
}
|
|
442
|
-
getPlotWidth() {
|
|
443
|
-
var _a, _b, _c, _d;
|
|
444
|
-
if (!this.rect || !this.rect.width) {
|
|
445
|
-
return 0;
|
|
446
|
-
}
|
|
447
|
-
return Math.max(this.rect.width -
|
|
448
|
-
((_b = (_a = this.layout.margin) === null || _a === void 0 ? void 0 : _a.l) !== null && _b !== void 0 ? _b : 0) -
|
|
449
|
-
((_d = (_c = this.layout.margin) === null || _c === void 0 ? void 0 : _c.r) !== null && _d !== void 0 ? _d : 0), 0);
|
|
450
|
-
}
|
|
451
|
-
getPlotHeight() {
|
|
452
|
-
var _a, _b, _c, _d;
|
|
453
|
-
if (!this.rect || !this.rect.height) {
|
|
454
|
-
return 0;
|
|
455
|
-
}
|
|
456
|
-
return Math.max(this.rect.height -
|
|
457
|
-
((_b = (_a = this.layout.margin) === null || _a === void 0 ? void 0 : _a.t) !== null && _b !== void 0 ? _b : 0) -
|
|
458
|
-
((_d = (_c = this.layout.margin) === null || _c === void 0 ? void 0 : _c.b) !== null && _d !== void 0 ? _d : 0), 0);
|
|
459
|
-
}
|
|
460
|
-
}
|
|
461
|
-
/**
|
|
462
|
-
* The size at which the chart will automatically downsample the data if it can be downsampled.
|
|
463
|
-
* If it cannot be downsampled, but the size is below MAX_FETCH_SIZE,
|
|
464
|
-
* the chart will show a confirmation to fetch the data since it might be a slow operation.
|
|
465
|
-
*/
|
|
466
|
-
PlotlyExpressChartModel.AUTO_DOWNSAMPLE_SIZE = 30000;
|
|
467
|
-
/**
|
|
468
|
-
* The maximum number of items that can be fetched from a table.
|
|
469
|
-
* If a table is larger than this, the chart will not be fetched.
|
|
470
|
-
* This is to prevent the chart from fetching too much data and crashing the browser.
|
|
471
|
-
*/
|
|
472
|
-
PlotlyExpressChartModel.MAX_FETCH_SIZE = 1000000;
|
|
473
|
-
export default PlotlyExpressChartModel;
|
|
474
|
-
//# sourceMappingURL=PlotlyExpressChartModel.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PlotlyExpressChartModel.js","sourceRoot":"","sources":["../src/PlotlyExpressChartModel.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,GAAG,MAAM,gBAAgB,CAAC;AAEjC,OAAO,EAGL,gBAAgB,EAChB,UAAU,EACV,eAAe,EACf,YAAY,EACZ,+BAA+B,EAC/B,aAAa,EACb,UAAU,EACV,YAAY,EACZ,YAAY,EACZ,oBAAoB,EACpB,iBAAiB,EACjB,2BAA2B,GAC5B,MAAM,2BAA2B,CAAC;AAEnC,MAAM,GAAG,GAAG,GAAG,CAAC,MAAM,CAAC,gDAAgD,CAAC,CAAC;AAEzE,MAAM,OAAO,uBAAwB,SAAQ,UAAU;IAerD,MAAM,CAAC,QAAQ,CAAC,KAAmB;QACjC,OAAO,KAAK,CAAC,IAAI,IAAI,uBAAuB,CAAC,cAAc,CAAC;IAC9D,CAAC;IAED,YACE,EAAiB,EACjB,MAAqB,EACrB,OAAqC;QAErC,KAAK,CAAC,EAAE,CAAC,CAAC;QAgBZ,iBAAY,GAAG,KAAK,CAAC;QAUrB;;WAEG;QACH,sBAAiB,GAA8B,IAAI,GAAG,EAAE,CAAC;QAEzD;;WAEG;QACH,kBAAa,GAAgC,IAAI,GAAG,EAAE,CAAC;QAEvD;;WAEG;QACH,yBAAoB,GAA0C,IAAI,GAAG,EAAE,CAAC;Q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IAED,YAAY;;QACV,IAAI,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE;YAClC,OAAO,CAAC,CAAC;SACV;QAED,OAAO,IAAI,CAAC,GAAG,CACb,IAAI,CAAC,IAAI,CAAC,KAAK;YACb,CAAC,MAAA,MAAA,IAAI,CAAC,MAAM,CAAC,MAAM,0CAAE,CAAC,mCAAI,CAAC,CAAC;YAC5B,CAAC,MAAA,MAAA,IAAI,CAAC,MAAM,CAAC,MAAM,0CAAE,CAAC,mCAAI,CAAC,CAAC,EAC9B,CAAC,CACF,CAAC;IACJ,CAAC;IAED,aAAa;;QACX,IAAI,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE;YACnC,OAAO,CAAC,CAAC;SACV;QAED,OAAO,IAAI,CAAC,GAAG,CACb,IAAI,CAAC,IAAI,CAAC,MAAM;YACd,CAAC,MAAA,MAAA,IAAI,CAAC,MAAM,CAAC,MAAM,0CAAE,CAAC,mCAAI,CAAC,CAAC;YAC5B,CAAC,MAAA,MAAA,IAAI,CAAC,MAAM,CAAC,MAAM,0CAAE,CAAC,mCAAI,CAAC,CAAC,EAC9B,CAAC,CACF,CAAC;IACJ,CAAC;;AA9mBD;;;;GAIG;AACI,4CAAoB,GAAG,KAAM,CAAC;AAErC;;;;GAIG;AACI,sCAAc,GAAG,OAAS,CAAC;AAqmBpC,eAAe,uBAAuB,CAAC"}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { dh } from '@deephaven/jsapi-types';
|
|
2
|
-
import { type WidgetPanelProps } from '@deephaven/plugin';
|
|
3
|
-
export declare function PlotlyExpressChartPanel(props: WidgetPanelProps<dh.Widget>): JSX.Element;
|
|
4
|
-
export default PlotlyExpressChartPanel;
|
|
5
|
-
//# sourceMappingURL=PlotlyExpressChartPanel.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PlotlyExpressChartPanel.d.ts","sourceRoot":"","sources":["../src/PlotlyExpressChartPanel.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAK1D,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,gBAAgB,CAAC,EAAE,CAAC,MAAM,CAAC,GACjC,GAAG,CAAC,OAAO,CAyBb;AAED,eAAe,uBAAuB,CAAC"}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
-
var t = {};
|
|
3
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
-
t[p] = s[p];
|
|
5
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
-
t[p[i]] = s[p[i]];
|
|
9
|
-
}
|
|
10
|
-
return t;
|
|
11
|
-
};
|
|
12
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
-
import { useCallback, useState } from 'react';
|
|
14
|
-
import Plotly from 'plotly.js-dist-min';
|
|
15
|
-
import { ChartPanel } from '@deephaven/dashboard-core-plugins';
|
|
16
|
-
import { useApi } from '@deephaven/jsapi-bootstrap';
|
|
17
|
-
import PlotlyExpressChartModel from './PlotlyExpressChartModel.js';
|
|
18
|
-
import { useHandleSceneTicks } from './useHandleSceneTicks.js';
|
|
19
|
-
export function PlotlyExpressChartPanel(props) {
|
|
20
|
-
const dh = useApi();
|
|
21
|
-
const { fetch, metadata = {} } = props, rest = __rest(props, ["fetch", "metadata"]);
|
|
22
|
-
const [container, setContainer] = useState(null);
|
|
23
|
-
const [model, setModel] = useState();
|
|
24
|
-
const makeModel = useCallback(async () => {
|
|
25
|
-
const widgetData = await fetch();
|
|
26
|
-
const m = new PlotlyExpressChartModel(dh, widgetData, fetch);
|
|
27
|
-
setModel(m);
|
|
28
|
-
return m;
|
|
29
|
-
}, [dh, fetch]);
|
|
30
|
-
useHandleSceneTicks(model, container);
|
|
31
|
-
return (_jsx(ChartPanel
|
|
32
|
-
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
33
|
-
, Object.assign({}, rest, { containerRef: setContainer, makeModel: makeModel, Plotly: Plotly, metadata: metadata })));
|
|
34
|
-
}
|
|
35
|
-
export default PlotlyExpressChartPanel;
|
|
36
|
-
//# sourceMappingURL=PlotlyExpressChartPanel.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PlotlyExpressChartPanel.js","sourceRoot":"","sources":["../src/PlotlyExpressChartPanel.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAc,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACrD,OAAO,MAAM,MAAM,oBAAoB,CAAC;AACxC,OAAO,EAAE,UAAU,EAAmB,MAAM,mCAAmC,CAAC;AAGhF,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACpD,OAAO,uBAAuB,MAAM,8BAA8B,CAAC;AACnE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAE/D,MAAM,UAAU,uBAAuB,CACrC,KAAkC;IAElC,MAAM,EAAE,GAAG,MAAM,EAAE,CAAC;IACpB,MAAM,EAAE,KAAK,EAAE,QAAQ,GAAG,EAAE,KAAc,KAAK,EAAd,IAAI,UAAK,KAAK,EAAzC,qBAAiC,CAAQ,CAAC;IAChD,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAwB,IAAI,CAAC,CAAC;IACxE,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,EAA2B,CAAC;IAE9D,MAAM,SAAS,GAAG,WAAW,CAAC,KAAK,IAAI,EAAE;QACvC,MAAM,UAAU,GAAG,MAAM,KAAK,EAAE,CAAC;QACjC,MAAM,CAAC,GAAG,IAAI,uBAAuB,CAAC,EAAE,EAAE,UAAU,EAAE,KAAK,CAAC,CAAC;QAC7D,QAAQ,CAAC,CAAC,CAAC,CAAC;QACZ,OAAO,CAAC,CAAC;IACX,CAAC,EAAE,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC,CAAC;IAEhB,mBAAmB,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;IAEtC,OAAO,CACL,KAAC,UAAU;IACT,wDAAwD;wBACnD,IAAwB,IAC7B,YAAY,EAAE,YAAY,EAC1B,SAAS,EAAE,SAAS,EACpB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,QAAuC,IACjD,CACH,CAAC;AACJ,CAAC;AAED,eAAe,uBAAuB,CAAC"}
|
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
import type { Data, LayoutAxis, PlotlyDataLayoutConfig } from 'plotly.js';
|
|
2
|
-
import type { dh as DhType } from '@deephaven/jsapi-types';
|
|
3
|
-
export interface PlotlyChartWidget {
|
|
4
|
-
getDataAsBase64: () => string;
|
|
5
|
-
exportedObjects: {
|
|
6
|
-
fetch: () => Promise<DhType.Table>;
|
|
7
|
-
}[];
|
|
8
|
-
addEventListener: (type: string, fn: (event: CustomEvent<PlotlyChartWidget>) => () => void) => void;
|
|
9
|
-
}
|
|
10
|
-
export interface PlotlyChartWidgetData {
|
|
11
|
-
type: string;
|
|
12
|
-
figure: {
|
|
13
|
-
deephaven: {
|
|
14
|
-
mappings: Array<{
|
|
15
|
-
table: number;
|
|
16
|
-
data_columns: Record<string, string[]>;
|
|
17
|
-
}>;
|
|
18
|
-
is_user_set_template: boolean;
|
|
19
|
-
is_user_set_color: boolean;
|
|
20
|
-
};
|
|
21
|
-
plotly: PlotlyDataLayoutConfig;
|
|
22
|
-
};
|
|
23
|
-
revision: number;
|
|
24
|
-
new_references: number[];
|
|
25
|
-
removed_references: number[];
|
|
26
|
-
}
|
|
27
|
-
export declare function getWidgetData(widgetInfo: DhType.Widget): PlotlyChartWidgetData;
|
|
28
|
-
export declare function getDataMappings(widgetData: PlotlyChartWidgetData): Map<number, Map<string, string[]>>;
|
|
29
|
-
/**
|
|
30
|
-
* Removes the default colors from the data
|
|
31
|
-
* Data color is not removed if the user set the color specifically or the plot type sets it
|
|
32
|
-
*
|
|
33
|
-
* This only checks if the marker or line color is set to a color in the colorway.
|
|
34
|
-
* This means it is not possible to change the order of the colorway and use the same colors.
|
|
35
|
-
*
|
|
36
|
-
* @param colorway The colorway from plotly
|
|
37
|
-
* @param data The data to remove the colorway from. This will be mutated
|
|
38
|
-
*/
|
|
39
|
-
export declare function removeColorsFromData(colorway: string[], data: Data[]): void;
|
|
40
|
-
/**
|
|
41
|
-
* Gets the path parts from a path replacement string from the widget data.
|
|
42
|
-
* The parts start with the plotly data array as the root.
|
|
43
|
-
* E.g. /plotly/data/0/x -> ['0', 'x']
|
|
44
|
-
* @param path The path from the widget data
|
|
45
|
-
* @returns The path parts within the plotly data array
|
|
46
|
-
*/
|
|
47
|
-
export declare function getPathParts(path: string): string[];
|
|
48
|
-
/**
|
|
49
|
-
* Checks if a plotly series is a line series without markers
|
|
50
|
-
* @param data The plotly data to check
|
|
51
|
-
* @returns True if the data is a line series without marakers
|
|
52
|
-
*/
|
|
53
|
-
export declare function isLineSeries(data: Data): boolean;
|
|
54
|
-
/**
|
|
55
|
-
* Checks if a plotly axis type is automatically determined based on the data
|
|
56
|
-
* @param axis The plotly axis to check
|
|
57
|
-
* @returns True if the axis type is determined based on the data
|
|
58
|
-
*/
|
|
59
|
-
export declare function isAutoAxis(axis: Partial<LayoutAxis>): boolean;
|
|
60
|
-
/**
|
|
61
|
-
* Checks if a plotly axis type is linear
|
|
62
|
-
* @param axis The plotly axis to check
|
|
63
|
-
* @returns True if the axis is a linear axis
|
|
64
|
-
*/
|
|
65
|
-
export declare function isLinearAxis(axis: Partial<LayoutAxis>): boolean;
|
|
66
|
-
/**
|
|
67
|
-
* Check if 2 axis ranges are the same
|
|
68
|
-
* A null range indicates an auto range
|
|
69
|
-
* @param range1 The first axis range options
|
|
70
|
-
* @param range2 The second axis range options
|
|
71
|
-
* @returns True if the range options describe the same range
|
|
72
|
-
*/
|
|
73
|
-
export declare function areSameAxisRange(range1: unknown[] | null, range2: unknown[] | null): boolean;
|
|
74
|
-
export interface DownsampleInfo {
|
|
75
|
-
type: 'linear';
|
|
76
|
-
/**
|
|
77
|
-
* The original table before downsampling.
|
|
78
|
-
*/
|
|
79
|
-
originalTable: DhType.Table;
|
|
80
|
-
/**
|
|
81
|
-
* The x column to downsample.
|
|
82
|
-
*/
|
|
83
|
-
xCol: string;
|
|
84
|
-
/**
|
|
85
|
-
* The y columns to downsample.
|
|
86
|
-
*/
|
|
87
|
-
yCols: string[];
|
|
88
|
-
/**
|
|
89
|
-
* The width of the x-axis in pixels.
|
|
90
|
-
*/
|
|
91
|
-
width: number;
|
|
92
|
-
/**
|
|
93
|
-
* The range of the x-axis. Null if set to autorange.
|
|
94
|
-
*/
|
|
95
|
-
range: string[] | null;
|
|
96
|
-
/**
|
|
97
|
-
* If the range is a datae or number
|
|
98
|
-
*/
|
|
99
|
-
rangeType: 'date' | 'number';
|
|
100
|
-
}
|
|
101
|
-
export declare function downsample(dh: typeof DhType, info: DownsampleInfo): Promise<DhType.Table>;
|
|
102
|
-
/**
|
|
103
|
-
* Get the indexes of the replaceable WebGL traces in the data
|
|
104
|
-
* A replaceable WebGL has a type that ends with 'gl' which indicates it has a SVG equivalent
|
|
105
|
-
* @param data The data to check
|
|
106
|
-
* @returns The indexes of the WebGL traces
|
|
107
|
-
*/
|
|
108
|
-
export declare function getReplaceableWebGlTraceIndices(data: Data[]): Set<number>;
|
|
109
|
-
/**
|
|
110
|
-
* Check if the data contains any traces that are at least partially powered by WebGL and have no SVG equivalent.
|
|
111
|
-
* @param data The data to check for WebGL traces
|
|
112
|
-
* @returns True if the data contains any unreplaceable WebGL traces
|
|
113
|
-
*/
|
|
114
|
-
export declare function hasUnreplaceableWebGlTraces(data: Data[]): boolean;
|
|
115
|
-
/**
|
|
116
|
-
* Set traces to use WebGL if WebGL is enabled and the trace was originally WebGL
|
|
117
|
-
* or swap out WebGL for SVG if WebGL is disabled and the trace was originally WebGL
|
|
118
|
-
* @param data The plotly figure data to update
|
|
119
|
-
* @param webgl True if WebGL is enabled
|
|
120
|
-
* @param webGlTraceIndices The indexes of the traces that are originally WebGL traces
|
|
121
|
-
*/
|
|
122
|
-
export declare function setWebGlTraceType(data: Data[], webgl: boolean, webGlTraceIndices: Set<number>): void;
|
|
123
|
-
//# sourceMappingURL=PlotlyExpressChartUtils.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PlotlyExpressChartUtils.d.ts","sourceRoot":"","sources":["../src/PlotlyExpressChartUtils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,IAAI,EACJ,UAAU,EACV,sBAAsB,EAEvB,MAAM,WAAW,CAAC;AACnB,OAAO,KAAK,EAAE,EAAE,IAAI,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAmB3D,MAAM,WAAW,iBAAiB;IAChC,eAAe,EAAE,MAAM,MAAM,CAAC;IAC9B,eAAe,EAAE;QAAE,KAAK,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;KAAE,EAAE,CAAC;IAC1D,gBAAgB,EAAE,CAChB,IAAI,EAAE,MAAM,EACZ,EAAE,EAAE,CAAC,KAAK,EAAE,WAAW,CAAC,iBAAiB,CAAC,KAAK,MAAM,IAAI,KACtD,IAAI,CAAC;CACX;AAED,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE;QACN,SAAS,EAAE;YACT,QAAQ,EAAE,KAAK,CAAC;gBACd,KAAK,EAAE,MAAM,CAAC;gBACd,YAAY,EAAE,MAA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IAC5B;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IAEvB;;OAEG;IACH,SAAS,EAAE,MAAM,GAAG,QAAQ,CAAC;CAC9B;AAED,wBAAgB,UAAU,CACxB,EAAE,EAAE,OAAO,MAAM,EACjB,IAAI,EAAE,cAAc,GACnB,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAYvB;AAED;;;;;GAKG;AACH,wBAAgB,+BAA+B,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,GAAG,CAAC,MAAM,CAAC,CAQzE;AAED;;;;GAIG;AACH,wBAAgB,2BAA2B,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,OAAO,CAIjE;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,IAAI,EAAE,EACZ,KAAK,EAAE,OAAO,EACd,iBAAiB,EAAE,GAAG,CAAC,MAAM,CAAC,GAC7B,IAAI,CAWN"}
|
|
@@ -1,176 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Traces that are at least partially powered by WebGL and have no SVG equivalent.
|
|
3
|
-
* https://plotly.com/python/webgl-vs-svg/
|
|
4
|
-
*/
|
|
5
|
-
const UNREPLACEABLE_WEBGL_TRACE_TYPES = new Set([
|
|
6
|
-
'splom',
|
|
7
|
-
'parcoords',
|
|
8
|
-
'scatter3d',
|
|
9
|
-
'surface',
|
|
10
|
-
'mesh3d',
|
|
11
|
-
'cone',
|
|
12
|
-
'streamtube',
|
|
13
|
-
'scattermapbox',
|
|
14
|
-
'choroplethmapbox',
|
|
15
|
-
'densitymapbox',
|
|
16
|
-
]);
|
|
17
|
-
export function getWidgetData(widgetInfo) {
|
|
18
|
-
return JSON.parse(widgetInfo.getDataAsString());
|
|
19
|
-
}
|
|
20
|
-
export function getDataMappings(widgetData) {
|
|
21
|
-
const data = widgetData.figure;
|
|
22
|
-
// Maps a reference index to a map of column name to an array of the paths where its data should be
|
|
23
|
-
const tableColumnReplacementMap = new Map();
|
|
24
|
-
data.deephaven.mappings.forEach(({ table: tableIndex, data_columns: dataColumns }) => {
|
|
25
|
-
var _a;
|
|
26
|
-
const existingColumnMap = (_a = tableColumnReplacementMap.get(tableIndex)) !== null && _a !== void 0 ? _a : new Map();
|
|
27
|
-
tableColumnReplacementMap.set(tableIndex, existingColumnMap);
|
|
28
|
-
// For each { columnName: [replacePaths] } in the object, add to the tableColumnReplacementMap
|
|
29
|
-
Object.entries(dataColumns).forEach(([columnName, paths]) => {
|
|
30
|
-
const existingPaths = existingColumnMap.get(columnName);
|
|
31
|
-
if (existingPaths !== undefined) {
|
|
32
|
-
existingPaths.push(...paths);
|
|
33
|
-
}
|
|
34
|
-
else {
|
|
35
|
-
existingColumnMap.set(columnName, [...paths]);
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
|
-
});
|
|
39
|
-
return tableColumnReplacementMap;
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* Removes the default colors from the data
|
|
43
|
-
* Data color is not removed if the user set the color specifically or the plot type sets it
|
|
44
|
-
*
|
|
45
|
-
* This only checks if the marker or line color is set to a color in the colorway.
|
|
46
|
-
* This means it is not possible to change the order of the colorway and use the same colors.
|
|
47
|
-
*
|
|
48
|
-
* @param colorway The colorway from plotly
|
|
49
|
-
* @param data The data to remove the colorway from. This will be mutated
|
|
50
|
-
*/
|
|
51
|
-
export function removeColorsFromData(colorway, data) {
|
|
52
|
-
const plotlyColors = new Set(colorway.map(color => color.toUpperCase()));
|
|
53
|
-
// Just check if the colors are in the colorway at any point
|
|
54
|
-
// Plotly has many different ways to layer/order series
|
|
55
|
-
for (let i = 0; i < data.length; i += 1) {
|
|
56
|
-
const trace = data[i];
|
|
57
|
-
// There are multiple datatypes in plotly and some don't contain marker or marker.color
|
|
58
|
-
if ('marker' in trace &&
|
|
59
|
-
trace.marker != null &&
|
|
60
|
-
'color' in trace.marker &&
|
|
61
|
-
typeof trace.marker.color === 'string') {
|
|
62
|
-
if (plotlyColors.has(trace.marker.color.toUpperCase())) {
|
|
63
|
-
delete trace.marker.color;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
if ('line' in trace &&
|
|
67
|
-
trace.line != null &&
|
|
68
|
-
'color' in trace.line &&
|
|
69
|
-
typeof trace.line.color === 'string') {
|
|
70
|
-
if (plotlyColors.has(trace.line.color.toUpperCase())) {
|
|
71
|
-
delete trace.line.color;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
/**
|
|
77
|
-
* Gets the path parts from a path replacement string from the widget data.
|
|
78
|
-
* The parts start with the plotly data array as the root.
|
|
79
|
-
* E.g. /plotly/data/0/x -> ['0', 'x']
|
|
80
|
-
* @param path The path from the widget data
|
|
81
|
-
* @returns The path parts within the plotly data array
|
|
82
|
-
*/
|
|
83
|
-
export function getPathParts(path) {
|
|
84
|
-
return path
|
|
85
|
-
.split('/')
|
|
86
|
-
.filter(part => part !== '' && part !== 'plotly' && part !== 'data');
|
|
87
|
-
}
|
|
88
|
-
/**
|
|
89
|
-
* Checks if a plotly series is a line series without markers
|
|
90
|
-
* @param data The plotly data to check
|
|
91
|
-
* @returns True if the data is a line series without marakers
|
|
92
|
-
*/
|
|
93
|
-
export function isLineSeries(data) {
|
|
94
|
-
return ((data.type === 'scatter' || data.type === 'scattergl') &&
|
|
95
|
-
data.mode === 'lines');
|
|
96
|
-
}
|
|
97
|
-
/**
|
|
98
|
-
* Checks if a plotly axis type is automatically determined based on the data
|
|
99
|
-
* @param axis The plotly axis to check
|
|
100
|
-
* @returns True if the axis type is determined based on the data
|
|
101
|
-
*/
|
|
102
|
-
export function isAutoAxis(axis) {
|
|
103
|
-
return axis.type == null || axis.type === '-';
|
|
104
|
-
}
|
|
105
|
-
/**
|
|
106
|
-
* Checks if a plotly axis type is linear
|
|
107
|
-
* @param axis The plotly axis to check
|
|
108
|
-
* @returns True if the axis is a linear axis
|
|
109
|
-
*/
|
|
110
|
-
export function isLinearAxis(axis) {
|
|
111
|
-
return axis.type === 'linear' || axis.type === 'date';
|
|
112
|
-
}
|
|
113
|
-
/**
|
|
114
|
-
* Check if 2 axis ranges are the same
|
|
115
|
-
* A null range indicates an auto range
|
|
116
|
-
* @param range1 The first axis range options
|
|
117
|
-
* @param range2 The second axis range options
|
|
118
|
-
* @returns True if the range options describe the same range
|
|
119
|
-
*/
|
|
120
|
-
export function areSameAxisRange(range1, range2) {
|
|
121
|
-
return ((range1 === null && range2 === null) ||
|
|
122
|
-
(range1 != null &&
|
|
123
|
-
range2 != null &&
|
|
124
|
-
range1[0] === range2[0] &&
|
|
125
|
-
range1[1] === range2[1]));
|
|
126
|
-
}
|
|
127
|
-
export function downsample(dh, info) {
|
|
128
|
-
var _a;
|
|
129
|
-
return dh.plot.Downsample.runChartDownsample(info.originalTable, info.xCol, info.yCols, info.width, (_a = info.range) === null || _a === void 0 ? void 0 : _a.map(val => info.rangeType === 'date'
|
|
130
|
-
? dh.DateWrapper.ofJsDate(new Date(val))
|
|
131
|
-
: dh.LongWrapper.ofString(val)));
|
|
132
|
-
}
|
|
133
|
-
/**
|
|
134
|
-
* Get the indexes of the replaceable WebGL traces in the data
|
|
135
|
-
* A replaceable WebGL has a type that ends with 'gl' which indicates it has a SVG equivalent
|
|
136
|
-
* @param data The data to check
|
|
137
|
-
* @returns The indexes of the WebGL traces
|
|
138
|
-
*/
|
|
139
|
-
export function getReplaceableWebGlTraceIndices(data) {
|
|
140
|
-
const webGlTraceIndexes = new Set();
|
|
141
|
-
data.forEach((trace, index) => {
|
|
142
|
-
if (trace.type && trace.type.endsWith('gl')) {
|
|
143
|
-
webGlTraceIndexes.add(index);
|
|
144
|
-
}
|
|
145
|
-
});
|
|
146
|
-
return webGlTraceIndexes;
|
|
147
|
-
}
|
|
148
|
-
/**
|
|
149
|
-
* Check if the data contains any traces that are at least partially powered by WebGL and have no SVG equivalent.
|
|
150
|
-
* @param data The data to check for WebGL traces
|
|
151
|
-
* @returns True if the data contains any unreplaceable WebGL traces
|
|
152
|
-
*/
|
|
153
|
-
export function hasUnreplaceableWebGlTraces(data) {
|
|
154
|
-
return data.some(trace => trace.type && UNREPLACEABLE_WEBGL_TRACE_TYPES.has(trace.type));
|
|
155
|
-
}
|
|
156
|
-
/**
|
|
157
|
-
* Set traces to use WebGL if WebGL is enabled and the trace was originally WebGL
|
|
158
|
-
* or swap out WebGL for SVG if WebGL is disabled and the trace was originally WebGL
|
|
159
|
-
* @param data The plotly figure data to update
|
|
160
|
-
* @param webgl True if WebGL is enabled
|
|
161
|
-
* @param webGlTraceIndices The indexes of the traces that are originally WebGL traces
|
|
162
|
-
*/
|
|
163
|
-
export function setWebGlTraceType(data, webgl, webGlTraceIndices) {
|
|
164
|
-
webGlTraceIndices.forEach(index => {
|
|
165
|
-
const trace = data[index];
|
|
166
|
-
if (webgl && trace.type && !trace.type.endsWith('gl')) {
|
|
167
|
-
// If WebGL is enabled and the trace is not already a WebGL trace, make it one
|
|
168
|
-
trace.type = `${trace.type}gl`;
|
|
169
|
-
}
|
|
170
|
-
else if (!webgl && trace.type && trace.type.endsWith('gl')) {
|
|
171
|
-
// If WebGL is disabled and the trace is a WebGL trace, remove the 'gl'
|
|
172
|
-
trace.type = trace.type.substring(0, trace.type.length - 2);
|
|
173
|
-
}
|
|
174
|
-
});
|
|
175
|
-
}
|
|
176
|
-
//# sourceMappingURL=PlotlyExpressChartUtils.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PlotlyExpressChartUtils.js","sourceRoot":"","sources":["../src/PlotlyExpressChartUtils.ts"],"names":[],"mappings":"AAQA;;;GAGG;AACH,MAAM,+BAA+B,GAAG,IAAI,GAAG,CAAC;IAC9C,OAAO;IACP,WAAW;IACX,WAAW;IACX,SAAS;IACT,QA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,CAAC,CAAC,EAAE,KAAK,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAa,CAAC;SACzE;IACH,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PlotlyExpressPlugin.d.ts","sourceRoot":"","sources":["../src/PlotlyExpressPlugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAc,MAAM,mBAAmB,CAAC;AAElE,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,wBAAwB,CAAC;AAIjD,eAAO,MAAM,mBAAmB,EAAE,YAAY,CAAC,EAAE,CAAC,MAAM,CAOvD,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { PluginType } from '@deephaven/plugin';
|
|
2
|
-
import { vsGraph } from '@deephaven/icons';
|
|
3
|
-
import { PlotlyExpressChart } from './PlotlyExpressChart.js';
|
|
4
|
-
import { PlotlyExpressChartPanel } from './PlotlyExpressChartPanel.js';
|
|
5
|
-
export const PlotlyExpressPlugin = {
|
|
6
|
-
name: '@deephaven/plotly-express',
|
|
7
|
-
type: PluginType.WIDGET_PLUGIN,
|
|
8
|
-
supportedTypes: 'deephaven.plot.express.DeephavenFigure',
|
|
9
|
-
component: PlotlyExpressChart,
|
|
10
|
-
panelComponent: PlotlyExpressChartPanel,
|
|
11
|
-
icon: vsGraph,
|
|
12
|
-
};
|
|
13
|
-
export default PlotlyExpressPlugin;
|
|
14
|
-
//# sourceMappingURL=PlotlyExpressPlugin.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PlotlyExpressPlugin.js","sourceRoot":"","sources":["../src/PlotlyExpressPlugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAClE,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAE3C,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AAEvE,MAAM,CAAC,MAAM,mBAAmB,GAA4B;IAC1D,IAAI,EAAE,2BAA2B;IACjC,IAAI,EAAE,UAAU,CAAC,aAAa;IAC9B,cAAc,EAAE,wCAAwC;IACxD,SAAS,EAAE,kBAAkB;IAC7B,cAAc,EAAE,uBAAuB;IACvC,IAAI,EAAE,OAAO;CACd,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
|
package/dist/index.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { PlotlyExpressPlugin } from './PlotlyExpressPlugin.js';
|
|
2
|
-
export * from './DashboardPlugin.js';
|
|
3
|
-
export * from './PlotlyExpressChartModel.js';
|
|
4
|
-
export * from './PlotlyExpressChartUtils.js';
|
|
5
|
-
export default PlotlyExpressPlugin;
|
|
6
|
-
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAG/D,cAAc,sBAAsB,CAAC;AACrC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,8BAA8B,CAAC;AAE7C,eAAe,mBAAmB,CAAC"}
|
package/dist/index.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { PlotlyExpressPlugin } from './PlotlyExpressPlugin.js';
|
|
2
|
-
// Export legacy dashboard plugin as named export for backwards compatibility
|
|
3
|
-
export * from './DashboardPlugin.js';
|
|
4
|
-
export * from './PlotlyExpressChartModel.js';
|
|
5
|
-
export * from './PlotlyExpressChartUtils.js';
|
|
6
|
-
export default PlotlyExpressPlugin;
|
|
7
|
-
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAE/D,6EAA6E;AAC7E,cAAc,sBAAsB,CAAC;AACrC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,8BAA8B,CAAC;AAE7C,eAAe,mBAAmB,CAAC"}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import PlotlyExpressChartModel from './PlotlyExpressChartModel.js';
|
|
2
|
-
export declare function useHandleSceneTicks(model: PlotlyExpressChartModel | undefined, container: HTMLDivElement | null): void;
|
|
3
|
-
export default useHandleSceneTicks;
|
|
4
|
-
//# sourceMappingURL=useHandleSceneTicks.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useHandleSceneTicks.d.ts","sourceRoot":"","sources":["../src/useHandleSceneTicks.ts"],"names":[],"mappings":"AACA,OAAO,uBAAuB,MAAM,8BAA8B,CAAC;AAEnE,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,uBAAuB,GAAG,SAAS,EAC1C,SAAS,EAAE,cAAc,GAAG,IAAI,GAC/B,IAAI,CAsCN;AAED,eAAe,mBAAmB,CAAC"}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { useEffect } from 'react';
|
|
2
|
-
export function useHandleSceneTicks(model, container) {
|
|
3
|
-
useEffect(() => {
|
|
4
|
-
// Plotly scenes and geo views reset when our data ticks
|
|
5
|
-
// Pause rendering data updates when the user is manipulating a scene
|
|
6
|
-
if (!model || !container || !model.shouldPauseOnUserInteraction()) {
|
|
7
|
-
return;
|
|
8
|
-
}
|
|
9
|
-
function handleMouseDown() {
|
|
10
|
-
model === null || model === void 0 ? void 0 : model.pauseUpdates();
|
|
11
|
-
// The once option removes the listener after it is called
|
|
12
|
-
window.addEventListener('mouseup', handleMouseUp, { once: true });
|
|
13
|
-
}
|
|
14
|
-
function handleMouseUp() {
|
|
15
|
-
model === null || model === void 0 ? void 0 : model.resumeUpdates();
|
|
16
|
-
}
|
|
17
|
-
let wheelTimeout = 0;
|
|
18
|
-
function handleWheel() {
|
|
19
|
-
model === null || model === void 0 ? void 0 : model.pauseUpdates();
|
|
20
|
-
window.clearTimeout(wheelTimeout);
|
|
21
|
-
wheelTimeout = window.setTimeout(() => {
|
|
22
|
-
model === null || model === void 0 ? void 0 : model.resumeUpdates();
|
|
23
|
-
}, 300);
|
|
24
|
-
}
|
|
25
|
-
container.addEventListener('mousedown', handleMouseDown);
|
|
26
|
-
container.addEventListener('wheel', handleWheel);
|
|
27
|
-
return () => {
|
|
28
|
-
window.clearTimeout(wheelTimeout);
|
|
29
|
-
window.removeEventListener('mouseup', handleMouseUp);
|
|
30
|
-
container.removeEventListener('mousedown', handleMouseDown);
|
|
31
|
-
container.removeEventListener('wheel', handleWheel);
|
|
32
|
-
};
|
|
33
|
-
}, [model, container]);
|
|
34
|
-
}
|
|
35
|
-
export default useHandleSceneTicks;
|
|
36
|
-
//# sourceMappingURL=useHandleSceneTicks.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useHandleSceneTicks.js","sourceRoot":"","sources":["../src/useHandleSceneTicks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGlC,MAAM,UAAU,mBAAmB,CACjC,KAA0C,EAC1C,SAAgC;IAEhC,SAAS,CAAC,GAAG,EAAE;QACb,wDAAwD;QACxD,qEAAqE;QACrE,IAAI,CAAC,KAAK,IAAI,CAAC,SAAS,IAAI,CAAC,KAAK,CAAC,4BAA4B,EAAE,EAAE;YACjE,OAAO;SACR;QAED,SAAS,eAAe;YACtB,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,YAAY,EAAE,CAAC;YACtB,0DAA0D;YAC1D,MAAM,CAAC,gBAAgB,CAAC,SAAS,EAAE,aAAa,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,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