@deephaven/chart 0.53.1-layout-manager.4 → 0.54.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.
Files changed (60) hide show
  1. package/dist/Chart.css +4 -0
  2. package/dist/Chart.css.map +1 -1
  3. package/dist/Chart.d.ts +12 -1
  4. package/dist/Chart.d.ts.map +1 -1
  5. package/dist/Chart.js +96 -9
  6. package/dist/Chart.js.map +1 -1
  7. package/dist/ChartModel.d.ts +2 -0
  8. package/dist/ChartModel.d.ts.map +1 -1
  9. package/dist/ChartModel.js +6 -0
  10. package/dist/ChartModel.js.map +1 -1
  11. package/dist/ChartModelFactory.d.ts +5 -38
  12. package/dist/ChartModelFactory.d.ts.map +1 -1
  13. package/dist/ChartModelFactory.js +6 -11
  14. package/dist/ChartModelFactory.js.map +1 -1
  15. package/dist/ChartTestUtils.d.ts +2 -1
  16. package/dist/ChartTestUtils.d.ts.map +1 -1
  17. package/dist/ChartTestUtils.js +4 -2
  18. package/dist/ChartTestUtils.js.map +1 -1
  19. package/dist/ChartTheme.d.ts +4 -3
  20. package/dist/ChartTheme.d.ts.map +1 -1
  21. package/dist/ChartTheme.js +38 -19
  22. package/dist/ChartTheme.js.map +1 -1
  23. package/dist/ChartTheme.module.css +16 -16
  24. package/dist/ChartTheme.module.css.map +1 -1
  25. package/dist/ChartThemeProvider.d.ts +9 -0
  26. package/dist/ChartThemeProvider.d.ts.map +1 -0
  27. package/dist/ChartThemeProvider.js +35 -0
  28. package/dist/ChartThemeProvider.js.map +1 -0
  29. package/dist/ChartUtils.d.ts +12 -129
  30. package/dist/ChartUtils.d.ts.map +1 -1
  31. package/dist/ChartUtils.js +19 -26
  32. package/dist/ChartUtils.js.map +1 -1
  33. package/dist/DownsamplingError.d.ts +5 -0
  34. package/dist/DownsamplingError.d.ts.map +1 -0
  35. package/dist/DownsamplingError.js +11 -0
  36. package/dist/DownsamplingError.js.map +1 -0
  37. package/dist/FigureChartModel.d.ts +4 -3
  38. package/dist/FigureChartModel.d.ts.map +1 -1
  39. package/dist/FigureChartModel.js +15 -11
  40. package/dist/FigureChartModel.js.map +1 -1
  41. package/dist/MockChartModel.d.ts +3 -0
  42. package/dist/MockChartModel.d.ts.map +1 -1
  43. package/dist/MockChartModel.js +21 -11
  44. package/dist/MockChartModel.js.map +1 -1
  45. package/dist/index.d.ts +4 -1
  46. package/dist/index.d.ts.map +1 -1
  47. package/dist/index.js +4 -1
  48. package/dist/index.js.map +1 -1
  49. package/dist/plotly/Plot.d.ts.map +1 -1
  50. package/dist/plotly/Plot.js +3 -8
  51. package/dist/plotly/Plot.js.map +1 -1
  52. package/dist/plotly/createPlotlyComponent.d.ts +4 -0
  53. package/dist/plotly/createPlotlyComponent.d.ts.map +1 -0
  54. package/dist/plotly/createPlotlyComponent.js +13 -0
  55. package/dist/plotly/createPlotlyComponent.js.map +1 -0
  56. package/dist/useChartTheme.d.ts +7 -0
  57. package/dist/useChartTheme.d.ts.map +1 -0
  58. package/dist/useChartTheme.js +10 -0
  59. package/dist/useChartTheme.js.map +1 -0
  60. package/package.json +11 -9
