@vizzly/services 0.14.4 → 0.15.0-dev-4c548c2a9cdc29d779838ea3325029fe7e640235

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 (91) hide show
  1. package/dist/index.js +1 -1
  2. package/dist/results-driver/src/driver/VizzlyQuery/AreaChart/toQueries.d.ts +1 -1
  3. package/dist/results-driver/src/driver/VizzlyQuery/BarChart/toQueries.d.ts +1 -1
  4. package/dist/results-driver/src/driver/VizzlyQuery/BarChartV2/toQueries.d.ts +4 -0
  5. package/dist/results-driver/src/driver/VizzlyQuery/BasicTable/toQueries.d.ts +1 -1
  6. package/dist/results-driver/src/driver/VizzlyQuery/BubbleChart/toQueries.d.ts +10 -0
  7. package/dist/results-driver/src/driver/VizzlyQuery/BubbleChartV2/toQueries.d.ts +10 -0
  8. package/dist/results-driver/src/driver/VizzlyQuery/ComboChartV2/toQueries.d.ts +10 -0
  9. package/dist/results-driver/src/driver/VizzlyQuery/FunnelChart/toQueries.d.ts +1 -1
  10. package/dist/results-driver/src/driver/VizzlyQuery/HorizontalBarChart/toQueries.d.ts +1 -1
  11. package/dist/results-driver/src/driver/VizzlyQuery/LineChart/toQueries.d.ts +1 -1
  12. package/dist/results-driver/src/driver/VizzlyQuery/LineChartV2/toQueries.d.ts +1 -1
  13. package/dist/results-driver/src/driver/VizzlyQuery/PieChart/toQueries.d.ts +1 -1
  14. package/dist/results-driver/src/driver/VizzlyQuery/PivotTable/toQueries.d.ts +1 -1
  15. package/dist/results-driver/src/driver/VizzlyQuery/RadarChart/toQueries.d.ts +4 -0
  16. package/dist/results-driver/src/driver/VizzlyQuery/RichText/toQueries.d.ts +1 -1
  17. package/dist/results-driver/src/driver/VizzlyQuery/SunburstChart/toQueries.d.ts +4 -0
  18. package/dist/results-driver/src/driver/VizzlyQuery/WaterfallChart/toQueries.d.ts +4 -0
  19. package/dist/results-driver/src/driver/VizzlyQuery/buildVizzlyQuery.d.ts +5 -0
  20. package/dist/results-driver/src/driver/VizzlyQuery/commonToQueries.d.ts +1 -1
  21. package/dist/services/src/Services/View.d.ts +17 -1
  22. package/dist/services/src/index.d.ts +6 -2
  23. package/dist/shared-logic/src/AreaChartV2/attributesSchema.d.ts +3 -0
  24. package/dist/shared-logic/src/AreaChartV2/constants.d.ts +3 -0
  25. package/dist/shared-logic/src/AreaChartV2/index.d.ts +4 -0
  26. package/dist/shared-logic/src/AreaChartV2/setAttributes.d.ts +4 -0
  27. package/dist/shared-logic/src/BarChartV2/attributesSchema.d.ts +3 -0
  28. package/dist/shared-logic/src/BarChartV2/constants.d.ts +3 -0
  29. package/dist/shared-logic/src/BarChartV2/index.d.ts +4 -0
  30. package/dist/shared-logic/src/BarChartV2/setAttributes.d.ts +4 -0
  31. package/dist/shared-logic/src/BubbleChart/attributesSchema.d.ts +3 -0
  32. package/dist/shared-logic/src/BubbleChart/constants.d.ts +3 -0
  33. package/dist/shared-logic/src/BubbleChart/index.d.ts +4 -0
  34. package/dist/shared-logic/src/BubbleChart/setAttributes.d.ts +4 -0
  35. package/dist/shared-logic/src/BubbleChartV2/attributesSchema.d.ts +3 -0
  36. package/dist/shared-logic/src/BubbleChartV2/constants.d.ts +3 -0
  37. package/dist/shared-logic/src/BubbleChartV2/index.d.ts +4 -0
  38. package/dist/shared-logic/src/BubbleChartV2/setAttributes.d.ts +4 -0
  39. package/dist/shared-logic/src/ComboChart/upcast.d.ts +1 -2
  40. package/dist/shared-logic/src/ComboChartV2/attributesSchema.d.ts +3 -0
  41. package/dist/shared-logic/src/ComboChartV2/constants.d.ts +3 -0
  42. package/dist/shared-logic/src/ComboChartV2/index.d.ts +4 -0
  43. package/dist/shared-logic/src/ComboChartV2/setAttributes.d.ts +4 -0
  44. package/dist/shared-logic/src/Component/sharedSchemas.d.ts +2 -1
  45. package/dist/shared-logic/src/Component/types.d.ts +149 -5
  46. package/dist/shared-logic/src/Component/usedFields.d.ts +5 -1
  47. package/dist/shared-logic/src/ComponentInterface/types/namespaces.types.d.ts +12 -3
  48. package/dist/shared-logic/src/ComponentInterface/types.d.ts +2 -1
  49. package/dist/shared-logic/src/CustomField/CustomField.d.ts +1 -1
  50. package/dist/shared-logic/src/CustomField/CustomMetric/build.d.ts +3 -7
  51. package/dist/shared-logic/src/CustomField/CustomMetric/index.d.ts +3 -10
  52. package/dist/shared-logic/src/CustomField/CustomMetric/init.d.ts +4 -0
  53. package/dist/shared-logic/src/CustomField/CustomMetric/types.d.ts +21 -15
  54. package/dist/shared-logic/src/CustomField/CustomMetric/validate.d.ts +2 -0
  55. package/dist/shared-logic/src/CustomField/index.d.ts +1 -0
  56. package/dist/shared-logic/src/CustomField/metricValuesHaveAggregates.d.ts +2 -0
  57. package/dist/shared-logic/src/CustomField/types.d.ts +30 -26
  58. package/dist/shared-logic/src/CustomView/types.d.ts +2 -5
  59. package/dist/shared-logic/src/Dashboard/Dashboard.d.ts +2 -0
  60. package/dist/shared-logic/src/Dashboard/fromRaw.d.ts +1 -0
  61. package/dist/shared-logic/src/Dashboard/types.d.ts +1 -0
  62. package/dist/shared-logic/src/DataPanelConfig/types.d.ts +1 -1
  63. package/dist/shared-logic/src/DataSet/DataSet.d.ts +1 -3
  64. package/dist/shared-logic/src/DataSet/fieldFilterOptions.d.ts +2 -0
  65. package/dist/shared-logic/src/Display/Display.d.ts +1 -0
  66. package/dist/shared-logic/src/Field/Field.d.ts +2 -12
  67. package/dist/shared-logic/src/FormatPanelConfig/types.d.ts +2 -1
  68. package/dist/shared-logic/src/Query/Query.d.ts +1 -16
  69. package/dist/shared-logic/src/RadarChart/attributesSchema.d.ts +3 -0
  70. package/dist/shared-logic/src/RadarChart/constants.d.ts +3 -0
  71. package/dist/shared-logic/src/RadarChart/index.d.ts +4 -0
  72. package/dist/shared-logic/src/RadarChart/setAttributes.d.ts +4 -0
  73. package/dist/shared-logic/src/Result/types.d.ts +6 -8
  74. package/dist/shared-logic/src/SunburstChart/attributesSchema.d.ts +3 -0
  75. package/dist/shared-logic/src/SunburstChart/constants.d.ts +3 -0
  76. package/dist/shared-logic/src/SunburstChart/index.d.ts +4 -0
  77. package/dist/shared-logic/src/ValueAlias/ValueAlias.d.ts +7 -0
  78. package/dist/shared-logic/src/ValueAlias/types.d.ts +10 -0
  79. package/dist/shared-logic/src/WaterfallChart/attributesSchema.d.ts +3 -0
  80. package/dist/shared-logic/src/WaterfallChart/constants.d.ts +3 -0
  81. package/dist/shared-logic/src/WaterfallChart/index.d.ts +4 -0
  82. package/dist/shared-logic/src/WaterfallChart/setAttributes.d.ts +4 -0
  83. package/dist/shared-logic/src/getComponentInterface.d.ts +8 -0
  84. package/package.json +2 -2
  85. package/dist/shared-logic/src/Query/validate.d.ts +0 -13
  86. package/dist/shared-logic/src/QueryEngineConfig/bigquery.d.ts +0 -2
  87. package/dist/shared-logic/src/QueryEngineConfig/mariadb.d.ts +0 -2
  88. package/dist/shared-logic/src/QueryEngineConfig/mysql.d.ts +0 -2
  89. package/dist/shared-logic/src/QueryEngineConfig/postgres.d.ts +0 -2
  90. package/dist/shared-logic/src/QueryEngineConfig/redshift.d.ts +0 -2
  91. package/dist/shared-logic/src/QueryEngineConfig/snowflake.d.ts +0 -2
