@deephaven/chart 0.43.0 → 0.44.0
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.css +71 -0
- package/dist/Chart.css.map +1 -0
- package/dist/Chart.js +518 -0
- package/dist/Chart.js.map +1 -0
- package/dist/ChartModel.js +135 -0
- package/dist/ChartModel.js.map +1 -0
- package/dist/ChartModelFactory.js +84 -0
- package/dist/ChartModelFactory.js.map +1 -0
- package/dist/ChartTestUtils.js +117 -0
- package/dist/ChartTestUtils.js.map +1 -0
- package/dist/ChartTheme.js +20 -0
- package/dist/ChartTheme.js.map +1 -0
- package/dist/ChartTheme.module.css +22 -0
- package/dist/ChartTheme.module.css.map +1 -0
- package/dist/ChartUtils.js +1435 -0
- package/dist/ChartUtils.js.map +1 -0
- package/dist/FigureChartModel.js +571 -0
- package/dist/FigureChartModel.js.map +1 -0
- package/dist/MockChartModel.js +186 -0
- package/dist/MockChartModel.js.map +1 -0
- package/dist/declaration.d.js +2 -0
- package/dist/declaration.d.js.map +1 -0
- package/dist/index.js +11 -0
- package/dist/index.js.map +1 -0
- package/dist/isFigureChartModel.js +4 -0
- package/dist/isFigureChartModel.js.map +1 -0
- package/dist/plotly/Plot.js +12 -0
- package/dist/plotly/Plot.js.map +1 -0
- package/dist/plotly/Plotly.js +24 -0
- package/dist/plotly/Plotly.js.map +1 -0
- package/package.json +9 -9
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Chart.js","names":["React","Component","deepEqual","memoize","vsLoading","dhGraphLineDown","dhWarningFilled","Formatter","FormatterUtils","DateUtils","Log","createPlotlyComponent","Plotly","ChartModel","ChartUtils","log","module","Chart","convertIcon","faIcon","width","path","icon","stringPath","ascent","descent","transform","downsampleButtonTitle","isDownsampleInProgress","isDownsamplingDisabled","downsampleButtonAttr","undefined","constructor","props","downsamplingError","isDownsampleFinished","data","customButtons","hasDownsampleError","Boolean","push","name","title","click","attr","handleDownsampleClick","has2D","some","type","includes","has3D","buttons2D","buttons3D","displaylogo","displayModeBar","modeBarButtons","handleAfterPlot","bind","handleModelEvent","handlePlotUpdate","handleRelayout","handleRestyle","PlotComponent","plot","createRef","plotWrapper","columnFormats","dateTimeFormatterOptions","decimalFormatOptions","integerFormatOptions","isSubscribed","isLoadedFired","currentSeries","state","layout","datarevision","revision","componentDidMount","updateDimensions","updateModelDimensions","initData","initFormatter","isActive","subscribe","componentDidUpdate","prevProps","settings","updateFormatterSettings","unsubscribe","componentWillUnmount","getPlotRect","current","getBoundingClientRect","model","setState","getData","getLayout","rect","height","debug2","setDownsamplingDisabled","event","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","reduce","acc","visible","force","warn","isRectChanged","setDimensions","getColumnFormats","getDateTimeFormatterOptions","updateFormatter","formatter","dh","setFormatter","PlotlyProp","relayout","el","autosize","catch","e","render","config","getCachedConfig","isPlotShown","error","timeZone","defaultDateTimeFormat","FULL_DATE_FORMAT","showTimeZone","showTSeparator"],"sources":["../src/Chart.tsx"],"sourcesContent":["import React, { Component, ReactElement, RefObject } from 'react';\nimport deepEqual from 'deep-equal';\nimport memoize from 'memoize-one';\nimport {\n vsLoading,\n dhGraphLineDown,\n dhWarningFilled,\n IconDefinition,\n} from '@deephaven/icons';\nimport {\n Formatter,\n FormatterUtils,\n DateUtils,\n DateTimeColumnFormatterOptions,\n DecimalColumnFormatterOptions,\n IntegerColumnFormatterOptions,\n FormattingRule,\n ColumnFormatSettings,\n DateTimeFormatSettings,\n} from '@deephaven/jsapi-utils';\nimport Log from '@deephaven/log';\nimport {\n Config as PlotlyConfig,\n Layout,\n Icon,\n Data,\n PlotData,\n ModeBarButtonAny,\n} from 'plotly.js';\nimport type { PlotParams } from 'react-plotly.js';\nimport createPlotlyComponent from 'react-plotly.js/factory.js';\nimport Plotly from './plotly/Plotly';\nimport ChartModel from './ChartModel';\nimport ChartUtils, { ChartModelSettings } from './ChartUtils';\nimport './Chart.scss';\n\nconst log = Log.module('Chart');\n\ntype FormatterSettings = ColumnFormatSettings &\n DateTimeFormatSettings & {\n decimalFormatOptions?: DecimalColumnFormatterOptions;\n integerFormatOptions?: IntegerColumnFormatterOptions;\n };\n\ninterface ChartProps {\n model: ChartModel;\n settings: FormatterSettings;\n isActive: boolean;\n Plotly: typeof Plotly;\n onDisconnect: () => void;\n onReconnect: () => void;\n onUpdate: (obj: { isLoading: boolean }) => void;\n onError: (error: Error) => void;\n onSettingsChanged: (settings: Partial<ChartModelSettings>) => void;\n}\n\ninterface ChartState {\n data: Partial<Data>[] | null;\n downsamplingError: unknown;\n isDownsampleFinished: boolean;\n isDownsampleInProgress: boolean;\n isDownsamplingDisabled: boolean;\n layout: Partial<Layout>;\n revision: number;\n}\n\nexport class Chart extends Component<ChartProps, ChartState> {\n static defaultProps = {\n isActive: true,\n settings: {\n timeZone: 'America/New_York',\n defaultDateTimeFormat: DateUtils.FULL_DATE_FORMAT,\n showTimeZone: false,\n showTSeparator: true,\n formatter: [],\n },\n Plotly,\n onDisconnect: (): void => undefined,\n onReconnect: (): void => undefined,\n onUpdate: (): void => undefined,\n onError: (): void => undefined,\n onSettingsChanged: (): void => undefined,\n };\n\n /**\n * Convert a font awesome icon definition to a plotly icon definition\n * @param faIcon The icon to convert\n */\n static convertIcon(faIcon: IconDefinition): Icon {\n const [width, , , , path] = faIcon.icon;\n // By default the icons are flipped upside down, so we need to add our own transform\n // https://github.com/plotly/plotly.js/issues/1335\n const stringPath = `${path}`;\n return {\n width,\n path: stringPath,\n ascent: width,\n descent: 0,\n transform: `matrix(1, 0, 0, 1, 0, 0)`,\n };\n }\n\n static downsampleButtonTitle(\n isDownsampleInProgress: boolean,\n isDownsamplingDisabled: boolean\n ): string {\n if (isDownsampleInProgress) {\n return 'Downsampling in progress...';\n }\n\n return isDownsamplingDisabled\n ? 'Downsampling disabled, click to enable'\n : 'Downsampling enabled, click to disable';\n }\n\n static downsampleButtonAttr(\n isDownsampleInProgress: boolean,\n isDownsamplingDisabled: boolean\n ): string | undefined {\n if (isDownsampleInProgress) {\n return 'animation-spin';\n }\n\n return isDownsamplingDisabled ? undefined : 'fill-active';\n }\n\n constructor(props: ChartProps) {\n super(props);\n\n this.handleAfterPlot = this.handleAfterPlot.bind(this);\n this.handleDownsampleClick = this.handleDownsampleClick.bind(this);\n this.handleModelEvent = this.handleModelEvent.bind(this);\n this.handlePlotUpdate = this.handlePlotUpdate.bind(this);\n this.handleRelayout = this.handleRelayout.bind(this);\n this.handleRestyle = this.handleRestyle.bind(this);\n\n this.PlotComponent = createPlotlyComponent(props.Plotly);\n this.plot = React.createRef();\n this.plotWrapper = React.createRef();\n this.columnFormats = [];\n this.dateTimeFormatterOptions = {};\n this.decimalFormatOptions = {};\n this.integerFormatOptions = {};\n this.isSubscribed = false;\n this.isLoadedFired = false;\n this.currentSeries = 0;\n\n this.state = {\n data: null,\n downsamplingError: null,\n isDownsampleFinished: false,\n isDownsampleInProgress: false,\n isDownsamplingDisabled: false,\n layout: {\n datarevision: 0,\n },\n revision: 0,\n };\n }\n\n componentDidMount(): void {\n // Need to make sure the model dimensions are up to date before initializing the data\n this.updateDimensions();\n this.updateModelDimensions();\n\n this.initData();\n this.initFormatter();\n\n const { isActive } = this.props;\n if (isActive) {\n this.subscribe();\n }\n }\n\n componentDidUpdate(prevProps: ChartProps): void {\n const { isActive, settings } = this.props;\n this.updateFormatterSettings(settings as FormatterSettings);\n\n if (isActive !== prevProps.isActive) {\n if (isActive) {\n this.subscribe();\n } else {\n this.unsubscribe();\n }\n }\n }\n\n componentWillUnmount(): void {\n this.unsubscribe();\n }\n\n currentSeries: number;\n\n PlotComponent: React.ComponentType<PlotParams>;\n\n plot: RefObject<typeof this.PlotComponent>;\n\n plotWrapper: RefObject<HTMLDivElement>;\n\n columnFormats?: FormattingRule[];\n\n dateTimeFormatterOptions?: DateTimeColumnFormatterOptions;\n\n decimalFormatOptions: DecimalColumnFormatterOptions;\n\n integerFormatOptions: IntegerColumnFormatterOptions;\n\n rect?: DOMRect;\n\n ranges?: unknown;\n\n isSubscribed: boolean;\n\n isLoadedFired: boolean;\n\n getCachedConfig = memoize(\n (\n downsamplingError: unknown,\n isDownsampleFinished: boolean,\n isDownsampleInProgress: boolean,\n isDownsamplingDisabled: boolean,\n data: Partial<Data>[]\n ): Partial<PlotlyConfig> => {\n const customButtons: ModeBarButtonAny[] = [];\n const hasDownsampleError = Boolean(downsamplingError);\n if (hasDownsampleError) {\n customButtons.push({\n name: `Downsampling failed: ${downsamplingError}`,\n title: 'Downsampling failed',\n click: () => undefined,\n icon: Chart.convertIcon(dhWarningFilled),\n attr: 'fill-warning',\n });\n }\n\n if (\n isDownsampleFinished ||\n isDownsampleInProgress ||\n isDownsamplingDisabled ||\n hasDownsampleError\n ) {\n const name = Chart.downsampleButtonTitle(\n isDownsampleInProgress,\n isDownsamplingDisabled\n );\n const attr = Chart.downsampleButtonAttr(\n isDownsampleInProgress,\n isDownsamplingDisabled\n );\n\n const icon = isDownsampleInProgress ? vsLoading : dhGraphLineDown;\n customButtons.push({\n name,\n title: 'Downsampling status',\n icon: Chart.convertIcon(icon),\n click: this.handleDownsampleClick,\n attr,\n });\n }\n\n const has2D = data.some(\n ({ type }) => type != null && !type.includes('3d')\n );\n const has3D = data.some(\n ({ type }) => type != null && type.includes('3d')\n );\n\n const buttons2D = [\n 'zoomIn2d',\n 'zoomOut2d',\n 'autoScale2d',\n 'resetScale2d',\n ] as const;\n const buttons3D = [\n 'orbitRotation',\n 'tableRotation',\n 'resetCameraDefault3d',\n ] as const;\n\n return {\n displaylogo: false,\n\n // Display the mode bar if there's an error or downsampling so user can see progress\n // Yes, the value is a boolean or the string 'hover': https://github.com/plotly/plotly.js/blob/master/src/plot_api/plot_config.js#L249\n displayModeBar:\n // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions\n isDownsampleInProgress || hasDownsampleError\n ? true\n : ('hover' as const),\n\n // Each array gets grouped together in the mode bar\n modeBarButtons: [\n customButtons,\n ['toImage'],\n ['zoom2d', 'pan2d'], // These work the same for both 2d and 3d\n [...(has2D ? buttons2D : []), ...(has3D ? buttons3D : [])],\n ],\n };\n }\n );\n\n getPlotRect(): DOMRect | null {\n return this.plotWrapper.current?.getBoundingClientRect() ?? null;\n }\n\n initData(): void {\n const { model } = this.props;\n const { layout } = this.state;\n this.setState({\n data: model.getData(),\n layout: {\n ...layout,\n ...model.getLayout(),\n },\n });\n }\n\n subscribe(): void {\n if (this.isSubscribed) {\n return;\n }\n\n const { model } = this.props;\n if (!this.rect || this.rect.width === 0 || this.rect.height === 0) {\n log.debug2('Delaying subscription until model dimensions are set');\n return;\n }\n model.subscribe(this.handleModelEvent);\n this.isSubscribed = true;\n }\n\n unsubscribe(): void {\n if (!this.isSubscribed) {\n return;\n }\n\n const { model } = this.props;\n model.unsubscribe(this.handleModelEvent);\n this.isSubscribed = false;\n }\n\n handleAfterPlot(): void {\n if (this.plot.current != null) {\n // TODO: Translate whatever Don was doing in plotting.js in the afterplot here so that area graphs show up properly\n }\n }\n\n handleDownsampleClick(): void {\n this.setState(\n ({ isDownsamplingDisabled }) => ({\n downsamplingError: null,\n isDownsampleInProgress: false,\n isDownsampleFinished: false,\n isDownsamplingDisabled: !isDownsamplingDisabled,\n }),\n () => {\n const { model } = this.props;\n const { isDownsamplingDisabled } = this.state;\n model.setDownsamplingDisabled(isDownsamplingDisabled);\n }\n );\n }\n\n handleModelEvent(event: CustomEvent): void {\n const { type, detail } = event;\n log.debug2('Received data update', type, detail);\n\n switch (type) {\n case ChartModel.EVENT_UPDATED: {\n this.currentSeries += 1;\n this.setState(state => {\n const { layout, revision } = state;\n if (typeof layout.datarevision === 'number') {\n layout.datarevision += 1;\n }\n return {\n data: detail,\n layout,\n revision: revision + 1,\n };\n });\n\n const { onUpdate } = this.props;\n onUpdate({ isLoading: !this.isLoadedFired });\n break;\n }\n case ChartModel.EVENT_LOADFINISHED: {\n const { onUpdate } = this.props;\n this.isLoadedFired = true;\n onUpdate({ isLoading: false });\n break;\n }\n case ChartModel.EVENT_DISCONNECT: {\n const { onDisconnect } = this.props;\n onDisconnect();\n break;\n }\n case ChartModel.EVENT_RECONNECT: {\n const { onReconnect } = this.props;\n onReconnect();\n break;\n }\n case ChartModel.EVENT_DOWNSAMPLESTARTED: {\n this.setState({\n isDownsampleFinished: false,\n isDownsampleInProgress: true,\n downsamplingError: null,\n });\n break;\n }\n case ChartModel.EVENT_DOWNSAMPLEFINISHED: {\n this.setState({\n isDownsampleFinished: true,\n isDownsampleInProgress: false,\n downsamplingError: null,\n });\n break;\n }\n case ChartModel.EVENT_DOWNSAMPLENEEDED:\n case ChartModel.EVENT_DOWNSAMPLEFAILED: {\n const downsamplingError = detail.message ?? detail;\n this.setState({\n isDownsampleFinished: false,\n isDownsampleInProgress: false,\n isDownsamplingDisabled: false,\n downsamplingError,\n });\n\n const { onError } = this.props;\n onError(new Error(downsamplingError));\n break;\n }\n default:\n log.debug('Unknown event type', type, event);\n }\n }\n\n handlePlotUpdate(figure: Readonly<{ layout: Partial<Layout> }>): void {\n // User could have modified zoom/pan here, update the model dimensions\n // We don't need to update the datarevision, as we don't have any data changes\n // until an update comes back from the server anyway\n const { layout } = figure;\n const ranges = ChartUtils.getLayoutRanges(layout);\n\n const isRangesChanged = !deepEqual(ranges, this.ranges);\n\n if (isRangesChanged) {\n this.ranges = ranges;\n\n this.updateModelDimensions(true);\n }\n }\n\n handleRelayout(changes: { hiddenlabels?: string[] }): void {\n log.debug('handleRelayout', changes);\n if (changes.hiddenlabels != null) {\n const { onSettingsChanged } = this.props;\n // Pie charts store series visibility in layout.hiddenlabels and trigger relayout on changes\n // Series visibility for other types of charts is handled in handleRestyle\n const hiddenSeries = [...changes.hiddenlabels];\n onSettingsChanged({ hiddenSeries });\n }\n\n this.updateModelDimensions();\n }\n\n handleRestyle([changes, seriesIndexes]: readonly [\n Record<string, unknown>,\n number[]\n ]): void {\n log.debug('handleRestyle', changes, seriesIndexes);\n if (Object.keys(changes).includes('visible')) {\n const { data } = this.state;\n const { onSettingsChanged } = this.props;\n if (data != null) {\n const hiddenSeries = (data as Partial<PlotData>[]).reduce(\n (acc: string[], { name, visible }) =>\n name != null && visible === 'legendonly' ? [...acc, name] : acc,\n []\n );\n onSettingsChanged({ hiddenSeries });\n }\n }\n }\n\n /**\n * Update the models dimensions and ranges.\n * Note that this will update it all whether the plot size changes OR the range\n * the user is looking at has changed (eg. panning/zooming).\n * Could update each independently, but doing them at the same time keeps the\n * ChartModel API a bit cleaner.\n * @param force Force a change even if the chart dimensions haven't changed (eg. after pan/zoom)\n */\n updateModelDimensions(force = false): void {\n const rect = this.getPlotRect();\n if (!rect) {\n log.warn('Unable to get plotting rect');\n return;\n }\n\n const isRectChanged =\n !this.rect ||\n this.rect.width !== rect.width ||\n this.rect.height !== rect.height;\n\n if (isRectChanged || force) {\n this.rect = rect;\n\n const { isActive, model } = this.props;\n model.setDimensions(rect);\n // We may need to resubscribe if dimensions were too small before\n if (isActive) {\n this.subscribe();\n }\n }\n }\n\n initFormatter(): void {\n const { settings } = this.props;\n this.updateFormatterSettings(settings as FormatterSettings);\n }\n\n updateFormatterSettings(settings: FormatterSettings): void {\n const columnFormats = FormatterUtils.getColumnFormats(settings);\n const dateTimeFormatterOptions = FormatterUtils.getDateTimeFormatterOptions(\n settings\n );\n const { decimalFormatOptions = {}, integerFormatOptions = {} } = settings;\n\n if (\n !deepEqual(this.columnFormats, columnFormats) ||\n !deepEqual(this.dateTimeFormatterOptions, dateTimeFormatterOptions) ||\n !deepEqual(this.decimalFormatOptions, decimalFormatOptions) ||\n !deepEqual(this.integerFormatOptions, integerFormatOptions)\n ) {\n this.columnFormats = FormatterUtils.getColumnFormats(settings);\n this.dateTimeFormatterOptions = dateTimeFormatterOptions;\n this.decimalFormatOptions = decimalFormatOptions;\n this.integerFormatOptions = integerFormatOptions;\n this.updateFormatter();\n }\n }\n\n updateFormatter(): void {\n const { model } = this.props;\n const formatter = new Formatter(\n model.dh,\n this.columnFormats,\n this.dateTimeFormatterOptions,\n this.decimalFormatOptions,\n this.integerFormatOptions\n );\n model.setFormatter(formatter);\n }\n\n updateDimensions(): void {\n const rect = this.getPlotRect();\n const { Plotly: PlotlyProp } = this.props;\n if (\n this.plot.current != null &&\n rect != null &&\n rect.width > 0 &&\n rect.height > 0\n ) {\n // Call relayout to resize avoiding the debouncing plotly does\n // https://github.com/plotly/plotly.js/issues/2769#issuecomment-402099552\n PlotlyProp.relayout(\n ((this.plot.current as unknown) as { el: HTMLElement }).el,\n {\n autosize: true,\n }\n ).catch((e: unknown) => {\n log.debug('Unable to resize, promise rejected', e);\n });\n }\n }\n\n render(): ReactElement {\n const { PlotComponent } = this;\n const {\n data,\n downsamplingError,\n isDownsampleFinished,\n isDownsampleInProgress,\n isDownsamplingDisabled,\n layout,\n revision,\n } = this.state;\n const config = this.getCachedConfig(\n downsamplingError,\n isDownsampleFinished,\n isDownsampleInProgress,\n isDownsamplingDisabled,\n data ?? []\n );\n const isPlotShown = data != null;\n return (\n <div className=\"h-100 w-100 chart-wrapper\" ref={this.plotWrapper}>\n {isPlotShown && (\n <PlotComponent\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n ref={this.plot}\n data={data}\n layout={layout}\n revision={revision}\n config={config}\n onAfterPlot={this.handleAfterPlot}\n onError={log.error}\n onRelayout={this.handleRelayout}\n onUpdate={this.handlePlotUpdate}\n onRestyle={this.handleRestyle}\n useResizeHandler\n style={{ height: '100%', width: '100%' }}\n />\n )}\n </div>\n );\n }\n}\n\nexport default Chart;\n"],"mappings":";;;;;AAAA,OAAOA,KAAK,IAAIC,SAAS,QAAiC,OAA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AAEqC,MAAM,EAAE,MAAM;QAAE9E,KAAK,EAAE;MAAO;IAAE,EAE5C,CACG;EAEV;AACF;AAAC,gBAziBYH,KAAK,kBACM;EACpBiE,QAAQ,EAAE,IAAI;EACdI,QAAQ,EAAE;IACRoE,QAAQ,EAAE,kBAAkB;IAC5BC,qBAAqB,EAAElJ,SAAS,CAACmJ,gBAAgB;IACjDC,YAAY,EAAE,KAAK;IACnBC,cAAc,EAAE,IAAI;IACpBlB,SAAS,EAAE;EACb,CAAC;EACDhI,MAAM;EACNgG,YAAY,EAAE,MAAY7E,SAAS;EACnC+E,WAAW,EAAE,MAAY/E,SAAS;EAClCyE,QAAQ,EAAE,MAAYzE,SAAS;EAC/BqF,OAAO,EAAE,MAAYrF,SAAS;EAC9B8F,iBAAiB,EAAE,MAAY9F;AACjC,CAAC;AA2hBH,eAAed,KAAK"}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
3
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
4
|
+
/* eslint class-methods-use-this: "off" */
|
|
5
|
+
/* eslint no-unused-vars: "off" */
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Model for a Chart
|
|
9
|
+
* All of these methods should return very quickly.
|
|
10
|
+
* If data needs to be loaded asynchronously, return something immediately, then trigger an event for the chart to refresh.
|
|
11
|
+
*/
|
|
12
|
+
class ChartModel {
|
|
13
|
+
constructor(dh) {
|
|
14
|
+
_defineProperty(this, "dh", void 0);
|
|
15
|
+
_defineProperty(this, "listeners", void 0);
|
|
16
|
+
_defineProperty(this, "formatter", void 0);
|
|
17
|
+
_defineProperty(this, "rect", void 0);
|
|
18
|
+
_defineProperty(this, "isDownsamplingDisabled", void 0);
|
|
19
|
+
_defineProperty(this, "title", void 0);
|
|
20
|
+
this.dh = dh;
|
|
21
|
+
this.listeners = [];
|
|
22
|
+
this.isDownsamplingDisabled = false;
|
|
23
|
+
}
|
|
24
|
+
getData() {
|
|
25
|
+
return [];
|
|
26
|
+
}
|
|
27
|
+
getDefaultTitle() {
|
|
28
|
+
return '';
|
|
29
|
+
}
|
|
30
|
+
getLayout() {
|
|
31
|
+
return {};
|
|
32
|
+
}
|
|
33
|
+
getFilterColumnMap() {
|
|
34
|
+
return new Map();
|
|
35
|
+
}
|
|
36
|
+
isFilterRequired() {
|
|
37
|
+
return false;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
41
|
+
setFilter(filter) {}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Close this model, clean up any underlying subscriptions
|
|
45
|
+
*/
|
|
46
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
47
|
+
close() {}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Set the formatter to use when charting the data.
|
|
51
|
+
* @param formatter The formatter to use to format the charting data
|
|
52
|
+
*/
|
|
53
|
+
setFormatter(formatter) {
|
|
54
|
+
this.formatter = formatter;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Disable downsampling
|
|
59
|
+
* @param isDownsamplingDisabled True if downsampling should be disabled
|
|
60
|
+
*/
|
|
61
|
+
setDownsamplingDisabled(isDownsamplingDisabled) {
|
|
62
|
+
this.isDownsamplingDisabled = isDownsamplingDisabled;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Set the dimensions of the plot. May be needed to evaluate some of the percents
|
|
67
|
+
* @param rect The bounding rectangle of the plot
|
|
68
|
+
*/
|
|
69
|
+
setDimensions(rect) {
|
|
70
|
+
this.rect = rect;
|
|
71
|
+
}
|
|
72
|
+
setTitle(title) {
|
|
73
|
+
this.title = title;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Subscribe to this ChartModel and start listening for all events.
|
|
78
|
+
* @param callback Callback when an event occurs
|
|
79
|
+
*/
|
|
80
|
+
subscribe(callback) {
|
|
81
|
+
this.listeners.push(callback);
|
|
82
|
+
}
|
|
83
|
+
unsubscribe(callback) {
|
|
84
|
+
this.listeners = this.listeners.filter(listener => listener !== callback);
|
|
85
|
+
}
|
|
86
|
+
fireEvent(event) {
|
|
87
|
+
for (var i = 0; i < this.listeners.length; i += 1) {
|
|
88
|
+
this.listeners[i](event);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
fireUpdate(data) {
|
|
92
|
+
this.fireEvent(new CustomEvent(ChartModel.EVENT_UPDATED, {
|
|
93
|
+
detail: data
|
|
94
|
+
}));
|
|
95
|
+
}
|
|
96
|
+
fireDisconnect() {
|
|
97
|
+
this.fireEvent(new CustomEvent(ChartModel.EVENT_DISCONNECT));
|
|
98
|
+
}
|
|
99
|
+
fireReconnect() {
|
|
100
|
+
this.fireEvent(new CustomEvent(ChartModel.EVENT_RECONNECT));
|
|
101
|
+
}
|
|
102
|
+
fireDownsampleStart(detail) {
|
|
103
|
+
this.fireEvent(new CustomEvent(ChartModel.EVENT_DOWNSAMPLESTARTED, {
|
|
104
|
+
detail
|
|
105
|
+
}));
|
|
106
|
+
}
|
|
107
|
+
fireDownsampleFinish(detail) {
|
|
108
|
+
this.fireEvent(new CustomEvent(ChartModel.EVENT_DOWNSAMPLEFINISHED, {
|
|
109
|
+
detail
|
|
110
|
+
}));
|
|
111
|
+
}
|
|
112
|
+
fireDownsampleFail(detail) {
|
|
113
|
+
this.fireEvent(new CustomEvent(ChartModel.EVENT_DOWNSAMPLEFAILED, {
|
|
114
|
+
detail
|
|
115
|
+
}));
|
|
116
|
+
}
|
|
117
|
+
fireDownsampleNeeded(detail) {
|
|
118
|
+
this.fireEvent(new CustomEvent(ChartModel.EVENT_DOWNSAMPLENEEDED, {
|
|
119
|
+
detail
|
|
120
|
+
}));
|
|
121
|
+
}
|
|
122
|
+
fireLoadFinished() {
|
|
123
|
+
this.fireEvent(new CustomEvent(ChartModel.EVENT_LOADFINISHED));
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
_defineProperty(ChartModel, "EVENT_UPDATED", 'ChartModel.EVENT_UPDATED');
|
|
127
|
+
_defineProperty(ChartModel, "EVENT_DISCONNECT", 'ChartModel.EVENT_DISCONNECT');
|
|
128
|
+
_defineProperty(ChartModel, "EVENT_RECONNECT", 'ChartModel.EVENT_RECONNECT');
|
|
129
|
+
_defineProperty(ChartModel, "EVENT_DOWNSAMPLESTARTED", 'ChartModel.EVENT_DOWNSAMPLESTARTED');
|
|
130
|
+
_defineProperty(ChartModel, "EVENT_DOWNSAMPLEFINISHED", 'ChartModel.EVENT_DOWNSAMPLEFINISHED');
|
|
131
|
+
_defineProperty(ChartModel, "EVENT_DOWNSAMPLEFAILED", 'ChartModel.EVENT_DOWNSAMPLEFAILED');
|
|
132
|
+
_defineProperty(ChartModel, "EVENT_DOWNSAMPLENEEDED", 'ChartModel.EVENT_DOWNSAMPLENEEDED');
|
|
133
|
+
_defineProperty(ChartModel, "EVENT_LOADFINISHED", 'ChartModel.EVENT_LOADFINISHED');
|
|
134
|
+
export default ChartModel;
|
|
135
|
+
//# sourceMappingURL=ChartModel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChartModel.js","names":["ChartModel","constructor","dh","listeners","isDownsamplingDisabled","getData","getDefaultTitle","getLayout","getFilterColumnMap","Map","isFilterRequired","setFilter","filter","close","setFormatter","formatter","setDownsamplingDisabled","setDimensions","rect","setTitle","title","subscribe","callback","push","unsubscribe","listener","fireEvent","event","i","length","fireUpdate","data","CustomEvent","EVENT_UPDATED","detail","fireDisconnect","EVENT_DISCONNECT","fireReconnect","EVENT_RECONNECT","fireDownsampleStart","EVENT_DOWNSAMPLESTARTED","fireDownsampleFinish","EVENT_DOWNSAMPLEFINISHED","fireDownsampleFail","EVENT_DOWNSAMPLEFAILED","fireDownsampleNeeded","EVENT_DOWNSAMPLENEEDED","fireLoadFinished","EVENT_LOADFINISHED"],"sources":["../src/ChartModel.ts"],"sourcesContent":["/* eslint class-methods-use-this: \"off\" */\n/* eslint no-unused-vars: \"off\" */\n\nimport type { dh as DhType } from '@deephaven/jsapi-types';\nimport { Formatter } from '@deephaven/jsapi-utils';\nimport type { Layout, Data } from 'plotly.js';\nimport { FilterColumnMap, FilterMap } from './ChartUtils';\n\nexport type ChartEvent = CustomEvent;\n/**\n * Model for a Chart\n * All of these methods should return very quickly.\n * If data needs to be loaded asynchronously, return something immediately, then trigger an event for the chart to refresh.\n */\nclass ChartModel {\n static EVENT_UPDATED = 'ChartModel.EVENT_UPDATED';\n\n static EVENT_DISCONNECT = 'ChartModel.EVENT_DISCONNECT';\n\n static EVENT_RECONNECT = 'ChartModel.EVENT_RECONNECT';\n\n static EVENT_DOWNSAMPLESTARTED = 'ChartModel.EVENT_DOWNSAMPLESTARTED';\n\n static EVENT_DOWNSAMPLEFINISHED = 'ChartModel.EVENT_DOWNSAMPLEFINISHED';\n\n static EVENT_DOWNSAMPLEFAILED = 'ChartModel.EVENT_DOWNSAMPLEFAILED';\n\n static EVENT_DOWNSAMPLENEEDED = 'ChartModel.EVENT_DOWNSAMPLENEEDED';\n\n static EVENT_LOADFINISHED = 'ChartModel.EVENT_LOADFINISHED';\n\n constructor(dh: DhType) {\n this.dh = dh;\n this.listeners = [];\n this.isDownsamplingDisabled = false;\n }\n\n dh: DhType;\n\n listeners: ((event: ChartEvent) => void)[];\n\n formatter?: Formatter;\n\n rect?: DOMRect;\n\n isDownsamplingDisabled: boolean;\n\n title?: string;\n\n getData(): Partial<Data>[] {\n return [];\n }\n\n getDefaultTitle(): string {\n return '';\n }\n\n getLayout(): Partial<Layout> {\n return {};\n }\n\n getFilterColumnMap(): FilterColumnMap {\n return new Map();\n }\n\n isFilterRequired(): boolean {\n return false;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n setFilter(filter: FilterMap): void {}\n\n /**\n * Close this model, clean up any underlying subscriptions\n */\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n close(): void {}\n\n /**\n * Set the formatter to use when charting the data.\n * @param formatter The formatter to use to format the charting data\n */\n setFormatter(formatter: Formatter): void {\n this.formatter = formatter;\n }\n\n /**\n * Disable downsampling\n * @param isDownsamplingDisabled True if downsampling should be disabled\n */\n setDownsamplingDisabled(isDownsamplingDisabled: boolean): void {\n this.isDownsamplingDisabled = isDownsamplingDisabled;\n }\n\n /**\n * Set the dimensions of the plot. May be needed to evaluate some of the percents\n * @param rect The bounding rectangle of the plot\n */\n setDimensions(rect: DOMRect): void {\n this.rect = rect;\n }\n\n setTitle(title: string): void {\n this.title = title;\n }\n\n /**\n * Subscribe to this ChartModel and start listening for all events.\n * @param callback Callback when an event occurs\n */\n subscribe(callback: (event: ChartEvent) => void): void {\n this.listeners.push(callback);\n }\n\n unsubscribe(callback: (event: ChartEvent) => void): void {\n this.listeners = this.listeners.filter(listener => listener !== callback);\n }\n\n fireEvent(event: ChartEvent): void {\n for (let i = 0; i < this.listeners.length; i += 1) {\n this.listeners[i](event);\n }\n }\n\n fireUpdate(data: unknown): void {\n this.fireEvent(new CustomEvent(ChartModel.EVENT_UPDATED, { detail: data }));\n }\n\n fireDisconnect(): void {\n this.fireEvent(new CustomEvent(ChartModel.EVENT_DISCONNECT));\n }\n\n fireReconnect(): void {\n this.fireEvent(new CustomEvent(ChartModel.EVENT_RECONNECT));\n }\n\n fireDownsampleStart(detail: unknown): void {\n this.fireEvent(\n new CustomEvent(ChartModel.EVENT_DOWNSAMPLESTARTED, { detail })\n );\n }\n\n fireDownsampleFinish(detail: unknown): void {\n this.fireEvent(\n new CustomEvent(ChartModel.EVENT_DOWNSAMPLEFINISHED, { detail })\n );\n }\n\n fireDownsampleFail(detail: unknown): void {\n this.fireEvent(\n new CustomEvent(ChartModel.EVENT_DOWNSAMPLEFAILED, { detail })\n );\n }\n\n fireDownsampleNeeded(detail: unknown): void {\n this.fireEvent(\n new CustomEvent(ChartModel.EVENT_DOWNSAMPLENEEDED, { detail })\n );\n }\n\n fireLoadFinished(): void {\n this.fireEvent(new CustomEvent(ChartModel.EVENT_LOADFINISHED));\n }\n}\n\nexport default ChartModel;\n"],"mappings":";;;AAAA;AACA;;AAQA;AACA;AACA;AACA;AACA;AACA,MAAMA,UAAU,CAAC;EAiBfC,WAAW,CAACC,EAAU,EAAE;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IACtB,IAAI,CAACA,EAAE,GAAGA,EAAE;IACZ,IAAI,CAACC,SAAS,GAAG,EAAE;IACnB,IAAI,CAACC,sBAAsB,GAAG,KAAK;EACrC;EAcAC,OAAO,GAAoB;IACzB,OAAO,EAAE;EACX;EAEAC,eAAe,GAAW;IACxB,OAAO,EAAE;EACX;EAEAC,SAAS,GAAoB;IAC3B,OAAO,CAAC,CAAC;EACX;EAEAC,kBAAkB,GAAoB;IACpC,OAAO,IAAIC,GAAG,EAAE;EAClB;EAEAC,gBAAgB,GAAY;IAC1B,OAAO,KAAK;EACd;;EAEA;EACAC,SAAS,CAACC,MAAiB,EAAQ,CAAC;;EAEpC;AACF;AACA;EACE;EACAC,KAAK,GAAS,CAAC;;EAEf;AACF;AACA;AACA;EACEC,YAAY,CAACC,SAAoB,EAAQ;IACvC,IAAI,CAACA,SAAS,GAAGA,SAAS;EAC5B;;EAEA;AACF;AACA;AACA;EACEC,uBAAuB,CAACZ,sBAA+B,EAAQ;IAC7D,IAAI,CAACA,sBAAsB,GAAGA,sBAAsB;EACtD;;EAEA;AACF;AACA;AACA;EACEa,aAAa,CAACC,IAAa,EAAQ;IACjC,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AU,CAAC0C,wBAAwB,EAAE;MAAER;IAAO,CAAC,CAAC,CACjE;EACH;EAEAS,kBAAkB,CAACT,MAAe,EAAQ;IACxC,IAAI,CAACR,SAAS,CACZ,IAAIM,WAAW,CAAChC,UAAU,CAAC4C,sBAAsB,EAAE;MAAEV;IAAO,CAAC,CAAC,CAC/D;EACH;EAEAW,oBAAoB,CAACX,MAAe,EAAQ;IAC1C,IAAI,CAACR,SAAS,CACZ,IAAIM,WAAW,CAAChC,UAAU,CAAC8C,sBAAsB,EAAE;MAAEZ;IAAO,CAAC,CAAC,CAC/D;EACH;EAEAa,gBAAgB,GAAS;IACvB,IAAI,CAACrB,SAAS,CAAC,IAAIM,WAAW,CAAChC,UAAU,CAACgD,kBAAkB,CAAC,CAAC;EAChE;AACF;AAAC,gBArJKhD,UAAU,mBACS,0BAA0B;AAAA,gBAD7CA,UAAU,sBAGY,6BAA6B;AAAA,gBAHnDA,UAAU,qBAKW,4BAA4B;AAAA,gBALjDA,UAAU,6BAOmB,oCAAoC;AAAA,gBAPjEA,UAAU,8BASoB,qCAAqC;AAAA,gBATnEA,UAAU,4BAWkB,mCAAmC;AAAA,gBAX/DA,UAAU,4BAakB,mCAAmC;AAAA,gBAb/DA,UAAU,wBAec,+BAA+B;AAwI7D,eAAeA,UAAU"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
2
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
3
|
+
import ChartUtils from "./ChartUtils.js";
|
|
4
|
+
import FigureChartModel from "./FigureChartModel.js";
|
|
5
|
+
import ChartTheme from "./ChartTheme.js";
|
|
6
|
+
class ChartModelFactory {
|
|
7
|
+
/**
|
|
8
|
+
* Creates a model from the settings provided.
|
|
9
|
+
* Tries to create a Figure in the API with it.
|
|
10
|
+
* @param dh JSAPI instance
|
|
11
|
+
* @param settings The chart builder settings
|
|
12
|
+
* @param settings.isLinked Whether the newly created chart should stay linked with the original table, update when filters are updated
|
|
13
|
+
* @param settings.series The column names to use for creating the series of this chart
|
|
14
|
+
* @param settings.type Chart builder type, from ChartBuilder.types
|
|
15
|
+
* @param settings.xAxis The column name to use for the x-axis
|
|
16
|
+
* @param [settings.hiddenSeries] Array of hidden series names
|
|
17
|
+
* @param table The table to build the model for
|
|
18
|
+
* @param theme The theme for the figure. Defaults to ChartTheme
|
|
19
|
+
* @returns The ChartModel Promise representing the figure
|
|
20
|
+
* CRA sets tsconfig to type check JS based on jsdoc comments. It isn't able to figure out FigureChartModel extends ChartModel
|
|
21
|
+
* This causes TS issues in 1 or 2 spots. Once this is TS it can be returned to just FigureChartModel
|
|
22
|
+
*/
|
|
23
|
+
static makeModelFromSettings(dh, settings, table) {
|
|
24
|
+
var _arguments = arguments;
|
|
25
|
+
return _asyncToGenerator(function* () {
|
|
26
|
+
var theme = _arguments.length > 3 && _arguments[3] !== undefined ? _arguments[3] : ChartTheme;
|
|
27
|
+
var figure = yield ChartModelFactory.makeFigureFromSettings(dh, settings, table);
|
|
28
|
+
return new FigureChartModel(dh, figure, settings, theme);
|
|
29
|
+
})();
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Creates a model from the settings provided.
|
|
34
|
+
* Tries to create a Figure in the API with it.
|
|
35
|
+
* @param dh DH JSAPI instance
|
|
36
|
+
* @param settings The chart builder settings
|
|
37
|
+
* @param settings.isLinked Whether the newly created chart should stay linked with the original table, update when filters are updated
|
|
38
|
+
* @param settings.series The column names to use for creating the series of this chart
|
|
39
|
+
* @param settings.type Chart builder type, from ChartBuilder.types
|
|
40
|
+
* @param settings.xAxis The column name to use for the x-axis
|
|
41
|
+
* @param [settings.hiddenSeries] Array of hidden series names
|
|
42
|
+
* @param table The table to build the model for
|
|
43
|
+
* @returns The Figure created with the settings provided
|
|
44
|
+
*/
|
|
45
|
+
static makeFigureFromSettings(dh, settings, table) {
|
|
46
|
+
return _asyncToGenerator(function* () {
|
|
47
|
+
// Copy the table first and then re-apply the filters from the original table
|
|
48
|
+
// When we add table linking we'll want to listen to the original table and update
|
|
49
|
+
// the copied table with any changes that occur.
|
|
50
|
+
// The table gets owned by the Figure that gets created, which closes the table
|
|
51
|
+
var tableCopy = yield table.copy();
|
|
52
|
+
tableCopy.applyCustomColumns(table.customColumns);
|
|
53
|
+
tableCopy.applyFilter(table.filter);
|
|
54
|
+
tableCopy.applySort(table.sort);
|
|
55
|
+
return dh.plot.Figure.create(new ChartUtils(dh).makeFigureSettings(settings, tableCopy));
|
|
56
|
+
})();
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Creates a model from the settings provided.
|
|
61
|
+
* Tries to create a Figure in the API with it.
|
|
62
|
+
* @param dh DH JSAPI instance
|
|
63
|
+
* @param settings The chart builder settings
|
|
64
|
+
* @param settings.isLinked Whether the newly created chart should stay linked with the original table, update when filters are updated
|
|
65
|
+
* @param settings.series The column names to use for creating the series of this chart
|
|
66
|
+
* @param settings.type Chart builder type, from ChartBuilder.types
|
|
67
|
+
* @param settings.xAxis The column name to use for the x-axis
|
|
68
|
+
* @param [settings.hiddenSeries] Array of hidden series names
|
|
69
|
+
* @param figure The figure to build the model for
|
|
70
|
+
* @param theme The theme for the figure. Defaults to ChartTheme
|
|
71
|
+
* @returns The FigureChartModel representing the figure
|
|
72
|
+
* CRA sets tsconfig to type check JS based on jsdoc comments. It isn't able to figure out FigureChartModel extends ChartModel
|
|
73
|
+
* This causes TS issues in 1 or 2 spots. Once this is TS it can be returned to just FigureChartModel
|
|
74
|
+
*/
|
|
75
|
+
static makeModel(dh, settings, figure) {
|
|
76
|
+
var _arguments2 = arguments;
|
|
77
|
+
return _asyncToGenerator(function* () {
|
|
78
|
+
var theme = _arguments2.length > 3 && _arguments2[3] !== undefined ? _arguments2[3] : ChartTheme;
|
|
79
|
+
return new FigureChartModel(dh, figure, settings, theme);
|
|
80
|
+
})();
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
export default ChartModelFactory;
|
|
84
|
+
//# sourceMappingURL=ChartModelFactory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChartModelFactory.js","names":["ChartUtils","FigureChartModel","ChartTheme","ChartModelFactory","makeModelFromSettings","dh","settings","table","theme","figure","makeFigureFromSettings","tableCopy","copy","applyCustomColumns","customColumns","applyFilter","filter","applySort","sort","plot","Figure","create","makeFigureSettings","makeModel"],"sources":["../src/ChartModelFactory.ts"],"sourcesContent":["import type { dh as DhType, Figure, Table } from '@deephaven/jsapi-types';\nimport ChartUtils, { ChartModelSettings } from './ChartUtils';\nimport FigureChartModel from './FigureChartModel';\nimport ChartTheme from './ChartTheme';\nimport ChartModel from './ChartModel';\n\nclass ChartModelFactory {\n /**\n * Creates a model from the settings provided.\n * Tries to create a Figure in the API with it.\n * @param dh JSAPI instance\n * @param settings The chart builder settings\n * @param settings.isLinked Whether the newly created chart should stay linked with the original table, update when filters are updated\n * @param settings.series The column names to use for creating the series of this chart\n * @param settings.type Chart builder type, from ChartBuilder.types\n * @param settings.xAxis The column name to use for the x-axis\n * @param [settings.hiddenSeries] Array of hidden series names\n * @param table The table to build the model for\n * @param theme The theme for the figure. Defaults to ChartTheme\n * @returns The ChartModel Promise representing the figure\n * CRA sets tsconfig to type check JS based on jsdoc comments. It isn't able to figure out FigureChartModel extends ChartModel\n * This causes TS issues in 1 or 2 spots. Once this is TS it can be returned to just FigureChartModel\n */\n static async makeModelFromSettings(\n dh: DhType,\n settings: ChartModelSettings,\n table: Table,\n theme = ChartTheme\n ): Promise<ChartModel> {\n const figure = await ChartModelFactory.makeFigureFromSettings(\n dh,\n settings,\n table\n );\n return new FigureChartModel(dh, figure, settings, theme);\n }\n\n /**\n * Creates a model from the settings provided.\n * Tries to create a Figure in the API with it.\n * @param dh DH JSAPI instance\n * @param settings The chart builder settings\n * @param settings.isLinked Whether the newly created chart should stay linked with the original table, update when filters are updated\n * @param settings.series The column names to use for creating the series of this chart\n * @param settings.type Chart builder type, from ChartBuilder.types\n * @param settings.xAxis The column name to use for the x-axis\n * @param [settings.hiddenSeries] Array of hidden series names\n * @param table The table to build the model for\n * @returns The Figure created with the settings provided\n */\n static async makeFigureFromSettings(\n dh: DhType,\n settings: ChartModelSettings,\n table: Table\n ): Promise<Figure> {\n // Copy the table first and then re-apply the filters from the original table\n // When we add table linking we'll want to listen to the original table and update\n // the copied table with any changes that occur.\n // The table gets owned by the Figure that gets created, which closes the table\n const tableCopy = await table.copy();\n tableCopy.applyCustomColumns(table.customColumns);\n tableCopy.applyFilter(table.filter);\n tableCopy.applySort(table.sort);\n\n return dh.plot.Figure.create(\n new ChartUtils(dh).makeFigureSettings(settings, tableCopy)\n );\n }\n\n /**\n * Creates a model from the settings provided.\n * Tries to create a Figure in the API with it.\n * @param dh DH JSAPI instance\n * @param settings The chart builder settings\n * @param settings.isLinked Whether the newly created chart should stay linked with the original table, update when filters are updated\n * @param settings.series The column names to use for creating the series of this chart\n * @param settings.type Chart builder type, from ChartBuilder.types\n * @param settings.xAxis The column name to use for the x-axis\n * @param [settings.hiddenSeries] Array of hidden series names\n * @param figure The figure to build the model for\n * @param theme The theme for the figure. Defaults to ChartTheme\n * @returns The FigureChartModel representing the figure\n * CRA sets tsconfig to type check JS based on jsdoc comments. It isn't able to figure out FigureChartModel extends ChartModel\n * This causes TS issues in 1 or 2 spots. Once this is TS it can be returned to just FigureChartModel\n */\n static async makeModel(\n dh: DhType,\n settings: ChartModelSettings | undefined,\n figure: Figure,\n theme = ChartTheme\n ): Promise<ChartModel> {\n return new FigureChartModel(dh, figure, settings, theme);\n }\n}\n\nexport default ChartModelFactory;\n"],"mappings":";;OACOA,UAAU;AAAA,OACVC,gBAAgB;AAAA,OAChBC,UAAU;AAGjB,MAAMC,iBAAiB,CAAC;EACtB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACE,OAAaC,qBAAqB,CAChCC,EAAU,EACVC,QAA4B,EAC5BC,KAAY,EAES;IAAA;IAAA;MAAA,IADrBC,KAAK,0EAAGN,UAAU;MAElB,IAAMO,MAAM,SAASN,iBAAiB,CAACO,sBAAsB,CAC3DL,EAAE,EACFC,QAAQ,EACRC,KAAK,CACN;MACD,OAAO,IAAIN,gBAAgB,CAACI,EAAE,EAAEI,MAAM,EAAEH,QAAQ,EAAEE,KAAK,CAAC;IAAC;EAC3D;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACE,OAAaE,sBAAsB,CACjCL,EAAU,EACVC,QAA4B,EAC5BC,KAAY,EACK;IAAA;MACjB;MACA;MACA;MACA;MACA,IAAMI,SAAS,SAASJ,KAAK,CAACK,IAAI,EAAE;MACpCD,SAAS,CAACE,kBAAkB,CAACN,KAAK,CAACO,aAAa,CAAC;MACjDH,SAAS,CAACI,WAAW,CAACR,KAAK,CAACS,MAAM,CAAC;MACnCL,SAAS,CAACM,SAAS,CAACV,KAAK,CAACW,IAAI,CAAC;MAE/B,OAAOb,EAAE,CAACc,IAAI,CAACC,MAAM,CAACC,MAAM,CAC1B,IAAIrB,UAAU,CAACK,EAAE,CAAC,CAACiB,kBAAkB,CAAChB,QAAQ,EAAEK,SAAS,CAAC,CAC3D;IAAC;EACJ;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACE,OAAaY,SAAS,CACpBlB,EAAU,EACVC,QAAwC,EACxCG,MAAc,EAEO;IAAA;IAAA;MAAA,IADrBD,KAAK,6EAAGN,UAAU;MAElB,OAAO,IAAID,gBAAgB,CAACI,EAAE,EAAEI,MAAM,EAAEH,QAAQ,EAAEE,KAAK,CAAC;IAAC;EAC3D;AACF;AAEA,eAAeL,iBAAiB"}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
3
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
4
|
+
class ChartTestUtils {
|
|
5
|
+
constructor(dh) {
|
|
6
|
+
_defineProperty(this, "dh", void 0);
|
|
7
|
+
this.dh = dh;
|
|
8
|
+
}
|
|
9
|
+
makeAxis() {
|
|
10
|
+
var {
|
|
11
|
+
label = 'Axis',
|
|
12
|
+
type = undefined,
|
|
13
|
+
position = undefined,
|
|
14
|
+
formatType = undefined,
|
|
15
|
+
formatPattern = '###,###0.00',
|
|
16
|
+
log = false
|
|
17
|
+
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
18
|
+
var {
|
|
19
|
+
dh
|
|
20
|
+
} = this;
|
|
21
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
22
|
+
return new dh.Axis({
|
|
23
|
+
label,
|
|
24
|
+
type: type !== null && type !== void 0 ? type : dh.plot.AxisType.X,
|
|
25
|
+
position: position !== null && position !== void 0 ? position : dh.plot.AxisPosition.BOTTOM,
|
|
26
|
+
formatType: formatType !== null && formatType !== void 0 ? formatType : dh.Axis.FORMAT_TYPE_NUMBER,
|
|
27
|
+
formatPattern,
|
|
28
|
+
log
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
makeDefaultAxes() {
|
|
32
|
+
var {
|
|
33
|
+
dh
|
|
34
|
+
} = this;
|
|
35
|
+
return [this.makeAxis({
|
|
36
|
+
label: ChartTestUtils.DEFAULT_X_TITLE,
|
|
37
|
+
type: dh.plot.AxisType.X
|
|
38
|
+
}), this.makeAxis({
|
|
39
|
+
label: ChartTestUtils.DEFAULT_Y_TITLE,
|
|
40
|
+
type: dh.plot.AxisType.Y
|
|
41
|
+
})];
|
|
42
|
+
}
|
|
43
|
+
makeSource(_ref) {
|
|
44
|
+
var {
|
|
45
|
+
axis = this.makeAxis()
|
|
46
|
+
} = _ref;
|
|
47
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
48
|
+
return new this.dh.SeriesDataSource({
|
|
49
|
+
axis,
|
|
50
|
+
type: axis.type
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
makeDefaultSources() {
|
|
54
|
+
var axes = this.makeDefaultAxes();
|
|
55
|
+
return axes.map(axis => this.makeSource({
|
|
56
|
+
axis
|
|
57
|
+
}));
|
|
58
|
+
}
|
|
59
|
+
makeSeries() {
|
|
60
|
+
var {
|
|
61
|
+
name = ChartTestUtils.DEFAULT_SERIES_NAME,
|
|
62
|
+
plotStyle = null,
|
|
63
|
+
sources = this.makeDefaultSources(),
|
|
64
|
+
lineColor = null,
|
|
65
|
+
shapeColor = null
|
|
66
|
+
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
67
|
+
var {
|
|
68
|
+
dh
|
|
69
|
+
} = this;
|
|
70
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
71
|
+
return new dh.Series(name, plotStyle !== null && plotStyle !== void 0 ? plotStyle : dh.plot.SeriesPlotStyle.SCATTER, sources, lineColor, shapeColor);
|
|
72
|
+
}
|
|
73
|
+
makeChart() {
|
|
74
|
+
var {
|
|
75
|
+
title = ChartTestUtils.DEFAULT_CHART_TITLE,
|
|
76
|
+
series = [this.makeSeries()],
|
|
77
|
+
axes = this.makeDefaultAxes(),
|
|
78
|
+
showLegend = null,
|
|
79
|
+
rowspan = 1,
|
|
80
|
+
colspan = 1,
|
|
81
|
+
row = 0,
|
|
82
|
+
column = 0
|
|
83
|
+
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
84
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
85
|
+
return new this.dh.Chart({
|
|
86
|
+
title,
|
|
87
|
+
series,
|
|
88
|
+
axes,
|
|
89
|
+
showLegend,
|
|
90
|
+
row,
|
|
91
|
+
column,
|
|
92
|
+
rowspan,
|
|
93
|
+
colspan
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
makeFigure() {
|
|
97
|
+
var {
|
|
98
|
+
title = 'Figure',
|
|
99
|
+
charts = [this.makeChart()],
|
|
100
|
+
rows = 1,
|
|
101
|
+
cols = 1
|
|
102
|
+
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
103
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
104
|
+
return new this.dh.plot.Figure({
|
|
105
|
+
title,
|
|
106
|
+
charts,
|
|
107
|
+
rows,
|
|
108
|
+
cols
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
_defineProperty(ChartTestUtils, "DEFAULT_CHART_TITLE", 'Chart Title');
|
|
113
|
+
_defineProperty(ChartTestUtils, "DEFAULT_X_TITLE", 'X Axis');
|
|
114
|
+
_defineProperty(ChartTestUtils, "DEFAULT_Y_TITLE", 'Y Axis');
|
|
115
|
+
_defineProperty(ChartTestUtils, "DEFAULT_SERIES_NAME", 'MySeries');
|
|
116
|
+
export default ChartTestUtils;
|
|
117
|
+
//# sourceMappingURL=ChartTestUtils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChartTestUtils.js","names":["ChartTestUtils","constructor","dh","makeAxis","label","type","undefined","position","formatType","formatPattern","log","Axis","plot","AxisType","X","AxisPosition","BOTTOM","FORMAT_TYPE_NUMBER","makeDefaultAxes","DEFAULT_X_TITLE","DEFAULT_Y_TITLE","Y","makeSource","axis","SeriesDataSource","makeDefaultSources","axes","map","makeSeries","name","DEFAULT_SERIES_NAME","plotStyle","sources","lineColor","shapeColor","Series","SeriesPlotStyle","SCATTER","makeChart","title","DEFAULT_CHART_TITLE","series","showLegend","rowspan","colspan","row","column","Chart","makeFigure","charts","rows","cols","Figure"],"sources":["../src/ChartTestUtils.ts"],"sourcesContent":["import type {\n Axis,\n AxisFormatType,\n AxisPosition,\n AxisType,\n Chart,\n dh as DhType,\n Figure,\n Series,\n SeriesDataSource,\n} from '@deephaven/jsapi-types';\n\nclass ChartTestUtils {\n static DEFAULT_CHART_TITLE = 'Chart Title';\n\n static DEFAULT_X_TITLE = 'X Axis';\n\n static DEFAULT_Y_TITLE = 'Y Axis';\n\n static DEFAULT_SERIES_NAME = 'MySeries';\n\n private dh: DhType;\n\n constructor(dh: DhType) {\n this.dh = dh;\n }\n\n makeAxis({\n label = 'Axis',\n type = undefined,\n position = undefined,\n formatType = undefined,\n formatPattern = '###,###0.00',\n log = false,\n }: {\n label?: string;\n type?: AxisType;\n position?: AxisPosition;\n formatType?: AxisFormatType;\n formatPattern?: string;\n log?: boolean;\n } = {}): Axis {\n const { dh } = this;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return new (dh as any).Axis({\n label,\n type: type ?? dh.plot.AxisType.X,\n position: position ?? dh.plot.AxisPosition.BOTTOM,\n formatType: formatType ?? dh.Axis.FORMAT_TYPE_NUMBER,\n formatPattern,\n log,\n });\n }\n\n makeDefaultAxes(): Axis[] {\n const { dh } = this;\n return [\n this.makeAxis({\n label: ChartTestUtils.DEFAULT_X_TITLE,\n type: dh.plot.AxisType.X,\n }),\n this.makeAxis({\n label: ChartTestUtils.DEFAULT_Y_TITLE,\n type: dh.plot.AxisType.Y,\n }),\n ];\n }\n\n makeSource({ axis = this.makeAxis() }: { axis: Axis }): SeriesDataSource {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return new (this.dh as any).SeriesDataSource({ axis, type: axis.type });\n }\n\n makeDefaultSources(): SeriesDataSource[] {\n const axes = this.makeDefaultAxes();\n return axes.map(axis => this.makeSource({ axis }));\n }\n\n makeSeries({\n name = ChartTestUtils.DEFAULT_SERIES_NAME,\n plotStyle = null,\n sources = this.makeDefaultSources(),\n lineColor = null,\n shapeColor = null,\n } = {}): Series {\n const { dh } = this;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return new (dh as any).Series(\n name,\n plotStyle ?? dh.plot.SeriesPlotStyle.SCATTER,\n sources,\n lineColor,\n shapeColor\n );\n }\n\n makeChart({\n title = ChartTestUtils.DEFAULT_CHART_TITLE,\n series = [this.makeSeries()],\n axes = this.makeDefaultAxes(),\n showLegend = null,\n rowspan = 1,\n colspan = 1,\n row = 0,\n column = 0,\n }: {\n title?: string;\n series?: Series[];\n axes?: Axis[];\n showLegend?: boolean | null;\n rowspan?: number;\n colspan?: number;\n row?: number;\n column?: number;\n } = {}): Chart {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return new (this.dh as any).Chart({\n title,\n series,\n axes,\n showLegend,\n row,\n column,\n rowspan,\n colspan,\n });\n }\n\n makeFigure({\n title = 'Figure',\n charts = [this.makeChart()],\n rows = 1,\n cols = 1,\n } = {}): Figure {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return new (this.dh as any).plot.Figure({ title, charts, rows, cols });\n }\n}\n\nexport default ChartTestUtils;\n"],"mappings":";;;AAYA,MAAMA,cAAc,CAAC;EAWnBC,WAAW,CAACC,EAAU,EAAE;IAAA;IACtB,IAAI,CAACA,EAAE,GAAGA,EAAE;EACd;EAEAC,QAAQ,GAcM;IAAA,IAdL;MACPC,KAAK,GAAG,MAAM;MACdC,IAAI,GAAGC,SAAS;MAChBC,QAAQ,GAAGD,SAAS;MACpBE,UAAU,GAA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AAC;IACJ;IACA,OAAO,IAAK,IAAI,CAACjD,EAAE,CAASU,IAAI,CAACwC,MAAM,CAAC;MAAEb,KAAK;MAAEU,MAAM;MAAEC,IAAI;MAAEC;IAAK,CAAC,CAAC;EACxE;AACF;AAAC,gBA7HKnD,cAAc,yBACW,aAAa;AAAA,gBADtCA,cAAc,qBAGO,QAAQ;AAAA,gBAH7BA,cAAc,qBAKO,QAAQ;AAAA,gBAL7BA,cAAc,yBAOW,UAAU;AAwHzC,eAAeA,cAAc"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import ChartTheme from "./ChartTheme.module.css";
|
|
2
|
+
export default Object.freeze({
|
|
3
|
+
paper_bgcolor: ChartTheme['paper-bgcolor'],
|
|
4
|
+
plot_bgcolor: ChartTheme['plot-bgcolor'],
|
|
5
|
+
title_color: ChartTheme['title-color'],
|
|
6
|
+
colorway: ChartTheme.colorway,
|
|
7
|
+
gridcolor: ChartTheme.gridcolor,
|
|
8
|
+
linecolor: ChartTheme.linecolor,
|
|
9
|
+
zerolinecolor: ChartTheme.zerolinecolor,
|
|
10
|
+
activecolor: ChartTheme.activecolor,
|
|
11
|
+
rangebgcolor: ChartTheme.rangebgcolor,
|
|
12
|
+
area_color: ChartTheme['area-color'],
|
|
13
|
+
trend_color: ChartTheme['trend-color'],
|
|
14
|
+
line_color: ChartTheme['line-color'],
|
|
15
|
+
error_band_line_color: ChartTheme['error-band-line-color'],
|
|
16
|
+
error_band_fill_color: ChartTheme['error-band-fill-color'],
|
|
17
|
+
ohlc_increasing: ChartTheme['ohlc-increasing'],
|
|
18
|
+
ohlc_decreasing: ChartTheme['ohlc-decreasing']
|
|
19
|
+
});
|
|
20
|
+
//# sourceMappingURL=ChartTheme.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChartTheme.js","names":["ChartTheme","Object","freeze","paper_bgcolor","plot_bgcolor","title_color","colorway","gridcolor","linecolor","zerolinecolor","activecolor","rangebgcolor","area_color","trend_color","line_color","error_band_line_color","error_band_fill_color","ohlc_increasing","ohlc_decreasing"],"sources":["../src/ChartTheme.ts"],"sourcesContent":["import ChartTheme from './ChartTheme.module.scss';\n\nexport default Object.freeze({\n paper_bgcolor: ChartTheme['paper-bgcolor'],\n plot_bgcolor: ChartTheme['plot-bgcolor'],\n title_color: ChartTheme['title-color'],\n colorway: ChartTheme.colorway,\n gridcolor: ChartTheme.gridcolor,\n linecolor: ChartTheme.linecolor,\n zerolinecolor: ChartTheme.zerolinecolor,\n activecolor: ChartTheme.activecolor,\n rangebgcolor: ChartTheme.rangebgcolor,\n area_color: ChartTheme['area-color'],\n trend_color: ChartTheme['trend-color'],\n line_color: ChartTheme['line-color'],\n error_band_line_color: ChartTheme['error-band-line-color'],\n error_band_fill_color: ChartTheme['error-band-fill-color'],\n ohlc_increasing: ChartTheme['ohlc-increasing'],\n ohlc_decreasing: ChartTheme['ohlc-decreasing'],\n});\n"],"mappings":"OAAOA,UAAU;AAEjB,eAAeC,MAAM,CAACC,MAAM,CAAC;EAC3BC,aAAa,EAAEH,UAAU,CAAC,eAAe,CAAC;EAC1CI,YAAY,EAAEJ,UAAU,CAAC,cAAc,CAAC;EACxCK,WAAW,EAAEL,UAAU,CAAC,aAAa,CAAC;EACtCM,QAAQ,EAAEN,UAAU,CAACM,QAAQ;EAC7BC,SAAS,EAAEP,UAAU,CAACO,SAAS;EAC/BC,SAAS,EAAER,UAAU,CAACQ,SAAS;EAC/BC,aAAa,EAAET,UAAU,CAACS,aAAa;EACvCC,WAAW,EAAEV,UAAU,CAACU,WAAW;EACnCC,YAAY,EAAEX,UAAU,CAACW,YAAY;EACrCC,UAAU,EAAEZ,UAAU,CAAC,YAAY,CAAC;EACpCa,WAAW,EAAEb,UAAU,CAAC,aAAa,CAAC;EACtCc,UAAU,EAAEd,UAAU,CAAC,YAAY,CAAC;EACpCe,qBAAqB,EAAEf,UAAU,CAAC,uBAAuB,CAAC;EAC1DgB,qBAAqB,EAAEhB,UAAU,CAAC,uBAAuB,CAAC;EAC1DiB,eAAe,EAAEjB,UAAU,CAAC,iBAAiB,CAAC;EAC9CkB,eAAe,EAAElB,UAAU,CAAC,iBAAiB;AAC/C,CAAC,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/* stylelint-disable */
|
|
2
|
+
/* stylelint-disable scss/at-import-no-partial-leading-underscore */
|
|
3
|
+
:export {
|
|
4
|
+
paper-bgcolor: #2d2a2e;
|
|
5
|
+
plot-bgcolor: #322f33;
|
|
6
|
+
title-color: #f0f0ee;
|
|
7
|
+
colorway: #76d9e4 #9edc6f #fcd65b #aa9af4 #f37e3f #f95d84 #f0f0ee;
|
|
8
|
+
gridcolor: #403e41;
|
|
9
|
+
linecolor: #5b5a5c;
|
|
10
|
+
zerolinecolor: #c0bfbf;
|
|
11
|
+
activecolor: #4878ea;
|
|
12
|
+
rangebgcolor: rgba(91, 90, 92, 0.7);
|
|
13
|
+
area-color: #76d9e4;
|
|
14
|
+
trend-color: #d5f0c1;
|
|
15
|
+
line-color: #9edc6f;
|
|
16
|
+
error-band-line-color: white;
|
|
17
|
+
error-band-fill-color: rgba(213, 240, 193, 0.1);
|
|
18
|
+
ohlc-increasing: #9edc6f;
|
|
19
|
+
ohlc-decreasing: #f95d84;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/*# sourceMappingURL=ChartTheme.module.css.map */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sourceRoot":"","sources":["../src/ChartTheme.module.scss","../../../node_modules/@deephaven/components/scss/custom.scss","../../../node_modules/@deephaven/components/scss/bootstrap_overrides.scss"],"names":[],"mappings":"AAAA;ACAA;ADGA;EACE,eEOc;EFNd,cEqBS;EFpBT,aEOe;EFNf;EACA,WEgBS;EFfT,WEaS;EFZT,eEUS;EFTT,aECc;EFAd;EACA,YENK;EFOL;EACA,YETM;EFUN;EACA;EACA,iBEZM;EFaN,iBEhBI","file":"ChartTheme.module.css","sourcesContent":["/* stylelint-disable */\n@import '@deephaven/components/scss/custom.scss';\n\n:export {\n paper-bgcolor: $content-bg;\n plot-bgcolor: $gray-850;\n title-color: $white;\n colorway: $blue $green $yellow $purple $orange $red $white;\n gridcolor: $gray-700;\n linecolor: $gray-500;\n zerolinecolor: $gray-300;\n activecolor: $primary;\n rangebgcolor: rgba($gray-500, 0.7);\n area-color: $blue;\n trend-color: lighten($green, 20%);\n line-color: $green;\n error-band-line-color: lighten($green, 40%);\n error-band-fill-color: rgba(lighten($green, 20%), 0.1);\n ohlc-increasing: $green;\n ohlc-decreasing: $red;\n}\n","/* stylelint-disable scss/at-import-no-partial-leading-underscore */\n// Consumers should be able to resolve bootstrap/ to node_modules/bootstrap\n\n//Make bootstrap functions available for use in overrides\n@import 'bootstrap/scss/_functions.scss';\n@import './bootstrap_overrides.scss';\n\n//_variable imports come after bootstrap default overrides,\n// makes all other variables and mixins from bootstrap available\n/// with just importing customer.scss\n@import 'bootstrap/scss/_variables.scss';\n@import 'bootstrap/scss/_mixins.scss';\n\n//New variables come after imports\n@import './new_variables.scss';\n","// Styling overrides for bootstrap\n\n// Override / set color variables\n$red: #f95d84;\n$orange: #f37e3f;\n$yellow: #fcd65b;\n$green: #9edc6f;\n$blue: #76d9e4;\n$purple: #aa9af4;\n\n//Define some UI colors\n$interfacegray: #2d2a2e;\n$interfaceblue: #4878ea;\n$interfacewhite: #f0f0ee; //same as gray-200\n$interfaceblack: #1a171a;\n\n//Define our Gray scale\n$white: $interfacewhite;\n$gray-100: #fcfcfa;\n$gray-200: $interfacewhite;\n$gray-300: #c0bfbf;\n$gray-400: #929192;\n$gray-500: #5b5a5c;\n$gray-600: #555356;\n$gray-700: #403e41;\n$gray-800: #373438;\n$gray-850: #322f33;\n$gray-900: #211f22;\n$black: $interfaceblack;\n$content-bg: $interfacegray;\n$background: $interfaceblack;\n$foreground: $interfacewhite;\n\n//Load colors into map\n$colors: ();\n$colors: map-merge(\n (\n 'red': $red,\n 'orange': $orange,\n 'yellow': $yellow,\n 'green': $green,\n 'blue': $blue,\n 'purple': $purple,\n 'white': $white,\n 'black': $black,\n ),\n $colors\n);\n\n//Set default colors\n$body-bg: $black;\n$body-color: $interfacewhite;\n\n// Set brand colors\n$primary: $interfaceblue;\n$primary-hover: darken($primary, 8%);\n$primary-dark: mix($primary, $content-bg, 25%);\n$primary-light: scale-color($primary, $lightness: -25%);\n$secondary: $gray-500;\n$secondary-hover: darken($secondary, 8%);\n$success: $green;\n$info: $yellow;\n$warning: $orange;\n$danger: $red;\n$danger-hover: darken($danger, 8%);\n$light: $gray-100;\n$mid: $gray-400; //Added a mid color, useful for input styling\n$dark: $gray-800;\n$green-dark: scale-color($green, $lightness: -45%, $saturation: -10%);\n\n$theme-colors: () !default;\n$theme-colors: map-merge(\n (\n 'primary': $primary,\n 'primary-hover': $primary-hover,\n 'primary-light': $primary-light,\n 'primary-dark': $primary-dark,\n 'secondary': $secondary,\n 'success': $success,\n 'info': $info,\n 'warning': $warning,\n 'danger': $danger,\n 'light': $light,\n 'dark': $dark,\n 'mid': $mid,\n 'content-bg': $interfacegray,\n 'background': $interfaceblack,\n 'foreground': $interfacewhite,\n ),\n $theme-colors\n);\n\n$component-active-bg: $primary;\n$theme-color-interval: 9%;\n$yiq-contrasted-threshold: 180;\n\n// Override fonts\n$font-family-sans-serif: 'Fira Sans', -apple-system, blinkmacsystemfont,\n 'Segoe UI', 'Roboto', 'Helvetica Neue', arial, sans-serif; //fira sans then native system ui fallbacks\n$font-family-monospace: 'Fira Mono', menlo, monaco, consolas, 'Liberation Mono',\n 'Courier New', monospace;\n$font-family-base: $font-family-sans-serif;\n\n$headings-font-weight: 400;\n\n//Text overides\n$text-muted: $gray-400;\n\n//Style Selection highlight color\n//so browsers add alpha to your color by default, ignoring opacity 1\n//by setting rgba with 0.99 it tricks browser into thinking there is alpha applied\n$text-select-color: $primary-hover;\n$text-select-color-editor: lighten(\n $gray-700,\n 15%\n); //we lighten it abit to account for that 0.01 loss, and because it needs some anyways.\n\n//Grid variables, same value as default just making easily accessible\n$grid-gutter-width: 30px;\n\n//Visual Overrides\n$border-radius: 4px;\n$box-shadow: 0 0.1rem 1rem rgba($black, 45%); //because our UI is so dark, we need darker default shadows\n$box-shadow-900: 0 0.1rem 1rem rgba(0, 0, 0, 45%); //darkest shadow for $black popups over $black UI\n\n//Override Btn\n$btn-border-radius: 4rem;\n$btn-padding-x: 1.5rem;\n$btn-transition: color 0.12s ease-in-out, background-color 0.12s ease-in-out,\n border-color 0.12s ease-in-out, box-shadow 0.12s ease-in-out; //default 0.15 is too long\n$btn-border-width: 2px;\n\n//Override Inputs\n$input-bg: $gray-600;\n$input-disabled-bg: $gray-800;\n$input-color: $foreground;\n$input-border-color: $gray-400;\n$input-placeholder-color: $gray-400;\n$input-focus-border-color: rgba($primary, 85%);\n\n$input-btn-focus-width: 0.2rem;\n$input-btn-focus-color: rgba($component-active-bg, 35%);\n$input-btn-focus-box-shadow: 0 0 0 $input-btn-focus-width $input-btn-focus-color;\n\n//checkbox\n$custom-control-indicator-bg: $gray-600;\n$custom-control-indicator-bg-size: 75% 75%;\n$custom-control-indicator-disabled-bg: $gray-800;\n$custom-control-indicator-checked-disabled-bg: $gray-800;\n$custom-control-label-disabled-color: $gray-400;\n\n//Custom Select\n$custom-select-indicator-color: $gray-400;\n$custom-select-bg-size: 16px 16px;\n//dhSort icon encoded\n$custom-select-indicator: str-replace(\n url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='#{$custom-select-indicator-color}' d='M4 7l-.4-.8 4-3.7h.8l4 3.7-.4.8H4zm0 2l-.4.8 4 3.7h.8l4-3.7L12 9H4z'/%3E%3C/svg%3E\"),\n '#',\n '%23'\n);\n$custom-select-focus-box-shadow: $input-btn-focus-box-shadow;\n$custom-select-disabled-color: darken($gray-400, 5%);\n$custom-select-disabled-bg: $gray-800;\n\n//modal\n$modal-content-bg: $gray-200;\n$modal-content-border-width: 0;\n$modal-md: 550px;\n\n// Toast notification\n$toast-bg: $primary-dark;\n$toast-color: $foreground;\n$toast-error-bg: mix($danger, $content-bg, 15%);\n$toast-error-color: $foreground;\n\n//tooltips\n$tooltip-bg: $gray-700;\n$tooltip-color: $foreground;\n$tooltip-box-shadow: 0 0.1rem 1.5rem 0.1rem rgba($black, 80%);\n\n//drowdowns\n$dropdown-bg: $gray-600;\n$dropdown-link-color: $foreground;\n$dropdown-link-hover-color: $foreground;\n$dropdown-link-hover-bg: $primary;\n$dropdown-divider-bg: $gray-700;\n\n//context menus\n$contextmenu-bg: $gray-600;\n$contextmenu-color: $foreground;\n$contextmenu-disabled-color: $text-muted;\n$contextmenu-keyboard-selected-bg: rgba($primary, 50%);\n$contextmenu-selected-bg: $primary;\n$contextmenu-selected-color: $foreground;\n\n//links\n$link-color: $gray-400;\n$link-hover-color: $foreground;\n\n//progress-bar\n$progress-bg: $gray-600;\n$progress-border-radius: 1rem;\n\n// Set global options\n$enable-shadows: false;\n$enable-gradients: false;\n$enable-print-styles: false; //I don't think anyone should expect to \"print\" this app.\n\n// Transition times\n$transition: 0.15s;\n$transition-mid: 0.2s;\n$transition-long: 0.3s;\n$transition-slow: 0.6s;\n\n//form-validation icon, uses vsWarning icon encoded here as svg\n$form-feedback-icon-invalid-color: theme-color('danger');\n$form-feedback-icon-invalid: str-replace(\n url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cg fill='none'%3E%3Cg fill='#{$form-feedback-icon-invalid-color}'%3E%3Cpath d='M7.56 1h.88l6.54 12.26-.44.74H1.44L1 13.26 7.56 1zM8 2.28 2.28 13H13.7L8 2.28zM8.625 12v-1h-1.25v1h1.25zm-1.25-2V6h1.25v4h-1.25z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E \"),\n '#',\n '%23'\n);\n"]}
|