@@ -1 +1 @@
1
- {"version":3,"file":"ChartModel.js","names":["ChartModel","constructor","dh","_defineProperty","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_L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oBAAoBA,CAACX,MAAe,EAAQ;IAC1C,IAAI,CAACR,SAAS,CACZ,IAAIM,WAAW,CAACjC,UAAU,CAAC+C,sBAAsB,EAAE;MAAEZ;IAAO,CAAC,CAC/D,CAAC;EACH;EAEAa,gBAAgBA,CAAA,EAAS;IACvB,IAAI,CAACrB,SAAS,CAAC,IAAIM,WAAW,CAACjC,UAAU,CAACiD,kBAAkB,CAAC,CAAC;EAChE;AACF;AAAC9C,eAAA,CArJKH,UAAU,mBACS,0BAA0B;AAAAG,eAAA,CAD7CH,UAAU,sBAGY,6BAA6B;AAAAG,eAAA,CAHnDH,UAAU,qBAKW,4BAA4B;AAAAG,eAAA,CALjDH,UAAU,6BAOmB,oCAAoC;AAAAG,eAAA,CAPjEH,UAAU,8BASoB,qCAAqC;AAAAG,eAAA,CATnEH,UAAU,4BAWkB,mCAAmC;AAAAG,eAAA,CAX/DH,UAAU,4BAakB,mCAAmC;AAAAG,eAAA,CAb/DH,UAAU,wBAec,+BAA+B;AAwI7D,eAAeA,UAAU"}
1
+ {"version":3,"file":"ChartModel.js","names":["ChartModel","constructor","dh","_defineProperty","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","fireError","EVENT_ERROR"],"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 static EVENT_ERROR = 'ChartModel.EVENT_ERROR';\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 fireError(detail: string[]): void {\n this.fireEvent(new CustomEvent(ChartModel.EVENT_ERROR, { detail }));\n }\n}\n\nexport default ChartModel;\n"],"mappings":";;;AAAA;AACA;;AAQA;AACA;AACA;AACA;AACA;AACA,MAAMA,UAAU,CAAC;EAmBfC,WAAWA,CAACC,EAAU,EAAE;IAAAC,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IACtB,IAAI,CAACD,EAAE,GAAGA,EAAE;IACZ,IAAI,CAACE,SAAS,GAAG,EAAE;IACnB,IAAI,CAACC,sBAAsB,GAAG,KAAK;EACrC;EAcAC,OAAOA,CAAA,EAAoB;IACzB,OAAO,EAAE;EACX;EAEAC,eAAeA,CAAA,EAAW;IACxB,OAAO,EAAE;EACX;EAEAC,SAASA,CAAA,EAAoB;IAC3B,OAAO,CAAC,CAAC;EACX;EAEAC,kBAAkBA,CAAA,EAAoB;IACpC,OAAO,IAAIC,GAAG,CAAC,CAAC;EAClB;EAEAC,gBAAgBA,CAAA,EAAY;IAC1B,OAAO,KAAK;EACd;;EAEA;EACAC,SAASA,CAACC,MAAiB,EAAQ,CAAC;;EAEpC;AACF;AACA;EACE;EACAC,KAAKA,CAAA,EAAS,CAAC;;EAEf;AACF;AACA;AACA;EACEC,YAAYA,CAACC,SAAoB,EAAQ;IACvC,IAAI,CAACA,SAAS,GAAGA,SAAS;EAC5B;;EAEA;AACF;AACA;AACA;EACEC,uBAAuBA,CAACZ,sBAA+B,EAAQ;IAC7D,IAAI,CAACA,sBAAsB,GAAGA,sBAAsB;EACtD;;EAEA;AACF;AACA;AACA;EACEa,aAAaA,CAACC,IAAa,EAAQ;IACjC,IAAI,CAACA,IAAI,GAAGA,IAAI;EAClB;EAEAC,QAAQA,CAACC,KAAa,EAAQ;IAC5B,IAAI,CAACA,KAAK,GAAGA,KAAK;EACpB;;EAEA;AACF;AACA;AACA;EACEC,SAASA,CAACC,QAAqC,EAAQ;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AU,CAAC6C,sBAAsB,EAAE;MAAEV;IAAO,CAAC,CAC/D,CAAC;EACH;EAEAW,oBAAoBA,CAACX,MAAe,EAAQ;IAC1C,IAAI,CAACR,SAAS,CACZ,IAAIM,WAAW,CAACjC,UAAU,CAAC+C,sBAAsB,EAAE;MAAEZ;IAAO,CAAC,CAC/D,CAAC;EACH;EAEAa,gBAAgBA,CAAA,EAAS;IACvB,IAAI,CAACrB,SAAS,CAAC,IAAIM,WAAW,CAACjC,UAAU,CAACiD,kBAAkB,CAAC,CAAC;EAChE;EAEAC,SAASA,CAACf,MAAgB,EAAQ;IAChC,IAAI,CAACR,SAAS,CAAC,IAAIM,WAAW,CAACjC,UAAU,CAACmD,WAAW,EAAE;MAAEhB;IAAO,CAAC,CAAC,CAAC;EACrE;AACF;AAAChC,eAAA,CA3JKH,UAAU,mBACS,0BAA0B;AAAAG,eAAA,CAD7CH,UAAU,sBAGY,6BAA6B;AAAAG,eAAA,CAHnDH,UAAU,qBAKW,4BAA4B;AAAAG,eAAA,CALjDH,UAAU,6BAOmB,oCAAoC;AAAAG,eAAA,CAPjEH,UAAU,8BASoB,qCAAqC;AAAAG,eAAA,CATnEH,UAAU,4BAWkB,mCAAmC;AAAAG,eAAA,CAX/DH,UAAU,4BAakB,mCAAmC;AAAAG,eAAA,CAb/DH,UAAU,wBAec,+BAA+B;AAAAG,eAAA,CAfvDH,UAAU,iBAiBO,wBAAwB;AA4I/C,eAAeA,UAAU"}
@@ -1,5 +1,6 @@
1
1
  import type { dh as DhType, Figure, Table } from '@deephaven/jsapi-types';
2
2
  import { ChartModelSettings } from './ChartUtils';
3
+ import { ChartTheme } from './ChartTheme';
3
4
  import ChartModel from './ChartModel';
4
5
  declare class ChartModelFactory {
5
6
  /**
@@ -13,29 +14,12 @@ declare class ChartModelFactory {
13
14
  * @param settings.xAxis The column name to use for the x-axis
14
15
  * @param [settings.hiddenSeries] Array of hidden series names
15
16
  * @param table The table to build the model for
16
- * @param theme The theme for the figure. Defaults to ChartTheme
17
+ * @param theme The theme for the figure
17
18
  * @returns The ChartModel Promise representing the figure
18
19
  * CRA sets tsconfig to type check JS based on jsdoc comments. It isn't able to figure out FigureChartModel extends ChartModel
19
20
  * This causes TS issues in 1 or 2 spots. Once this is TS it can be returned to just FigureChartModel
20
21
  */
21
- static makeModelFromSettings(dh: DhType, settings: ChartModelSettings, table: Table, theme?: Readonly<{
22
- paper_bgcolor: string;
23
- plot_bgcolor: string;
24
- title_color: string;
25
- colorway: string;
26
- gridcolor: string;
27
- linecolor: string;
28
- zerolinecolor: string;
29
- activecolor: string;
30
- rangebgcolor: string;
31
- area_color: string;
32
- trend_color: string;
33
- line_color: string;
34
- error_band_line_color: string;
35
- error_band_fill_color: string;
36
- ohlc_increasing: string;
37
- ohlc_decreasing: string;
38
- }>): Promise<ChartModel>;
22
+ static makeModelFromSettings(dh: DhType, settings: ChartModelSettings, table: Table, theme: ChartTheme): Promise<ChartModel>;
39
23
  /**
40
24
  * Creates a model from the settings provided.
41
25
  * Tries to create a Figure in the API with it.
@@ -61,29 +45,12 @@ declare class ChartModelFactory {
61
45
  * @param settings.xAxis The column name to use for the x-axis
62
46
  * @param [settings.hiddenSeries] Array of hidden series names
63
47
  * @param figure The figure to build the model for
64
- * @param theme The theme for the figure. Defaults to ChartTheme
48
+ * @param theme The theme for the figure
65
49
  * @returns The FigureChartModel representing the figure
66
50
  * CRA sets tsconfig to type check JS based on jsdoc comments. It isn't able to figure out FigureChartModel extends ChartModel
67
51
  * This causes TS issues in 1 or 2 spots. Once this is TS it can be returned to just FigureChartModel
68
52
  */
69
- static makeModel(dh: DhType, settings: ChartModelSettings | undefined, figure: Figure, theme?: Readonly<{
70
- paper_bgcolor: string;
71
- plot_bgcolor: string;
72
- title_color: string;
73
- colorway: string;
74
- gridcolor: string;
75
- linecolor: string;
76
- zerolinecolor: string;
77
- activecolor: string;
78
- rangebgcolor: string;
79
- area_color: string;
80
- trend_color: string;
81
- line_color: string;
82
- error_band_line_color: string;
83
- error_band_fill_color: string;
84
- ohlc_increasing: string;
85
- ohlc_decreasing: string;
86
- }>): Promise<ChartModel>;
53
+ static makeModel(dh: DhType, settings: ChartModelSettings | undefined, figure: Figure, theme: ChartTheme): Promise<ChartModel>;
87
54
  }
88
55
  export default ChartModelFactory;