@@ -11,10 +11,11 @@ import { DataSet } from '../DataSet/types';
11
11
  export declare type getNumberFormatter = (formatterId: string | undefined | null) => (number: number) => string;
12
12
  export declare type FormatType = string | null;
13
13
  export declare type ApproxAxisLabelCount = 'auto' | number;
14
- export declare type ComponentType = 'areaChart' | 'barChart' | 'basicTable' | 'comboChart' | 'custom' | 'dataTable' | 'funnelChart' | 'horizontalBarChart' | 'lineChart' | 'lineChartV2' | 'mercatorMap' | 'pieChart' | 'progress' | 'richText' | 'scatterChart' | 'singleStat';
14
+ export declare type ComponentType = 'areaChart' | 'areaChartV2' | 'barChart' | 'barChartV2' | 'basicTable' | 'bubbleChart' | 'bubbleChartV2' | 'comboChart' | 'comboChartV2' | 'custom' | 'dataTable' | 'funnelChart' | 'horizontalBarChart' | 'lineChart' | 'lineChartV2' | 'mercatorMap' | 'pieChart' | 'progress' | 'radarChart' | 'richText' | 'scatterChart' | 'singleStat' | 'sunburstChart' | 'waterfallChart';
15
15
  export declare const componentTypes: string[];
16
16
  export declare namespace Component {
17
17
  export type LineCurve = 'natural' | 'straight' | 'step' | 'stepBefore' | 'stepAfter' | 'dotted';
18
+ export type AreaCurve = 'natural' | 'straight' | 'step';
18
19
  export type RawComponent = Omit<Component, 'queries' | 'results' | 'span'> & {
19
20
  colSpan?: number;
20
21
  };
@@ -145,6 +146,29 @@ export declare namespace Component {
145
146
  };
146
147
  axisTitles?: AxisTitles;
147
148
  };
