@deephaven/chart 0.15.5 → 0.15.6-vite.21
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 +5 -12
- package/dist/Chart.d.ts.map +1 -1
- package/dist/Chart.js +7 -3
- package/dist/Chart.js.map +1 -1
- package/dist/ChartModel.d.ts +12 -11
- package/dist/ChartModel.d.ts.map +1 -1
- package/dist/ChartModel.js +3 -3
- package/dist/ChartModel.js.map +1 -1
- package/dist/ChartModelFactory.d.ts +2 -7
- package/dist/ChartModelFactory.d.ts.map +1 -1
- package/dist/ChartModelFactory.js.map +1 -1
- package/dist/ChartTestUtils.d.ts +16 -15
- package/dist/ChartTestUtils.d.ts.map +1 -1
- package/dist/ChartTestUtils.js +5 -0
- package/dist/ChartTestUtils.js.map +1 -1
- package/dist/ChartTheme.js.map +1 -1
- package/dist/ChartUtils.d.ts +252 -225
- package/dist/ChartUtils.d.ts.map +1 -1
- package/dist/ChartUtils.js +216 -174
- package/dist/ChartUtils.js.map +1 -1
- package/dist/FigureChartModel.d.ts +70 -106
- package/dist/FigureChartModel.d.ts.map +1 -1
- package/dist/FigureChartModel.js +90 -36
- package/dist/FigureChartModel.js.map +1 -1
- package/dist/MockChartModel.d.ts +3 -201
- package/dist/MockChartModel.d.ts.map +1 -1
- package/dist/MockChartModel.js.map +1 -1
- package/dist/declaration.d.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/isFigureChartModel.js.map +1 -1
- package/dist/plotly/Plot.js.map +1 -1
- package/dist/plotly/Plotly.js.map +1 -1
- package/package.json +10 -11
package/dist/Chart.d.ts
CHANGED
|
@@ -2,9 +2,10 @@ import { Component, ReactElement, RefObject } from 'react';
|
|
|
2
2
|
import { IconDefinition } from '@deephaven/icons';
|
|
3
3
|
import { DateTimeColumnFormatterOptions, DecimalColumnFormatterOptions, IntegerColumnFormatterOptions, FormattingRule } from '@deephaven/jsapi-utils';
|
|
4
4
|
import { WorkspaceSettings } from '@deephaven/redux';
|
|
5
|
-
import { Layout, Icon } from 'plotly.js';
|
|
5
|
+
import { Layout, Icon, PlotData } from 'plotly.js';
|
|
6
6
|
import Plot from './plotly/Plot';
|
|
7
7
|
import ChartModel from './ChartModel';
|
|
8
|
+
import { ChartModelSettings } from './ChartUtils';
|
|
8
9
|
import './Chart.scss';
|
|
9
10
|
interface ChartProps {
|
|
10
11
|
model: ChartModel;
|
|
@@ -18,21 +19,13 @@ interface ChartProps {
|
|
|
18
19
|
onError: (error: Error) => void;
|
|
19
20
|
onSettingsChanged: (settings: Partial<ChartModelSettings>) => void;
|
|
20
21
|
}
|
|
21
|
-
interface ChartModelSettings {
|
|
22
|
-
hiddenSeries: string[];
|
|
23
|
-
}
|
|
24
22
|
interface ChartState {
|
|
25
|
-
data:
|
|
26
|
-
name: string;
|
|
27
|
-
visible: string;
|
|
28
|
-
}[] | null;
|
|
23
|
+
data: Partial<PlotData>[] | null;
|
|
29
24
|
downsamplingError: unknown;
|
|
30
25
|
isDownsampleFinished: boolean;
|
|
31
26
|
isDownsampleInProgress: boolean;
|
|
32
27
|
isDownsamplingDisabled: boolean;
|
|
33
|
-
layout:
|
|
34
|
-
datarevision: number;
|
|
35
|
-
};
|
|
28
|
+
layout: Partial<Layout>;
|
|
36
29
|
revision: number;
|
|
37
30
|
}
|
|
38
31
|
export declare class Chart extends Component<ChartProps, ChartState> {
|
|
@@ -106,7 +99,7 @@ export declare class Chart extends Component<ChartProps, ChartState> {
|
|
|
106
99
|
* the user is looking at has changed (eg. panning/zooming).
|
|
107
100
|
* Could update each independently, but doing them at the same time keeps the
|
|
108
101
|
* ChartModel API a bit cleaner.
|
|
109
|
-
* @param
|
|
102
|
+
* @param force Force a change even if the chart dimensions haven't changed (eg. after pan/zoom)
|
|
110
103
|
*/
|
|
111
104
|
updateModelDimensions(force?: boolean): void;
|
|
112
105
|
initFormatter(): 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,OAAc,EAAE,SAAS,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGlE,OAAO,EAIL,cAAc,EACf,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAIL,8BAA8B,EAC9B,6BAA6B,EAC7B,6BAA6B,EAC7B,cAAc,EACf,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"Chart.d.ts","sourceRoot":"","sources":["../src/Chart.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,SAAS,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGlE,OAAO,EAIL,cAAc,EACf,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAIL,8BAA8B,EAC9B,6BAA6B,EAC7B,6BAA6B,EAC7B,cAAc,EACf,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAEnD,OAAO,IAAI,MAAM,eAAe,CAAC;AAEjC,OAAO,UAAU,MAAM,cAAc,CAAC;AACtC,OAAmB,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAC9D,OAAO,cAAc,CAAC;AAStB,UAAU,UAAU;IAClB,KAAK,EAAE,UAAU,CAAC;IAElB,QAAQ,EAAE,OAAO,CAAC,iBAAiB,CAAC,CAAC;IACrC,QAAQ,EAAE,OAAO,CAAC;IAClB,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB,WAAW,EAAE,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B;AAED,eAAe,KAAK,CAAC"}
|
package/dist/Chart.js
CHANGED
|
@@ -265,7 +265,11 @@ export class Chart extends Component {
|
|
|
265
265
|
layout,
|
|
266
266
|
revision
|
|
267
267
|
} = state;
|
|
268
|
-
|
|
268
|
+
|
|
269
|
+
if (typeof layout.datarevision === 'number') {
|
|
270
|
+
layout.datarevision += 1;
|
|
271
|
+
}
|
|
272
|
+
|
|
269
273
|
return {
|
|
270
274
|
data: detail,
|
|
271
275
|
layout,
|
|
@@ -407,7 +411,7 @@ export class Chart extends Component {
|
|
|
407
411
|
name,
|
|
408
412
|
visible
|
|
409
413
|
} = _ref3;
|
|
410
|
-
return visible === 'legendonly' ? [...acc, name] : acc;
|
|
414
|
+
return name != null && visible === 'legendonly' ? [...acc, name] : acc;
|
|
411
415
|
}, []);
|
|
412
416
|
onSettingsChanged({
|
|
413
417
|
hiddenSeries
|
|
@@ -421,7 +425,7 @@ export class Chart extends Component {
|
|
|
421
425
|
* the user is looking at has changed (eg. panning/zooming).
|
|
422
426
|
* Could update each independently, but doing them at the same time keeps the
|
|
423
427
|
* ChartModel API a bit cleaner.
|
|
424
|
-
* @param
|
|
428
|
+
* @param force Force a change even if the chart dimensions haven't changed (eg. after pan/zoom)
|
|
425
429
|
*/
|
|
426
430
|
|
|
427
431
|
|
package/dist/Chart.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/Chart.tsx"],"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","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","setFormatter","relayout","el","autosize","catch","e","render","config","getCachedConfig","isPlotShown","error","timeZone","defaultDateTimeFormat","FULL_DATE_FORMAT","showTimeZone","showTSeparator"],"mappings":";;;;;;AAAA,OAAOA,KAAP,IAAgBC,SAAhB,QAA0D,OAA1D;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,OAAP,MAAoB,aAApB;AACA,SACEC,SADF,EAEEC,eAFF,EAGEC,eAHF,QAKO,kBALP;AAMA,SACEC,SADF,EAEEC,cAFF,EAGEC,SAHF,QAQO,wBARP;AASA,OAAOC,GAAP,MAAgB,gBAAhB;OAGOC,M;OACAC,I;OAEAC,U;OACAC,U;;AAGP,IAAMC,GAAG,GAAGL,GAAG,CAACM,MAAJ,CAAW,OAAX,CAAZ;AAmCA,OAAO,MAAMC,KAAN,SAAoBhB,SAApB,CAAsD;AAiB3D;AACF;AACA;AACA;AACoB,SAAXiB,WAAW,CAACC,MAAD,EAA+B;A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;;gBAAhDH,K,kBACW;AACpBsD,EAAAA,QAAQ,EAAE,IADU;AAEpBI,EAAAA,QAAQ,EAAE;AACRoE,IAAAA,QAAQ,EAAE,kBADF;AAERC,IAAAA,qBAAqB,EAAEvI,SAAS,CAACwI,gBAFzB;AAGRC,IAAAA,YAAY,EAAE,KAHN;AAIRC,IAAAA,cAAc,EAAE,IAJR;AAKRhB,IAAAA,SAAS,EAAE;AALH,GAFU;AASpBjC,EAAAA,YAAY,EAAE,MAAYnE,SATN;AAUpBqE,EAAAA,WAAW,EAAE,MAAYrE,SAVL;AAWpB+D,EAAAA,QAAQ,EAAE,MAAY/D,SAXF;AAYpB2E,EAAAA,OAAO,EAAE,MAAY3E,SAZD;AAapBoF,EAAAA,iBAAiB,EAAE,MAAYpF;AAbX,C;;AAugBxB,eAAed,KAAf","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} from '@deephaven/jsapi-utils';\nimport Log from '@deephaven/log';\nimport { WorkspaceSettings } from '@deephaven/redux';\nimport { Layout, Icon } from 'plotly.js';\nimport Plotly from './plotly/Plotly';\nimport Plot from './plotly/Plot';\n\nimport ChartModel from './ChartModel';\nimport ChartUtils from './ChartUtils';\nimport './Chart.scss';\n\nconst log = Log.module('Chart');\n\ntype FormatterSettings = Partial<WorkspaceSettings> & {\n decimalFormatOptions: DecimalColumnFormatterOptions;\n integerFormatOptions: IntegerColumnFormatterOptions;\n};\n\ninterface ChartProps {\n model: ChartModel;\n // These settings come from the redux store\n settings: Partial<WorkspaceSettings>;\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 ChartModelSettings {\n hiddenSeries: string[];\n}\n\ninterface ChartState {\n data: { name: string; visible: string }[] | null;\n downsamplingError: unknown;\n isDownsampleFinished: boolean;\n isDownsampleInProgress: boolean;\n isDownsamplingDisabled: boolean;\n layout: {\n datarevision: number;\n };\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,\n isDownsampleFinished,\n isDownsampleInProgress,\n isDownsamplingDisabled\n ) => {\n const customButtons = [];\n if (downsamplingError) {\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 downsamplingError\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 isDownsampleInProgress || downsamplingError ? 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) {\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 layout.datarevision += 1;\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.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 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 {boolean} 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(\n settings: Partial<WorkspaceSettings> & {\n decimalFormatOptions: DecimalColumnFormatterOptions;\n integerFormatOptions: IntegerColumnFormatterOptions;\n }\n ): 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 formatter = new Formatter(\n this.columnFormats,\n this.dateTimeFormatterOptions,\n this.decimalFormatOptions,\n this.integerFormatOptions\n );\n\n const { model } = this.props;\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"],"file":"Chart.js"}
|
|
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","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","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} from '@deephaven/jsapi-utils';\nimport Log from '@deephaven/log';\nimport { WorkspaceSettings } from '@deephaven/redux';\nimport { Layout, Icon, PlotData } from 'plotly.js';\nimport Plotly from './plotly/Plotly';\nimport Plot from './plotly/Plot';\n\nimport ChartModel from './ChartModel';\nimport ChartUtils, { ChartModelSettings } from './ChartUtils';\nimport './Chart.scss';\n\nconst log = Log.module('Chart');\n\ntype FormatterSettings = Partial<WorkspaceSettings> & {\n decimalFormatOptions: DecimalColumnFormatterOptions;\n integerFormatOptions: IntegerColumnFormatterOptions;\n};\n\ninterface ChartProps {\n model: ChartModel;\n // These settings come from the redux store\n settings: Partial<WorkspaceSettings>;\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,\n isDownsampleFinished,\n isDownsampleInProgress,\n isDownsamplingDisabled\n ) => {\n const customButtons = [];\n if (downsamplingError) {\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 downsamplingError\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 isDownsampleInProgress || downsamplingError ? 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) {\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.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(\n settings: Partial<WorkspaceSettings> & {\n decimalFormatOptions: DecimalColumnFormatterOptions;\n integerFormatOptions: IntegerColumnFormatterOptions;\n }\n ): 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 formatter = new Formatter(\n this.columnFormats,\n this.dateTimeFormatterOptions,\n this.decimalFormatOptions,\n this.integerFormatOptions\n );\n\n const { model } = this.props;\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,KAAP,IAAgBC,SAAhB,QAA0D,OAA1D;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,OAAP,MAAoB,aAApB;AACA,SACEC,SADF,EAEEC,eAFF,EAGEC,eAHF,QAKO,kBALP;AAMA,SACEC,SADF,EAEEC,cAFF,EAGEC,SAHF,QAQO,wBARP;AASA,OAAOC,GAAP,MAAgB,gBAAhB;OAGOC,M;OACAC,I;OAEAC,U;OACAC,U;;AAGP,IAAMC,GAAG,GAAGL,GAAG,CAACM,MAAJ,CAAW,OAAX,C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K1F,IADZ;MAEE,IAAI,EAAEW,IAFR;MAGE,MAAM,EAAEC,MAHV;MAIE,QAAQ,EAAEE,QAJZ;MAKE,MAAM,EAAE0E,MALV;MAME,WAAW,EAAE,KAAK9F,eANpB;MAOE,OAAO,EAAE9B,GAAG,CAAC+H,KAPf;MAQE,UAAU,EAAE,KAAK7F,cARnB;MASE,QAAQ,EAAE,KAAKD,gBATjB;MAUE,SAAS,EAAE,KAAKE,aAVlB;MAWE,gBAAgB,MAXlB;MAYE,KAAK,EAAE;QAAEqC,MAAM,EAAE,MAAV;QAAkBnE,KAAK,EAAE;MAAzB;IAZT,EAFJ,CADF;EAoBD;;AAvgB0D;;gBAAhDH,K,kBACW;EACpBsD,QAAQ,EAAE,IADU;EAEpBI,QAAQ,EAAE;IACRoE,QAAQ,EAAE,kBADF;IAERC,qBAAqB,EAAEvI,SAAS,CAACwI,gBAFzB;IAGRC,YAAY,EAAE,KAHN;IAIRC,cAAc,EAAE,IAJR;IAKRhB,SAAS,EAAE;EALH,CAFU;EASpBjC,YAAY,EAAE,MAAYnE,SATN;EAUpBqE,WAAW,EAAE,MAAYrE,SAVL;EAWpB+D,QAAQ,EAAE,MAAY/D,SAXF;EAYpB2E,OAAO,EAAE,MAAY3E,SAZD;EAapBoF,iBAAiB,EAAE,MAAYpF;AAbX,C;;AAygBxB,eAAed,KAAf"}
|
package/dist/ChartModel.d.ts
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
import { Column } from '@deephaven/jsapi-shim';
|
|
2
1
|
import { Formatter } from '@deephaven/jsapi-utils';
|
|
3
|
-
|
|
2
|
+
import { Layout, PlotData } from 'plotly.js';
|
|
3
|
+
export declare type FilterColumnMap = Map<string, {
|
|
4
|
+
name: string;
|
|
5
|
+
type: string;
|
|
6
|
+
}>;
|
|
7
|
+
export declare type ChartEvent = CustomEvent;
|
|
4
8
|
/**
|
|
5
9
|
* Model for a Chart
|
|
6
10
|
* All of these methods should return very quickly.
|
|
@@ -21,13 +25,10 @@ declare class ChartModel {
|
|
|
21
25
|
rect?: DOMRect;
|
|
22
26
|
isDownsamplingDisabled: boolean;
|
|
23
27
|
title?: string;
|
|
24
|
-
getData():
|
|
25
|
-
name: string;
|
|
26
|
-
visible: string;
|
|
27
|
-
}[];
|
|
28
|
+
getData(): Partial<PlotData>[];
|
|
28
29
|
getDefaultTitle(): string;
|
|
29
|
-
getLayout():
|
|
30
|
-
getFilterColumnMap():
|
|
30
|
+
getLayout(): Partial<Layout>;
|
|
31
|
+
getFilterColumnMap(): FilterColumnMap;
|
|
31
32
|
isFilterRequired(): boolean;
|
|
32
33
|
setFilter(filter: Map<string, string>): void;
|
|
33
34
|
/**
|
|
@@ -41,18 +42,18 @@ declare class ChartModel {
|
|
|
41
42
|
setFormatter(formatter: Formatter): void;
|
|
42
43
|
/**
|
|
43
44
|
* Disable downsampling
|
|
44
|
-
* @param
|
|
45
|
+
* @param isDownsamplingDisabled True if downsampling should be disabled
|
|
45
46
|
*/
|
|
46
47
|
setDownsamplingDisabled(isDownsamplingDisabled: boolean): void;
|
|
47
48
|
/**
|
|
48
49
|
* Set the dimensions of the plot. May be needed to evaluate some of the percents
|
|
49
|
-
* @param
|
|
50
|
+
* @param rect The bounding rectangle of the plot
|
|
50
51
|
*/
|
|
51
52
|
setDimensions(rect: DOMRect): void;
|
|
52
53
|
setTitle(title: string): void;
|
|
53
54
|
/**
|
|
54
55
|
* Subscribe to this ChartModel and start listening for all events.
|
|
55
|
-
* @param
|
|
56
|
+
* @param callback Callback when an event occurs
|
|
56
57
|
*/
|
|
57
58
|
subscribe(callback: (event: ChartEvent) => void): void;
|
|
58
59
|
unsubscribe(callback: (event: ChartEvent) => void): void;
|
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,EAAE,MAAM,EAAE,MAAM,
|
|
1
|
+
{"version":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IACH,uBAAuB,CAAC,sBAAsB,EAAE,OAAO,GAAG,IAAI;IAI9D;;;OAGG;IACH,aAAa,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI;IAIlC,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAI7B;;;OAGG;IACH,SAAS,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,GAAG,IAAI;IAItD,WAAW,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,GAAG,IAAI;IAIxD,SAAS,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI;IAMlC,UAAU,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI;IAI/B,cAAc,IAAI,IAAI;IAItB,aAAa,IAAI,IAAI;IAIrB,mBAAmB,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI;IAM1C,oBAAoB,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI;IAM3C,kBAAkB,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI;IAMzC,oBAAoB,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI;IAM3C,gBAAgB,IAAI,IAAI;CAGzB;AAED,eAAe,UAAU,CAAC"}
|
package/dist/ChartModel.js
CHANGED
|
@@ -65,7 +65,7 @@ class ChartModel {
|
|
|
65
65
|
}
|
|
66
66
|
/**
|
|
67
67
|
* Disable downsampling
|
|
68
|
-
* @param
|
|
68
|
+
* @param isDownsamplingDisabled True if downsampling should be disabled
|
|
69
69
|
*/
|
|
70
70
|
|
|
71
71
|
|
|
@@ -74,7 +74,7 @@ class ChartModel {
|
|
|
74
74
|
}
|
|
75
75
|
/**
|
|
76
76
|
* Set the dimensions of the plot. May be needed to evaluate some of the percents
|
|
77
|
-
* @param
|
|
77
|
+
* @param rect The bounding rectangle of the plot
|
|
78
78
|
*/
|
|
79
79
|
|
|
80
80
|
|
|
@@ -87,7 +87,7 @@ class ChartModel {
|
|
|
87
87
|
}
|
|
88
88
|
/**
|
|
89
89
|
* Subscribe to this ChartModel and start listening for all events.
|
|
90
|
-
* @param
|
|
90
|
+
* @param callback Callback when an event occurs
|
|
91
91
|
*/
|
|
92
92
|
|
|
93
93
|
|
package/dist/ChartModel.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"ChartModel.js","names":["ChartModel","constructor","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 { Formatter } from '@deephaven/jsapi-utils';\nimport { Layout, PlotData } from 'plotly.js';\n\nexport type FilterColumnMap = Map<\n string,\n {\n name: string;\n type: string;\n }\n>;\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() {\n this.listeners = [];\n this.isDownsamplingDisabled = false;\n }\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<PlotData>[] {\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: Map<string, string>): 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;;AAcA;AACA;AACA;AACA;AACA;AACA,MAAMA,UAAN,CAAiB;EAiBfC,WAAW,GAAG;IAAA;;IAAA;;IAAA;;IAAA;;IAAA;;IACZ,KAAKC,SAAL,GAAiB,EAAjB;IACA,KAAKC,sBAAL,GAA8B,KAA9B;EACD;;EAYDC,OAAO,GAAwB;IAC7B,OAAO,EAAP;EACD;;EAEDC,eAAe,GAAW;IACxB,OAAO,EAAP;EACD;;EAEDC,SAAS,GAAoB;IAC3B,OAAO,EAAP;EACD;;EAEDC,kBAAkB,GAAoB;IACpC,OAAO,IAAIC,GAAJ,EAAP;EACD;;EAEDC,gBAAgB,GAAY;IAC1B,OAAO,KAAP;EACD,CAlDc,CAoDf;;;EACAC,SAAS,CAACC,MAAD,EAAoC,CAAE;EAE/C;AACF;AAC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BAAmB,CAACL,MAAD,EAAwB;IACzC,KAAKR,SAAL,CACE,IAAIM,WAAJ,CAAgB/B,UAAU,CAACuC,uBAA3B,EAAoD;MAAEN;IAAF,CAApD,CADF;EAGD;;EAEDO,oBAAoB,CAACP,MAAD,EAAwB;IAC1C,KAAKR,SAAL,CACE,IAAIM,WAAJ,CAAgB/B,UAAU,CAACyC,wBAA3B,EAAqD;MAAER;IAAF,CAArD,CADF;EAGD;;EAEDS,kBAAkB,CAACT,MAAD,EAAwB;IACxC,KAAKR,SAAL,CACE,IAAIM,WAAJ,CAAgB/B,UAAU,CAAC2C,sBAA3B,EAAmD;MAAEV;IAAF,CAAnD,CADF;EAGD;;EAEDW,oBAAoB,CAACX,MAAD,EAAwB;IAC1C,KAAKR,SAAL,CACE,IAAIM,WAAJ,CAAgB/B,UAAU,CAAC6C,sBAA3B,EAAmD;MAAEZ;IAAF,CAAnD,CADF;EAGD;;EAEDa,gBAAgB,GAAS;IACvB,KAAKrB,SAAL,CAAe,IAAIM,WAAJ,CAAgB/B,UAAU,CAAC+C,kBAA3B,CAAf;EACD;;AAjJc;;gBAAX/C,U,mBACmB,0B;;gBADnBA,U,sBAGsB,6B;;gBAHtBA,U,qBAKqB,4B;;gBALrBA,U,6BAO6B,oC;;gBAP7BA,U,8BAS8B,qC;;gBAT9BA,U,4BAW4B,mC;;gBAX5BA,U,4BAa4B,mC;;gBAb5BA,U,wBAewB,+B;;AAqI9B,eAAeA,UAAf"}
|
|
@@ -1,11 +1,6 @@
|
|
|
1
|
-
import { Figure,
|
|
1
|
+
import { Figure, Table } from '@deephaven/jsapi-shim';
|
|
2
|
+
import { ChartModelSettings } from './ChartUtils';
|
|
2
3
|
import ChartModel from './ChartModel';
|
|
3
|
-
interface ChartModelSettings {
|
|
4
|
-
title: string;
|
|
5
|
-
xAxis: string;
|
|
6
|
-
series: string[];
|
|
7
|
-
type: SeriesPlotStyle;
|
|
8
|
-
}
|
|
9
4
|
declare class ChartModelFactory {
|
|
10
5
|
/**
|
|
11
6
|
* Creates a model from the settings provided.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChartModelFactory.d.ts","sourceRoot":"","sources":["../src/ChartModelFactory.ts"],"names":[],"mappings":"AAAA,OAAW,EAAE,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"ChartModelFactory.d.ts","sourceRoot":"","sources":["../src/ChartModelFactory.ts"],"names":[],"mappings":"AAAA,OAAW,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAmB,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAG9D,OAAO,UAAU,MAAM,cAAc,CAAC;AAEtC,cAAM,iBAAiB;IACrB;;;;;;;;;;;;;;OAcG;WACU,qBAAqB,CAChC,QAAQ,EAAE,kBAAkB,EAC5B,KAAK,EAAE,KAAK,EACZ,KAAK;;;;;;;;;;;;;;;;;MAAa,GACjB,OAAO,CAAC,UAAU,CAAC;IAQtB;;;;;;;;;;;OAWG;WACU,sBAAsB,CACjC,QAAQ,EAAE,kBAAkB,EAC5B,KAAK,EAAE,KAAK,GACX,OAAO,CAAC,MAAM,CAAC;IAelB;;;;;;;;;;;;;;OAcG;WACU,SAAS,CACpB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,EAC7C,MAAM,EAAE,MAAM,EACd,KAAK;;;;;;;;;;;;;;;;;MAAa,GACjB,OAAO,CAAC,UAAU,CAAC;CAGvB;AAED,eAAe,iBAAiB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"ChartModelFactory.js","names":["dh","ChartUtils","FigureChartModel","ChartTheme","ChartModelFactory","makeModelFromSettings","settings","table","theme","figure","makeFigureFromSettings","tableCopy","copy","applyCustomColumns","customColumns","applyFilter","filter","applySort","sort","plot","Figure","create","makeFigureSettings","makeModel"],"sources":["../src/ChartModelFactory.ts"],"sourcesContent":["import dh, { Figure, Table } from '@deephaven/jsapi-shim';\nimport ChartUtils, { ChartModelSettings } from './ChartUtils';\nimport FigureChartModel from './FigureChartModel';\nimport ChartTheme from './ChartTheme';\nimport ChartModel from './ChartModel';\n\nclass ChartModelFactory {\n /**\n * Creates a model from the settings provided.\n * Tries to create a Figure in the API with it.\n * @param settings The chart builder settings\n * @param settings.isLinked Whether the newly created chart should stay linked with the original table, update when filters are updated\n * @param settings.series The column names to use for creating the series of this chart\n * @param settings.type Chart builder type, from ChartBuilder.types\n * @param settings.xAxis The column name to use for the x-axis\n * @param [settings.hiddenSeries] Array of hidden series names\n * @param table The table to build the model for\n * @param theme The theme for the figure. Defaults to ChartTheme\n * @returns The ChartModel Promise representing the figure\n * CRA sets tsconfig to type check JS based on jsdoc comments. It isn't able to figure out FigureChartModel extends ChartModel\n * This causes TS issues in 1 or 2 spots. Once this is TS it can be returned to just FigureChartModel\n */\n static async makeModelFromSettings(\n settings: ChartModelSettings,\n table: Table,\n theme = ChartTheme\n ): Promise<ChartModel> {\n const figure = await ChartModelFactory.makeFigureFromSettings(\n settings,\n table\n );\n return new FigureChartModel(figure, settings, theme);\n }\n\n /**\n * Creates a model from the settings provided.\n * Tries to create a Figure in the API with it.\n * @param settings The chart builder settings\n * @param settings.isLinked Whether the newly created chart should stay linked with the original table, update when filters are updated\n * @param settings.series The column names to use for creating the series of this chart\n * @param settings.type Chart builder type, from ChartBuilder.types\n * @param settings.xAxis The column name to use for the x-axis\n * @param [settings.hiddenSeries] Array of hidden series names\n * @param table The table to build the model for\n * @returns The Figure created with the settings provided\n */\n static async makeFigureFromSettings(\n settings: ChartModelSettings,\n table: Table\n ): Promise<Figure> {\n // Copy the table first and then re-apply the filters from the original table\n // When we add toable linking we'll want to listen to the original table and update\n // the copied table with any changes that occur.\n // The table gets owned by the Figure that gets created, which closes the table\n const tableCopy = await table.copy();\n tableCopy.applyCustomColumns(table.customColumns);\n tableCopy.applyFilter(table.filter);\n tableCopy.applySort(table.sort);\n\n return dh.plot.Figure.create(\n ChartUtils.makeFigureSettings(settings, tableCopy)\n );\n }\n\n /**\n * Creates a model from the settings provided.\n * Tries to create a Figure in the API with it.\n * @param settings The chart builder settings\n * @param settings.isLinked Whether the newly created chart should stay linked with the original table, update when filters are updated\n * @param settings.series The column names to use for creating the series of this chart\n * @param settings.type Chart builder type, from ChartBuilder.types\n * @param settings.xAxis The column name to use for the x-axis\n * @param [settings.hiddenSeries] Array of hidden series names\n * @param figure The figure to build the model for\n * @param theme The theme for the figure. Defaults to ChartTheme\n * @returns The FigureChartModel representing the figure\n * CRA sets tsconfig to type check JS based on jsdoc comments. It isn't able to figure out FigureChartModel extends ChartModel\n * This causes TS issues in 1 or 2 spots. Once this is TS it can be returned to just FigureChartModel\n */\n static async makeModel(\n settings: Record<string, unknown> | undefined,\n figure: Figure,\n theme = ChartTheme\n ): Promise<ChartModel> {\n return new FigureChartModel(figure, settings, theme);\n }\n}\n\nexport default ChartModelFactory;\n"],"mappings":";;;;AAAA,OAAOA,EAAP,MAAkC,uBAAlC;OACOC,U;OACAC,gB;OACAC,U;;AAGP,MAAMC,iBAAN,CAAwB;EACtB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACoC,OAArBC,qBAAqB,CAChCC,QADgC,EAEhCC,KAFgC,EAIX;IAAA;IAAA;MAAA,IADrBC,KACqB,0EADbL,UACa;MACrB,IAAMM,MAAM,SAASL,iBAAiB,CAACM,sBAAlB,CACnBJ,QADmB,EAEnBC,KAFmB,CAArB;MAIA,OAAO,IAAIL,gBAAJ,CAAqBO,MAArB,EAA6BH,QAA7B,EAAuCE,KAAvC,CAAP;IALqB;EAMtB;EAED;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;EACqC,OAAtBE,sBAAsB,CACjCJ,QADiC,EAEjCC,KAFiC,EAGhB;IAAA;MACjB;MACA;MACA;MACA;MACA,IAAMI,SAAS,SAASJ,KAAK,CAACK,IAAN,EAAxB;MACAD,SAAS,CAACE,kBAAV,CAA6BN,KAAK,CAACO,aAAnC;MACAH,SAAS,CAACI,WAAV,CAAsBR,KAAK,CAACS,MAA5B;MACAL,SAAS,CAACM,SAAV,CAAoBV,KAAK,CAACW,IAA1B;MAEA,OAAOlB,EAAE,CAACmB,IAAH,CAAQC,MAAR,CAAeC,MAAf,CACLpB,UAAU,CAACqB,kBAAX,CAA8BhB,QAA9B,EAAwCK,SAAxC,CADK,CAAP;IAViB;EAalB;EAED;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;EACwB,OAATY,SAAS,CACpBjB,QADoB,EAEpBG,MAFoB,EAIC;IAAA;IAAA;MAAA,IADrBD,KACqB,6EADbL,UACa;MACrB,OAAO,IAAID,gBAAJ,CAAqBO,MAArB,EAA6BH,QAA7B,EAAuCE,KAAvC,CAAP;IADqB;EAEtB;;AA/EqB;;AAkFxB,eAAeJ,iBAAf"}
|
package/dist/ChartTestUtils.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import { Axis, Chart, Figure, Series, SeriesDataSource } from '@deephaven/jsapi-shim';
|
|
2
2
|
declare class ChartTestUtils {
|
|
3
3
|
static DEFAULT_CHART_TITLE: string;
|
|
4
4
|
static DEFAULT_X_TITLE: string;
|
|
@@ -8,30 +8,31 @@ declare class ChartTestUtils {
|
|
|
8
8
|
label?: string | undefined;
|
|
9
9
|
type?: import("@deephaven/jsapi-shim").AxisType | undefined;
|
|
10
10
|
position?: import("@deephaven/jsapi-shim").AxisPosition | undefined;
|
|
11
|
-
formatType?:
|
|
11
|
+
formatType?: unknown;
|
|
12
12
|
formatPattern?: string | undefined;
|
|
13
13
|
log?: boolean | undefined;
|
|
14
|
-
}):
|
|
15
|
-
static makeDefaultAxes():
|
|
16
|
-
static makeSource({ axis }: {
|
|
17
|
-
axis
|
|
18
|
-
}):
|
|
19
|
-
static makeDefaultSources():
|
|
14
|
+
}): Axis;
|
|
15
|
+
static makeDefaultAxes(): Axis[];
|
|
16
|
+
static makeSource({ axis, }: {
|
|
17
|
+
axis: Axis;
|
|
18
|
+
}): SeriesDataSource;
|
|
19
|
+
static makeDefaultSources(): SeriesDataSource[];
|
|
20
20
|
static makeSeries({ name, plotStyle, sources, lineColor, shapeColor, }?: {
|
|
21
21
|
name?: string | undefined;
|
|
22
22
|
plotStyle?: import("@deephaven/jsapi-shim").SeriesPlotStyle | undefined;
|
|
23
|
-
sources?:
|
|
23
|
+
sources?: SeriesDataSource[] | undefined;
|
|
24
24
|
lineColor?: null | undefined;
|
|
25
25
|
shapeColor?: null | undefined;
|
|
26
|
-
}):
|
|
26
|
+
}): Series;
|
|
27
27
|
static makeChart({ title, series, axes, }?: {
|
|
28
28
|
title?: string | undefined;
|
|
29
|
-
series?:
|
|
30
|
-
axes?:
|
|
31
|
-
}):
|
|
29
|
+
series?: Series[] | undefined;
|
|
30
|
+
axes?: Axis[] | undefined;
|
|
31
|
+
}): Chart;
|
|
32
32
|
static makeFigure({ title, charts, }?: {
|
|
33
33
|
title?: string | undefined;
|
|
34
|
-
charts?:
|
|
35
|
-
}):
|
|
34
|
+
charts?: Chart[] | undefined;
|
|
35
|
+
}): Figure;
|
|
36
36
|
}
|
|
37
|
+
export default ChartTestUtils;
|
|
37
38
|
//# sourceMappingURL=ChartTestUtils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChartTestUtils.d.ts","sourceRoot":"","sources":["../src/ChartTestUtils.
|
|
1
|
+
{"version":3,"file":"ChartTestUtils.d.ts","sourceRoot":"","sources":["../src/ChartTestUtils.ts"],"names":[],"mappings":"AAAA,OAAW,EACT,IAAI,EACJ,KAAK,EACL,MAAM,EACN,MAAM,EACN,gBAAgB,EACjB,MAAM,uBAAuB,CAAC;AAE/B,cAAM,cAAc;IAClB,MAAM,CAAC,mBAAmB,SAAiB;IAE3C,MAAM,CAAC,eAAe,SAAY;IAElC,MAAM,CAAC,eAAe,SAAY;IAElC,MAAM,CAAC,mBAAmB,SAAc;IAExC,MAAM,CAAC,QAAQ,CAAC,EACd,KAAc,EACd,IAAyB,EACzB,QAAsC,EACtC,UAAuC,EACvC,aAA6B,EAC7B,GAAW,GACZ;;;;;;;KAAK,GAAG,IAAI;IAYb,MAAM,CAAC,eAAe,IAAI,IAAI,EAAE;IAahC,MAAM,CAAC,UAAU,CAAC,EAChB,IAAgC,GACjC,EAAE;QACD,IAAI,EAAE,IAAI,CAAC;KACZ,GAAG,gBAAgB;IAKpB,MAAM,CAAC,kBAAkB,IAAI,gBAAgB,EAAE;IAK/C,MAAM,CAAC,UAAU,CAAC,EAChB,IAAyC,EACzC,SAA2C,EAC3C,OAA6C,EAC7C,SAAgB,EAChB,UAAiB,GAClB;;;;;;KAAK,GAAG,MAAM;IAWf,MAAM,CAAC,SAAS,CAAC,EACf,KAA0C,EAC1C,MAAsC,EACtC,IAAuC,GACxC;;;;KAAK,GAAG,KAAK;IAKd,MAAM,CAAC,UAAU,CAAC,EAChB,KAAgB,EAChB,MAAqC,GACtC;;;KAAK,GAAG,MAAM;CAIhB;AAED,eAAe,cAAc,CAAC"}
|
package/dist/ChartTestUtils.js
CHANGED
|
@@ -12,6 +12,7 @@ class ChartTestUtils {
|
|
|
12
12
|
formatPattern = '###,###0.00',
|
|
13
13
|
log = false
|
|
14
14
|
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
15
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
15
16
|
return new dh.Axis({
|
|
16
17
|
label,
|
|
17
18
|
type,
|
|
@@ -36,6 +37,7 @@ class ChartTestUtils {
|
|
|
36
37
|
var {
|
|
37
38
|
axis = ChartTestUtils.makeAxis()
|
|
38
39
|
} = _ref;
|
|
40
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
39
41
|
return new dh.SeriesDataSource({
|
|
40
42
|
axis,
|
|
41
43
|
type: axis.type
|
|
@@ -57,6 +59,7 @@ class ChartTestUtils {
|
|
|
57
59
|
lineColor = null,
|
|
58
60
|
shapeColor = null
|
|
59
61
|
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
62
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
60
63
|
return new dh.Series(name, plotStyle, sources, lineColor, shapeColor);
|
|
61
64
|
}
|
|
62
65
|
|
|
@@ -66,6 +69,7 @@ class ChartTestUtils {
|
|
|
66
69
|
series = [ChartTestUtils.makeSeries()],
|
|
67
70
|
axes = ChartTestUtils.makeDefaultAxes()
|
|
68
71
|
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
72
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
69
73
|
return new dh.Chart({
|
|
70
74
|
title,
|
|
71
75
|
series,
|
|
@@ -78,6 +82,7 @@ class ChartTestUtils {
|
|
|
78
82
|
title = 'Figure',
|
|
79
83
|
charts = [ChartTestUtils.makeChart()]
|
|
80
84
|
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
85
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
81
86
|
return new dh.plot.Figure({
|
|
82
87
|
title,
|
|
83
88
|
charts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"ChartTestUtils.js","names":["dh","ChartTestUtils","makeAxis","label","type","plot","AxisType","X","position","AxisPosition","BOTTOM","formatType","Axis","FORMAT_TYPE_NUMBER","formatPattern","log","makeDefaultAxes","DEFAULT_X_TITLE","DEFAULT_Y_TITLE","Y","makeSource","axis","SeriesDataSource","makeDefaultSources","axes","map","makeSeries","name","DEFAULT_SERIES_NAME","plotStyle","SeriesPlotStyle","SCATTER","sources","lineColor","shapeColor","Series","makeChart","title","DEFAULT_CHART_TITLE","series","Chart","makeFigure","charts","Figure"],"sources":["../src/ChartTestUtils.ts"],"sourcesContent":["import dh, {\n Axis,\n Chart,\n Figure,\n Series,\n SeriesDataSource,\n} from '@deephaven/jsapi-shim';\n\nclass ChartTestUtils {\n static DEFAULT_CHART_TITLE = 'Chart Title';\n\n static DEFAULT_X_TITLE = 'X Axis';\n\n static DEFAULT_Y_TITLE = 'Y Axis';\n\n static DEFAULT_SERIES_NAME = 'MySeries';\n\n static makeAxis({\n label = 'Axis',\n type = dh.plot.AxisType.X,\n position = dh.plot.AxisPosition.BOTTOM,\n formatType = dh.Axis.FORMAT_TYPE_NUMBER,\n formatPattern = '###,###0.00',\n log = false,\n } = {}): Axis {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return new (dh as any).Axis({\n label,\n type,\n position,\n formatType,\n formatPattern,\n log,\n });\n }\n\n static makeDefaultAxes(): Axis[] {\n return [\n ChartTestUtils.makeAxis({\n label: ChartTestUtils.DEFAULT_X_TITLE,\n type: dh.plot.AxisType.X,\n }),\n ChartTestUtils.makeAxis({\n label: ChartTestUtils.DEFAULT_Y_TITLE,\n type: dh.plot.AxisType.Y,\n }),\n ];\n }\n\n static makeSource({\n axis = ChartTestUtils.makeAxis(),\n }: {\n axis: Axis;\n }): SeriesDataSource {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return new (dh as any).SeriesDataSource({ axis, type: axis.type });\n }\n\n static makeDefaultSources(): SeriesDataSource[] {\n const axes = ChartTestUtils.makeDefaultAxes();\n return axes.map(axis => ChartTestUtils.makeSource({ axis }));\n }\n\n static makeSeries({\n name = ChartTestUtils.DEFAULT_SERIES_NAME,\n plotStyle = dh.plot.SeriesPlotStyle.SCATTER,\n sources = ChartTestUtils.makeDefaultSources(),\n lineColor = null,\n shapeColor = null,\n } = {}): Series {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return new (dh as any).Series(\n name,\n plotStyle,\n sources,\n lineColor,\n shapeColor\n );\n }\n\n static makeChart({\n title = ChartTestUtils.DEFAULT_CHART_TITLE,\n series = [ChartTestUtils.makeSeries()],\n axes = ChartTestUtils.makeDefaultAxes(),\n } = {}): Chart {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return new (dh as any).Chart({ title, series, axes });\n }\n\n static makeFigure({\n title = 'Figure',\n charts = [ChartTestUtils.makeChart()],\n } = {}): Figure {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return new (dh as any).plot.Figure({ title, charts });\n }\n}\n\nexport default ChartTestUtils;\n"],"mappings":";;AAAA,OAAOA,EAAP,MAMO,uBANP;;AAQA,MAAMC,cAAN,CAAqB;EASJ,OAARC,QAAQ,GAOD;IAAA,IAPE;MACdC,KAAK,GAAG,MADM;MAEdC,IAAI,GAAGJ,EAAE,CAACK,IAAH,CAAQC,QAAR,CAAiBC,CAFV;MAGdC,QAAQ,GAAGR,EAAE,CAACK,IAAH,CAAQI,YAAR,CAAqBC,MAHlB;MAIdC,UAAU,GAAGX,EAAE,CAACY,IAAH,CAAQC,kBAJP;MAKdC,aAAa,GAAG,aALF;MAMdC,GAAG,GAAG;IANQ,CAOF,uEAAV,EAAU;IACZ;IACA,OAAO,IAAKf,EAAD,CAAYY,IAAhB,CAAqB;MAC1BT,KAD0B;MAE1BC,IAF0B;MAG1BI,QAH0B;MAI1BG,UAJ0B;MAK1BG,aAL0B;MAM1BC;IAN0B,CAArB,CAAP;EAQD;;EAEqB,OAAfC,eAAe,GAAW;IAC/B,OAAO,CACLf,cAAc,CAACC,QAAf,CAAwB;MACtBC,KAAK,EAAEF,cAAc,CAACgB,eADA;MAEtBb,IAAI,EAAEJ,EAAE,CAACK,IAAH,CAAQC,QAAR,CAAiBC;IAFD,CAAxB,CADK,EAKLN,cAAc,CAACC,QAAf,CAAwB;MACtBC,KAAK,EAAEF,cAAc,CAACiB,eADA;MAEtBd,IAAI,EAAEJ,EAAE,CAACK,IAAH,CAAQC,QAAR,CAAiBa;IAFD,CAAxB,CALK,CAAP;EAUD;;EAEgB,OAAVC,UAAU,OAII;IAAA,IAJH;MAChBC,IAAI,GAAGpB,cAAc,CAACC,QAAf;IAD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,CAAiBsC,MAArB,CAA4B;MAAEN,KAAF;MAASK;IAAT,CAA5B,CAAP;EACD;;AAvFkB;;gBAAfzC,c,yBACyB,a;;gBADzBA,c,qBAGqB,Q;;gBAHrBA,c,qBAKqB,Q;;gBALrBA,c,yBAOyB,U;;AAmF/B,eAAeA,cAAf"}
|
package/dist/ChartTheme.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"ChartTheme.js","names":["ChartTheme","Object","freeze","paper_bgcolor","plot_bgcolor","title_color","colorway","gridcolor","linecolor","zerolinecolor","activecolor","rangebgcolor","area_color","trend_color","line_color","error_band_line_color","error_band_fill_color","ohlc_increasing","ohlc_decreasing"],"sources":["../src/ChartTheme.ts"],"sourcesContent":["import ChartTheme from './ChartTheme.module.scss';\n\nexport default Object.freeze({\n paper_bgcolor: ChartTheme['paper-bgcolor'],\n plot_bgcolor: ChartTheme['plot-bgcolor'],\n title_color: ChartTheme['title-color'],\n colorway: ChartTheme.colorway,\n gridcolor: ChartTheme.gridcolor,\n linecolor: ChartTheme.linecolor,\n zerolinecolor: ChartTheme.zerolinecolor,\n activecolor: ChartTheme.activecolor,\n rangebgcolor: ChartTheme.rangebgcolor,\n area_color: ChartTheme['area-color'],\n trend_color: ChartTheme['trend-color'],\n line_color: ChartTheme['line-color'],\n error_band_line_color: ChartTheme['error-band-line-color'],\n error_band_fill_color: ChartTheme['error-band-fill-color'],\n ohlc_increasing: ChartTheme['ohlc-increasing'],\n ohlc_decreasing: ChartTheme['ohlc-decreasing'],\n});\n"],"mappings":"OAAOA,U;AAEP,eAAeC,MAAM,CAACC,MAAP,CAAc;EAC3BC,aAAa,EAAEH,UAAU,CAAC,eAAD,CADE;EAE3BI,YAAY,EAAEJ,UAAU,CAAC,cAAD,CAFG;EAG3BK,WAAW,EAAEL,UAAU,CAAC,aAAD,CAHI;EAI3BM,QAAQ,EAAEN,UAAU,CAACM,QAJM;EAK3BC,SAAS,EAAEP,UAAU,CAACO,SALK;EAM3BC,SAAS,EAAER,UAAU,CAACQ,SANK;EAO3BC,aAAa,EAAET,UAAU,CAACS,aAPC;EAQ3BC,WAAW,EAAEV,UAAU,CAACU,WARG;EAS3BC,YAAY,EAAEX,UAAU,CAACW,YATE;EAU3BC,UAAU,EAAEZ,UAAU,CAAC,YAAD,CAVK;EAW3Ba,WAAW,EAAEb,UAAU,CAAC,aAAD,CAXI;EAY3Bc,UAAU,EAAEd,UAAU,CAAC,YAAD,CAZK;EAa3Be,qBAAqB,EAAEf,UAAU,CAAC,uBAAD,CAbN;EAc3BgB,qBAAqB,EAAEhB,UAAU,CAAC,uBAAD,CAdN;EAe3BiB,eAAe,EAAEjB,UAAU,CAAC,iBAAD,CAfA;EAgB3BkB,eAAe,EAAElB,UAAU,CAAC,iBAAD;AAhBA,CAAd,CAAf"}
|