89
56
  //# sourceMappingURL=ChartModelFactory.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ChartModelFactory.d.ts","sourceRoot":"","sources":["../src/ChartModelFactory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,IAAI,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAC1E,OAAmB,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAG9D,OAAO,UAAU,MAAM,cAAc,CAAC;AAEtC,cAAM,iBAAiB;IACrB;;;;;;;;;;;;;;;OAeG;WACU,qBAAqB,CAChC,EAAE,EAAE,MAAM,EACV,QAAQ,EAAE,kBAAkB,EAC5B,KAAK,EAAE,KAAK,EACZ,KAAK;;;;;;;;;;;;;;;;;MAAa,GACjB,OAAO,CAAC,UAAU,CAAC;IAStB;;;;;;;;;;;;OAYG;WACU,sBAAsB,CACjC,EAAE,EAAE,MAAM,EACV,QAAQ,EAAE,kBAAkB,EAC5B,KAAK,EAAE,KAAK,GACX,OAAO,CAAC,MAAM,CAAC;IAelB;;;;;;;;;;;;;;;OAeG;WACU,SAAS,CACpB,EAAE,EAAE,MAAM,EACV,QAAQ,EAAE,kBAAkB,GAAG,SAAS,EACxC,MAAM,EAAE,MAAM,EACd,KAAK;;;;;;;;;;;;;;;;;MAAa,GACjB,OAAO,CAAC,UAAU,CAAC;CAGvB;AAED,eAAe,iBAAiB,CAAC"}