149
+ export type ComboChartV2Attributes = BaseAttributes & Omit<BaseQueryAttributes, 'measure' | 'dimension'> & {
150
+ type: 'comboChartV2';
151
+ barMeasure: QueryAttributes.Measure[];
152
+ lineMeasure: QueryAttributes.Measure[];
153
+ barDimension: QueryAttributes.Dimension[];
154
+ lineDimension: QueryAttributes.Dimension[];
155
+ stacked?: false;
156
+ xAxisPrefix: string;
157
+ yAxisPrefix: string;
158
+ xAxisPostfix: string;
159
+ yAxisPostfix: string;
160
+ xAxisFormat: FormatType;
161
+ yAxisFormat: FormatType;
162
+ approxXAxisLabelCount: ApproxAxisLabelCount;
163
+ approxYAxisLabelCount: ApproxAxisLabelCount;
164
+ legend: boolean;
165
+ goalLines?: Array<Component.GoalLine.Rule>;
166
+ conditionalFormattingRules?: {
167
+ bar?: Array<ConditionalFormatting.Rule>;
168
+ line?: Array<ConditionalFormatting.Rule>;
169
+ };
170
+ axisTitles?: AxisTitles;
171
+ };
148
172
  export type LineChartAttributes = BaseAttributes & BaseQueryAttributes & {
149
173
  type: 'lineChart';
150
174
  stacked?: boolean | '100%';
@@ -187,6 +211,47 @@ export declare namespace Component {
187
211
  headline?: Headline;
188
212
  trends?: Array<Trends>;
189
213
  };
214
+ export type AreaChartV2Attributes = BaseAttributes & BaseQueryAttributes & {
215
+ type: 'areaChartV2';
216
+ stacked: boolean;
217
+ xAxisPrefix: string;
218
+ yAxisPrefix: string;
219
+ xAxisPostfix: string;
220
+ yAxisPostfix: string;
221
+ xAxisFormat: FormatType;
222
+ yAxisFormat: FormatType;
223
+ approxXAxisLabelCount: ApproxAxisLabelCount;
224
+ approxYAxisLabelCount: ApproxAxisLabelCount;
225
+ conditionalFormattingRules: Array<ConditionalFormatting.Rule>;
226
+ drilldown: QueryAttributes.Dimension[];
227
+ legend: boolean;
228
+ parameters?: Parameters;
229
+ goalLines?: Array<Component.GoalLine.Rule>;
230
+ axisTitles?: AxisTitles;
231
+ headline?: Headline;
232
+ trends?: Array<Trends>;
233
+ lineCurve: AreaCurve;
234
+ };
235
+ export type BarChartV2Attributes = BaseAttributes & BaseQueryAttributes & {
236
+ type: 'barChartV2';
237
+ stacked?: boolean;
238
+ xAxisPrefix: string;
239
+ yAxisPrefix: string;
240
+ xAxisPostfix: string;
241
+ yAxisPostfix: string;
242
+ xAxisFormat: FormatType;
243
+ yAxisFormat: FormatType;
244
+ approxXAxisLabelCount: ApproxAxisLabelCount;
245
+ approxYAxisLabelCount: ApproxAxisLabelCount;
246
+ conditionalFormattingRules: Array<ConditionalFormatting.Rule>;
247
+ drilldown: QueryAttributes.Dimension[];
248
+ legend: boolean;
249
+ parameters?: Parameters;
250
+ goalLines?: Array<Component.GoalLine.Rule>;
251
+ axisTitles?: AxisTitles;
252
+ headline?: Headline;
253
+ drilldownOptions: Array<DrilldownOptions> | undefined;
254
+ };
190
255
  export type PieChartAttributes = BaseAttributes & BaseQueryAttributes & {
191
256
  type: 'pieChart';
192
257
  conditionalFormattingRules: Array<ConditionalFormatting.Rule>;
@@ -197,6 +262,15 @@ export declare namespace Component {
197
262
  parameters?: Parameters;
198
263
  drilldownOptions: Array<DrilldownOptions> | undefined;
199
264
  };
265
+ export type SunburstChartAttributes = BaseAttributes & BaseQueryAttributes & {
266
+ type: 'sunburstChart';
267
+ conditionalFormattingRules: Array<ConditionalFormatting.Rule>;
268
+ labelsAsPercentage: boolean;
269
+ legend: boolean;
270
+ labels?: boolean;
271
+ labelFormat: FormatType;
272
+ parameters?: Parameters;
273
+ };
200
274
  export type AreaChartAttributes = BaseAttributes & BaseQueryAttributes & {
201
275
  type: 'areaChart';
202
276
  stacked?: boolean | '100%';
@@ -332,8 +406,77 @@ export declare namespace Component {
332
406
  goalLines?: Array<Component.GoalLine.Rule>;
333
407
  axisTitles?: AxisTitles;
334
408
  };
335
- export type ViewType = 'areaChart' | 'barChart' | 'basicTable' | 'comboChart' | 'custom' | 'dataTable' | 'funnelChart' | 'horizontalBarChart' | 'lineChart' | 'lineChartV2' | 'mercatorMap' | 'pieChart' | 'progress' | 'richText' | 'scatterChart' | 'singleStat';
336
- export type Attributes = AreaChartAttributes | BarChartAttributes | BasicTableAttributes | ComboChartAttributes | CustomViewAttributes | DataTableAttributes | FunnelChartAttributes | HorizontalBarChartAttributes | LineChartAttributes | LineChartV2Attributes | MercatorMapAttributes | PieChartAttributes | ProgressAttributes | RichTextAttributes | ScatterChartAttributes | SingleStatAttributes;
409
+ export type BubbleChartAttributes = BaseAttributes & Omit<BaseQueryAttributes, 'measure'> & {
410
+ type: 'bubbleChart';
411
+ xMeasure: QueryAttributes.Measure | null;
412
+ yMeasure: QueryAttributes.Measure | null;
413
+ zMeasure?: QueryAttributes.Measure | null;
414
+ legend: boolean;
415
+ xAxisPrefix: string;
416
+ yAxisPrefix: string;
417
+ xAxisPostfix: string;
418
+ yAxisPostfix: string;
419
+ xAxisFormat: FormatType;
420
+ yAxisFormat: FormatType;
421
+ approxXAxisLabelCount: ApproxAxisLabelCount;
422
+ approxYAxisLabelCount: ApproxAxisLabelCount;
423
+ goalLines?: Array<Component.GoalLine.Rule>;
424
+ axisTitles?: AxisTitles;
425
+ };
426
+ export type BubbleChartV2Attributes = BaseAttributes & BaseQueryAttributes & {
427
+ type: 'bubbleChartV2';
428
+ stacked?: boolean | '100%';
429
+ zMeasure: QueryAttributes.Measure[];
430
+ xMeasure: QueryAttributes.Measure[];
431
+ xAxisPrefix: string;
432
+ yAxisPrefix: string;
433
+ xAxisPostfix: string;
434
+ yAxisPostfix: string;
435
+ lineCurve: LineCurve;
436
+ xAxisFormat: FormatType;
437
+ yAxisFormat: FormatType;
438
+ approxXAxisLabelCount: ApproxAxisLabelCount;
439
+ approxYAxisLabelCount: ApproxAxisLabelCount;
440
+ conditionalFormattingRules: Array<ConditionalFormatting.Rule>;
441
+ drilldown: QueryAttributes.Dimension[];
442
+ legend: boolean;
443
+ parameters?: Parameters;
444
+ goalLines?: Array<Component.GoalLine.Rule>;
445
+ axisTitles?: AxisTitles;
446
+ headline?: Headline;
447
+ trends?: Array<Trends>;
448
+ };
449
+ export type RadarChartAttributes = BaseAttributes & BaseQueryAttributes & {
450
+ type: 'radarChart';
451
+ legend: boolean;
452
+ xAxisPrefix: string;
453
+ yAxisPrefix: string;
454
+ xAxisPostfix: string;
455
+ yAxisPostfix: string;
456
+ xAxisFormat: FormatType;
457
+ yAxisFormat: FormatType;
458
+ approxXAxisLabelCount: ApproxAxisLabelCount;
459
+ approxYAxisLabelCount: ApproxAxisLabelCount;
460
+ };
461
+ export type WaterfallChartAttributes = BaseAttributes & BaseQueryAttributes & {
462
+ type: 'waterfallChart';
463
+ xAxisPrefix: string;
464
+ yAxisPrefix: string;
465
+ xAxisPostfix: string;
466
+ yAxisPostfix: string;
467
+ xAxisFormat: FormatType;
468
+ yAxisFormat: FormatType;
469
+ approxXAxisLabelCount: ApproxAxisLabelCount;
470
+ approxYAxisLabelCount: ApproxAxisLabelCount;
471
+ legend: boolean;
472
+ parameters?: Parameters;
473
+ axisTitles?: AxisTitles;
474
+ headline?: Headline;
475
+ increaseColor: string;
476
+ decreaseColor: string;
477
+ };
478
+ export type ViewType = 'areaChart' | 'barChart' | 'basicTable' | 'bubbleChart' | 'bubbleChartV2' | 'comboChart' | 'comboChartV2' | 'custom' | 'dataTable' | 'funnelChart' | 'horizontalBarChart' | 'lineChart' | 'lineChartV2' | 'areaChartV2' | 'barChartV2' | 'mercatorMap' | 'pieChart' | 'sunburstChart' | 'progress' | 'richText' | 'scatterChart' | 'singleStat' | 'waterfallChart' | 'radarChart';
479
+ export type Attributes = AreaChartAttributes | BarChartAttributes | BasicTableAttributes | BubbleChartAttributes | BubbleChartV2Attributes | ComboChartAttributes | CustomViewAttributes | DataTableAttributes | FunnelChartAttributes | HorizontalBarChartAttributes | LineChartAttributes | LineChartV2Attributes | BarChartV2Attributes | AreaChartV2Attributes | MercatorMapAttributes | PieChartAttributes | SunburstChartAttributes | ProgressAttributes | RichTextAttributes | ScatterChartAttributes | SingleStatAttributes | WaterfallChartAttributes | RadarChartAttributes | ComboChartV2Attributes;
337
480
  export interface RenderTableCell {
338
481
  viewId: string;
339
482
  type: 'basicTable' | 'dataTable';
@@ -371,7 +514,7 @@ export declare namespace Component {
371
514
  };
372
515
  }
373
516
  export interface ChartOnViewClick extends BaseOnViewClick {
374
- type: 'barChart' | 'horizontalBarChart' | 'pieChart';
517
+ type: 'barChart' | 'horizontalBarChart' | 'pieChart' | 'sunburstChart';
375
518
  clicked: {
376
519
  grouping?: Array<ReturnedField>;
377
520
  value?: ReturnedField;
@@ -393,8 +536,9 @@ export declare namespace Component {
393
536
  };
394
537
  export type ValueAliasOptions = {
395
538
  fieldId?: string;
396
- value: string | number;
539
+ value: string | number | null;
397
540
  filter?: AdditionalFilter;
541
+ dataSetId?: string;
398
542
  };
399
543
  export type Parameters = {
400
544
  measure?: ParameterMeasure;
@@ -2,5 +2,9 @@ import { QueryAttributes } from '../QueryAttributes/types';
2
2
  import { Component } from './types';
3
3
  export declare const usedMeasures: (attrs: Partial<Component.Attributes | QueryAttributes>) => QueryAttributes['measure'];
4
4
  export declare const usedDimensions: (attrs: Partial<Component.Attributes | QueryAttributes>) => QueryAttributes['dimension'];
5
- declare const usedFields: (attrs: Partial<Component.Attributes | QueryAttributes>) => string[];
5
+ declare const usedFields: (attrs: Partial<Component.Attributes | QueryAttributes>) => Array<{
6
+ dataSetId: string;
7
+ fieldId: string;
8
+ function: string;
9
+ }>;
6
10
  export default usedFields;
@@ -19,6 +19,7 @@ declare type SubSectionDef = {
19
19
  bar?: SubSection<'metrics'>;
20
20
  xAxis?: SubSection<'metrics'>;
21
21
  yAxis?: SubSection<'metrics'>;
22
+ zAxis?: SubSection<'metrics'>;
22
23
  };
23
24
  export declare type Pagination = {
24
25
  options: number[];
@@ -28,6 +29,7 @@ export interface DataPanelNamespaces {
28
29
  views: Section<'views'>;
29
30
  fields?: Section<'fields'>;
30
31
  field_y_axis?: Section<'fieldCollector'>;
32
+ field_z_axis?: Section<'fieldCollector'>;
31
33
  field_rows?: Section<'fieldCollector'>;
32
34
  field_columns?: Section<'fieldCollector'>;
33
35
  field_metrics?: Section<'fieldCollector'>;
@@ -56,13 +58,19 @@ export interface FormatPanelNamespaces {
56
58
  'x.postfix': SubSection<'axisLabels'>;
57
59
  'x.format': SubSection<'axisLabels'>;
58
60
  'x.count': SubSection<'axisLabels'>;
59
- 'x.axis_title': SubSection<'axisLabels'>;
61
+ 'x.axis_title'?: SubSection<'axisLabels'>;
60
62
  y: SubSection<'axisLabels'>;
61
63
  'y.prefix': SubSection<'axisLabels'>;
62
64
  'y.postfix': SubSection<'axisLabels'>;
63
65
  'y.format': SubSection<'axisLabels'>;
64
66
  'y.count': SubSection<'axisLabels'>;
65
- 'y.axis_title': SubSection<'axisLabels'>;
67
+ 'y.axis_title'?: SubSection<'axisLabels'>;
68
+ z?: SubSection<'axisLabels'>;
69
+ 'z.prefix'?: SubSection<'axisLabels'>;
70
+ 'z.postfix'?: SubSection<'axisLabels'>;
71
+ 'z.format'?: SubSection<'axisLabels'>;
72
+ 'z.count'?: SubSection<'axisLabels'>;
73
+ 'z.axis_title'?: SubSection<'axisLabels'>;
66
74
  };
67
75
  };
68
76
  stats_labels?: Section<'statsLabels'> & {
@@ -99,6 +107,7 @@ export interface FormatPanelNamespaces {
99
107
  };
100
108
  goal_line?: Section<'goalLine'>;
101
109
  map_colors?: Section<'mapColors'>;
110
+ waterfall_colors?: Section<'waterfallColors'>;
102
111
  headline?: Section<'headline'>;
103
112
  trends?: Section<'trends'>;
104
113
  prefixes?: Section<'prefixes'>;
@@ -109,5 +118,5 @@ export interface FormatPanelNamespaces {
109
118
  };
110
119
  };
111
120
  }
112
- export declare type ComponentNamespace = 'area_chart' | 'bar_chart' | 'basic_table' | 'combo_chart' | 'custom' | 'fields' | 'funnel_chart' | 'headline' | 'horizontal_bar_chart' | 'line_chart' | 'mercator_map' | 'pie_chart' | 'pivot_table' | 'progress' | 'rich_text' | 'scatter_chart' | 'single_stat';
121
+ export declare type ComponentNamespace = 'area_chart' | 'bar_chart' | 'basic_table' | 'bubble_chart' | 'combo_chart' | 'custom' | 'fields' | 'funnel_chart' | 'headline' | 'horizontal_bar_chart' | 'line_chart' | 'mercator_map' | 'pie_chart' | 'sunburst_chart' | 'pivot_table' | 'progress' | 'rich_text' | 'scatter_chart' | 'single_stat' | 'waterfall_chart' | 'radar_chart';
113
122
  export {};
@@ -34,11 +34,12 @@ export interface ComponentInterface<Hydrated = any, Dumped = any> extends Dumpab
34
34
  roundedNumbers: boolean;
35
35
  dateCalculations: boolean;
36
36
  conditional: boolean;
37
- calculatedField: Array<AcceptedTypes> | false;
37
+ customBuild: Array<AcceptedTypes> | false;
38
38
  };
39
39
  supportedFeatures: {
40
40
  parameters: boolean;
41
41
  colorGradient: boolean;
42
42
  };
43
+ supportedAggregations?: Array<string>;
43
44
  }
44
45
  export declare type LoadComponentInterface<Hydrated, Dumped> = (config: ComponentInterfaceConfig) => ComponentInterface<Hydrated, Dumped>;
@@ -11,7 +11,7 @@ export declare const isAggregateMathField: (field: DataSetType.Field) => field i
11
11
  export declare const isPercentageField: (field: DataSetType.Field) => field is PercentageField;
12
12
  export declare const isRules: (field: DataSetType.Field) => field is RulesField;
13
13
  export declare const isConditional: (field: DataSetType.Field) => field is ConditionalField;
14
- export declare const isMetric: (field: DataSetType.Field) => field is MetricField;
14
+ export declare const isCustomBuildMetric: (field: DataSetType.Field) => field is MetricField;
15
15
  export declare const isDateCalculation: (field: DataSetType.Field) => field is DateCalculationField;
16
16
  export declare const getCustomFieldCategory: (field: CustomField) => CustomFieldCategory;
17
17
  export declare const isCustomField: (field: DataSetType.Field) => field is CustomField;
@@ -1,11 +1,7 @@
1
1
  import { DataSet } from '../../DataSet/types';
2
- import { Query, QueryNameSpace } from '../../Query/types';
3
- import * as Filter from '../../Filter';
4
- import * as Types from './types';
2
+ import { Query } from '../../Query/types';
5
3
  import { QueryAttributes } from '../../QueryAttributes/types';
6
4
  import { Params } from '../../../../results-driver/src/types';
7
5
  import { QueryEngineConfig } from '../../QueryEngineConfig/types';
8
- export declare const buildOperator: (operator: Types.Operator, dataSet: DataSet, params: Params, measureAttribute?: QueryAttributes.Measure) => Query['measure'][number];
9
- export declare const buildIfLogic: (ifLogic: Types.IfLogic, dataSet: DataSet, localAndDashboardFilters: QueryAttributes.Filter[], queryEngineConfig: QueryEngineConfig, params: Params, measureAttribute?: QueryAttributes.Measure) => QueryNameSpace.FieldDefinition<string, string, string>;
10
- export declare const buildNumber: (numberInput: Types.NumberInput) => QueryNameSpace.FieldDefinition<string, string, string>;
11
- export declare const buildField: (field: Types.Field) => QueryNameSpace.FieldDefinition<string, string, string>;
6
+ import { MetricField } from '../types';
7
+ export declare const build: (measureAttribute: QueryAttributes.Measure, customField: MetricField, dataSet: DataSet, queryEngineConfig: QueryEngineConfig, params: Params) => Query['measure'][number];
@@ -1,10 +1,3 @@
1
- import { DataSet } from '../../DataSet/types';
2
- import { Query } from '../../Query/types';
3
- import * as Types from './types';
4
- import { QueryAttributes } from '../../QueryAttributes/types';
5
- import { Params } from '../../../../results-driver/src/types';
6
- import { QueryEngineConfig } from '../../QueryEngineConfig/types';
7
- import { MetricField } from '../types';
8
- export declare const init: (publicName: string, metric: Types.Metric, queryEngineConfig: QueryEngineConfig) => MetricField;
9
- export declare const build: (measureAttribute: QueryAttributes.Measure, customField: MetricField, dataSet: DataSet, queryEngineConfig: QueryEngineConfig, params: Params) => Query['measure'][number];
10
- export declare const validate: (field: MetricField) => boolean;
1
+ export * from './init';
2
+ export * from './build';
3
+ export * from './validate';
@@ -0,0 +1,4 @@
1
+ import * as Types from './types';
2
+ import { QueryEngineConfig } from '../../QueryEngineConfig/types';
3
+ import { MetricField } from '../types';
4
+ export declare const init: (publicName: string, metric: Types.Metric, queryEngineConfig: QueryEngineConfig) => MetricField;
@@ -4,13 +4,15 @@ export declare enum PropertyType {
4
4
  IfLogic = "ifLogic",
5
5
  NumberInput = "number",
6
6
  Variable = "variable",
7
- Field = "field"
7
+ Field = "field",
8
+ Aggregate = "aggregate"
9
+ }
10
+ export declare enum OperatorType {
11
+ Divide = "/",
12
+ Multiply = "*",
13
+ Subtract = "-",
14
+ Add = "+"
8
15
  }
9
- export declare type Operator = {
10
- type: PropertyType.Operator;
11
- op: OperatorType;
12
- values: Array<Operator | NumberInput | Field | Variable | IfLogic>;
13
- };
14
16
  export declare type NumberInput = {
15
17
  type: PropertyType.NumberInput;
16
18
  value: number | undefined;
@@ -24,18 +26,22 @@ export declare type Field = {
24
26
  fieldId: string;
25
27
  function: string;
26
28
  };
29
+ export declare type Aggregate = {
30
+ type: PropertyType.Aggregate;
31
+ fieldId: string;
32
+ function?: string;
33
+ };
27
34
  export declare type IfLogic = {
28
35
  type: PropertyType.IfLogic;
29
36
  cases: Array<{
30
37
  filter: Array<QueryAttributes.Filter[]>;
31
- returns: Operator | NumberInput | Field | Variable | IfLogic | undefined;
38
+ returns: Operator | NumberInput | Field | Variable | IfLogic | Aggregate | undefined;
32
39
  }>;
33
- else: Operator | NumberInput | Field | Variable | IfLogic | undefined;
40
+ else: Operator | NumberInput | Field | Variable | IfLogic | undefined | Aggregate;
34
41
  };
35
- export declare type Metric = Operator | IfLogic;
36
- export declare enum OperatorType {
37
- Divide = "/",
38
- Multiply = "*",
39
- Subtract = "-",
40
- Add = "+"
41
- }
42
+ export declare type Operator = {
43
+ type: PropertyType.Operator;
44
+ op: OperatorType;
45
+ values: Array<Operator | NumberInput | Field | Variable | IfLogic | Aggregate>;
46
+ };
47
+ export declare type Metric = Operator | IfLogic | Aggregate | NumberInput | Field;
@@ -0,0 +1,2 @@
1
+ import { MetricField } from '../types';
2
+ export declare const validate: (field: MetricField) => boolean;
@@ -6,4 +6,5 @@ export * as Rules from './Rules';
6
6
  export * as RoundedNumber from './RoundedNumber';
7
7
  export * as DateCalculation from './DateCalculation';
8
8
  export * as Conditional from './Conditional';
9
+ export * as CustomMetric from './CustomMetric';
9
10
  export * from './upcast';
@@ -0,0 +1,2 @@
1
+ import { Aggregate, IfLogic, NumberInput, Operator, Field as FieldMetric, Variable } from './CustomMetric/types';
2
+ export declare function metricValuesHaveAggregates(values: (Operator | IfLogic | Aggregate | NumberInput | FieldMetric | Variable)[] | undefined): boolean;
@@ -3,22 +3,15 @@ import { BaseField, DataType, NonDateTimeField } from '../Field/types';
3
3
  import { Rules } from './Rules/types';
4
4
  import { Metric } from './CustomMetric/types';
5
5
  declare type BaseCustomField = Omit<NonDateTimeField, 'dashboardFilterGroups'>;
6
- export declare type PercentageField = BaseCustomField & Percentage;
7
- export declare type RoundedNumberField = BaseCustomField & RoundedNumber;
8
- export declare type DateCalculationField = BaseCustomField & DateCalculation;
9
- export declare type AggregateMathField = BaseCustomField & AggregateMath;
10
- export declare type ConditionalField = BaseCustomField & Conditional;
11
- export declare type MetricField = BaseCustomField & {
12
- metric: Metric;
6
+ declare type SimpleMath = {
7
+ leftFieldId: string;
8
+ operator: MathOperator;
9
+ rightFieldId: string;
13
10
  };
14
- export declare type SimpleMathField = BaseCustomField & SimpleMath & {
15
- dataType: 'number';
11
+ declare type RoundedNumber = {
12
+ roundToDecimalPlaces: 0 | 2;
13
+ fieldId: string;
16
14
  };
17
- export interface RulesField extends BaseField {
18
- rules: Rules[];
19
- dataType: 'string';
20
- }
21
- export declare type CustomField = PercentageField | SimpleMathField | AggregateMathField | RulesField | RoundedNumberField | DateCalculationField | ConditionalField | MetricField;
22
15
  export declare type Conditional = {
23
16
  fieldId: string;
24
17
  function: string;
@@ -55,25 +48,36 @@ export declare type AggregateMath = {
55
48
  /** @deprecated ignore this outside of upcasting */
56
49
  rightAggregate?: string;
57
50
  };
58
- export declare type SimpleMath = {
59
- leftFieldId: string;
60
- operator: MathOperator;
61
- rightFieldId: string;
62
- };
63
- export declare type RoundedNumber = {
64
- roundToDecimalPlaces: 0 | 2;
65
- fieldId: string;
66
- };
67
51
  export declare type DateCalculation = {
68
52
  leftFieldId: string;
69
53
  rightFieldId: string;
70
54
  dateCalculationFunction: 'seconds_between' | 'minutes_between' | 'hours_between' | 'days_between';
71
55
  };
56
+ export declare type PercentageField = BaseCustomField & Percentage;
57
+ export declare type RoundedNumberField = BaseCustomField & RoundedNumber;
58
+ export declare type DateCalculationField = BaseCustomField & DateCalculation;
59
+ export declare type AggregateMathField = BaseCustomField & AggregateMath;
60
+ export declare type ConditionalField = BaseCustomField & Conditional;
61
+ export declare type MetricField = BaseCustomField & {
62
+ metric: Metric;
63
+ };
64
+ export declare type SimpleMathField = BaseCustomField & SimpleMath & {
65
+ dataType: 'number';
66
+ };
67
+ export declare type RulesField = BaseField & {
68
+ rules: Rules[];
69
+ dataType: 'string';
70
+ };
71
+ export declare type CustomBuildMetricField = BaseField & {
72
+ metricAttributes: Metric;
73
+ dataType: 'number';
74
+ };
75
+ export declare type CustomField = PercentageField | SimpleMathField | AggregateMathField | RulesField | RoundedNumberField | DateCalculationField | ConditionalField | MetricField | CustomBuildMetricField;
72
76
  export declare type MathOperator = '*' | '-' | '/' | '+';
73
- export declare type CustomFieldCategory = 'percentage' | 'math' | 'rules' | 'roundedNumber' | 'dateCalculation' | 'conditional' | 'calculatedField';
77
+ export declare type CustomFieldCategory = 'percentage' | 'math' | 'rules' | 'roundedNumber' | 'dateCalculation' | 'conditional' | 'customBuildMetric';
74
78
  export declare enum AcceptedTypes {
75
79
  Maths = "maths",
76
- IfStatement = "ifStatement"
80
+ IfStatement = "ifStatement",
81
+ Aggregates = "aggregates"
77
82
  }
78
- export declare type MaybeOldCustomField = CustomField;
79
83
  export {};
@@ -1,13 +1,10 @@
1
1
  /// <reference types="react" />
2
+ import { FilterConfig } from '../AdditionalFilter/types';
2
3
  import { Component } from '../Component/types';
3
- import { QueryAttributes } from '../QueryAttributes/types';
4
4
  export declare type CustomView = StaticCustomView | SelectableCustomView;
5
- export declare type DataSetDashboardFilters = {
6
- [dataSetId: string]: QueryAttributes.Filter[][];
7
- };
8
5
  export declare type CustomViewCallbackParams = {
9
- dashboardFilters: DataSetDashboardFilters;
10
6
  attributes?: Component.CustomViewAttributes;
7
+ filterConfig: FilterConfig;
11
8
  };
12
9
  export declare type BaseCustomView = {
13
10
  id: string;
@@ -2,6 +2,7 @@ import { Component as ComponentType } from '../Component/types';
2
2
  import { DataSet } from '../DataSet/types';
3
3
  import { CustomField } from '../CustomField/types';
4
4
  import { Dashboard, SaveableDashboardDefinition, ImportableDashboard } from './types';
5
+ import { FieldUsage } from '@vizzly/api-client';
5
6
  export * from './saveableDashboardDefinitionSchema';
6
7
  export * from './fromRaw';
7
8
  export declare const indexOfDataSet: (dashboard: Dashboard, dataSetId: string) => number;
@@ -35,3 +36,4 @@ export declare const VIZZLY_EDITOR_ID = "vizzly_editor";
35
36
  export declare function updateWithProgrammaticDashboard(allDashboards: Dashboard[], programmaticDashboards: Dashboard[]): Dashboard[];
36
37
  export declare const addUniqueLibraryComponents: (programmaticLibrary: ComponentType[], dashboardLibrary: ComponentType[]) => ComponentType[];
37
38
  export declare const checkAndReturnProgrammaticDashboardId: (dashboards: Dashboard[]) => string | undefined;
39
+ export declare const getFieldUsage: (dashboardDefinition: SaveableDashboardDefinition, dataSets: DataSet[]) => FieldUsage;
@@ -7,6 +7,7 @@ export declare type RawDashboard<Definition = RawDefinition> = {
7
7
  id: string;
8
8
  parent_dashboard_id: string;
9
9
  definition: Definition;
10
+ name?: string | null;
10
11
  theme: StoredTheme & {
11
12
  rowLimit?: number;
12
13
  };
@@ -12,6 +12,7 @@ export declare namespace Dashboard {
12
12
  }
13
13
  export declare type Dashboard = {
14
14
  id: string;
15
+ name?: string | null;
15
16
  parentDashboardId: string | null;
16
17
  metadata: Dashboard.ExternalMetadata;
17
18
  /**
@@ -9,7 +9,7 @@ export declare type Section<Type> = ConstSection<Type> & {
9
9
  declare type MetricOptions = {
10
10
  allowsMultiple?: boolean;
11
11
  maximumMetricsAllowed?: number;
12
- propKey?: 'xMeasure' | 'yMeasure' | 'measure' | 'barMeasure' | 'lineMeasure';
12
+ propKey?: 'xMeasure' | 'yMeasure' | 'zMeasure' | 'measure' | 'barMeasure' | 'lineMeasure';
13
13
  filterFieldOptions?: FieldFilterOptions;
14
14
  };
15
15
  export declare type FieldCollectorOptions<Attrs> = {
@@ -1,9 +1,8 @@
1
1
  import { DataSet } from './types';
2
2
  import { CustomField, SimpleMathField } from '../CustomField/types';
3
3
  import { DateTimeField, NonDateTimeField } from '../Field/types';
4
- import { PreAggregatedQuery, Query } from '../Query/types';
4
+ import { PreAggregatedQuery } from '../Query/types';
5
5
  import * as Field from '../Field/Field';
6
- import FieldNotFoundInDataSet from '../errors/FieldNotFoundInDataSet';
7
6
  import { QueryAttributes } from '../QueryAttributes/types';
8
7
  import { QueryEngineConfig } from '../QueryEngineConfig/types';
9
8
  import { ComponentType } from '../Component/types';
@@ -24,7 +23,6 @@ export declare const hasDateTimeFields: (dataSet: DataSet) => boolean;
24
23
  export declare const getPlaceholder: (dataSet: DataSet, field: string | null) => string;
25
24
  export declare const takeFieldsForDimension: (dataSet: DataSet) => DataSet.Field[];
26
25
  export declare const takeFieldsForMeasure: (dataSet: DataSet, componentType: ComponentType) => DataSet.Field[];
27
- export declare const validateQueries: (dataSet: DataSet, queries: Query[]) => undefined | FieldNotFoundInDataSet;
28
26
  /**
29
27
  * Return all custom fields for a data set, and optionally
30
28
  * provide the componentType to ensure the custom fields which are returned
@@ -8,6 +8,8 @@ export declare type FieldFilterOptions = {
8
8
  removeAggregateMaths?: boolean;
9
9
  removeDateCalculations?: boolean;
10
10
  removeConditional?: boolean;
11
+ removeCustomBuildMetric?: boolean;
12
+ removeAggregateCustomBuildMetric?: boolean;
11
13
  onlyDimensions?: boolean;
12
14
  onlyMeasures?: boolean;
13
15
  forComponent?: ComponentType;
@@ -20,3 +20,4 @@ export declare const listComponentTypesUsed: (display: Display) => ComponentType
20
20
  export declare const isComponentEmpty: (component: Component | EmptyCell | HeaderComponent) => component is EmptyCell;
21
21
  export declare function isDisplayComponentsEmpty(display: Display): boolean;
22
22
  export declare const moveDisplayToNewIndex: (display: DisplayRow[], movingIndex: number, destinationIndex: number) => DisplayRow[];
23
+ export declare const countNonHeaderRows: (display: Display) => number;
@@ -8,6 +8,7 @@ import { SupportedTimeTruncFunctions } from '@vizzly/semantic-layer-public';
8
8
  import { QueryEngineConfig } from '../QueryEngineConfig/types';
9
9
  import { SupportedTransformationFunctions } from '../Functions/types';
10
10
  import { TextOverride } from '../Translations/types';
11
+ import { ValueAlias as ValueAliasType } from '../ValueAlias/types';
11
12
  export declare const NULL_REPLACEMENT = "No value";
12
13
  export declare const ALL_AGGREGATES: Array<QueryAttributes.Aggregate>;
13
14
  export declare type OldField = {
@@ -98,16 +99,5 @@ export declare const isArrayDataType: (field: {
98
99
  declare const vizzlySupportedTransformationFunctions: SupportedTransformationFunctions;
99
100
  export declare const supportedTransformationFunctions: (keys?: Array<keyof typeof vizzlySupportedTransformationFunctions>) => SupportedTransformationFunctions;
100
101
  export declare const supportedAggregatesFunction: (queryEngineConfig: QueryEngineConfig, dataType: DataType, supportedAggregateOptions?: SupportedAggregateOption[]) => SupportedAggregateOption[];
101
- declare type NullValueAlias = (params: {
102
- dataSetId: string;
103
- fieldId: string;
104
- }) => string | null | undefined;
105
- export declare const nullValue: (dataSetId: string, dimensions: QueryAttributes.Dimension[] | null, timeDimension: QueryAttributes.TimeDimension | null, nullValueAlias?: NullValueAlias, textOverride?: TextOverride, textOverrideKey?: string) => string | undefined;
106
- export declare const nullValueWithFieldId: ({ dataSetId, fieldId, nullValueAlias, textOverride, textOverrideKey, }: {
107
- dataSetId: string;
108
- fieldId: string;
109
- nullValueAlias?: NullValueAlias | undefined;
110
- textOverride?: TextOverride | undefined;
111
- textOverrideKey?: string | undefined;
112
- }) => string | undefined;
102
+ export declare const checkForNullValue: (dataSetId: string, dimensions: QueryAttributes.Dimension[] | null, timeDimension: QueryAttributes.TimeDimension | null, textOverride?: TextOverride, valueAlias?: ValueAliasType, textOverrideKey?: string) => string | undefined;
113
103
  export {};
@@ -26,6 +26,7 @@ export declare type AxisLabelsSection = Section<'axisLabels'> & {
26
26
  export declare type LabelsSection = Section<'statsLabels'> & LabelSection<'statsLabels'>;
27
27
  export declare type PrefixSection = Section<'prefixes'>;
28
28
  export declare type MapColorsSection = Section<'mapColors'>;
29
+ export declare type WaterfallColorsSection = Section<'waterfallColors'>;
29
30
  export declare type HeadlineSection = Section<'headline'>;
30
31
  export declare type RichTextFormatSection = Section<'richText'>;
31
32
  export interface ConditionalFormattingSection extends Section<'conditionalFormatting'> {
@@ -41,5 +42,5 @@ export interface ProgressTypeSection<T> extends Omit<Section<T>, 'type'> {
41
42
  progressType?: Omit<Section<T>, 'type'>;
42
43
  }
43
44
  export declare type ProgressTypesSection = Section<'progressType'> & ProgressTypeSection<'progressType'>;
44
- export declare type FormatPanelSection = HeadingSection | FormatSection | ChartStylesSection | PrefixSection | AxisLabelsSection | LabelsSection | MapColorsSection | ConditionalFormattingSection | GoalLineSection | ProgressTypesSection | HeadlineSection | RichTextFormatSection | Section<'trends'>;
45
+ export declare type FormatPanelSection = HeadingSection | FormatSection | ChartStylesSection | PrefixSection | AxisLabelsSection | LabelsSection | MapColorsSection | WaterfallColorsSection | ConditionalFormattingSection | GoalLineSection | ProgressTypesSection | HeadlineSection | RichTextFormatSection | Section<'trends'>;
45
46
  export declare type FormatPanelConfig = Array<FormatPanelSection>;