@deephaven/chart 0.19.2-beta.0 → 0.19.2-beta.5
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 +1 -1
- package/dist/Chart.d.ts.map +1 -1
- package/dist/Chart.js +9 -5
- package/dist/Chart.js.map +1 -1
- package/dist/ChartUtils.d.ts.map +1 -1
- package/dist/ChartUtils.js +17 -14
- package/dist/ChartUtils.js.map +1 -1
- package/dist/FigureChartModel.d.ts.map +1 -1
- package/dist/FigureChartModel.js +4 -3
- package/dist/FigureChartModel.js.map +1 -1
- package/package.json +9 -9
package/dist/Chart.d.ts
CHANGED
|
@@ -69,7 +69,7 @@ export declare class Chart extends Component<ChartProps, ChartState> {
|
|
|
69
69
|
ranges?: unknown;
|
|
70
70
|
isSubscribed: boolean;
|
|
71
71
|
isLoadedFired: boolean;
|
|
72
|
-
getCachedConfig: (
|
|
72
|
+
getCachedConfig: (downsamplingError: unknown, isDownsampleFinished: boolean, isDownsampleInProgress: boolean, isDownsamplingDisabled: boolean) => {
|
|
73
73
|
displaylogo: boolean;
|
|
74
74
|
displayModeBar: string | boolean;
|
|
75
75
|
modeBarButtons: (string[] | {
|
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,EACd,oBAAoB,EACpB,sBAAsB,EACvB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAEnD,OAAO,IAAI,MAAM,eA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AA;KAAE,GAAG,IAAI;IAa1D,aAAa,CAAC,CAAC,OAAO,EAAE,aAAa,CAAC,EAAE;QACtC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;QACvB,MAAM,EAAE;KACT,GAAG,IAAI;IAgBR;;;;;;;OAOG;IACH,qBAAqB,CAAC,KAAK,UAAQ,GAAG,IAAI;IAwB1C,aAAa,IAAI,IAAI;IAKrB,uBAAuB,CAAC,QAAQ,EAAE,iBAAiB,GAAG,IAAI;IAqB1D,eAAe,IAAI,IAAI;IAYvB,gBAAgB,IAAI,IAAI;IAkBxB,MAAM,IAAI,YAAY;CAsCvB;AAED,eAAe,KAAK,CAAC"}
|
package/dist/Chart.js
CHANGED
|
@@ -78,8 +78,9 @@ export class Chart extends Component {
|
|
|
78
78
|
|
|
79
79
|
_defineProperty(this, "getCachedConfig", memoize((downsamplingError, isDownsampleFinished, isDownsampleInProgress, isDownsamplingDisabled) => {
|
|
80
80
|
var customButtons = [];
|
|
81
|
+
var hasDownsampleError = Boolean(downsamplingError);
|
|
81
82
|
|
|
82
|
-
if (
|
|
83
|
+
if (hasDownsampleError) {
|
|
83
84
|
customButtons.push({
|
|
84
85
|
name: "Downsampling failed: ".concat(downsamplingError),
|
|
85
86
|
click: () => undefined,
|
|
@@ -88,7 +89,7 @@ export class Chart extends Component {
|
|
|
88
89
|
});
|
|
89
90
|
}
|
|
90
91
|
|
|
91
|
-
if (isDownsampleFinished || isDownsampleInProgress || isDownsamplingDisabled ||
|
|
92
|
+
if (isDownsampleFinished || isDownsampleInProgress || isDownsamplingDisabled || hasDownsampleError) {
|
|
92
93
|
var name = Chart.downsampleButtonTitle(isDownsampleInProgress, isDownsamplingDisabled);
|
|
93
94
|
var attr = Chart.downsampleButtonAttr(isDownsampleInProgress, isDownsamplingDisabled);
|
|
94
95
|
var icon = isDownsampleInProgress ? vsLoading : dhGraphLineDown;
|
|
@@ -104,7 +105,8 @@ export class Chart extends Component {
|
|
|
104
105
|
displaylogo: false,
|
|
105
106
|
// Display the mode bar if there's an error or downsampling so user can see progress
|
|
106
107
|
// 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
|
|
107
|
-
displayModeBar:
|
|
108
|
+
displayModeBar: // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
|
|
109
|
+
isDownsampleInProgress || hasDownsampleError ? true : 'hover',
|
|
108
110
|
// Each array gets grouped together in the mode bar
|
|
109
111
|
modeBarButtons: [customButtons, ['toImage'], ['zoom2d', 'pan2d'], ['zoomIn2d', 'zoomOut2d', 'autoScale2d', 'resetScale2d']]
|
|
110
112
|
};
|
|
@@ -223,7 +225,7 @@ export class Chart extends Component {
|
|
|
223
225
|
}
|
|
224
226
|
|
|
225
227
|
handleAfterPlot() {
|
|
226
|
-
if (this.plot.current) {// TODO: Translate whatever Don was doing in plotting.js in the afterplot here so that area graphs show up properly
|
|
228
|
+
if (this.plot.current != null) {// TODO: Translate whatever Don was doing in plotting.js in the afterplot here so that area graphs show up properly
|
|
227
229
|
}
|
|
228
230
|
}
|
|
229
231
|
|
|
@@ -340,7 +342,9 @@ export class Chart extends Component {
|
|
|
340
342
|
case ChartModel.EVENT_DOWNSAMPLENEEDED:
|
|
341
343
|
case ChartModel.EVENT_DOWNSAMPLEFAILED:
|
|
342
344
|
{
|
|
343
|
-
var
|
|
345
|
+
var _detail$message;
|
|
346
|
+
|
|
347
|
+
var downsamplingError = (_detail$message = detail.message) !== null && _detail$message !== void 0 ? _detail$message : detail;
|
|
344
348
|
this.setState({
|
|
345
349
|
isDownsampleFinished: false,
|
|
346
350
|
isDownsampleInProgress: false,
|
package/dist/Chart.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Chart.js","names":["React","Component","deepEqual","memoize","vsLoading","dhGraphLineDown","dhWarningFilled","Formatter","FormatterUtils","DateUtils","Log","Plotly","Plot","ChartModel","ChartUtils","log","module","Chart","convertIcon","faIcon","width","path","icon","stringPath","ascent","descent","transform","downsampleButtonTitle","isDownsampleInProgress","isDownsamplingDisabled","downsampleButtonAttr","undefined","constructor","props","downsamplingError","isDownsampleFinished","customButtons","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 ColumnFormatSettings,\n DateTimeFormatSettings,\n} from '@deephaven/jsapi-utils';\nimport Log from '@deephaven/log';\nimport { Layout, Icon, PlotData } from 'plotly.js';\nimport Plotly from './plotly/Plotly';\nimport Plot from './plotly/Plot';\nimport ChartModel from './ChartModel';\nimport ChartUtils, { ChartModelSettings } from './ChartUtils';\nimport './Chart.scss';\n\nconst log = Log.module('Chart');\n\ntype FormatterSettings = ColumnFormatSettings &\n DateTimeFormatSettings & {\n decimalFormatOptions?: DecimalColumnFormatterOptions;\n integerFormatOptions?: IntegerColumnFormatterOptions;\n };\n\ninterface ChartProps {\n model: ChartModel;\n settings: FormatterSettings;\n isActive: boolean;\n onDisconnect: () => void;\n onReconnect: () => void;\n onUpdate: (obj: { isLoading: boolean }) => void;\n onError: (error: Error) => void;\n onSettingsChanged: (settings: Partial<ChartModelSettings>) => void;\n}\n\ninterface ChartState {\n data: Partial<PlotData>[] | null;\n downsamplingError: unknown;\n isDownsampleFinished: boolean;\n isDownsampleInProgress: boolean;\n isDownsamplingDisabled: boolean;\n layout: Partial<Layout>;\n revision: number;\n}\n\nexport class Chart extends Component<ChartProps, ChartState> {\n static defaultProps = {\n isActive: true,\n settings: {\n timeZone: 'America/New_York',\n defaultDateTimeFormat: DateUtils.FULL_DATE_FORMAT,\n showTimeZone: false,\n showTSeparator: true,\n formatter: [],\n },\n onDisconnect: (): void => undefined,\n onReconnect: (): void => undefined,\n onUpdate: (): void => undefined,\n onError: (): void => undefined,\n onSettingsChanged: (): void => undefined,\n };\n\n /**\n * Convert a font awesome icon definition to a plotly icon definition\n * @param faIcon The icon to convert\n */\n static convertIcon(faIcon: IconDefinition): Icon {\n const [width, , , , path] = faIcon.icon;\n // By default the icons are flipped upside down, so we need to add our own transform\n // https://github.com/plotly/plotly.js/issues/1335\n const stringPath = `${path}`;\n return {\n width,\n path: stringPath,\n ascent: width,\n descent: 0,\n transform: `matrix(1, 0, 0, 1, 0, 0)`,\n };\n }\n\n static downsampleButtonTitle(\n isDownsampleInProgress: boolean,\n isDownsamplingDisabled: boolean\n ): string {\n if (isDownsampleInProgress) {\n return 'Downsampling in progress...';\n }\n\n return isDownsamplingDisabled\n ? 'Downsampling disabled, click to enable'\n : 'Downsampling enabled, click to disable';\n }\n\n static downsampleButtonAttr(\n isDownsampleInProgress: boolean,\n isDownsamplingDisabled: boolean\n ): string | undefined {\n if (isDownsampleInProgress) {\n return 'animation-spin';\n }\n\n return isDownsamplingDisabled ? undefined : 'fill-active';\n }\n\n constructor(props: ChartProps) {\n super(props);\n\n this.handleAfterPlot = this.handleAfterPlot.bind(this);\n this.handleDownsampleClick = this.handleDownsampleClick.bind(this);\n this.handleModelEvent = this.handleModelEvent.bind(this);\n this.handlePlotUpdate = this.handlePlotUpdate.bind(this);\n this.handleRelayout = this.handleRelayout.bind(this);\n this.handleRestyle = this.handleRestyle.bind(this);\n\n this.plot = React.createRef();\n this.plotWrapper = React.createRef();\n this.columnFormats = [];\n this.dateTimeFormatterOptions = {};\n this.decimalFormatOptions = {};\n this.integerFormatOptions = {};\n this.isSubscribed = false;\n this.isLoadedFired = false;\n this.currentSeries = 0;\n\n this.state = {\n data: null,\n downsamplingError: null,\n isDownsampleFinished: false,\n isDownsampleInProgress: false,\n isDownsamplingDisabled: false,\n layout: {\n datarevision: 0,\n },\n revision: 0,\n };\n }\n\n componentDidMount(): void {\n // Need to make sure the model dimensions are up to date before initializing the data\n this.updateDimensions();\n this.updateModelDimensions();\n\n this.initData();\n this.initFormatter();\n\n const { isActive } = this.props;\n if (isActive) {\n this.subscribe();\n }\n }\n\n componentDidUpdate(prevProps: ChartProps): void {\n const { isActive, settings } = this.props;\n this.updateFormatterSettings(settings as FormatterSettings);\n\n if (isActive !== prevProps.isActive) {\n if (isActive) {\n this.subscribe();\n } else {\n this.unsubscribe();\n }\n }\n }\n\n componentWillUnmount(): void {\n this.unsubscribe();\n }\n\n currentSeries: number;\n\n plot: RefObject<typeof Plot>;\n\n plotWrapper: RefObject<HTMLDivElement>;\n\n columnFormats?: FormattingRule[];\n\n dateTimeFormatterOptions?: DateTimeColumnFormatterOptions;\n\n decimalFormatOptions: DecimalColumnFormatterOptions;\n\n integerFormatOptions: IntegerColumnFormatterOptions;\n\n rect?: DOMRect;\n\n ranges?: unknown;\n\n isSubscribed: boolean;\n\n isLoadedFired: boolean;\n\n getCachedConfig = memoize(\n (\n downsamplingError,\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(settings: FormatterSettings): void {\n const columnFormats = FormatterUtils.getColumnFormats(settings);\n const dateTimeFormatterOptions = FormatterUtils.getDateTimeFormatterOptions(\n settings\n );\n const { decimalFormatOptions = {}, integerFormatOptions = {} } = settings;\n\n if (\n !deepEqual(this.columnFormats, columnFormats) ||\n !deepEqual(this.dateTimeFormatterOptions, dateTimeFormatterOptions) ||\n !deepEqual(this.decimalFormatOptions, decimalFormatOptions) ||\n !deepEqual(this.integerFormatOptions, integerFormatOptions)\n ) {\n this.columnFormats = FormatterUtils.getColumnFormats(settings);\n this.dateTimeFormatterOptions = dateTimeFormatterOptions;\n this.decimalFormatOptions = decimalFormatOptions;\n this.integerFormatOptions = integerFormatOptions;\n this.updateFormatter();\n }\n }\n\n updateFormatter(): void {\n const 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,QAUO,wBAVP;AAWA,OAAOC,GAAP,MAAgB,gBAAhB;OAEOC,M;OACAC,I;OACAC,U;OACAC,U;;AAGP,IAAMC,GAAG,GAAGL,GAAG,CAACM,MAAJ,CAAW,OAAX,CAAZ;AA6BA,OAAO,MAAMC,KAAN,SAAoBhB,SAApB,CAAsD;EAiB3D;AACF;AACA;AACA;EACoB,OAAXiB,WAAW,CAACC,MAAD,EAA+B;IAC/C,IAAM,CAACC,KAAD,KAAcC,IAAd,IAAsBF,MAAM,CAACG,IAAnC,CAD+C,CAE/C;IACA;;IACA,IAAMC,UAAU,aAAMF,IAAN,CAAhB;IACA,OAAO;MACLD,KADK;MAELC,IAAI,EAAEE,UAFD;MAGLC,MAAM,EAAEJ,KAHH;MAILK,OAAO,EAAE,CAJJ;MAKLC,SAAS;IALJ,CAAP;EAOD;;EAE2B,OAArBC,qB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,CADF;EAoBD;;AAlgB0D;;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;;AAogBxB,eAAed,KAAf"}
|
|
1
|
+
{"version":3,"file":"Chart.js","names":["React","Component","deepEqual","memoize","vsLoading","dhGraphLineDown","dhWarningFilled","Formatter","FormatterUtils","DateUtils","Log","Plotly","Plot","ChartModel","ChartUtils","log","module","Chart","convertIcon","faIcon","width","path","icon","stringPath","ascent","descent","transform","downsampleButtonTitle","isDownsampleInProgress","isDownsamplingDisabled","downsampleButtonAttr","undefined","constructor","props","downsamplingError","isDownsampleFinished","customButtons","hasDownsampleError","Boolean","push","name","click","attr","handleDownsampleClick","displaylogo","displayModeBar","modeBarButtons","handleAfterPlot","bind","handleModelEvent","handlePlotUpdate","handleRelayout","handleRestyle","plot","createRef","plotWrapper","columnFormats","dateTimeFormatterOptions","decimalFormatOptions","integerFormatOptions","isSubscribed","isLoadedFired","currentSeries","state","data","layout","datarevision","revision","componentDidMount","updateDimensions","updateModelDimensions","initData","initFormatter","isActive","subscribe","componentDidUpdate","prevProps","settings","updateFormatterSettings","unsubscribe","componentWillUnmount","getPlotRect","current","getBoundingClientRect","model","setState","getData","getLayout","rect","height","debug2","setDownsamplingDisabled","event","type","detail","EVENT_UPDATED","onUpdate","isLoading","EVENT_LOADFINISHED","EVENT_DISCONNECT","onDisconnect","EVENT_RECONNECT","onReconnect","EVENT_DOWNSAMPLESTARTED","EVENT_DOWNSAMPLEFINISHED","EVENT_DOWNSAMPLENEEDED","EVENT_DOWNSAMPLEFAILED","message","onError","Error","debug","figure","ranges","getLayoutRanges","isRangesChanged","changes","hiddenlabels","onSettingsChanged","hiddenSeries","seriesIndexes","Object","keys","includes","reduce","acc","visible","force","warn","isRectChanged","setDimensions","getColumnFormats","getDateTimeFormatterOptions","updateFormatter","formatter","setFormatter","relayout","el","autosize","catch","e","render","config","getCachedConfig","isPlotShown","error","timeZone","defaultDateTimeFormat","FULL_DATE_FORMAT","showTimeZone","showTSeparator"],"sources":["../src/Chart.tsx"],"sourcesContent":["import React, { Component, ReactElement, RefObject } from 'react';\nimport deepEqual from 'deep-equal';\nimport memoize from 'memoize-one';\nimport {\n vsLoading,\n dhGraphLineDown,\n dhWarningFilled,\n IconDefinition,\n} from '@deephaven/icons';\nimport {\n Formatter,\n FormatterUtils,\n DateUtils,\n DateTimeColumnFormatterOptions,\n DecimalColumnFormatterOptions,\n IntegerColumnFormatterOptions,\n FormattingRule,\n ColumnFormatSettings,\n DateTimeFormatSettings,\n} from '@deephaven/jsapi-utils';\nimport Log from '@deephaven/log';\nimport { Layout, Icon, PlotData } from 'plotly.js';\nimport Plotly from './plotly/Plotly';\nimport Plot from './plotly/Plot';\nimport ChartModel from './ChartModel';\nimport ChartUtils, { ChartModelSettings } from './ChartUtils';\nimport './Chart.scss';\n\nconst log = Log.module('Chart');\n\ntype FormatterSettings = ColumnFormatSettings &\n DateTimeFormatSettings & {\n decimalFormatOptions?: DecimalColumnFormatterOptions;\n integerFormatOptions?: IntegerColumnFormatterOptions;\n };\n\ninterface ChartProps {\n model: ChartModel;\n settings: FormatterSettings;\n isActive: boolean;\n onDisconnect: () => void;\n onReconnect: () => void;\n onUpdate: (obj: { isLoading: boolean }) => void;\n onError: (error: Error) => void;\n onSettingsChanged: (settings: Partial<ChartModelSettings>) => void;\n}\n\ninterface ChartState {\n data: Partial<PlotData>[] | null;\n downsamplingError: unknown;\n isDownsampleFinished: boolean;\n isDownsampleInProgress: boolean;\n isDownsamplingDisabled: boolean;\n layout: Partial<Layout>;\n revision: number;\n}\n\nexport class Chart extends Component<ChartProps, ChartState> {\n static defaultProps = {\n isActive: true,\n settings: {\n timeZone: 'America/New_York',\n defaultDateTimeFormat: DateUtils.FULL_DATE_FORMAT,\n showTimeZone: false,\n showTSeparator: true,\n formatter: [],\n },\n onDisconnect: (): void => undefined,\n onReconnect: (): void => undefined,\n onUpdate: (): void => undefined,\n onError: (): void => undefined,\n onSettingsChanged: (): void => undefined,\n };\n\n /**\n * Convert a font awesome icon definition to a plotly icon definition\n * @param faIcon The icon to convert\n */\n static convertIcon(faIcon: IconDefinition): Icon {\n const [width, , , , path] = faIcon.icon;\n // By default the icons are flipped upside down, so we need to add our own transform\n // https://github.com/plotly/plotly.js/issues/1335\n const stringPath = `${path}`;\n return {\n width,\n path: stringPath,\n ascent: width,\n descent: 0,\n transform: `matrix(1, 0, 0, 1, 0, 0)`,\n };\n }\n\n static downsampleButtonTitle(\n isDownsampleInProgress: boolean,\n isDownsamplingDisabled: boolean\n ): string {\n if (isDownsampleInProgress) {\n return 'Downsampling in progress...';\n }\n\n return isDownsamplingDisabled\n ? 'Downsampling disabled, click to enable'\n : 'Downsampling enabled, click to disable';\n }\n\n static downsampleButtonAttr(\n isDownsampleInProgress: boolean,\n isDownsamplingDisabled: boolean\n ): string | undefined {\n if (isDownsampleInProgress) {\n return 'animation-spin';\n }\n\n return isDownsamplingDisabled ? undefined : 'fill-active';\n }\n\n constructor(props: ChartProps) {\n super(props);\n\n this.handleAfterPlot = this.handleAfterPlot.bind(this);\n this.handleDownsampleClick = this.handleDownsampleClick.bind(this);\n this.handleModelEvent = this.handleModelEvent.bind(this);\n this.handlePlotUpdate = this.handlePlotUpdate.bind(this);\n this.handleRelayout = this.handleRelayout.bind(this);\n this.handleRestyle = this.handleRestyle.bind(this);\n\n this.plot = React.createRef();\n this.plotWrapper = React.createRef();\n this.columnFormats = [];\n this.dateTimeFormatterOptions = {};\n this.decimalFormatOptions = {};\n this.integerFormatOptions = {};\n this.isSubscribed = false;\n this.isLoadedFired = false;\n this.currentSeries = 0;\n\n this.state = {\n data: null,\n downsamplingError: null,\n isDownsampleFinished: false,\n isDownsampleInProgress: false,\n isDownsamplingDisabled: false,\n layout: {\n datarevision: 0,\n },\n revision: 0,\n };\n }\n\n componentDidMount(): void {\n // Need to make sure the model dimensions are up to date before initializing the data\n this.updateDimensions();\n this.updateModelDimensions();\n\n this.initData();\n this.initFormatter();\n\n const { isActive } = this.props;\n if (isActive) {\n this.subscribe();\n }\n }\n\n componentDidUpdate(prevProps: ChartProps): void {\n const { isActive, settings } = this.props;\n this.updateFormatterSettings(settings as FormatterSettings);\n\n if (isActive !== prevProps.isActive) {\n if (isActive) {\n this.subscribe();\n } else {\n this.unsubscribe();\n }\n }\n }\n\n componentWillUnmount(): void {\n this.unsubscribe();\n }\n\n currentSeries: number;\n\n plot: RefObject<typeof Plot>;\n\n plotWrapper: RefObject<HTMLDivElement>;\n\n columnFormats?: FormattingRule[];\n\n dateTimeFormatterOptions?: DateTimeColumnFormatterOptions;\n\n decimalFormatOptions: DecimalColumnFormatterOptions;\n\n integerFormatOptions: IntegerColumnFormatterOptions;\n\n rect?: DOMRect;\n\n ranges?: unknown;\n\n isSubscribed: boolean;\n\n isLoadedFired: boolean;\n\n getCachedConfig = memoize(\n (\n downsamplingError: unknown,\n isDownsampleFinished: boolean,\n isDownsampleInProgress: boolean,\n isDownsamplingDisabled: boolean\n ) => {\n const customButtons = [];\n const hasDownsampleError = Boolean(downsamplingError);\n if (hasDownsampleError) {\n customButtons.push({\n name: `Downsampling failed: ${downsamplingError}`,\n click: () => undefined,\n icon: Chart.convertIcon(dhWarningFilled),\n attr: 'fill-warning',\n });\n }\n\n if (\n isDownsampleFinished ||\n isDownsampleInProgress ||\n isDownsamplingDisabled ||\n hasDownsampleError\n ) {\n const name = Chart.downsampleButtonTitle(\n isDownsampleInProgress,\n isDownsamplingDisabled\n );\n const attr = Chart.downsampleButtonAttr(\n isDownsampleInProgress,\n isDownsamplingDisabled\n );\n\n const icon = isDownsampleInProgress ? vsLoading : dhGraphLineDown;\n customButtons.push({\n name,\n icon: Chart.convertIcon(icon),\n click: this.handleDownsampleClick,\n attr,\n });\n }\n\n return {\n displaylogo: false,\n\n // Display the mode bar if there's an error or downsampling so user can see progress\n // Yes, the value is a boolean or the string 'hover': https://github.com/plotly/plotly.js/blob/master/src/plot_api/plot_config.js#L249\n displayModeBar:\n // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions\n isDownsampleInProgress || hasDownsampleError ? true : 'hover',\n\n // Each array gets grouped together in the mode bar\n modeBarButtons: [\n customButtons,\n ['toImage'],\n ['zoom2d', 'pan2d'],\n ['zoomIn2d', 'zoomOut2d', 'autoScale2d', 'resetScale2d'],\n ],\n };\n }\n );\n\n getPlotRect(): DOMRect | null {\n return this.plotWrapper.current?.getBoundingClientRect() ?? null;\n }\n\n initData(): void {\n const { model } = this.props;\n const { layout } = this.state;\n this.setState({\n data: model.getData(),\n layout: {\n ...layout,\n ...model.getLayout(),\n },\n });\n }\n\n subscribe(): void {\n if (this.isSubscribed) {\n return;\n }\n\n const { model } = this.props;\n if (!this.rect || this.rect.width === 0 || this.rect.height === 0) {\n log.debug2('Delaying subscription until model dimensions are set');\n return;\n }\n model.subscribe(this.handleModelEvent);\n this.isSubscribed = true;\n }\n\n unsubscribe(): void {\n if (!this.isSubscribed) {\n return;\n }\n\n const { model } = this.props;\n model.unsubscribe(this.handleModelEvent);\n this.isSubscribed = false;\n }\n\n handleAfterPlot(): void {\n if (this.plot.current != null) {\n // TODO: Translate whatever Don was doing in plotting.js in the afterplot here so that area graphs show up properly\n }\n }\n\n handleDownsampleClick(): void {\n this.setState(\n ({ isDownsamplingDisabled }) => ({\n downsamplingError: null,\n isDownsampleInProgress: false,\n isDownsampleFinished: false,\n isDownsamplingDisabled: !isDownsamplingDisabled,\n }),\n () => {\n const { model } = this.props;\n const { isDownsamplingDisabled } = this.state;\n model.setDownsamplingDisabled(isDownsamplingDisabled);\n }\n );\n }\n\n handleModelEvent(event: CustomEvent): void {\n const { type, detail } = event;\n log.debug2('Received data update', type, detail);\n\n switch (type) {\n case ChartModel.EVENT_UPDATED: {\n this.currentSeries += 1;\n this.setState(state => {\n const { layout, revision } = state;\n if (typeof layout.datarevision === 'number') {\n layout.datarevision += 1;\n }\n return {\n data: detail,\n layout,\n revision: revision + 1,\n };\n });\n\n const { onUpdate } = this.props;\n onUpdate({ isLoading: !this.isLoadedFired });\n break;\n }\n case ChartModel.EVENT_LOADFINISHED: {\n const { onUpdate } = this.props;\n this.isLoadedFired = true;\n onUpdate({ isLoading: false });\n break;\n }\n case ChartModel.EVENT_DISCONNECT: {\n const { onDisconnect } = this.props;\n onDisconnect();\n break;\n }\n case ChartModel.EVENT_RECONNECT: {\n const { onReconnect } = this.props;\n onReconnect();\n break;\n }\n case ChartModel.EVENT_DOWNSAMPLESTARTED: {\n this.setState({\n isDownsampleFinished: false,\n isDownsampleInProgress: true,\n downsamplingError: null,\n });\n break;\n }\n case ChartModel.EVENT_DOWNSAMPLEFINISHED: {\n this.setState({\n isDownsampleFinished: true,\n isDownsampleInProgress: false,\n downsamplingError: null,\n });\n break;\n }\n case ChartModel.EVENT_DOWNSAMPLENEEDED:\n case ChartModel.EVENT_DOWNSAMPLEFAILED: {\n const downsamplingError = detail.message ?? detail;\n this.setState({\n isDownsampleFinished: false,\n isDownsampleInProgress: false,\n isDownsamplingDisabled: false,\n downsamplingError,\n });\n\n const { onError } = this.props;\n onError(new Error(downsamplingError));\n break;\n }\n default:\n log.debug('Unknown event type', type, event);\n }\n }\n\n handlePlotUpdate(figure: { layout: Layout }): void {\n // User could have modified zoom/pan here, update the model dimensions\n // We don't need to update the datarevision, as we don't have any data changes\n // until an update comes back from the server anyway\n const { layout } = figure;\n const ranges = ChartUtils.getLayoutRanges(layout);\n\n const isRangesChanged = !deepEqual(ranges, this.ranges);\n\n if (isRangesChanged) {\n this.ranges = ranges;\n\n this.updateModelDimensions(true);\n }\n }\n\n handleRelayout(changes: { hiddenlabels?: string[] }): void {\n log.debug('handleRelayout', changes);\n if (changes.hiddenlabels != null) {\n const { onSettingsChanged } = this.props;\n // Pie charts store series visibility in layout.hiddenlabels and trigger relayout on changes\n // Series visibility for other types of charts is handled in handleRestyle\n const hiddenSeries = [...changes.hiddenlabels];\n onSettingsChanged({ hiddenSeries });\n }\n\n this.updateModelDimensions();\n }\n\n handleRestyle([changes, seriesIndexes]: [\n Record<string, unknown>,\n number[]\n ]): void {\n log.debug('handleRestyle', changes, seriesIndexes);\n if (Object.keys(changes).includes('visible')) {\n const { data } = this.state;\n const { onSettingsChanged } = this.props;\n if (data != null) {\n const hiddenSeries = data.reduce(\n (acc: string[], { name, visible }) =>\n name != null && visible === 'legendonly' ? [...acc, name] : acc,\n []\n );\n onSettingsChanged({ hiddenSeries });\n }\n }\n }\n\n /**\n * Update the models dimensions and ranges.\n * Note that this will update it all whether the plot size changes OR the range\n * the user is looking at has changed (eg. panning/zooming).\n * Could update each independently, but doing them at the same time keeps the\n * ChartModel API a bit cleaner.\n * @param force Force a change even if the chart dimensions haven't changed (eg. after pan/zoom)\n */\n updateModelDimensions(force = false): void {\n const rect = this.getPlotRect();\n if (!rect) {\n log.warn('Unable to get plotting rect');\n return;\n }\n\n const isRectChanged =\n !this.rect ||\n this.rect.width !== rect.width ||\n this.rect.height !== rect.height;\n\n if (isRectChanged || force) {\n this.rect = rect;\n\n const { isActive, model } = this.props;\n model.setDimensions(rect);\n // We may need to resubscribe if dimensions were too small before\n if (isActive) {\n this.subscribe();\n }\n }\n }\n\n initFormatter(): void {\n const { settings } = this.props;\n this.updateFormatterSettings(settings as FormatterSettings);\n }\n\n updateFormatterSettings(settings: FormatterSettings): void {\n const columnFormats = FormatterUtils.getColumnFormats(settings);\n const dateTimeFormatterOptions = FormatterUtils.getDateTimeFormatterOptions(\n settings\n );\n const { decimalFormatOptions = {}, integerFormatOptions = {} } = settings;\n\n if (\n !deepEqual(this.columnFormats, columnFormats) ||\n !deepEqual(this.dateTimeFormatterOptions, dateTimeFormatterOptions) ||\n !deepEqual(this.decimalFormatOptions, decimalFormatOptions) ||\n !deepEqual(this.integerFormatOptions, integerFormatOptions)\n ) {\n this.columnFormats = FormatterUtils.getColumnFormats(settings);\n this.dateTimeFormatterOptions = dateTimeFormatterOptions;\n this.decimalFormatOptions = decimalFormatOptions;\n this.integerFormatOptions = integerFormatOptions;\n this.updateFormatter();\n }\n }\n\n updateFormatter(): void {\n const 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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iB,CAAC,QAAQ,EAAE,kBAAkB,GAAG,MAAM;IAU9D;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,kBAAkB,CACvB,QAAQ,EAAE,kBAAkB,EAC5B,KAAK,EAAE,aAAa,GACnB;QACD,MAAM,EAAE;YACN,SAAS,EAAE,MAAM,CAAC;YAClB,IAAI,EAAE;gBAAE,UAAU,EAAE,MAAM,CAAC;gBAAC,IAAI,EAAE,MAAM,CAAC;gBAAC,QAAQ,EAAE,MAAM,CAAA;aAAE,EAAE,CAAC;YAC/D,MAAM,EAAE;gBACN,SAAS,EAAE,MAAM,CAAC;gBAClB,IAAI,EAAE,MAAM,CAAC;gBACb,WAAW,EAAE;oBACX,IAAI,EAAE,MAAM,CAAC;oBACb,UAAU,EAAE,MAAM,CAAC;oBACnB,IAAI,EAAE;wBAAE,UAAU,EAAE,MAAM,CAAC;wBAAC,IAAI,EAAE,MAAM,CAAC;wBAAC,QAAQ,EAAE,MAAM,CAAA;qBAAE,CAAC;oBAC7D,KAAK,EAAE,aAAa,CAAC;iBACtB,EAAE,CAAC;aACL,EAAE,CAAC;SACL,EAAE,CAAC;QACJ,KAAK,EAAE,MAAM,CAAC;KACf;CA0CF;AAED,eAAe,UAAU,CAAC"}
|
package/dist/ChartUtils.js
CHANGED
|
@@ -29,7 +29,7 @@ function isDateTimeColumnFormatter(value) {
|
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
function isRangedPlotlyAxis(value) {
|
|
32
|
-
return value != null && value.range &&
|
|
32
|
+
return value != null && value.range && (value.autorange === false || value.autorange === undefined);
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
class ChartUtils {
|
|
@@ -284,8 +284,8 @@ class ChartUtils {
|
|
|
284
284
|
var paddingLength = zeroDigits.replace(',', '').length;
|
|
285
285
|
var isCommaSeparated = placeholderDigits.indexOf(',') >= 0 || zeroDigits.indexOf(',') >= 0;
|
|
286
286
|
var comma = isCommaSeparated ? ',' : '';
|
|
287
|
-
var plotlyNumberType = numberType ? 'e' : 'f';
|
|
288
|
-
var type = percentSign
|
|
287
|
+
var plotlyNumberType = numberType != null && numberType !== '' ? 'e' : 'f';
|
|
288
|
+
var type = percentSign !== '' ? percentSign : plotlyNumberType;
|
|
289
289
|
var decimalLength = decimalDigits.length + optionalDecimalDigits.length; // IDS-4565 Plotly uses an older version of d3 which doesn't support the trim option or negative brackets
|
|
290
290
|
// If plotly updates it's d3 version, this should be re-enabled
|
|
291
291
|
// const trimOption = optionalDecimalDigits.length > 0 ? '~' : '';
|
|
@@ -409,9 +409,7 @@ class ChartUtils {
|
|
|
409
409
|
|
|
410
410
|
|
|
411
411
|
static getSeriesVisibility(name, settings) {
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
if (settings !== null && settings !== void 0 && (_settings$hiddenSerie = settings.hiddenSeries) !== null && _settings$hiddenSerie !== void 0 && _settings$hiddenSerie.includes(name)) {
|
|
412
|
+
if (settings != null && settings.hiddenSeries != null && settings.hiddenSeries.includes(name)) {
|
|
415
413
|
return 'legendonly';
|
|
416
414
|
}
|
|
417
415
|
|
|
@@ -490,7 +488,7 @@ class ChartUtils {
|
|
|
490
488
|
} = source;
|
|
491
489
|
var dataAttributeName = ChartUtils.getPlotlyProperty(plotStyle, sourceType);
|
|
492
490
|
set(seriesData, dataAttributeName, []);
|
|
493
|
-
var axisProperty = _axis ? ChartUtils.getAxisPropertyName(_axis.type) : null;
|
|
491
|
+
var axisProperty = _axis != null ? ChartUtils.getAxisPropertyName(_axis.type) : null;
|
|
494
492
|
|
|
495
493
|
if (axisProperty != null) {
|
|
496
494
|
var axes = axisTypeMap.get(_axis.type);
|
|
@@ -530,10 +528,13 @@ class ChartUtils {
|
|
|
530
528
|
// The default histfunc in plotly is 'count', but the data passed up from the API provides explicit x/y values and bins
|
|
531
529
|
// Since it's converted to bar, just set the widths of each bar
|
|
532
530
|
seriesData.width = [];
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
531
|
+
|
|
532
|
+
if (seriesData.marker.line !== undefined) {
|
|
533
|
+
Object.assign(seriesData.marker.line, {
|
|
534
|
+
color: theme.paper_bgcolor,
|
|
535
|
+
width: 1
|
|
536
|
+
});
|
|
537
|
+
}
|
|
537
538
|
} else if (plotStyle === dh.plot.SeriesPlotStyle.OHLC) {
|
|
538
539
|
seriesData.increasing = {
|
|
539
540
|
line: {
|
|
@@ -645,7 +646,7 @@ class ChartUtils {
|
|
|
645
646
|
businessCalendar
|
|
646
647
|
} = _axis2;
|
|
647
648
|
|
|
648
|
-
if (businessCalendar) {
|
|
649
|
+
if (businessCalendar != null) {
|
|
649
650
|
(function () {
|
|
650
651
|
var rangebreaks = [];
|
|
651
652
|
var {
|
|
@@ -868,7 +869,7 @@ class ChartUtils {
|
|
|
868
869
|
autorange
|
|
869
870
|
} = layoutAxis;
|
|
870
871
|
|
|
871
|
-
if (getRangeParser && _range &&
|
|
872
|
+
if (getRangeParser != null && _range !== undefined && (autorange === undefined || autorange === false)) {
|
|
872
873
|
var rangeParser = getRangeParser(_axis3);
|
|
873
874
|
var [rangeStart, rangeEnd] = rangeParser(_range);
|
|
874
875
|
log.debug('Setting downsample range', plotSize, rangeStart, rangeEnd);
|
|
@@ -1118,8 +1119,10 @@ class ChartUtils {
|
|
|
1118
1119
|
|
|
1119
1120
|
static groupArray(array, property) {
|
|
1120
1121
|
return array.reduce((result, item) => {
|
|
1122
|
+
var _result$get;
|
|
1123
|
+
|
|
1121
1124
|
var key = item[property];
|
|
1122
|
-
var group = result.get(key)
|
|
1125
|
+
var group = (_result$get = result.get(key)) !== null && _result$get !== void 0 ? _result$get : [];
|
|
1123
1126
|
group.push(item);
|
|
1124
1127
|
result.set(key, group);
|
|
1125
1128
|
return result;
|
package/dist/ChartUtils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChartUtils.js","names":["Log","TableUtils","dh","set","assertNotNull","ChartTheme","log","module","DAYS","Object","freeze","calendar","DayOfWeek","values","BUSINESS_COLUMN_TYPE","MILLIS_PER_HOUR","NANOS_PER_MILLI","isDateWrapper","value","asDate","undefined","isLongWrapper","asNumber","isDateTimeColumnFormatter","dhTimeZone","isRangedPlotlyAxis","range","autorange","ChartUtils","getPlotlyChartType","plotStyle","isBusinessTime","plot","SeriesPlotStyle","SCATTER","LINE","BAR","STACKED_BAR","PIE","TREEMAP","HISTOGRAM","OHLC","getPlotlyChartMode","getPlotlyProperty","sourceType","SourceType","X","Y","TIME","LABEL","PARENT","COLOR","Z","X_LOW","X_HIGH","Y_LOW","Y_HIGH","OPEN","HIGH","LOW","CLOSE","SHAPE","SIZE","HOVER_TEXT","TEXT","Error","getPlotlySeriesOrientation","series","sources","length","axis","type","AxisType","ORIENTATION","HORIZONTAL","VERTICAL","getPlotlyErrorBars","x","xLow","xHigh","array","map","i","arrayminus","symmetric","getPlotlyDateFormat","formatter","columnType","formatPattern","tickformat","replace","ticksuffix","dataFormatter","getColumnTypeFormatter","showTimeZone","i18n","DateTimeFormat","format","Date","automargin","convertNumberPrefix","prefix","getPlotlyNumberFormat","subpatterns","split","matchArray","match","placeholderDigits","zeroDigits","decimalDigits","optionalDecimalDigits","numberType","percentSign","suffix","paddingLength","isCommaSeparated","indexOf","comma","plotlyNumberType","decimalLength","trimOption","tickprefix","getPlotlyAxisFormat","source","axisFormat","isDateType","addTickSpacing","isNumberType","formatType","AxisFormatType","CATEGORY","gapBetweenMajorTicks","updatedFormat","tickSpacing","Math","tickmode","dtick","getSourceForAxis","chart","j","getSeriesVisibility","name","settings","hiddenSeries","includes","getHiddenLabels","makeSeriesData","mode","orientation","makeSeriesDataFromSeries","axisTypeMap","seriesVisibility","theme","lineColor","shapeColor","some","businessCalendar","getChartType","seriesData","addSourcesToSeriesData","addStylingToSeriesData","seriesDataParam","k","dataAttributeName","axisProperty","getAxisPropertyName","axes","get","axisIndex","axisIndexString","marker","line","width","AREA","fill","STACKED_AREA","stackgroup","STEP","shape","assign","color","paper_bgcolor","increasing","ohlc_increasing","decreasing","ohlc_decreasing","textinfo","outsidetextfont","title_color","hoverinfo","tiling","packing","pad","textposition","visible","getAxisFormats","figure","axisFormats","Map","nullFormat","charts","groupArray","axisSources","filter","axisType","typeAxes","axisLayoutProperty","getAxisLayoutProperty","has","debug","rangebreaks","businessPeriods","businessDays","holidays","timeZone","calendarTimeZone","typeFormatter","formatterTimeZone","timeZoneDiff","standardOffset","push","createRangeBreakValuesFromHolidays","forEach","period","pattern","bounds","periodToDecimal","close","open","createBoundsFromDays","weekendBounds","size","getAxisSide","axisPosition","AxisPosition","BOTTOM","TOP","LEFT","RIGHT","getChartForSeries","getLayoutRanges","layout","ranges","keys","key","updateLayoutAxes","layoutParam","plotWidth","plotHeight","getRangeParser","xAxisSize","max","MIN_AXIS_SIZE","min","AXIS_SIZE_PX","MAX_AXIS_SIZE","DEFAULT_AXIS_SIZE","yAxisSize","left","bottom","top","right","axisPositionMap","rightAxes","LEGEND_WIDTH_PX","MAX_LEGEND_SIZE","axisTypes","isYAxis","plotSize","makeLayoutAxis","layoutAxis","updateLayoutAxis","rangeParser","rangeStart","rangeEnd","layoutAxisParam","axisSize","label","title","text","side","position","overlaying","positionAxes","sideIndex","anchor","leftAxes","domain","bottomAxes","topAxes","Number","businessDaysInt","day","nonBusinessDaysInt","reopenDays","Set","closed","adjustedDay","add","boundsArray","closedDay","fullHolidays","partialHolidays","holiday","createPartialHoliday","createFullHoliday","adjustDateForTimeZone","date","toString","dateString","closedPeriods","rangeBreaks","startClose","endClose","dvalue","unwrapValue","wrapValue","property","reduce","result","item","group","DATE_FORMAT","substr","parse","tzFormat","estimatedOffset","estimatedDate","offset","gridcolor","linecolor","rangeslider","showline","ticklen","tickcolor","tickfont","zerolinecolor","font","showgrid","zerolinewidth","getColorwayFromTheme","colorway","Array","isArray","warn","makeDefaultLayout","autosize","family","yanchor","DEFAULT_TITLE_PADDING","y","legend","margin","DEFAULT_MARGIN","xaxis","yaxis","datarevision","hydrateSettings","titleFromSettings","xAxis","join","makeFigureSettings","table","settingsAxis","NUMBER","yAxis","chartType","ChartType","XY","dataSources","columnName","l","r","t","b"],"sources":["../src/ChartUtils.ts"],"sourcesContent":["import Log from '@deephaven/log';\nimport {\n DateTimeColumnFormatter,\n Formatter,\n TableColumnFormatter,\n TableUtils,\n} from '@deephaven/jsapi-utils';\nimport dh, {\n Axis,\n AxisPosition,\n AxisType,\n Chart,\n DateWrapper,\n Figure,\n Holiday,\n LongWrapper,\n Series,\n SeriesDataSource,\n SeriesPlotStyle,\n SourceType,\n TableTemplate,\n TimeZone,\n} from '@deephaven/jsapi-shim';\nimport set from 'lodash.set';\nimport {\n Layout,\n PlotData,\n PlotType,\n Axis as PlotlyAxis,\n ErrorBar,\n LayoutAxis,\n AxisType as PlotlyAxisType,\n OhclData,\n} from 'plotly.js';\nimport { assertNotNull, Range } from '@deephaven/utils';\nimport ChartTheme from './ChartTheme';\n\nexport interface ChartModelSettings {\n hiddenSeries?: string[];\n type: keyof SeriesPlotStyle;\n series: string[];\n xAxis: string;\n title?: string;\n}\n\nexport interface SeriesData {\n type: string | null;\n mode: string | null;\n name: string;\n orientation: string;\n xaxis?: number;\n marker?: unknown;\n xLow?: number;\n xHigh?: number;\n}\n\ntype LayoutAxisKey =\n | 'xaxis'\n | 'xaxis2'\n | 'xaxis3'\n | 'xaxis4'\n | 'xaxis5'\n | 'xaxis6'\n | 'xaxis7'\n | 'xaxis8'\n | 'xaxis9'\n | 'yaxis'\n | 'yaxis2'\n | 'yaxis3'\n | 'yaxis4'\n | 'yaxis5'\n | 'yaxis6'\n | 'yaxis7'\n | 'yaxis8'\n | 'yaxis9';\n\nexport interface TreeMapData extends PlotData {\n tiling: {\n packing: 'squarify';\n pad: 0;\n };\n}\n\ninterface Rangebreaks {\n bounds?: number[];\n dvalue?: number;\n enable?: boolean;\n name?: string;\n pattern?: 'day of week' | 'hour' | '';\n values?: string[];\n}\ninterface RangebreakAxisFormat extends PlotlyAxis {\n rangebreaks: Rangebreaks[];\n}\n\nexport type AxisTypeMap = Map<AxisType, Axis[]>;\ntype AxisPositionMap = Map<AxisPosition, Axis[]>;\n\nconst log = Log.module('ChartUtils');\n\nconst DAYS = Object.freeze(dh.calendar.DayOfWeek.values());\n\nconst BUSINESS_COLUMN_TYPE = 'io.deephaven.time.DateTime';\n\nconst MILLIS_PER_HOUR = 3600000;\n\nconst NANOS_PER_MILLI = 1000000;\n\nfunction isDateWrapper(value: unknown): value is DateWrapper {\n return (value as DateWrapper).asDate !== undefined;\n}\n\nfunction isLongWrapper(value: unknown): value is LongWrapper {\n return (value as LongWrapper).asNumber !== undefined;\n}\n\nfunction isDateTimeColumnFormatter(\n value: TableColumnFormatter\n): value is DateTimeColumnFormatter {\n return (value as DateTimeColumnFormatter).dhTimeZone !== undefined;\n}\n\nfunction isRangedPlotlyAxis(value: unknown): value is { range: Range[] } {\n return (\n value != null &&\n (value as PlotlyAxis).range &&\n !(value as PlotlyAxis).autorange\n );\n}\n\nclass ChartUtils {\n static DEFAULT_AXIS_SIZE = 0.15;\n\n static MIN_AXIS_SIZE = 0.025;\n\n static MAX_AXIS_SIZE = 0.2;\n\n static AXIS_SIZE_PX = 75;\n\n static LEGEND_WIDTH_PX = 50;\n\n static MAX_LEGEND_SIZE = 0.25;\n\n static ORIENTATION = Object.freeze({\n HORIZONTAL: 'h',\n VERTICAL: 'v',\n } as const);\n\n static DATE_FORMAT = 'yyyy-MM-dd HH:mm:ss.SSSSSS';\n\n static DEFAULT_MARGIN = Object.freeze({ l: 60, r: 50, t: 30, b: 60, pad: 0 });\n\n static DEFAULT_TITLE_PADDING = Object.freeze({ t: 8 });\n\n static SUBTITLE_LINE_HEIGHT = 25;\n\n /**\n * Converts the Iris plot style into a plotly chart type\n * @param plotStyle The plotStyle to use, see dh.plot.SeriesPlotStyle\n * @param isBusinessTime If the plot is using business time for an axis\n */\n static getPlotlyChartType(\n plotStyle: SeriesPlotStyle,\n isBusinessTime: boolean\n ): PlotType | undefined {\n switch (plotStyle) {\n case dh.plot.SeriesPlotStyle.SCATTER:\n // scattergl mode is more performant, but doesn't support the rangebreaks we need for businessTime calendars\n return !isBusinessTime ? 'scattergl' : 'scatter';\n case dh.plot.SeriesPlotStyle.LINE:\n // There is also still some artifacting bugs with scattergl: https://github.com/plotly/plotly.js/issues/3522\n // The artifacting only occurs on line plots, which we can draw with fairly decent performance using SVG paths\n // Once the above plotly issue is fixed, scattergl should be used here (when !isBusinessTime)\n return 'scatter';\n case dh.plot.SeriesPlotStyle.BAR:\n case dh.plot.SeriesPlotStyle.STACKED_BAR:\n return 'bar';\n\n case dh.plot.SeriesPlotStyle.PIE:\n return 'pie';\n\n case dh.plot.SeriesPlotStyle.TREEMAP:\n return 'treemap';\n\n case dh.plot.SeriesPlotStyle.HISTOGRAM:\n return 'histogram';\n\n case dh.plot.SeriesPlotStyle.OHLC:\n return 'ohlc';\n\n default:\n return undefined;\n }\n }\n\n /**\n * Converts the Iris plot style into a plotly chart mode\n * @param plotStyle The plotStyle to use, see dh.plot.SeriesPlotStyle.*\n */\n static getPlotlyChartMode(\n plotStyle: SeriesPlotStyle\n ): PlotData['mode'] | undefined {\n switch (plotStyle) {\n case dh.plot.SeriesPlotStyle.SCATTER:\n return 'markers';\n case dh.plot.SeriesPlotStyle.LINE:\n return 'lines';\n default:\n return undefined;\n }\n }\n\n /**\n * Get the property to set on the series data for plotly\n * @param plotStyle The plot style of the series\n * @param sourceType The source type for the series\n */\n static getPlotlyProperty(\n plotStyle: SeriesPlotStyle,\n sourceType: SourceType\n ): string {\n switch (plotStyle) {\n case dh.plot.SeriesPlotStyle.PIE:\n switch (sourceType) {\n case dh.plot.SourceType.X:\n return 'labels';\n case dh.plot.SourceType.Y:\n return 'values';\n default:\n break;\n }\n break;\n case dh.plot.SeriesPlotStyle.OHLC:\n switch (sourceType) {\n case dh.plot.SourceType.TIME:\n return 'x';\n default:\n break;\n }\n break;\n case dh.plot.SeriesPlotStyle.TREEMAP:\n switch (sourceType) {\n case dh.plot.SourceType.X:\n return 'ids';\n case dh.plot.SourceType.Y:\n return 'values';\n case dh.plot.SourceType.LABEL:\n return 'labels';\n case dh.plot.SourceType.PARENT:\n return 'parents';\n case dh.plot.SourceType.COLOR:\n return 'marker.colors';\n default:\n break;\n }\n break;\n default:\n break;\n }\n\n switch (sourceType) {\n case dh.plot.SourceType.X:\n return 'x';\n case dh.plot.SourceType.Y:\n return 'y';\n case dh.plot.SourceType.Z:\n return 'z';\n case dh.plot.SourceType.X_LOW:\n return 'xLow';\n case dh.plot.SourceType.X_HIGH:\n return 'xHigh';\n case dh.plot.SourceType.Y_LOW:\n return 'yLow';\n case dh.plot.SourceType.Y_HIGH:\n return 'yHigh';\n case dh.plot.SourceType.TIME:\n return 'time';\n case dh.plot.SourceType.OPEN:\n return 'open';\n case dh.plot.SourceType.HIGH:\n return 'high';\n case dh.plot.SourceType.LOW:\n return 'low';\n case dh.plot.SourceType.CLOSE:\n return 'close';\n case dh.plot.SourceType.SHAPE:\n return 'shape';\n case dh.plot.SourceType.SIZE:\n return 'size';\n case dh.plot.SourceType.LABEL:\n return 'label';\n case dh.plot.SourceType.COLOR:\n return 'color';\n case dh.plot.SourceType.PARENT:\n return 'parent';\n case dh.plot.SourceType.HOVER_TEXT:\n return 'hovertext';\n case dh.plot.SourceType.TEXT:\n return 'text';\n default:\n throw new Error(`Unrecognized source type: ${sourceType}`);\n }\n }\n\n static getPlotlySeriesOrientation(series: Series): 'h' | 'v' | undefined {\n const { sources } = series;\n if (sources.length === 2 && sources[0]?.axis?.type === dh.plot.AxisType.Y) {\n return ChartUtils.ORIENTATION.HORIZONTAL;\n }\n\n return ChartUtils.ORIENTATION.VERTICAL;\n }\n\n /**\n * Generate the plotly error bar data from the passed in data.\n * Iris passes in the values as absolute, plotly needs them as relative.\n * @param x The main data array\n * @param xLow The absolute low values\n * @param xHigh\n *\n * @returns The error_x object required by plotly, or null if none is required\n */\n static getPlotlyErrorBars(\n x: number[],\n xLow: number[],\n xHigh: number[]\n ): ErrorBar {\n const array = xHigh.map((value, i) => value - x[i]);\n const arrayminus = xLow.map((value, i) => x[i] - value);\n return {\n type: 'data',\n symmetric: false,\n array,\n arrayminus,\n };\n }\n\n static getPlotlyDateFormat(\n formatter: Formatter | null,\n columnType: string,\n formatPattern: string\n ): Partial<LayoutAxis> {\n const tickformat =\n formatPattern == null\n ? undefined\n : formatPattern\n .replace('%', '%%')\n .replace(/S{9}/g, '%9f')\n .replace(/S{8}/g, '%8f')\n .replace(/S{7}/g, '%7f')\n .replace(/S{6}/g, '%6f')\n .replace(/S{5}/g, '%5f')\n .replace(/S{4}/g, '%4f')\n .replace(/S{3}/g, '%3f')\n .replace(/S{2}/g, '%2f')\n .replace(/S{1}/g, '%1f')\n .replace(/y{4}/g, '%Y')\n .replace(/y{2}/g, '%y')\n .replace(/M{4}/g, '%B')\n .replace(/M{3}/g, '%b')\n .replace(/M{2}/g, '%m')\n .replace(/M{1}/g, '%-m')\n .replace(/E{4,}/g, '%A')\n .replace(/E{1,}/g, '%a')\n .replace(/d{2}/g, '%d')\n .replace(/([^%]|^)d{1}/g, '$1%-d')\n .replace(/H{2}/g, '%H')\n .replace(/h{2}/g, '%I')\n .replace(/h{1}/g, '%-I')\n .replace(/m{2}/g, '%M')\n .replace(/s{2}/g, '%S')\n .replace(\"'T'\", 'T')\n .replace(' z', ''); // timezone added as suffix if necessary\n\n let ticksuffix;\n const dataFormatter = formatter?.getColumnTypeFormatter(columnType);\n if (\n dataFormatter != null &&\n isDateTimeColumnFormatter(dataFormatter) &&\n dataFormatter.dhTimeZone != null &&\n dataFormatter.showTimeZone\n ) {\n ticksuffix = dh.i18n.DateTimeFormat.format(\n ' z',\n new Date(),\n dataFormatter.dhTimeZone\n );\n }\n\n return {\n tickformat,\n ticksuffix,\n automargin: true,\n };\n }\n\n static convertNumberPrefix(prefix: string): string {\n return prefix.replace(/\\u00A4\\u00A4/g, 'USD').replace(/\\u00A4/g, '$');\n }\n\n static getPlotlyNumberFormat(\n formatter: Formatter | null,\n columnType: string,\n formatPattern: string\n ): Partial<LayoutAxis> | null {\n if (!formatPattern) {\n return null;\n }\n\n // We translate java formatting: https://docs.oracle.com/javase/7/docs/api/java/text/DecimalFormat.html\n // Into d3 number formatting: https://github.com/d3/d3-format\n // We can't translate number formatting exactly, but should be able to translate the most common cases\n // First split it into the subpatterns; currently only handling the positive subpattern, ignoring the rest\n const subpatterns = formatPattern.split(';');\n\n const matchArray = subpatterns[0].match(\n /^([^#,0.]*)([#,]*)([0,]*)(\\.?)(0*)(#*)(E?0*)(%?)(.*)/\n );\n assertNotNull(matchArray);\n\n const [\n ,\n prefix,\n placeholderDigits,\n zeroDigits,\n ,\n decimalDigits,\n optionalDecimalDigits,\n numberType,\n percentSign,\n suffix,\n ] = matchArray;\n\n const paddingLength = zeroDigits.replace(',', '').length;\n const isCommaSeparated =\n placeholderDigits.indexOf(',') >= 0 || zeroDigits.indexOf(',') >= 0;\n const comma = isCommaSeparated ? ',' : '';\n const plotlyNumberType = numberType ? 'e' : 'f';\n const type = percentSign || plotlyNumberType;\n const decimalLength = decimalDigits.length + optionalDecimalDigits.length;\n // IDS-4565 Plotly uses an older version of d3 which doesn't support the trim option or negative brackets\n // If plotly updates it's d3 version, this should be re-enabled\n // const trimOption = optionalDecimalDigits.length > 0 ? '~' : '';\n const trimOption = '';\n\n const tickformat = `0${paddingLength}${comma}.${decimalLength}${trimOption}${type}`;\n const tickprefix = ChartUtils.convertNumberPrefix(prefix);\n // prefix and suffix are processed the same\n const ticksuffix = ChartUtils.convertNumberPrefix(suffix);\n\n return { tickformat, tickprefix, ticksuffix, automargin: true };\n }\n\n /**\n * Gets the plotly axis formatting information from the source passed in\n * @param source The Source to get the formatter information from\n * @param formatter The current formatter for formatting data\n */\n static getPlotlyAxisFormat(\n source: SeriesDataSource,\n formatter: Formatter | null = null\n ): Partial<PlotlyAxis> | null {\n const { axis, columnType } = source;\n const { formatPattern } = axis;\n\n let axisFormat = null;\n if (TableUtils.isDateType(columnType)) {\n axisFormat = ChartUtils.getPlotlyDateFormat(\n formatter,\n columnType,\n formatPattern\n );\n axisFormat = ChartUtils.addTickSpacing(axisFormat, axis, true);\n } else if (TableUtils.isNumberType(columnType)) {\n axisFormat = ChartUtils.getPlotlyNumberFormat(\n formatter,\n columnType,\n formatPattern\n );\n axisFormat = ChartUtils.addTickSpacing(axisFormat, axis, false);\n }\n\n if (axis.formatType === dh.plot.AxisFormatType.CATEGORY) {\n if (axisFormat) {\n axisFormat.type = 'category';\n } else {\n axisFormat = {\n type: 'category' as PlotlyAxisType,\n tickformat: undefined,\n ticksuffix: undefined,\n };\n }\n }\n\n return axisFormat;\n }\n\n /**\n * Adds tick spacing for an axis that has gapBetweenMajorTicks defined.\n *\n * @param axisFormat the current axis format, may be null\n * @param axis the current axis\n * @param isDateType indicates if the columns is a date type\n */\n static addTickSpacing(\n axisFormat: Partial<LayoutAxis> | null,\n axis: Axis,\n isDateType: boolean\n ): Partial<PlotlyAxis> | null {\n const { gapBetweenMajorTicks } = axis;\n if (gapBetweenMajorTicks > 0) {\n const updatedFormat: Partial<PlotlyAxis> = axisFormat || {};\n let tickSpacing = gapBetweenMajorTicks;\n if (isDateType) {\n // Need to convert from nanoseconds to milliseconds\n tickSpacing = gapBetweenMajorTicks / NANOS_PER_MILLI;\n }\n if (axis.log) {\n tickSpacing = Math.log(tickSpacing);\n }\n // Note that tickmode defaults to 'auto'\n updatedFormat.tickmode = 'linear';\n updatedFormat.dtick = tickSpacing;\n return updatedFormat;\n }\n\n return axisFormat;\n }\n\n /**\n * Retrieve the data source for a given axis in a chart\n * @param chart The chart to get the source for\n * @param axis The axis to find the source for\n * @returns The first source matching this axis\n */\n static getSourceForAxis(chart: Chart, axis: Axis): SeriesDataSource | null {\n for (let i = 0; i < chart.series.length; i += 1) {\n const series = chart.series[i];\n for (let j = 0; j < series.sources.length; j += 1) {\n const source = series.sources[j];\n if (source.axis === axis) {\n return source;\n }\n }\n }\n\n return null;\n }\n\n /**\n * Get visibility setting for the series object\n * @param name The series name to get the visibility for\n * @param settings Chart settings\n * @returns True for visible series and 'legendonly' for hidden\n */\n static getSeriesVisibility(\n name: string,\n settings?: Partial<ChartModelSettings>\n ): boolean | 'legendonly' {\n if (settings?.hiddenSeries?.includes(name)) {\n return 'legendonly';\n }\n return true;\n }\n\n /**\n * Get hidden labels array from chart settings\n * @param settings Chart settings\n * @returns Array of hidden series names\n */\n static getHiddenLabels(settings: Partial<ChartModelSettings>): string[] {\n if (settings?.hiddenSeries) {\n return [...settings.hiddenSeries];\n }\n return [];\n }\n\n /**\n * Create a default series data object. Apply styling to the object afterward.\n * @returns A simple series data object with no styling\n */\n static makeSeriesData(\n type: PlotType | undefined,\n mode: PlotData['mode'] | undefined,\n name: string,\n orientation: 'h' | 'v' = ChartUtils.ORIENTATION.VERTICAL\n ): Partial<PlotData> {\n return { type, mode, name, orientation };\n }\n\n /**\n * Create a data series (trace) for use with plotly\n * @param series The series to create the series data with\n * @param axisTypeMap The map of axes grouped by type\n * @param seriesVisibility Visibility setting for the series\n * @param theme The theme properties for the plot. See ChartTheme.js for an example\n * @returns The series data (trace) object for use with plotly.\n */\n static makeSeriesDataFromSeries(\n series: Series,\n axisTypeMap: AxisTypeMap,\n seriesVisibility: boolean | 'legendonly',\n theme = ChartTheme\n ): Partial<PlotData> {\n const { name, plotStyle, lineColor, shapeColor, sources } = series;\n\n const isBusinessTime = sources.some(\n source => source.axis?.businessCalendar\n );\n const type = ChartUtils.getChartType(plotStyle, isBusinessTime);\n const mode = ChartUtils.getPlotlyChartMode(plotStyle);\n const orientation = ChartUtils.getPlotlySeriesOrientation(series);\n\n const seriesData = ChartUtils.makeSeriesData(type, mode, name, orientation);\n\n ChartUtils.addSourcesToSeriesData(\n seriesData,\n plotStyle,\n sources,\n axisTypeMap\n );\n\n ChartUtils.addStylingToSeriesData(\n seriesData,\n plotStyle,\n theme,\n lineColor,\n shapeColor,\n seriesVisibility\n );\n\n return seriesData;\n }\n\n static addSourcesToSeriesData(\n seriesDataParam: Partial<PlotData>,\n plotStyle: SeriesPlotStyle,\n sources: SeriesDataSource[],\n axisTypeMap: AxisTypeMap\n ): void {\n const seriesData = seriesDataParam;\n for (let k = 0; k < sources.length; k += 1) {\n const source = sources[k];\n const { axis, type: sourceType } = source;\n\n const dataAttributeName = ChartUtils.getPlotlyProperty(\n plotStyle,\n sourceType\n );\n set(seriesData, dataAttributeName, []);\n\n const axisProperty = axis\n ? ChartUtils.getAxisPropertyName(axis.type)\n : null;\n if (axisProperty != null) {\n const axes = axisTypeMap.get(axis.type);\n if (axes) {\n const axisIndex = axes.indexOf(axis);\n const axisIndexString = axisIndex > 0 ? `${axisIndex + 1}` : '';\n seriesData[\n `${axisProperty}axis`\n ] = `${axisProperty}${axisIndexString}`;\n }\n }\n }\n }\n\n static addStylingToSeriesData(\n seriesDataParam: Partial<PlotData>,\n plotStyle: SeriesPlotStyle,\n theme: typeof ChartTheme = ChartTheme,\n lineColor: string | null = null,\n shapeColor: string | null = null,\n seriesVisibility: 'legendonly' | boolean | null = null\n ): void {\n const seriesData = seriesDataParam;\n // Add some empty objects so we can fill them in later with details without checking for existence\n seriesData.marker = { line: {} }; // border line width on markers\n seriesData.line = {\n width: 1, // default line width for lines, should eventually be able to override\n };\n\n if (plotStyle === dh.plot.SeriesPlotStyle.AREA) {\n seriesData.fill = 'tozeroy';\n } else if (plotStyle === dh.plot.SeriesPlotStyle.STACKED_AREA) {\n seriesData.stackgroup = 'stack';\n } else if (plotStyle === dh.plot.SeriesPlotStyle.STEP) {\n seriesData.line.shape = 'hv'; // plot.ly horizontal then vertical step styling\n } else if (plotStyle === dh.plot.SeriesPlotStyle.HISTOGRAM) {\n // The default histfunc in plotly is 'count', but the data passed up from the API provides explicit x/y values and bins\n // Since it's converted to bar, just set the widths of each bar\n seriesData.width = [];\n Object.assign(seriesData.marker.line, {\n color: theme.paper_bgcolor,\n width: 1,\n });\n } else if (plotStyle === dh.plot.SeriesPlotStyle.OHLC) {\n (seriesData as Partial<OhclData>).increasing = {\n line: { color: theme.ohlc_increasing },\n };\n (seriesData as Partial<OhclData>).decreasing = {\n line: { color: theme.ohlc_decreasing },\n };\n } else if (plotStyle === dh.plot.SeriesPlotStyle.PIE) {\n seriesData.textinfo = 'label+percent';\n\n // TODO Open DefinitelyTyped/Plotly PR to mark family and size as optional\n // https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/plotly.js/lib/traces/pie.d.ts#L6\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (seriesData as any).outsidetextfont = {\n color: theme.title_color,\n };\n } else if (plotStyle === dh.plot.SeriesPlotStyle.TREEMAP) {\n seriesData.hoverinfo = 'text';\n seriesData.textinfo = 'label+text';\n (seriesData as TreeMapData).tiling = {\n packing: 'squarify',\n pad: 0,\n };\n seriesData.textposition = 'middle center';\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (seriesData as any).outsidetextfont = { color: theme.title_color };\n }\n\n if (lineColor != null) {\n if (plotStyle === dh.plot.SeriesPlotStyle.BAR) {\n seriesData.marker.color = lineColor;\n } else {\n seriesData.line.color = lineColor;\n }\n }\n\n if (shapeColor != null) {\n seriesData.marker.color = shapeColor;\n }\n\n // Skipping pie charts\n // Pie slice visibility is configured in chart layout instead of series data\n if (seriesVisibility != null && plotStyle !== dh.plot.SeriesPlotStyle.PIE) {\n seriesData.visible = seriesVisibility;\n }\n }\n\n /**\n * Retrieve the axis formats from the provided figure.\n * Currently defaults to just the x/y axes.\n * @param figure The figure to get the axis formats for\n * @param formatter The formatter to use when getting the axis format\n * @returns A map of axis layout property names to axis formats\n */\n static getAxisFormats(\n figure: Figure,\n formatter: Formatter\n ): Map<LayoutAxisKey, Partial<PlotlyAxis>> {\n const axisFormats = new Map();\n const nullFormat = { tickformat: null, ticksuffix: null };\n\n const { charts } = figure;\n\n for (let i = 0; i < charts.length; i += 1) {\n const chart = charts[i];\n const axisTypeMap = ChartUtils.groupArray(chart.axes, 'type');\n\n for (let j = 0; j < chart.series.length; j += 1) {\n const series = chart.series[j];\n const { sources } = series;\n const axisSources = sources.filter(source => source.axis);\n for (let k = 0; k < axisSources.length; k += 1) {\n const source = axisSources[k];\n const { axis } = source;\n const { type: axisType } = axis;\n const typeAxes = axisTypeMap.get(axisType);\n assertNotNull(typeAxes);\n const axisIndex = typeAxes.indexOf(axis);\n const axisProperty = ChartUtils.getAxisPropertyName(axisType);\n if (axisProperty != null) {\n const axisLayoutProperty = ChartUtils.getAxisLayoutProperty(\n axisProperty,\n axisIndex\n );\n\n if (axisFormats.has(axisLayoutProperty)) {\n log.debug(`${axisLayoutProperty} already added.`);\n } else {\n log.debug(`Adding ${axisLayoutProperty} to axisFormats.`);\n const axisFormat = ChartUtils.getPlotlyAxisFormat(\n source,\n formatter\n );\n if (axisFormat === null) {\n axisFormats.set(axisLayoutProperty, nullFormat);\n } else {\n axisFormats.set(axisLayoutProperty, axisFormat);\n\n const { businessCalendar } = axis;\n if (businessCalendar) {\n const rangebreaks: Rangebreaks[] = [];\n const {\n businessPeriods,\n businessDays,\n holidays,\n timeZone: calendarTimeZone,\n } = businessCalendar;\n const typeFormatter = formatter?.getColumnTypeFormatter(\n BUSINESS_COLUMN_TYPE\n );\n let formatterTimeZone;\n if (isDateTimeColumnFormatter(typeFormatter)) {\n formatterTimeZone = typeFormatter.dhTimeZone;\n }\n const timeZoneDiff = formatterTimeZone\n ? (calendarTimeZone.standardOffset -\n formatterTimeZone.standardOffset) /\n 60\n : 0;\n if (holidays.length > 0) {\n rangebreaks.push(\n ...ChartUtils.createRangeBreakValuesFromHolidays(\n holidays,\n calendarTimeZone,\n formatterTimeZone\n )\n );\n }\n businessPeriods.forEach(period =>\n rangebreaks.push({\n pattern: 'hour',\n bounds: [\n ChartUtils.periodToDecimal(period.close) + timeZoneDiff,\n ChartUtils.periodToDecimal(period.open) + timeZoneDiff,\n ],\n })\n );\n // If there are seven business days, then there is no weekend\n if (businessDays.length < DAYS.length) {\n ChartUtils.createBoundsFromDays(businessDays).forEach(\n weekendBounds =>\n rangebreaks.push({\n pattern: 'day of week',\n bounds: weekendBounds,\n })\n );\n }\n\n (axisFormat as RangebreakAxisFormat).rangebreaks = rangebreaks;\n }\n\n if (axisFormats.size === chart.axes.length) {\n return axisFormats;\n }\n }\n }\n }\n }\n }\n }\n\n return axisFormats;\n }\n\n static getChartType(\n plotStyle: SeriesPlotStyle,\n isBusinessTime: boolean\n ): PlotType | undefined {\n switch (plotStyle) {\n case dh.plot.SeriesPlotStyle.HISTOGRAM:\n // When reading data from the `Figure`, it already provides bins and values, so rather than using\n // plot.ly to calculate the bins and sum values, just convert it to a bar chart\n return 'bar';\n default:\n return ChartUtils.getPlotlyChartType(plotStyle, isBusinessTime);\n }\n }\n\n /**\n * Return the plotly axis property name\n * @param axisType The axis type to get the property name for\n */\n static getAxisPropertyName(axisType: AxisType): 'x' | 'y' | null {\n switch (axisType) {\n case dh.plot.AxisType.X:\n return 'x';\n case dh.plot.AxisType.Y:\n return 'y';\n default:\n return null;\n }\n }\n\n /**\n * Returns the plotly \"side\" value for the provided axis position\n * @param axisPosition The Iris AxisPosition of the axis\n */\n static getAxisSide(\n axisPosition: AxisPosition\n ): LayoutAxis['side'] | undefined {\n switch (axisPosition) {\n case dh.plot.AxisPosition.BOTTOM:\n return 'bottom';\n case dh.plot.AxisPosition.TOP:\n return 'top';\n case dh.plot.AxisPosition.LEFT:\n return 'left';\n case dh.plot.AxisPosition.RIGHT:\n return 'right';\n default:\n return undefined;\n }\n }\n\n /**\n * Retrieve the chart that contains the passed in series from the figure\n * @param figure The figure to retrieve the chart from\n * @param series The series to get the chart for\n */\n static getChartForSeries(figure: Figure, series: Series): Chart | null {\n const { charts } = figure;\n\n for (let i = 0; i < charts.length; i += 1) {\n const chart = charts[i];\n for (let j = 0; j < chart.series.length; j += 1) {\n if (series === chart.series[j]) {\n return chart;\n }\n }\n }\n\n return null;\n }\n\n /**\n * Get an object mapping axis to their ranges\n * @param layout The plotly layout object to get the ranges from\n * @returns An object mapping the axis name to it's range\n */\n static getLayoutRanges(layout: Layout): Record<string, Range[]> {\n const ranges: Record<string, Range[]> = {};\n const keys: (keyof Layout)[] = Object.keys(layout).filter(\n key => key.indexOf('axis') >= 0\n ) as LayoutAxisKey[];\n for (let i = 0; i < keys.length; i += 1) {\n const key = keys[i];\n const value = layout[key];\n if (isRangedPlotlyAxis(value)) {\n // Only want to add the range if it's not autoranged\n ranges[key] = [...(value as PlotlyAxis).range];\n }\n }\n\n return ranges;\n }\n\n /**\n * Updates the axes positions and sizes in the layout object provided.\n * If the axis did not exist in the layout previously, it is created and added.\n * Any axis that no longer exists in axes is removed.\n * With Downsampling enabled, will also update the range on the axis itself as appropriate\n * @param layoutParam The layout object to update\n * @param axes The axes to update the layout with\n * @param plotWidth The width of the plot to calculate the axis sizes for\n * @param plotHeight The height of the plot to calculate the axis sizes for\n * @param getRangeParser A function to retrieve the range parser for a given axis\n */\n static updateLayoutAxes(\n layoutParam: Partial<Layout>,\n axes: Axis[],\n plotWidth = 0,\n plotHeight = 0,\n getRangeParser: ((axis: Axis) => (range: Range) => unknown[]) | null = null,\n theme = ChartTheme\n ): void {\n const xAxisSize =\n plotWidth > 0\n ? Math.max(\n ChartUtils.MIN_AXIS_SIZE,\n Math.min(\n ChartUtils.AXIS_SIZE_PX / plotHeight,\n ChartUtils.MAX_AXIS_SIZE\n )\n )\n : ChartUtils.DEFAULT_AXIS_SIZE;\n const yAxisSize =\n plotHeight > 0\n ? Math.max(\n ChartUtils.MIN_AXIS_SIZE,\n Math.min(\n ChartUtils.AXIS_SIZE_PX / plotWidth,\n ChartUtils.MAX_AXIS_SIZE\n )\n )\n : ChartUtils.DEFAULT_AXIS_SIZE;\n\n // Adjust the bounds based on where the legend is\n // For now, always assume the legend is shown on the right\n const bounds = {\n left: 0,\n bottom: 0,\n top: 1,\n right: 1,\n };\n const axisPositionMap = ChartUtils.groupArray(axes, 'position');\n const rightAxes = axisPositionMap.get(dh.plot.AxisPosition.RIGHT) || [];\n if (rightAxes.length > 0) {\n if (plotWidth > 0) {\n bounds.right =\n 1 -\n Math.max(\n 0,\n Math.min(\n ChartUtils.LEGEND_WIDTH_PX / plotWidth,\n ChartUtils.MAX_LEGEND_SIZE\n )\n );\n } else {\n bounds.right = 1 - ChartUtils.DEFAULT_AXIS_SIZE;\n }\n }\n\n const layout = layoutParam;\n const axisTypeMap = ChartUtils.groupArray(axes, 'type');\n const axisTypes = [...axisTypeMap.keys()];\n for (let j = 0; j < axisTypes.length; j += 1) {\n const axisType = axisTypes[j];\n const axisProperty = ChartUtils.getAxisPropertyName(axisType);\n if (axisProperty != null) {\n const typeAxes = axisTypeMap.get(axisType);\n const isYAxis = axisType === dh.plot.AxisType.Y;\n const plotSize = isYAxis ? plotHeight : plotWidth;\n\n assertNotNull(typeAxes);\n let axisIndex = 0;\n\n for (axisIndex = 0; axisIndex < typeAxes.length; axisIndex += 1) {\n const axis = typeAxes[axisIndex];\n const axisLayoutProperty = ChartUtils.getAxisLayoutProperty(\n axisProperty,\n axisIndex\n );\n if (layout[axisLayoutProperty] == null) {\n layout[axisLayoutProperty] = ChartUtils.makeLayoutAxis(\n axisType,\n theme\n );\n }\n\n const layoutAxis = layout[axisLayoutProperty];\n if (layoutAxis != null) {\n ChartUtils.updateLayoutAxis(\n layoutAxis,\n axis,\n axisIndex,\n axisPositionMap,\n xAxisSize,\n yAxisSize,\n bounds\n );\n\n const { range, autorange } = layoutAxis;\n if (getRangeParser && range && !autorange) {\n const rangeParser = getRangeParser(axis);\n const [rangeStart, rangeEnd] = rangeParser(range as Range);\n\n log.debug(\n 'Setting downsample range',\n plotSize,\n rangeStart,\n rangeEnd\n );\n\n axis.range(plotSize, rangeStart, rangeEnd);\n } else {\n axis.range(plotSize);\n }\n }\n }\n\n let axisLayoutProperty = ChartUtils.getAxisLayoutProperty(\n axisProperty,\n axisIndex\n );\n while (layout[axisLayoutProperty] != null) {\n delete layout[axisLayoutProperty];\n\n axisIndex += 1;\n axisLayoutProperty = ChartUtils.getAxisLayoutProperty(\n axisProperty,\n axisIndex\n );\n }\n }\n }\n }\n\n static getAxisLayoutProperty(\n axisProperty: 'x' | 'y',\n axisIndex: number\n ): LayoutAxisKey {\n const axisIndexString = axisIndex > 0 ? `${axisIndex + 1}` : '';\n return `${axisProperty ?? ''}axis${axisIndexString}` as LayoutAxisKey;\n }\n\n /**\n * Updates the layout axis object in place\n * @param layoutAxisParam The plotly layout axis param\n * @param axis The Iris Axis to update the plotly layout with\n * @param axisIndex The type index for this axis\n * @param axisPositionMap All the axes mapped by position\n * @param axisSize The size of each axis in percent\n * @param bounds The bounds of the axes domains\n */\n static updateLayoutAxis(\n layoutAxisParam: Partial<LayoutAxis>,\n axis: Axis,\n axisIndex: number,\n axisPositionMap: AxisPositionMap,\n xAxisSize: number,\n yAxisSize: number,\n bounds: {\n left: number;\n bottom: number;\n top: number;\n right: number;\n }\n ): void {\n const isYAxis = axis.type === dh.plot.AxisType.Y;\n const axisSize = isYAxis ? yAxisSize : xAxisSize;\n const layoutAxis = layoutAxisParam;\n // Enterprise API returns null for empty axis labels\n // Passing null title text to Plotly results in incorrect axis position, DH-9164\n const label = axis.label ?? '';\n if (\n layoutAxis.title !== undefined &&\n typeof layoutAxis.title !== 'string'\n ) {\n layoutAxis.title.text = label;\n } else {\n layoutAxis.title = { text: label };\n }\n\n if (axis.log) {\n layoutAxis.type = 'log';\n }\n\n layoutAxis.side = ChartUtils.getAxisSide(axis.position);\n\n if (axisIndex > 0) {\n layoutAxis.overlaying =\n ChartUtils.getAxisPropertyName(axis.type) ?? undefined;\n\n const positionAxes = axisPositionMap.get(axis.position) ?? [];\n const sideIndex = positionAxes.indexOf(axis);\n if (sideIndex > 0) {\n layoutAxis.anchor = 'free';\n\n if (axis.position === dh.plot.AxisPosition.RIGHT) {\n layoutAxis.position =\n bounds.right + (sideIndex - positionAxes.length + 1) * axisSize;\n } else if (axis.position === dh.plot.AxisPosition.TOP) {\n layoutAxis.position =\n bounds.top + (sideIndex - positionAxes.length + 1) * axisSize;\n } else if (axis.position === dh.plot.AxisPosition.BOTTOM) {\n layoutAxis.position =\n bounds.bottom + (positionAxes.length - sideIndex + 1) * axisSize;\n } else if (axis.position === dh.plot.AxisPosition.LEFT) {\n layoutAxis.position =\n bounds.left + (positionAxes.length - sideIndex + 1) * axisSize;\n }\n }\n } else if (axis.type === dh.plot.AxisType.X) {\n const leftAxes = axisPositionMap.get(dh.plot.AxisPosition.LEFT) || [];\n const rightAxes = axisPositionMap.get(dh.plot.AxisPosition.RIGHT) || [];\n const left = Math.max(\n bounds.left,\n bounds.left + (leftAxes.length - 1) * yAxisSize\n );\n const right = Math.min(\n bounds.right - (rightAxes.length - 1) * yAxisSize,\n bounds.right\n );\n layoutAxis.domain = [left, right];\n } else if (axis.type === dh.plot.AxisType.Y) {\n const bottomAxes = axisPositionMap.get(dh.plot.AxisPosition.BOTTOM) || [];\n const topAxes = axisPositionMap.get(dh.plot.AxisPosition.TOP) || [];\n const bottom = Math.max(\n bounds.bottom,\n bounds.bottom + (bottomAxes.length - 1) * xAxisSize\n );\n const top = Math.min(\n bounds.top - (topAxes.length - 1) * xAxisSize,\n bounds.top\n );\n layoutAxis.domain = [bottom, top];\n }\n }\n\n /**\n * Converts an open or close period to a declimal. e.g '09:30\" to 9.5\n *\n * @param period the open or close value of the period\n */\n static periodToDecimal(period: string): number {\n const values = period.split(':');\n return Number(values[0]) + Number(values[1]) / 60;\n }\n\n /**\n * Creates range break bounds for plotly from business days.\n * For example a standard business week of ['MONDAY','TUESDAY','WEDNESDAY','THURSDAY','FRIDAY']\n * will result in [[6,1]] meaning close on Saturday and open on Monday.\n * If you remove Wednesday from the array, then you get two closures [[6, 1], [3, 4]]\n *\n * @param businessDays the days to display on the x-axis\n */\n static createBoundsFromDays(businessDays: string[]): Range[] {\n const businessDaysInt = businessDays.map(day => DAYS.indexOf(day));\n const nonBusinessDaysInt = DAYS.filter(\n day => !businessDays.includes(day)\n ).map(day => DAYS.indexOf(day));\n // These are the days when business reopens (e.g. Monday after a weekend)\n const reopenDays = new Set<number>();\n nonBusinessDaysInt.forEach(closed => {\n for (let i = closed + 1; i < closed + DAYS.length; i += 1) {\n const adjustedDay = i % DAYS.length;\n if (businessDaysInt.includes(adjustedDay)) {\n reopenDays.add(adjustedDay);\n break;\n }\n }\n });\n const boundsArray: Range[] = [];\n // For each reopen day, find the furthest previous closed day\n reopenDays.forEach(open => {\n for (let i = open - 1; i > open - DAYS.length; i -= 1) {\n const adjustedDay = i < 0 ? i + DAYS.length : i;\n if (businessDaysInt.includes(adjustedDay)) {\n const closedDay = (adjustedDay + 1) % 7;\n boundsArray.push([closedDay, open]);\n break;\n }\n }\n });\n return boundsArray;\n }\n\n /**\n * Creates an array of range breaks for all holidays.\n *\n * @param holidays an array of holidays\n * @param calendarTimeZone the time zone for the business calendar\n * @param formatterTimeZone the time zone for the formatter\n */\n static createRangeBreakValuesFromHolidays(\n holidays: Holiday[],\n calendarTimeZone: TimeZone,\n formatterTimeZone?: TimeZone\n ): Rangebreaks[] {\n const fullHolidays: string[] = [];\n const partialHolidays: {\n values: string[];\n dvalue: number;\n }[] = [];\n holidays.forEach(holiday => {\n if (holiday.businessPeriods.length > 0) {\n partialHolidays.push(\n ...ChartUtils.createPartialHoliday(\n holiday,\n calendarTimeZone,\n formatterTimeZone\n )\n );\n } else {\n fullHolidays.push(\n ChartUtils.createFullHoliday(\n holiday,\n calendarTimeZone,\n formatterTimeZone\n )\n );\n }\n });\n return [{ values: fullHolidays }, ...partialHolidays];\n }\n\n /**\n * Creates the range break value for a full holiday. A full holiday is day that has no business periods.\n *\n * @param holiday the full holiday\n * @param calendarTimeZone the time zone for the business calendar\n * @param formatterTimeZone the time zone for the formatter\n */\n static createFullHoliday(\n holiday: Holiday,\n calendarTimeZone: TimeZone,\n formatterTimeZone?: TimeZone\n ): string {\n return ChartUtils.adjustDateForTimeZone(\n `${holiday.date.toString()} 00:00:00.000000`,\n calendarTimeZone,\n formatterTimeZone\n );\n }\n\n /**\n * Creates the range break for a partial holiday. A partial holiday is holiday with business periods\n * that are different than the default business periods.\n *\n * @param holiday the partial holiday\n * @param calendarTimeZone the time zone for the business calendar\n * @param formatterTimeZone the time zone for the formatter\n */\n static createPartialHoliday(\n holiday: Holiday,\n calendarTimeZone: TimeZone,\n formatterTimeZone?: TimeZone\n ): {\n values: string[];\n dvalue: number;\n }[] {\n // If a holiday has business periods {open1, close1} and {open2, close2}\n // This will generate range breaks for:\n // closed from 00:00 to open1\n // closed from close1 to open2\n // closed from close2 to 23:59:59.999999\n const dateString = holiday.date.toString();\n const closedPeriods = ['00:00'];\n holiday.businessPeriods.forEach(period => {\n closedPeriods.push(period.open);\n closedPeriods.push(period.close);\n });\n // To go up to 23:59:59.999999, we calculate the dvalue using 24 - close\n closedPeriods.push('24:00');\n\n const rangeBreaks = [];\n for (let i = 0; i < closedPeriods.length; i += 2) {\n const startClose = closedPeriods[i];\n const endClose = closedPeriods[i + 1];\n // Skip over any periods where start and close are the same (zero hours)\n if (startClose !== endClose) {\n const values = [\n ChartUtils.adjustDateForTimeZone(\n `${dateString} ${startClose}:00.000000`,\n calendarTimeZone,\n formatterTimeZone\n ),\n ];\n const dvalue =\n MILLIS_PER_HOUR *\n (ChartUtils.periodToDecimal(endClose) -\n ChartUtils.periodToDecimal(startClose));\n rangeBreaks.push({ values, dvalue });\n }\n }\n return rangeBreaks;\n }\n\n /**\n * Adjusts a date string from the calendar time zone to the formatter time zone.\n *\n * @param dateString the date string\n * @param calendarTimeZone the time zone for the business calendar\n * @param formatterTimeZone the time zone for the formatter\n */\n static adjustDateForTimeZone(\n dateString: string,\n calendarTimeZone: TimeZone,\n formatterTimeZone?: TimeZone\n ): string {\n if (\n formatterTimeZone &&\n formatterTimeZone.standardOffset !== calendarTimeZone.standardOffset\n ) {\n return ChartUtils.unwrapValue(\n ChartUtils.wrapValue(\n dateString,\n BUSINESS_COLUMN_TYPE,\n calendarTimeZone\n ),\n formatterTimeZone\n ) as string;\n }\n return dateString;\n }\n\n /**\n * Groups an array and returns a map\n * @param array The object to group\n * @param property The property name to group by\n * @returns A map containing the items grouped by their values for the property\n */\n static groupArray<T, P extends keyof T>(\n array: T[],\n property: P\n ): Map<T[P], T[]> {\n return array.reduce((result, item) => {\n const key = item[property];\n const group: T[] = result.get(key) || [];\n group.push(item);\n result.set(key, group);\n return result;\n }, new Map());\n }\n\n /**\n * Unwraps a value provided from API to a value plotly can understand\n * Eg. Unwraps DateWrapper, LongWrapper objects.\n */\n static unwrapValue(value: unknown, timeZone?: TimeZone): unknown {\n if (value != null) {\n if (isDateWrapper(value)) {\n return dh.i18n.DateTimeFormat.format(\n ChartUtils.DATE_FORMAT,\n value,\n timeZone\n );\n }\n\n if (isLongWrapper(value)) {\n return value.asNumber();\n }\n }\n\n return value;\n }\n\n /**\n *\n * @param value The value to wrap up\n * @param columnType The type of column this value is from\n * @param timeZone The time zone if applicable\n */\n static wrapValue(\n value: unknown,\n columnType: string,\n timeZone: TimeZone | null = null\n ): unknown {\n if (TableUtils.isDateType(columnType) && typeof value === 'string') {\n // Need to limit the format to the actual length of the string range set in plotly\n // Otherwise parse will fail\n const text = value;\n const format = ChartUtils.DATE_FORMAT.substr(0, value.length);\n const date = dh.i18n.DateTimeFormat.parse(format, text);\n if (!timeZone) {\n return date;\n }\n\n // IDS-5994 Due to date parsing, time zone, and daylight savings shenanigans, we need\n // to pass the actual offset with the time to have it parse correctly.\n // However, the offset can change based on the date because of Daylight Savings\n // So we end up parsing the date multiple times. And curse daylight savings.\n const tzFormat = `${format} Z`;\n const estimatedOffset = dh.i18n.DateTimeFormat.format(\n 'Z',\n date,\n timeZone\n );\n const estimatedDate = dh.i18n.DateTimeFormat.parse(\n tzFormat,\n `${text} ${estimatedOffset}`\n );\n const offset = dh.i18n.DateTimeFormat.format(\n 'Z',\n estimatedDate,\n timeZone\n );\n return dh.i18n.DateTimeFormat.parse(tzFormat, `${text} ${offset}`);\n }\n\n return value;\n }\n\n static makeLayoutAxis(\n type: AxisType,\n theme = ChartTheme\n ): Partial<LayoutAxis> {\n const axis = {\n automargin: true,\n gridcolor: theme.gridcolor,\n linecolor: theme.linecolor,\n rangeslider: { visible: false },\n showline: true,\n ticklen: 5, // act as padding, can't find a tick padding\n tickcolor: theme.paper_bgcolor, // hide ticks as padding\n tickfont: {\n color: theme.zerolinecolor,\n },\n title: {\n font: {\n color: theme.title_color,\n },\n },\n };\n\n if (type === dh.plot.AxisType.X) {\n Object.assign(axis, {\n showgrid: true,\n });\n } else if (type === dh.plot.AxisType.Y) {\n Object.assign(axis, {\n zerolinecolor: theme.zerolinecolor,\n zerolinewidth: 2,\n });\n }\n\n return axis;\n }\n\n /**\n * Parses the colorway property of a theme and returns an array of colors\n * Theme could have a single string with space separated colors or an array of strings representing the colorway\n * @param theme The theme to get colorway from\n * @returns Colorway array for the theme\n */\n static getColorwayFromTheme(theme = ChartTheme): string[] {\n let colorway: string[] = [];\n if (theme.colorway) {\n if (Array.isArray(theme.colorway)) {\n colorway = theme.colorway;\n } else if (typeof theme.colorway === 'string') {\n colorway = theme.colorway.split(' ');\n } else {\n log.warn(`Unable to handle colorway property: ${theme.colorway}`);\n }\n }\n\n return colorway;\n }\n\n static makeDefaultLayout(theme = ChartTheme): Partial<Layout> {\n const layout: Partial<Layout> = {\n ...theme,\n autosize: true,\n colorway: ChartUtils.getColorwayFromTheme(theme),\n font: {\n family: \"'Fira Sans', sans-serif\",\n },\n title: {\n font: {\n color: theme.title_color,\n },\n yanchor: 'top',\n pad: { ...ChartUtils.DEFAULT_TITLE_PADDING },\n y: 1,\n },\n legend: {\n font: {\n color: theme.title_color,\n },\n },\n margin: { ...ChartUtils.DEFAULT_MARGIN },\n xaxis: ChartUtils.makeLayoutAxis(dh.plot.AxisType.X, theme),\n yaxis: ChartUtils.makeLayoutAxis(dh.plot.AxisType.Y, theme),\n };\n layout.datarevision = 0;\n return layout;\n }\n\n /**\n * Hydrate settings from a JSONable object\n * @param settings Dehydrated settings\n */\n static hydrateSettings(\n settings: ChartModelSettings\n ): Omit<ChartModelSettings, 'type'> & { type: SeriesPlotStyle } {\n return {\n ...settings,\n type: dh.plot.SeriesPlotStyle[settings.type],\n };\n }\n\n static titleFromSettings(settings: ChartModelSettings): string {\n const {\n series,\n xAxis,\n title = `${series.join(', ')} by ${xAxis}`,\n } = settings;\n\n return title;\n }\n\n /**\n * Creates the Figure settings from the Chart Builder settings\n * This should be deprecated at some point, and have Chart Builder create the figure settings directly.\n * This logic will still need to exist to translate existing charts, but could be part of a migration script\n * to translate the data.\n * Change when we decide to add more functionality to the Chart Builder.\n * @param settings The chart builder settings\n * @param settings.title The title for this figure\n * @param settings.xAxis The name of the column to use for the x-axis\n * @param settings.series The name of the columns to use for the series of this figure\n * @param settings.type The plot style for this figure\n */\n static makeFigureSettings(\n settings: ChartModelSettings,\n table: TableTemplate\n ): {\n charts: {\n chartType: string;\n axes: { formatType: string; type: string; position: string }[];\n series: {\n plotStyle: string;\n name: string;\n dataSources: {\n type: string;\n columnName: string;\n axis: { formatType: string; type: string; position: string };\n table: TableTemplate;\n }[];\n }[];\n }[];\n title: string;\n } {\n const { series, xAxis: settingsAxis, type } = settings;\n const title = ChartUtils.titleFromSettings(settings);\n const xAxis = {\n formatType: `${dh.plot.AxisFormatType.NUMBER}`,\n type: `${dh.plot.AxisType.X}`,\n position: `${dh.plot.AxisPosition.BOTTOM}`,\n };\n const yAxis = {\n formatType: `${dh.plot.AxisFormatType.NUMBER}`,\n type: `${dh.plot.AxisType.Y}`,\n position: `${dh.plot.AxisPosition.LEFT}`,\n };\n\n return {\n charts: [\n {\n chartType: `${dh.plot.ChartType.XY}`,\n axes: [xAxis, yAxis],\n series: series.map(name => ({\n plotStyle: `${type}`,\n name,\n dataSources: [\n {\n type: `${dh.plot.SourceType.X}`,\n columnName: settingsAxis,\n axis: xAxis,\n table,\n },\n {\n type: `${dh.plot.SourceType.Y}`,\n columnName: name,\n axis: yAxis,\n table,\n },\n ],\n })),\n },\n ],\n title,\n };\n }\n}\n\nexport default ChartUtils;\n"],"mappings":";;;;;;AAAA,OAAOA,GAAP,M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G;;gBALnBA,U,kBAOkB,E;;gBAPlBA,U,qBASqB,E;;gBATrBA,U,qBAWqB,I;;gBAXrBA,U,iBAaiBnB,MAAM,CAACC,MAAP,CAAc;EACjCgE,UAAU,EAAE,GADqB;EAEjCC,QAAQ,EAAE;AAFuB,CAAd,C;;gBAbjB/C,U,iBAkBiB,4B;;gBAlBjBA,U,oBAoBoBnB,MAAM,CAACC,MAAP,CAAc;EAAEyW,CAAC,EAAE,EAAL;EAASC,CAAC,EAAE,EAAZ;EAAgBC,CAAC,EAAE,EAAnB;EAAuBC,CAAC,EAAE,EAA1B;EAA8BtL,GAAG,EAAE;AAAnC,CAAd,C;;gBApBpBpK,U,2BAsB2BnB,MAAM,CAACC,MAAP,CAAc;EAAE2W,CAAC,EAAE;AAAL,CAAd,C;;gBAtB3BzV,U,0BAwB0B,E;;AA49ChC,eAAeA,UAAf"}
|
|
1
|
+
{"version":3,"file":"ChartUtils.js","names":["Log","TableUtils","dh","set","assertNotNull","ChartTheme","log","module","DAYS","Object","freeze","calendar","DayOfWeek","values","BUSINESS_COLUMN_TYPE","MILLIS_PER_HOUR","NANOS_PER_MILLI","isDateWrapper","value","asDate","undefined","isLongWrapper","asNumber","isDateTimeColumnFormatter","dhTimeZone","isRangedPlotlyAxis","range","autorange","ChartUtils","getPlotlyChartType","plotStyle","isBusinessTime","plot","SeriesPlotStyle","SCATTER","LINE","BAR","STACKED_BAR","PIE","TREEMAP","HISTOGRAM","OHLC","getPlotlyChartMode","getPlotlyProperty","sourceType","SourceType","X","Y","TIME","LABEL","PARENT","COLOR","Z","X_LOW","X_HIGH","Y_LOW","Y_HIGH","OPEN","HIGH","LOW","CLOSE","SHAPE","SIZE","HOVER_TEXT","TEXT","Error","getPlotlySeriesOrientation","series","sources","length","axis","type","AxisType","ORIENTATION","HORIZONTAL","VERTICAL","getPlotlyErrorBars","x","xLow","xHigh","array","map","i","arrayminus","symmetric","getPlotlyDateFormat","formatter","columnType","formatPattern","tickformat","replace","ticksuffix","dataFormatter","getColumnTypeFormatter","showTimeZone","i18n","DateTimeFormat","format","Date","automargin","convertNumberPrefix","prefix","getPlotlyNumberFormat","subpatterns","split","matchArray","match","placeholderDigits","zeroDigits","decimalDigits","optionalDecimalDigits","numberType","percentSign","suffix","paddingLength","isCommaSeparated","indexOf","comma","plotlyNumberType","decimalLength","trimOption","tickprefix","getPlotlyAxisFormat","source","axisFormat","isDateType","addTickSpacing","isNumberType","formatType","AxisFormatType","CATEGORY","gapBetweenMajorTicks","updatedFormat","tickSpacing","Math","tickmode","dtick","getSourceForAxis","chart","j","getSeriesVisibility","name","settings","hiddenSeries","includes","getHiddenLabels","makeSeriesData","mode","orientation","makeSeriesDataFromSeries","axisTypeMap","seriesVisibility","theme","lineColor","shapeColor","some","businessCalendar","getChartType","seriesData","addSourcesToSeriesData","addStylingToSeriesData","seriesDataParam","k","dataAttributeName","axisProperty","getAxisPropertyName","axes","get","axisIndex","axisIndexString","marker","line","width","AREA","fill","STACKED_AREA","stackgroup","STEP","shape","assign","color","paper_bgcolor","increasing","ohlc_increasing","decreasing","ohlc_decreasing","textinfo","outsidetextfont","title_color","hoverinfo","tiling","packing","pad","textposition","visible","getAxisFormats","figure","axisFormats","Map","nullFormat","charts","groupArray","axisSources","filter","axisType","typeAxes","axisLayoutProperty","getAxisLayoutProperty","has","debug","rangebreaks","businessPeriods","businessDays","holidays","timeZone","calendarTimeZone","typeFormatter","formatterTimeZone","timeZoneDiff","standardOffset","push","createRangeBreakValuesFromHolidays","forEach","period","pattern","bounds","periodToDecimal","close","open","createBoundsFromDays","weekendBounds","size","getAxisSide","axisPosition","AxisPosition","BOTTOM","TOP","LEFT","RIGHT","getChartForSeries","getLayoutRanges","layout","ranges","keys","key","updateLayoutAxes","layoutParam","plotWidth","plotHeight","getRangeParser","xAxisSize","max","MIN_AXIS_SIZE","min","AXIS_SIZE_PX","MAX_AXIS_SIZE","DEFAULT_AXIS_SIZE","yAxisSize","left","bottom","top","right","axisPositionMap","rightAxes","LEGEND_WIDTH_PX","MAX_LEGEND_SIZE","axisTypes","isYAxis","plotSize","makeLayoutAxis","layoutAxis","updateLayoutAxis","rangeParser","rangeStart","rangeEnd","layoutAxisParam","axisSize","label","title","text","side","position","overlaying","positionAxes","sideIndex","anchor","leftAxes","domain","bottomAxes","topAxes","Number","businessDaysInt","day","nonBusinessDaysInt","reopenDays","Set","closed","adjustedDay","add","boundsArray","closedDay","fullHolidays","partialHolidays","holiday","createPartialHoliday","createFullHoliday","adjustDateForTimeZone","date","toString","dateString","closedPeriods","rangeBreaks","startClose","endClose","dvalue","unwrapValue","wrapValue","property","reduce","result","item","group","DATE_FORMAT","substr","parse","tzFormat","estimatedOffset","estimatedDate","offset","gridcolor","linecolor","rangeslider","showline","ticklen","tickcolor","tickfont","zerolinecolor","font","showgrid","zerolinewidth","getColorwayFromTheme","colorway","Array","isArray","warn","makeDefaultLayout","autosize","family","yanchor","DEFAULT_TITLE_PADDING","y","legend","margin","DEFAULT_MARGIN","xaxis","yaxis","datarevision","hydrateSettings","titleFromSettings","xAxis","join","makeFigureSettings","table","settingsAxis","NUMBER","yAxis","chartType","ChartType","XY","dataSources","columnName","l","r","t","b"],"sources":["../src/ChartUtils.ts"],"sourcesContent":["import Log from '@deephaven/log';\nimport {\n DateTimeColumnFormatter,\n Formatter,\n TableColumnFormatter,\n TableUtils,\n} from '@deephaven/jsapi-utils';\nimport dh, {\n Axis,\n AxisPosition,\n AxisType,\n Chart,\n DateWrapper,\n Figure,\n Holiday,\n LongWrapper,\n Series,\n SeriesDataSource,\n SeriesPlotStyle,\n SourceType,\n TableTemplate,\n TimeZone,\n} from '@deephaven/jsapi-shim';\nimport set from 'lodash.set';\nimport {\n Layout,\n PlotData,\n PlotType,\n Axis as PlotlyAxis,\n ErrorBar,\n LayoutAxis,\n AxisType as PlotlyAxisType,\n OhclData,\n} from 'plotly.js';\nimport { assertNotNull, Range } from '@deephaven/utils';\nimport ChartTheme from './ChartTheme';\n\nexport interface ChartModelSettings {\n hiddenSeries?: string[];\n type: keyof SeriesPlotStyle;\n series: string[];\n xAxis: string;\n title?: string;\n}\n\nexport interface SeriesData {\n type: string | null;\n mode: string | null;\n name: string;\n orientation: string;\n xaxis?: number;\n marker?: unknown;\n xLow?: number;\n xHigh?: number;\n}\n\ntype LayoutAxisKey =\n | 'xaxis'\n | 'xaxis2'\n | 'xaxis3'\n | 'xaxis4'\n | 'xaxis5'\n | 'xaxis6'\n | 'xaxis7'\n | 'xaxis8'\n | 'xaxis9'\n | 'yaxis'\n | 'yaxis2'\n | 'yaxis3'\n | 'yaxis4'\n | 'yaxis5'\n | 'yaxis6'\n | 'yaxis7'\n | 'yaxis8'\n | 'yaxis9';\n\nexport interface TreeMapData extends PlotData {\n tiling: {\n packing: 'squarify';\n pad: 0;\n };\n}\n\ninterface Rangebreaks {\n bounds?: number[];\n dvalue?: number;\n enable?: boolean;\n name?: string;\n pattern?: 'day of week' | 'hour' | '';\n values?: string[];\n}\ninterface RangebreakAxisFormat extends PlotlyAxis {\n rangebreaks: Rangebreaks[];\n}\n\nexport type AxisTypeMap = Map<AxisType, Axis[]>;\ntype AxisPositionMap = Map<AxisPosition, Axis[]>;\n\nconst log = Log.module('ChartUtils');\n\nconst DAYS = Object.freeze(dh.calendar.DayOfWeek.values());\n\nconst BUSINESS_COLUMN_TYPE = 'io.deephaven.time.DateTime';\n\nconst MILLIS_PER_HOUR = 3600000;\n\nconst NANOS_PER_MILLI = 1000000;\n\nfunction isDateWrapper(value: unknown): value is DateWrapper {\n return (value as DateWrapper).asDate !== undefined;\n}\n\nfunction isLongWrapper(value: unknown): value is LongWrapper {\n return (value as LongWrapper).asNumber !== undefined;\n}\n\nfunction isDateTimeColumnFormatter(\n value: TableColumnFormatter\n): value is DateTimeColumnFormatter {\n return (value as DateTimeColumnFormatter).dhTimeZone !== undefined;\n}\n\nfunction isRangedPlotlyAxis(value: unknown): value is { range: Range[] } {\n return (\n value != null &&\n (value as PlotlyAxis).range &&\n ((value as PlotlyAxis).autorange === false ||\n (value as PlotlyAxis).autorange === undefined)\n );\n}\n\nclass ChartUtils {\n static DEFAULT_AXIS_SIZE = 0.15;\n\n static MIN_AXIS_SIZE = 0.025;\n\n static MAX_AXIS_SIZE = 0.2;\n\n static AXIS_SIZE_PX = 75;\n\n static LEGEND_WIDTH_PX = 50;\n\n static MAX_LEGEND_SIZE = 0.25;\n\n static ORIENTATION = Object.freeze({\n HORIZONTAL: 'h',\n VERTICAL: 'v',\n } as const);\n\n static DATE_FORMAT = 'yyyy-MM-dd HH:mm:ss.SSSSSS';\n\n static DEFAULT_MARGIN = Object.freeze({ l: 60, r: 50, t: 30, b: 60, pad: 0 });\n\n static DEFAULT_TITLE_PADDING = Object.freeze({ t: 8 });\n\n static SUBTITLE_LINE_HEIGHT = 25;\n\n /**\n * Converts the Iris plot style into a plotly chart type\n * @param plotStyle The plotStyle to use, see dh.plot.SeriesPlotStyle\n * @param isBusinessTime If the plot is using business time for an axis\n */\n static getPlotlyChartType(\n plotStyle: SeriesPlotStyle,\n isBusinessTime: boolean\n ): PlotType | undefined {\n switch (plotStyle) {\n case dh.plot.SeriesPlotStyle.SCATTER:\n // scattergl mode is more performant, but doesn't support the rangebreaks we need for businessTime calendars\n return !isBusinessTime ? 'scattergl' : 'scatter';\n case dh.plot.SeriesPlotStyle.LINE:\n // There is also still some artifacting bugs with scattergl: https://github.com/plotly/plotly.js/issues/3522\n // The artifacting only occurs on line plots, which we can draw with fairly decent performance using SVG paths\n // Once the above plotly issue is fixed, scattergl should be used here (when !isBusinessTime)\n return 'scatter';\n case dh.plot.SeriesPlotStyle.BAR:\n case dh.plot.SeriesPlotStyle.STACKED_BAR:\n return 'bar';\n\n case dh.plot.SeriesPlotStyle.PIE:\n return 'pie';\n\n case dh.plot.SeriesPlotStyle.TREEMAP:\n return 'treemap';\n\n case dh.plot.SeriesPlotStyle.HISTOGRAM:\n return 'histogram';\n\n case dh.plot.SeriesPlotStyle.OHLC:\n return 'ohlc';\n\n default:\n return undefined;\n }\n }\n\n /**\n * Converts the Iris plot style into a plotly chart mode\n * @param plotStyle The plotStyle to use, see dh.plot.SeriesPlotStyle.*\n */\n static getPlotlyChartMode(\n plotStyle: SeriesPlotStyle\n ): PlotData['mode'] | undefined {\n switch (plotStyle) {\n case dh.plot.SeriesPlotStyle.SCATTER:\n return 'markers';\n case dh.plot.SeriesPlotStyle.LINE:\n return 'lines';\n default:\n return undefined;\n }\n }\n\n /**\n * Get the property to set on the series data for plotly\n * @param plotStyle The plot style of the series\n * @param sourceType The source type for the series\n */\n static getPlotlyProperty(\n plotStyle: SeriesPlotStyle,\n sourceType: SourceType\n ): string {\n switch (plotStyle) {\n case dh.plot.SeriesPlotStyle.PIE:\n switch (sourceType) {\n case dh.plot.SourceType.X:\n return 'labels';\n case dh.plot.SourceType.Y:\n return 'values';\n default:\n break;\n }\n break;\n case dh.plot.SeriesPlotStyle.OHLC:\n switch (sourceType) {\n case dh.plot.SourceType.TIME:\n return 'x';\n default:\n break;\n }\n break;\n case dh.plot.SeriesPlotStyle.TREEMAP:\n switch (sourceType) {\n case dh.plot.SourceType.X:\n return 'ids';\n case dh.plot.SourceType.Y:\n return 'values';\n case dh.plot.SourceType.LABEL:\n return 'labels';\n case dh.plot.SourceType.PARENT:\n return 'parents';\n case dh.plot.SourceType.COLOR:\n return 'marker.colors';\n default:\n break;\n }\n break;\n default:\n break;\n }\n\n switch (sourceType) {\n case dh.plot.SourceType.X:\n return 'x';\n case dh.plot.SourceType.Y:\n return 'y';\n case dh.plot.SourceType.Z:\n return 'z';\n case dh.plot.SourceType.X_LOW:\n return 'xLow';\n case dh.plot.SourceType.X_HIGH:\n return 'xHigh';\n case dh.plot.SourceType.Y_LOW:\n return 'yLow';\n case dh.plot.SourceType.Y_HIGH:\n return 'yHigh';\n case dh.plot.SourceType.TIME:\n return 'time';\n case dh.plot.SourceType.OPEN:\n return 'open';\n case dh.plot.SourceType.HIGH:\n return 'high';\n case dh.plot.SourceType.LOW:\n return 'low';\n case dh.plot.SourceType.CLOSE:\n return 'close';\n case dh.plot.SourceType.SHAPE:\n return 'shape';\n case dh.plot.SourceType.SIZE:\n return 'size';\n case dh.plot.SourceType.LABEL:\n return 'label';\n case dh.plot.SourceType.COLOR:\n return 'color';\n case dh.plot.SourceType.PARENT:\n return 'parent';\n case dh.plot.SourceType.HOVER_TEXT:\n return 'hovertext';\n case dh.plot.SourceType.TEXT:\n return 'text';\n default:\n throw new Error(`Unrecognized source type: ${sourceType}`);\n }\n }\n\n static getPlotlySeriesOrientation(series: Series): 'h' | 'v' | undefined {\n const { sources } = series;\n if (sources.length === 2 && sources[0]?.axis?.type === dh.plot.AxisType.Y) {\n return ChartUtils.ORIENTATION.HORIZONTAL;\n }\n\n return ChartUtils.ORIENTATION.VERTICAL;\n }\n\n /**\n * Generate the plotly error bar data from the passed in data.\n * Iris passes in the values as absolute, plotly needs them as relative.\n * @param x The main data array\n * @param xLow The absolute low values\n * @param xHigh\n *\n * @returns The error_x object required by plotly, or null if none is required\n */\n static getPlotlyErrorBars(\n x: number[],\n xLow: number[],\n xHigh: number[]\n ): ErrorBar {\n const array = xHigh.map((value, i) => value - x[i]);\n const arrayminus = xLow.map((value, i) => x[i] - value);\n return {\n type: 'data',\n symmetric: false,\n array,\n arrayminus,\n };\n }\n\n static getPlotlyDateFormat(\n formatter: Formatter | null,\n columnType: string,\n formatPattern: string\n ): Partial<LayoutAxis> {\n const tickformat =\n formatPattern == null\n ? undefined\n : formatPattern\n .replace('%', '%%')\n .replace(/S{9}/g, '%9f')\n .replace(/S{8}/g, '%8f')\n .replace(/S{7}/g, '%7f')\n .replace(/S{6}/g, '%6f')\n .replace(/S{5}/g, '%5f')\n .replace(/S{4}/g, '%4f')\n .replace(/S{3}/g, '%3f')\n .replace(/S{2}/g, '%2f')\n .replace(/S{1}/g, '%1f')\n .replace(/y{4}/g, '%Y')\n .replace(/y{2}/g, '%y')\n .replace(/M{4}/g, '%B')\n .replace(/M{3}/g, '%b')\n .replace(/M{2}/g, '%m')\n .replace(/M{1}/g, '%-m')\n .replace(/E{4,}/g, '%A')\n .replace(/E{1,}/g, '%a')\n .replace(/d{2}/g, '%d')\n .replace(/([^%]|^)d{1}/g, '$1%-d')\n .replace(/H{2}/g, '%H')\n .replace(/h{2}/g, '%I')\n .replace(/h{1}/g, '%-I')\n .replace(/m{2}/g, '%M')\n .replace(/s{2}/g, '%S')\n .replace(\"'T'\", 'T')\n .replace(' z', ''); // timezone added as suffix if necessary\n\n let ticksuffix;\n const dataFormatter = formatter?.getColumnTypeFormatter(columnType);\n if (\n dataFormatter != null &&\n isDateTimeColumnFormatter(dataFormatter) &&\n dataFormatter.dhTimeZone != null &&\n dataFormatter.showTimeZone\n ) {\n ticksuffix = dh.i18n.DateTimeFormat.format(\n ' z',\n new Date(),\n dataFormatter.dhTimeZone\n );\n }\n\n return {\n tickformat,\n ticksuffix,\n automargin: true,\n };\n }\n\n static convertNumberPrefix(prefix: string): string {\n return prefix.replace(/\\u00A4\\u00A4/g, 'USD').replace(/\\u00A4/g, '$');\n }\n\n static getPlotlyNumberFormat(\n formatter: Formatter | null,\n columnType: string,\n formatPattern: string\n ): Partial<LayoutAxis> | null {\n if (!formatPattern) {\n return null;\n }\n\n // We translate java formatting: https://docs.oracle.com/javase/7/docs/api/java/text/DecimalFormat.html\n // Into d3 number formatting: https://github.com/d3/d3-format\n // We can't translate number formatting exactly, but should be able to translate the most common cases\n // First split it into the subpatterns; currently only handling the positive subpattern, ignoring the rest\n const subpatterns = formatPattern.split(';');\n\n const matchArray = subpatterns[0].match(\n /^([^#,0.]*)([#,]*)([0,]*)(\\.?)(0*)(#*)(E?0*)(%?)(.*)/\n );\n assertNotNull(matchArray);\n\n const [\n ,\n prefix,\n placeholderDigits,\n zeroDigits,\n ,\n decimalDigits,\n optionalDecimalDigits,\n numberType,\n percentSign,\n suffix,\n ] = matchArray;\n\n const paddingLength = zeroDigits.replace(',', '').length;\n const isCommaSeparated =\n placeholderDigits.indexOf(',') >= 0 || zeroDigits.indexOf(',') >= 0;\n const comma = isCommaSeparated ? ',' : '';\n const plotlyNumberType =\n numberType != null && numberType !== '' ? 'e' : 'f';\n\n const type = percentSign !== '' ? percentSign : plotlyNumberType;\n\n const decimalLength = decimalDigits.length + optionalDecimalDigits.length;\n // IDS-4565 Plotly uses an older version of d3 which doesn't support the trim option or negative brackets\n // If plotly updates it's d3 version, this should be re-enabled\n // const trimOption = optionalDecimalDigits.length > 0 ? '~' : '';\n const trimOption = '';\n\n const tickformat = `0${paddingLength}${comma}.${decimalLength}${trimOption}${type}`;\n const tickprefix = ChartUtils.convertNumberPrefix(prefix);\n // prefix and suffix are processed the same\n const ticksuffix = ChartUtils.convertNumberPrefix(suffix);\n\n return { tickformat, tickprefix, ticksuffix, automargin: true };\n }\n\n /**\n * Gets the plotly axis formatting information from the source passed in\n * @param source The Source to get the formatter information from\n * @param formatter The current formatter for formatting data\n */\n static getPlotlyAxisFormat(\n source: SeriesDataSource,\n formatter: Formatter | null = null\n ): Partial<PlotlyAxis> | null {\n const { axis, columnType } = source;\n const { formatPattern } = axis;\n\n let axisFormat = null;\n if (TableUtils.isDateType(columnType)) {\n axisFormat = ChartUtils.getPlotlyDateFormat(\n formatter,\n columnType,\n formatPattern\n );\n axisFormat = ChartUtils.addTickSpacing(axisFormat, axis, true);\n } else if (TableUtils.isNumberType(columnType)) {\n axisFormat = ChartUtils.getPlotlyNumberFormat(\n formatter,\n columnType,\n formatPattern\n );\n axisFormat = ChartUtils.addTickSpacing(axisFormat, axis, false);\n }\n\n if (axis.formatType === dh.plot.AxisFormatType.CATEGORY) {\n if (axisFormat) {\n axisFormat.type = 'category';\n } else {\n axisFormat = {\n type: 'category' as PlotlyAxisType,\n tickformat: undefined,\n ticksuffix: undefined,\n };\n }\n }\n\n return axisFormat;\n }\n\n /**\n * Adds tick spacing for an axis that has gapBetweenMajorTicks defined.\n *\n * @param axisFormat the current axis format, may be null\n * @param axis the current axis\n * @param isDateType indicates if the columns is a date type\n */\n static addTickSpacing(\n axisFormat: Partial<LayoutAxis> | null,\n axis: Axis,\n isDateType: boolean\n ): Partial<PlotlyAxis> | null {\n const { gapBetweenMajorTicks } = axis;\n if (gapBetweenMajorTicks > 0) {\n const updatedFormat: Partial<PlotlyAxis> = axisFormat || {};\n let tickSpacing = gapBetweenMajorTicks;\n if (isDateType) {\n // Need to convert from nanoseconds to milliseconds\n tickSpacing = gapBetweenMajorTicks / NANOS_PER_MILLI;\n }\n if (axis.log) {\n tickSpacing = Math.log(tickSpacing);\n }\n // Note that tickmode defaults to 'auto'\n updatedFormat.tickmode = 'linear';\n updatedFormat.dtick = tickSpacing;\n return updatedFormat;\n }\n\n return axisFormat;\n }\n\n /**\n * Retrieve the data source for a given axis in a chart\n * @param chart The chart to get the source for\n * @param axis The axis to find the source for\n * @returns The first source matching this axis\n */\n static getSourceForAxis(chart: Chart, axis: Axis): SeriesDataSource | null {\n for (let i = 0; i < chart.series.length; i += 1) {\n const series = chart.series[i];\n for (let j = 0; j < series.sources.length; j += 1) {\n const source = series.sources[j];\n if (source.axis === axis) {\n return source;\n }\n }\n }\n\n return null;\n }\n\n /**\n * Get visibility setting for the series object\n * @param name The series name to get the visibility for\n * @param settings Chart settings\n * @returns True for visible series and 'legendonly' for hidden\n */\n static getSeriesVisibility(\n name: string,\n settings?: Partial<ChartModelSettings>\n ): boolean | 'legendonly' {\n if (\n settings != null &&\n settings.hiddenSeries != null &&\n settings.hiddenSeries.includes(name)\n ) {\n return 'legendonly';\n }\n return true;\n }\n\n /**\n * Get hidden labels array from chart settings\n * @param settings Chart settings\n * @returns Array of hidden series names\n */\n static getHiddenLabels(settings: Partial<ChartModelSettings>): string[] {\n if (settings?.hiddenSeries) {\n return [...settings.hiddenSeries];\n }\n return [];\n }\n\n /**\n * Create a default series data object. Apply styling to the object afterward.\n * @returns A simple series data object with no styling\n */\n static makeSeriesData(\n type: PlotType | undefined,\n mode: PlotData['mode'] | undefined,\n name: string,\n orientation: 'h' | 'v' = ChartUtils.ORIENTATION.VERTICAL\n ): Partial<PlotData> {\n return { type, mode, name, orientation };\n }\n\n /**\n * Create a data series (trace) for use with plotly\n * @param series The series to create the series data with\n * @param axisTypeMap The map of axes grouped by type\n * @param seriesVisibility Visibility setting for the series\n * @param theme The theme properties for the plot. See ChartTheme.js for an example\n * @returns The series data (trace) object for use with plotly.\n */\n static makeSeriesDataFromSeries(\n series: Series,\n axisTypeMap: AxisTypeMap,\n seriesVisibility: boolean | 'legendonly',\n theme = ChartTheme\n ): Partial<PlotData> {\n const { name, plotStyle, lineColor, shapeColor, sources } = series;\n\n const isBusinessTime = sources.some(\n source => source.axis?.businessCalendar\n );\n const type = ChartUtils.getChartType(plotStyle, isBusinessTime);\n const mode = ChartUtils.getPlotlyChartMode(plotStyle);\n const orientation = ChartUtils.getPlotlySeriesOrientation(series);\n\n const seriesData = ChartUtils.makeSeriesData(type, mode, name, orientation);\n\n ChartUtils.addSourcesToSeriesData(\n seriesData,\n plotStyle,\n sources,\n axisTypeMap\n );\n\n ChartUtils.addStylingToSeriesData(\n seriesData,\n plotStyle,\n theme,\n lineColor,\n shapeColor,\n seriesVisibility\n );\n\n return seriesData;\n }\n\n static addSourcesToSeriesData(\n seriesDataParam: Partial<PlotData>,\n plotStyle: SeriesPlotStyle,\n sources: SeriesDataSource[],\n axisTypeMap: AxisTypeMap\n ): void {\n const seriesData = seriesDataParam;\n for (let k = 0; k < sources.length; k += 1) {\n const source = sources[k];\n const { axis, type: sourceType } = source;\n\n const dataAttributeName = ChartUtils.getPlotlyProperty(\n plotStyle,\n sourceType\n );\n set(seriesData, dataAttributeName, []);\n\n const axisProperty =\n axis != null ? ChartUtils.getAxisPropertyName(axis.type) : null;\n if (axisProperty != null) {\n const axes = axisTypeMap.get(axis.type);\n if (axes) {\n const axisIndex = axes.indexOf(axis);\n const axisIndexString = axisIndex > 0 ? `${axisIndex + 1}` : '';\n seriesData[\n `${axisProperty}axis`\n ] = `${axisProperty}${axisIndexString}`;\n }\n }\n }\n }\n\n static addStylingToSeriesData(\n seriesDataParam: Partial<PlotData>,\n plotStyle: SeriesPlotStyle,\n theme: typeof ChartTheme = ChartTheme,\n lineColor: string | null = null,\n shapeColor: string | null = null,\n seriesVisibility: 'legendonly' | boolean | null = null\n ): void {\n const seriesData = seriesDataParam;\n // Add some empty objects so we can fill them in later with details without checking for existence\n seriesData.marker = { line: {} }; // border line width on markers\n seriesData.line = {\n width: 1, // default line width for lines, should eventually be able to override\n };\n\n if (plotStyle === dh.plot.SeriesPlotStyle.AREA) {\n seriesData.fill = 'tozeroy';\n } else if (plotStyle === dh.plot.SeriesPlotStyle.STACKED_AREA) {\n seriesData.stackgroup = 'stack';\n } else if (plotStyle === dh.plot.SeriesPlotStyle.STEP) {\n seriesData.line.shape = 'hv'; // plot.ly horizontal then vertical step styling\n } else if (plotStyle === dh.plot.SeriesPlotStyle.HISTOGRAM) {\n // The default histfunc in plotly is 'count', but the data passed up from the API provides explicit x/y values and bins\n // Since it's converted to bar, just set the widths of each bar\n seriesData.width = [];\n\n if (seriesData.marker.line !== undefined) {\n Object.assign(seriesData.marker.line, {\n color: theme.paper_bgcolor,\n width: 1,\n });\n }\n } else if (plotStyle === dh.plot.SeriesPlotStyle.OHLC) {\n (seriesData as Partial<OhclData>).increasing = {\n line: { color: theme.ohlc_increasing },\n };\n (seriesData as Partial<OhclData>).decreasing = {\n line: { color: theme.ohlc_decreasing },\n };\n } else if (plotStyle === dh.plot.SeriesPlotStyle.PIE) {\n seriesData.textinfo = 'label+percent';\n\n // TODO Open DefinitelyTyped/Plotly PR to mark family and size as optional\n // https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/plotly.js/lib/traces/pie.d.ts#L6\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (seriesData as any).outsidetextfont = {\n color: theme.title_color,\n };\n } else if (plotStyle === dh.plot.SeriesPlotStyle.TREEMAP) {\n seriesData.hoverinfo = 'text';\n seriesData.textinfo = 'label+text';\n (seriesData as TreeMapData).tiling = {\n packing: 'squarify',\n pad: 0,\n };\n seriesData.textposition = 'middle center';\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (seriesData as any).outsidetextfont = { color: theme.title_color };\n }\n\n if (lineColor != null) {\n if (plotStyle === dh.plot.SeriesPlotStyle.BAR) {\n seriesData.marker.color = lineColor;\n } else {\n seriesData.line.color = lineColor;\n }\n }\n\n if (shapeColor != null) {\n seriesData.marker.color = shapeColor;\n }\n\n // Skipping pie charts\n // Pie slice visibility is configured in chart layout instead of series data\n if (seriesVisibility != null && plotStyle !== dh.plot.SeriesPlotStyle.PIE) {\n seriesData.visible = seriesVisibility;\n }\n }\n\n /**\n * Retrieve the axis formats from the provided figure.\n * Currently defaults to just the x/y axes.\n * @param figure The figure to get the axis formats for\n * @param formatter The formatter to use when getting the axis format\n * @returns A map of axis layout property names to axis formats\n */\n static getAxisFormats(\n figure: Figure,\n formatter: Formatter\n ): Map<LayoutAxisKey, Partial<PlotlyAxis>> {\n const axisFormats = new Map();\n const nullFormat = { tickformat: null, ticksuffix: null };\n\n const { charts } = figure;\n\n for (let i = 0; i < charts.length; i += 1) {\n const chart = charts[i];\n const axisTypeMap = ChartUtils.groupArray(chart.axes, 'type');\n\n for (let j = 0; j < chart.series.length; j += 1) {\n const series = chart.series[j];\n const { sources } = series;\n const axisSources = sources.filter(source => source.axis);\n for (let k = 0; k < axisSources.length; k += 1) {\n const source = axisSources[k];\n const { axis } = source;\n const { type: axisType } = axis;\n const typeAxes = axisTypeMap.get(axisType);\n assertNotNull(typeAxes);\n const axisIndex = typeAxes.indexOf(axis);\n const axisProperty = ChartUtils.getAxisPropertyName(axisType);\n if (axisProperty != null) {\n const axisLayoutProperty = ChartUtils.getAxisLayoutProperty(\n axisProperty,\n axisIndex\n );\n\n if (axisFormats.has(axisLayoutProperty)) {\n log.debug(`${axisLayoutProperty} already added.`);\n } else {\n log.debug(`Adding ${axisLayoutProperty} to axisFormats.`);\n const axisFormat = ChartUtils.getPlotlyAxisFormat(\n source,\n formatter\n );\n if (axisFormat === null) {\n axisFormats.set(axisLayoutProperty, nullFormat);\n } else {\n axisFormats.set(axisLayoutProperty, axisFormat);\n\n const { businessCalendar } = axis;\n if (businessCalendar != null) {\n const rangebreaks: Rangebreaks[] = [];\n const {\n businessPeriods,\n businessDays,\n holidays,\n timeZone: calendarTimeZone,\n } = businessCalendar;\n const typeFormatter = formatter?.getColumnTypeFormatter(\n BUSINESS_COLUMN_TYPE\n );\n let formatterTimeZone;\n if (isDateTimeColumnFormatter(typeFormatter)) {\n formatterTimeZone = typeFormatter.dhTimeZone;\n }\n const timeZoneDiff = formatterTimeZone\n ? (calendarTimeZone.standardOffset -\n formatterTimeZone.standardOffset) /\n 60\n : 0;\n if (holidays.length > 0) {\n rangebreaks.push(\n ...ChartUtils.createRangeBreakValuesFromHolidays(\n holidays,\n calendarTimeZone,\n formatterTimeZone\n )\n );\n }\n businessPeriods.forEach(period =>\n rangebreaks.push({\n pattern: 'hour',\n bounds: [\n ChartUtils.periodToDecimal(period.close) + timeZoneDiff,\n ChartUtils.periodToDecimal(period.open) + timeZoneDiff,\n ],\n })\n );\n // If there are seven business days, then there is no weekend\n if (businessDays.length < DAYS.length) {\n ChartUtils.createBoundsFromDays(businessDays).forEach(\n weekendBounds =>\n rangebreaks.push({\n pattern: 'day of week',\n bounds: weekendBounds,\n })\n );\n }\n\n (axisFormat as RangebreakAxisFormat).rangebreaks = rangebreaks;\n }\n\n if (axisFormats.size === chart.axes.length) {\n return axisFormats;\n }\n }\n }\n }\n }\n }\n }\n\n return axisFormats;\n }\n\n static getChartType(\n plotStyle: SeriesPlotStyle,\n isBusinessTime: boolean\n ): PlotType | undefined {\n switch (plotStyle) {\n case dh.plot.SeriesPlotStyle.HISTOGRAM:\n // When reading data from the `Figure`, it already provides bins and values, so rather than using\n // plot.ly to calculate the bins and sum values, just convert it to a bar chart\n return 'bar';\n default:\n return ChartUtils.getPlotlyChartType(plotStyle, isBusinessTime);\n }\n }\n\n /**\n * Return the plotly axis property name\n * @param axisType The axis type to get the property name for\n */\n static getAxisPropertyName(axisType: AxisType): 'x' | 'y' | null {\n switch (axisType) {\n case dh.plot.AxisType.X:\n return 'x';\n case dh.plot.AxisType.Y:\n return 'y';\n default:\n return null;\n }\n }\n\n /**\n * Returns the plotly \"side\" value for the provided axis position\n * @param axisPosition The Iris AxisPosition of the axis\n */\n static getAxisSide(\n axisPosition: AxisPosition\n ): LayoutAxis['side'] | undefined {\n switch (axisPosition) {\n case dh.plot.AxisPosition.BOTTOM:\n return 'bottom';\n case dh.plot.AxisPosition.TOP:\n return 'top';\n case dh.plot.AxisPosition.LEFT:\n return 'left';\n case dh.plot.AxisPosition.RIGHT:\n return 'right';\n default:\n return undefined;\n }\n }\n\n /**\n * Retrieve the chart that contains the passed in series from the figure\n * @param figure The figure to retrieve the chart from\n * @param series The series to get the chart for\n */\n static getChartForSeries(figure: Figure, series: Series): Chart | null {\n const { charts } = figure;\n\n for (let i = 0; i < charts.length; i += 1) {\n const chart = charts[i];\n for (let j = 0; j < chart.series.length; j += 1) {\n if (series === chart.series[j]) {\n return chart;\n }\n }\n }\n\n return null;\n }\n\n /**\n * Get an object mapping axis to their ranges\n * @param layout The plotly layout object to get the ranges from\n * @returns An object mapping the axis name to it's range\n */\n static getLayoutRanges(layout: Layout): Record<string, Range[]> {\n const ranges: Record<string, Range[]> = {};\n const keys: (keyof Layout)[] = Object.keys(layout).filter(\n key => key.indexOf('axis') >= 0\n ) as LayoutAxisKey[];\n for (let i = 0; i < keys.length; i += 1) {\n const key = keys[i];\n const value = layout[key];\n if (isRangedPlotlyAxis(value)) {\n // Only want to add the range if it's not autoranged\n ranges[key] = [...(value as PlotlyAxis).range];\n }\n }\n\n return ranges;\n }\n\n /**\n * Updates the axes positions and sizes in the layout object provided.\n * If the axis did not exist in the layout previously, it is created and added.\n * Any axis that no longer exists in axes is removed.\n * With Downsampling enabled, will also update the range on the axis itself as appropriate\n * @param layoutParam The layout object to update\n * @param axes The axes to update the layout with\n * @param plotWidth The width of the plot to calculate the axis sizes for\n * @param plotHeight The height of the plot to calculate the axis sizes for\n * @param getRangeParser A function to retrieve the range parser for a given axis\n */\n static updateLayoutAxes(\n layoutParam: Partial<Layout>,\n axes: Axis[],\n plotWidth = 0,\n plotHeight = 0,\n getRangeParser: ((axis: Axis) => (range: Range) => unknown[]) | null = null,\n theme = ChartTheme\n ): void {\n const xAxisSize =\n plotWidth > 0\n ? Math.max(\n ChartUtils.MIN_AXIS_SIZE,\n Math.min(\n ChartUtils.AXIS_SIZE_PX / plotHeight,\n ChartUtils.MAX_AXIS_SIZE\n )\n )\n : ChartUtils.DEFAULT_AXIS_SIZE;\n const yAxisSize =\n plotHeight > 0\n ? Math.max(\n ChartUtils.MIN_AXIS_SIZE,\n Math.min(\n ChartUtils.AXIS_SIZE_PX / plotWidth,\n ChartUtils.MAX_AXIS_SIZE\n )\n )\n : ChartUtils.DEFAULT_AXIS_SIZE;\n\n // Adjust the bounds based on where the legend is\n // For now, always assume the legend is shown on the right\n const bounds = {\n left: 0,\n bottom: 0,\n top: 1,\n right: 1,\n };\n const axisPositionMap = ChartUtils.groupArray(axes, 'position');\n const rightAxes = axisPositionMap.get(dh.plot.AxisPosition.RIGHT) || [];\n if (rightAxes.length > 0) {\n if (plotWidth > 0) {\n bounds.right =\n 1 -\n Math.max(\n 0,\n Math.min(\n ChartUtils.LEGEND_WIDTH_PX / plotWidth,\n ChartUtils.MAX_LEGEND_SIZE\n )\n );\n } else {\n bounds.right = 1 - ChartUtils.DEFAULT_AXIS_SIZE;\n }\n }\n\n const layout = layoutParam;\n const axisTypeMap = ChartUtils.groupArray(axes, 'type');\n const axisTypes = [...axisTypeMap.keys()];\n for (let j = 0; j < axisTypes.length; j += 1) {\n const axisType = axisTypes[j];\n const axisProperty = ChartUtils.getAxisPropertyName(axisType);\n if (axisProperty != null) {\n const typeAxes = axisTypeMap.get(axisType);\n const isYAxis = axisType === dh.plot.AxisType.Y;\n const plotSize = isYAxis ? plotHeight : plotWidth;\n\n assertNotNull(typeAxes);\n let axisIndex = 0;\n\n for (axisIndex = 0; axisIndex < typeAxes.length; axisIndex += 1) {\n const axis = typeAxes[axisIndex];\n const axisLayoutProperty = ChartUtils.getAxisLayoutProperty(\n axisProperty,\n axisIndex\n );\n if (layout[axisLayoutProperty] == null) {\n layout[axisLayoutProperty] = ChartUtils.makeLayoutAxis(\n axisType,\n theme\n );\n }\n\n const layoutAxis = layout[axisLayoutProperty];\n if (layoutAxis != null) {\n ChartUtils.updateLayoutAxis(\n layoutAxis,\n axis,\n axisIndex,\n axisPositionMap,\n xAxisSize,\n yAxisSize,\n bounds\n );\n\n const { range, autorange } = layoutAxis;\n if (\n getRangeParser != null &&\n range !== undefined &&\n (autorange === undefined || autorange === false)\n ) {\n const rangeParser = getRangeParser(axis);\n const [rangeStart, rangeEnd] = rangeParser(range as Range);\n\n log.debug(\n 'Setting downsample range',\n plotSize,\n rangeStart,\n rangeEnd\n );\n\n axis.range(plotSize, rangeStart, rangeEnd);\n } else {\n axis.range(plotSize);\n }\n }\n }\n\n let axisLayoutProperty = ChartUtils.getAxisLayoutProperty(\n axisProperty,\n axisIndex\n );\n while (layout[axisLayoutProperty] != null) {\n delete layout[axisLayoutProperty];\n\n axisIndex += 1;\n axisLayoutProperty = ChartUtils.getAxisLayoutProperty(\n axisProperty,\n axisIndex\n );\n }\n }\n }\n }\n\n static getAxisLayoutProperty(\n axisProperty: 'x' | 'y',\n axisIndex: number\n ): LayoutAxisKey {\n const axisIndexString = axisIndex > 0 ? `${axisIndex + 1}` : '';\n return `${axisProperty ?? ''}axis${axisIndexString}` as LayoutAxisKey;\n }\n\n /**\n * Updates the layout axis object in place\n * @param layoutAxisParam The plotly layout axis param\n * @param axis The Iris Axis to update the plotly layout with\n * @param axisIndex The type index for this axis\n * @param axisPositionMap All the axes mapped by position\n * @param axisSize The size of each axis in percent\n * @param bounds The bounds of the axes domains\n */\n static updateLayoutAxis(\n layoutAxisParam: Partial<LayoutAxis>,\n axis: Axis,\n axisIndex: number,\n axisPositionMap: AxisPositionMap,\n xAxisSize: number,\n yAxisSize: number,\n bounds: {\n left: number;\n bottom: number;\n top: number;\n right: number;\n }\n ): void {\n const isYAxis = axis.type === dh.plot.AxisType.Y;\n const axisSize = isYAxis ? yAxisSize : xAxisSize;\n const layoutAxis = layoutAxisParam;\n // Enterprise API returns null for empty axis labels\n // Passing null title text to Plotly results in incorrect axis position, DH-9164\n const label = axis.label ?? '';\n if (\n layoutAxis.title !== undefined &&\n typeof layoutAxis.title !== 'string'\n ) {\n layoutAxis.title.text = label;\n } else {\n layoutAxis.title = { text: label };\n }\n\n if (axis.log) {\n layoutAxis.type = 'log';\n }\n\n layoutAxis.side = ChartUtils.getAxisSide(axis.position);\n\n if (axisIndex > 0) {\n layoutAxis.overlaying =\n ChartUtils.getAxisPropertyName(axis.type) ?? undefined;\n\n const positionAxes = axisPositionMap.get(axis.position) ?? [];\n const sideIndex = positionAxes.indexOf(axis);\n if (sideIndex > 0) {\n layoutAxis.anchor = 'free';\n\n if (axis.position === dh.plot.AxisPosition.RIGHT) {\n layoutAxis.position =\n bounds.right + (sideIndex - positionAxes.length + 1) * axisSize;\n } else if (axis.position === dh.plot.AxisPosition.TOP) {\n layoutAxis.position =\n bounds.top + (sideIndex - positionAxes.length + 1) * axisSize;\n } else if (axis.position === dh.plot.AxisPosition.BOTTOM) {\n layoutAxis.position =\n bounds.bottom + (positionAxes.length - sideIndex + 1) * axisSize;\n } else if (axis.position === dh.plot.AxisPosition.LEFT) {\n layoutAxis.position =\n bounds.left + (positionAxes.length - sideIndex + 1) * axisSize;\n }\n }\n } else if (axis.type === dh.plot.AxisType.X) {\n const leftAxes = axisPositionMap.get(dh.plot.AxisPosition.LEFT) || [];\n const rightAxes = axisPositionMap.get(dh.plot.AxisPosition.RIGHT) || [];\n const left = Math.max(\n bounds.left,\n bounds.left + (leftAxes.length - 1) * yAxisSize\n );\n const right = Math.min(\n bounds.right - (rightAxes.length - 1) * yAxisSize,\n bounds.right\n );\n layoutAxis.domain = [left, right];\n } else if (axis.type === dh.plot.AxisType.Y) {\n const bottomAxes = axisPositionMap.get(dh.plot.AxisPosition.BOTTOM) || [];\n const topAxes = axisPositionMap.get(dh.plot.AxisPosition.TOP) || [];\n const bottom = Math.max(\n bounds.bottom,\n bounds.bottom + (bottomAxes.length - 1) * xAxisSize\n );\n const top = Math.min(\n bounds.top - (topAxes.length - 1) * xAxisSize,\n bounds.top\n );\n layoutAxis.domain = [bottom, top];\n }\n }\n\n /**\n * Converts an open or close period to a declimal. e.g '09:30\" to 9.5\n *\n * @param period the open or close value of the period\n */\n static periodToDecimal(period: string): number {\n const values = period.split(':');\n return Number(values[0]) + Number(values[1]) / 60;\n }\n\n /**\n * Creates range break bounds for plotly from business days.\n * For example a standard business week of ['MONDAY','TUESDAY','WEDNESDAY','THURSDAY','FRIDAY']\n * will result in [[6,1]] meaning close on Saturday and open on Monday.\n * If you remove Wednesday from the array, then you get two closures [[6, 1], [3, 4]]\n *\n * @param businessDays the days to display on the x-axis\n */\n static createBoundsFromDays(businessDays: string[]): Range[] {\n const businessDaysInt = businessDays.map(day => DAYS.indexOf(day));\n const nonBusinessDaysInt = DAYS.filter(\n day => !businessDays.includes(day)\n ).map(day => DAYS.indexOf(day));\n // These are the days when business reopens (e.g. Monday after a weekend)\n const reopenDays = new Set<number>();\n nonBusinessDaysInt.forEach(closed => {\n for (let i = closed + 1; i < closed + DAYS.length; i += 1) {\n const adjustedDay = i % DAYS.length;\n if (businessDaysInt.includes(adjustedDay)) {\n reopenDays.add(adjustedDay);\n break;\n }\n }\n });\n const boundsArray: Range[] = [];\n // For each reopen day, find the furthest previous closed day\n reopenDays.forEach(open => {\n for (let i = open - 1; i > open - DAYS.length; i -= 1) {\n const adjustedDay = i < 0 ? i + DAYS.length : i;\n if (businessDaysInt.includes(adjustedDay)) {\n const closedDay = (adjustedDay + 1) % 7;\n boundsArray.push([closedDay, open]);\n break;\n }\n }\n });\n return boundsArray;\n }\n\n /**\n * Creates an array of range breaks for all holidays.\n *\n * @param holidays an array of holidays\n * @param calendarTimeZone the time zone for the business calendar\n * @param formatterTimeZone the time zone for the formatter\n */\n static createRangeBreakValuesFromHolidays(\n holidays: Holiday[],\n calendarTimeZone: TimeZone,\n formatterTimeZone?: TimeZone\n ): Rangebreaks[] {\n const fullHolidays: string[] = [];\n const partialHolidays: {\n values: string[];\n dvalue: number;\n }[] = [];\n holidays.forEach(holiday => {\n if (holiday.businessPeriods.length > 0) {\n partialHolidays.push(\n ...ChartUtils.createPartialHoliday(\n holiday,\n calendarTimeZone,\n formatterTimeZone\n )\n );\n } else {\n fullHolidays.push(\n ChartUtils.createFullHoliday(\n holiday,\n calendarTimeZone,\n formatterTimeZone\n )\n );\n }\n });\n return [{ values: fullHolidays }, ...partialHolidays];\n }\n\n /**\n * Creates the range break value for a full holiday. A full holiday is day that has no business periods.\n *\n * @param holiday the full holiday\n * @param calendarTimeZone the time zone for the business calendar\n * @param formatterTimeZone the time zone for the formatter\n */\n static createFullHoliday(\n holiday: Holiday,\n calendarTimeZone: TimeZone,\n formatterTimeZone?: TimeZone\n ): string {\n return ChartUtils.adjustDateForTimeZone(\n `${holiday.date.toString()} 00:00:00.000000`,\n calendarTimeZone,\n formatterTimeZone\n );\n }\n\n /**\n * Creates the range break for a partial holiday. A partial holiday is holiday with business periods\n * that are different than the default business periods.\n *\n * @param holiday the partial holiday\n * @param calendarTimeZone the time zone for the business calendar\n * @param formatterTimeZone the time zone for the formatter\n */\n static createPartialHoliday(\n holiday: Holiday,\n calendarTimeZone: TimeZone,\n formatterTimeZone?: TimeZone\n ): {\n values: string[];\n dvalue: number;\n }[] {\n // If a holiday has business periods {open1, close1} and {open2, close2}\n // This will generate range breaks for:\n // closed from 00:00 to open1\n // closed from close1 to open2\n // closed from close2 to 23:59:59.999999\n const dateString = holiday.date.toString();\n const closedPeriods = ['00:00'];\n holiday.businessPeriods.forEach(period => {\n closedPeriods.push(period.open);\n closedPeriods.push(period.close);\n });\n // To go up to 23:59:59.999999, we calculate the dvalue using 24 - close\n closedPeriods.push('24:00');\n\n const rangeBreaks = [];\n for (let i = 0; i < closedPeriods.length; i += 2) {\n const startClose = closedPeriods[i];\n const endClose = closedPeriods[i + 1];\n // Skip over any periods where start and close are the same (zero hours)\n if (startClose !== endClose) {\n const values = [\n ChartUtils.adjustDateForTimeZone(\n `${dateString} ${startClose}:00.000000`,\n calendarTimeZone,\n formatterTimeZone\n ),\n ];\n const dvalue =\n MILLIS_PER_HOUR *\n (ChartUtils.periodToDecimal(endClose) -\n ChartUtils.periodToDecimal(startClose));\n rangeBreaks.push({ values, dvalue });\n }\n }\n return rangeBreaks;\n }\n\n /**\n * Adjusts a date string from the calendar time zone to the formatter time zone.\n *\n * @param dateString the date string\n * @param calendarTimeZone the time zone for the business calendar\n * @param formatterTimeZone the time zone for the formatter\n */\n static adjustDateForTimeZone(\n dateString: string,\n calendarTimeZone: TimeZone,\n formatterTimeZone?: TimeZone\n ): string {\n if (\n formatterTimeZone &&\n formatterTimeZone.standardOffset !== calendarTimeZone.standardOffset\n ) {\n return ChartUtils.unwrapValue(\n ChartUtils.wrapValue(\n dateString,\n BUSINESS_COLUMN_TYPE,\n calendarTimeZone\n ),\n formatterTimeZone\n ) as string;\n }\n return dateString;\n }\n\n /**\n * Groups an array and returns a map\n * @param array The object to group\n * @param property The property name to group by\n * @returns A map containing the items grouped by their values for the property\n */\n static groupArray<T, P extends keyof T>(\n array: T[],\n property: P\n ): Map<T[P], T[]> {\n return array.reduce((result, item) => {\n const key = item[property];\n const group: T[] = result.get(key) ?? [];\n group.push(item);\n result.set(key, group);\n return result;\n }, new Map());\n }\n\n /**\n * Unwraps a value provided from API to a value plotly can understand\n * Eg. Unwraps DateWrapper, LongWrapper objects.\n */\n static unwrapValue(value: unknown, timeZone?: TimeZone): unknown {\n if (value != null) {\n if (isDateWrapper(value)) {\n return dh.i18n.DateTimeFormat.format(\n ChartUtils.DATE_FORMAT,\n value,\n timeZone\n );\n }\n\n if (isLongWrapper(value)) {\n return value.asNumber();\n }\n }\n\n return value;\n }\n\n /**\n *\n * @param value The value to wrap up\n * @param columnType The type of column this value is from\n * @param timeZone The time zone if applicable\n */\n static wrapValue(\n value: unknown,\n columnType: string,\n timeZone: TimeZone | null = null\n ): unknown {\n if (TableUtils.isDateType(columnType) && typeof value === 'string') {\n // Need to limit the format to the actual length of the string range set in plotly\n // Otherwise parse will fail\n const text = value;\n const format = ChartUtils.DATE_FORMAT.substr(0, value.length);\n const date = dh.i18n.DateTimeFormat.parse(format, text);\n if (!timeZone) {\n return date;\n }\n\n // IDS-5994 Due to date parsing, time zone, and daylight savings shenanigans, we need\n // to pass the actual offset with the time to have it parse correctly.\n // However, the offset can change based on the date because of Daylight Savings\n // So we end up parsing the date multiple times. And curse daylight savings.\n const tzFormat = `${format} Z`;\n const estimatedOffset = dh.i18n.DateTimeFormat.format(\n 'Z',\n date,\n timeZone\n );\n const estimatedDate = dh.i18n.DateTimeFormat.parse(\n tzFormat,\n `${text} ${estimatedOffset}`\n );\n const offset = dh.i18n.DateTimeFormat.format(\n 'Z',\n estimatedDate,\n timeZone\n );\n return dh.i18n.DateTimeFormat.parse(tzFormat, `${text} ${offset}`);\n }\n\n return value;\n }\n\n static makeLayoutAxis(\n type: AxisType,\n theme = ChartTheme\n ): Partial<LayoutAxis> {\n const axis = {\n automargin: true,\n gridcolor: theme.gridcolor,\n linecolor: theme.linecolor,\n rangeslider: { visible: false },\n showline: true,\n ticklen: 5, // act as padding, can't find a tick padding\n tickcolor: theme.paper_bgcolor, // hide ticks as padding\n tickfont: {\n color: theme.zerolinecolor,\n },\n title: {\n font: {\n color: theme.title_color,\n },\n },\n };\n\n if (type === dh.plot.AxisType.X) {\n Object.assign(axis, {\n showgrid: true,\n });\n } else if (type === dh.plot.AxisType.Y) {\n Object.assign(axis, {\n zerolinecolor: theme.zerolinecolor,\n zerolinewidth: 2,\n });\n }\n\n return axis;\n }\n\n /**\n * Parses the colorway property of a theme and returns an array of colors\n * Theme could have a single string with space separated colors or an array of strings representing the colorway\n * @param theme The theme to get colorway from\n * @returns Colorway array for the theme\n */\n static getColorwayFromTheme(theme = ChartTheme): string[] {\n let colorway: string[] = [];\n if (theme.colorway) {\n if (Array.isArray(theme.colorway)) {\n colorway = theme.colorway;\n } else if (typeof theme.colorway === 'string') {\n colorway = theme.colorway.split(' ');\n } else {\n log.warn(`Unable to handle colorway property: ${theme.colorway}`);\n }\n }\n\n return colorway;\n }\n\n static makeDefaultLayout(theme = ChartTheme): Partial<Layout> {\n const layout: Partial<Layout> = {\n ...theme,\n autosize: true,\n colorway: ChartUtils.getColorwayFromTheme(theme),\n font: {\n family: \"'Fira Sans', sans-serif\",\n },\n title: {\n font: {\n color: theme.title_color,\n },\n yanchor: 'top',\n pad: { ...ChartUtils.DEFAULT_TITLE_PADDING },\n y: 1,\n },\n legend: {\n font: {\n color: theme.title_color,\n },\n },\n margin: { ...ChartUtils.DEFAULT_MARGIN },\n xaxis: ChartUtils.makeLayoutAxis(dh.plot.AxisType.X, theme),\n yaxis: ChartUtils.makeLayoutAxis(dh.plot.AxisType.Y, theme),\n };\n layout.datarevision = 0;\n return layout;\n }\n\n /**\n * Hydrate settings from a JSONable object\n * @param settings Dehydrated settings\n */\n static hydrateSettings(\n settings: ChartModelSettings\n ): Omit<ChartModelSettings, 'type'> & { type: SeriesPlotStyle } {\n return {\n ...settings,\n type: dh.plot.SeriesPlotStyle[settings.type],\n };\n }\n\n static titleFromSettings(settings: ChartModelSettings): string {\n const {\n series,\n xAxis,\n title = `${series.join(', ')} by ${xAxis}`,\n } = settings;\n\n return title;\n }\n\n /**\n * Creates the Figure settings from the Chart Builder settings\n * This should be deprecated at some point, and have Chart Builder create the figure settings directly.\n * This logic will still need to exist to translate existing charts, but could be part of a migration script\n * to translate the data.\n * Change when we decide to add more functionality to the Chart Builder.\n * @param settings The chart builder settings\n * @param settings.title The title for this figure\n * @param settings.xAxis The name of the column to use for the x-axis\n * @param settings.series The name of the columns to use for the series of this figure\n * @param settings.type The plot style for this figure\n */\n static makeFigureSettings(\n settings: ChartModelSettings,\n table: TableTemplate\n ): {\n charts: {\n chartType: string;\n axes: { formatType: string; type: string; position: string }[];\n series: {\n plotStyle: string;\n name: string;\n dataSources: {\n type: string;\n columnName: string;\n axis: { formatType: string; type: string; position: string };\n table: TableTemplate;\n }[];\n }[];\n }[];\n title: string;\n } {\n const { series, xAxis: settingsAxis, type } = settings;\n const title = ChartUtils.titleFromSettings(settings);\n const xAxis = {\n formatType: `${dh.plot.AxisFormatType.NUMBER}`,\n type: `${dh.plot.AxisType.X}`,\n position: `${dh.plot.AxisPosition.BOTTOM}`,\n };\n const yAxis = {\n formatType: `${dh.plot.AxisFormatType.NUMBER}`,\n type: `${dh.plot.AxisType.Y}`,\n position: `${dh.plot.AxisPosition.LEFT}`,\n };\n\n return {\n charts: [\n {\n chartType: `${dh.plot.ChartType.XY}`,\n axes: [xAxis, yAxis],\n series: series.map(name => ({\n plotStyle: `${type}`,\n name,\n dataSources: [\n {\n type: `${dh.plot.SourceType.X}`,\n columnName: settingsAxis,\n axis: xAxis,\n table,\n },\n {\n type: `${dh.plot.SourceType.Y}`,\n columnName: name,\n axis: yAxis,\n table,\n },\n ],\n })),\n },\n ],\n title,\n };\n }\n}\n\nexport default ChartUtils;\n"],"mappings":";;;;;;AAAA,OAAOA,GAAP,MAAgB,gBAAhB;AACA,SAIEC,UAJF,QAKO,wBALP;AAMA,OAAOC,EAAP,MAeO,uBAfP;AAgBA,OAAOC,GAAP,MAAgB,YAAhB;AAWA,SAASC,aAAT,QAAqC,kBAArC;OACOC,U;AA+DP,IAAMC,GAAG,GAAGN,GAAG,CAACO,MAAJ,CAAW,YAAX,CAAZ;AAEA,IAAMC,IAAI,GAAGC,MAAM,CAACC,MAAP,CAAcR,EAAE,CAACS,QAAH,CAAYC,SAAZ,CAAsBC,MAAtB,EAAd,CAAb;AAEA,IAAMC,oBAAoB,GAAG,4BAA7B;AAEA,IAAMC,eAAe,GAAG,OAAxB;AAEA,IAAM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IAAI;IAejD,uBAAuB,CAAC,KAAK,EAAE;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI;IAQxD,aAAa,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI;IAMlC,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IA4B7B,YAAY,IAAI,MAAM;IAatB,aAAa,IAAI,MAAM;IAavB,mBAAmB,IAAI,IAAI;IAkB3B;;OAEG;IACH,mBAAmB,IAAI,IAAI;IAsB3B;;;;;OAKG;IACH,qBAAqB,CACnB,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,UAAU,EACtB,SAAS,EAAE,OAAO,EAAE,GACnB,IAAI;IAWP;;;;;OAKG;IACH,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAyCjC,OAAO,IAAI,OAAO,CAAC,QAAQ,CAAC,EAAE;IAI9B,SAAS,IAAI,OAAO,CAAC,MAAM,CAAC;IAI5B,kBAAkB,IAAI,eAAe;IAIrC,gBAAgB,IAAI,OAAO;IAO3B;;;OAGG;IACH,SAAS,CAAC,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI;IA2B/C,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAc/B,cAAc,CAAC,QAAQ,EAAE,OAAO,CAAC,kBAAkB,CAAC,GAAG,IAAI;CAG5D;AAED,eAAe,gBAAgB,CAAC"}
|
package/dist/FigureChartModel.js
CHANGED
|
@@ -202,7 +202,7 @@ class FigureChartModel extends ChartModel {
|
|
|
202
202
|
|
|
203
203
|
this.layout.showlegend = this.data.length > 1 || series.plotStyle === dh.plot.SeriesPlotStyle.PIE;
|
|
204
204
|
|
|
205
|
-
if (series.oneClick) {
|
|
205
|
+
if (series.oneClick != null) {
|
|
206
206
|
var {
|
|
207
207
|
oneClick
|
|
208
208
|
} = series;
|
|
@@ -472,9 +472,10 @@ class FigureChartModel extends ChartModel {
|
|
|
472
472
|
var axisFormats = ChartUtils.getAxisFormats(this.figure, this.formatter);
|
|
473
473
|
axisFormats.forEach((axisFormat, axisLayoutProperty) => {
|
|
474
474
|
log.debug("Assigning ".concat(axisLayoutProperty), this.layout[axisLayoutProperty], axisFormat);
|
|
475
|
+
var props = this.layout[axisLayoutProperty];
|
|
475
476
|
|
|
476
|
-
if (
|
|
477
|
-
Object.assign(
|
|
477
|
+
if (props != null) {
|
|
478
|
+
Object.assign(props, axisFormat);
|
|
478
479
|
} else {
|
|
479
480
|
log.debug("Ignoring null layout.".concat(axisLayoutProperty));
|
|
480
481
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FigureChartModel.js","names":["memoize","debounce","set","dh","Log","ChartModel","ChartUtils","ChartTheme","log","module","FigureChartModel","constructor","figure","settings","theme","pendingSeries","i","length","series","addSeries","subscribe","ADD_SERIES_DEBOUNCE","columnType","formatter","dataFormatter","getColumnTypeFormatter","dhTimeZone","timeZone","getTimeZone","value","unwrapValue","wrapValue","range","rangeStart","rangeEnd","valueParser","getValueParser","chart","axis","source","getSourceForAxis","getRangeParser","handleFigureUpdated","bind","handleFigureDisconnected","handleFigureReconnected","handleFigureSeriesAdded","handleDownsampleStart","handleDownsampleFinish","handleDownsampleFail","handleDownsampleNeeded","handleRequestFailed","data","layout","makeDefaultLayout","seriesDataMap","Map","oneClicks","filterColumnMap","lastFilter","isConnected","seriesToProcess","Set","setTitle","getDefaultTitle","initAllSeries","updateAxisPositions","startListeningFigure","close","addPendingSeries","cancel","stopListeningFigure","charts","title","clear","activeSeriesNames","j","push","name","allSeriesNames","keys","inactiveSeriesNames","filter","seriesName","indexOf","delete","getChartForSeries","error","axisTypeMap","groupArray","axes","seriesData","makeSeriesDataFromSeries","getSeriesVisibility","values","plotStyle","plot","SeriesPlotStyle","STACKED_BAR","barmode","PIE","hiddenlabels","getHiddenLabels","showlegend","oneClick","columns","updateLayoutFormats","callback","listeners","subscribeFigure","unsubscribe","unsubscribeFigure","debug","isDownsamplingDisabled","DownsampleOptions","DISABLE","DEFAULT","addEventListener","Figure","EVENT_UPDATED","EVENT_SERIES_ADDED","EVENT_DISCONNECT","EVENT_RECONNECT","EVENT_DOWNSAMPLESTARTED","EVENT_DOWNSAMPLEFINISHED","EVENT_DOWNSAMPLEFAILED","EVENT_DOWNSAMPLENEEDED","Client","EVENT_REQUEST_FAILED","removeEventListener","event","fireDownsampleStart","detail","fireDownsampleFinish","fireDownsampleFail","info","fireDownsampleNeeded","figureUpdateEvent","seriesArray","debug2","sources","type","valueTranslator","getValueTranslator","dataArray","getArray","setDataArrayForSeries","size","fireLoadFinished","cleanSeries","fireUpdate","resubscribe","setFormatter","setDownsamplingDisabled","fireDisconnect","fireReconnect","setDimensions","rect","subtitleCount","match","margin","DEFAULT_MARGIN","t","SUBTITLE_LINE_HEIGHT","text","pad","DEFAULT_TITLE_PADDING","getPlotWidth","width","Math","max","l","r","getPlotHeight","height","b","plotWidth","plotHeight","axisRangeParser","getAxisRangeParser","updateLayoutAxes","axisFormats","getAxisFormats","forEach","axisFormat","axisLayoutProperty","Object","assign","sourceType","get","property","getPlotlyProperty","HISTOGRAM","xLow","xHigh","LINE","x","y","yLow","yHigh","error_x","getPlotlyErrorBars","error_y","TREEMAP","ids","labels","undefined","getData","getLayout","getFilterColumnMap","isFilterRequired","find","requireAllFiltersToDisplay","setFilter","filterMap","warn","key","column","setValueForColumn","setFigure","updateSettings"],"sources":["../src/FigureChartModel.ts"],"sourcesContent":["/* eslint class-methods-use-this: \"off\" */\nimport memoize from 'memoizee';\nimport debounce from 'lodash.debounce';\nimport set from 'lodash.set';\nimport dh, {\n Axis,\n Chart,\n Figure,\n OneClick,\n Series,\n SourceType,\n} from '@deephaven/jsapi-shim';\nimport Log from '@deephaven/log';\nimport { Range } from '@deephaven/utils';\nimport { Layout, PlotData } from 'plotly.js';\nimport { Formatter } from '@deephaven/jsapi-utils';\nimport ChartModel, { ChartEvent, FilterColumnMap } from './ChartModel';\nimport ChartUtils, { AxisTypeMap, ChartModelSettings } from './ChartUtils';\nimport ChartTheme from './ChartTheme';\n\nconst log = Log.module('FigureChartModel');\n\n/**\n * Takes a Figure object from a widget to make a model for a chart\n */\nclass FigureChartModel extends ChartModel {\n static ADD_SERIES_DEBOUNCE = 50;\n\n /**\n * @param figure The figure object created by the API\n * @param settings Chart settings\n */\n constructor(\n figure: Figure,\n settings: Partial<ChartModelSettings> = {},\n theme: typeof ChartTheme = ChartTheme\n ) {\n super();\n\n this.handleFigureUpdated = this.handleFigureUpdated.bind(this);\n this.handleFigureDisconnected = this.handleFigureDisconnected.bind(this);\n this.handleFigureReconnected = this.handleFigureReconnected.bind(this);\n this.handleFigureSeriesAdded = this.handleFigureSeriesAdded.bind(this);\n this.handleDownsampleStart = this.handleDownsampleStart.bind(this);\n this.handleDownsampleFinish = this.handleDownsampleFinish.bind(this);\n this.handleDownsampleFail = this.handleDownsampleFail.bind(this);\n this.handleDownsampleNeeded = this.handleDownsampleNeeded.bind(this);\n this.handleRequestFailed = this.handleRequestFailed.bind(this);\n // We need to debounce adding series so we subscribe to them all in the same tick\n // This should no longer be necessary after IDS-5049 lands\n\n this.figure = figure;\n this.settings = settings;\n this.theme = theme;\n this.data = [];\n this.layout = ChartUtils.makeDefaultLayout(theme);\n this.seriesDataMap = new Map();\n this.pendingSeries = [];\n this.oneClicks = [];\n this.filterColumnMap = new Map();\n this.lastFilter = new Map();\n this.isConnected = true; // Assume figure is connected to start\n this.seriesToProcess = new Set();\n\n this.setTitle(this.getDefaultTitle());\n this.initAllSeries();\n this.updateAxisPositions();\n this.startListeningFigure();\n }\n\n figure: Figure;\n\n settings: Partial<ChartModelSettings>;\n\n theme: typeof ChartTheme;\n\n data: Partial<PlotData>[];\n\n layout: Partial<Layout>;\n\n seriesDataMap: Map<\n string,\n Partial<PlotData> & {\n xLow?: number[];\n xHigh?: number[];\n yLow?: number[];\n yHigh?: number[];\n }\n >;\n\n pendingSeries: Series[];\n\n oneClicks: OneClick[];\n\n filterColumnMap: FilterColumnMap;\n\n lastFilter: Map<string, string>;\n\n isConnected: boolean; // Assume figure is connected to start\n\n seriesToProcess;\n\n close(): void {\n this.figure.close();\n this.addPendingSeries.cancel();\n this.stopListeningFigure();\n }\n\n getDefaultTitle(): string {\n if (this.figure.charts.length > 0) {\n const chart = this.figure.charts[0];\n return chart.title;\n }\n\n return '';\n }\n\n initAllSeries(): void {\n this.oneClicks = [];\n this.filterColumnMap.clear();\n\n const { charts } = this.figure;\n const activeSeriesNames: string[] = [];\n for (let i = 0; i < charts.length; i += 1) {\n const chart = charts[i];\n\n for (let j = 0; j < chart.series.length; j += 1) {\n const series = chart.series[j];\n activeSeriesNames.push(series.name);\n this.addSeries(series);\n }\n }\n\n // Remove any series that no longer exist\n const allSeriesNames = [...this.seriesDataMap.keys()];\n const inactiveSeriesNames = allSeriesNames.filter(\n seriesName => activeSeriesNames.indexOf(seriesName) < 0\n );\n for (let i = 0; i < inactiveSeriesNames.length; i += 1) {\n const seriesName = inactiveSeriesNames[i];\n this.seriesDataMap.delete(seriesName);\n }\n this.seriesToProcess = new Set([...this.seriesDataMap.keys()]);\n }\n\n addSeries(series: Series): void {\n const chart = ChartUtils.getChartForSeries(this.figure, series);\n if (chart == null) {\n log.error('Unable to find matching chart for series', series);\n return;\n }\n\n const axisTypeMap: AxisTypeMap = ChartUtils.groupArray(chart.axes, 'type');\n\n const seriesData = ChartUtils.makeSeriesDataFromSeries(\n series,\n axisTypeMap,\n ChartUtils.getSeriesVisibility(series.name, this.settings),\n this.theme\n );\n\n this.seriesDataMap.set(series.name, seriesData);\n\n this.data = [...this.seriesDataMap.values()];\n\n if (series.plotStyle === dh.plot.SeriesPlotStyle.STACKED_BAR) {\n this.layout.barmode = 'stack';\n } else if (series.plotStyle === dh.plot.SeriesPlotStyle.PIE) {\n this.layout.hiddenlabels = ChartUtils.getHiddenLabels(this.settings);\n }\n\n this.layout.showlegend =\n this.data.length > 1 || series.plotStyle === dh.plot.SeriesPlotStyle.PIE;\n\n if (series.oneClick) {\n const { oneClick } = series;\n const { columns } = oneClick;\n for (let i = 0; i < columns.length; i += 1) {\n this.filterColumnMap.set(columns[i].name, columns[i]);\n }\n\n this.oneClicks.push(oneClick);\n }\n\n this.updateLayoutFormats();\n }\n\n addPendingSeries = debounce(() => {\n const { pendingSeries } = this;\n for (let i = 0; i < pendingSeries.length; i += 1) {\n const series = pendingSeries[i];\n this.addSeries(series);\n\n series.subscribe();\n // We'll get an update with the data after subscribing\n }\n\n this.pendingSeries = [];\n }, FigureChartModel.ADD_SERIES_DEBOUNCE);\n\n subscribe(callback: (event: ChartEvent) => void): void {\n super.subscribe(callback);\n\n if (this.listeners.length === 1) {\n // Need to initialize the series here as we may have missed some series when not subscribed\n this.initAllSeries();\n this.subscribeFigure();\n }\n }\n\n unsubscribe(callback: (event: ChartEvent) => void): void {\n super.unsubscribe(callback);\n\n if (this.listeners.length === 0) {\n this.unsubscribeFigure();\n }\n }\n\n subscribeFigure(): void {\n if (!this.isConnected) {\n log.debug('Ignoring subscribe when figure in disconnected state');\n return;\n }\n\n this.figure.subscribe(\n this.isDownsamplingDisabled\n ? dh.plot.DownsampleOptions.DISABLE\n : dh.plot.DownsampleOptions.DEFAULT\n );\n }\n\n unsubscribeFigure(): void {\n this.figure.unsubscribe();\n }\n\n startListeningFigure(): void {\n this.figure.addEventListener(\n dh.plot.Figure.EVENT_UPDATED,\n this.handleFigureUpdated\n );\n this.figure.addEventListener(\n dh.plot.Figure.EVENT_SERIES_ADDED,\n this.handleFigureSeriesAdded\n );\n this.figure.addEventListener(\n dh.plot.Figure.EVENT_DISCONNECT,\n this.handleFigureDisconnected\n );\n this.figure.addEventListener(\n dh.plot.Figure.EVENT_RECONNECT,\n this.handleFigureReconnected\n );\n this.figure.addEventListener(\n dh.plot.Figure.EVENT_DOWNSAMPLESTARTED,\n this.handleDownsampleStart\n );\n this.figure.addEventListener(\n dh.plot.Figure.EVENT_DOWNSAMPLEFINISHED,\n this.handleDownsampleFinish\n );\n this.figure.addEventListener(\n dh.plot.Figure.EVENT_DOWNSAMPLEFAILED,\n this.handleDownsampleFail\n );\n this.figure.addEventListener(\n dh.plot.Figure.EVENT_DOWNSAMPLENEEDED,\n this.handleDownsampleNeeded\n );\n this.figure.addEventListener(\n dh.Client.EVENT_REQUEST_FAILED,\n this.handleRequestFailed\n );\n }\n\n stopListeningFigure(): void {\n this.figure.removeEventListener(\n dh.plot.Figure.EVENT_UPDATED,\n this.handleFigureUpdated\n );\n this.figure.removeEventListener(\n dh.plot.Figure.EVENT_SERIES_ADDED,\n this.handleFigureSeriesAdded\n );\n this.figure.removeEventListener(\n dh.plot.Figure.EVENT_DISCONNECT,\n this.handleFigureDisconnected\n );\n this.figure.removeEventListener(\n dh.plot.Figure.EVENT_RECONNECT,\n this.handleFigureReconnected\n );\n this.figure.removeEventListener(\n dh.plot.Figure.EVENT_DOWNSAMPLESTARTED,\n this.handleDownsampleStart\n );\n this.figure.removeEventListener(\n dh.plot.Figure.EVENT_DOWNSAMPLEFINISHED,\n this.handleDownsampleFinish\n );\n this.figure.removeEventListener(\n dh.plot.Figure.EVENT_DOWNSAMPLEFAILED,\n this.handleDownsampleFail\n );\n this.figure.removeEventListener(\n dh.plot.Figure.EVENT_DOWNSAMPLENEEDED,\n this.handleDownsampleNeeded\n );\n this.figure.removeEventListener(\n dh.Client.EVENT_REQUEST_FAILED,\n this.handleRequestFailed\n );\n }\n\n getTimeZone = memoize((columnType, formatter) => {\n if (formatter != null) {\n const dataFormatter = formatter.getColumnTypeFormatter(columnType);\n if (dataFormatter != null) {\n return dataFormatter.dhTimeZone;\n }\n }\n return null;\n });\n\n getValueTranslator = memoize((columnType, formatter) => {\n const timeZone = this.getTimeZone(columnType, formatter);\n return (value: unknown) => ChartUtils.unwrapValue(value, timeZone);\n });\n\n /** Gets the parser for a value with the provided column type */\n getValueParser = memoize((columnType, formatter) => {\n const timeZone = this.getTimeZone(columnType, formatter);\n return (value: unknown) =>\n ChartUtils.wrapValue(value, columnType, timeZone);\n });\n\n /**\n * Gets the range parser for a particular column type\n */\n getRangeParser = memoize(\n (columnType: string, formatter?: Formatter) => (range: Range) => {\n let [rangeStart, rangeEnd]: [unknown, unknown] = range;\n const valueParser = this.getValueParser(columnType, formatter);\n rangeStart = valueParser(rangeStart);\n rangeEnd = valueParser(rangeEnd);\n return [rangeStart, rangeEnd];\n }\n );\n\n /**\n * Gets the parser for parsing the range from an axis within the given chart\n */\n getAxisRangeParser = memoize(\n (chart: Chart, formatter?: Formatter) => (axis: Axis) => {\n const source = ChartUtils.getSourceForAxis(chart, axis);\n if (source) {\n return this.getRangeParser(source.columnType, formatter);\n }\n\n return (range: [unknown, unknown]) => range;\n }\n );\n\n handleDownsampleStart(event: ChartEvent): void {\n log.debug('Downsample started', event);\n\n this.fireDownsampleStart(event.detail);\n }\n\n handleDownsampleFinish(event: ChartEvent): void {\n log.debug('Downsample finished', event);\n\n this.fireDownsampleFinish(event.detail);\n }\n\n handleDownsampleFail(event: ChartEvent): void {\n log.error('Downsample failed', event);\n\n this.fireDownsampleFail(event.detail);\n }\n\n handleDownsampleNeeded(event: ChartEvent): void {\n log.info('Downsample needed', event);\n\n this.fireDownsampleNeeded(event.detail);\n }\n\n handleFigureUpdated(event: ChartEvent): void {\n const { detail: figureUpdateEvent } = event;\n const { series: seriesArray } = figureUpdateEvent;\n\n log.debug2('handleFigureUpdated', seriesArray);\n\n for (let i = 0; i < seriesArray.length; i += 1) {\n const series = seriesArray[i];\n\n log.debug2('handleFigureUpdated updating series', series.name);\n\n const { sources } = series;\n for (let j = 0; j < sources.length; j += 1) {\n const source = sources[j];\n const { columnType, type } = source;\n const valueTranslator = this.getValueTranslator(\n columnType,\n this.formatter\n );\n const dataArray = figureUpdateEvent.getArray(\n series,\n type,\n valueTranslator\n );\n this.setDataArrayForSeries(series, type, dataArray);\n }\n\n this.seriesToProcess.delete(series.name);\n if (this.seriesToProcess.size === 0) {\n this.fireLoadFinished();\n }\n\n this.cleanSeries(series);\n }\n\n const { data } = this;\n this.fireUpdate(data);\n }\n\n handleRequestFailed(event: ChartEvent): void {\n log.error('Request failed', event);\n }\n\n /**\n * Resubscribe to the figure, should be done if settings change\n */\n resubscribe(): void {\n if (this.listeners.length > 0) {\n this.unsubscribeFigure();\n this.subscribeFigure();\n }\n }\n\n setFormatter(formatter: Formatter): void {\n super.setFormatter(formatter);\n\n this.updateLayoutFormats();\n\n // Unsubscribe and resubscribe to trigger a data update\n // Data may need to be translated again because of the new formatter\n this.resubscribe();\n }\n\n setDownsamplingDisabled(isDownsamplingDisabled: boolean): void {\n super.setDownsamplingDisabled(isDownsamplingDisabled);\n\n this.resubscribe();\n }\n\n handleFigureDisconnected(event: CustomEvent): void {\n log.debug('Figure disconnected', event);\n\n this.isConnected = false;\n\n if (this.listeners.length > 0) {\n this.unsubscribeFigure();\n }\n\n this.fireDisconnect();\n }\n\n handleFigureReconnected(event: CustomEvent): void {\n log.debug('Figure reconnected', event);\n\n this.isConnected = true;\n\n // It's possible the series have changed completely, as the query could have been changed\n this.initAllSeries();\n\n this.fireReconnect();\n\n if (this.listeners.length > 0) {\n this.subscribeFigure();\n }\n }\n\n handleFigureSeriesAdded(event: { detail: Series }): void {\n const { detail: series } = event;\n log.debug('handleFigureSeriesAdded', series);\n\n this.pendingSeries.push(series);\n this.addPendingSeries();\n }\n\n setDimensions(rect: DOMRect): void {\n super.setDimensions(rect);\n\n this.updateAxisPositions();\n }\n\n setTitle(title: string): void {\n super.setTitle(title);\n\n // Need to recalculate the padding based on how many lines of text the title is\n // Plotly doesn't handle positioning it correctly, and it's an undocumented feature\n const subtitleCount = (title ?? '').match(/<br>/g)?.length ?? 0;\n const margin =\n ChartUtils.DEFAULT_MARGIN.t +\n subtitleCount * ChartUtils.SUBTITLE_LINE_HEIGHT;\n\n if (this.layout.margin) {\n this.layout.margin.t = margin;\n } else {\n this.layout.margin = { t: margin };\n }\n\n if (typeof this.layout.title === 'string') {\n this.layout.title = title;\n } else {\n this.layout.title = { ...this.layout.title };\n this.layout.title.text = title;\n this.layout.title.pad = { ...this.layout.title.pad };\n this.layout.title.pad.t =\n ChartUtils.DEFAULT_TITLE_PADDING.t +\n subtitleCount * ChartUtils.SUBTITLE_LINE_HEIGHT * 0.5;\n }\n }\n\n getPlotWidth(): number {\n if (!this.rect || !this.rect.width) {\n return 0;\n }\n\n return Math.max(\n this.rect.width -\n (this.layout.margin?.l ?? 0) -\n (this.layout.margin?.r ?? 0),\n 0\n );\n }\n\n getPlotHeight(): number {\n if (!this.rect || !this.rect.height) {\n return 0;\n }\n\n return Math.max(\n this.rect.height -\n (this.layout.margin?.t ?? 0) -\n (this.layout.margin?.b ?? 0),\n 0\n );\n }\n\n updateAxisPositions(): void {\n const plotWidth = this.getPlotWidth();\n const plotHeight = this.getPlotHeight();\n\n for (let i = 0; i < this.figure.charts.length; i += 1) {\n const chart = this.figure.charts[i];\n const axisRangeParser = this.getAxisRangeParser(chart, this.formatter);\n ChartUtils.updateLayoutAxes(\n this.layout,\n chart.axes,\n plotWidth,\n plotHeight,\n axisRangeParser,\n this.theme\n );\n }\n }\n\n /**\n * Updates the format patterns used\n */\n updateLayoutFormats(): void {\n if (!this.formatter) {\n return;\n }\n\n const axisFormats = ChartUtils.getAxisFormats(this.figure, this.formatter);\n axisFormats.forEach((axisFormat, axisLayoutProperty) => {\n log.debug(\n `Assigning ${axisLayoutProperty}`,\n this.layout[axisLayoutProperty],\n axisFormat\n );\n if (this.layout[axisLayoutProperty] != null) {\n Object.assign(this.layout[axisLayoutProperty], axisFormat);\n } else {\n log.debug(`Ignoring null layout.${axisLayoutProperty}`);\n }\n });\n }\n\n /**\n * Set a specific array for the array of series properties specified.\n * @param series The series to set the data array for.\n * @param sourceType The source type within that series to set the data for.\n * @param dataArray The array to use for the data for this series source.\n */\n setDataArrayForSeries(\n series: Series,\n sourceType: SourceType,\n dataArray: unknown[]\n ): void {\n const { name, plotStyle } = series;\n\n const seriesData = this.seriesDataMap.get(name);\n const property = ChartUtils.getPlotlyProperty(plotStyle, sourceType);\n\n if (seriesData) {\n set(seriesData, property, dataArray);\n }\n }\n\n /**\n * After setting all the data in the series data, we may need to adjust some other properties\n * Eg. Calculating the width from the xLow/xHigh values; Plot.ly uses `width` instead of a low/high\n * value for x.\n * @param series The series to clean the data for\n */\n cleanSeries(series: Series): void {\n const { name, plotStyle } = series;\n const seriesData = this.seriesDataMap.get(name);\n if (seriesData == null) {\n return;\n }\n if (plotStyle === dh.plot.SeriesPlotStyle.HISTOGRAM) {\n const { xLow, xHigh } = seriesData;\n if (xLow && xHigh && xLow.length === xHigh.length) {\n const width = [];\n for (let i = 0; i < xLow.length; i += 1) {\n width.push(xHigh[i] - xLow[i]);\n }\n seriesData.width = width;\n }\n } else if (plotStyle === dh.plot.SeriesPlotStyle.LINE) {\n const { x, xLow, xHigh, y, yLow, yHigh } = seriesData;\n if (xLow && xHigh && xLow !== x) {\n seriesData.error_x = ChartUtils.getPlotlyErrorBars(\n x as number[],\n xLow,\n xHigh\n );\n }\n if (yLow && yHigh && yLow !== y) {\n seriesData.error_y = ChartUtils.getPlotlyErrorBars(\n y as number[],\n yLow,\n yHigh\n );\n }\n } else if (plotStyle === dh.plot.SeriesPlotStyle.TREEMAP) {\n const { ids, labels } = seriesData;\n if (ids !== undefined && labels === undefined) {\n // If the user only provided IDs, we assign the IDs to the labels property as well automatically\n // Plotly uses the labels primarily, which from our API perspective seems kind of backwards\n seriesData.labels = ids;\n }\n }\n }\n\n getData(): Partial<PlotData>[] {\n return this.data;\n }\n\n getLayout(): Partial<Layout> {\n return this.layout;\n }\n\n getFilterColumnMap(): FilterColumnMap {\n return new Map(this.filterColumnMap);\n }\n\n isFilterRequired(): boolean {\n return (\n this.oneClicks.find(oneClick => oneClick.requireAllFiltersToDisplay) !=\n null\n );\n }\n\n /**\n * Sets the filter on the model. Will only set the values that have changed.\n * @param filterMap Map of filter column names to values\n */\n setFilter(filterMap: Map<string, string>): void {\n if (this.oneClicks.length === 0) {\n log.warn('Trying to set a filter, but no one click!');\n return;\n }\n\n log.debug('setFilter', filterMap);\n\n for (let i = 0; i < this.oneClicks.length; i += 1) {\n const oneClick = this.oneClicks[i];\n const { columns } = oneClick;\n // Need to get all the keys in case a filter was removed\n const keys = new Set([...filterMap.keys(), ...this.lastFilter.keys()]);\n keys.forEach(key => {\n const value = filterMap.get(key);\n if (\n this.lastFilter.get(key) !== value &&\n columns.find(column => column.name === key) != null\n ) {\n oneClick.setValueForColumn(key, value);\n }\n });\n }\n\n this.lastFilter = new Map(filterMap);\n }\n\n setFigure(figure: Figure): void {\n this.close();\n\n this.figure = figure;\n\n this.setTitle(this.getDefaultTitle());\n this.initAllSeries();\n this.updateAxisPositions();\n this.startListeningFigure();\n if (this.listeners.length > 0) {\n this.subscribeFigure();\n }\n }\n\n updateSettings(settings: Partial<ChartModelSettings>): void {\n this.settings = settings;\n }\n}\n\nexport default FigureChartModel;\n"],"mappings":";;;;;;AAAA;AACA,OAAOA,OAAP,MAAoB,UAApB;AACA,OAAOC,QAAP,MAAqB,iBAArB;AACA,OAAOC,GAAP,MAAgB,YAAhB;AACA,OAAOC,EAAP,MAOO,uBAPP;AAQA,OAAOC,GAAP,MAAgB,gBAAhB;OAIOC,U;OACAC,U;OACAC,U;AAEP,IAAMC,GAAG,GAAGJ,GAAG,CAACK,MAAJ,CAAW,kBAAX,CAAZ;AAEA;AACA;AACA;;AACA,MAAMC,gBAAN,SAA+BL,UAA/B,CAA0C;EAGxC;AACF;AACA;AACA;EACEM,WAAW,CACTC,MADS,EAIT;IAAA,IAFAC,QAEA,uEAFwC,EAExC;IAAA,IADAC,KACA,uEAD2BP,UAC3B;IACA;;IADA;;IAAA;;IAAA;;IAAA;;IAAA;;IAAA;;IAAA;;IAAA;;IAAA;;IAAA;;IAAA;;IAAA;;IAAA,0CAuJiBN,QAAQ,CAAC,MAAM;MAChC,IAAM;QAAEc;MAAF,IAAoB,IAA1B;;MACA,KAAK,IAAIC,CAAC,GAAG,CAAb,EAAgBA,CAAC,GAAGD,aAAa,CAACE,MAA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d;;QACA,IACE,KAAI,CAAC7J,UAAL,CAAgBkI,GAAhB,CAAoB2B,GAApB,MAA6B3L,KAA7B,IACA4E,OAAO,CAAC0G,IAAR,CAAaM,MAAM,IAAIA,MAAM,CAAC3I,IAAP,KAAgB0I,GAAvC,KAA+C,IAFjD,EAGE;UACAhH,QAAQ,CAACkH,iBAAT,CAA2BF,GAA3B,EAAgC3L,KAAhC;QACD;MACF,CARD;IAb4C;;IAQ9C,KAAK,IAAIb,CAAC,GAAG,CAAb,EAAgBA,CAAC,GAAG,KAAKyC,SAAL,CAAexC,MAAnC,EAA2CD,CAAC,IAAI,CAAhD,EAAmD;MAAA,MAA1CA,CAA0C;IAclD;;IAED,KAAK2C,UAAL,GAAkB,IAAIH,GAAJ,CAAQ8J,SAAR,CAAlB;EACD;;EAEDK,SAAS,CAAC/M,MAAD,EAAuB;IAC9B,KAAKwD,KAAL;IAEA,KAAKxD,MAAL,GAAcA,MAAd;IAEA,KAAKmD,QAAL,CAAc,KAAKC,eAAL,EAAd;IACA,KAAKC,aAAL;IACA,KAAKC,mBAAL;IACA,KAAKC,oBAAL;;IACA,IAAI,KAAKyC,SAAL,CAAe3F,MAAf,GAAwB,CAA5B,EAA+B;MAC7B,KAAK4F,eAAL;IACD;EACF;;EAED+G,cAAc,CAAC/M,QAAD,EAA8C;IAC1D,KAAKA,QAAL,GAAgBA,QAAhB;EACD;;AA5rBuC;;gBAApCH,gB,yBACyB,E;;AA8rB/B,eAAeA,gBAAf"}
|
|
1
|
+
{"version":3,"file":"FigureChartModel.js","names":["memoize","debounce","set","dh","Log","ChartModel","ChartUtils","ChartTheme","log","module","FigureChartModel","constructor","figure","settings","theme","pendingSeries","i","length","series","addSeries","subscribe","ADD_SERIES_DEBOUNCE","columnType","formatter","dataFormatter","getColumnTypeFormatter","dhTimeZone","timeZone","getTimeZone","value","unwrapValue","wrapValue","range","rangeStart","rangeEnd","valueParser","getValueParser","chart","axis","source","getSourceForAxis","getRangeParser","handleFigureUpdated","bind","handleFigureDisconnected","handleFigureReconnected","handleFigureSeriesAdded","handleDownsampleStart","handleDownsampleFinish","handleDownsampleFail","handleDownsampleNeeded","handleRequestFailed","data","layout","makeDefaultLayout","seriesDataMap","Map","oneClicks","filterColumnMap","lastFilter","isConnected","seriesToProcess","Set","setTitle","getDefaultTitle","initAllSeries","updateAxisPositions","startListeningFigure","close","addPendingSeries","cancel","stopListeningFigure","charts","title","clear","activeSeriesNames","j","push","name","allSeriesNames","keys","inactiveSeriesNames","filter","seriesName","indexOf","delete","getChartForSeries","error","axisTypeMap","groupArray","axes","seriesData","makeSeriesDataFromSeries","getSeriesVisibility","values","plotStyle","plot","SeriesPlotStyle","STACKED_BAR","barmode","PIE","hiddenlabels","getHiddenLabels","showlegend","oneClick","columns","updateLayoutFormats","callback","listeners","subscribeFigure","unsubscribe","unsubscribeFigure","debug","isDownsamplingDisabled","DownsampleOptions","DISABLE","DEFAULT","addEventListener","Figure","EVENT_UPDATED","EVENT_SERIES_ADDED","EVENT_DISCONNECT","EVENT_RECONNECT","EVENT_DOWNSAMPLESTARTED","EVENT_DOWNSAMPLEFINISHED","EVENT_DOWNSAMPLEFAILED","EVENT_DOWNSAMPLENEEDED","Client","EVENT_REQUEST_FAILED","removeEventListener","event","fireDownsampleStart","detail","fireDownsampleFinish","fireDownsampleFail","info","fireDownsampleNeeded","figureUpdateEvent","seriesArray","debug2","sources","type","valueTranslator","getValueTranslator","dataArray","getArray","setDataArrayForSeries","size","fireLoadFinished","cleanSeries","fireUpdate","resubscribe","setFormatter","setDownsamplingDisabled","fireDisconnect","fireReconnect","setDimensions","rect","subtitleCount","match","margin","DEFAULT_MARGIN","t","SUBTITLE_LINE_HEIGHT","text","pad","DEFAULT_TITLE_PADDING","getPlotWidth","width","Math","max","l","r","getPlotHeight","height","b","plotWidth","plotHeight","axisRangeParser","getAxisRangeParser","updateLayoutAxes","axisFormats","getAxisFormats","forEach","axisFormat","axisLayoutProperty","props","Object","assign","sourceType","get","property","getPlotlyProperty","HISTOGRAM","xLow","xHigh","LINE","x","y","yLow","yHigh","error_x","getPlotlyErrorBars","error_y","TREEMAP","ids","labels","undefined","getData","getLayout","getFilterColumnMap","isFilterRequired","find","requireAllFiltersToDisplay","setFilter","filterMap","warn","key","column","setValueForColumn","setFigure","updateSettings"],"sources":["../src/FigureChartModel.ts"],"sourcesContent":["/* eslint class-methods-use-this: \"off\" */\nimport memoize from 'memoizee';\nimport debounce from 'lodash.debounce';\nimport set from 'lodash.set';\nimport dh, {\n Axis,\n Chart,\n Figure,\n OneClick,\n Series,\n SourceType,\n} from '@deephaven/jsapi-shim';\nimport Log from '@deephaven/log';\nimport { Range } from '@deephaven/utils';\nimport { Layout, PlotData } from 'plotly.js';\nimport { Formatter } from '@deephaven/jsapi-utils';\nimport ChartModel, { ChartEvent, FilterColumnMap } from './ChartModel';\nimport ChartUtils, { AxisTypeMap, ChartModelSettings } from './ChartUtils';\nimport ChartTheme from './ChartTheme';\n\nconst log = Log.module('FigureChartModel');\n\n/**\n * Takes a Figure object from a widget to make a model for a chart\n */\nclass FigureChartModel extends ChartModel {\n static ADD_SERIES_DEBOUNCE = 50;\n\n /**\n * @param figure The figure object created by the API\n * @param settings Chart settings\n */\n constructor(\n figure: Figure,\n settings: Partial<ChartModelSettings> = {},\n theme: typeof ChartTheme = ChartTheme\n ) {\n super();\n\n this.handleFigureUpdated = this.handleFigureUpdated.bind(this);\n this.handleFigureDisconnected = this.handleFigureDisconnected.bind(this);\n this.handleFigureReconnected = this.handleFigureReconnected.bind(this);\n this.handleFigureSeriesAdded = this.handleFigureSeriesAdded.bind(this);\n this.handleDownsampleStart = this.handleDownsampleStart.bind(this);\n this.handleDownsampleFinish = this.handleDownsampleFinish.bind(this);\n this.handleDownsampleFail = this.handleDownsampleFail.bind(this);\n this.handleDownsampleNeeded = this.handleDownsampleNeeded.bind(this);\n this.handleRequestFailed = this.handleRequestFailed.bind(this);\n // We need to debounce adding series so we subscribe to them all in the same tick\n // This should no longer be necessary after IDS-5049 lands\n\n this.figure = figure;\n this.settings = settings;\n this.theme = theme;\n this.data = [];\n this.layout = ChartUtils.makeDefaultLayout(theme);\n this.seriesDataMap = new Map();\n this.pendingSeries = [];\n this.oneClicks = [];\n this.filterColumnMap = new Map();\n this.lastFilter = new Map();\n this.isConnected = true; // Assume figure is connected to start\n this.seriesToProcess = new Set();\n\n this.setTitle(this.getDefaultTitle());\n this.initAllSeries();\n this.updateAxisPositions();\n this.startListeningFigure();\n }\n\n figure: Figure;\n\n settings: Partial<ChartModelSettings>;\n\n theme: typeof ChartTheme;\n\n data: Partial<PlotData>[];\n\n layout: Partial<Layout>;\n\n seriesDataMap: Map<\n string,\n Partial<PlotData> & {\n xLow?: number[];\n xHigh?: number[];\n yLow?: number[];\n yHigh?: number[];\n }\n >;\n\n pendingSeries: Series[];\n\n oneClicks: OneClick[];\n\n filterColumnMap: FilterColumnMap;\n\n lastFilter: Map<string, string>;\n\n isConnected: boolean; // Assume figure is connected to start\n\n seriesToProcess;\n\n close(): void {\n this.figure.close();\n this.addPendingSeries.cancel();\n this.stopListeningFigure();\n }\n\n getDefaultTitle(): string {\n if (this.figure.charts.length > 0) {\n const chart = this.figure.charts[0];\n return chart.title;\n }\n\n return '';\n }\n\n initAllSeries(): void {\n this.oneClicks = [];\n this.filterColumnMap.clear();\n\n const { charts } = this.figure;\n const activeSeriesNames: string[] = [];\n for (let i = 0; i < charts.length; i += 1) {\n const chart = charts[i];\n\n for (let j = 0; j < chart.series.length; j += 1) {\n const series = chart.series[j];\n activeSeriesNames.push(series.name);\n this.addSeries(series);\n }\n }\n\n // Remove any series that no longer exist\n const allSeriesNames = [...this.seriesDataMap.keys()];\n const inactiveSeriesNames = allSeriesNames.filter(\n seriesName => activeSeriesNames.indexOf(seriesName) < 0\n );\n for (let i = 0; i < inactiveSeriesNames.length; i += 1) {\n const seriesName = inactiveSeriesNames[i];\n this.seriesDataMap.delete(seriesName);\n }\n this.seriesToProcess = new Set([...this.seriesDataMap.keys()]);\n }\n\n addSeries(series: Series): void {\n const chart = ChartUtils.getChartForSeries(this.figure, series);\n if (chart == null) {\n log.error('Unable to find matching chart for series', series);\n return;\n }\n\n const axisTypeMap: AxisTypeMap = ChartUtils.groupArray(chart.axes, 'type');\n\n const seriesData = ChartUtils.makeSeriesDataFromSeries(\n series,\n axisTypeMap,\n ChartUtils.getSeriesVisibility(series.name, this.settings),\n this.theme\n );\n\n this.seriesDataMap.set(series.name, seriesData);\n\n this.data = [...this.seriesDataMap.values()];\n\n if (series.plotStyle === dh.plot.SeriesPlotStyle.STACKED_BAR) {\n this.layout.barmode = 'stack';\n } else if (series.plotStyle === dh.plot.SeriesPlotStyle.PIE) {\n this.layout.hiddenlabels = ChartUtils.getHiddenLabels(this.settings);\n }\n\n this.layout.showlegend =\n this.data.length > 1 || series.plotStyle === dh.plot.SeriesPlotStyle.PIE;\n\n if (series.oneClick != null) {\n const { oneClick } = series;\n const { columns } = oneClick;\n for (let i = 0; i < columns.length; i += 1) {\n this.filterColumnMap.set(columns[i].name, columns[i]);\n }\n\n this.oneClicks.push(oneClick);\n }\n\n this.updateLayoutFormats();\n }\n\n addPendingSeries = debounce(() => {\n const { pendingSeries } = this;\n for (let i = 0; i < pendingSeries.length; i += 1) {\n const series = pendingSeries[i];\n this.addSeries(series);\n\n series.subscribe();\n // We'll get an update with the data after subscribing\n }\n\n this.pendingSeries = [];\n }, FigureChartModel.ADD_SERIES_DEBOUNCE);\n\n subscribe(callback: (event: ChartEvent) => void): void {\n super.subscribe(callback);\n\n if (this.listeners.length === 1) {\n // Need to initialize the series here as we may have missed some series when not subscribed\n this.initAllSeries();\n this.subscribeFigure();\n }\n }\n\n unsubscribe(callback: (event: ChartEvent) => void): void {\n super.unsubscribe(callback);\n\n if (this.listeners.length === 0) {\n this.unsubscribeFigure();\n }\n }\n\n subscribeFigure(): void {\n if (!this.isConnected) {\n log.debug('Ignoring subscribe when figure in disconnected state');\n return;\n }\n\n this.figure.subscribe(\n this.isDownsamplingDisabled\n ? dh.plot.DownsampleOptions.DISABLE\n : dh.plot.DownsampleOptions.DEFAULT\n );\n }\n\n unsubscribeFigure(): void {\n this.figure.unsubscribe();\n }\n\n startListeningFigure(): void {\n this.figure.addEventListener(\n dh.plot.Figure.EVENT_UPDATED,\n this.handleFigureUpdated\n );\n this.figure.addEventListener(\n dh.plot.Figure.EVENT_SERIES_ADDED,\n this.handleFigureSeriesAdded\n );\n this.figure.addEventListener(\n dh.plot.Figure.EVENT_DISCONNECT,\n this.handleFigureDisconnected\n );\n this.figure.addEventListener(\n dh.plot.Figure.EVENT_RECONNECT,\n this.handleFigureReconnected\n );\n this.figure.addEventListener(\n dh.plot.Figure.EVENT_DOWNSAMPLESTARTED,\n this.handleDownsampleStart\n );\n this.figure.addEventListener(\n dh.plot.Figure.EVENT_DOWNSAMPLEFINISHED,\n this.handleDownsampleFinish\n );\n this.figure.addEventListener(\n dh.plot.Figure.EVENT_DOWNSAMPLEFAILED,\n this.handleDownsampleFail\n );\n this.figure.addEventListener(\n dh.plot.Figure.EVENT_DOWNSAMPLENEEDED,\n this.handleDownsampleNeeded\n );\n this.figure.addEventListener(\n dh.Client.EVENT_REQUEST_FAILED,\n this.handleRequestFailed\n );\n }\n\n stopListeningFigure(): void {\n this.figure.removeEventListener(\n dh.plot.Figure.EVENT_UPDATED,\n this.handleFigureUpdated\n );\n this.figure.removeEventListener(\n dh.plot.Figure.EVENT_SERIES_ADDED,\n this.handleFigureSeriesAdded\n );\n this.figure.removeEventListener(\n dh.plot.Figure.EVENT_DISCONNECT,\n this.handleFigureDisconnected\n );\n this.figure.removeEventListener(\n dh.plot.Figure.EVENT_RECONNECT,\n this.handleFigureReconnected\n );\n this.figure.removeEventListener(\n dh.plot.Figure.EVENT_DOWNSAMPLESTARTED,\n this.handleDownsampleStart\n );\n this.figure.removeEventListener(\n dh.plot.Figure.EVENT_DOWNSAMPLEFINISHED,\n this.handleDownsampleFinish\n );\n this.figure.removeEventListener(\n dh.plot.Figure.EVENT_DOWNSAMPLEFAILED,\n this.handleDownsampleFail\n );\n this.figure.removeEventListener(\n dh.plot.Figure.EVENT_DOWNSAMPLENEEDED,\n this.handleDownsampleNeeded\n );\n this.figure.removeEventListener(\n dh.Client.EVENT_REQUEST_FAILED,\n this.handleRequestFailed\n );\n }\n\n getTimeZone = memoize((columnType, formatter) => {\n if (formatter != null) {\n const dataFormatter = formatter.getColumnTypeFormatter(columnType);\n if (dataFormatter != null) {\n return dataFormatter.dhTimeZone;\n }\n }\n return null;\n });\n\n getValueTranslator = memoize((columnType, formatter) => {\n const timeZone = this.getTimeZone(columnType, formatter);\n return (value: unknown) => ChartUtils.unwrapValue(value, timeZone);\n });\n\n /** Gets the parser for a value with the provided column type */\n getValueParser = memoize((columnType, formatter) => {\n const timeZone = this.getTimeZone(columnType, formatter);\n return (value: unknown) =>\n ChartUtils.wrapValue(value, columnType, timeZone);\n });\n\n /**\n * Gets the range parser for a particular column type\n */\n getRangeParser = memoize(\n (columnType: string, formatter?: Formatter) => (range: Range) => {\n let [rangeStart, rangeEnd]: [unknown, unknown] = range;\n const valueParser = this.getValueParser(columnType, formatter);\n rangeStart = valueParser(rangeStart);\n rangeEnd = valueParser(rangeEnd);\n return [rangeStart, rangeEnd];\n }\n );\n\n /**\n * Gets the parser for parsing the range from an axis within the given chart\n */\n getAxisRangeParser = memoize(\n (chart: Chart, formatter?: Formatter) => (axis: Axis) => {\n const source = ChartUtils.getSourceForAxis(chart, axis);\n if (source) {\n return this.getRangeParser(source.columnType, formatter);\n }\n\n return (range: [unknown, unknown]) => range;\n }\n );\n\n handleDownsampleStart(event: ChartEvent): void {\n log.debug('Downsample started', event);\n\n this.fireDownsampleStart(event.detail);\n }\n\n handleDownsampleFinish(event: ChartEvent): void {\n log.debug('Downsample finished', event);\n\n this.fireDownsampleFinish(event.detail);\n }\n\n handleDownsampleFail(event: ChartEvent): void {\n log.error('Downsample failed', event);\n\n this.fireDownsampleFail(event.detail);\n }\n\n handleDownsampleNeeded(event: ChartEvent): void {\n log.info('Downsample needed', event);\n\n this.fireDownsampleNeeded(event.detail);\n }\n\n handleFigureUpdated(event: ChartEvent): void {\n const { detail: figureUpdateEvent } = event;\n const { series: seriesArray } = figureUpdateEvent;\n\n log.debug2('handleFigureUpdated', seriesArray);\n\n for (let i = 0; i < seriesArray.length; i += 1) {\n const series = seriesArray[i];\n\n log.debug2('handleFigureUpdated updating series', series.name);\n\n const { sources } = series;\n for (let j = 0; j < sources.length; j += 1) {\n const source = sources[j];\n const { columnType, type } = source;\n const valueTranslator = this.getValueTranslator(\n columnType,\n this.formatter\n );\n const dataArray = figureUpdateEvent.getArray(\n series,\n type,\n valueTranslator\n );\n this.setDataArrayForSeries(series, type, dataArray);\n }\n\n this.seriesToProcess.delete(series.name);\n if (this.seriesToProcess.size === 0) {\n this.fireLoadFinished();\n }\n\n this.cleanSeries(series);\n }\n\n const { data } = this;\n this.fireUpdate(data);\n }\n\n handleRequestFailed(event: ChartEvent): void {\n log.error('Request failed', event);\n }\n\n /**\n * Resubscribe to the figure, should be done if settings change\n */\n resubscribe(): void {\n if (this.listeners.length > 0) {\n this.unsubscribeFigure();\n this.subscribeFigure();\n }\n }\n\n setFormatter(formatter: Formatter): void {\n super.setFormatter(formatter);\n\n this.updateLayoutFormats();\n\n // Unsubscribe and resubscribe to trigger a data update\n // Data may need to be translated again because of the new formatter\n this.resubscribe();\n }\n\n setDownsamplingDisabled(isDownsamplingDisabled: boolean): void {\n super.setDownsamplingDisabled(isDownsamplingDisabled);\n\n this.resubscribe();\n }\n\n handleFigureDisconnected(event: CustomEvent): void {\n log.debug('Figure disconnected', event);\n\n this.isConnected = false;\n\n if (this.listeners.length > 0) {\n this.unsubscribeFigure();\n }\n\n this.fireDisconnect();\n }\n\n handleFigureReconnected(event: CustomEvent): void {\n log.debug('Figure reconnected', event);\n\n this.isConnected = true;\n\n // It's possible the series have changed completely, as the query could have been changed\n this.initAllSeries();\n\n this.fireReconnect();\n\n if (this.listeners.length > 0) {\n this.subscribeFigure();\n }\n }\n\n handleFigureSeriesAdded(event: { detail: Series }): void {\n const { detail: series } = event;\n log.debug('handleFigureSeriesAdded', series);\n\n this.pendingSeries.push(series);\n this.addPendingSeries();\n }\n\n setDimensions(rect: DOMRect): void {\n super.setDimensions(rect);\n\n this.updateAxisPositions();\n }\n\n setTitle(title: string): void {\n super.setTitle(title);\n\n // Need to recalculate the padding based on how many lines of text the title is\n // Plotly doesn't handle positioning it correctly, and it's an undocumented feature\n const subtitleCount = (title ?? '').match(/<br>/g)?.length ?? 0;\n const margin =\n ChartUtils.DEFAULT_MARGIN.t +\n subtitleCount * ChartUtils.SUBTITLE_LINE_HEIGHT;\n\n if (this.layout.margin) {\n this.layout.margin.t = margin;\n } else {\n this.layout.margin = { t: margin };\n }\n\n if (typeof this.layout.title === 'string') {\n this.layout.title = title;\n } else {\n this.layout.title = { ...this.layout.title };\n this.layout.title.text = title;\n this.layout.title.pad = { ...this.layout.title.pad };\n this.layout.title.pad.t =\n ChartUtils.DEFAULT_TITLE_PADDING.t +\n subtitleCount * ChartUtils.SUBTITLE_LINE_HEIGHT * 0.5;\n }\n }\n\n getPlotWidth(): number {\n if (!this.rect || !this.rect.width) {\n return 0;\n }\n\n return Math.max(\n this.rect.width -\n (this.layout.margin?.l ?? 0) -\n (this.layout.margin?.r ?? 0),\n 0\n );\n }\n\n getPlotHeight(): number {\n if (!this.rect || !this.rect.height) {\n return 0;\n }\n\n return Math.max(\n this.rect.height -\n (this.layout.margin?.t ?? 0) -\n (this.layout.margin?.b ?? 0),\n 0\n );\n }\n\n updateAxisPositions(): void {\n const plotWidth = this.getPlotWidth();\n const plotHeight = this.getPlotHeight();\n\n for (let i = 0; i < this.figure.charts.length; i += 1) {\n const chart = this.figure.charts[i];\n const axisRangeParser = this.getAxisRangeParser(chart, this.formatter);\n ChartUtils.updateLayoutAxes(\n this.layout,\n chart.axes,\n plotWidth,\n plotHeight,\n axisRangeParser,\n this.theme\n );\n }\n }\n\n /**\n * Updates the format patterns used\n */\n updateLayoutFormats(): void {\n if (!this.formatter) {\n return;\n }\n\n const axisFormats = ChartUtils.getAxisFormats(this.figure, this.formatter);\n axisFormats.forEach((axisFormat, axisLayoutProperty) => {\n log.debug(\n `Assigning ${axisLayoutProperty}`,\n this.layout[axisLayoutProperty],\n axisFormat\n );\n\n const props = this.layout[axisLayoutProperty];\n if (props != null) {\n Object.assign(props, axisFormat);\n } else {\n log.debug(`Ignoring null layout.${axisLayoutProperty}`);\n }\n });\n }\n\n /**\n * Set a specific array for the array of series properties specified.\n * @param series The series to set the data array for.\n * @param sourceType The source type within that series to set the data for.\n * @param dataArray The array to use for the data for this series source.\n */\n setDataArrayForSeries(\n series: Series,\n sourceType: SourceType,\n dataArray: unknown[]\n ): void {\n const { name, plotStyle } = series;\n\n const seriesData = this.seriesDataMap.get(name);\n const property = ChartUtils.getPlotlyProperty(plotStyle, sourceType);\n\n if (seriesData) {\n set(seriesData, property, dataArray);\n }\n }\n\n /**\n * After setting all the data in the series data, we may need to adjust some other properties\n * Eg. Calculating the width from the xLow/xHigh values; Plot.ly uses `width` instead of a low/high\n * value for x.\n * @param series The series to clean the data for\n */\n cleanSeries(series: Series): void {\n const { name, plotStyle } = series;\n const seriesData = this.seriesDataMap.get(name);\n if (seriesData == null) {\n return;\n }\n if (plotStyle === dh.plot.SeriesPlotStyle.HISTOGRAM) {\n const { xLow, xHigh } = seriesData;\n if (xLow && xHigh && xLow.length === xHigh.length) {\n const width = [];\n for (let i = 0; i < xLow.length; i += 1) {\n width.push(xHigh[i] - xLow[i]);\n }\n seriesData.width = width;\n }\n } else if (plotStyle === dh.plot.SeriesPlotStyle.LINE) {\n const { x, xLow, xHigh, y, yLow, yHigh } = seriesData;\n if (xLow && xHigh && xLow !== x) {\n seriesData.error_x = ChartUtils.getPlotlyErrorBars(\n x as number[],\n xLow,\n xHigh\n );\n }\n if (yLow && yHigh && yLow !== y) {\n seriesData.error_y = ChartUtils.getPlotlyErrorBars(\n y as number[],\n yLow,\n yHigh\n );\n }\n } else if (plotStyle === dh.plot.SeriesPlotStyle.TREEMAP) {\n const { ids, labels } = seriesData;\n if (ids !== undefined && labels === undefined) {\n // If the user only provided IDs, we assign the IDs to the labels property as well automatically\n // Plotly uses the labels primarily, which from our API perspective seems kind of backwards\n seriesData.labels = ids;\n }\n }\n }\n\n getData(): Partial<PlotData>[] {\n return this.data;\n }\n\n getLayout(): Partial<Layout> {\n return this.layout;\n }\n\n getFilterColumnMap(): FilterColumnMap {\n return new Map(this.filterColumnMap);\n }\n\n isFilterRequired(): boolean {\n return (\n this.oneClicks.find(oneClick => oneClick.requireAllFiltersToDisplay) !=\n null\n );\n }\n\n /**\n * Sets the filter on the model. Will only set the values that have changed.\n * @param filterMap Map of filter column names to values\n */\n setFilter(filterMap: Map<string, string>): void {\n if (this.oneClicks.length === 0) {\n log.warn('Trying to set a filter, but no one click!');\n return;\n }\n\n log.debug('setFilter', filterMap);\n\n for (let i = 0; i < this.oneClicks.length; i += 1) {\n const oneClick = this.oneClicks[i];\n const { columns } = oneClick;\n // Need to get all the keys in case a filter was removed\n const keys = new Set([...filterMap.keys(), ...this.lastFilter.keys()]);\n keys.forEach(key => {\n const value = filterMap.get(key);\n if (\n this.lastFilter.get(key) !== value &&\n columns.find(column => column.name === key) != null\n ) {\n oneClick.setValueForColumn(key, value);\n }\n });\n }\n\n this.lastFilter = new Map(filterMap);\n }\n\n setFigure(figure: Figure): void {\n this.close();\n\n this.figure = figure;\n\n this.setTitle(this.getDefaultTitle());\n this.initAllSeries();\n this.updateAxisPositions();\n this.startListeningFigure();\n if (this.listeners.length > 0) {\n this.subscribeFigure();\n }\n }\n\n updateSettings(settings: Partial<ChartModelSettings>): void {\n this.settings = settings;\n }\n}\n\nexport default FigureChartModel;\n"],"mappings":";;;;;;AAAA;AACA,OAAOA,OAAP,MAAoB,UAApB;AACA,OAAOC,QAAP,MAAqB,iBAArB;AACA,OAAOC,GAAP,MAAgB,YAAhB;AACA,OAAOC,EAAP,MAOO,uBAPP;AAQA,O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,oBAAL;;IACA,IAAI,KAAKyC,SAAL,CAAe3F,MAAf,GAAwB,CAA5B,EAA+B;MAC7B,KAAK4F,eAAL;IACD;EACF;;EAEDgH,cAAc,CAAChN,QAAD,EAA8C;IAC1D,KAAKA,QAAL,GAAgBA,QAAhB;EACD;;AA9rBuC;;gBAApCH,gB,yBACyB,E;;AAgsB/B,eAAeA,gBAAf"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deephaven/chart",
|
|
3
|
-
"version": "0.19.2-beta.
|
|
3
|
+
"version": "0.19.2-beta.5+f6a5d6d",
|
|
4
4
|
"description": "Deephaven Chart",
|
|
5
5
|
"author": "Deephaven Data Labs LLC",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -30,11 +30,11 @@
|
|
|
30
30
|
"start": "cross-env NODE_ENV=development npm run watch"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@deephaven/icons": "^0.19.2-beta.
|
|
34
|
-
"@deephaven/jsapi-shim": "^0.19.2-beta.
|
|
35
|
-
"@deephaven/jsapi-utils": "^0.19.2-beta.
|
|
36
|
-
"@deephaven/log": "^0.19.2-beta.
|
|
37
|
-
"@deephaven/utils": "^0.19.2-beta.
|
|
33
|
+
"@deephaven/icons": "^0.19.2-beta.5+f6a5d6d",
|
|
34
|
+
"@deephaven/jsapi-shim": "^0.19.2-beta.5+f6a5d6d",
|
|
35
|
+
"@deephaven/jsapi-utils": "^0.19.2-beta.5+f6a5d6d",
|
|
36
|
+
"@deephaven/log": "^0.19.2-beta.5+f6a5d6d",
|
|
37
|
+
"@deephaven/utils": "^0.19.2-beta.5+f6a5d6d",
|
|
38
38
|
"deep-equal": "^2.0.5",
|
|
39
39
|
"lodash.debounce": "^4.0.8",
|
|
40
40
|
"lodash.set": "^4.3.2",
|
|
@@ -48,8 +48,8 @@
|
|
|
48
48
|
"react": "^17.x"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
|
-
"@deephaven/mocks": "^0.19.2-beta.
|
|
52
|
-
"@deephaven/tsconfig": "^0.19.2-beta.
|
|
51
|
+
"@deephaven/mocks": "^0.19.2-beta.5+f6a5d6d",
|
|
52
|
+
"@deephaven/tsconfig": "^0.19.2-beta.5+f6a5d6d",
|
|
53
53
|
"@types/plotly.js": "^2.12.2"
|
|
54
54
|
},
|
|
55
55
|
"files": [
|
|
@@ -61,5 +61,5 @@
|
|
|
61
61
|
"publishConfig": {
|
|
62
62
|
"access": "public"
|
|
63
63
|
},
|
|
64
|
-
"gitHead": "
|
|
64
|
+
"gitHead": "f6a5d6d2a6c2bbc3e8a9b05aad234c30bb0a7bcb"
|
|
65
65
|
}
|