@deephaven/chart 0.15.5-vite.12 → 0.15.6-vite.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Chart.d.ts +84 -85
- package/dist/Chart.d.ts.map +1 -1
- package/dist/Chart.js +56 -49
- package/dist/Chart.js.map +1 -1
- package/dist/ChartModel.d.ts +30 -22
- package/dist/ChartModel.d.ts.map +1 -1
- package/dist/ChartModel.js +18 -9
- package/dist/ChartModel.js.map +1 -1
- package/dist/ChartModelFactory.d.ts +67 -43
- package/dist/ChartModelFactory.d.ts.map +1 -1
- package/dist/ChartModelFactory.js +27 -27
- package/dist/ChartModelFactory.js.map +1 -1
- package/dist/ChartTestUtils.d.ts +16 -15
- package/dist/ChartTestUtils.d.ts.map +1 -1
- package/dist/ChartTestUtils.js +5 -0
- package/dist/ChartTestUtils.js.map +1 -1
- package/dist/ChartTheme.d.ts +17 -17
- package/dist/ChartTheme.d.ts.map +1 -1
- package/dist/ChartTheme.js.map +1 -1
- package/dist/ChartUtils.d.ts +252 -225
- package/dist/ChartUtils.d.ts.map +1 -1
- package/dist/ChartUtils.js +219 -174
- package/dist/ChartUtils.js.map +1 -1
- package/dist/FigureChartModel.d.ts +70 -106
- package/dist/FigureChartModel.d.ts.map +1 -1
- package/dist/FigureChartModel.js +90 -36
- package/dist/FigureChartModel.js.map +1 -1
- package/dist/MockChartModel.d.ts +11 -209
- package/dist/MockChartModel.d.ts.map +1 -1
- package/dist/declaration.d.js +2 -0
- package/dist/declaration.d.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/isFigureChartModel.d.ts +4 -0
- package/dist/isFigureChartModel.d.ts.map +1 -0
- package/dist/isFigureChartModel.js +4 -0
- package/dist/isFigureChartModel.js.map +1 -0
- package/dist/plotly/Plotly.d.ts +1 -0
- package/package.json +11 -8
package/dist/ChartUtils.d.ts
CHANGED
|
@@ -1,4 +1,42 @@
|
|
|
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';
|
|
3
|
+
import { Layout, PlotData, PlotType, Axis as PlotlyAxis, ErrorBar, LayoutAxis } from 'plotly.js';
|
|
4
|
+
import { Range } from '@deephaven/utils';
|
|
5
|
+
import ChartTheme from './ChartTheme';
|
|
6
|
+
export interface ChartModelSettings {
|
|
7
|
+
hiddenSeries?: string[];
|
|
8
|
+
type: keyof SeriesPlotStyle;
|
|
9
|
+
series: string[];
|
|
10
|
+
xAxis: string;
|
|
11
|
+
title?: string;
|
|
12
|
+
}
|
|
13
|
+
export interface SeriesData {
|
|
14
|
+
type: string | null;
|
|
15
|
+
mode: string | null;
|
|
16
|
+
name: string;
|
|
17
|
+
orientation: string;
|
|
18
|
+
xaxis?: number;
|
|
19
|
+
marker?: unknown;
|
|
20
|
+
xLow?: number;
|
|
21
|
+
xHigh?: number;
|
|
22
|
+
}
|
|
23
|
+
declare type LayoutAxisKey = 'xaxis' | 'xaxis2' | 'xaxis3' | 'xaxis4' | 'xaxis5' | 'xaxis6' | 'xaxis7' | 'xaxis8' | 'xaxis9' | 'yaxis' | 'yaxis2' | 'yaxis3' | 'yaxis4' | 'yaxis5' | 'yaxis6' | 'yaxis7' | 'yaxis8' | 'yaxis9';
|
|
24
|
+
export interface TreeMapData extends PlotData {
|
|
25
|
+
tiling: {
|
|
26
|
+
packing: 'squarify';
|
|
27
|
+
pad: 0;
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
interface Rangebreaks {
|
|
31
|
+
bounds?: number[];
|
|
32
|
+
dvalue?: number;
|
|
33
|
+
enable?: boolean;
|
|
34
|
+
name?: string;
|
|
35
|
+
pattern?: 'day of week' | 'hour' | '';
|
|
36
|
+
values?: string[];
|
|
37
|
+
}
|
|
38
|
+
export declare type AxisTypeMap = Map<AxisType, Axis[]>;
|
|
39
|
+
declare type AxisPositionMap = Map<AxisPosition, Axis[]>;
|
|
2
40
|
declare class ChartUtils {
|
|
3
41
|
static DEFAULT_AXIS_SIZE: number;
|
|
4
42
|
static MIN_AXIS_SIZE: number;
|
|
@@ -7,8 +45,8 @@ declare class ChartUtils {
|
|
|
7
45
|
static LEGEND_WIDTH_PX: number;
|
|
8
46
|
static MAX_LEGEND_SIZE: number;
|
|
9
47
|
static ORIENTATION: Readonly<{
|
|
10
|
-
HORIZONTAL:
|
|
11
|
-
VERTICAL:
|
|
48
|
+
readonly HORIZONTAL: "h";
|
|
49
|
+
readonly VERTICAL: "v";
|
|
12
50
|
}>;
|
|
13
51
|
static DATE_FORMAT: string;
|
|
14
52
|
static DEFAULT_MARGIN: Readonly<{
|
|
@@ -24,152 +62,182 @@ declare class ChartUtils {
|
|
|
24
62
|
static SUBTITLE_LINE_HEIGHT: number;
|
|
25
63
|
/**
|
|
26
64
|
* Converts the Iris plot style into a plotly chart type
|
|
27
|
-
* @param
|
|
28
|
-
* @param
|
|
65
|
+
* @param plotStyle The plotStyle to use, see dh.plot.SeriesPlotStyle
|
|
66
|
+
* @param isBusinessTime If the plot is using business time for an axis
|
|
29
67
|
*/
|
|
30
|
-
static getPlotlyChartType(plotStyle:
|
|
68
|
+
static getPlotlyChartType(plotStyle: SeriesPlotStyle, isBusinessTime: boolean): PlotType | undefined;
|
|
31
69
|
/**
|
|
32
70
|
* Converts the Iris plot style into a plotly chart mode
|
|
33
|
-
* @param
|
|
71
|
+
* @param plotStyle The plotStyle to use, see dh.plot.SeriesPlotStyle.*
|
|
34
72
|
*/
|
|
35
|
-
static getPlotlyChartMode(plotStyle:
|
|
73
|
+
static getPlotlyChartMode(plotStyle: SeriesPlotStyle): PlotData['mode'] | undefined;
|
|
36
74
|
/**
|
|
37
75
|
* Get the property to set on the series data for plotly
|
|
38
|
-
* @param
|
|
39
|
-
* @param
|
|
76
|
+
* @param plotStyle The plot style of the series
|
|
77
|
+
* @param sourceType The source type for the series
|
|
40
78
|
*/
|
|
41
|
-
static getPlotlyProperty(plotStyle:
|
|
42
|
-
static getPlotlySeriesOrientation(series:
|
|
79
|
+
static getPlotlyProperty(plotStyle: SeriesPlotStyle, sourceType: SourceType): string;
|
|
80
|
+
static getPlotlySeriesOrientation(series: Series): 'h' | 'v' | undefined;
|
|
43
81
|
/**
|
|
44
82
|
* Generate the plotly error bar data from the passed in data.
|
|
45
83
|
* Iris passes in the values as absolute, plotly needs them as relative.
|
|
46
|
-
* @param
|
|
47
|
-
* @param
|
|
48
|
-
* @param
|
|
84
|
+
* @param x The main data array
|
|
85
|
+
* @param xLow The absolute low values
|
|
86
|
+
* @param xHigh
|
|
49
87
|
*
|
|
50
|
-
* @returns
|
|
88
|
+
* @returns The error_x object required by plotly, or null if none is required
|
|
51
89
|
*/
|
|
52
|
-
static getPlotlyErrorBars(x:
|
|
53
|
-
static getPlotlyDateFormat(formatter:
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
automargin: boolean;
|
|
57
|
-
};
|
|
58
|
-
static convertNumberPrefix(prefix: any): any;
|
|
59
|
-
static getPlotlyNumberFormat(formatter: any, columnType: any, formatPattern: any): {
|
|
60
|
-
tickformat: string;
|
|
61
|
-
tickprefix: any;
|
|
62
|
-
ticksuffix: any;
|
|
63
|
-
automargin: boolean;
|
|
64
|
-
} | null;
|
|
90
|
+
static getPlotlyErrorBars(x: number[], xLow: number[], xHigh: number[]): ErrorBar;
|
|
91
|
+
static getPlotlyDateFormat(formatter: Formatter | null, columnType: string, formatPattern: string): Partial<LayoutAxis>;
|
|
92
|
+
static convertNumberPrefix(prefix: string): string;
|
|
93
|
+
static getPlotlyNumberFormat(formatter: Formatter | null, columnType: string, formatPattern: string): Partial<LayoutAxis> | null;
|
|
65
94
|
/**
|
|
66
95
|
* Gets the plotly axis formatting information from the source passed in
|
|
67
|
-
* @param
|
|
68
|
-
* @param
|
|
96
|
+
* @param source The Source to get the formatter information from
|
|
97
|
+
* @param formatter The current formatter for formatting data
|
|
69
98
|
*/
|
|
70
|
-
static getPlotlyAxisFormat(source:
|
|
99
|
+
static getPlotlyAxisFormat(source: SeriesDataSource, formatter?: Formatter | null): Partial<PlotlyAxis> | null;
|
|
71
100
|
/**
|
|
72
101
|
* Adds tick spacing for an axis that has gapBetweenMajorTicks defined.
|
|
73
102
|
*
|
|
74
|
-
* @param
|
|
75
|
-
* @param
|
|
76
|
-
* @param
|
|
103
|
+
* @param axisFormat the current axis format, may be null
|
|
104
|
+
* @param axis the current axis
|
|
105
|
+
* @param isDateType indicates if the columns is a date type
|
|
77
106
|
*/
|
|
78
|
-
static addTickSpacing(axisFormat:
|
|
107
|
+
static addTickSpacing(axisFormat: Partial<LayoutAxis> | null, axis: Axis, isDateType: boolean): Partial<PlotlyAxis> | null;
|
|
79
108
|
/**
|
|
80
109
|
* Retrieve the data source for a given axis in a chart
|
|
81
|
-
* @param
|
|
82
|
-
* @param
|
|
83
|
-
* @returns
|
|
110
|
+
* @param chart The chart to get the source for
|
|
111
|
+
* @param axis The axis to find the source for
|
|
112
|
+
* @returns The first source matching this axis
|
|
84
113
|
*/
|
|
85
|
-
static getSourceForAxis(chart:
|
|
114
|
+
static getSourceForAxis(chart: Chart, axis: Axis): SeriesDataSource | null;
|
|
86
115
|
/**
|
|
87
116
|
* Get visibility setting for the series object
|
|
88
|
-
* @param
|
|
89
|
-
* @param
|
|
90
|
-
* @returns
|
|
117
|
+
* @param name The series name to get the visibility for
|
|
118
|
+
* @param settings Chart settings
|
|
119
|
+
* @returns True for visible series and 'legendonly' for hidden
|
|
91
120
|
*/
|
|
92
|
-
static getSeriesVisibility(name: string, settings
|
|
121
|
+
static getSeriesVisibility(name: string, settings?: Partial<ChartModelSettings>): boolean | 'legendonly';
|
|
93
122
|
/**
|
|
94
123
|
* Get hidden labels array from chart settings
|
|
95
|
-
* @param
|
|
96
|
-
* @returns
|
|
124
|
+
* @param settings Chart settings
|
|
125
|
+
* @returns Array of hidden series names
|
|
97
126
|
*/
|
|
98
|
-
static getHiddenLabels(settings:
|
|
127
|
+
static getHiddenLabels(settings: Partial<ChartModelSettings>): string[];
|
|
99
128
|
/**
|
|
100
129
|
* Create a default series data object. Apply styling to the object afterward.
|
|
101
|
-
* @returns
|
|
130
|
+
* @returns A simple series data object with no styling
|
|
102
131
|
*/
|
|
103
|
-
static makeSeriesData(type:
|
|
132
|
+
static makeSeriesData(type: PlotType | undefined, mode: PlotData['mode'] | undefined, name: string, orientation?: 'h' | 'v'): Partial<PlotData>;
|
|
104
133
|
/**
|
|
105
134
|
* Create a data series (trace) for use with plotly
|
|
106
|
-
* @param
|
|
107
|
-
* @param
|
|
108
|
-
* @param
|
|
109
|
-
* @param
|
|
110
|
-
* @returns
|
|
135
|
+
* @param series The series to create the series data with
|
|
136
|
+
* @param axisTypeMap The map of axes grouped by type
|
|
137
|
+
* @param seriesVisibility Visibility setting for the series
|
|
138
|
+
* @param theme The theme properties for the plot. See ChartTheme.js for an example
|
|
139
|
+
* @returns The series data (trace) object for use with plotly.
|
|
111
140
|
*/
|
|
112
|
-
static makeSeriesDataFromSeries(series:
|
|
113
|
-
|
|
114
|
-
|
|
141
|
+
static makeSeriesDataFromSeries(series: Series, axisTypeMap: AxisTypeMap, seriesVisibility: boolean | 'legendonly', theme?: Readonly<{
|
|
142
|
+
paper_bgcolor: string;
|
|
143
|
+
plot_bgcolor: string;
|
|
144
|
+
title_color: string;
|
|
145
|
+
colorway: string;
|
|
146
|
+
gridcolor: string;
|
|
147
|
+
linecolor: string;
|
|
148
|
+
zerolinecolor: string;
|
|
149
|
+
activecolor: string;
|
|
150
|
+
rangebgcolor: string;
|
|
151
|
+
area_color: string;
|
|
152
|
+
trend_color: string;
|
|
153
|
+
line_color: string;
|
|
154
|
+
error_band_line_color: string;
|
|
155
|
+
error_band_fill_color: string;
|
|
156
|
+
ohlc_increasing: string;
|
|
157
|
+
ohlc_decreasing: string;
|
|
158
|
+
}>): Partial<PlotData>;
|
|
159
|
+
static addSourcesToSeriesData(seriesDataParam: Partial<PlotData>, plotStyle: SeriesPlotStyle, sources: SeriesDataSource[], axisTypeMap: AxisTypeMap): void;
|
|
160
|
+
static addStylingToSeriesData(seriesDataParam: Partial<PlotData>, plotStyle: SeriesPlotStyle, theme?: typeof ChartTheme, lineColor?: string | null, shapeColor?: string | null, seriesVisibility?: 'legendonly' | boolean | null): void;
|
|
115
161
|
/**
|
|
116
162
|
* Retrieve the axis formats from the provided figure.
|
|
117
163
|
* Currently defaults to just the x/y axes.
|
|
118
|
-
* @param
|
|
119
|
-
* @param
|
|
120
|
-
* @returns
|
|
164
|
+
* @param figure The figure to get the axis formats for
|
|
165
|
+
* @param formatter The formatter to use when getting the axis format
|
|
166
|
+
* @returns A map of axis layout property names to axis formats
|
|
121
167
|
*/
|
|
122
|
-
static getAxisFormats(figure:
|
|
123
|
-
static getChartType(plotStyle:
|
|
168
|
+
static getAxisFormats(figure: Figure, formatter: Formatter): Map<LayoutAxisKey, Partial<PlotlyAxis>>;
|
|
169
|
+
static getChartType(plotStyle: SeriesPlotStyle, isBusinessTime: boolean): PlotType | undefined;
|
|
124
170
|
/**
|
|
125
171
|
* Return the plotly axis property name
|
|
126
|
-
* @param
|
|
172
|
+
* @param axisType The axis type to get the property name for
|
|
127
173
|
*/
|
|
128
|
-
static getAxisPropertyName(axisType:
|
|
174
|
+
static getAxisPropertyName(axisType: AxisType): 'x' | 'y' | null;
|
|
129
175
|
/**
|
|
130
176
|
* Returns the plotly "side" value for the provided axis position
|
|
131
|
-
* @param
|
|
177
|
+
* @param axisPosition The Iris AxisPosition of the axis
|
|
132
178
|
*/
|
|
133
|
-
static getAxisSide(axisPosition:
|
|
179
|
+
static getAxisSide(axisPosition: AxisPosition): LayoutAxis['side'] | undefined;
|
|
134
180
|
/**
|
|
135
181
|
* Retrieve the chart that contains the passed in series from the figure
|
|
136
|
-
* @param
|
|
137
|
-
* @param
|
|
182
|
+
* @param figure The figure to retrieve the chart from
|
|
183
|
+
* @param series The series to get the chart for
|
|
138
184
|
*/
|
|
139
|
-
static getChartForSeries(figure:
|
|
185
|
+
static getChartForSeries(figure: Figure, series: Series): Chart | null;
|
|
140
186
|
/**
|
|
141
187
|
* Get an object mapping axis to their ranges
|
|
142
|
-
* @param
|
|
143
|
-
* @returns
|
|
188
|
+
* @param layout The plotly layout object to get the ranges from
|
|
189
|
+
* @returns An object mapping the axis name to it's range
|
|
144
190
|
*/
|
|
145
|
-
static getLayoutRanges(layout:
|
|
191
|
+
static getLayoutRanges(layout: Layout): Record<string, Range[]>;
|
|
146
192
|
/**
|
|
147
193
|
* Updates the axes positions and sizes in the layout object provided.
|
|
148
194
|
* If the axis did not exist in the layout previously, it is created and added.
|
|
149
195
|
* Any axis that no longer exists in axes is removed.
|
|
150
196
|
* With Downsampling enabled, will also update the range on the axis itself as appropriate
|
|
151
|
-
* @param
|
|
152
|
-
* @param
|
|
153
|
-
* @param
|
|
154
|
-
* @param
|
|
155
|
-
* @param
|
|
197
|
+
* @param layoutParam The layout object to update
|
|
198
|
+
* @param axes The axes to update the layout with
|
|
199
|
+
* @param plotWidth The width of the plot to calculate the axis sizes for
|
|
200
|
+
* @param plotHeight The height of the plot to calculate the axis sizes for
|
|
201
|
+
* @param getRangeParser A function to retrieve the range parser for a given axis
|
|
156
202
|
*/
|
|
157
|
-
static updateLayoutAxes(layoutParam:
|
|
158
|
-
|
|
203
|
+
static updateLayoutAxes(layoutParam: Partial<Layout>, axes: Axis[], plotWidth?: number, plotHeight?: number, getRangeParser?: ((axis: Axis) => (range: Range) => unknown[]) | null, theme?: Readonly<{
|
|
204
|
+
paper_bgcolor: string;
|
|
205
|
+
plot_bgcolor: string;
|
|
206
|
+
title_color: string;
|
|
207
|
+
colorway: string;
|
|
208
|
+
gridcolor: string;
|
|
209
|
+
linecolor: string;
|
|
210
|
+
zerolinecolor: string;
|
|
211
|
+
activecolor: string;
|
|
212
|
+
rangebgcolor: string;
|
|
213
|
+
area_color: string;
|
|
214
|
+
trend_color: string;
|
|
215
|
+
line_color: string;
|
|
216
|
+
error_band_line_color: string;
|
|
217
|
+
error_band_fill_color: string;
|
|
218
|
+
ohlc_increasing: string;
|
|
219
|
+
ohlc_decreasing: string;
|
|
220
|
+
}>): void;
|
|
221
|
+
static getAxisLayoutProperty(axisProperty: 'x' | 'y', axisIndex: number): LayoutAxisKey;
|
|
159
222
|
/**
|
|
160
223
|
* Updates the layout axis object in place
|
|
161
|
-
* @param
|
|
162
|
-
* @param
|
|
163
|
-
* @param
|
|
164
|
-
* @param
|
|
165
|
-
* @param
|
|
166
|
-
* @param
|
|
224
|
+
* @param layoutAxisParam The plotly layout axis param
|
|
225
|
+
* @param axis The Iris Axis to update the plotly layout with
|
|
226
|
+
* @param axisIndex The type index for this axis
|
|
227
|
+
* @param axisPositionMap All the axes mapped by position
|
|
228
|
+
* @param axisSize The size of each axis in percent
|
|
229
|
+
* @param bounds The bounds of the axes domains
|
|
167
230
|
*/
|
|
168
|
-
static updateLayoutAxis(layoutAxisParam:
|
|
231
|
+
static updateLayoutAxis(layoutAxisParam: Partial<LayoutAxis>, axis: Axis, axisIndex: number, axisPositionMap: AxisPositionMap, xAxisSize: number, yAxisSize: number, bounds: {
|
|
232
|
+
left: number;
|
|
233
|
+
bottom: number;
|
|
234
|
+
top: number;
|
|
235
|
+
right: number;
|
|
236
|
+
}): void;
|
|
169
237
|
/**
|
|
170
238
|
* Converts an open or close period to a declimal. e.g '09:30" to 9.5
|
|
171
239
|
*
|
|
172
|
-
* @param
|
|
240
|
+
* @param period the open or close value of the period
|
|
173
241
|
*/
|
|
174
242
|
static periodToDecimal(period: string): number;
|
|
175
243
|
/**
|
|
@@ -178,187 +246,145 @@ declare class ChartUtils {
|
|
|
178
246
|
* will result in [[6,1]] meaning close on Saturday and open on Monday.
|
|
179
247
|
* If you remove Wednesday from the array, then you get two closures [[6, 1], [3, 4]]
|
|
180
248
|
*
|
|
181
|
-
* @param
|
|
249
|
+
* @param businessDays the days to display on the x-axis
|
|
182
250
|
*/
|
|
183
|
-
static createBoundsFromDays(businessDays:
|
|
251
|
+
static createBoundsFromDays(businessDays: string[]): Range[];
|
|
184
252
|
/**
|
|
185
253
|
* Creates an array of range breaks for all holidays.
|
|
186
254
|
*
|
|
187
|
-
* @param
|
|
188
|
-
* @param
|
|
189
|
-
* @param
|
|
255
|
+
* @param holidays an array of holidays
|
|
256
|
+
* @param calendarTimeZone the time zone for the business calendar
|
|
257
|
+
* @param formatterTimeZone the time zone for the formatter
|
|
190
258
|
*/
|
|
191
|
-
static createRangeBreakValuesFromHolidays(holidays:
|
|
259
|
+
static createRangeBreakValuesFromHolidays(holidays: Holiday[], calendarTimeZone: TimeZone, formatterTimeZone?: TimeZone): Rangebreaks[];
|
|
192
260
|
/**
|
|
193
261
|
* Creates the range break value for a full holiday. A full holiday is day that has no business periods.
|
|
194
262
|
*
|
|
195
|
-
* @param
|
|
196
|
-
* @param
|
|
197
|
-
* @param
|
|
263
|
+
* @param holiday the full holiday
|
|
264
|
+
* @param calendarTimeZone the time zone for the business calendar
|
|
265
|
+
* @param formatterTimeZone the time zone for the formatter
|
|
198
266
|
*/
|
|
199
|
-
static createFullHoliday(holiday: Holiday, calendarTimeZone: TimeZone, formatterTimeZone
|
|
267
|
+
static createFullHoliday(holiday: Holiday, calendarTimeZone: TimeZone, formatterTimeZone?: TimeZone): string;
|
|
200
268
|
/**
|
|
201
269
|
* Creates the range break for a partial holiday. A partial holiday is holiday with business periods
|
|
202
270
|
* that are different than the default business periods.
|
|
203
271
|
*
|
|
204
|
-
* @param
|
|
205
|
-
* @param
|
|
206
|
-
* @param
|
|
272
|
+
* @param holiday the partial holiday
|
|
273
|
+
* @param calendarTimeZone the time zone for the business calendar
|
|
274
|
+
* @param formatterTimeZone the time zone for the formatter
|
|
207
275
|
*/
|
|
208
|
-
static createPartialHoliday(holiday: Holiday, calendarTimeZone: TimeZone, formatterTimeZone
|
|
209
|
-
values:
|
|
276
|
+
static createPartialHoliday(holiday: Holiday, calendarTimeZone: TimeZone, formatterTimeZone?: TimeZone): {
|
|
277
|
+
values: string[];
|
|
210
278
|
dvalue: number;
|
|
211
279
|
}[];
|
|
212
280
|
/**
|
|
213
281
|
* Adjusts a date string from the calendar time zone to the formatter time zone.
|
|
214
282
|
*
|
|
215
|
-
* @param
|
|
216
|
-
* @param
|
|
217
|
-
* @param
|
|
283
|
+
* @param dateString the date string
|
|
284
|
+
* @param calendarTimeZone the time zone for the business calendar
|
|
285
|
+
* @param formatterTimeZone the time zone for the formatter
|
|
218
286
|
*/
|
|
219
|
-
static adjustDateForTimeZone(dateString: string, calendarTimeZone: TimeZone, formatterTimeZone
|
|
287
|
+
static adjustDateForTimeZone(dateString: string, calendarTimeZone: TimeZone, formatterTimeZone?: TimeZone): string;
|
|
220
288
|
/**
|
|
221
289
|
* Groups an array and returns a map
|
|
222
|
-
* @param
|
|
223
|
-
* @param
|
|
224
|
-
* @returns
|
|
290
|
+
* @param array The object to group
|
|
291
|
+
* @param property The property name to group by
|
|
292
|
+
* @returns A map containing the items grouped by their values for the property
|
|
225
293
|
*/
|
|
226
|
-
static groupArray(array:
|
|
227
|
-
/**
|
|
228
|
-
* Update
|
|
229
|
-
*/
|
|
230
|
-
static updateRanges(): void;
|
|
294
|
+
static groupArray<T, P extends keyof T>(array: T[], property: P): Map<T[P], T[]>;
|
|
231
295
|
/**
|
|
232
296
|
* Unwraps a value provided from API to a value plotly can understand
|
|
233
297
|
* Eg. Unwraps DateWrapper, LongWrapper objects.
|
|
234
298
|
*/
|
|
235
|
-
static unwrapValue(value:
|
|
299
|
+
static unwrapValue(value: unknown, timeZone?: TimeZone): unknown;
|
|
236
300
|
/**
|
|
237
301
|
*
|
|
238
|
-
* @param
|
|
239
|
-
* @param
|
|
240
|
-
* @param
|
|
302
|
+
* @param value The value to wrap up
|
|
303
|
+
* @param columnType The type of column this value is from
|
|
304
|
+
* @param timeZone The time zone if applicable
|
|
241
305
|
*/
|
|
242
|
-
static wrapValue(value:
|
|
243
|
-
static makeLayoutAxis(type:
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
};
|
|
306
|
+
static wrapValue(value: unknown, columnType: string, timeZone?: TimeZone | null): unknown;
|
|
307
|
+
static makeLayoutAxis(type: AxisType, theme?: Readonly<{
|
|
308
|
+
paper_bgcolor: string;
|
|
309
|
+
plot_bgcolor: string;
|
|
310
|
+
title_color: string;
|
|
311
|
+
colorway: string;
|
|
312
|
+
gridcolor: string;
|
|
313
|
+
linecolor: string;
|
|
314
|
+
zerolinecolor: string;
|
|
315
|
+
activecolor: string;
|
|
316
|
+
rangebgcolor: string;
|
|
317
|
+
area_color: string;
|
|
318
|
+
trend_color: string;
|
|
319
|
+
line_color: string;
|
|
320
|
+
error_band_line_color: string;
|
|
321
|
+
error_band_fill_color: string;
|
|
322
|
+
ohlc_increasing: string;
|
|
323
|
+
ohlc_decreasing: string;
|
|
324
|
+
}>): Partial<LayoutAxis>;
|
|
262
325
|
/**
|
|
263
326
|
* Parses the colorway property of a theme and returns an array of colors
|
|
264
327
|
* Theme could have a single string with space separated colors or an array of strings representing the colorway
|
|
265
|
-
* @param
|
|
266
|
-
* @returns
|
|
328
|
+
* @param theme The theme to get colorway from
|
|
329
|
+
* @returns Colorway array for the theme
|
|
267
330
|
*/
|
|
268
|
-
static getColorwayFromTheme(theme
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
showline: boolean;
|
|
305
|
-
ticklen: number;
|
|
306
|
-
tickcolor: any;
|
|
307
|
-
tickfont: {
|
|
308
|
-
color: any;
|
|
309
|
-
};
|
|
310
|
-
title: {
|
|
311
|
-
font: {
|
|
312
|
-
color: any;
|
|
313
|
-
};
|
|
314
|
-
};
|
|
315
|
-
};
|
|
316
|
-
yaxis: {
|
|
317
|
-
automargin: boolean;
|
|
318
|
-
gridcolor: any;
|
|
319
|
-
linecolor: any;
|
|
320
|
-
rangeslider: {
|
|
321
|
-
visible: boolean;
|
|
322
|
-
};
|
|
323
|
-
showline: boolean;
|
|
324
|
-
ticklen: number;
|
|
325
|
-
tickcolor: any;
|
|
326
|
-
tickfont: {
|
|
327
|
-
color: any;
|
|
328
|
-
};
|
|
329
|
-
title: {
|
|
330
|
-
font: {
|
|
331
|
-
color: any;
|
|
332
|
-
};
|
|
333
|
-
};
|
|
334
|
-
};
|
|
335
|
-
};
|
|
331
|
+
static getColorwayFromTheme(theme?: Readonly<{
|
|
332
|
+
paper_bgcolor: string;
|
|
333
|
+
plot_bgcolor: string;
|
|
334
|
+
title_color: string;
|
|
335
|
+
colorway: string;
|
|
336
|
+
gridcolor: string;
|
|
337
|
+
linecolor: string;
|
|
338
|
+
zerolinecolor: string;
|
|
339
|
+
activecolor: string;
|
|
340
|
+
rangebgcolor: string;
|
|
341
|
+
area_color: string;
|
|
342
|
+
trend_color: string;
|
|
343
|
+
line_color: string;
|
|
344
|
+
error_band_line_color: string;
|
|
345
|
+
error_band_fill_color: string;
|
|
346
|
+
ohlc_increasing: string;
|
|
347
|
+
ohlc_decreasing: string;
|
|
348
|
+
}>): string[];
|
|
349
|
+
static makeDefaultLayout(theme?: Readonly<{
|
|
350
|
+
paper_bgcolor: string;
|
|
351
|
+
plot_bgcolor: string;
|
|
352
|
+
title_color: string;
|
|
353
|
+
colorway: string;
|
|
354
|
+
gridcolor: string;
|
|
355
|
+
linecolor: string;
|
|
356
|
+
zerolinecolor: string;
|
|
357
|
+
activecolor: string;
|
|
358
|
+
rangebgcolor: string;
|
|
359
|
+
area_color: string;
|
|
360
|
+
trend_color: string;
|
|
361
|
+
line_color: string;
|
|
362
|
+
error_band_line_color: string;
|
|
363
|
+
error_band_fill_color: string;
|
|
364
|
+
ohlc_increasing: string;
|
|
365
|
+
ohlc_decreasing: string;
|
|
366
|
+
}>): Partial<Layout>;
|
|
336
367
|
/**
|
|
337
368
|
* Hydrate settings from a JSONable object
|
|
338
|
-
* @param
|
|
369
|
+
* @param settings Dehydrated settings
|
|
339
370
|
*/
|
|
340
|
-
static hydrateSettings(settings:
|
|
341
|
-
type:
|
|
371
|
+
static hydrateSettings(settings: ChartModelSettings): Omit<ChartModelSettings, 'type'> & {
|
|
372
|
+
type: SeriesPlotStyle;
|
|
342
373
|
};
|
|
343
|
-
static titleFromSettings(settings:
|
|
374
|
+
static titleFromSettings(settings: ChartModelSettings): string;
|
|
344
375
|
/**
|
|
345
376
|
* Creates the Figure settings from the Chart Builder settings
|
|
346
377
|
* This should be deprecated at some point, and have Chart Builder create the figure settings directly.
|
|
347
378
|
* This logic will still need to exist to translate existing charts, but could be part of a migration script
|
|
348
379
|
* to translate the data.
|
|
349
380
|
* Change when we decide to add more functionality to the Chart Builder.
|
|
350
|
-
* @param
|
|
351
|
-
* @param
|
|
352
|
-
* @param
|
|
353
|
-
* @param
|
|
354
|
-
* @param
|
|
381
|
+
* @param settings The chart builder settings
|
|
382
|
+
* @param settings.title The title for this figure
|
|
383
|
+
* @param settings.xAxis The name of the column to use for the x-axis
|
|
384
|
+
* @param settings.series The name of the columns to use for the series of this figure
|
|
385
|
+
* @param settings.type The plot style for this figure
|
|
355
386
|
*/
|
|
356
|
-
static makeFigureSettings(settings: {
|
|
357
|
-
title: string;
|
|
358
|
-
xAxis: string;
|
|
359
|
-
series: string[];
|
|
360
|
-
type: dh.plot.SeriesPlotStyle;
|
|
361
|
-
}, table: any): {
|
|
387
|
+
static makeFigureSettings(settings: ChartModelSettings, table: TableTemplate): {
|
|
362
388
|
charts: {
|
|
363
389
|
chartType: string;
|
|
364
390
|
axes: {
|
|
@@ -377,11 +403,12 @@ declare class ChartUtils {
|
|
|
377
403
|
type: string;
|
|
378
404
|
position: string;
|
|
379
405
|
};
|
|
380
|
-
table:
|
|
406
|
+
table: TableTemplate;
|
|
381
407
|
}[];
|
|
382
408
|
}[];
|
|
383
409
|
}[];
|
|
384
|
-
title:
|
|
410
|
+
title: string;
|
|
385
411
|
};
|
|
386
412
|
}
|
|
413
|
+
export default ChartUtils;
|
|
387
414
|
//# sourceMappingURL=ChartUtils.d.ts.map
|