1
+ {"version":3,"file":"ChartModelFactory.d.ts","sourceRoot":"","sources":["../src/ChartModelFactory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,IAAI,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAC1E,OAAmB,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAE9D,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,UAAU,MAAM,cAAc,CAAC;AAEtC,cAAM,iBAAiB;IACrB;;;;;;;;;;;;;;;OAeG;WACU,qBAAqB,CAChC,EAAE,EAAE,MAAM,EACV,QAAQ,EAAE,kBAAkB,EAC5B,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,UAAU,GAChB,OAAO,CAAC,UAAU,CAAC;IAStB;;;;;;;;;;;;OAYG;WACU,sBAAsB,CACjC,EAAE,EAAE,MAAM,EACV,QAAQ,EAAE,kBAAkB,EAC5B,KAAK,EAAE,KAAK,GACX,OAAO,CAAC,MAAM,CAAC;IAelB;;;;;;;;;;;;;;;OAeG;WACU,SAAS,CACpB,EAAE,EAAE,MAAM,EACV,QAAQ,EAAE,kBAAkB,GAAG,SAAS,EACxC,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,UAAU,GAChB,OAAO,CAAC,UAAU,CAAC;CAGvB;AAED,eAAe,iBAAiB,CAAC"}
@@ -2,7 +2,6 @@ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try
2
2
  function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
3
3
  import ChartUtils from "./ChartUtils.js";
4
4
  import FigureChartModel from "./FigureChartModel.js";
5
- import ChartTheme from "./ChartTheme.js";
6
5
  class ChartModelFactory {
7
6
  /**
8
7
  * Creates a model from the settings provided.
@@ -15,17 +14,15 @@ class ChartModelFactory {
15
14
  * @param settings.xAxis The column name to use for the x-axis
16
15
  * @param [settings.hiddenSeries] Array of hidden series names
17
16
  * @param table The table to build the model for
18
- * @param theme The theme for the figure. Defaults to ChartTheme
17
+ * @param theme The theme for the figure
19
18
  * @returns The ChartModel Promise representing the figure
20
19
  * CRA sets tsconfig to type check JS based on jsdoc comments. It isn't able to figure out FigureChartModel extends ChartModel
21
20
  * This causes TS issues in 1 or 2 spots. Once this is TS it can be returned to just FigureChartModel
22
21
  */
23
- static makeModelFromSettings(dh, settings, table) {
24
- var _arguments = arguments;
22
+ static makeModelFromSettings(dh, settings, table, theme) {
25
23
  return _asyncToGenerator(function* () {
26
- var theme = _arguments.length > 3 && _arguments[3] !== undefined ? _arguments[3] : ChartTheme;
27
24
  var figure = yield ChartModelFactory.makeFigureFromSettings(dh, settings, table);
28
- return new FigureChartModel(dh, figure, settings, theme);
25
+ return new FigureChartModel(dh, figure, theme, settings);
29
26
  })();
30
27
  }
31
28
 
@@ -67,16 +64,14 @@ class ChartModelFactory {
67
64
  * @param settings.xAxis The column name to use for the x-axis
68
65
  * @param [settings.hiddenSeries] Array of hidden series names
69
66
  * @param figure The figure to build the model for
70
- * @param theme The theme for the figure. Defaults to ChartTheme
67
+ * @param theme The theme for the figure
71
68
  * @returns The FigureChartModel representing the figure
72
69
  * CRA sets tsconfig to type check JS based on jsdoc comments. It isn't able to figure out FigureChartModel extends ChartModel
73
70
  * This causes TS issues in 1 or 2 spots. Once this is TS it can be returned to just FigureChartModel
74
71
  */
75
- static makeModel(dh, settings, figure) {
76
- var _arguments2 = arguments;
72
+ static makeModel(dh, settings, figure, theme) {
77
73
  return _asyncToGenerator(function* () {
78
- var theme = _arguments2.length > 3 && _arguments2[3] !== undefined ? _arguments2[3] : ChartTheme;
79
- return new FigureChartModel(dh, figure, settings, theme);
74
+ return new FigureChartModel(dh, figure, theme, settings);
80
75
  })();
81
76
  }
82
77
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ChartModelFactory.js","names":["ChartUtils","FigureChartModel","ChartTheme","ChartModelFactory","makeModelFromSettings","dh","settings","table","_arguments","arguments","_asyncToGenerator","theme","length","undefined","figure","makeFigureFromSettings","tableCopy","copy","applyCustomColumns","customColumns","applyFilter","filter","applySort","sort","plot","Figure","create","makeFigureSettings","makeModel","_arguments2"],"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,qBAAqBA,CAChCC,EAAU,EACVC,QAA4B,EAC5BC,KAAY,EAES;IAAA,IAAAC,UAAA,GAAAC,SAAA;IAAA,OAAAC,iBAAA;MAAA,IADrBC,KAAK,GAAAH,UAAA,CAAAI,MAAA,QAAAJ,UAAA,QAAAK,SAAA,GAAAL,UAAA,MAAGN,UAAU;MAElB,IAAMY,MAAM,SAASX,iBAAiB,CAACY,sBAAsB,CAC3DV,EAAE,EACFC,QAAQ,EACRC,KACF,CAAC;MACD,OAAO,IAAIN,gBAAgB,CAACI,EAAE,EAAES,MAAM,EAAER,QAAQ,EAAEK,KAAK,CAAC;IAAC;EAC3D;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACE,OAAaI,sBAAsBA,CACjCV,EAAU,EACVC,QAA4B,EAC5BC,KAAY,EACK;IAAA,OAAAG,iBAAA;MACjB;MACA;MACA;MACA;MACA,IAAMM,SAAS,SAAST,KAAK,CAACU,IAAI,CAAC,CAAC;MACpCD,SAAS,CAACE,kBAAkB,CAACX,KAAK,CAACY,aAAa,CAAC;MACjDH,SAAS,CAACI,WAAW,CAACb,KAAK,CAACc,MAAM,CAAC;MACnCL,SAAS,CAACM,SAAS,CAACf,KAAK,CAACgB,IAAI,CAAC;MAE/B,OAAOlB,EAAE,CAACmB,IAAI,CAACC,MAAM,CAACC,MAAM,CAC1B,IAAI1B,UAAU,CAACK,EAAE,CAAC,CAACsB,kBAAkB,CAACrB,QAAQ,EAAEU,SAAS,CAC3D,CAAC;IAAC;EACJ;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACE,OAAaY,SAASA,CACpBvB,EAAU,EACVC,QAAwC,EACxCQ,MAAc,EAEO;IAAA,IAAAe,WAAA,GAAApB,SAAA;IAAA,OAAAC,iBAAA;MAAA,IADrBC,KAAK,GAAAkB,WAAA,CAAAjB,MAAA,QAAAiB,WAAA,QAAAhB,SAAA,GAAAgB,WAAA,MAAG3B,UAAU;MAElB,OAAO,IAAID,gBAAgB,CAACI,EAAE,EAAES,MAAM,EAAER,QAAQ,EAAEK,KAAK,CAAC;IAAC;EAC3D;AACF;AAEA,eAAeR,iBAAiB"}
1
+ {"version":3,"file":"ChartModelFactory.js","names":["ChartUtils","FigureChartModel","ChartModelFactory","makeModelFromSettings","dh","settings","table","theme","_asyncToGenerator","figure","makeFigureFromSettings","tableCopy","copy","applyCustomColumns","customColumns","applyFilter","filter","applySort","sort","plot","Figure","create","makeFigureSettings","makeModel"],"sources":["../src/ChartModelFactory.ts"],"sourcesContent":["import type { dh as DhType, Figure, Table } from '@deephaven/jsapi-types';\nimport ChartUtils, { ChartModelSettings } from './ChartUtils';\nimport FigureChartModel from './FigureChartModel';\nimport { ChartTheme } from './ChartTheme';\nimport ChartModel from './ChartModel';\n\nclass ChartModelFactory {\n /**\n * Creates a model from the settings provided.\n * Tries to create a Figure in the API with it.\n * @param dh JSAPI instance\n * @param settings The chart builder settings\n * @param settings.isLinked Whether the newly created chart should stay linked with the original table, update when filters are updated\n * @param settings.series The column names to use for creating the series of this chart\n * @param settings.type Chart builder type, from ChartBuilder.types\n * @param settings.xAxis The column name to use for the x-axis\n * @param [settings.hiddenSeries] Array of hidden series names\n * @param table The table to build the model for\n * @param theme The theme for the figure\n * @returns The ChartModel Promise representing the figure\n * CRA sets tsconfig to type check JS based on jsdoc comments. It isn't able to figure out FigureChartModel extends ChartModel\n * This causes TS issues in 1 or 2 spots. Once this is TS it can be returned to just FigureChartModel\n */\n static async makeModelFromSettings(\n dh: DhType,\n settings: ChartModelSettings,\n table: Table,\n theme: ChartTheme\n ): Promise<ChartModel> {\n const figure = await ChartModelFactory.makeFigureFromSettings(\n dh,\n settings,\n table\n );\n return new FigureChartModel(dh, figure, theme, settings);\n }\n\n /**\n * Creates a model from the settings provided.\n * Tries to create a Figure in the API with it.\n * @param dh DH JSAPI instance\n * @param settings The chart builder settings\n * @param settings.isLinked Whether the newly created chart should stay linked with the original table, update when filters are updated\n * @param settings.series The column names to use for creating the series of this chart\n * @param settings.type Chart builder type, from ChartBuilder.types\n * @param settings.xAxis The column name to use for the x-axis\n * @param [settings.hiddenSeries] Array of hidden series names\n * @param table The table to build the model for\n * @returns The Figure created with the settings provided\n */\n static async makeFigureFromSettings(\n dh: DhType,\n settings: ChartModelSettings,\n table: Table\n ): Promise<Figure> {\n // Copy the table first and then re-apply the filters from the original table\n // When we add table linking we'll want to listen to the original table and update\n // the copied table with any changes that occur.\n // The table gets owned by the Figure that gets created, which closes the table\n const tableCopy = await table.copy();\n tableCopy.applyCustomColumns(table.customColumns);\n tableCopy.applyFilter(table.filter);\n tableCopy.applySort(table.sort);\n\n return dh.plot.Figure.create(\n new ChartUtils(dh).makeFigureSettings(settings, tableCopy)\n );\n }\n\n /**\n * Creates a model from the settings provided.\n * Tries to create a Figure in the API with it.\n * @param dh DH JSAPI instance\n * @param settings The chart builder settings\n * @param settings.isLinked Whether the newly created chart should stay linked with the original table, update when filters are updated\n * @param settings.series The column names to use for creating the series of this chart\n * @param settings.type Chart builder type, from ChartBuilder.types\n * @param settings.xAxis The column name to use for the x-axis\n * @param [settings.hiddenSeries] Array of hidden series names\n * @param figure The figure to build the model for\n * @param theme The theme for the figure\n * @returns The FigureChartModel representing the figure\n * CRA sets tsconfig to type check JS based on jsdoc comments. It isn't able to figure out FigureChartModel extends ChartModel\n * This causes TS issues in 1 or 2 spots. Once this is TS it can be returned to just FigureChartModel\n */\n static async makeModel(\n dh: DhType,\n settings: ChartModelSettings | undefined,\n figure: Figure,\n theme: ChartTheme\n ): Promise<ChartModel> {\n return new FigureChartModel(dh, figure, theme, settings);\n }\n}\n\nexport default ChartModelFactory;\n"],"mappings":";;OACOA,UAAU;AAAA,OACVC,gBAAgB;AAIvB,MAAMC,iBAAiB,CAAC;EACtB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACE,OAAaC,qBAAqBA,CAChCC,EAAU,EACVC,QAA4B,EAC5BC,KAAY,EACZC,KAAiB,EACI;IAAA,OAAAC,iBAAA;MACrB,IAAMC,MAAM,SAASP,iBAAiB,CAACQ,sBAAsB,CAC3DN,EAAE,EACFC,QAAQ,EACRC,KACF,CAAC;MACD,OAAO,IAAIL,gBAAgB,CAACG,EAAE,EAAEK,MAAM,EAAEF,KAAK,EAAEF,QAAQ,CAAC;IAAC;EAC3D;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACE,OAAaK,sBAAsBA,CACjCN,EAAU,EACVC,QAA4B,EAC5BC,KAAY,EACK;IAAA,OAAAE,iBAAA;MACjB;MACA;MACA;MACA;MACA,IAAMG,SAAS,SAASL,KAAK,CAACM,IAAI,CAAC,CAAC;MACpCD,SAAS,CAACE,kBAAkB,CAACP,KAAK,CAACQ,aAAa,CAAC;MACjDH,SAAS,CAACI,WAAW,CAACT,KAAK,CAACU,MAAM,CAAC;MACnCL,SAAS,CAACM,SAAS,CAACX,KAAK,CAACY,IAAI,CAAC;MAE/B,OAAOd,EAAE,CAACe,IAAI,CAACC,MAAM,CAACC,MAAM,CAC1B,IAAIrB,UAAU,CAACI,EAAE,CAAC,CAACkB,kBAAkB,CAACjB,QAAQ,EAAEM,SAAS,CAC3D,CAAC;IAAC;EACJ;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACE,OAAaY,SAASA,CACpBnB,EAAU,EACVC,QAAwC,EACxCI,MAAc,EACdF,KAAiB,EACI;IAAA,OAAAC,iBAAA;MACrB,OAAO,IAAIP,gBAAgB,CAACG,EAAE,EAAEK,MAAM,EAAEF,KAAK,EAAEF,QAAQ,CAAC;IAAC;EAC3D;AACF;AAEA,eAAeH,iBAAiB"}
@@ -36,11 +36,12 @@ declare class ChartTestUtils {
36
36
  row?: number;
37
37
  column?: number;
38
38
  }): Chart;
39
- makeFigure({ title, charts, rows, cols, }?: {
39
+ makeFigure({ title, charts, rows, cols, errors, }?: {
40
40
  title?: string | undefined;
41
41
  charts?: Chart[] | undefined;
42
42
  rows?: number | undefined;
43
43
  cols?: number | undefined;
44
+ errors?: never[] | undefined;
44
45
  }): Figure;
45
46
  }
46
47
  export default ChartTestUtils;
@@ -1 +1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;IAczB,UAAU,CAAC,EAAE,IAAsB,EAAE,EAAE;QAAE,IAAI,EAAE,IAAI,CAAA;KAAE,GAAG,gBAAgB;IAKxE,kBAAkB,IAAI,gBAAgB,EAAE;IAKxC,UAAU,CAAC,EACT,IAAyC,EACzC,SAAgB,EAChB,OAAmC,EACnC,SAAgB,EAChB,UAAiB,GAClB;;;;;;KAAK,GAAG,MAAM;IAYf,SAAS,CAAC,EACR,KAA0C,EAC1C,MAA4B,EAC5B,IAA6B,EAC7B,UAAiB,EACjB,OAAW,EACX,OAAW,EACX,GAAO,EACP,MAAU,GACX,GAAE;QACD,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;QAClB,IAAI,CAAC,EAAE,IAAI,EAAE,CAAC;QACd,UAAU,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;QAC5B,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,GAAG,CAAC,EAAE,MAAM,CAAC;QACb,MAAM,CAAC,EAAE,MAAM,CAAC;KACZ,GAAG,KAAK;IAcd,UAAU,CAAC,EACT,KAAgB,EAChB,MAA2B,EAC3B,IAAQ,EACR,IAAQ,EACR,MAAW,GACZ;;;;;;KAAK,GAAG,MAAM;CAUhB;AAED,eAAe,cAAc,CAAC"}
@@ -98,14 +98,16 @@ class ChartTestUtils {
98
98
  title = 'Figure',
99
99
  charts = [this.makeChart()],
100
100
  rows = 1,
101
- cols = 1
101
+ cols = 1,
102
+ errors = []
102
103
  } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
103
104
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
104
105
  return new this.dh.plot.Figure({
105
106
  title,
106
107
  charts,
107
108
  rows,
108
- cols
109
+ cols,
110
+ errors
109
111
  });
110
112
  }
111
113
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ChartTestUtils.js","names":["ChartTestUtils","constructor","dh","_defineProperty","makeAxis","label","type","undefined","position","formatType","formatPattern","log","arguments","length","Axis","plot","AxisType","X","AxisPosition","BOTTOM","FORMAT_TYPE_NUMBER","makeDefaultAxes","DEFAULT_X_TITLE","DEFAULT_Y_TITLE","Y","makeSource","_ref","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,WAAWA,CAACC,EAAU,EAAE;IAAAC,eAAA;IACtB,IAAI,CAACD,EAAE,GAAGA,EAAE;EACd;EAEAE,QAAQA,CAAA,EAcM;IAAA,IAdL;MACPC,KAAK,GAAG,MAAM;MACdC,IAAI,GAAGC,SAAS;MAChBC,Q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AE,CAASiD,KAAK,CAAC;MAChCR,KAAK;MACLE,MAAM;MACNf,IAAI;MACJgB,UAAU;MACVG,GAAG;MACHC,MAAM;MACNH,OAAO;MACPC;IACF,CAAC,CAAC;EACJ;EAEAI,UAAUA,CAAA,EAKM;IAAA,IALL;MACTT,KAAK,GAAG,QAAQ;MAChBU,MAAM,GAAG,CAAC,IAAI,CAACX,SAAS,CAAC,CAAC,CAAC;MAC3BY,IAAI,GAAG,CAAC;MACRC,IAAI,GAAG;IACT,CAAC,GAAA3C,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAL,SAAA,GAAAK,SAAA,MAAG,CAAC,CAAC;IACJ;IACA,OAAO,IAAK,IAAI,CAACV,EAAE,CAASa,IAAI,CAACyC,MAAM,CAAC;MAAEb,KAAK;MAAEU,MAAM;MAAEC,IAAI;MAAEC;IAAK,CAAC,CAAC;EACxE;AACF;AAACpD,eAAA,CA7HKH,cAAc,yBACW,aAAa;AAAAG,eAAA,CADtCH,cAAc,qBAGO,QAAQ;AAAAG,eAAA,CAH7BH,cAAc,qBAKO,QAAQ;AAAAG,eAAA,CAL7BH,cAAc,yBAOW,UAAU;AAwHzC,eAAeA,cAAc"}
1
+ {"version":3,"file":"ChartTestUtils.js","names":["ChartTestUtils","constructor","dh","_defineProperty","makeAxis","label","type","undefined","position","formatType","formatPattern","log","arguments","length","Axis","plot","AxisType","X","AxisPosition","BOTTOM","FORMAT_TYPE_NUMBER","makeDefaultAxes","DEFAULT_X_TITLE","DEFAULT_Y_TITLE","Y","makeSource","_ref","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","errors","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 errors = [],\n } = {}): Figure {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return new (this.dh as any).plot.Figure({\n title,\n charts,\n rows,\n cols,\n errors,\n });\n }\n}\n\nexport default ChartTestUtils;\n"],"mappings":";;;AAYA,MAAMA,cAAc,CAAC;EAWnBC,WAAWA,CAACC,EAAU,EAAE;IAAAC,eAAA;IACtB,IAAI,CAACD,EAAE,GAAGA,EAAE;EACd;EAEAE,QAAQA,CAAA,EAcM;IAAA,IAdL;MACPC,KAAK,GAAG,MAAM;MACdC,IAAI,GAAGC,SAAS;MAChBC,QAAQ,GAAGD,SAAS;MACpBE,UAAU,GAAGF,SAAS;MACtBG,aAAa,GAAG,aAAa;MAC7BC,GAAG,GAAG;IAQR,CAAC,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAL,SAAA,GAAAK,SAAA,MAAG,CAAC,CAAC;IACJ,IAAM;MAAEV;IAAG,CAAC,GAAG,IAAI;IACnB;IACA,OAAO,IAAKA,EAAE,CAASY,IAAI,CAAC;MAC1BT,KAAK;MACLC,IAAI,EAAEA,IAAI,aAAJA,IAAI,cAAJA,IAAI,GAAIJ,EAAE,CAACa,IAAI,CAACC,QAAQ,CAACC,CAAC;MAChCT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SAAA,MAAG,CAAC,CAAC;IACJ;IACA,OAAO,IAAK,IAAI,CAACV,EAAE,CAASa,IAAI,CAAC0C,MAAM,CAAC;MACtCd,KAAK;MACLU,MAAM;MACNC,IAAI;MACJC,IAAI;MACJC;IACF,CAAC,CAAC;EACJ;AACF;AAACrD,eAAA,CApIKH,cAAc,yBACW,aAAa;AAAAG,eAAA,CADtCH,cAAc,qBAGO,QAAQ;AAAAG,eAAA,CAH7BH,cAAc,qBAKO,QAAQ;AAAAG,eAAA,CAL7BH,cAAc,yBAOW,UAAU;AA+HzC,eAAeA,cAAc"}
@@ -1,4 +1,4 @@
1
- declare const _default: Readonly<{
1
+ export interface ChartTheme {
2
2
  paper_bgcolor: string;
3
3
  plot_bgcolor: string;
4
4
  title_color: string;
@@ -15,6 +15,7 @@ declare const _default: Readonly<{
15
15
  error_band_fill_color: string;
16
16
  ohlc_increasing: string;
17
17
  ohlc_decreasing: string;
18
- }>;
19
- export default _default;
18
+ }
19
+ export declare function defaultChartTheme(): Readonly<ChartTheme>;
20
+ export default defaultChartTheme;
20
21
  //# sourceMappingURL=ChartTheme.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ChartTheme.d.ts","sourceRoot":"","sources":["../src/ChartTheme.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAEA,wBAiBG"}
1
+ {"version":3,"file":"ChartTheme.d.ts","sourceRoot":"","sources":["../src/ChartTheme.ts"],"names":[],"mappings":"AAUA,MAAM,WAAW,UAAU;IACzB,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,qBAAqB,EAAE,MAAM,CAAC;IAC9B,qBAAqB,EAAE,MAAM,CAAC;IAC9B,eAAe,EAAE,MAAM,CAAC;IACxB,eAAe,EAAE,MAAM,CAAC;CACzB;AAED,wBAAgB,iBAAiB,IAAI,QAAQ,CAAC,UAAU,CAAC,CAmCxD;AAED,eAAe,iBAAiB,CAAC"}
@@ -1,20 +1,39 @@
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
- });
1
+ import { getExpressionRanges, resolveCssVariablesInRecord } from '@deephaven/components';
2
+ import Log from '@deephaven/log';
3
+ import { ColorUtils } from '@deephaven/utils';
4
+ import chartThemeRaw from "./ChartTheme.module.css";
5
+ var log = Log.module('ChartTheme');
6
+ export function defaultChartTheme() {
7
+ var _chartTheme$colorway;
8
+ var chartTheme = resolveCssVariablesInRecord(chartThemeRaw);
9
+
10
+ // The color normalization in `resolveCssVariablesInRecord` won't work for
11
+ // colorway since it is an array of colors. We need to explicitly normalize
12
+ // each color expression
13
+ chartTheme.colorway = getExpressionRanges((_chartTheme$colorway = chartTheme.colorway) !== null && _chartTheme$colorway !== void 0 ? _chartTheme$colorway : '').map(_ref => {
14
+ var [start, end] = _ref;
15
+ return ColorUtils.normalizeCssColor(chartTheme.colorway.substring(start, end + 1));
16
+ }).join(' ');
17
+ log.debug2('Chart theme:', chartThemeRaw);
18
+ log.debug2('Chart theme derived:', chartTheme);
19
+ return Object.freeze({
20
+ paper_bgcolor: chartTheme['paper-bgcolor'],
21
+ plot_bgcolor: chartTheme['plot-bgcolor'],
22
+ title_color: chartTheme['title-color'],
23
+ colorway: chartTheme.colorway,
24
+ gridcolor: chartTheme.gridcolor,
25
+ linecolor: chartTheme.linecolor,
26
+ zerolinecolor: chartTheme.zerolinecolor,
27
+ activecolor: chartTheme.activecolor,
28
+ rangebgcolor: chartTheme.rangebgcolor,
29
+ area_color: chartTheme['area-color'],
30
+ trend_color: chartTheme['trend-color'],
31
+ line_color: chartTheme['line-color'],
32
+ error_band_line_color: chartTheme['error-band-line-color'],
33
+ error_band_fill_color: chartTheme['error-band-fill-color'],
34
+ ohlc_increasing: chartTheme['ohlc-increasing'],
35
+ ohlc_decreasing: chartTheme['ohlc-decreasing']
36
+ });
37
+ }
38
+ export default defaultChartTheme;
20
39
  //# sourceMappingURL=ChartTheme.js.map
@@ -1 +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"}
1
+ {"version":3,"file":"ChartTheme.js","names":["getExpressionRanges","resolveCssVariablesInRecord","Log","ColorUtils","chartThemeRaw","log","module","defaultChartTheme","_chartTheme$colorway","chartTheme","colorway","map","_ref","start","end","normalizeCssColor","substring","join","debug2","Object","freeze","paper_bgcolor","plot_bgcolor","title_color","gridcolor","linecolor","zerolinecolor","activecolor","rangebgcolor","area_color","trend_color","line_color","error_band_line_color","error_band_fill_color","ohlc_increasing","ohlc_decreasing"],"sources":["../src/ChartTheme.ts"],"sourcesContent":["import {\n getExpressionRanges,\n resolveCssVariablesInRecord,\n} from '@deephaven/components';\nimport Log from '@deephaven/log';\nimport { ColorUtils } from '@deephaven/utils';\nimport chartThemeRaw from './ChartTheme.module.scss';\n\nconst log = Log.module('ChartTheme');\n\nexport interface ChartTheme {\n paper_bgcolor: string;\n plot_bgcolor: string;\n title_color: string;\n colorway: string;\n gridcolor: string;\n linecolor: string;\n zerolinecolor: string;\n activecolor: string;\n rangebgcolor: string;\n area_color: string;\n trend_color: string;\n line_color: string;\n error_band_line_color: string;\n error_band_fill_color: string;\n ohlc_increasing: string;\n ohlc_decreasing: string;\n}\n\nexport function defaultChartTheme(): Readonly<ChartTheme> {\n const chartTheme = resolveCssVariablesInRecord(chartThemeRaw);\n\n // The color normalization in `resolveCssVariablesInRecord` won't work for\n // colorway since it is an array of colors. We need to explicitly normalize\n // each color expression\n chartTheme.colorway = getExpressionRanges(chartTheme.colorway ?? '')\n .map(([start, end]) =>\n ColorUtils.normalizeCssColor(\n chartTheme.colorway.substring(start, end + 1)\n )\n )\n .join(' ');\n\n log.debug2('Chart theme:', chartThemeRaw);\n log.debug2('Chart theme derived:', chartTheme);\n\n return Object.freeze({\n paper_bgcolor: chartTheme['paper-bgcolor'],\n plot_bgcolor: chartTheme['plot-bgcolor'],\n title_color: chartTheme['title-color'],\n colorway: chartTheme.colorway,\n gridcolor: chartTheme.gridcolor,\n linecolor: chartTheme.linecolor,\n zerolinecolor: chartTheme.zerolinecolor,\n activecolor: chartTheme.activecolor,\n rangebgcolor: chartTheme.rangebgcolor,\n area_color: chartTheme['area-color'],\n trend_color: chartTheme['trend-color'],\n line_color: chartTheme['line-color'],\n error_band_line_color: chartTheme['error-band-line-color'],\n error_band_fill_color: chartTheme['error-band-fill-color'],\n ohlc_increasing: chartTheme['ohlc-increasing'],\n ohlc_decreasing: ch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IACvCC,WAAW,EAAElB,UAAU,CAACkB,WAAW;IACnCC,YAAY,EAAEnB,UAAU,CAACmB,YAAY;IACrCC,UAAU,EAAEpB,UAAU,CAAC,YAAY,CAAC;IACpCqB,WAAW,EAAErB,UAAU,CAAC,aAAa,CAAC;IACtCsB,UAAU,EAAEtB,UAAU,CAAC,YAAY,CAAC;IACpCuB,qBAAqB,EAAEvB,UAAU,CAAC,uBAAuB,CAAC;IAC1DwB,qBAAqB,EAAExB,UAAU,CAAC,uBAAuB,CAAC;IAC1DyB,eAAe,EAAEzB,UAAU,CAAC,iBAAiB,CAAC;IAC9C0B,eAAe,EAAE1B,UAAU,CAAC,iBAAiB;EAC/C,CAAC,CAAC;AACJ;AAEA,eAAeF,iBAAiB"}
@@ -1,22 +1,22 @@
1
1
  /* stylelint-disable */
2
2
  /* stylelint-disable scss/at-import-no-partial-leading-underscore */
3
3
  :export {
4
- paper-bgcolor: #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;
4
+ paper-bgcolor: var(--dh-color-chart-bg);
5
+ plot-bgcolor: var(--dh-color-chart-plot-bg);
6
+ title-color: var(--dh-color-chart-title);
7
+ colorway: var(--dh-color-chart-colorway);
8
+ gridcolor: var(--dh-color-chart-grid);
9
+ linecolor: var(--dh-color-chart-axis-line);
10
+ zerolinecolor: var(--dh-color-chart-axis-line-zero);
11
+ activecolor: var(--dh-color-chart-active);
12
+ rangebgcolor: var(--dh-color-chart-range-bg);
13
+ area-color: var(--dh-color-chart-area);
14
+ trend-color: var(--dh-color-chart-trend);
15
+ line-color: var(--dh-color-chart-line-deprecated);
16
+ error-band-line-color: var(--dh-color-chart-error-band-line);
17
+ error-band-fill-color: var(--dh-color-chart-error-band-fill);
18
+ ohlc-increasing: var(--dh-color-chart-ohlc-increase);
19
+ ohlc-decreasing: var(--dh-color-chart-ohlc-decrease);
20
20
  }
21
21
 
22
22
  /*# sourceMappingURL=ChartTheme.module.css.map */
@@ -1 +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:\n 'Fira Sans',\n -apple-system,\n blinkmacsystemfont,\n 'Segoe UI',\n 'Roboto',\n 'Helvetica Neue',\n arial,\n 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:\n color 0.12s ease-in-out,\n background-color 0.12s ease-in-out,\n border-color 0.12s ease-in-out,\n 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"]}
1
+ {"version":3,"sourceRoot":"","sources":["../src/ChartTheme.module.scss","../../../node_modules/@deephaven/components/scss/custom.scss"],"names":[],"mappings":"AAAA;ACAA;ADGA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA","file":"ChartTheme.module.css","sourcesContent":["/* stylelint-disable */\n@import '@deephaven/components/scss/custom.scss';\n\n:export {\n paper-bgcolor: var(--dh-color-chart-bg);\n plot-bgcolor: var(--dh-color-chart-plot-bg);\n title-color: var(--dh-color-chart-title);\n colorway: var(--dh-color-chart-colorway);\n gridcolor: var(--dh-color-chart-grid);\n linecolor: var(--dh-color-chart-axis-line);\n zerolinecolor: var(--dh-color-chart-axis-line-zero);\n activecolor: var(--dh-color-chart-active);\n rangebgcolor: var(--dh-color-chart-range-bg);\n area-color: var(--dh-color-chart-area);\n trend-color: var(--dh-color-chart-trend);\n line-color: var(--dh-color-chart-line-deprecated);\n error-band-line-color: var(--dh-color-chart-error-band-line);\n error-band-fill-color: var(--dh-color-chart-error-band-fill);\n ohlc-increasing: var(--dh-color-chart-ohlc-increase);\n ohlc-decreasing: var(--dh-color-chart-ohlc-decrease);\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"]}
@@ -0,0 +1,9 @@
1
+ import { ReactNode } from 'react';
2
+ import { ChartTheme } from './ChartTheme';
3
+ export type ChartThemeContextValue = ChartTheme;
4
+ export declare const ChartThemeContext: import("react").Context<ChartTheme | null>;
5
+ export interface ChartThemeProviderProps {
6
+ children: ReactNode;
7
+ }
8
+ export declare function ChartThemeProvider({ children, }: ChartThemeProviderProps): JSX.Element;
9
+ //# sourceMappingURL=ChartThemeProvider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChartThemeProvider.d.ts","sourceRoot":"","sources":["../src/ChartThemeProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAiB,SAAS,EAAuB,MAAM,OAAO,CAAC;AAEtE,OAA0B,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE7D,MAAM,MAAM,sBAAsB,GAAG,UAAU,CAAC;AAEhD,eAAO,MAAM,iBAAiB,4CAE7B,CAAC;AAEF,MAAM,WAAW,uBAAuB;IACtC,QAAQ,EAAE,SAAS,CAAC;CACrB;AAKD,wBAAgB,kBAAkB,CAAC,EACjC,QAAQ,GACT,EAAE,uBAAuB,GAAG,GAAG,CAAC,OAAO,CAuBvC"}
@@ -0,0 +1,35 @@
1
+ import { createContext, useEffect, useState } from 'react';
2
+ import { useTheme } from '@deephaven/components';
3
+ import defaultChartTheme from "./ChartTheme.js";
4
+ import { jsx as _jsx } from "react/jsx-runtime";
5
+ export var ChartThemeContext = /*#__PURE__*/createContext(null);
6
+ /*
7
+ * Provides a chart theme based on the active themes from the ThemeProvider.
8
+ */
9
+ export function ChartThemeProvider(_ref) {
10
+ var {
11
+ children
12
+ } = _ref;
13
+ var {
14
+ activeThemes
15
+ } = useTheme();
16
+ var [chartTheme, setChartTheme] = useState(null);
17
+
18
+ // The `ThemeProvider` that supplies `activeThemes` also provides the corresponding
19
+ // CSS theme variables to the DOM by dynamically rendering <style> tags whenever
20
+ // the `activeThemes` change. Painting the latest CSS variables to the DOM may
21
+ // not happen until after `ChartThemeProvider` is rendered, but they should be
22
+ // available by the time the effect runs. Therefore, it is important to derive
23
+ // the chart theme in an effect instead of deriving in a `useMemo` to ensure
24
+ // we have the latest CSS variables.
25
+ useEffect(() => {
26
+ if (activeThemes != null) {
27
+ setChartTheme(defaultChartTheme());
28
+ }
29
+ }, [activeThemes]);
30
+ return /*#__PURE__*/_jsx(ChartThemeContext.Provider, {
31
+ value: chartTheme,
32
+ children: children
33
+ });
34
+ }
35
+ //# sourceMappingURL=ChartThemeProvider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChartThemeProvider.js","names":["createContext","useEffect","useState","useTheme","defaultChartTheme","jsx","_jsx","ChartThemeContext","ChartThemeProvider","_ref","children","activeThemes","chartTheme","setChartTheme","Provider","value"],"sources":["../src/ChartThemeProvider.tsx"],"sourcesContent":["import { createContext, ReactNode, useEffect, useState } from 'react';\nimport { useTheme } from '@deephaven/components';\nimport defaultChartTheme, { ChartTheme } from './ChartTheme';\n\nexport type ChartThemeContextValue = ChartTheme;\n\nexport const ChartThemeContext = createContext<ChartThemeContextValue | null>(\n null\n);\n\nexport interface ChartThemeProviderProps {\n children: ReactNode;\n}\n\n/*\n * Provides a chart theme based on the active themes from the ThemeProvider.\n */\nexport function ChartThemeProvider({\n children,\n}: ChartThemeProviderProps): JSX.Element {\n const { activeThemes } = useTheme();\n\n const [chartTheme, setChartTheme] = useState<ChartTheme | null>(null);\n\n // The `ThemeProvider` that supplies `activeThemes` also provides the corresponding\n // CSS theme variables to the DOM by dynamically rendering <style> tags whenever\n // the `activeThemes` change. Painting the latest CSS variables to the DOM may\n // not happen until after `ChartThemeProvider` is rendered, but they should be\n // available by the time the effect runs. Therefore, it is important to derive\n // the chart theme in an effect instead of deriving in a `useMemo` to ensure\n // we have the latest CSS variables.\n useEffect(() => {\n if (activeThemes != null) {\n setChartTheme(defaultChartTheme());\n }\n }, [activeThemes]);\n\n return (\n <ChartThemeContext.Provider value={chartTheme}>\n {children}\n </ChartThemeContext.Provider>\n );\n}\n"],"mappings":"AAAA,SAASA,aAAa,EAAaC,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AACrE,SAASC,QAAQ,QAAQ,uBAAuB;AAAC,OAC1CC,iBAAiB;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAIxB,OAAO,IAAMC,iBAAiB,gBAAGP,aAAa,CAC5C,IACF,CAAC;AAMD;AACA;AACA;AACA,OAAO,SAASQ,kBAAkBA,CAAAC,IAAA,EAEO;EAAA,IAFN;IACjCC;EACuB,CAAC,GAAAD,IAAA;EACxB,IAAM;IAAEE;EAAa,CAAC,GAAGR,QAAQ,CAAC,CAAC;EAEnC,IAAM,CAACS,UAAU,EAAEC,aAAa,CAAC,GAAGX,QAAQ,CAAoB,IAAI,CAAC;;EAErE;EACA;EACA;EACA;EACA;EACA;EACA;EACAD,SAAS,CAAC,MAAM;IACd,IAAIU,YAAY,IAAI,IAAI,EAAE;MACxBE,aAAa,CAACT,iBAAiB,CAAC,CAAC,CAAC;IACpC;EACF,CAAC,EAAE,CAACO,YAAY,CAAC,CAAC;EAElB,oBACEL,IAAA,CAACC,iBAAiB,CAACO,QAAQ;IAACC,KAAK,EAAEH,UAAW;IAAAF,QAAA,EAC3CA;EAAQ,CACiB,CAAC;AAEjC"}