@deephaven/chart 0.39.1-beta.0 → 0.39.1-chart-refactor.13
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/dist/Chart.d.ts +14 -19
- package/dist/Chart.d.ts.map +1 -1
- package/dist/Chart.js +21 -6
- package/dist/Chart.js.map +1 -1
- package/dist/ChartModel.d.ts +2 -2
- package/dist/ChartModel.d.ts.map +1 -1
- package/dist/ChartModel.js.map +1 -1
- package/dist/ChartUtils.d.ts +2 -2
- package/dist/ChartUtils.d.ts.map +1 -1
- package/dist/ChartUtils.js +11 -1
- package/dist/ChartUtils.js.map +1 -1
- package/dist/FigureChartModel.d.ts +3 -3
- package/dist/FigureChartModel.d.ts.map +1 -1
- package/dist/FigureChartModel.js +1 -1
- package/dist/FigureChartModel.js.map +1 -1
- package/dist/plotly/Plot.d.ts +1 -1
- package/dist/plotly/Plot.d.ts.map +1 -1
- package/dist/plotly/Plot.js +2 -4
- package/dist/plotly/Plot.js.map +1 -1
- package/dist/plotly/Plotly.d.ts +1 -1
- package/dist/plotly/Plotly.d.ts.map +1 -1
- package/dist/plotly/Plotly.js +8 -0
- package/dist/plotly/Plotly.js.map +1 -1
- package/package.json +10 -10
package/dist/Chart.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { Component, ReactElement, RefObject } from 'react';
|
|
1
|
+
import React, { Component, ReactElement, RefObject } from 'react';
|
|
2
2
|
import { IconDefinition } from '@deephaven/icons';
|
|
3
3
|
import { DateTimeColumnFormatterOptions, DecimalColumnFormatterOptions, IntegerColumnFormatterOptions, FormattingRule, ColumnFormatSettings, DateTimeFormatSettings } from '@deephaven/jsapi-utils';
|
|
4
|
-
import { Layout, Icon,
|
|
5
|
-
import
|
|
4
|
+
import { Config as PlotlyConfig, Layout, Icon, Data } from 'plotly.js';
|
|
5
|
+
import type { PlotParams } from 'react-plotly.js';
|
|
6
|
+
import Plotly from './plotly/Plotly';
|
|
6
7
|
import ChartModel from './ChartModel';
|
|
7
8
|
import { ChartModelSettings } from './ChartUtils';
|
|
8
9
|
import './Chart.scss';
|
|
@@ -14,6 +15,7 @@ interface ChartProps {
|
|
|
14
15
|
model: ChartModel;
|
|
15
16
|
settings: FormatterSettings;
|
|
16
17
|
isActive: boolean;
|
|
18
|
+
Plotly: typeof Plotly;
|
|
17
19
|
onDisconnect: () => void;
|
|
18
20
|
onReconnect: () => void;
|
|
19
21
|
onUpdate: (obj: {
|
|
@@ -23,7 +25,7 @@ interface ChartProps {
|
|
|
23
25
|
onSettingsChanged: (settings: Partial<ChartModelSettings>) => void;
|
|
24
26
|
}
|
|
25
27
|
interface ChartState {
|
|
26
|
-
data: Partial<
|
|
28
|
+
data: Partial<Data>[] | null;
|
|
27
29
|
downsamplingError: unknown;
|
|
28
30
|
isDownsampleFinished: boolean;
|
|
29
31
|
isDownsampleInProgress: boolean;
|
|
@@ -41,6 +43,7 @@ export declare class Chart extends Component<ChartProps, ChartState> {
|
|
|
41
43
|
showTSeparator: boolean;
|
|
42
44
|
formatter: never[];
|
|
43
45
|
};
|
|
46
|
+
Plotly: typeof Plotly;
|
|
44
47
|
onDisconnect: () => void;
|
|
45
48
|
onReconnect: () => void;
|
|
46
49
|
onUpdate: () => void;
|
|
@@ -59,7 +62,8 @@ export declare class Chart extends Component<ChartProps, ChartState> {
|
|
|
59
62
|
componentDidUpdate(prevProps: ChartProps): void;
|
|
60
63
|
componentWillUnmount(): void;
|
|
61
64
|
currentSeries: number;
|
|
62
|
-
|
|
65
|
+
PlotComponent: React.ComponentType<PlotParams>;
|
|
66
|
+
plot: RefObject<typeof this.PlotComponent>;
|
|
63
67
|
plotWrapper: RefObject<HTMLDivElement>;
|
|
64
68
|
columnFormats?: FormattingRule[];
|
|
65
69
|
dateTimeFormatterOptions?: DateTimeColumnFormatterOptions;
|
|
@@ -69,16 +73,7 @@ export declare class Chart extends Component<ChartProps, ChartState> {
|
|
|
69
73
|
ranges?: unknown;
|
|
70
74
|
isSubscribed: boolean;
|
|
71
75
|
isLoadedFired: boolean;
|
|
72
|
-
getCachedConfig: (downsamplingError: unknown, isDownsampleFinished: boolean, isDownsampleInProgress: boolean, isDownsamplingDisabled: boolean) =>
|
|
73
|
-
displaylogo: boolean;
|
|
74
|
-
displayModeBar: string | boolean;
|
|
75
|
-
modeBarButtons: (string[] | {
|
|
76
|
-
name: string;
|
|
77
|
-
icon: Icon;
|
|
78
|
-
click: () => void;
|
|
79
|
-
attr: string | undefined;
|
|
80
|
-
}[])[];
|
|
81
|
-
};
|
|
76
|
+
getCachedConfig: (downsamplingError: unknown, isDownsampleFinished: boolean, isDownsampleInProgress: boolean, isDownsamplingDisabled: boolean, is3d: boolean) => Partial<PlotlyConfig>;
|
|
82
77
|
getPlotRect(): DOMRect | null;
|
|
83
78
|
initData(): void;
|
|
84
79
|
subscribe(): void;
|
|
@@ -86,13 +81,13 @@ export declare class Chart extends Component<ChartProps, ChartState> {
|
|
|
86
81
|
handleAfterPlot(): void;
|
|
87
82
|
handleDownsampleClick(): void;
|
|
88
83
|
handleModelEvent(event: CustomEvent): void;
|
|
89
|
-
handlePlotUpdate(figure: {
|
|
90
|
-
layout: Layout
|
|
91
|
-
}): void;
|
|
84
|
+
handlePlotUpdate(figure: Readonly<{
|
|
85
|
+
layout: Partial<Layout>;
|
|
86
|
+
}>): void;
|
|
92
87
|
handleRelayout(changes: {
|
|
93
88
|
hiddenlabels?: string[];
|
|
94
89
|
}): void;
|
|
95
|
-
handleRestyle([changes, seriesIndexes]: [
|
|
90
|
+
handleRestyle([changes, seriesIndexes]: readonly [
|
|
96
91
|
Record<string, unknown>,
|
|
97
92
|
number[]
|
|
98
93
|
]): void;
|
package/dist/Chart.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Chart.d.ts","sourceRoot":"","sources":["../src/Chart.tsx"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"Chart.d.ts","sourceRoot":"","sources":["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AAC,EAAE,OAAO,CAAC;IAEf,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB,YAAY,EAAE,OAAO,CAAC;IAEtB,aAAa,EAAE,OAAO,CAAC;IAEvB,eAAe,sBAEQ,OAAO,wBACJ,OAAO,0BACL,OAAO,0BACP,OAAO,QACzB,OAAO,KACZ,QAAQ,YAAY,CAAC,CA4DxB;IAEF,WAAW,IAAI,OAAO,GAAG,IAAI;IAI7B,QAAQ,IAAI,IAAI;IAYhB,SAAS,IAAI,IAAI;IAcjB,WAAW,IAAI,IAAI;IAUnB,eAAe,IAAI,IAAI;IAMvB,qBAAqB,IAAI,IAAI;IAgB7B,gBAAgB,CAAC,KAAK,EAAE,WAAW,GAAG,IAAI;IA0E1C,gBAAgB,CAAC,MAAM,EAAE,QAAQ,CAAC;QAAE,MAAM,EAAE,OAAO,CAAC,MAAM,CAAC,CAAA;KAAE,CAAC,GAAG,IAAI;IAgBrE,cAAc,CAAC,OAAO,EAAE;QAAE,YAAY,CAAC,EAAE,MAAM,EAAE,CAAA;KAAE,GAAG,IAAI;IAa1D,aAAa,CAAC,CAAC,OAAO,EAAE,aAAa,CAAC,EAAE,SAAS;QAC/C,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;QACvB,MAAM,EAAE;KACT,GAAG,IAAI;IAgBR;;;;;;;OAOG;IACH,qBAAqB,CAAC,KAAK,UAAQ,GAAG,IAAI;IAwB1C,aAAa,IAAI,IAAI;IAKrB,uBAAuB,CAAC,QAAQ,EAAE,iBAAiB,GAAG,IAAI;IAqB1D,eAAe,IAAI,IAAI;IAYvB,gBAAgB,IAAI,IAAI;IAsBxB,MAAM,IAAI,YAAY;CA0CvB;AAED,eAAe,KAAK,CAAC"}
|
package/dist/Chart.js
CHANGED
|
@@ -9,8 +9,8 @@ import memoize from 'memoize-one';
|
|
|
9
9
|
import { vsLoading, dhGraphLineDown, dhWarningFilled } from '@deephaven/icons';
|
|
10
10
|
import { Formatter, FormatterUtils, DateUtils } from '@deephaven/jsapi-utils';
|
|
11
11
|
import Log from '@deephaven/log';
|
|
12
|
+
import createPlotlyComponent from 'react-plotly.js/factory.js';
|
|
12
13
|
import Plotly from "./plotly/Plotly.js";
|
|
13
|
-
import Plot from "./plotly/Plot.js";
|
|
14
14
|
import ChartModel from "./ChartModel.js";
|
|
15
15
|
import ChartUtils from "./ChartUtils.js";
|
|
16
16
|
import "./Chart.css";
|
|
@@ -48,6 +48,7 @@ export class Chart extends Component {
|
|
|
48
48
|
constructor(props) {
|
|
49
49
|
super(props);
|
|
50
50
|
_defineProperty(this, "currentSeries", void 0);
|
|
51
|
+
_defineProperty(this, "PlotComponent", void 0);
|
|
51
52
|
_defineProperty(this, "plot", void 0);
|
|
52
53
|
_defineProperty(this, "plotWrapper", void 0);
|
|
53
54
|
_defineProperty(this, "columnFormats", void 0);
|
|
@@ -58,12 +59,13 @@ export class Chart extends Component {
|
|
|
58
59
|
_defineProperty(this, "ranges", void 0);
|
|
59
60
|
_defineProperty(this, "isSubscribed", void 0);
|
|
60
61
|
_defineProperty(this, "isLoadedFired", void 0);
|
|
61
|
-
_defineProperty(this, "getCachedConfig", memoize((downsamplingError, isDownsampleFinished, isDownsampleInProgress, isDownsamplingDisabled) => {
|
|
62
|
+
_defineProperty(this, "getCachedConfig", memoize((downsamplingError, isDownsampleFinished, isDownsampleInProgress, isDownsamplingDisabled, is3d) => {
|
|
62
63
|
var customButtons = [];
|
|
63
64
|
var hasDownsampleError = Boolean(downsamplingError);
|
|
64
65
|
if (hasDownsampleError) {
|
|
65
66
|
customButtons.push({
|
|
66
67
|
name: "Downsampling failed: ".concat(downsamplingError),
|
|
68
|
+
title: 'Downsampling failed',
|
|
67
69
|
click: () => undefined,
|
|
68
70
|
icon: Chart.convertIcon(dhWarningFilled),
|
|
69
71
|
attr: 'fill-warning'
|
|
@@ -75,6 +77,7 @@ export class Chart extends Component {
|
|
|
75
77
|
var icon = isDownsampleInProgress ? vsLoading : dhGraphLineDown;
|
|
76
78
|
customButtons.push({
|
|
77
79
|
name,
|
|
80
|
+
title: 'Downsampling status',
|
|
78
81
|
icon: Chart.convertIcon(icon),
|
|
79
82
|
click: this.handleDownsampleClick,
|
|
80
83
|
attr
|
|
@@ -88,7 +91,7 @@ export class Chart extends Component {
|
|
|
88
91
|
// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
|
|
89
92
|
isDownsampleInProgress || hasDownsampleError ? true : 'hover',
|
|
90
93
|
// Each array gets grouped together in the mode bar
|
|
91
|
-
modeBarButtons: [customButtons, ['toImage'], ['zoom2d', 'pan2d'], ['zoomIn2d', 'zoomOut2d', 'autoScale2d', 'resetScale2d']]
|
|
94
|
+
modeBarButtons: [customButtons, ['toImage'], is3d ? ['zoom3d', 'pan3d'] : ['zoom2d', 'pan2d'], is3d ? ['orbitRotation', 'tableRotation', 'resetCameraDefault3d'] : ['zoomIn2d', 'zoomOut2d', 'autoScale2d', 'resetScale2d']]
|
|
92
95
|
};
|
|
93
96
|
}));
|
|
94
97
|
this.handleAfterPlot = this.handleAfterPlot.bind(this);
|
|
@@ -97,6 +100,7 @@ export class Chart extends Component {
|
|
|
97
100
|
this.handlePlotUpdate = this.handlePlotUpdate.bind(this);
|
|
98
101
|
this.handleRelayout = this.handleRelayout.bind(this);
|
|
99
102
|
this.handleRestyle = this.handleRestyle.bind(this);
|
|
103
|
+
this.PlotComponent = createPlotlyComponent(props.Plotly);
|
|
100
104
|
this.plot = /*#__PURE__*/React.createRef();
|
|
101
105
|
this.plotWrapper = /*#__PURE__*/React.createRef();
|
|
102
106
|
this.columnFormats = [];
|
|
@@ -425,10 +429,13 @@ export class Chart extends Component {
|
|
|
425
429
|
}
|
|
426
430
|
updateDimensions() {
|
|
427
431
|
var rect = this.getPlotRect();
|
|
432
|
+
var {
|
|
433
|
+
Plotly: PlotlyProp
|
|
434
|
+
} = this.props;
|
|
428
435
|
if (this.plot.current != null && rect != null && rect.width > 0 && rect.height > 0) {
|
|
429
436
|
// Call relayout to resize avoiding the debouncing plotly does
|
|
430
437
|
// https://github.com/plotly/plotly.js/issues/2769#issuecomment-402099552
|
|
431
|
-
|
|
438
|
+
PlotlyProp.relayout(this.plot.current.el, {
|
|
432
439
|
autosize: true
|
|
433
440
|
}).catch(e => {
|
|
434
441
|
log.debug('Unable to resize, promise rejected', e);
|
|
@@ -436,6 +443,10 @@ export class Chart extends Component {
|
|
|
436
443
|
}
|
|
437
444
|
}
|
|
438
445
|
render() {
|
|
446
|
+
var _data$0$type$includes, _data$0$type;
|
|
447
|
+
var {
|
|
448
|
+
PlotComponent
|
|
449
|
+
} = this;
|
|
439
450
|
var {
|
|
440
451
|
data,
|
|
441
452
|
downsamplingError,
|
|
@@ -445,12 +456,15 @@ export class Chart extends Component {
|
|
|
445
456
|
layout,
|
|
446
457
|
revision
|
|
447
458
|
} = this.state;
|
|
448
|
-
var config = this.getCachedConfig(downsamplingError, isDownsampleFinished, isDownsampleInProgress, isDownsamplingDisabled);
|
|
459
|
+
var config = this.getCachedConfig(downsamplingError, isDownsampleFinished, isDownsampleInProgress, isDownsamplingDisabled, (_data$0$type$includes = data === null || data === void 0 ? void 0 : (_data$0$type = data[0].type) === null || _data$0$type === void 0 ? void 0 : _data$0$type.includes('3d')) !== null && _data$0$type$includes !== void 0 ? _data$0$type$includes : false);
|
|
449
460
|
var isPlotShown = data != null;
|
|
450
461
|
return /*#__PURE__*/React.createElement("div", {
|
|
451
462
|
className: "h-100 w-100 chart-wrapper",
|
|
452
463
|
ref: this.plotWrapper
|
|
453
|
-
}, isPlotShown && /*#__PURE__*/React.createElement(
|
|
464
|
+
}, isPlotShown && /*#__PURE__*/React.createElement(PlotComponent
|
|
465
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
466
|
+
// @ts-ignore
|
|
467
|
+
, {
|
|
454
468
|
ref: this.plot,
|
|
455
469
|
data: data,
|
|
456
470
|
layout: layout,
|
|
@@ -478,6 +492,7 @@ _defineProperty(Chart, "defaultProps", {
|
|
|
478
492
|
showTSeparator: true,
|
|
479
493
|
formatter: []
|
|
480
494
|
},
|
|
495
|
+
Plotly,
|
|
481
496
|
onDisconnect: () => undefined,
|
|
482
497
|
onReconnect: () => undefined,
|
|
483
498
|
onUpdate: () => undefined,
|
package/dist/Chart.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Chart.js","names":["React","Component","deepEqual","memoize","vsLoading","dhGraphLineDown","dhWarningFilled","Formatter","FormatterUtils","DateUtils","Log","Plotly","Plot","ChartModel","ChartUtils","log","module","Chart","convertIcon","faIcon","width","path","icon","stringPath","ascent","descent","transform","downsampleButtonTitle","isDownsampleInProgress","isDownsamplingDisabled","downsampleButtonAttr","undefined","constructor","props","downsamplingError","isDownsampleFinished","customButtons","hasDownsampleError","Boolean","push","name","click","attr","handleDownsampleClick","displaylogo","displayModeBar","modeBarButtons","handleAfterPlot","bind","handleModelEvent","handlePlotUpdate","handleRelayout","handleRestyle","plot","createRef","plotWrapper","columnFormats","dateTimeFormatterOptions","decimalFormatOptions","integerFormatOptions","isSubscribed","isLoadedFired","currentSeries","state","data","layout","datarevision","revision","componentDidMount","updateDimensions","updateModelDimensions","initData","initFormatter","isActive","subscribe","componentDidUpdate","prevProps","settings","updateFormatterSettings","unsubscribe","componentWillUnmount","getPlotRect","current","getBoundingClientRect","model","setState","getData","getLayout","rect","height","debug2","setDownsamplingDisabled","event","type","detail","EVENT_UPDATED","onUpdate","isLoading","EVENT_LOADFINISHED","EVENT_DISCONNECT","onDisconnect","EVENT_RECONNECT","onReconnect","EVENT_DOWNSAMPLESTARTED","EVENT_DOWNSAMPLEFINISHED","EVENT_DOWNSAMPLENEEDED","EVENT_DOWNSAMPLEFAILED","message","onError","Error","debug","figure","ranges","getLayoutRanges","isRangesChanged","changes","hiddenlabels","onSettingsChanged","hiddenSeries","seriesIndexes","Object","keys","includes","reduce","acc","visible","force","warn","isRectChanged","setDimensions","getColumnFormats","getDateTimeFormatterOptions","updateFormatter","formatter","dh","setFormatter","relayout","el","autosize","catch","e","render","config","getCachedConfig","isPlotShown","error","timeZone","defaultDateTimeFormat","FULL_DATE_FORMAT","showTimeZone","showTSeparator"],"sources":["../src/Chart.tsx"],"sourcesContent":["import React, { Component, ReactElement, RefObject } from 'react';\nimport deepEqual from 'deep-equal';\nimport memoize from 'memoize-one';\nimport {\n vsLoading,\n dhGraphLineDown,\n dhWarningFilled,\n IconDefinition,\n} from '@deephaven/icons';\nimport {\n Formatter,\n FormatterUtils,\n DateUtils,\n DateTimeColumnFormatterOptions,\n DecimalColumnFormatterOptions,\n IntegerColumnFormatterOptions,\n FormattingRule,\n ColumnFormatSettings,\n DateTimeFormatSettings,\n} from '@deephaven/jsapi-utils';\nimport Log from '@deephaven/log';\nimport { Layout, Icon, PlotData } from 'plotly.js';\nimport Plotly from './plotly/Plotly';\nimport Plot from './plotly/Plot';\nimport ChartModel from './ChartModel';\nimport ChartUtils, { ChartModelSettings } from './ChartUtils';\nimport './Chart.scss';\n\nconst log = Log.module('Chart');\n\ntype FormatterSettings = ColumnFormatSettings &\n DateTimeFormatSettings & {\n decimalFormatOptions?: DecimalColumnFormatterOptions;\n integerFormatOptions?: IntegerColumnFormatterOptions;\n };\n\ninterface ChartProps {\n model: ChartModel;\n settings: FormatterSettings;\n isActive: boolean;\n onDisconnect: () => void;\n onReconnect: () => void;\n onUpdate: (obj: { isLoading: boolean }) => void;\n onError: (error: Error) => void;\n onSettingsChanged: (settings: Partial<ChartModelSettings>) => void;\n}\n\ninterface ChartState {\n data: Partial<PlotData>[] | null;\n downsamplingError: unknown;\n isDownsampleFinished: boolean;\n isDownsampleInProgress: boolean;\n isDownsamplingDisabled: boolean;\n layout: Partial<Layout>;\n revision: number;\n}\n\nexport class Chart extends Component<ChartProps, ChartState> {\n static defaultProps = {\n isActive: true,\n settings: {\n timeZone: 'America/New_York',\n defaultDateTimeFormat: DateUtils.FULL_DATE_FORMAT,\n showTimeZone: false,\n showTSeparator: true,\n formatter: [],\n },\n onDisconnect: (): void => undefined,\n onReconnect: (): void => undefined,\n onUpdate: (): void => undefined,\n onError: (): void => undefined,\n onSettingsChanged: (): void => undefined,\n };\n\n /**\n * Convert a font awesome icon definition to a plotly icon definition\n * @param faIcon The icon to convert\n */\n static convertIcon(faIcon: IconDefinition): Icon {\n const [width, , , , path] = faIcon.icon;\n // By default the icons are flipped upside down, so we need to add our own transform\n // https://github.com/plotly/plotly.js/issues/1335\n const stringPath = `${path}`;\n return {\n width,\n path: stringPath,\n ascent: width,\n descent: 0,\n transform: `matrix(1, 0, 0, 1, 0, 0)`,\n };\n }\n\n static downsampleButtonTitle(\n isDownsampleInProgress: boolean,\n isDownsamplingDisabled: boolean\n ): string {\n if (isDownsampleInProgress) {\n return 'Downsampling in progress...';\n }\n\n return isDownsamplingDisabled\n ? 'Downsampling disabled, click to enable'\n : 'Downsampling enabled, click to disable';\n }\n\n static downsampleButtonAttr(\n isDownsampleInProgress: boolean,\n isDownsamplingDisabled: boolean\n ): string | undefined {\n if (isDownsampleInProgress) {\n return 'animation-spin';\n }\n\n return isDownsamplingDisabled ? undefined : 'fill-active';\n }\n\n constructor(props: ChartProps) {\n super(props);\n\n this.handleAfterPlot = this.handleAfterPlot.bind(this);\n this.handleDownsampleClick = this.handleDownsampleClick.bind(this);\n this.handleModelEvent = this.handleModelEvent.bind(this);\n this.handlePlotUpdate = this.handlePlotUpdate.bind(this);\n this.handleRelayout = this.handleRelayout.bind(this);\n this.handleRestyle = this.handleRestyle.bind(this);\n\n this.plot = React.createRef();\n this.plotWrapper = React.createRef();\n this.columnFormats = [];\n this.dateTimeFormatterOptions = {};\n this.decimalFormatOptions = {};\n this.integerFormatOptions = {};\n this.isSubscribed = false;\n this.isLoadedFired = false;\n this.currentSeries = 0;\n\n this.state = {\n data: null,\n downsamplingError: null,\n isDownsampleFinished: false,\n isDownsampleInProgress: false,\n isDownsamplingDisabled: false,\n layout: {\n datarevision: 0,\n },\n revision: 0,\n };\n }\n\n componentDidMount(): void {\n // Need to make sure the model dimensions are up to date before initializing the data\n this.updateDimensions();\n this.updateModelDimensions();\n\n this.initData();\n this.initFormatter();\n\n const { isActive } = this.props;\n if (isActive) {\n this.subscribe();\n }\n }\n\n componentDidUpdate(prevProps: ChartProps): void {\n const { isActive, settings } = this.props;\n this.updateFormatterSettings(settings as FormatterSettings);\n\n if (isActive !== prevProps.isActive) {\n if (isActive) {\n this.subscribe();\n } else {\n this.unsubscribe();\n }\n }\n }\n\n componentWillUnmount(): void {\n this.unsubscribe();\n }\n\n currentSeries: number;\n\n plot: RefObject<typeof Plot>;\n\n plotWrapper: RefObject<HTMLDivElement>;\n\n columnFormats?: FormattingRule[];\n\n dateTimeFormatterOptions?: DateTimeColumnFormatterOptions;\n\n decimalFormatOptions: DecimalColumnFormatterOptions;\n\n integerFormatOptions: IntegerColumnFormatterOptions;\n\n rect?: DOMRect;\n\n ranges?: unknown;\n\n isSubscribed: boolean;\n\n isLoadedFired: boolean;\n\n getCachedConfig = memoize(\n (\n downsamplingError: unknown,\n isDownsampleFinished: boolean,\n isDownsampleInProgress: boolean,\n isDownsamplingDisabled: boolean\n ) => {\n const customButtons = [];\n const hasDownsampleError = Boolean(downsamplingError);\n if (hasDownsampleError) {\n customButtons.push({\n name: `Downsampling failed: ${downsamplingError}`,\n click: () => undefined,\n icon: Chart.convertIcon(dhWarningFilled),\n attr: 'fill-warning',\n });\n }\n\n if (\n isDownsampleFinished ||\n isDownsampleInProgress ||\n isDownsamplingDisabled ||\n hasDownsampleError\n ) {\n const name = Chart.downsampleButtonTitle(\n isDownsampleInProgress,\n isDownsamplingDisabled\n );\n const attr = Chart.downsampleButtonAttr(\n isDownsampleInProgress,\n isDownsamplingDisabled\n );\n\n const icon = isDownsampleInProgress ? vsLoading : dhGraphLineDown;\n customButtons.push({\n name,\n icon: Chart.convertIcon(icon),\n click: this.handleDownsampleClick,\n attr,\n });\n }\n\n return {\n displaylogo: false,\n\n // Display the mode bar if there's an error or downsampling so user can see progress\n // Yes, the value is a boolean or the string 'hover': https://github.com/plotly/plotly.js/blob/master/src/plot_api/plot_config.js#L249\n displayModeBar:\n // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions\n isDownsampleInProgress || hasDownsampleError ? true : 'hover',\n\n // Each array gets grouped together in the mode bar\n modeBarButtons: [\n customButtons,\n ['toImage'],\n ['zoom2d', 'pan2d'],\n ['zoomIn2d', 'zoomOut2d', 'autoScale2d', 'resetScale2d'],\n ],\n };\n }\n );\n\n getPlotRect(): DOMRect | null {\n return this.plotWrapper.current?.getBoundingClientRect() ?? null;\n }\n\n initData(): void {\n const { model } = this.props;\n const { layout } = this.state;\n this.setState({\n data: model.getData(),\n layout: {\n ...layout,\n ...model.getLayout(),\n },\n });\n }\n\n subscribe(): void {\n if (this.isSubscribed) {\n return;\n }\n\n const { model } = this.props;\n if (!this.rect || this.rect.width === 0 || this.rect.height === 0) {\n log.debug2('Delaying subscription until model dimensions are set');\n return;\n }\n model.subscribe(this.handleModelEvent);\n this.isSubscribed = true;\n }\n\n unsubscribe(): void {\n if (!this.isSubscribed) {\n return;\n }\n\n const { model } = this.props;\n model.unsubscribe(this.handleModelEvent);\n this.isSubscribed = false;\n }\n\n handleAfterPlot(): void {\n if (this.plot.current != null) {\n // TODO: Translate whatever Don was doing in plotting.js in the afterplot here so that area graphs show up properly\n }\n }\n\n handleDownsampleClick(): void {\n this.setState(\n ({ isDownsamplingDisabled }) => ({\n downsamplingError: null,\n isDownsampleInProgress: false,\n isDownsampleFinished: false,\n isDownsamplingDisabled: !isDownsamplingDisabled,\n }),\n () => {\n const { model } = this.props;\n const { isDownsamplingDisabled } = this.state;\n model.setDownsamplingDisabled(isDownsamplingDisabled);\n }\n );\n }\n\n handleModelEvent(event: CustomEvent): void {\n const { type, detail } = event;\n log.debug2('Received data update', type, detail);\n\n switch (type) {\n case ChartModel.EVENT_UPDATED: {\n this.currentSeries += 1;\n this.setState(state => {\n const { layout, revision } = state;\n if (typeof layout.datarevision === 'number') {\n layout.datarevision += 1;\n }\n return {\n data: detail,\n layout,\n revision: revision + 1,\n };\n });\n\n const { onUpdate } = this.props;\n onUpdate({ isLoading: !this.isLoadedFired });\n break;\n }\n case ChartModel.EVENT_LOADFINISHED: {\n const { onUpdate } = this.props;\n this.isLoadedFired = true;\n onUpdate({ isLoading: false });\n break;\n }\n case ChartModel.EVENT_DISCONNECT: {\n const { onDisconnect } = this.props;\n onDisconnect();\n break;\n }\n case ChartModel.EVENT_RECONNECT: {\n const { onReconnect } = this.props;\n onReconnect();\n break;\n }\n case ChartModel.EVENT_DOWNSAMPLESTARTED: {\n this.setState({\n isDownsampleFinished: false,\n isDownsampleInProgress: true,\n downsamplingError: null,\n });\n break;\n }\n case ChartModel.EVENT_DOWNSAMPLEFINISHED: {\n this.setState({\n isDownsampleFinished: true,\n isDownsampleInProgress: false,\n downsamplingError: null,\n });\n break;\n }\n case ChartModel.EVENT_DOWNSAMPLENEEDED:\n case ChartModel.EVENT_DOWNSAMPLEFAILED: {\n const downsamplingError = detail.message ?? detail;\n this.setState({\n isDownsampleFinished: false,\n isDownsampleInProgress: false,\n isDownsamplingDisabled: false,\n downsamplingError,\n });\n\n const { onError } = this.props;\n onError(new Error(downsamplingError));\n break;\n }\n default:\n log.debug('Unknown event type', type, event);\n }\n }\n\n handlePlotUpdate(figure: { layout: Layout }): void {\n // User could have modified zoom/pan here, update the model dimensions\n // We don't need to update the datarevision, as we don't have any data changes\n // until an update comes back from the server anyway\n const { layout } = figure;\n const ranges = ChartUtils.getLayoutRanges(layout);\n\n const isRangesChanged = !deepEqual(ranges, this.ranges);\n\n if (isRangesChanged) {\n this.ranges = ranges;\n\n this.updateModelDimensions(true);\n }\n }\n\n handleRelayout(changes: { hiddenlabels?: string[] }): void {\n log.debug('handleRelayout', changes);\n if (changes.hiddenlabels != null) {\n const { onSettingsChanged } = this.props;\n // Pie charts store series visibility in layout.hiddenlabels and trigger relayout on changes\n // Series visibility for other types of charts is handled in handleRestyle\n const hiddenSeries = [...changes.hiddenlabels];\n onSettingsChanged({ hiddenSeries });\n }\n\n this.updateModelDimensions();\n }\n\n handleRestyle([changes, seriesIndexes]: [\n Record<string, unknown>,\n number[]\n ]): void {\n log.debug('handleRestyle', changes, seriesIndexes);\n if (Object.keys(changes).includes('visible')) {\n const { data } = this.state;\n const { onSettingsChanged } = this.props;\n if (data != null) {\n const hiddenSeries = data.reduce(\n (acc: string[], { name, visible }) =>\n name != null && visible === 'legendonly' ? [...acc, name] : acc,\n []\n );\n onSettingsChanged({ hiddenSeries });\n }\n }\n }\n\n /**\n * Update the models dimensions and ranges.\n * Note that this will update it all whether the plot size changes OR the range\n * the user is looking at has changed (eg. panning/zooming).\n * Could update each independently, but doing them at the same time keeps the\n * ChartModel API a bit cleaner.\n * @param force Force a change even if the chart dimensions haven't changed (eg. after pan/zoom)\n */\n updateModelDimensions(force = false): void {\n const rect = this.getPlotRect();\n if (!rect) {\n log.warn('Unable to get plotting rect');\n return;\n }\n\n const isRectChanged =\n !this.rect ||\n this.rect.width !== rect.width ||\n this.rect.height !== rect.height;\n\n if (isRectChanged || force) {\n this.rect = rect;\n\n const { isActive, model } = this.props;\n model.setDimensions(rect);\n // We may need to resubscribe if dimensions were too small before\n if (isActive) {\n this.subscribe();\n }\n }\n }\n\n initFormatter(): void {\n const { settings } = this.props;\n this.updateFormatterSettings(settings as FormatterSettings);\n }\n\n updateFormatterSettings(settings: FormatterSettings): void {\n const columnFormats = FormatterUtils.getColumnFormats(settings);\n const dateTimeFormatterOptions = FormatterUtils.getDateTimeFormatterOptions(\n settings\n );\n const { decimalFormatOptions = {}, integerFormatOptions = {} } = settings;\n\n if (\n !deepEqual(this.columnFormats, columnFormats) ||\n !deepEqual(this.dateTimeFormatterOptions, dateTimeFormatterOptions) ||\n !deepEqual(this.decimalFormatOptions, decimalFormatOptions) ||\n !deepEqual(this.integerFormatOptions, integerFormatOptions)\n ) {\n this.columnFormats = FormatterUtils.getColumnFormats(settings);\n this.dateTimeFormatterOptions = dateTimeFormatterOptions;\n this.decimalFormatOptions = decimalFormatOptions;\n this.integerFormatOptions = integerFormatOptions;\n this.updateFormatter();\n }\n }\n\n updateFormatter(): void {\n const { model } = this.props;\n const formatter = new Formatter(\n model.dh,\n this.columnFormats,\n this.dateTimeFormatterOptions,\n this.decimalFormatOptions,\n this.integerFormatOptions\n );\n model.setFormatter(formatter);\n }\n\n updateDimensions(): void {\n const rect = this.getPlotRect();\n if (\n this.plot.current != null &&\n rect != null &&\n rect.width > 0 &&\n rect.height > 0\n ) {\n // Call relayout to resize avoiding the debouncing plotly does\n // https://github.com/plotly/plotly.js/issues/2769#issuecomment-402099552\n Plotly.relayout(this.plot.current.el, { autosize: true }).catch(\n (e: unknown) => {\n log.debug('Unable to resize, promise rejected', e);\n }\n );\n }\n }\n\n render(): ReactElement {\n const {\n data,\n downsamplingError,\n isDownsampleFinished,\n isDownsampleInProgress,\n isDownsamplingDisabled,\n layout,\n revision,\n } = this.state;\n const config = this.getCachedConfig(\n downsamplingError,\n isDownsampleFinished,\n isDownsampleInProgress,\n isDownsamplingDisabled\n );\n const isPlotShown = data != null;\n return (\n <div className=\"h-100 w-100 chart-wrapper\" ref={this.plotWrapper}>\n {isPlotShown && (\n <Plot\n ref={this.plot}\n data={data}\n layout={layout}\n revision={revision}\n config={config}\n onAfterPlot={this.handleAfterPlot}\n onError={log.error}\n onRelayout={this.handleRelayout}\n onUpdate={this.handlePlotUpdate}\n onRestyle={this.handleRestyle}\n useResizeHandler\n style={{ height: '100%', width: '100%' }}\n />\n )}\n </div>\n );\n }\n}\n\nexport default Chart;\n"],"mappings":";;;;;AAAA,OAAOA,KAAK,IAAIC,SAAS,QAAiC,OAAO;AACjE,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,OAAO,MAAM,aAAa;AACjC,SACEC,SAAS,EACTC,eAAe,EACfC,eAAe,QAEV,kBAAkB;AACzB,SACEC,SAAS,EACTC,cAAc,EACdC,SAAS,QAOJ,wBAAwB;AAC/B,OAAOC,GAAG,MAAM,gBAAgB;AAAC,OAE1BC,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AAQ,EAAE,IAAI,CAACD,gBAAiB;MAChC,SAAS,EAAE,IAAI,CAACE,aAAc;MAC9B,gBAAgB;MAChB,KAAK,EAAE;QAAEqC,MAAM,EAAE,MAAM;QAAErE,KAAK,EAAE;MAAO;IAAE,EAE5C,CACG;EAEV;AACF;AAAC,gBArgBYH,KAAK,kBACM;EACpBwD,QAAQ,EAAE,IAAI;EACdI,QAAQ,EAAE;IACRqE,QAAQ,EAAE,kBAAkB;IAC5BC,qBAAqB,EAAE1I,SAAS,CAAC2I,gBAAgB;IACjDC,YAAY,EAAE,KAAK;IACnBC,cAAc,EAAE,IAAI;IACpBjB,SAAS,EAAE;EACb,CAAC;EACDjC,YAAY,EAAE,MAAYrE,SAAS;EACnCuE,WAAW,EAAE,MAAYvE,SAAS;EAClCiE,QAAQ,EAAE,MAAYjE,SAAS;EAC/B6E,OAAO,EAAE,MAAY7E,SAAS;EAC9BsF,iBAAiB,EAAE,MAAYtF;AACjC,CAAC;AAwfH,eAAed,KAAK"}
|
|
1
|
+
{"version":3,"file":"Chart.js","names":["React","Component","deepEqual","memoize","vsLoading","dhGraphLineDown","dhWarningFilled","Formatter","FormatterUtils","DateUtils","Log","createPlotlyComponent","Plotly","ChartModel","ChartUtils","log","module","Chart","convertIcon","faIcon","width","path","icon","stringPath","ascent","descent","transform","downsampleButtonTitle","isDownsampleInProgress","isDownsamplingDisabled","downsampleButtonAttr","undefined","constructor","props","downsamplingError","isDownsampleFinished","is3d","customButtons","hasDownsampleError","Boolean","push","name","title","click","attr","handleDownsampleClick","displaylogo","displayModeBar","modeBarButtons","handleAfterPlot","bind","handleModelEvent","handlePlotUpdate","handleRelayout","handleRestyle","PlotComponent","plot","createRef","plotWrapper","columnFormats","dateTimeFormatterOptions","decimalFormatOptions","integerFormatOptions","isSubscribed","isLoadedFired","currentSeries","state","data","layout","datarevision","revision","componentDidMount","updateDimensions","updateModelDimensions","initData","initFormatter","isActive","subscribe","componentDidUpdate","prevProps","settings","updateFormatterSettings","unsubscribe","componentWillUnmount","getPlotRect","current","getBoundingClientRect","model","setState","getData","getLayout","rect","height","debug2","setDownsamplingDisabled","event","type","detail","EVENT_UPDATED","onUpdate","isLoading","EVENT_LOADFINISHED","EVENT_DISCONNECT","onDisconnect","EVENT_RECONNECT","onReconnect","EVENT_DOWNSAMPLESTARTED","EVENT_DOWNSAMPLEFINISHED","EVENT_DOWNSAMPLENEEDED","EVENT_DOWNSAMPLEFAILED","message","onError","Error","debug","figure","ranges","getLayoutRanges","isRangesChanged","changes","hiddenlabels","onSettingsChanged","hiddenSeries","seriesIndexes","Object","keys","includes","reduce","acc","visible","force","warn","isRectChanged","setDimensions","getColumnFormats","getDateTimeFormatterOptions","updateFormatter","formatter","dh","setFormatter","PlotlyProp","relayout","el","autosize","catch","e","render","config","getCachedConfig","isPlotShown","error","timeZone","defaultDateTimeFormat","FULL_DATE_FORMAT","showTimeZone","showTSeparator"],"sources":["../src/Chart.tsx"],"sourcesContent":["import React, { Component, ReactElement, RefObject } from 'react';\nimport deepEqual from 'deep-equal';\nimport memoize from 'memoize-one';\nimport {\n vsLoading,\n dhGraphLineDown,\n dhWarningFilled,\n IconDefinition,\n} from '@deephaven/icons';\nimport {\n Formatter,\n FormatterUtils,\n DateUtils,\n DateTimeColumnFormatterOptions,\n DecimalColumnFormatterOptions,\n IntegerColumnFormatterOptions,\n FormattingRule,\n ColumnFormatSettings,\n DateTimeFormatSettings,\n} from '@deephaven/jsapi-utils';\nimport Log from '@deephaven/log';\nimport {\n Config as PlotlyConfig,\n Layout,\n Icon,\n Data,\n PlotData,\n ModeBarButtonAny,\n} from 'plotly.js';\nimport type { PlotParams } from 'react-plotly.js';\nimport createPlotlyComponent from 'react-plotly.js/factory.js';\nimport Plotly from './plotly/Plotly';\nimport ChartModel from './ChartModel';\nimport ChartUtils, { ChartModelSettings } from './ChartUtils';\nimport './Chart.scss';\n\nconst log = Log.module('Chart');\n\ntype FormatterSettings = ColumnFormatSettings &\n DateTimeFormatSettings & {\n decimalFormatOptions?: DecimalColumnFormatterOptions;\n integerFormatOptions?: IntegerColumnFormatterOptions;\n };\n\ninterface ChartProps {\n model: ChartModel;\n settings: FormatterSettings;\n isActive: boolean;\n Plotly: typeof Plotly;\n onDisconnect: () => void;\n onReconnect: () => void;\n onUpdate: (obj: { isLoading: boolean }) => void;\n onError: (error: Error) => void;\n onSettingsChanged: (settings: Partial<ChartModelSettings>) => void;\n}\n\ninterface ChartState {\n data: Partial<Data>[] | null;\n downsamplingError: unknown;\n isDownsampleFinished: boolean;\n isDownsampleInProgress: boolean;\n isDownsamplingDisabled: boolean;\n layout: Partial<Layout>;\n revision: number;\n}\n\nexport class Chart extends Component<ChartProps, ChartState> {\n static defaultProps = {\n isActive: true,\n settings: {\n timeZone: 'America/New_York',\n defaultDateTimeFormat: DateUtils.FULL_DATE_FORMAT,\n showTimeZone: false,\n showTSeparator: true,\n formatter: [],\n },\n Plotly,\n onDisconnect: (): void => undefined,\n onReconnect: (): void => undefined,\n onUpdate: (): void => undefined,\n onError: (): void => undefined,\n onSettingsChanged: (): void => undefined,\n };\n\n /**\n * Convert a font awesome icon definition to a plotly icon definition\n * @param faIcon The icon to convert\n */\n static convertIcon(faIcon: IconDefinition): Icon {\n const [width, , , , path] = faIcon.icon;\n // By default the icons are flipped upside down, so we need to add our own transform\n // https://github.com/plotly/plotly.js/issues/1335\n const stringPath = `${path}`;\n return {\n width,\n path: stringPath,\n ascent: width,\n descent: 0,\n transform: `matrix(1, 0, 0, 1, 0, 0)`,\n };\n }\n\n static downsampleButtonTitle(\n isDownsampleInProgress: boolean,\n isDownsamplingDisabled: boolean\n ): string {\n if (isDownsampleInProgress) {\n return 'Downsampling in progress...';\n }\n\n return isDownsamplingDisabled\n ? 'Downsampling disabled, click to enable'\n : 'Downsampling enabled, click to disable';\n }\n\n static downsampleButtonAttr(\n isDownsampleInProgress: boolean,\n isDownsamplingDisabled: boolean\n ): string | undefined {\n if (isDownsampleInProgress) {\n return 'animation-spin';\n }\n\n return isDownsamplingDisabled ? undefined : 'fill-active';\n }\n\n constructor(props: ChartProps) {\n super(props);\n\n this.handleAfterPlot = this.handleAfterPlot.bind(this);\n this.handleDownsampleClick = this.handleDownsampleClick.bind(this);\n this.handleModelEvent = this.handleModelEvent.bind(this);\n this.handlePlotUpdate = this.handlePlotUpdate.bind(this);\n this.handleRelayout = this.handleRelayout.bind(this);\n this.handleRestyle = this.handleRestyle.bind(this);\n\n this.PlotComponent = createPlotlyComponent(props.Plotly);\n this.plot = React.createRef();\n this.plotWrapper = React.createRef();\n this.columnFormats = [];\n this.dateTimeFormatterOptions = {};\n this.decimalFormatOptions = {};\n this.integerFormatOptions = {};\n this.isSubscribed = false;\n this.isLoadedFired = false;\n this.currentSeries = 0;\n\n this.state = {\n data: null,\n downsamplingError: null,\n isDownsampleFinished: false,\n isDownsampleInProgress: false,\n isDownsamplingDisabled: false,\n layout: {\n datarevision: 0,\n },\n revision: 0,\n };\n }\n\n componentDidMount(): void {\n // Need to make sure the model dimensions are up to date before initializing the data\n this.updateDimensions();\n this.updateModelDimensions();\n\n this.initData();\n this.initFormatter();\n\n const { isActive } = this.props;\n if (isActive) {\n this.subscribe();\n }\n }\n\n componentDidUpdate(prevProps: ChartProps): void {\n const { isActive, settings } = this.props;\n this.updateFormatterSettings(settings as FormatterSettings);\n\n if (isActive !== prevProps.isActive) {\n if (isActive) {\n this.subscribe();\n } else {\n this.unsubscribe();\n }\n }\n }\n\n componentWillUnmount(): void {\n this.unsubscribe();\n }\n\n currentSeries: number;\n\n PlotComponent: React.ComponentType<PlotParams>;\n\n plot: RefObject<typeof this.PlotComponent>;\n\n plotWrapper: RefObject<HTMLDivElement>;\n\n columnFormats?: FormattingRule[];\n\n dateTimeFormatterOptions?: DateTimeColumnFormatterOptions;\n\n decimalFormatOptions: DecimalColumnFormatterOptions;\n\n integerFormatOptions: IntegerColumnFormatterOptions;\n\n rect?: DOMRect;\n\n ranges?: unknown;\n\n isSubscribed: boolean;\n\n isLoadedFired: boolean;\n\n getCachedConfig = memoize(\n (\n downsamplingError: unknown,\n isDownsampleFinished: boolean,\n isDownsampleInProgress: boolean,\n isDownsamplingDisabled: boolean,\n is3d: boolean\n ): Partial<PlotlyConfig> => {\n const customButtons: ModeBarButtonAny[] = [];\n const hasDownsampleError = Boolean(downsamplingError);\n if (hasDownsampleError) {\n customButtons.push({\n name: `Downsampling failed: ${downsamplingError}`,\n title: 'Downsampling failed',\n click: () => undefined,\n icon: Chart.convertIcon(dhWarningFilled),\n attr: 'fill-warning',\n });\n }\n\n if (\n isDownsampleFinished ||\n isDownsampleInProgress ||\n isDownsamplingDisabled ||\n hasDownsampleError\n ) {\n const name = Chart.downsampleButtonTitle(\n isDownsampleInProgress,\n isDownsamplingDisabled\n );\n const attr = Chart.downsampleButtonAttr(\n isDownsampleInProgress,\n isDownsamplingDisabled\n );\n\n const icon = isDownsampleInProgress ? vsLoading : dhGraphLineDown;\n customButtons.push({\n name,\n title: 'Downsampling status',\n icon: Chart.convertIcon(icon),\n click: this.handleDownsampleClick,\n attr,\n });\n }\n\n return {\n displaylogo: false,\n\n // Display the mode bar if there's an error or downsampling so user can see progress\n // Yes, the value is a boolean or the string 'hover': https://github.com/plotly/plotly.js/blob/master/src/plot_api/plot_config.js#L249\n displayModeBar:\n // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions\n isDownsampleInProgress || hasDownsampleError\n ? true\n : ('hover' as const),\n\n // Each array gets grouped together in the mode bar\n modeBarButtons: [\n customButtons,\n ['toImage'],\n is3d ? ['zoom3d', 'pan3d'] : ['zoom2d', 'pan2d'],\n is3d\n ? ['orbitRotation', 'tableRotation', 'resetCameraDefault3d']\n : ['zoomIn2d', 'zoomOut2d', 'autoScale2d', 'resetScale2d'],\n ],\n };\n }\n );\n\n getPlotRect(): DOMRect | null {\n return this.plotWrapper.current?.getBoundingClientRect() ?? null;\n }\n\n initData(): void {\n const { model } = this.props;\n const { layout } = this.state;\n this.setState({\n data: model.getData(),\n layout: {\n ...layout,\n ...model.getLayout(),\n },\n });\n }\n\n subscribe(): void {\n if (this.isSubscribed) {\n return;\n }\n\n const { model } = this.props;\n if (!this.rect || this.rect.width === 0 || this.rect.height === 0) {\n log.debug2('Delaying subscription until model dimensions are set');\n return;\n }\n model.subscribe(this.handleModelEvent);\n this.isSubscribed = true;\n }\n\n unsubscribe(): void {\n if (!this.isSubscribed) {\n return;\n }\n\n const { model } = this.props;\n model.unsubscribe(this.handleModelEvent);\n this.isSubscribed = false;\n }\n\n handleAfterPlot(): void {\n if (this.plot.current != null) {\n // TODO: Translate whatever Don was doing in plotting.js in the afterplot here so that area graphs show up properly\n }\n }\n\n handleDownsampleClick(): void {\n this.setState(\n ({ isDownsamplingDisabled }) => ({\n downsamplingError: null,\n isDownsampleInProgress: false,\n isDownsampleFinished: false,\n isDownsamplingDisabled: !isDownsamplingDisabled,\n }),\n () => {\n const { model } = this.props;\n const { isDownsamplingDisabled } = this.state;\n model.setDownsamplingDisabled(isDownsamplingDisabled);\n }\n );\n }\n\n handleModelEvent(event: CustomEvent): void {\n const { type, detail } = event;\n log.debug2('Received data update', type, detail);\n\n switch (type) {\n case ChartModel.EVENT_UPDATED: {\n this.currentSeries += 1;\n this.setState(state => {\n const { layout, revision } = state;\n if (typeof layout.datarevision === 'number') {\n layout.datarevision += 1;\n }\n return {\n data: detail,\n layout,\n revision: revision + 1,\n };\n });\n\n const { onUpdate } = this.props;\n onUpdate({ isLoading: !this.isLoadedFired });\n break;\n }\n case ChartModel.EVENT_LOADFINISHED: {\n const { onUpdate } = this.props;\n this.isLoadedFired = true;\n onUpdate({ isLoading: false });\n break;\n }\n case ChartModel.EVENT_DISCONNECT: {\n const { onDisconnect } = this.props;\n onDisconnect();\n break;\n }\n case ChartModel.EVENT_RECONNECT: {\n const { onReconnect } = this.props;\n onReconnect();\n break;\n }\n case ChartModel.EVENT_DOWNSAMPLESTARTED: {\n this.setState({\n isDownsampleFinished: false,\n isDownsampleInProgress: true,\n downsamplingError: null,\n });\n break;\n }\n case ChartModel.EVENT_DOWNSAMPLEFINISHED: {\n this.setState({\n isDownsampleFinished: true,\n isDownsampleInProgress: false,\n downsamplingError: null,\n });\n break;\n }\n case ChartModel.EVENT_DOWNSAMPLENEEDED:\n case ChartModel.EVENT_DOWNSAMPLEFAILED: {\n const downsamplingError = detail.message ?? detail;\n this.setState({\n isDownsampleFinished: false,\n isDownsampleInProgress: false,\n isDownsamplingDisabled: false,\n downsamplingError,\n });\n\n const { onError } = this.props;\n onError(new Error(downsamplingError));\n break;\n }\n default:\n log.debug('Unknown event type', type, event);\n }\n }\n\n handlePlotUpdate(figure: Readonly<{ layout: Partial<Layout> }>): void {\n // User could have modified zoom/pan here, update the model dimensions\n // We don't need to update the datarevision, as we don't have any data changes\n // until an update comes back from the server anyway\n const { layout } = figure;\n const ranges = ChartUtils.getLayoutRanges(layout);\n\n const isRangesChanged = !deepEqual(ranges, this.ranges);\n\n if (isRangesChanged) {\n this.ranges = ranges;\n\n this.updateModelDimensions(true);\n }\n }\n\n handleRelayout(changes: { hiddenlabels?: string[] }): void {\n log.debug('handleRelayout', changes);\n if (changes.hiddenlabels != null) {\n const { onSettingsChanged } = this.props;\n // Pie charts store series visibility in layout.hiddenlabels and trigger relayout on changes\n // Series visibility for other types of charts is handled in handleRestyle\n const hiddenSeries = [...changes.hiddenlabels];\n onSettingsChanged({ hiddenSeries });\n }\n\n this.updateModelDimensions();\n }\n\n handleRestyle([changes, seriesIndexes]: readonly [\n Record<string, unknown>,\n number[]\n ]): void {\n log.debug('handleRestyle', changes, seriesIndexes);\n if (Object.keys(changes).includes('visible')) {\n const { data } = this.state;\n const { onSettingsChanged } = this.props;\n if (data != null) {\n const hiddenSeries = (data as Partial<PlotData>[]).reduce(\n (acc: string[], { name, visible }) =>\n name != null && visible === 'legendonly' ? [...acc, name] : acc,\n []\n );\n onSettingsChanged({ hiddenSeries });\n }\n }\n }\n\n /**\n * Update the models dimensions and ranges.\n * Note that this will update it all whether the plot size changes OR the range\n * the user is looking at has changed (eg. panning/zooming).\n * Could update each independently, but doing them at the same time keeps the\n * ChartModel API a bit cleaner.\n * @param force Force a change even if the chart dimensions haven't changed (eg. after pan/zoom)\n */\n updateModelDimensions(force = false): void {\n const rect = this.getPlotRect();\n if (!rect) {\n log.warn('Unable to get plotting rect');\n return;\n }\n\n const isRectChanged =\n !this.rect ||\n this.rect.width !== rect.width ||\n this.rect.height !== rect.height;\n\n if (isRectChanged || force) {\n this.rect = rect;\n\n const { isActive, model } = this.props;\n model.setDimensions(rect);\n // We may need to resubscribe if dimensions were too small before\n if (isActive) {\n this.subscribe();\n }\n }\n }\n\n initFormatter(): void {\n const { settings } = this.props;\n this.updateFormatterSettings(settings as FormatterSettings);\n }\n\n updateFormatterSettings(settings: FormatterSettings): void {\n const columnFormats = FormatterUtils.getColumnFormats(settings);\n const dateTimeFormatterOptions = FormatterUtils.getDateTimeFormatterOptions(\n settings\n );\n const { decimalFormatOptions = {}, integerFormatOptions = {} } = settings;\n\n if (\n !deepEqual(this.columnFormats, columnFormats) ||\n !deepEqual(this.dateTimeFormatterOptions, dateTimeFormatterOptions) ||\n !deepEqual(this.decimalFormatOptions, decimalFormatOptions) ||\n !deepEqual(this.integerFormatOptions, integerFormatOptions)\n ) {\n this.columnFormats = FormatterUtils.getColumnFormats(settings);\n this.dateTimeFormatterOptions = dateTimeFormatterOptions;\n this.decimalFormatOptions = decimalFormatOptions;\n this.integerFormatOptions = integerFormatOptions;\n this.updateFormatter();\n }\n }\n\n updateFormatter(): void {\n const { model } = this.props;\n const formatter = new Formatter(\n model.dh,\n this.columnFormats,\n this.dateTimeFormatterOptions,\n this.decimalFormatOptions,\n this.integerFormatOptions\n );\n model.setFormatter(formatter);\n }\n\n updateDimensions(): void {\n const rect = this.getPlotRect();\n const { Plotly: PlotlyProp } = this.props;\n if (\n this.plot.current != null &&\n rect != null &&\n rect.width > 0 &&\n rect.height > 0\n ) {\n // Call relayout to resize avoiding the debouncing plotly does\n // https://github.com/plotly/plotly.js/issues/2769#issuecomment-402099552\n PlotlyProp.relayout(\n ((this.plot.current as unknown) as { el: HTMLElement }).el,\n {\n autosize: true,\n }\n ).catch((e: unknown) => {\n log.debug('Unable to resize, promise rejected', e);\n });\n }\n }\n\n render(): ReactElement {\n const { PlotComponent } = this;\n const {\n data,\n downsamplingError,\n isDownsampleFinished,\n isDownsampleInProgress,\n isDownsamplingDisabled,\n layout,\n revision,\n } = this.state;\n const config = this.getCachedConfig(\n downsamplingError,\n isDownsampleFinished,\n isDownsampleInProgress,\n isDownsamplingDisabled,\n data?.[0].type?.includes('3d') ?? false\n );\n const isPlotShown = data != null;\n return (\n <div className=\"h-100 w-100 chart-wrapper\" ref={this.plotWrapper}>\n {isPlotShown && (\n <PlotComponent\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n ref={this.plot}\n data={data}\n layout={layout}\n revision={revision}\n config={config}\n onAfterPlot={this.handleAfterPlot}\n onError={log.error}\n onRelayout={this.handleRelayout}\n onUpdate={this.handlePlotUpdate}\n onRestyle={this.handleRestyle}\n useResizeHandler\n style={{ height: '100%', width: '100%' }}\n />\n )}\n </div>\n );\n }\n}\n\nexport default Chart;\n"],"mappings":";;;;;AAAA,OAAOA,KAAK,IAAIC,SAAS,QAAiC,OAAO;AACjE,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,OAAO,MAAM,aAAa;AACjC,SACEC,SAAS,EACTC,eAAe,EACfC,eAAe,QAEV,kBAAkB;AACzB,SACEC,SAAS,EACTC,cAAc,EACdC,SAAS,QAOJ,wBAAwB;AAC/B,OAAOC,GAAG,MAAM,gBAAgB;AAUhC,OAAOC,qBAAqB,MAAM,4BAA4B;AAAC,OACxDC,MAAM;AAAA,OACNC,UAAU;AAAA,OACVC,UAAU;AAAA;AAGjB,IAAMC,GAAG,GAAGL,GAAG,CAACM,MAAM,CAAC,OAAO,CAAC;AA8B/B,OAAO,MAAMC,KAAK,SAAShB,SAAS,CAAyB;EAkB3D;AACF;AACA;AACA;EACE,OA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;IAAY,GAC9D0F,WAAW,iBACV,oBAAC;IACC;IACA;IAAA;MACA,GAAG,EAAE,IAAI,CAAC5F,IAAK;MACf,IAAI,EAAEW,IAAK;MACX,MAAM,EAAEC,MAAO;MACf,QAAQ,EAAEE,QAAS;MACnB,MAAM,EAAE4E,MAAO;MACf,WAAW,EAAE,IAAI,CAACjG,eAAgB;MAClC,OAAO,EAAElC,GAAG,CAACsI,KAAM;MACnB,UAAU,EAAE,IAAI,CAAChG,cAAe;MAChC,QAAQ,EAAE,IAAI,CAACD,gBAAiB;MAChC,SAAS,EAAE,IAAI,CAACE,aAAc;MAC9B,gBAAgB;MAChB,KAAK,EAAE;QAAEsC,MAAM,EAAE,MAAM;QAAExE,KAAK,EAAE;MAAO;IAAE,EAE5C,CACG;EAEV;AACF;AAAC,gBAxhBYH,KAAK,kBACM;EACpB2D,QAAQ,EAAE,IAAI;EACdI,QAAQ,EAAE;IACRsE,QAAQ,EAAE,kBAAkB;IAC5BC,qBAAqB,EAAE9I,SAAS,CAAC+I,gBAAgB;IACjDC,YAAY,EAAE,KAAK;IACnBC,cAAc,EAAE,IAAI;IACpBlB,SAAS,EAAE;EACb,CAAC;EACD5H,MAAM;EACN2F,YAAY,EAAE,MAAYxE,SAAS;EACnC0E,WAAW,EAAE,MAAY1E,SAAS;EAClCoE,QAAQ,EAAE,MAAYpE,SAAS;EAC/BgF,OAAO,EAAE,MAAYhF,SAAS;EAC9ByF,iBAAiB,EAAE,MAAYzF;AACjC,CAAC;AA0gBH,eAAed,KAAK"}
|
package/dist/ChartModel.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { dh as DhType } from '@deephaven/jsapi-types';
|
|
2
2
|
import { Formatter } from '@deephaven/jsapi-utils';
|
|
3
|
-
import { Layout,
|
|
3
|
+
import type { Layout, Data } from 'plotly.js';
|
|
4
4
|
import { FilterColumnMap, FilterMap } from './ChartUtils';
|
|
5
5
|
export type ChartEvent = CustomEvent;
|
|
6
6
|
/**
|
|
@@ -24,7 +24,7 @@ declare class ChartModel {
|
|
|
24
24
|
rect?: DOMRect;
|
|
25
25
|
isDownsamplingDisabled: boolean;
|
|
26
26
|
title?: string;
|
|
27
|
-
getData(): Partial<
|
|
27
|
+
getData(): Partial<Data>[];
|
|
28
28
|
getDefaultTitle(): string;
|
|
29
29
|
getLayout(): Partial<Layout>;
|
|
30
30
|
getFilterColumnMap(): FilterColumnMap;
|
package/dist/ChartModel.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChartModel.d.ts","sourceRoot":"","sources":["../src/ChartModel.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,EAAE,IAAI,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"ChartModel.d.ts","sourceRoot":"","sources":["../src/ChartModel.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,EAAE,IAAI,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE1D,MAAM,MAAM,UAAU,GAAG,WAAW,CAAC;AACrC;;;;GAIG;AACH,cAAM,UAAU;IACd,MAAM,CAAC,aAAa,SAA8B;IAElD,MAAM,CAAC,gBAAgB,SAAiC;IAExD,MAAM,CAAC,eAAe,SAAgC;IAEtD,MAAM,CAAC,uBAAuB,SAAwC;IAEtE,MAAM,CAAC,wBAAwB,SAAyC;IAExE,MAAM,CAAC,sBAAsB,SAAuC;IAEpE,MAAM,CAAC,sBAAsB,SAAuC;IAEpE,MAAM,CAAC,kBAAkB,SAAmC;gBAEhD,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AAO,GAAG,IAAI;IAMzC,oBAAoB,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI;IAM3C,gBAAgB,IAAI,IAAI;CAGzB;AAED,eAAe,UAAU,CAAC"}
|
package/dist/ChartModel.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChartModel.js","names":["ChartModel","constructor","dh","listeners","isDownsamplingDisabled","getData","getDefaultTitle","getLayout","getFilterColumnMap","Map","isFilterRequired","setFilter","filter","close","setFormatter","formatter","setDownsamplingDisabled","setDimensions","rect","setTitle","title","subscribe","callback","push","unsubscribe","listener","fireEvent","event","i","length","fireUpdate","data","CustomEvent","EVENT_UPDATED","detail","fireDisconnect","EVENT_DISCONNECT","fireReconnect","EVENT_RECONNECT","fireDownsampleStart","EVENT_DOWNSAMPLESTARTED","fireDownsampleFinish","EVENT_DOWNSAMPLEFINISHED","fireDownsampleFail","EVENT_DOWNSAMPLEFAILED","fireDownsampleNeeded","EVENT_DOWNSAMPLENEEDED","fireLoadFinished","EVENT_LOADFINISHED"],"sources":["../src/ChartModel.ts"],"sourcesContent":["/* eslint class-methods-use-this: \"off\" */\n/* eslint no-unused-vars: \"off\" */\n\nimport type { dh as DhType } from '@deephaven/jsapi-types';\nimport { Formatter } from '@deephaven/jsapi-utils';\nimport { Layout,
|
|
1
|
+
{"version":3,"file":"ChartModel.js","names":["ChartModel","constructor","dh","listeners","isDownsamplingDisabled","getData","getDefaultTitle","getLayout","getFilterColumnMap","Map","isFilterRequired","setFilter","filter","close","setFormatter","formatter","setDownsamplingDisabled","setDimensions","rect","setTitle","title","subscribe","callback","push","unsubscribe","listener","fireEvent","event","i","length","fireUpdate","data","CustomEvent","EVENT_UPDATED","detail","fireDisconnect","EVENT_DISCONNECT","fireReconnect","EVENT_RECONNECT","fireDownsampleStart","EVENT_DOWNSAMPLESTARTED","fireDownsampleFinish","EVENT_DOWNSAMPLEFINISHED","fireDownsampleFail","EVENT_DOWNSAMPLEFAILED","fireDownsampleNeeded","EVENT_DOWNSAMPLENEEDED","fireLoadFinished","EVENT_LOADFINISHED"],"sources":["../src/ChartModel.ts"],"sourcesContent":["/* eslint class-methods-use-this: \"off\" */\n/* eslint no-unused-vars: \"off\" */\n\nimport type { dh as DhType } from '@deephaven/jsapi-types';\nimport { Formatter } from '@deephaven/jsapi-utils';\nimport type { Layout, Data } from 'plotly.js';\nimport { FilterColumnMap, FilterMap } from './ChartUtils';\n\nexport type ChartEvent = CustomEvent;\n/**\n * Model for a Chart\n * All of these methods should return very quickly.\n * If data needs to be loaded asynchronously, return something immediately, then trigger an event for the chart to refresh.\n */\nclass ChartModel {\n static EVENT_UPDATED = 'ChartModel.EVENT_UPDATED';\n\n static EVENT_DISCONNECT = 'ChartModel.EVENT_DISCONNECT';\n\n static EVENT_RECONNECT = 'ChartModel.EVENT_RECONNECT';\n\n static EVENT_DOWNSAMPLESTARTED = 'ChartModel.EVENT_DOWNSAMPLESTARTED';\n\n static EVENT_DOWNSAMPLEFINISHED = 'ChartModel.EVENT_DOWNSAMPLEFINISHED';\n\n static EVENT_DOWNSAMPLEFAILED = 'ChartModel.EVENT_DOWNSAMPLEFAILED';\n\n static EVENT_DOWNSAMPLENEEDED = 'ChartModel.EVENT_DOWNSAMPLENEEDED';\n\n static EVENT_LOADFINISHED = 'ChartModel.EVENT_LOADFINISHED';\n\n constructor(dh: DhType) {\n this.dh = dh;\n this.listeners = [];\n this.isDownsamplingDisabled = false;\n }\n\n dh: DhType;\n\n listeners: ((event: ChartEvent) => void)[];\n\n formatter?: Formatter;\n\n rect?: DOMRect;\n\n isDownsamplingDisabled: boolean;\n\n title?: string;\n\n getData(): Partial<Data>[] {\n return [];\n }\n\n getDefaultTitle(): string {\n return '';\n }\n\n getLayout(): Partial<Layout> {\n return {};\n }\n\n getFilterColumnMap(): FilterColumnMap {\n return new Map();\n }\n\n isFilterRequired(): boolean {\n return false;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n setFilter(filter: FilterMap): void {}\n\n /**\n * Close this model, clean up any underlying subscriptions\n */\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n close(): void {}\n\n /**\n * Set the formatter to use when charting the data.\n * @param formatter The formatter to use to format the charting data\n */\n setFormatter(formatter: Formatter): void {\n this.formatter = formatter;\n }\n\n /**\n * Disable downsampling\n * @param isDownsamplingDisabled True if downsampling should be disabled\n */\n setDownsamplingDisabled(isDownsamplingDisabled: boolean): void {\n this.isDownsamplingDisabled = isDownsamplingDisabled;\n }\n\n /**\n * Set the dimensions of the plot. May be needed to evaluate some of the percents\n * @param rect The bounding rectangle of the plot\n */\n setDimensions(rect: DOMRect): void {\n this.rect = rect;\n }\n\n setTitle(title: string): void {\n this.title = title;\n }\n\n /**\n * Subscribe to this ChartModel and start listening for all events.\n * @param callback Callback when an event occurs\n */\n subscribe(callback: (event: ChartEvent) => void): void {\n this.listeners.push(callback);\n }\n\n unsubscribe(callback: (event: ChartEvent) => void): void {\n this.listeners = this.listeners.filter(listener => listener !== callback);\n }\n\n fireEvent(event: ChartEvent): void {\n for (let i = 0; i < this.listeners.length; i += 1) {\n this.listeners[i](event);\n }\n }\n\n fireUpdate(data: unknown): void {\n this.fireEvent(new CustomEvent(ChartModel.EVENT_UPDATED, { detail: data }));\n }\n\n fireDisconnect(): void {\n this.fireEvent(new CustomEvent(ChartModel.EVENT_DISCONNECT));\n }\n\n fireReconnect(): void {\n this.fireEvent(new CustomEvent(ChartModel.EVENT_RECONNECT));\n }\n\n fireDownsampleStart(detail: unknown): void {\n this.fireEvent(\n new CustomEvent(ChartModel.EVENT_DOWNSAMPLESTARTED, { detail })\n );\n }\n\n fireDownsampleFinish(detail: unknown): void {\n this.fireEvent(\n new CustomEvent(ChartModel.EVENT_DOWNSAMPLEFINISHED, { detail })\n );\n }\n\n fireDownsampleFail(detail: unknown): void {\n this.fireEvent(\n new CustomEvent(ChartModel.EVENT_DOWNSAMPLEFAILED, { detail })\n );\n }\n\n fireDownsampleNeeded(detail: unknown): void {\n this.fireEvent(\n new CustomEvent(ChartModel.EVENT_DOWNSAMPLENEEDED, { detail })\n );\n }\n\n fireLoadFinished(): void {\n this.fireEvent(new CustomEvent(ChartModel.EVENT_LOADFINISHED));\n }\n}\n\nexport default ChartModel;\n"],"mappings":";;;AAAA;AACA;;AAQA;AACA;AACA;AACA;AACA;AACA,MAAMA,UAAU,CAAC;EAiBfC,WAAW,CAACC,EAAU,EAAE;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IACtB,IAAI,CAACA,EAAE,GAAGA,EAAE;IACZ,IAAI,CAACC,SAAS,GAAG,EAAE;IACnB,IAAI,CAACC,sBAAsB,GAAG,KAAK;EACrC;EAcAC,OAAO,GAAoB;IACzB,OAAO,EAAE;EACX;EAEAC,eAAe,GAAW;IACxB,OAAO,EAAE;EACX;EAEAC,SAAS,GAAoB;IAC3B,OAAO,CAAC,CAAC;EACX;EAEAC,kBAAkB,GAAoB;IACpC,OAAO,IAAIC,GAAG,EAAE;EAClB;EAEAC,gBAAgB,GAAY;IAC1B,OAAO,KAAK;EACd;;EAEA;EACAC,SAAS,CAACC,MAAiB,EAAQ,CAAC;;EAEpC;AACF;AACA;EACE;EACAC,KAAK,GAAS,CAAC;;EAEf;AACF;AACA;AACA;EACEC,YAAY,CAACC,SAAoB,EAAQ;IACvC,IAAI,CAACA,SAAS,GAAGA,SAAS;EAC5B;;EAEA;AACF;AACA;AACA;EACEC,uBAAuB,CAACZ,sBAA+B,EAAQ;IAC7D,IAAI,CAACA,sBAAsB,GAAGA,sBAAsB;EACtD;;EAEA;AACF;AACA;AACA;EACEa,aAAa,CAACC,IAAa,EAAQ;IACjC,IAAI,CAACA,IAAI,GAAGA,IAAI;EAClB;EAEAC,QAAQ,CAACC,KAAa,EAAQ;IAC5B,IAAI,CAACA,KAAK,GAAGA,KAAK;EACpB;;EAEA;AACF;AACA;AACA;EACEC,SAAS,CAACC,QAAqC,EAAQ;IACrD,IAAI,CAACnB,SAAS,CAACoB,IAAI,CAACD,QAAQ,C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AAoB,CAACX,MAAe,EAAQ;IAC1C,IAAI,CAACR,SAAS,CACZ,IAAIM,WAAW,CAAChC,UAAU,CAAC8C,sBAAsB,EAAE;MAAEZ;IAAO,CAAC,CAAC,CAC/D;EACH;EAEAa,gBAAgB,GAAS;IACvB,IAAI,CAACrB,SAAS,CAAC,IAAIM,WAAW,CAAChC,UAAU,CAACgD,kBAAkB,CAAC,CAAC;EAChE;AACF;AAAC,gBArJKhD,UAAU,mBACS,0BAA0B;AAAA,gBAD7CA,UAAU,sBAGY,6BAA6B;AAAA,gBAHnDA,UAAU,qBAKW,4BAA4B;AAAA,gBALjDA,UAAU,6BAOmB,oCAAoC;AAAA,gBAPjEA,UAAU,8BASoB,qCAAqC;AAAA,gBATnEA,UAAU,4BAWkB,mCAAmC;AAAA,gBAX/DA,UAAU,4BAakB,mCAAmC;AAAA,gBAb/DA,UAAU,wBAec,+BAA+B;AAwI7D,eAAeA,UAAU"}
|
package/dist/ChartUtils.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Formatter } from '@deephaven/jsapi-utils';
|
|
2
2
|
import type { Axis, AxisPosition, AxisType, Chart, dh as DhType, Figure, Holiday, Series, SeriesDataSource, SeriesPlotStyle, SourceType, TableTemplate, TimeZone } from '@deephaven/jsapi-types';
|
|
3
|
-
import { Layout, PlotData, PlotType, Axis as PlotlyAxis, ErrorBar, LayoutAxis, MarkerSymbol } from 'plotly.js';
|
|
3
|
+
import type { Layout, PlotData, PlotType, Axis as PlotlyAxis, ErrorBar, LayoutAxis, MarkerSymbol } from 'plotly.js';
|
|
4
4
|
import { Range } from '@deephaven/utils';
|
|
5
5
|
import ChartTheme from './ChartTheme';
|
|
6
6
|
export type FilterColumnMap = Map<string, {
|
|
@@ -146,7 +146,7 @@ declare class ChartUtils {
|
|
|
146
146
|
* @param layout The plotly layout object to get the ranges from
|
|
147
147
|
* @returns An object mapping the axis name to it's range
|
|
148
148
|
*/
|
|
149
|
-
static getLayoutRanges(layout: Layout): Record<string, Range[]>;
|
|
149
|
+
static getLayoutRanges(layout: Partial<Layout>): Record<string, Range[]>;
|
|
150
150
|
static getAxisLayoutProperty(axisProperty: 'x' | 'y', axisIndex: number): LayoutAxisKey;
|
|
151
151
|
/**
|
|
152
152
|
* Converts an open or close period to a declimal. e.g '09:30" to 9.5
|
package/dist/ChartUtils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChartUtils.d.ts","sourceRoot":"","sources":["../src/ChartUtils.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,SAAS,EAGV,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EACV,IAAI,EACJ,YAAY,EACZ,QAAQ,EACR,KAAK,EAEL,EAAE,IAAI,MAAM,EACZ,MAAM,EACN,OAAO,EAEP,MAAM,EACN,gBAAgB,EAChB,eAAe,EACf,UAAU,EACV,aAAa,EACb,QAAQ,EACT,MAAM,wBAAwB,CAAC;AAEhC,OAAO,
|
|
1
|
+
{"version":3,"file":"ChartUtils.d.ts","sourceRoot":"","sources":["../src/ChartUtils.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,SAAS,EAGV,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EACV,IAAI,EACJ,YAAY,EACZ,QAAQ,EACR,KAAK,EAEL,EAAE,IAAI,MAAM,EACZ,MAAM,EACN,OAAO,EAEP,MAAM,EACN,gBAAgB,EAChB,eAAe,EACf,UAAU,EACV,aAAa,EACb,QAAQ,EACT,MAAM,wBAAwB,CAAC;AAEhC,OAAO,KAAK,EACV,MAAM,EACN,QAAQ,EACR,QAAQ,EACR,IAAI,IAAI,UAAU,EAClB,QAAQ,EACR,UAAU,EAGV,YAAY,EACb,MAAM,WAAW,CAAC;AACnB,OAAO,EAAiB,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,UAAU,MAAM,cAAc,CAAC;AAEtC,MAAM,MAAM,eAAe,GAAG,GAAG,CAC/B,MAAM,EACN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AE;oBACX,IAAI,EAAE,MAAM,CAAC;oBACb,UAAU,EAAE,MAAM,CAAC;oBACnB,IAAI,EAAE;wBAAE,UAAU,EAAE,MAAM,CAAC;wBAAC,IAAI,EAAE,MAAM,CAAC;wBAAC,QAAQ,EAAE,MAAM,CAAA;qBAAE,CAAC;oBAC7D,KAAK,EAAE,aAAa,CAAC;iBACtB,EAAE,CAAC;aACL,EAAE,CAAC;SACL,EAAE,CAAC;QACJ,KAAK,EAAE,MAAM,CAAC;KACf;IA4CD;;;OAGG;IACH,WAAW,CAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,CAAC,EAAE,QAAQ,GAAG,OAAO;IAmBzD;;;;;OAKG;IACH,SAAS,CACP,KAAK,EAAE,OAAO,EACd,UAAU,EAAE,MAAM,EAClB,QAAQ,GAAE,QAAQ,GAAG,IAAW,GAC/B,OAAO;IAqCV,cAAc,CAAC,IAAI,EAAE,QAAQ,EAAE,KAAK;;;;;;;;;;;;;;;;;MAAa,GAAG,OAAO,CAAC,UAAU,CAAC;IAkCvE,iBAAiB,CAAC,KAAK;;;;;;;;;;;;;;;;;MAAa,GAAG,OAAO,CAAC,MAAM,CAAC;IAwCtD;;;OAGG;IACH,eAAe,CACb,QAAQ,EAAE,kBAAkB,GAC3B,IAAI,CAAC,kBAAkB,EAAE,MAAM,CAAC,GAAG;QAAE,IAAI,CAAC,EAAE,eAAe,CAAA;KAAE;CAUjE;AAED,eAAe,UAAU,CAAC"}
|
package/dist/ChartUtils.js
CHANGED
|
@@ -1376,7 +1376,17 @@ class ChartUtils {
|
|
|
1376
1376
|
},
|
|
1377
1377
|
margin: _objectSpread({}, ChartUtils.DEFAULT_MARGIN),
|
|
1378
1378
|
xaxis: this.makeLayoutAxis(dh.plot.AxisType.X, theme),
|
|
1379
|
-
yaxis: this.makeLayoutAxis(dh.plot.AxisType.Y, theme)
|
|
1379
|
+
yaxis: this.makeLayoutAxis(dh.plot.AxisType.Y, theme),
|
|
1380
|
+
polar: {
|
|
1381
|
+
angularaxis: this.makeLayoutAxis(dh.plot.AxisType.SHAPE, theme),
|
|
1382
|
+
radialaxis: this.makeLayoutAxis(dh.plot.AxisType.SHAPE, theme),
|
|
1383
|
+
bgcolor: theme.plot_bgcolor
|
|
1384
|
+
},
|
|
1385
|
+
scene: {
|
|
1386
|
+
xaxis: this.makeLayoutAxis(dh.plot.AxisType.X, theme),
|
|
1387
|
+
yaxis: this.makeLayoutAxis(dh.plot.AxisType.Y, theme),
|
|
1388
|
+
zaxis: this.makeLayoutAxis(dh.plot.AxisType.Z, theme)
|
|
1389
|
+
}
|
|
1380
1390
|
});
|
|
1381
1391
|
layout.datarevision = 0;
|
|
1382
1392
|
return layout;
|