@deephaven/chart 0.35.1-sideEffects.3 → 0.35.1-test-envoy.18
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/ChartModelFactory.d.ts +6 -4
- package/dist/ChartModelFactory.d.ts.map +1 -1
- package/dist/ChartModelFactory.js +12 -11
- package/dist/ChartModelFactory.js.map +1 -1
- package/dist/ChartUtils.d.ts +152 -149
- package/dist/ChartUtils.d.ts.map +1 -1
- package/dist/ChartUtils.js +603 -542
- package/dist/ChartUtils.js.map +1 -1
- package/dist/FigureChartModel.d.ts +7 -3
- package/dist/FigureChartModel.d.ts.map +1 -1
- package/dist/FigureChartModel.js +32 -12
- package/dist/FigureChartModel.js.map +1 -1
- package/dist/MockChartModel.d.ts +1 -1
- package/dist/MockChartModel.d.ts.map +1 -1
- package/dist/MockChartModel.js +4 -3
- package/dist/MockChartModel.js.map +1 -1
- package/package.json +9 -9
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { Figure, Table } from '@deephaven/jsapi-shim';
|
|
1
|
+
import { dhType, Figure, Table } from '@deephaven/jsapi-shim';
|
|
2
2
|
import { ChartModelSettings } from './ChartUtils';
|
|
3
3
|
import ChartModel from './ChartModel';
|
|
4
4
|
declare class ChartModelFactory {
|
|
5
5
|
/**
|
|
6
6
|
* Creates a model from the settings provided.
|
|
7
7
|
* Tries to create a Figure in the API with it.
|
|
8
|
+
* // TODO: add dh
|
|
8
9
|
* @param settings The chart builder settings
|
|
9
10
|
* @param settings.isLinked Whether the newly created chart should stay linked with the original table, update when filters are updated
|
|
10
11
|
* @param settings.series The column names to use for creating the series of this chart
|
|
@@ -17,7 +18,7 @@ declare class ChartModelFactory {
|
|
|
17
18
|
* CRA sets tsconfig to type check JS based on jsdoc comments. It isn't able to figure out FigureChartModel extends ChartModel
|
|
18
19
|
* This causes TS issues in 1 or 2 spots. Once this is TS it can be returned to just FigureChartModel
|
|
19
20
|
*/
|
|
20
|
-
static makeModelFromSettings(settings: ChartModelSettings, table: Table, theme?: Readonly<{
|
|
21
|
+
static makeModelFromSettings(dh: dhType, settings: ChartModelSettings, table: Table, theme?: Readonly<{
|
|
21
22
|
paper_bgcolor: string;
|
|
22
23
|
plot_bgcolor: string;
|
|
23
24
|
title_color: string;
|
|
@@ -47,10 +48,11 @@ declare class ChartModelFactory {
|
|
|
47
48
|
* @param table The table to build the model for
|
|
48
49
|
* @returns The Figure created with the settings provided
|
|
49
50
|
*/
|
|
50
|
-
static makeFigureFromSettings(settings: ChartModelSettings, table: Table): Promise<Figure>;
|
|
51
|
+
static makeFigureFromSettings(dh: dhType, settings: ChartModelSettings, table: Table): Promise<Figure>;
|
|
51
52
|
/**
|
|
52
53
|
* Creates a model from the settings provided.
|
|
53
54
|
* Tries to create a Figure in the API with it.
|
|
55
|
+
* TODO: jsdoc
|
|
54
56
|
* @param settings The chart builder settings
|
|
55
57
|
* @param settings.isLinked Whether the newly created chart should stay linked with the original table, update when filters are updated
|
|
56
58
|
* @param settings.series The column names to use for creating the series of this chart
|
|
@@ -63,7 +65,7 @@ declare class ChartModelFactory {
|
|
|
63
65
|
* CRA sets tsconfig to type check JS based on jsdoc comments. It isn't able to figure out FigureChartModel extends ChartModel
|
|
64
66
|
* This causes TS issues in 1 or 2 spots. Once this is TS it can be returned to just FigureChartModel
|
|
65
67
|
*/
|
|
66
|
-
static makeModel(settings: ChartModelSettings | undefined, figure: Figure, theme?: Readonly<{
|
|
68
|
+
static makeModel(dh: dhType, settings: ChartModelSettings | undefined, figure: Figure, theme?: Readonly<{
|
|
67
69
|
paper_bgcolor: string;
|
|
68
70
|
plot_bgcolor: string;
|
|
69
71
|
title_color: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChartModelFactory.d.ts","sourceRoot":"","sources":["../src/ChartModelFactory.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"ChartModelFactory.d.ts","sourceRoot":"","sources":["../src/ChartModelFactory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC9D,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;;;;;;;;;;;OAWG;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,6 +1,5 @@
|
|
|
1
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
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 dh from '@deephaven/jsapi-shim';
|
|
4
3
|
import ChartUtils from "./ChartUtils.js";
|
|
5
4
|
import FigureChartModel from "./FigureChartModel.js";
|
|
6
5
|
import ChartTheme from "./ChartTheme.js";
|
|
@@ -8,6 +7,7 @@ class ChartModelFactory {
|
|
|
8
7
|
/**
|
|
9
8
|
* Creates a model from the settings provided.
|
|
10
9
|
* Tries to create a Figure in the API with it.
|
|
10
|
+
* // TODO: add dh
|
|
11
11
|
* @param settings The chart builder settings
|
|
12
12
|
* @param settings.isLinked Whether the newly created chart should stay linked with the original table, update when filters are updated
|
|
13
13
|
* @param settings.series The column names to use for creating the series of this chart
|
|
@@ -20,12 +20,12 @@ class ChartModelFactory {
|
|
|
20
20
|
* CRA sets tsconfig to type check JS based on jsdoc comments. It isn't able to figure out FigureChartModel extends ChartModel
|
|
21
21
|
* This causes TS issues in 1 or 2 spots. Once this is TS it can be returned to just FigureChartModel
|
|
22
22
|
*/
|
|
23
|
-
static makeModelFromSettings(settings, table) {
|
|
23
|
+
static makeModelFromSettings(dh, settings, table) {
|
|
24
24
|
var _arguments = arguments;
|
|
25
25
|
return _asyncToGenerator(function* () {
|
|
26
|
-
var theme = _arguments.length >
|
|
27
|
-
var figure = yield ChartModelFactory.makeFigureFromSettings(settings, table);
|
|
28
|
-
return new FigureChartModel(figure, settings, theme);
|
|
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
29
|
})();
|
|
30
30
|
}
|
|
31
31
|
|
|
@@ -41,23 +41,24 @@ class ChartModelFactory {
|
|
|
41
41
|
* @param table The table to build the model for
|
|
42
42
|
* @returns The Figure created with the settings provided
|
|
43
43
|
*/
|
|
44
|
-
static makeFigureFromSettings(settings, table) {
|
|
44
|
+
static makeFigureFromSettings(dh, settings, table) {
|
|
45
45
|
return _asyncToGenerator(function* () {
|
|
46
46
|
// Copy the table first and then re-apply the filters from the original table
|
|
47
|
-
// When we add
|
|
47
|
+
// When we add table linking we'll want to listen to the original table and update
|
|
48
48
|
// the copied table with any changes that occur.
|
|
49
49
|
// The table gets owned by the Figure that gets created, which closes the table
|
|
50
50
|
var tableCopy = yield table.copy();
|
|
51
51
|
tableCopy.applyCustomColumns(table.customColumns);
|
|
52
52
|
tableCopy.applyFilter(table.filter);
|
|
53
53
|
tableCopy.applySort(table.sort);
|
|
54
|
-
return dh.plot.Figure.create(ChartUtils.makeFigureSettings(settings, tableCopy));
|
|
54
|
+
return dh.plot.Figure.create(new ChartUtils(dh).makeFigureSettings(settings, tableCopy));
|
|
55
55
|
})();
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
/**
|
|
59
59
|
* Creates a model from the settings provided.
|
|
60
60
|
* Tries to create a Figure in the API with it.
|
|
61
|
+
* TODO: jsdoc
|
|
61
62
|
* @param settings The chart builder settings
|
|
62
63
|
* @param settings.isLinked Whether the newly created chart should stay linked with the original table, update when filters are updated
|
|
63
64
|
* @param settings.series The column names to use for creating the series of this chart
|
|
@@ -70,11 +71,11 @@ class ChartModelFactory {
|
|
|
70
71
|
* CRA sets tsconfig to type check JS based on jsdoc comments. It isn't able to figure out FigureChartModel extends ChartModel
|
|
71
72
|
* This causes TS issues in 1 or 2 spots. Once this is TS it can be returned to just FigureChartModel
|
|
72
73
|
*/
|
|
73
|
-
static makeModel(settings, figure) {
|
|
74
|
+
static makeModel(dh, settings, figure) {
|
|
74
75
|
var _arguments2 = arguments;
|
|
75
76
|
return _asyncToGenerator(function* () {
|
|
76
|
-
var theme = _arguments2.length >
|
|
77
|
-
return new FigureChartModel(figure, settings, theme);
|
|
77
|
+
var theme = _arguments2.length > 3 && _arguments2[3] !== undefined ? _arguments2[3] : ChartTheme;
|
|
78
|
+
return new FigureChartModel(dh, figure, settings, theme);
|
|
78
79
|
})();
|
|
79
80
|
}
|
|
80
81
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChartModelFactory.js","names":["
|
|
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 { dhType, Figure, Table } from '@deephaven/jsapi-shim';\nimport ChartUtils, { ChartModelSettings } from './ChartUtils';\nimport FigureChartModel from './FigureChartModel';\nimport ChartTheme from './ChartTheme';\nimport ChartModel from './ChartModel';\n\nclass ChartModelFactory {\n /**\n * Creates a model from the settings provided.\n * Tries to create a Figure in the API with it.\n * // TODO: add dh\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 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 * TODO: jsdoc\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;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"}
|
package/dist/ChartUtils.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Formatter } from '@deephaven/jsapi-utils';
|
|
2
|
-
import { Axis, AxisPosition, AxisType, Chart, Figure, Holiday, Series, SeriesDataSource, SeriesPlotStyle, SourceType, TableTemplate, TimeZone } from '@deephaven/jsapi-shim';
|
|
2
|
+
import { Axis, AxisPosition, AxisType, Chart, dhType, Figure, Holiday, Series, SeriesDataSource, SeriesPlotStyle, SourceType, TableTemplate, TimeZone } from '@deephaven/jsapi-shim';
|
|
3
3
|
import { Layout, PlotData, PlotType, Axis as PlotlyAxis, ErrorBar, LayoutAxis, MarkerSymbol } from 'plotly.js';
|
|
4
4
|
import { Range } from '@deephaven/utils';
|
|
5
5
|
import ChartTheme from './ChartTheme';
|
|
@@ -72,26 +72,6 @@ declare class ChartUtils {
|
|
|
72
72
|
static DEFAULT_MARKER_SIZE: number;
|
|
73
73
|
static MODE_MARKERS: PlotData['mode'];
|
|
74
74
|
static MODE_LINES: PlotData['mode'];
|
|
75
|
-
/**
|
|
76
|
-
* Converts the Iris plot style into a plotly chart type
|
|
77
|
-
* @param plotStyle The plotStyle to use, see dh.plot.SeriesPlotStyle
|
|
78
|
-
* @param isBusinessTime If the plot is using business time for an axis
|
|
79
|
-
*/
|
|
80
|
-
static getPlotlyChartType(plotStyle: SeriesPlotStyle, isBusinessTime: boolean): PlotType | undefined;
|
|
81
|
-
/**
|
|
82
|
-
* Converts the Iris plot style into a plotly chart mode
|
|
83
|
-
* @param plotStyle The plotStyle to use, see dh.plot.SeriesPlotStyle.*
|
|
84
|
-
* @param areLinesVisible Whether lines are visible or not
|
|
85
|
-
* @param areShapesVisible Whether shapes are visible or not
|
|
86
|
-
*/
|
|
87
|
-
static getPlotlyChartMode(plotStyle: SeriesPlotStyle, areLinesVisible?: boolean, areShapesVisible?: boolean): PlotData['mode'] | undefined;
|
|
88
|
-
/**
|
|
89
|
-
* Get the property to set on the series data for plotly
|
|
90
|
-
* @param plotStyle The plot style of the series
|
|
91
|
-
* @param sourceType The source type for the series
|
|
92
|
-
*/
|
|
93
|
-
static getPlotlyProperty(plotStyle: SeriesPlotStyle, sourceType: SourceType): string;
|
|
94
|
-
static getPlotlySeriesOrientation(series: Series): 'h' | 'v' | undefined;
|
|
95
75
|
/**
|
|
96
76
|
* Generate the plotly error bar data from the passed in data.
|
|
97
77
|
* Iris passes in the values as absolute, plotly needs them as relative.
|
|
@@ -102,7 +82,7 @@ declare class ChartUtils {
|
|
|
102
82
|
* @returns The error_x object required by plotly, or null if none is required
|
|
103
83
|
*/
|
|
104
84
|
static getPlotlyErrorBars(x: number[], xLow: number[], xHigh: number[]): ErrorBar;
|
|
105
|
-
static getPlotlyDateFormat(formatter: Formatter | null, columnType: string, formatPattern: string): Partial<LayoutAxis>;
|
|
85
|
+
static getPlotlyDateFormat(dh: dhType, formatter: Formatter | null, columnType: string, formatPattern: string): Partial<LayoutAxis>;
|
|
106
86
|
static convertNumberPrefix(prefix: string): string;
|
|
107
87
|
static getPlotlyNumberFormat(formatter: Formatter | null, columnType: string, formatPattern: string): Partial<LayoutAxis> | null;
|
|
108
88
|
/**
|
|
@@ -110,7 +90,7 @@ declare class ChartUtils {
|
|
|
110
90
|
* @param source The Source to get the formatter information from
|
|
111
91
|
* @param formatter The current formatter for formatting data
|
|
112
92
|
*/
|
|
113
|
-
static getPlotlyAxisFormat(source: SeriesDataSource, formatter?: Formatter | null): Partial<PlotlyAxis> | null;
|
|
93
|
+
static getPlotlyAxisFormat(dh: dhType, source: SeriesDataSource, formatter?: Formatter | null): Partial<PlotlyAxis> | null;
|
|
114
94
|
/**
|
|
115
95
|
* Adds tick spacing for an axis that has gapBetweenMajorTicks defined.
|
|
116
96
|
*
|
|
@@ -145,14 +125,51 @@ declare class ChartUtils {
|
|
|
145
125
|
*/
|
|
146
126
|
static makeSeriesData(type: PlotType | undefined, mode: PlotData['mode'] | undefined, name: string, showLegend: boolean | null, orientation?: 'h' | 'v'): Partial<PlotData>;
|
|
147
127
|
/**
|
|
148
|
-
*
|
|
149
|
-
*
|
|
150
|
-
*
|
|
151
|
-
*
|
|
152
|
-
* @param
|
|
153
|
-
|
|
128
|
+
* Get the Plotly marker symbol for the provided Deephaven shape
|
|
129
|
+
* Deephaven shapes: https://deephaven.io/enterprise/docs/plotting/visual-formatting/#point-formatting
|
|
130
|
+
* Plotly shapes: https://plotly.com/javascript/reference/scattergl/#scattergl-marker-symbol
|
|
131
|
+
* Table of plotly shapes: https://plotly.com/python/marker-style/#custom-marker-symbols
|
|
132
|
+
* @param deephavenShape Deephaven shape to get the marker symbol for
|
|
133
|
+
*/
|
|
134
|
+
static getMarkerSymbol(deephavenShape: string): MarkerSymbol;
|
|
135
|
+
/**
|
|
136
|
+
* Get all axes for a given `Figure`. Iterates through all charts axes and concatenates them.
|
|
137
|
+
* @param figure Figure to get all axes for
|
|
138
|
+
*/
|
|
139
|
+
static getAllAxes(figure: Figure): Axis[];
|
|
140
|
+
/**
|
|
141
|
+
* Retrieve the chart that contains the passed in series from the figure
|
|
142
|
+
* @param figure The figure to retrieve the chart from
|
|
143
|
+
* @param series The series to get the chart for
|
|
144
|
+
*/
|
|
145
|
+
static getChartForSeries(figure: Figure, series: Series): Chart | null;
|
|
146
|
+
/**
|
|
147
|
+
* Get an object mapping axis to their ranges
|
|
148
|
+
* @param layout The plotly layout object to get the ranges from
|
|
149
|
+
* @returns An object mapping the axis name to it's range
|
|
150
|
+
*/
|
|
151
|
+
static getLayoutRanges(layout: Layout): Record<string, Range[]>;
|
|
152
|
+
static getAxisLayoutProperty(axisProperty: 'x' | 'y', axisIndex: number): LayoutAxisKey;
|
|
153
|
+
/**
|
|
154
|
+
* Converts an open or close period to a declimal. e.g '09:30" to 9.5
|
|
155
|
+
*
|
|
156
|
+
* @param period the open or close value of the period
|
|
154
157
|
*/
|
|
155
|
-
static
|
|
158
|
+
static periodToDecimal(period: string): number;
|
|
159
|
+
/**
|
|
160
|
+
* Groups an array and returns a map
|
|
161
|
+
* @param array The object to group
|
|
162
|
+
* @param property The property name to group by
|
|
163
|
+
* @returns A map containing the items grouped by their values for the property
|
|
164
|
+
*/
|
|
165
|
+
static groupArray<T, P extends keyof T>(array: T[], property: P): Map<T[P], T[]>;
|
|
166
|
+
/**
|
|
167
|
+
* Parses the colorway property of a theme and returns an array of colors
|
|
168
|
+
* Theme could have a single string with space separated colors or an array of strings representing the colorway
|
|
169
|
+
* @param theme The theme to get colorway from
|
|
170
|
+
* @returns Colorway array for the theme
|
|
171
|
+
*/
|
|
172
|
+
static getColorwayFromTheme(theme?: Readonly<{
|
|
156
173
|
paper_bgcolor: string;
|
|
157
174
|
plot_bgcolor: string;
|
|
158
175
|
title_color: string;
|
|
@@ -169,17 +186,11 @@ declare class ChartUtils {
|
|
|
169
186
|
error_band_fill_color: string;
|
|
170
187
|
ohlc_increasing: string;
|
|
171
188
|
ohlc_decreasing: string;
|
|
172
|
-
}>):
|
|
173
|
-
static
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
* Deephaven shapes: https://deephaven.io/enterprise/docs/plotting/visual-formatting/#point-formatting
|
|
178
|
-
* Plotly shapes: https://plotly.com/javascript/reference/scattergl/#scattergl-marker-symbol
|
|
179
|
-
* Table of plotly shapes: https://plotly.com/python/marker-style/#custom-marker-symbols
|
|
180
|
-
* @param deephavenShape Deephaven shape to get the marker symbol for
|
|
181
|
-
*/
|
|
182
|
-
static getMarkerSymbol(deephavenShape: string): MarkerSymbol;
|
|
189
|
+
}>): string[];
|
|
190
|
+
static titleFromSettings(settings: ChartModelSettings): string;
|
|
191
|
+
private dh;
|
|
192
|
+
private days;
|
|
193
|
+
constructor(dh: dhType);
|
|
183
194
|
/**
|
|
184
195
|
* Retrieve the axis formats from the provided figure.
|
|
185
196
|
* Currently defaults to just the x/y axes.
|
|
@@ -187,35 +198,66 @@ declare class ChartUtils {
|
|
|
187
198
|
* @param formatter The formatter to use when getting the axis format
|
|
188
199
|
* @returns A map of axis layout property names to axis formats
|
|
189
200
|
*/
|
|
190
|
-
|
|
191
|
-
static getChartType(plotStyle: SeriesPlotStyle, isBusinessTime: boolean): PlotType | undefined;
|
|
201
|
+
getAxisFormats(figure: Figure, formatter: Formatter): Map<LayoutAxisKey, Partial<PlotlyAxis>>;
|
|
192
202
|
/**
|
|
193
|
-
*
|
|
194
|
-
* @param
|
|
203
|
+
* Converts the Iris plot style into a plotly chart type
|
|
204
|
+
* @param plotStyle The plotStyle to use, see dh.plot.SeriesPlotStyle
|
|
205
|
+
* @param isBusinessTime If the plot is using business time for an axis
|
|
195
206
|
*/
|
|
196
|
-
|
|
207
|
+
getPlotlyChartType(plotStyle: SeriesPlotStyle, isBusinessTime: boolean): PlotType | undefined;
|
|
197
208
|
/**
|
|
198
|
-
*
|
|
199
|
-
* @param
|
|
209
|
+
* Converts the Iris plot style into a plotly chart mode
|
|
210
|
+
* @param plotStyle The plotStyle to use, see dh.plot.SeriesPlotStyle.*
|
|
211
|
+
* @param areLinesVisible Whether lines are visible or not
|
|
212
|
+
* @param areShapesVisible Whether shapes are visible or not
|
|
200
213
|
*/
|
|
201
|
-
|
|
214
|
+
getPlotlyChartMode(plotStyle: SeriesPlotStyle, areLinesVisible?: boolean, areShapesVisible?: boolean): PlotData['mode'] | undefined;
|
|
202
215
|
/**
|
|
203
|
-
* Get
|
|
204
|
-
* @param
|
|
216
|
+
* Get the property to set on the series data for plotly
|
|
217
|
+
* @param plotStyle The plot style of the series
|
|
218
|
+
* @param sourceType The source type for the series
|
|
205
219
|
*/
|
|
206
|
-
|
|
220
|
+
getPlotlyProperty(plotStyle: SeriesPlotStyle, sourceType: SourceType): string;
|
|
221
|
+
getPlotlySeriesOrientation(series: Series): 'h' | 'v' | undefined;
|
|
207
222
|
/**
|
|
208
|
-
*
|
|
209
|
-
* @param
|
|
210
|
-
* @param
|
|
223
|
+
* Create a data series (trace) for use with plotly
|
|
224
|
+
* @param series The series to create the series data with
|
|
225
|
+
* @param axisTypeMap The map of axes grouped by type
|
|
226
|
+
* @param seriesVisibility Visibility setting for the series
|
|
227
|
+
* @param theme The theme properties for the plot. See ChartTheme.js for an example
|
|
228
|
+
* @returns The series data (trace) object for use with plotly.
|
|
211
229
|
*/
|
|
212
|
-
|
|
230
|
+
makeSeriesDataFromSeries(series: Series, axisTypeMap: AxisTypeMap, seriesVisibility: boolean | 'legendonly', showLegend?: boolean | null, theme?: Readonly<{
|
|
231
|
+
paper_bgcolor: string;
|
|
232
|
+
plot_bgcolor: string;
|
|
233
|
+
title_color: string;
|
|
234
|
+
colorway: string;
|
|
235
|
+
gridcolor: string;
|
|
236
|
+
linecolor: string;
|
|
237
|
+
zerolinecolor: string;
|
|
238
|
+
activecolor: string;
|
|
239
|
+
rangebgcolor: string;
|
|
240
|
+
area_color: string;
|
|
241
|
+
trend_color: string;
|
|
242
|
+
line_color: string;
|
|
243
|
+
error_band_line_color: string;
|
|
244
|
+
error_band_fill_color: string;
|
|
245
|
+
ohlc_increasing: string;
|
|
246
|
+
ohlc_decreasing: string;
|
|
247
|
+
}>): Partial<PlotData>;
|
|
248
|
+
addSourcesToSeriesData(seriesDataParam: Partial<PlotData>, plotStyle: SeriesPlotStyle, sources: SeriesDataSource[], axisTypeMap: AxisTypeMap): void;
|
|
249
|
+
addStylingToSeriesData(seriesDataParam: Partial<PlotData>, plotStyle: SeriesPlotStyle, theme?: typeof ChartTheme, lineColor?: string | null, shapeColor?: string | null, shape?: string | null, shapeSize?: number | null, seriesVisibility?: 'legendonly' | boolean | null): void;
|
|
250
|
+
getChartType(plotStyle: SeriesPlotStyle, isBusinessTime: boolean): PlotType | undefined;
|
|
213
251
|
/**
|
|
214
|
-
*
|
|
215
|
-
* @param
|
|
216
|
-
* @returns An object mapping the axis name to it's range
|
|
252
|
+
* Return the plotly axis property name
|
|
253
|
+
* @param axisType The axis type to get the property name for
|
|
217
254
|
*/
|
|
218
|
-
|
|
255
|
+
getAxisPropertyName(axisType: AxisType): 'x' | 'y' | null;
|
|
256
|
+
/**
|
|
257
|
+
* Returns the plotly "side" value for the provided axis position
|
|
258
|
+
* @param axisPosition The Iris AxisPosition of the axis
|
|
259
|
+
*/
|
|
260
|
+
getAxisSide(axisPosition: AxisPosition): LayoutAxis['side'] | undefined;
|
|
219
261
|
/**
|
|
220
262
|
* Update the layout with all the axes information for the provided figure
|
|
221
263
|
* @param figure Figure to update the axes for
|
|
@@ -225,7 +267,7 @@ declare class ChartUtils {
|
|
|
225
267
|
* @param plotHeight Height of the plot in pixels
|
|
226
268
|
* @param theme Theme used for displaying the plot
|
|
227
269
|
*/
|
|
228
|
-
|
|
270
|
+
updateFigureAxes(layoutParam: Partial<Layout>, figure: Figure, chartAxisRangeParser?: ChartAxisRangeParser, plotWidth?: number, plotHeight?: number, theme?: Readonly<{
|
|
229
271
|
paper_bgcolor: string;
|
|
230
272
|
plot_bgcolor: string;
|
|
231
273
|
title_color: string;
|
|
@@ -243,7 +285,7 @@ declare class ChartUtils {
|
|
|
243
285
|
ohlc_increasing: string;
|
|
244
286
|
ohlc_decreasing: string;
|
|
245
287
|
}>): void;
|
|
246
|
-
|
|
288
|
+
getChartBounds(figure: Figure, chart: Chart, plotWidth: number, plotHeight: number): ChartBounds;
|
|
247
289
|
/**
|
|
248
290
|
* Updates the axes positions and sizes in the layout object provided.
|
|
249
291
|
* If the axis did not exist in the layout previously, it is created and added.
|
|
@@ -257,7 +299,7 @@ declare class ChartUtils {
|
|
|
257
299
|
* @param bounds The bounds for this set of axes
|
|
258
300
|
* @param axisRangeParser A function to retrieve the range parser for a given axis
|
|
259
301
|
*/
|
|
260
|
-
|
|
302
|
+
updateLayoutAxes(layoutParam: Partial<Layout>, chartAxes: Axis[], figureAxes: Axis[], plotWidth?: number, plotHeight?: number, bounds?: ChartBounds, axisRangeParser?: AxisRangeParser, theme?: Readonly<{
|
|
261
303
|
paper_bgcolor: string;
|
|
262
304
|
plot_bgcolor: string;
|
|
263
305
|
title_color: string;
|
|
@@ -280,8 +322,7 @@ declare class ChartUtils {
|
|
|
280
322
|
* @param layoutParam Layout object to remove stale axes from
|
|
281
323
|
* @param axes All axes in the figure
|
|
282
324
|
*/
|
|
283
|
-
|
|
284
|
-
static getAxisLayoutProperty(axisProperty: 'x' | 'y', axisIndex: number): LayoutAxisKey;
|
|
325
|
+
removeStaleAxes(layoutParam: Partial<Layout>, axes: Axis[]): void;
|
|
285
326
|
/**
|
|
286
327
|
* Updates the layout axis object in place
|
|
287
328
|
* @param layoutAxisParam The plotly layout axis param
|
|
@@ -291,18 +332,12 @@ declare class ChartUtils {
|
|
|
291
332
|
* @param axisSize The size of each axis in percent
|
|
292
333
|
* @param bounds The bounds of the axes domains
|
|
293
334
|
*/
|
|
294
|
-
|
|
335
|
+
updateLayoutAxis(layoutAxisParam: Partial<LayoutAxis>, axis: Axis, axisIndex: number, axisPositionMap: AxisPositionMap, xAxisSize: number, yAxisSize: number, bounds: {
|
|
295
336
|
left: number;
|
|
296
337
|
bottom: number;
|
|
297
338
|
top: number;
|
|
298
339
|
right: number;
|
|
299
340
|
}): void;
|
|
300
|
-
/**
|
|
301
|
-
* Converts an open or close period to a declimal. e.g '09:30" to 9.5
|
|
302
|
-
*
|
|
303
|
-
* @param period the open or close value of the period
|
|
304
|
-
*/
|
|
305
|
-
static periodToDecimal(period: string): number;
|
|
306
341
|
/**
|
|
307
342
|
* Creates range break bounds for plotly from business days.
|
|
308
343
|
* For example a standard business week of ['MONDAY','TUESDAY','WEDNESDAY','THURSDAY','FRIDAY']
|
|
@@ -311,7 +346,7 @@ declare class ChartUtils {
|
|
|
311
346
|
*
|
|
312
347
|
* @param businessDays the days to display on the x-axis
|
|
313
348
|
*/
|
|
314
|
-
|
|
349
|
+
createBoundsFromDays(businessDays: string[]): Range[];
|
|
315
350
|
/**
|
|
316
351
|
* Creates an array of range breaks for all holidays.
|
|
317
352
|
*
|
|
@@ -319,7 +354,7 @@ declare class ChartUtils {
|
|
|
319
354
|
* @param calendarTimeZone the time zone for the business calendar
|
|
320
355
|
* @param formatterTimeZone the time zone for the formatter
|
|
321
356
|
*/
|
|
322
|
-
|
|
357
|
+
createRangeBreakValuesFromHolidays(holidays: Holiday[], calendarTimeZone: TimeZone, formatterTimeZone?: TimeZone): Rangebreaks[];
|
|
323
358
|
/**
|
|
324
359
|
* Creates the range break value for a full holiday. A full holiday is day that has no business periods.
|
|
325
360
|
*
|
|
@@ -327,7 +362,7 @@ declare class ChartUtils {
|
|
|
327
362
|
* @param calendarTimeZone the time zone for the business calendar
|
|
328
363
|
* @param formatterTimeZone the time zone for the formatter
|
|
329
364
|
*/
|
|
330
|
-
|
|
365
|
+
createFullHoliday(holiday: Holiday, calendarTimeZone: TimeZone, formatterTimeZone?: TimeZone): string;
|
|
331
366
|
/**
|
|
332
367
|
* Creates the range break for a partial holiday. A partial holiday is holiday with business periods
|
|
333
368
|
* that are different than the default business periods.
|
|
@@ -336,7 +371,7 @@ declare class ChartUtils {
|
|
|
336
371
|
* @param calendarTimeZone the time zone for the business calendar
|
|
337
372
|
* @param formatterTimeZone the time zone for the formatter
|
|
338
373
|
*/
|
|
339
|
-
|
|
374
|
+
createPartialHoliday(holiday: Holiday, calendarTimeZone: TimeZone, formatterTimeZone?: TimeZone): {
|
|
340
375
|
values: string[];
|
|
341
376
|
dvalue: number;
|
|
342
377
|
}[];
|
|
@@ -347,27 +382,57 @@ declare class ChartUtils {
|
|
|
347
382
|
* @param calendarTimeZone the time zone for the business calendar
|
|
348
383
|
* @param formatterTimeZone the time zone for the formatter
|
|
349
384
|
*/
|
|
350
|
-
|
|
385
|
+
adjustDateForTimeZone(dateString: string, calendarTimeZone: TimeZone, formatterTimeZone?: TimeZone): string;
|
|
351
386
|
/**
|
|
352
|
-
*
|
|
353
|
-
*
|
|
354
|
-
*
|
|
355
|
-
*
|
|
387
|
+
* Creates the Figure settings from the Chart Builder settings
|
|
388
|
+
* This should be deprecated at some point, and have Chart Builder create the figure settings directly.
|
|
389
|
+
* This logic will still need to exist to translate existing charts, but could be part of a migration script
|
|
390
|
+
* to translate the data.
|
|
391
|
+
* Change when we decide to add more functionality to the Chart Builder.
|
|
392
|
+
* @param settings The chart builder settings
|
|
393
|
+
* @param settings.title The title for this figure
|
|
394
|
+
* @param settings.xAxis The name of the column to use for the x-axis
|
|
395
|
+
* @param settings.series The name of the columns to use for the series of this figure
|
|
396
|
+
* @param settings.type The plot style for this figure
|
|
356
397
|
*/
|
|
357
|
-
|
|
398
|
+
makeFigureSettings(settings: ChartModelSettings, table: TableTemplate): {
|
|
399
|
+
charts: {
|
|
400
|
+
chartType: string;
|
|
401
|
+
axes: {
|
|
402
|
+
formatType: string;
|
|
403
|
+
type: string;
|
|
404
|
+
position: string;
|
|
405
|
+
}[];
|
|
406
|
+
series: {
|
|
407
|
+
plotStyle: string;
|
|
408
|
+
name: string;
|
|
409
|
+
dataSources: {
|
|
410
|
+
type: string;
|
|
411
|
+
columnName: string;
|
|
412
|
+
axis: {
|
|
413
|
+
formatType: string;
|
|
414
|
+
type: string;
|
|
415
|
+
position: string;
|
|
416
|
+
};
|
|
417
|
+
table: TableTemplate;
|
|
418
|
+
}[];
|
|
419
|
+
}[];
|
|
420
|
+
}[];
|
|
421
|
+
title: string;
|
|
422
|
+
};
|
|
358
423
|
/**
|
|
359
424
|
* Unwraps a value provided from API to a value plotly can understand
|
|
360
425
|
* Eg. Unwraps DateWrapper, LongWrapper objects.
|
|
361
426
|
*/
|
|
362
|
-
|
|
427
|
+
unwrapValue(value: unknown, timeZone?: TimeZone): unknown;
|
|
363
428
|
/**
|
|
364
429
|
*
|
|
365
430
|
* @param value The value to wrap up
|
|
366
431
|
* @param columnType The type of column this value is from
|
|
367
432
|
* @param timeZone The time zone if applicable
|
|
368
433
|
*/
|
|
369
|
-
|
|
370
|
-
|
|
434
|
+
wrapValue(value: unknown, columnType: string, timeZone?: TimeZone | null): unknown;
|
|
435
|
+
makeLayoutAxis(type: AxisType, theme?: Readonly<{
|
|
371
436
|
paper_bgcolor: string;
|
|
372
437
|
plot_bgcolor: string;
|
|
373
438
|
title_color: string;
|
|
@@ -385,31 +450,7 @@ declare class ChartUtils {
|
|
|
385
450
|
ohlc_increasing: string;
|
|
386
451
|
ohlc_decreasing: string;
|
|
387
452
|
}>): Partial<LayoutAxis>;
|
|
388
|
-
|
|
389
|
-
* Parses the colorway property of a theme and returns an array of colors
|
|
390
|
-
* Theme could have a single string with space separated colors or an array of strings representing the colorway
|
|
391
|
-
* @param theme The theme to get colorway from
|
|
392
|
-
* @returns Colorway array for the theme
|
|
393
|
-
*/
|
|
394
|
-
static getColorwayFromTheme(theme?: Readonly<{
|
|
395
|
-
paper_bgcolor: string;
|
|
396
|
-
plot_bgcolor: string;
|
|
397
|
-
title_color: string;
|
|
398
|
-
colorway: string;
|
|
399
|
-
gridcolor: string;
|
|
400
|
-
linecolor: string;
|
|
401
|
-
zerolinecolor: string;
|
|
402
|
-
activecolor: string;
|
|
403
|
-
rangebgcolor: string;
|
|
404
|
-
area_color: string;
|
|
405
|
-
trend_color: string;
|
|
406
|
-
line_color: string;
|
|
407
|
-
error_band_line_color: string;
|
|
408
|
-
error_band_fill_color: string;
|
|
409
|
-
ohlc_increasing: string;
|
|
410
|
-
ohlc_decreasing: string;
|
|
411
|
-
}>): string[];
|
|
412
|
-
static makeDefaultLayout(theme?: Readonly<{
|
|
453
|
+
makeDefaultLayout(theme?: Readonly<{
|
|
413
454
|
paper_bgcolor: string;
|
|
414
455
|
plot_bgcolor: string;
|
|
415
456
|
title_color: string;
|
|
@@ -431,47 +472,9 @@ declare class ChartUtils {
|
|
|
431
472
|
* Hydrate settings from a JSONable object
|
|
432
473
|
* @param settings Dehydrated settings
|
|
433
474
|
*/
|
|
434
|
-
|
|
475
|
+
hydrateSettings(settings: ChartModelSettings): Omit<ChartModelSettings, 'type'> & {
|
|
435
476
|
type?: SeriesPlotStyle;
|
|
436
477
|
};
|
|
437
|
-
static titleFromSettings(settings: ChartModelSettings): string;
|
|
438
|
-
/**
|
|
439
|
-
* Creates the Figure settings from the Chart Builder settings
|
|
440
|
-
* This should be deprecated at some point, and have Chart Builder create the figure settings directly.
|
|
441
|
-
* This logic will still need to exist to translate existing charts, but could be part of a migration script
|
|
442
|
-
* to translate the data.
|
|
443
|
-
* Change when we decide to add more functionality to the Chart Builder.
|
|
444
|
-
* @param settings The chart builder settings
|
|
445
|
-
* @param settings.title The title for this figure
|
|
446
|
-
* @param settings.xAxis The name of the column to use for the x-axis
|
|
447
|
-
* @param settings.series The name of the columns to use for the series of this figure
|
|
448
|
-
* @param settings.type The plot style for this figure
|
|
449
|
-
*/
|
|
450
|
-
static makeFigureSettings(settings: ChartModelSettings, table: TableTemplate): {
|
|
451
|
-
charts: {
|
|
452
|
-
chartType: string;
|
|
453
|
-
axes: {
|
|
454
|
-
formatType: string;
|
|
455
|
-
type: string;
|
|
456
|
-
position: string;
|
|
457
|
-
}[];
|
|
458
|
-
series: {
|
|
459
|
-
plotStyle: string;
|
|
460
|
-
name: string;
|
|
461
|
-
dataSources: {
|
|
462
|
-
type: string;
|
|
463
|
-
columnName: string;
|
|
464
|
-
axis: {
|
|
465
|
-
formatType: string;
|
|
466
|
-
type: string;
|
|
467
|
-
position: string;
|
|
468
|
-
};
|
|
469
|
-
table: TableTemplate;
|
|
470
|
-
}[];
|
|
471
|
-
}[];
|
|
472
|
-
}[];
|
|
473
|
-
title: string;
|
|
474
|
-
};
|
|
475
478
|
}
|
|
476
479
|
export default ChartUtils;
|
|
477
480
|
//# sourceMappingURL=ChartUtils.d.ts.map
|