@deephaven/chart 0.53.1-beta.2 → 0.53.1-beta.4
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 +2 -0
- package/dist/Chart.d.ts.map +1 -1
- package/dist/Chart.js +15 -1
- package/dist/Chart.js.map +1 -1
- package/dist/ChartModelFactory.d.ts +5 -38
- package/dist/ChartModelFactory.d.ts.map +1 -1
- package/dist/ChartModelFactory.js +6 -11
- package/dist/ChartModelFactory.js.map +1 -1
- package/dist/ChartTheme.d.ts +4 -3
- package/dist/ChartTheme.d.ts.map +1 -1
- package/dist/ChartTheme.js +38 -19
- package/dist/ChartTheme.js.map +1 -1
- package/dist/ChartTheme.module.css +16 -16
- package/dist/ChartTheme.module.css.map +1 -1
- package/dist/ChartThemeProvider.d.ts +9 -0
- package/dist/ChartThemeProvider.d.ts.map +1 -0
- package/dist/ChartThemeProvider.js +35 -0
- package/dist/ChartThemeProvider.js.map +1 -0
- package/dist/ChartUtils.d.ts +12 -129
- package/dist/ChartUtils.d.ts.map +1 -1
- package/dist/ChartUtils.js +19 -26
- package/dist/ChartUtils.js.map +1 -1
- package/dist/FigureChartModel.d.ts +4 -3
- package/dist/FigureChartModel.d.ts.map +1 -1
- package/dist/FigureChartModel.js +7 -8
- package/dist/FigureChartModel.js.map +1 -1
- package/dist/MockChartModel.d.ts +3 -0
- package/dist/MockChartModel.d.ts.map +1 -1
- package/dist/MockChartModel.js +21 -11
- package/dist/MockChartModel.js.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/plotly/Plot.d.ts.map +1 -1
- package/dist/plotly/Plot.js +3 -8
- package/dist/plotly/Plot.js.map +1 -1
- package/dist/plotly/createPlotlyComponent.d.ts +4 -0
- package/dist/plotly/createPlotlyComponent.d.ts.map +1 -0
- package/dist/plotly/createPlotlyComponent.js +13 -0
- package/dist/plotly/createPlotlyComponent.js.map +1 -0
- package/dist/useChartTheme.d.ts +7 -0
- package/dist/useChartTheme.d.ts.map +1 -0
- package/dist/useChartTheme.js +10 -0
- package/dist/useChartTheme.js.map +1 -0
- package/package.json +11 -9
package/dist/Chart.d.ts
CHANGED
|
@@ -73,6 +73,7 @@ export declare class Chart extends Component<ChartProps, ChartState> {
|
|
|
73
73
|
ranges?: unknown;
|
|
74
74
|
isSubscribed: boolean;
|
|
75
75
|
isLoadedFired: boolean;
|
|
76
|
+
resizeObserver: ResizeObserver;
|
|
76
77
|
getCachedConfig: (downsamplingError: unknown, isDownsampleFinished: boolean, isDownsampleInProgress: boolean, isDownsamplingDisabled: boolean, data: Partial<Data>[]) => Partial<PlotlyConfig>;
|
|
77
78
|
getPlotRect(): DOMRect | null;
|
|
78
79
|
initData(): void;
|
|
@@ -87,6 +88,7 @@ export declare class Chart extends Component<ChartProps, ChartState> {
|
|
|
87
88
|
handleRelayout(changes: {
|
|
88
89
|
hiddenlabels?: string[];
|
|
89
90
|
}): void;
|
|
91
|
+
handleResize(): void;
|
|
90
92
|
handleRestyle([changes, seriesIndexes]: readonly [
|
|
91
93
|
Record<string, unknown>,
|
|
92
94
|
number[]
|
package/dist/Chart.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Chart.d.ts","sourceRoot":"","sources":["../src/Chart.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,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,EACd,oBAAoB,EACpB,sBAAsB,EACvB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EACL,MAAM,IAAI,YAAY,EACtB,MAAM,EACN,IAAI,EACJ,IAAI,EAGL,MAAM,WAAW,CAAC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,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;IAoB1D,eAAe,IAAI,IAAI;IAYvB,gBAAgB,IAAI,IAAI;IAsBxB,MAAM,IAAI,YAAY;CA0CvB;AAED,eAAe,KAAK,CAAC"}
|
package/dist/Chart.js
CHANGED
|
@@ -9,7 +9,7 @@ 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
|
|
12
|
+
import createPlotlyComponent from "./plotly/createPlotlyComponent.js";
|
|
13
13
|
import Plotly from "./plotly/Plotly.js";
|
|
14
14
|
import ChartModel from "./ChartModel.js";
|
|
15
15
|
import ChartUtils from "./ChartUtils.js";
|
|
@@ -60,6 +60,7 @@ export class Chart extends Component {
|
|
|
60
60
|
_defineProperty(this, "ranges", void 0);
|
|
61
61
|
_defineProperty(this, "isSubscribed", void 0);
|
|
62
62
|
_defineProperty(this, "isLoadedFired", void 0);
|
|
63
|
+
_defineProperty(this, "resizeObserver", void 0);
|
|
63
64
|
_defineProperty(this, "getCachedConfig", memoize((downsamplingError, isDownsampleFinished, isDownsampleInProgress, isDownsamplingDisabled, data) => {
|
|
64
65
|
var customButtons = [];
|
|
65
66
|
var hasDownsampleError = Boolean(downsamplingError);
|
|
@@ -116,6 +117,7 @@ export class Chart extends Component {
|
|
|
116
117
|
this.handleModelEvent = this.handleModelEvent.bind(this);
|
|
117
118
|
this.handlePlotUpdate = this.handlePlotUpdate.bind(this);
|
|
118
119
|
this.handleRelayout = this.handleRelayout.bind(this);
|
|
120
|
+
this.handleResize = this.handleResize.bind(this);
|
|
119
121
|
this.handleRestyle = this.handleRestyle.bind(this);
|
|
120
122
|
this.PlotComponent = createPlotlyComponent(props.Plotly);
|
|
121
123
|
this.plot = /*#__PURE__*/React.createRef();
|
|
@@ -127,6 +129,7 @@ export class Chart extends Component {
|
|
|
127
129
|
this.isSubscribed = false;
|
|
128
130
|
this.isLoadedFired = false;
|
|
129
131
|
this.currentSeries = 0;
|
|
132
|
+
this.resizeObserver = new window.ResizeObserver(this.handleResize);
|
|
130
133
|
this.state = {
|
|
131
134
|
data: null,
|
|
132
135
|
downsamplingError: null,
|
|
@@ -152,6 +155,9 @@ export class Chart extends Component {
|
|
|
152
155
|
if (isActive) {
|
|
153
156
|
this.subscribe(model);
|
|
154
157
|
}
|
|
158
|
+
if (this.plotWrapper.current != null) {
|
|
159
|
+
this.resizeObserver.observe(this.plotWrapper.current);
|
|
160
|
+
}
|
|
155
161
|
}
|
|
156
162
|
componentDidUpdate(prevProps) {
|
|
157
163
|
var {
|
|
@@ -166,6 +172,7 @@ export class Chart extends Component {
|
|
|
166
172
|
}
|
|
167
173
|
if (isActive !== prevProps.isActive) {
|
|
168
174
|
if (isActive) {
|
|
175
|
+
this.updateDimensions();
|
|
169
176
|
this.subscribe(model);
|
|
170
177
|
} else {
|
|
171
178
|
this.unsubscribe(model);
|
|
@@ -177,7 +184,11 @@ export class Chart extends Component {
|
|
|
177
184
|
model
|
|
178
185
|
} = this.props;
|
|
179
186
|
this.unsubscribe(model);
|
|
187
|
+
this.resizeObserver.disconnect();
|
|
180
188
|
}
|
|
189
|
+
|
|
190
|
+
// Listen for resizing of the element and update the canvas appropriately
|
|
191
|
+
|
|
181
192
|
getPlotRect() {
|
|
182
193
|
var _this$plotWrapper$cur, _this$plotWrapper$cur2;
|
|
183
194
|
return (_this$plotWrapper$cur = (_this$plotWrapper$cur2 = this.plotWrapper.current) === null || _this$plotWrapper$cur2 === void 0 ? void 0 : _this$plotWrapper$cur2.getBoundingClientRect()) !== null && _this$plotWrapper$cur !== void 0 ? _this$plotWrapper$cur : null;
|
|
@@ -365,6 +376,9 @@ export class Chart extends Component {
|
|
|
365
376
|
}
|
|
366
377
|
this.updateModelDimensions();
|
|
367
378
|
}
|
|
379
|
+
handleResize() {
|
|
380
|
+
this.updateDimensions();
|
|
381
|
+
}
|
|
368
382
|
handleRestyle(_ref4) {
|
|
369
383
|
var [changes, seriesIndexes] = _ref4;
|
|
370
384
|
log.debug('handleRestyle', changes, seriesIndexes);
|
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","createPlotlyComponent","Plotly","ChartModel","ChartUtils","jsx","_jsx","log","module","Chart","convertIcon","faIcon","width","path","icon","stringPath","concat","ascent","descent","transform","downsampleButtonTitle","isDownsampleInProgress","isDownsamplingDisabled","downsampleButtonAttr","undefined","constructor","props","_defineProperty","downsamplingError","isDownsampleFinished","data","customButtons","hasDownsampleError","Boolean","push","name","title","click","attr","handleDownsampleClick","has2D","some","_ref","type","includes","has3D","_ref2","buttons2D","buttons3D","displaylogo","displayModeBar","modeBarButtons","handleAfterPlot","bind","handleModelEvent","handlePlotUpdate","handleRelayout","handleRestyle","PlotComponent","plot","createRef","plotWrapper","columnFormats","dateTimeFormatterOptions","decimalFormatOptions","integerFormatOptions","isSubscribed","isLoadedFired","currentSeries","state","layout","datarevision","revision","componentDidMount","updateDimensions","updateModelDimensions","initData","initFormatter","isActive","model","subscribe","componentDidUpdate","prevProps","settings","updateFormatterSettings","unsubscribe","componentWillUnmount","getPlotRect","_this$plotWrapper$cur","_this$plotWrapper$cur2","current","getBoundingClientRect","setState","getData","_objectSpread","getLayout","rect","height","debug2","_ref3","setDownsamplingDisabled","event","detail","EVENT_UPDATED","onUpdate","isLoading","EVENT_LOADFINISHED","EVENT_DISCONNECT","onDisconnect","EVENT_RECONNECT","onReconnect","EVENT_DOWNSAMPLESTARTED","EVENT_DOWNSAMPLEFINISHED","EVENT_DOWNSAMPLENEEDED","EVENT_DOWNSAMPLEFAILED","_detail$message","message","onError","Error","debug","figure","ranges","getLayoutRanges","isRangesChanged","changes","hiddenlabels","onSettingsChanged","hiddenSeries","_ref4","seriesIndexes","Object","keys","reduce","acc","_ref5","visible","force","arguments","length","warn","isRectChanged","setDimensions","getColumnFormats","getDateTimeFormatterOptions","updateFormatter","formatter","dh","setFormatter","PlotlyProp","relayout","el","autosize","catch","e","render","config","getCachedConfig","isPlotShown","className","ref","children","onAfterPlot","error","onRelayout","onRestyle","useResizeHandler","style","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, model } = this.props;\n if (isActive) {\n this.subscribe(model);\n }\n }\n\n componentDidUpdate(prevProps: ChartProps): void {\n const { isActive, model, settings } = this.props;\n this.updateFormatterSettings(settings as FormatterSettings);\n\n if (model !== prevProps.model) {\n this.unsubscribe(prevProps.model);\n this.subscribe(model);\n }\n\n if (isActive !== prevProps.isActive) {\n if (isActive) {\n this.subscribe(model);\n } else {\n this.unsubscribe(model);\n }\n }\n }\n\n componentWillUnmount(): void {\n const { model } = this.props;\n this.unsubscribe(model);\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 data: Partial<Data>[]\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 const has2D = data.some(\n ({ type }) => type != null && !type.includes('3d')\n );\n const has3D = data.some(\n ({ type }) => type != null && type.includes('3d')\n );\n\n const buttons2D = [\n 'zoomIn2d',\n 'zoomOut2d',\n 'autoScale2d',\n 'resetScale2d',\n ] as const;\n const buttons3D = [\n 'orbitRotation',\n 'tableRotation',\n 'resetCameraDefault3d',\n ] as const;\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 ['zoom2d', 'pan2d'], // These work the same for both 2d and 3d\n [...(has2D ? buttons2D : []), ...(has3D ? buttons3D : [])],\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(model: ChartModel): void {\n if (this.isSubscribed) {\n return;\n }\n\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(model: ChartModel): void {\n if (!this.isSubscribed) {\n return;\n }\n\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(model);\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 =\n FormatterUtils.getDateTimeFormatterOptions(settings);\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 ?? []\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,MA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EAC9BsG,iBAAiB,EAAEA,CAAA,KAAYtG;AACjC,CAAC;AA8hBH,eAAef,KAAK"}
|
|
1
|
+
{"version":3,"file":"Chart.js","names":["React","Component","deepEqual","memoize","vsLoading","dhGraphLineDown","dhWarningFilled","Formatter","FormatterUtils","DateUtils","Log","createPlotlyComponent","Plotly","ChartModel","ChartUtils","jsx","_jsx","log","module","Chart","convertIcon","faIcon","width","path","icon","stringPath","concat","ascent","descent","transform","downsampleButtonTitle","isDownsampleInProgress","isDownsamplingDisabled","downsampleButtonAttr","undefined","constructor","props","_defineProperty","downsamplingError","isDownsampleFinished","data","customButtons","hasDownsampleError","Boolean","push","name","title","click","attr","handleDownsampleClick","has2D","some","_ref","type","includes","has3D","_ref2","buttons2D","buttons3D","displaylogo","displayModeBar","modeBarButtons","handleAfterPlot","bind","handleModelEvent","handlePlotUpdate","handleRelayout","handleResize","handleRestyle","PlotComponent","plot","createRef","plotWrapper","columnFormats","dateTimeFormatterOptions","decimalFormatOptions","integerFormatOptions","isSubscribed","isLoadedFired","currentSeries","resizeObserver","window","ResizeObserver","state","layout","datarevision","revision","componentDidMount","updateDimensions","updateModelDimensions","initData","initFormatter","isActive","model","subscribe","current","observe","componentDidUpdate","prevProps","settings","updateFormatterSettings","unsubscribe","componentWillUnmount","disconnect","getPlotRect","_this$plotWrapper$cur","_this$plotWrapper$cur2","getBoundingClientRect","setState","getData","_objectSpread","getLayout","rect","height","debug2","_ref3","setDownsamplingDisabled","event","detail","EVENT_UPDATED","onUpdate","isLoading","EVENT_LOADFINISHED","EVENT_DISCONNECT","onDisconnect","EVENT_RECONNECT","onReconnect","EVENT_DOWNSAMPLESTARTED","EVENT_DOWNSAMPLEFINISHED","EVENT_DOWNSAMPLENEEDED","EVENT_DOWNSAMPLEFAILED","_detail$message","message","onError","Error","debug","figure","ranges","getLayoutRanges","isRangesChanged","changes","hiddenlabels","onSettingsChanged","hiddenSeries","_ref4","seriesIndexes","Object","keys","reduce","acc","_ref5","visible","force","arguments","length","warn","isRectChanged","setDimensions","getColumnFormats","getDateTimeFormatterOptions","updateFormatter","formatter","dh","setFormatter","PlotlyProp","relayout","el","autosize","catch","e","render","config","getCachedConfig","isPlotShown","className","ref","children","onAfterPlot","error","onRelayout","onRestyle","useResizeHandler","style","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 './plotly/createPlotlyComponent';\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.handleResize = this.handleResize.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 this.resizeObserver = new window.ResizeObserver(this.handleResize);\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, model } = this.props;\n if (isActive) {\n this.subscribe(model);\n }\n if (this.plotWrapper.current != null) {\n this.resizeObserver.observe(this.plotWrapper.current);\n }\n }\n\n componentDidUpdate(prevProps: ChartProps): void {\n const { isActive, model, settings } = this.props;\n this.updateFormatterSettings(settings as FormatterSettings);\n\n if (model !== prevProps.model) {\n this.unsubscribe(prevProps.model);\n this.subscribe(model);\n }\n\n if (isActive !== prevProps.isActive) {\n if (isActive) {\n this.updateDimensions();\n this.subscribe(model);\n } else {\n this.unsubscribe(model);\n }\n }\n }\n\n componentWillUnmount(): void {\n const { model } = this.props;\n this.unsubscribe(model);\n\n this.resizeObserver.disconnect();\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 // Listen for resizing of the element and update the canvas appropriately\n resizeObserver: ResizeObserver;\n\n getCachedConfig = memoize(\n (\n downsamplingError: unknown,\n isDownsampleFinished: boolean,\n isDownsampleInProgress: boolean,\n isDownsamplingDisabled: boolean,\n data: Partial<Data>[]\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 const has2D = data.some(\n ({ type }) => type != null && !type.includes('3d')\n );\n const has3D = data.some(\n ({ type }) => type != null && type.includes('3d')\n );\n\n const buttons2D = [\n 'zoomIn2d',\n 'zoomOut2d',\n 'autoScale2d',\n 'resetScale2d',\n ] as const;\n const buttons3D = [\n 'orbitRotation',\n 'tableRotation',\n 'resetCameraDefault3d',\n ] as const;\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 ['zoom2d', 'pan2d'], // These work the same for both 2d and 3d\n [...(has2D ? buttons2D : []), ...(has3D ? buttons3D : [])],\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(model: ChartModel): void {\n if (this.isSubscribed) {\n return;\n }\n\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(model: ChartModel): void {\n if (!this.isSubscribed) {\n return;\n }\n\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 handleResize(): void {\n this.updateDimensions();\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(model);\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 =\n FormatterUtils.getDateTimeFormatterOptions(settings);\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 ?? []\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;AAAC,OAU1BC,qBAAqB;AAAA,OACrBC,MAAM;AAAA,OACNC,UAAU;AAAA,OACVC,UAAU;AAAA;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAG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lB,KAAK,kBACM;EACpByE,QAAQ,EAAE,IAAI;EACdO,QAAQ,EAAE;IACRoF,QAAQ,EAAE,kBAAkB;IAC5BC,qBAAqB,EAAE/K,SAAS,CAACgL,gBAAgB;IACjDC,YAAY,EAAE,KAAK;IACnBC,cAAc,EAAE,IAAI;IACpB1B,SAAS,EAAE;EACb,CAAC;EACDrJ,MAAM;EACNgH,YAAY,EAAEA,CAAA,KAAY1F,SAAS;EACnC4F,WAAW,EAAEA,CAAA,KAAY5F,SAAS;EAClCsF,QAAQ,EAAEA,CAAA,KAAYtF,SAAS;EAC/BmG,OAAO,EAAEA,CAAA,KAAYnG,SAAS;EAC9B4G,iBAAiB,EAAEA,CAAA,KAAY5G;AACjC,CAAC;AA6iBH,eAAef,KAAK"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { dh as DhType, Figure, Table } from '@deephaven/jsapi-types';
|
|
2
2
|
import { ChartModelSettings } from './ChartUtils';
|
|
3
|
+
import { ChartTheme } from './ChartTheme';
|
|
3
4
|
import ChartModel from './ChartModel';
|
|
4
5
|
declare class ChartModelFactory {
|
|
5
6
|
/**
|
|
@@ -13,29 +14,12 @@ declare class ChartModelFactory {
|
|
|
13
14
|
* @param settings.xAxis The column name to use for the x-axis
|
|
14
15
|
* @param [settings.hiddenSeries] Array of hidden series names
|
|
15
16
|
* @param table The table to build the model for
|
|
16
|
-
* @param theme The theme for the figure
|
|
17
|
+
* @param theme The theme for the figure
|
|
17
18
|
* @returns The ChartModel Promise representing the figure
|
|
18
19
|
* CRA sets tsconfig to type check JS based on jsdoc comments. It isn't able to figure out FigureChartModel extends ChartModel
|
|
19
20
|
* This causes TS issues in 1 or 2 spots. Once this is TS it can be returned to just FigureChartModel
|
|
20
21
|
*/
|
|
21
|
-
static makeModelFromSettings(dh: DhType, settings: ChartModelSettings, table: Table, theme
|
|
22
|
-
paper_bgcolor: string;
|
|
23
|
-
plot_bgcolor: string;
|
|
24
|
-
title_color: string;
|
|
25
|
-
colorway: string;
|
|
26
|
-
gridcolor: string;
|
|
27
|
-
linecolor: string;
|
|
28
|
-
zerolinecolor: string;
|
|
29
|
-
activecolor: string;
|
|
30
|
-
rangebgcolor: string;
|
|
31
|
-
area_color: string;
|
|
32
|
-
trend_color: string;
|
|
33
|
-
line_color: string;
|
|
34
|
-
error_band_line_color: string;
|
|
35
|
-
error_band_fill_color: string;
|
|
36
|
-
ohlc_increasing: string;
|
|
37
|
-
ohlc_decreasing: string;
|
|
38
|
-
}>): Promise<ChartModel>;
|
|
22
|
+
static makeModelFromSettings(dh: DhType, settings: ChartModelSettings, table: Table, theme: ChartTheme): Promise<ChartModel>;
|
|
39
23
|
/**
|
|
40
24
|
* Creates a model from the settings provided.
|
|
41
25
|
* Tries to create a Figure in the API with it.
|
|
@@ -61,29 +45,12 @@ declare class ChartModelFactory {
|
|
|
61
45
|
* @param settings.xAxis The column name to use for the x-axis
|
|
62
46
|
* @param [settings.hiddenSeries] Array of hidden series names
|
|
63
47
|
* @param figure The figure to build the model for
|
|
64
|
-
* @param theme The theme for the figure
|
|
48
|
+
* @param theme The theme for the figure
|
|
65
49
|
* @returns The FigureChartModel representing the figure
|
|
66
50
|
* CRA sets tsconfig to type check JS based on jsdoc comments. It isn't able to figure out FigureChartModel extends ChartModel
|
|
67
51
|
* This causes TS issues in 1 or 2 spots. Once this is TS it can be returned to just FigureChartModel
|
|
68
52
|
*/
|
|
69
|
-
static makeModel(dh: DhType, settings: ChartModelSettings | undefined, figure: Figure, theme
|
|
70
|
-
paper_bgcolor: string;
|
|
71
|
-
plot_bgcolor: string;
|
|
72
|
-
title_color: string;
|
|
73
|
-
colorway: string;
|
|
74
|
-
gridcolor: string;
|
|
75
|
-
linecolor: string;
|
|
76
|
-
zerolinecolor: string;
|
|
77
|
-
activecolor: string;
|
|
78
|
-
rangebgcolor: string;
|
|
79
|
-
area_color: string;
|
|
80
|
-
trend_color: string;
|
|
81
|
-
line_color: string;
|
|
82
|
-
error_band_line_color: string;
|
|
83
|
-
error_band_fill_color: string;
|
|
84
|
-
ohlc_increasing: string;
|
|
85
|
-
ohlc_decreasing: string;
|
|
86
|
-
}>): Promise<ChartModel>;
|
|
53
|
+
static makeModel(dh: DhType, settings: ChartModelSettings | undefined, figure: Figure, theme: ChartTheme): Promise<ChartModel>;
|
|
87
54
|
}
|
|
88
55
|
export default ChartModelFactory;
|
|
89
56
|
//# sourceMappingURL=ChartModelFactory.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChartModelFactory.d.ts","sourceRoot":"","sources":["../src/ChartModelFactory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,IAAI,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAC1E,OAAmB,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"ChartModelFactory.d.ts","sourceRoot":"","sources":["../src/ChartModelFactory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,IAAI,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAC1E,OAAmB,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAE9D,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,UAAU,MAAM,cAAc,CAAC;AAEtC,cAAM,iBAAiB;IACrB;;;;;;;;;;;;;;;OAeG;WACU,qBAAqB,CAChC,EAAE,EAAE,MAAM,EACV,QAAQ,EAAE,kBAAkB,EAC5B,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,UAAU,GAChB,OAAO,CAAC,UAAU,CAAC;IAStB;;;;;;;;;;;;OAYG;WACU,sBAAsB,CACjC,EAAE,EAAE,MAAM,EACV,QAAQ,EAAE,kBAAkB,EAC5B,KAAK,EAAE,KAAK,GACX,OAAO,CAAC,MAAM,CAAC;IAelB;;;;;;;;;;;;;;;OAeG;WACU,SAAS,CACpB,EAAE,EAAE,MAAM,EACV,QAAQ,EAAE,kBAAkB,GAAG,SAAS,EACxC,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,UAAU,GAChB,OAAO,CAAC,UAAU,CAAC;CAGvB;AAED,eAAe,iBAAiB,CAAC"}
|
|
@@ -2,7 +2,6 @@ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try
|
|
|
2
2
|
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
3
3
|
import ChartUtils from "./ChartUtils.js";
|
|
4
4
|
import FigureChartModel from "./FigureChartModel.js";
|
|
5
|
-
import ChartTheme from "./ChartTheme.js";
|
|
6
5
|
class ChartModelFactory {
|
|
7
6
|
/**
|
|
8
7
|
* Creates a model from the settings provided.
|
|
@@ -15,17 +14,15 @@ class ChartModelFactory {
|
|
|
15
14
|
* @param settings.xAxis The column name to use for the x-axis
|
|
16
15
|
* @param [settings.hiddenSeries] Array of hidden series names
|
|
17
16
|
* @param table The table to build the model for
|
|
18
|
-
* @param theme The theme for the figure
|
|
17
|
+
* @param theme The theme for the figure
|
|
19
18
|
* @returns The ChartModel Promise representing the figure
|
|
20
19
|
* CRA sets tsconfig to type check JS based on jsdoc comments. It isn't able to figure out FigureChartModel extends ChartModel
|
|
21
20
|
* This causes TS issues in 1 or 2 spots. Once this is TS it can be returned to just FigureChartModel
|
|
22
21
|
*/
|
|
23
|
-
static makeModelFromSettings(dh, settings, table) {
|
|
24
|
-
var _arguments = arguments;
|
|
22
|
+
static makeModelFromSettings(dh, settings, table, theme) {
|
|
25
23
|
return _asyncToGenerator(function* () {
|
|
26
|
-
var theme = _arguments.length > 3 && _arguments[3] !== undefined ? _arguments[3] : ChartTheme;
|
|
27
24
|
var figure = yield ChartModelFactory.makeFigureFromSettings(dh, settings, table);
|
|
28
|
-
return new FigureChartModel(dh, figure,
|
|
25
|
+
return new FigureChartModel(dh, figure, theme, settings);
|
|
29
26
|
})();
|
|
30
27
|
}
|
|
31
28
|
|
|
@@ -67,16 +64,14 @@ class ChartModelFactory {
|
|
|
67
64
|
* @param settings.xAxis The column name to use for the x-axis
|
|
68
65
|
* @param [settings.hiddenSeries] Array of hidden series names
|
|
69
66
|
* @param figure The figure to build the model for
|
|
70
|
-
* @param theme The theme for the figure
|
|
67
|
+
* @param theme The theme for the figure
|
|
71
68
|
* @returns The FigureChartModel representing the figure
|
|
72
69
|
* CRA sets tsconfig to type check JS based on jsdoc comments. It isn't able to figure out FigureChartModel extends ChartModel
|
|
73
70
|
* This causes TS issues in 1 or 2 spots. Once this is TS it can be returned to just FigureChartModel
|
|
74
71
|
*/
|
|
75
|
-
static makeModel(dh, settings, figure) {
|
|
76
|
-
var _arguments2 = arguments;
|
|
72
|
+
static makeModel(dh, settings, figure, theme) {
|
|
77
73
|
return _asyncToGenerator(function* () {
|
|
78
|
-
|
|
79
|
-
return new FigureChartModel(dh, figure, settings, theme);
|
|
74
|
+
return new FigureChartModel(dh, figure, theme, settings);
|
|
80
75
|
})();
|
|
81
76
|
}
|
|
82
77
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChartModelFactory.js","names":["ChartUtils","FigureChartModel","
|
|
1
|
+
{"version":3,"file":"ChartModelFactory.js","names":["ChartUtils","FigureChartModel","ChartModelFactory","makeModelFromSettings","dh","settings","table","theme","_asyncToGenerator","figure","makeFigureFromSettings","tableCopy","copy","applyCustomColumns","customColumns","applyFilter","filter","applySort","sort","plot","Figure","create","makeFigureSettings","makeModel"],"sources":["../src/ChartModelFactory.ts"],"sourcesContent":["import type { dh as DhType, Figure, Table } from '@deephaven/jsapi-types';\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 dh JSAPI instance\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\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 dh: DhType,\n settings: ChartModelSettings,\n table: Table,\n theme: ChartTheme\n ): Promise<ChartModel> {\n const figure = await ChartModelFactory.makeFigureFromSettings(\n dh,\n settings,\n table\n );\n return new FigureChartModel(dh, figure, theme, settings);\n }\n\n /**\n * Creates a model from the settings provided.\n * Tries to create a Figure in the API with it.\n * @param dh DH JSAPI instance\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 dh: DhType,\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 table 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 new ChartUtils(dh).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 dh DH JSAPI instance\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\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 dh: DhType,\n settings: ChartModelSettings | undefined,\n figure: Figure,\n theme: ChartTheme\n ): Promise<ChartModel> {\n return new FigureChartModel(dh, figure, theme, settings);\n }\n}\n\nexport default ChartModelFactory;\n"],"mappings":";;OACOA,UAAU;AAAA,OACVC,gBAAgB;AAIvB,MAAMC,iBAAiB,CAAC;EACtB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACE,OAAaC,qBAAqBA,CAChCC,EAAU,EACVC,QAA4B,EAC5BC,KAAY,EACZC,KAAiB,EACI;IAAA,OAAAC,iBAAA;MACrB,IAAMC,MAAM,SAASP,iBAAiB,CAACQ,sBAAsB,CAC3DN,EAAE,EACFC,QAAQ,EACRC,KACF,CAAC;MACD,OAAO,IAAIL,gBAAgB,CAACG,EAAE,EAAEK,MAAM,EAAEF,KAAK,EAAEF,QAAQ,CAAC;IAAC;EAC3D;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACE,OAAaK,sBAAsBA,CACjCN,EAAU,EACVC,QAA4B,EAC5BC,KAAY,EACK;IAAA,OAAAE,iBAAA;MACjB;MACA;MACA;MACA;MACA,IAAMG,SAAS,SAASL,KAAK,CAACM,IAAI,CAAC,CAAC;MACpCD,SAAS,CAACE,kBAAkB,CAACP,KAAK,CAACQ,aAAa,CAAC;MACjDH,SAAS,CAACI,WAAW,CAACT,KAAK,CAACU,MAAM,CAAC;MACnCL,SAAS,CAACM,SAAS,CAACX,KAAK,CAACY,IAAI,CAAC;MAE/B,OAAOd,EAAE,CAACe,IAAI,CAACC,MAAM,CAACC,MAAM,CAC1B,IAAIrB,UAAU,CAACI,EAAE,CAAC,CAACkB,kBAAkB,CAACjB,QAAQ,EAAEM,SAAS,CAC3D,CAAC;IAAC;EACJ;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACE,OAAaY,SAASA,CACpBnB,EAAU,EACVC,QAAwC,EACxCI,MAAc,EACdF,KAAiB,EACI;IAAA,OAAAC,iBAAA;MACrB,OAAO,IAAIP,gBAAgB,CAACG,EAAE,EAAEK,MAAM,EAAEF,KAAK,EAAEF,QAAQ,CAAC;IAAC;EAC3D;AACF;AAEA,eAAeH,iBAAiB"}
|
package/dist/ChartTheme.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
export interface ChartTheme {
|
|
2
2
|
paper_bgcolor: string;
|
|
3
3
|
plot_bgcolor: string;
|
|
4
4
|
title_color: string;
|
|
@@ -15,6 +15,7 @@ declare const _default: Readonly<{
|
|
|
15
15
|
error_band_fill_color: string;
|
|
16
16
|
ohlc_increasing: string;
|
|
17
17
|
ohlc_decreasing: string;
|
|
18
|
-
}
|
|
19
|
-
export
|
|
18
|
+
}
|
|
19
|
+
export declare function defaultChartTheme(): Readonly<ChartTheme>;
|
|
20
|
+
export default defaultChartTheme;
|
|
20
21
|
//# sourceMappingURL=ChartTheme.d.ts.map
|
package/dist/ChartTheme.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChartTheme.d.ts","sourceRoot":"","sources":["../src/ChartTheme.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ChartTheme.d.ts","sourceRoot":"","sources":["../src/ChartTheme.ts"],"names":[],"mappings":"AAUA,MAAM,WAAW,UAAU;IACzB,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,qBAAqB,EAAE,MAAM,CAAC;IAC9B,qBAAqB,EAAE,MAAM,CAAC;IAC9B,eAAe,EAAE,MAAM,CAAC;IACxB,eAAe,EAAE,MAAM,CAAC;CACzB;AAED,wBAAgB,iBAAiB,IAAI,QAAQ,CAAC,UAAU,CAAC,CAmCxD;AAED,eAAe,iBAAiB,CAAC"}
|
package/dist/ChartTheme.js
CHANGED
|
@@ -1,20 +1,39 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
1
|
+
import { getExpressionRanges, resolveCssVariablesInRecord } from '@deephaven/components';
|
|
2
|
+
import Log from '@deephaven/log';
|
|
3
|
+
import { ColorUtils } from '@deephaven/utils';
|
|
4
|
+
import chartThemeRaw from "./ChartTheme.module.css";
|
|
5
|
+
var log = Log.module('ChartTheme');
|
|
6
|
+
export function defaultChartTheme() {
|
|
7
|
+
var _chartTheme$colorway;
|
|
8
|
+
var chartTheme = resolveCssVariablesInRecord(chartThemeRaw);
|
|
9
|
+
|
|
10
|
+
// The color normalization in `resolveCssVariablesInRecord` won't work for
|
|
11
|
+
// colorway since it is an array of colors. We need to explicitly normalize
|
|
12
|
+
// each color expression
|
|
13
|
+
chartTheme.colorway = getExpressionRanges((_chartTheme$colorway = chartTheme.colorway) !== null && _chartTheme$colorway !== void 0 ? _chartTheme$colorway : '').map(_ref => {
|
|
14
|
+
var [start, end] = _ref;
|
|
15
|
+
return ColorUtils.normalizeCssColor(chartTheme.colorway.substring(start, end + 1));
|
|
16
|
+
}).join(' ');
|
|
17
|
+
log.debug2('Chart theme:', chartThemeRaw);
|
|
18
|
+
log.debug2('Chart theme derived:', chartTheme);
|
|
19
|
+
return Object.freeze({
|
|
20
|
+
paper_bgcolor: chartTheme['paper-bgcolor'],
|
|
21
|
+
plot_bgcolor: chartTheme['plot-bgcolor'],
|
|
22
|
+
title_color: chartTheme['title-color'],
|
|
23
|
+
colorway: chartTheme.colorway,
|
|
24
|
+
gridcolor: chartTheme.gridcolor,
|
|
25
|
+
linecolor: chartTheme.linecolor,
|
|
26
|
+
zerolinecolor: chartTheme.zerolinecolor,
|
|
27
|
+
activecolor: chartTheme.activecolor,
|
|
28
|
+
rangebgcolor: chartTheme.rangebgcolor,
|
|
29
|
+
area_color: chartTheme['area-color'],
|
|
30
|
+
trend_color: chartTheme['trend-color'],
|
|
31
|
+
line_color: chartTheme['line-color'],
|
|
32
|
+
error_band_line_color: chartTheme['error-band-line-color'],
|
|
33
|
+
error_band_fill_color: chartTheme['error-band-fill-color'],
|
|
34
|
+
ohlc_increasing: chartTheme['ohlc-increasing'],
|
|
35
|
+
ohlc_decreasing: chartTheme['ohlc-decreasing']
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
export default defaultChartTheme;
|
|
20
39
|
//# sourceMappingURL=ChartTheme.js.map
|
package/dist/ChartTheme.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChartTheme.js","names":["
|
|
1
|
+
{"version":3,"file":"ChartTheme.js","names":["getExpressionRanges","resolveCssVariablesInRecord","Log","ColorUtils","chartThemeRaw","log","module","defaultChartTheme","_chartTheme$colorway","chartTheme","colorway","map","_ref","start","end","normalizeCssColor","substring","join","debug2","Object","freeze","paper_bgcolor","plot_bgcolor","title_color","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 {\n getExpressionRanges,\n resolveCssVariablesInRecord,\n} from '@deephaven/components';\nimport Log from '@deephaven/log';\nimport { ColorUtils } from '@deephaven/utils';\nimport chartThemeRaw from './ChartTheme.module.scss';\n\nconst log = Log.module('ChartTheme');\n\nexport interface ChartTheme {\n paper_bgcolor: string;\n plot_bgcolor: string;\n title_color: string;\n colorway: string;\n gridcolor: string;\n linecolor: string;\n zerolinecolor: string;\n activecolor: string;\n rangebgcolor: string;\n area_color: string;\n trend_color: string;\n line_color: string;\n error_band_line_color: string;\n error_band_fill_color: string;\n ohlc_increasing: string;\n ohlc_decreasing: string;\n}\n\nexport function defaultChartTheme(): Readonly<ChartTheme> {\n const chartTheme = resolveCssVariablesInRecord(chartThemeRaw);\n\n // The color normalization in `resolveCssVariablesInRecord` won't work for\n // colorway since it is an array of colors. We need to explicitly normalize\n // each color expression\n chartTheme.colorway = getExpressionRanges(chartTheme.colorway ?? '')\n .map(([start, end]) =>\n ColorUtils.normalizeCssColor(\n chartTheme.colorway.substring(start, end + 1)\n )\n )\n .join(' ');\n\n log.debug2('Chart theme:', chartThemeRaw);\n log.debug2('Chart theme derived:', chartTheme);\n\n return 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}\n\nexport default defaultChartTheme;\n"],"mappings":"AAAA,SACEA,mBAAmB,EACnBC,2BAA2B,QACtB,uBAAuB;AAC9B,OAAOC,GAAG,MAAM,gBAAgB;AAChC,SAASC,UAAU,QAAQ,kBAAkB;AAAC,OACvCC,aAAa;AAEpB,IAAMC,GAAG,GAAGH,GAAG,CAACI,MAAM,CAAC,YAAY,CAAC;AAqBpC,OAAO,SAASC,iBAAiBA,CAAA,EAAyB;EAAA,IAAAC,oBAAA;EACxD,IAAMC,UAAU,GAAGR,2BAA2B,CAACG,aAAa,CAAC;;EAE7D;EACA;EACA;EACAK,UAAU,CAACC,QAAQ,GAAGV,mBAAmB,EAAAQ,oBAAA,GAACC,UAAU,CAACC,QAAQ,cAAAF,oBAAA,cAAAA,oBAAA,GAAI,EAAE,CAAC,CACjEG,GAAG,CAACC,IAAA;IAAA,IAAC,CAACC,KAAK,EAAEC,GAAG,CAAC,GAAAF,IAAA;IAAA,OAChBT,UAAU,CAACY,iBAAiB,CAC1BN,UAAU,CAACC,QAAQ,CAACM,SAAS,CAACH,KAAK,EAAEC,GAAG,GAAG,CAAC,CAC9C,CAAC;EAAA,CACH,CAAC,CACAG,IAAI,CAAC,GAAG,CAAC;EAEZZ,GAAG,CAACa,MAAM,CAAC,cAAc,EAAEd,aAAa,CAAC;EACzCC,GAAG,CAACa,MAAM,CAAC,sBAAsB,EAAET,UAAU,CAAC;EAE9C,OAAOU,MAAM,CAACC,MAAM,CAAC;IACnBC,aAAa,EAAEZ,UAAU,CAAC,eAAe,CAAC;IAC1Ca,YAAY,EAAEb,UAAU,CAAC,cAAc,CAAC;IACxCc,WAAW,EAAEd,UAAU,CAAC,aAAa,CAAC;IACtCC,QAAQ,EAAED,UAAU,CAACC,QAAQ;IAC7Bc,SAAS,EAAEf,UAAU,CAACe,SAAS;IAC/BC,SAAS,EAAEhB,UAAU,CAACgB,SAAS;IAC/BC,aAAa,EAAEjB,UAAU,CAACiB,aAAa;IACvCC,WAAW,EAAElB,UAAU,CAACkB,WAAW;IACnCC,YAAY,EAAEnB,UAAU,CAACmB,YAAY;IACrCC,UAAU,EAAEpB,UAAU,CAAC,YAAY,CAAC;IACpCqB,WAAW,EAAErB,UAAU,CAAC,aAAa,CAAC;IACtCsB,UAAU,EAAEtB,UAAU,CAAC,YAAY,CAAC;IACpCuB,qBAAqB,EAAEvB,UAAU,CAAC,uBAAuB,CAAC;IAC1DwB,qBAAqB,EAAExB,UAAU,CAAC,uBAAuB,CAAC;IAC1DyB,eAAe,EAAEzB,UAAU,CAAC,iBAAiB,CAAC;IAC9C0B,eAAe,EAAE1B,UAAU,CAAC,iBAAiB;EAC/C,CAAC,CAAC;AACJ;AAEA,eAAeF,iBAAiB"}
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
/* stylelint-disable */
|
|
2
2
|
/* stylelint-disable scss/at-import-no-partial-leading-underscore */
|
|
3
3
|
:export {
|
|
4
|
-
paper-bgcolor:
|
|
5
|
-
plot-bgcolor:
|
|
6
|
-
title-color:
|
|
7
|
-
colorway:
|
|
8
|
-
gridcolor:
|
|
9
|
-
linecolor:
|
|
10
|
-
zerolinecolor:
|
|
11
|
-
activecolor:
|
|
12
|
-
rangebgcolor:
|
|
13
|
-
area-color:
|
|
14
|
-
trend-color:
|
|
15
|
-
line-color:
|
|
16
|
-
error-band-line-color:
|
|
17
|
-
error-band-fill-color:
|
|
18
|
-
ohlc-increasing:
|
|
19
|
-
ohlc-decreasing:
|
|
4
|
+
paper-bgcolor: var(--dh-color-chart-bg);
|
|
5
|
+
plot-bgcolor: var(--dh-color-chart-plot-bg);
|
|
6
|
+
title-color: var(--dh-color-chart-title);
|
|
7
|
+
colorway: var(--dh-color-chart-colorway);
|
|
8
|
+
gridcolor: var(--dh-color-chart-grid);
|
|
9
|
+
linecolor: var(--dh-color-chart-axis-line);
|
|
10
|
+
zerolinecolor: var(--dh-color-chart-axis-line-zero);
|
|
11
|
+
activecolor: var(--dh-color-chart-active);
|
|
12
|
+
rangebgcolor: var(--dh-color-chart-range-bg);
|
|
13
|
+
area-color: var(--dh-color-chart-area);
|
|
14
|
+
trend-color: var(--dh-color-chart-trend);
|
|
15
|
+
line-color: var(--dh-color-chart-line-deprecated);
|
|
16
|
+
error-band-line-color: var(--dh-color-chart-error-band-line);
|
|
17
|
+
error-band-fill-color: var(--dh-color-chart-error-band-fill);
|
|
18
|
+
ohlc-increasing: var(--dh-color-chart-ohlc-increase);
|
|
19
|
+
ohlc-decreasing: var(--dh-color-chart-ohlc-decrease);
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
/*# sourceMappingURL=ChartTheme.module.css.map */
|