@vizzly/dashboard 0.14.4-dev-8beb4cd0b38350abdd05b93b66f2523ced40aa15 → 0.14.4-dev-f592adcabadc611d0e867520c138d5a939466968
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/charts/src/v2/index.d.ts +1 -0
- package/dist/dashboard/src/contexts/GlobalProvider/useGlobalProvider.d.ts +6 -6
- package/dist/dashboard.cjs.development.js +1027 -438
- package/dist/dashboard.cjs.production.min.js +1 -1
- package/dist/dashboard.esm.js +1027 -438
- package/dist/results-driver/src/driver/VizzlyQuery/AreaChart/toQueries.d.ts +1 -1
- package/dist/results-driver/src/driver/VizzlyQuery/BarChart/toQueries.d.ts +1 -1
- package/dist/results-driver/src/driver/VizzlyQuery/BarChartV2/toQueries.d.ts +1 -1
- package/dist/results-driver/src/driver/VizzlyQuery/BarChartV2 copy/toQueries.d.ts +4 -0
- package/dist/results-driver/src/driver/VizzlyQuery/BasicTable/toQueries.d.ts +1 -1
- package/dist/results-driver/src/driver/VizzlyQuery/FunnelChart/toQueries.d.ts +1 -1
- package/dist/results-driver/src/driver/VizzlyQuery/HorizontalBarChart/toQueries.d.ts +1 -1
- package/dist/results-driver/src/driver/VizzlyQuery/LineChart/toQueries.d.ts +1 -1
- package/dist/results-driver/src/driver/VizzlyQuery/LineChartV2/toQueries.d.ts +1 -1
- package/dist/results-driver/src/driver/VizzlyQuery/PieChart/toQueries.d.ts +1 -1
- package/dist/results-driver/src/driver/VizzlyQuery/PivotTable/toQueries.d.ts +1 -1
- package/dist/results-driver/src/driver/VizzlyQuery/RichText/toQueries.d.ts +1 -1
- package/dist/results-driver/src/driver/VizzlyQuery/WaterfallChart/toQueries.d.ts +1 -1
- package/dist/results-driver/src/driver/VizzlyQuery/commonToQueries.d.ts +1 -1
- package/dist/shared-logic/src/AreaChartV2/attributesSchema.d.ts +3 -0
- package/dist/shared-logic/src/AreaChartV2/buildAreaChartRepresentation.d.ts +40 -0
- package/dist/shared-logic/src/AreaChartV2/constants.d.ts +3 -0
- package/dist/shared-logic/src/AreaChartV2/index.d.ts +4 -0
- package/dist/shared-logic/src/AreaChartV2/setAttributes.d.ts +4 -0
- package/dist/shared-logic/src/AreaChartV2/types.d.ts +1 -1
- package/dist/shared-logic/src/ChartsV2/adjustTicks.d.ts +3 -0
- package/dist/shared-logic/src/{LineChartV2 → ChartsV2}/buildTrendAndForecast.d.ts +1 -1
- package/dist/shared-logic/src/ChartsV2/formattingFunctionAxis.d.ts +2 -0
- package/dist/shared-logic/src/{BarChartV2/getMinAndMax.d.ts → ChartsV2/getStackedMinAndMax.d.ts} +1 -1
- package/dist/shared-logic/src/{LineChartV2 → ChartsV2}/getTrendsAndForecastsData.d.ts +1 -1
- package/dist/shared-logic/src/Component/setAttributes.d.ts +1 -1
- package/dist/shared-logic/src/Component/sharedSchemas.d.ts +1 -0
- package/dist/shared-logic/src/Component/types.d.ts +26 -4
- package/dist/shared-logic/src/DataSet/DataSet.d.ts +1 -1
- package/dist/shared-logic/src/getComponentInterface.d.ts +1 -0
- package/dist/shared-ui/src/api/useQueryEffect.d.ts +1 -1
- package/dist/shared-ui/src/components/AreaChartV2/AreaChartV2.d.ts +3 -0
- package/dist/shared-ui/src/components/AreaChartV2/AreaChartV2View.d.ts +17 -0
- package/dist/shared-ui/src/components/AreaChartV2/index.d.ts +2 -0
- package/dist/shared-ui/src/components/Component/types.d.ts +1 -0
- package/dist/shared-ui/src/components/HeadlineStats/HeadlineStats.d.ts +2 -2
- package/dist/shared-ui/src/components/LineChart/LineChartView.d.ts +1 -1
- package/dist/shared-ui/src/components/MercatorMap/View.d.ts +1 -1
- package/package.json +1 -1
- package/dist/shared-logic/src/BarChartV2/adjustTicks.d.ts +0 -3
- package/dist/shared-logic/src/LineChartV2/adjustTicks.d.ts +0 -3
- /package/dist/shared-logic/src/{BarChartV2 → ChartsV2}/fillMissingKeysForChartData.d.ts +0 -0
- /package/dist/shared-logic/src/{LineChartV2 → ChartsV2}/getMinAndMax.d.ts +0 -0
- /package/dist/shared-logic/src/{LineChartV2 → ChartsV2}/getScaleAndTicks.d.ts +0 -0
- /package/dist/shared-logic/src/{BarChartV2/getScaleAndTicks.d.ts → ChartsV2/getStackedScaleAndTicks.d.ts} +0 -0
package/dist/dashboard.esm.js
CHANGED
|
@@ -55,6 +55,7 @@ import { AxisBottom as AxisBottom$1, AxisLeft as AxisLeft$1 } from '@visx/axis';
|
|
|
55
55
|
import { Text } from '@visx/text';
|
|
56
56
|
import { GridRows as GridRows$1 } from '@visx/grid';
|
|
57
57
|
import '@visx/point';
|
|
58
|
+
import { AreaChartV2 as AreaChartV2$1 } from './charts/src/v2';
|
|
58
59
|
import VisibilitySensor from 'react-visibility-sensor';
|
|
59
60
|
import ExcelJS from 'exceljs';
|
|
60
61
|
import { saveAs } from 'file-saver';
|
|
@@ -2722,6 +2723,7 @@ var timeDimensionQuerySchema = function timeDimensionQuerySchema(queryEngineConf
|
|
|
2722
2723
|
});
|
|
2723
2724
|
};
|
|
2724
2725
|
var lineCurveSchema = /*#__PURE__*/Joi.string().valid('natural', 'straight', 'step', 'stepBefore', 'stepAfter', 'dotted');
|
|
2726
|
+
var areaCurveSchema = /*#__PURE__*/Joi.string().valid('natural', 'straight', 'step');
|
|
2725
2727
|
var protectedFieldsMeasure = function protectedFieldsMeasure(queryEngineConfig) {
|
|
2726
2728
|
var _Joi$string6;
|
|
2727
2729
|
return Joi.array().items(Joi.object({
|
|
@@ -8162,7 +8164,7 @@ var RichText = function RichText(config) {
|
|
|
8162
8164
|
};
|
|
8163
8165
|
};
|
|
8164
8166
|
|
|
8165
|
-
var componentTypes = ['areaChart', 'barChart', 'basicTable', 'bubbleChart', 'comboChart', 'custom', 'dataTable', 'funnelChart', 'horizontalBarChart', 'lineChart', 'lineChartV2', 'barChartV2', 'mercatorMap', 'pieChart', 'progress', 'richText', 'scatterChart', 'singleStat', 'waterfallChart'];
|
|
8167
|
+
var componentTypes = ['areaChart', 'barChart', 'basicTable', 'bubbleChart', 'comboChart', 'custom', 'dataTable', 'funnelChart', 'horizontalBarChart', 'lineChart', 'lineChartV2', 'areaChartV2', 'barChartV2', 'mercatorMap', 'pieChart', 'progress', 'richText', 'scatterChart', 'singleStat', 'waterfallChart'];
|
|
8166
8168
|
/** @deprecated */
|
|
8167
8169
|
|
|
8168
8170
|
var ProgressType = /*#__PURE__*/function (ProgressType) {
|
|
@@ -8959,7 +8961,6 @@ var attributesSchema$e = function attributesSchema(config) {
|
|
|
8959
8961
|
var setAttributes$d = (function (config) {
|
|
8960
8962
|
return function (bubbleChart, partial) {
|
|
8961
8963
|
var newAttributes = setAttributes(bubbleChart, partial, attributesSchema$e(config));
|
|
8962
|
-
console.log(newAttributes, 'HERE');
|
|
8963
8964
|
var allowedOrderSpec = [];
|
|
8964
8965
|
if (newAttributes.xMeasure) {
|
|
8965
8966
|
allowedOrderSpec.push(newAttributes.xMeasure);
|
|
@@ -10010,6 +10011,379 @@ var WaterfallChart = function WaterfallChart(config) {
|
|
|
10010
10011
|
};
|
|
10011
10012
|
};
|
|
10012
10013
|
|
|
10014
|
+
var attributesSchema$h = function attributesSchema(config) {
|
|
10015
|
+
return Joi.object(_extends({}, baseAttributesSchema(config.attributesSchemaOptions), timeDimensionQuerySchema(config.queryEngineConfig, config.attributesSchemaOptions), {
|
|
10016
|
+
stacked: Joi.valid(true, false),
|
|
10017
|
+
legend: Joi.valid(true, false),
|
|
10018
|
+
type: Joi.valid('areaChartV2').required(),
|
|
10019
|
+
parameters: parametersSchema(config.queryEngineConfig, config.attributesSchemaOptions),
|
|
10020
|
+
lineCurve: areaCurveSchema,
|
|
10021
|
+
conditionalFormattingRules: conditionalFormattingRulesSchema(config.queryEngineConfig),
|
|
10022
|
+
goalLines: goalLinesSchema(),
|
|
10023
|
+
axisTitles: axisTitleSchema(),
|
|
10024
|
+
headline: headlineSchema(),
|
|
10025
|
+
tags: tagsSchema(),
|
|
10026
|
+
trends: trendsSchema()
|
|
10027
|
+
}));
|
|
10028
|
+
};
|
|
10029
|
+
|
|
10030
|
+
var setAttributes$g = (function (config) {
|
|
10031
|
+
return function (lineChart, partial) {
|
|
10032
|
+
var newAttributes = setAttributes(lineChart, partial, attributesSchema$h(config));
|
|
10033
|
+
newAttributes = removeUnusedOrderFieldsFromTimeSeriesComponent(newAttributes);
|
|
10034
|
+
return newAttributes;
|
|
10035
|
+
};
|
|
10036
|
+
});
|
|
10037
|
+
|
|
10038
|
+
var CONSTANTS$j = {
|
|
10039
|
+
title: 'Area chart',
|
|
10040
|
+
description: 'Ideal for illustrating changes and trends over time with area graphs.',
|
|
10041
|
+
namespace: 'area_chart',
|
|
10042
|
+
data_panel: {
|
|
10043
|
+
data_set: {
|
|
10044
|
+
type: 'dataSet',
|
|
10045
|
+
title: 'Data set',
|
|
10046
|
+
description: 'What data do you want to use in this area chart?'
|
|
10047
|
+
},
|
|
10048
|
+
views: {
|
|
10049
|
+
type: 'views',
|
|
10050
|
+
title: 'View',
|
|
10051
|
+
description: ''
|
|
10052
|
+
},
|
|
10053
|
+
field_y_axis: {
|
|
10054
|
+
type: 'fieldCollector',
|
|
10055
|
+
title: 'Metric - Y Axis',
|
|
10056
|
+
description: 'What do you want each area to measure?',
|
|
10057
|
+
callToAction: 'Add metric'
|
|
10058
|
+
},
|
|
10059
|
+
drilldown: {
|
|
10060
|
+
type: 'drilldown',
|
|
10061
|
+
title: 'Drilldown',
|
|
10062
|
+
description: 'After clicking on a segment of this area chart, what information do you want to see next?'
|
|
10063
|
+
},
|
|
10064
|
+
field_x_axis: {
|
|
10065
|
+
type: 'fieldCollector',
|
|
10066
|
+
title: 'Grouping - X Axis',
|
|
10067
|
+
description: 'What do you want each area to represent? An example might be a `product category` field to represent each category as a area.',
|
|
10068
|
+
callToAction: 'Add grouping'
|
|
10069
|
+
},
|
|
10070
|
+
sort: {
|
|
10071
|
+
type: 'sort',
|
|
10072
|
+
title: 'Sort',
|
|
10073
|
+
description: 'Select the order of categories or time on the x Axis.'
|
|
10074
|
+
},
|
|
10075
|
+
filter: {
|
|
10076
|
+
type: 'filter',
|
|
10077
|
+
title: 'Filters',
|
|
10078
|
+
description: 'Only include the information you want to use in this area chart.'
|
|
10079
|
+
},
|
|
10080
|
+
custom_metrics: {
|
|
10081
|
+
type: 'customMetrics',
|
|
10082
|
+
title: 'Custom metrics',
|
|
10083
|
+
description: 'Build your own metrics, such as a percentage.'
|
|
10084
|
+
},
|
|
10085
|
+
limit: {
|
|
10086
|
+
type: 'limit',
|
|
10087
|
+
title: 'Limit',
|
|
10088
|
+
description: 'Set the maximum number of records to show on this area chart.'
|
|
10089
|
+
}
|
|
10090
|
+
},
|
|
10091
|
+
format_panel: {
|
|
10092
|
+
heading: {
|
|
10093
|
+
type: 'heading',
|
|
10094
|
+
title: 'Heading',
|
|
10095
|
+
description: '',
|
|
10096
|
+
subSectionDefinition: {
|
|
10097
|
+
title: {
|
|
10098
|
+
type: 'title',
|
|
10099
|
+
title: 'Title',
|
|
10100
|
+
description: '',
|
|
10101
|
+
namespace: 'title'
|
|
10102
|
+
},
|
|
10103
|
+
subject: {
|
|
10104
|
+
title: 'Subject',
|
|
10105
|
+
type: 'subject',
|
|
10106
|
+
description: '',
|
|
10107
|
+
namespace: 'subject'
|
|
10108
|
+
}
|
|
10109
|
+
}
|
|
10110
|
+
},
|
|
10111
|
+
chart_styles: {
|
|
10112
|
+
type: 'chartStyles',
|
|
10113
|
+
title: 'Chart Settings',
|
|
10114
|
+
description: '',
|
|
10115
|
+
subSectionDefinition: {
|
|
10116
|
+
stacked: {
|
|
10117
|
+
type: 'stacked',
|
|
10118
|
+
title: 'Layout',
|
|
10119
|
+
description: '',
|
|
10120
|
+
namespace: 'stacked'
|
|
10121
|
+
},
|
|
10122
|
+
curve: {
|
|
10123
|
+
type: 'curve',
|
|
10124
|
+
title: 'Area Style',
|
|
10125
|
+
description: '',
|
|
10126
|
+
namespace: 'curve'
|
|
10127
|
+
},
|
|
10128
|
+
legend: {
|
|
10129
|
+
type: 'legend',
|
|
10130
|
+
title: 'Show Legend',
|
|
10131
|
+
description: '',
|
|
10132
|
+
namespace: 'legend'
|
|
10133
|
+
}
|
|
10134
|
+
}
|
|
10135
|
+
},
|
|
10136
|
+
axis_labels: {
|
|
10137
|
+
type: 'axisLabels',
|
|
10138
|
+
title: 'Axis Preferences',
|
|
10139
|
+
description: '',
|
|
10140
|
+
subSectionDefinition: {
|
|
10141
|
+
x: {
|
|
10142
|
+
title: 'X Axis',
|
|
10143
|
+
description: '',
|
|
10144
|
+
namespace: 'x'
|
|
10145
|
+
},
|
|
10146
|
+
'x.prefix': {
|
|
10147
|
+
title: 'Prefix',
|
|
10148
|
+
description: '',
|
|
10149
|
+
namespace: 'x.prefix'
|
|
10150
|
+
},
|
|
10151
|
+
'x.postfix': {
|
|
10152
|
+
title: 'Postfix',
|
|
10153
|
+
description: '',
|
|
10154
|
+
namespace: 'x.postfix'
|
|
10155
|
+
},
|
|
10156
|
+
'x.format': {
|
|
10157
|
+
title: 'Format',
|
|
10158
|
+
description: '',
|
|
10159
|
+
namespace: 'x.format'
|
|
10160
|
+
},
|
|
10161
|
+
'x.count': {
|
|
10162
|
+
title: 'Label count',
|
|
10163
|
+
description: '',
|
|
10164
|
+
namespace: 'x.count'
|
|
10165
|
+
},
|
|
10166
|
+
'x.axis_title': {
|
|
10167
|
+
title: 'Title',
|
|
10168
|
+
description: '',
|
|
10169
|
+
namespace: 'x.axis_title'
|
|
10170
|
+
},
|
|
10171
|
+
y: {
|
|
10172
|
+
title: 'Y Axis',
|
|
10173
|
+
description: '',
|
|
10174
|
+
namespace: 'y'
|
|
10175
|
+
},
|
|
10176
|
+
'y.prefix': {
|
|
10177
|
+
title: 'Prefix',
|
|
10178
|
+
description: '',
|
|
10179
|
+
namespace: 'y.prefix'
|
|
10180
|
+
},
|
|
10181
|
+
'y.postfix': {
|
|
10182
|
+
title: 'Postfix',
|
|
10183
|
+
description: '',
|
|
10184
|
+
namespace: 'y.postfix'
|
|
10185
|
+
},
|
|
10186
|
+
'y.format': {
|
|
10187
|
+
title: 'Format',
|
|
10188
|
+
description: '',
|
|
10189
|
+
namespace: 'y.format'
|
|
10190
|
+
},
|
|
10191
|
+
'y.count': {
|
|
10192
|
+
title: 'Label count',
|
|
10193
|
+
description: '',
|
|
10194
|
+
namespace: 'y.count'
|
|
10195
|
+
},
|
|
10196
|
+
'y.axis_title': {
|
|
10197
|
+
title: 'Title',
|
|
10198
|
+
description: '',
|
|
10199
|
+
namespace: 'y.axis_title'
|
|
10200
|
+
}
|
|
10201
|
+
}
|
|
10202
|
+
},
|
|
10203
|
+
conditional_formatting: {
|
|
10204
|
+
type: 'conditionalFormatting',
|
|
10205
|
+
title: 'Conditional Formatting',
|
|
10206
|
+
description: ''
|
|
10207
|
+
},
|
|
10208
|
+
headline: {
|
|
10209
|
+
type: 'headline',
|
|
10210
|
+
title: 'Headarea',
|
|
10211
|
+
description: ''
|
|
10212
|
+
},
|
|
10213
|
+
trends: {
|
|
10214
|
+
type: 'trends',
|
|
10215
|
+
title: 'Trend lines',
|
|
10216
|
+
description: 'Specify a trend type for the area chart.'
|
|
10217
|
+
},
|
|
10218
|
+
goal_line: {
|
|
10219
|
+
type: 'goalLine',
|
|
10220
|
+
title: 'Goal lines',
|
|
10221
|
+
description: ''
|
|
10222
|
+
}
|
|
10223
|
+
}
|
|
10224
|
+
};
|
|
10225
|
+
|
|
10226
|
+
var AreaChart$1 = function AreaChart(config) {
|
|
10227
|
+
return {
|
|
10228
|
+
title: 'Area chart V2',
|
|
10229
|
+
description: 'Ideal for illustrating changes and trends over time with area graphs.',
|
|
10230
|
+
servicesClass: 'AreaChart',
|
|
10231
|
+
namespace: 'area_chart',
|
|
10232
|
+
dump: function dump(hydrated) {
|
|
10233
|
+
return hydrated;
|
|
10234
|
+
},
|
|
10235
|
+
load: function load(dumped) {
|
|
10236
|
+
var _dumped$tags, _dumped$trends;
|
|
10237
|
+
return {
|
|
10238
|
+
type: dumped.type,
|
|
10239
|
+
measure: upcastMeasure(dumped.measure),
|
|
10240
|
+
order: upcastOrder(dumped.order, dumped.timeDimension),
|
|
10241
|
+
dimension: upcastStringDimensionsToObject(dumped.dimension),
|
|
10242
|
+
// TODO: upcast dumped.timeDimension -> dimension
|
|
10243
|
+
displayTitle: dumped.displayTitle,
|
|
10244
|
+
displaySubject: dumped.displaySubject,
|
|
10245
|
+
protectedByOrganisation: dumped.protectedByOrganisation,
|
|
10246
|
+
viewId: upcastViewId(dumped.viewId),
|
|
10247
|
+
filter: upcastFilter(dumped.filter),
|
|
10248
|
+
dataSetId: dumped.dataSetId,
|
|
10249
|
+
limit: dumped.limit,
|
|
10250
|
+
timeDimension: null,
|
|
10251
|
+
xAxisPostfix: dumped.xAxisPostfix,
|
|
10252
|
+
xAxisPrefix: dumped.xAxisPrefix,
|
|
10253
|
+
yAxisPostfix: dumped.yAxisPostfix,
|
|
10254
|
+
yAxisPrefix: dumped.yAxisPrefix,
|
|
10255
|
+
yAxisFormat: dumped.yAxisFormat,
|
|
10256
|
+
xAxisFormat: dumped.xAxisFormat,
|
|
10257
|
+
lineCurve: dumped.lineCurve,
|
|
10258
|
+
conditionalFormattingRules: upcast$1(config.queryEngineConfig, dumped.conditionalFormattingRules),
|
|
10259
|
+
drilldown: dumped.drilldown,
|
|
10260
|
+
legend: dumped.legend,
|
|
10261
|
+
goalLines: dumped.goalLines,
|
|
10262
|
+
headline: upcastHeadline(dumped.headline, dumped.timeDimension),
|
|
10263
|
+
parameters: upcastParameters(dumped.parameters),
|
|
10264
|
+
approxXAxisLabelCount: upcastAxisLabel(dumped.approxXAxisLabelCount),
|
|
10265
|
+
approxYAxisLabelCount: upcastAxisLabel(dumped.approxYAxisLabelCount),
|
|
10266
|
+
axisTitles: dumped.axisTitles,
|
|
10267
|
+
tags: (_dumped$tags = dumped.tags) != null ? _dumped$tags : [],
|
|
10268
|
+
trends: (_dumped$trends = dumped.trends) != null ? _dumped$trends : [],
|
|
10269
|
+
stacked: dumped.stacked
|
|
10270
|
+
};
|
|
10271
|
+
},
|
|
10272
|
+
setAttributes: setAttributes$g(config),
|
|
10273
|
+
validate: function validate(attrs, dataSets) {
|
|
10274
|
+
return validateView(attrs, dataSets, config.queryEngineConfig);
|
|
10275
|
+
},
|
|
10276
|
+
init: function init(dataSetId, overrides) {
|
|
10277
|
+
return _extends({
|
|
10278
|
+
type: 'areaChartV2',
|
|
10279
|
+
measure: [],
|
|
10280
|
+
dimension: [],
|
|
10281
|
+
timeDimension: null,
|
|
10282
|
+
displayTitle: '',
|
|
10283
|
+
displaySubject: '',
|
|
10284
|
+
protectedByOrganisation: undefined,
|
|
10285
|
+
viewId: upcastViewId(overrides == null ? void 0 : overrides.viewId),
|
|
10286
|
+
filter: [],
|
|
10287
|
+
order: [],
|
|
10288
|
+
dataSetId: dataSetId,
|
|
10289
|
+
limit: 5000,
|
|
10290
|
+
xAxisPostfix: '',
|
|
10291
|
+
xAxisPrefix: '',
|
|
10292
|
+
yAxisPostfix: '',
|
|
10293
|
+
yAxisPrefix: '',
|
|
10294
|
+
yAxisFormat: null,
|
|
10295
|
+
xAxisFormat: null,
|
|
10296
|
+
lineCurve: 'natural',
|
|
10297
|
+
conditionalFormattingRules: [],
|
|
10298
|
+
drilldown: [],
|
|
10299
|
+
legend: true,
|
|
10300
|
+
goalLines: undefined,
|
|
10301
|
+
approxXAxisLabelCount: 'auto',
|
|
10302
|
+
approxYAxisLabelCount: 'auto',
|
|
10303
|
+
parameters: {},
|
|
10304
|
+
axisTitles: undefined,
|
|
10305
|
+
headline: undefined,
|
|
10306
|
+
tags: [],
|
|
10307
|
+
trends: [],
|
|
10308
|
+
stacked: false
|
|
10309
|
+
}, overrides);
|
|
10310
|
+
},
|
|
10311
|
+
createFeedback: createFeedback,
|
|
10312
|
+
schema: attributesSchema$h(config),
|
|
10313
|
+
removeField: function removeField(attrs, fieldId) {
|
|
10314
|
+
return removeField$1(attrs, fieldId, config.queryEngineConfig);
|
|
10315
|
+
},
|
|
10316
|
+
isRunnable: function isRunnable(hydrated) {
|
|
10317
|
+
return hydrated.measure.length > 0 && hydrated.dimension.length > 0;
|
|
10318
|
+
},
|
|
10319
|
+
autoGenerate: function autoGenerate(dataSet) {
|
|
10320
|
+
var _DataSet$buildQueryAt = buildQueryAttributes(dataSet, config.queryEngineConfig, 'lineChart'),
|
|
10321
|
+
measure = _DataSet$buildQueryAt.measure,
|
|
10322
|
+
dimension = _DataSet$buildQueryAt.dimension;
|
|
10323
|
+
return this.init(dataSet.id, {
|
|
10324
|
+
measure: [measure[0]],
|
|
10325
|
+
dimension: dimension
|
|
10326
|
+
});
|
|
10327
|
+
},
|
|
10328
|
+
dataPanelConfig: function dataPanelConfig() {
|
|
10329
|
+
return [namespace(CONSTANTS$j, 'data_set'), namespace(CONSTANTS$j, 'views'), _extends({}, namespace(CONSTANTS$j, 'field_y_axis'), {
|
|
10330
|
+
fieldFilterOptions: {
|
|
10331
|
+
forComponent: 'lineChart'
|
|
10332
|
+
},
|
|
10333
|
+
preSetPartialAttributes: function preSetPartialAttributes(values) {
|
|
10334
|
+
return {
|
|
10335
|
+
measure: values
|
|
10336
|
+
};
|
|
10337
|
+
},
|
|
10338
|
+
getValues: function getValues(attrs) {
|
|
10339
|
+
return attrs.measure;
|
|
10340
|
+
},
|
|
10341
|
+
testId: 'metric-input'
|
|
10342
|
+
}), _extends({}, namespace(CONSTANTS$j, 'field_x_axis'), {
|
|
10343
|
+
fieldFilterOptions: {
|
|
10344
|
+
forComponent: 'lineChart',
|
|
10345
|
+
onlyDimensions: true
|
|
10346
|
+
},
|
|
10347
|
+
preventDuplicates: false,
|
|
10348
|
+
// return all values in the dimension array instead of seperating out timeDimension
|
|
10349
|
+
preSetPartialAttributes: function preSetPartialAttributes(values) {
|
|
10350
|
+
return {
|
|
10351
|
+
dimension: [].concat(values)
|
|
10352
|
+
};
|
|
10353
|
+
},
|
|
10354
|
+
// does this need to be updated too?
|
|
10355
|
+
getValues: function getValues(attrs) {
|
|
10356
|
+
return [].concat(attrs.dimension);
|
|
10357
|
+
},
|
|
10358
|
+
maxAllowed: 2,
|
|
10359
|
+
testId: 'add-dimension'
|
|
10360
|
+
}), namespace(CONSTANTS$j, 'sort'), namespace(CONSTANTS$j, 'filter'), namespace(CONSTANTS$j, 'custom_metrics'), namespace(CONSTANTS$j, 'limit')];
|
|
10361
|
+
},
|
|
10362
|
+
formatPanelConfig: function formatPanelConfig() {
|
|
10363
|
+
return [headingConstant(CONSTANTS$j), chartStylesConstant(CONSTANTS$j, true, false), axisLabelsConstants(CONSTANTS$j), _extends({}, namespace(CONSTANTS$j, 'conditional_formatting'), {
|
|
10364
|
+
ruleType: 'lineColor'
|
|
10365
|
+
}), namespace(CONSTANTS$j, 'goal_line')];
|
|
10366
|
+
},
|
|
10367
|
+
supportedCustomFields: {
|
|
10368
|
+
calculatedField: false,
|
|
10369
|
+
percentages: true,
|
|
10370
|
+
dateCalculations: true,
|
|
10371
|
+
simpleMaths: true,
|
|
10372
|
+
rules: true,
|
|
10373
|
+
aggregateMaths: true,
|
|
10374
|
+
roundedNumbers: true,
|
|
10375
|
+
conditional: true
|
|
10376
|
+
},
|
|
10377
|
+
supportedFeatures: {
|
|
10378
|
+
parameters: true,
|
|
10379
|
+
colorGradient: false
|
|
10380
|
+
},
|
|
10381
|
+
setDataAttributesFromPreAggregatedDataSet: function setDataAttributesFromPreAggregatedDataSet$1(attributes, dataSet) {
|
|
10382
|
+
return setDataAttributesFromPreAggregatedDataSet(attributes, dataSet, this.setAttributes);
|
|
10383
|
+
}
|
|
10384
|
+
};
|
|
10385
|
+
};
|
|
10386
|
+
|
|
10013
10387
|
var EMPTY_CONFIG = {
|
|
10014
10388
|
queryEngineConfig: {
|
|
10015
10389
|
supportedFeatures: [],
|
|
@@ -10036,6 +10410,7 @@ function getComponentInterface(type, config) {
|
|
|
10036
10410
|
if (type == 'lineChart') return textOverrideComponent(LineChart(config || EMPTY_CONFIG), config == null ? void 0 : config.textOverride);
|
|
10037
10411
|
if (type == 'lineChartV2') return textOverrideComponent(LineChart$1(config || EMPTY_CONFIG), config == null ? void 0 : config.textOverride);
|
|
10038
10412
|
if (type == 'barChartV2') return textOverrideComponent(BarChart$1(config || EMPTY_CONFIG), config == null ? void 0 : config.textOverride);
|
|
10413
|
+
if (type == 'areaChartV2') return textOverrideComponent(AreaChart$1(config || EMPTY_CONFIG), config == null ? void 0 : config.textOverride);
|
|
10039
10414
|
if (type == 'mercatorMap') return textOverrideComponent(MercatorMap(config || EMPTY_CONFIG), config == null ? void 0 : config.textOverride);
|
|
10040
10415
|
if (type == 'pieChart') return textOverrideComponent(PieChart(config || EMPTY_CONFIG), config == null ? void 0 : config.textOverride);
|
|
10041
10416
|
if (type == 'progress') return textOverrideComponent(Progress(config || EMPTY_CONFIG), config == null ? void 0 : config.textOverride);
|
|
@@ -13192,7 +13567,7 @@ var buildDefaults = function buildDefaults(partialFeatureToggles) {
|
|
|
13192
13567
|
};
|
|
13193
13568
|
};
|
|
13194
13569
|
|
|
13195
|
-
var ALL_COMPONENT_TYPES = ['barChart', 'bubbleChart', 'horizontalBarChart', 'funnelChart', 'areaChart', 'lineChart', 'lineChartV2', 'barChartV2', 'scatterChart', 'pieChart', 'singleStat', 'dataTable', 'basicTable', 'comboChart', 'mercatorMap', 'progress', 'richText', 'custom', 'waterfallChart'];
|
|
13570
|
+
var ALL_COMPONENT_TYPES = ['barChart', 'bubbleChart', 'horizontalBarChart', 'funnelChart', 'areaChart', 'areaChartV2', 'lineChart', 'lineChartV2', 'barChartV2', 'scatterChart', 'pieChart', 'singleStat', 'dataTable', 'basicTable', 'comboChart', 'mercatorMap', 'progress', 'richText', 'custom', 'waterfallChart'];
|
|
13196
13571
|
var ALL_VIZZLY_COMPONENT_TYPES = /*#__PURE__*/[].concat(ALL_COMPONENT_TYPES).filter(function (type) {
|
|
13197
13572
|
return type != 'custom';
|
|
13198
13573
|
});
|
|
@@ -13532,7 +13907,7 @@ var saveable = function saveable(component, protectedComponent) {
|
|
|
13532
13907
|
};
|
|
13533
13908
|
};
|
|
13534
13909
|
|
|
13535
|
-
var attributesSchema$
|
|
13910
|
+
var attributesSchema$i = function attributesSchema(config) {
|
|
13536
13911
|
return Joi.alternatives().conditional('.type', {
|
|
13537
13912
|
is: 'barChart',
|
|
13538
13913
|
then: BarChart(config).schema
|
|
@@ -13554,6 +13929,9 @@ var attributesSchema$h = function attributesSchema(config) {
|
|
|
13554
13929
|
}).conditional('.type', {
|
|
13555
13930
|
is: 'barChartV2',
|
|
13556
13931
|
then: BarChart$1(config).schema
|
|
13932
|
+
}).conditional('.type', {
|
|
13933
|
+
is: 'areaChartV2',
|
|
13934
|
+
then: AreaChart$1(config).schema
|
|
13557
13935
|
}).conditional('.type', {
|
|
13558
13936
|
is: 'comboChart',
|
|
13559
13937
|
then: ComboChart(config).schema
|
|
@@ -20932,7 +21310,7 @@ var Combobox = function Combobox(props) {
|
|
|
20932
21310
|
});
|
|
20933
21311
|
};
|
|
20934
21312
|
|
|
20935
|
-
var attributesSchema$
|
|
21313
|
+
var attributesSchema$j = /*#__PURE__*/Joi.object({
|
|
20936
21314
|
displayTitle: /*#__PURE__*/Joi.string().min(1).required(),
|
|
20937
21315
|
colSpan: /*#__PURE__*/Joi.number().valid(12).required()
|
|
20938
21316
|
});
|
|
@@ -20949,7 +21327,7 @@ var isEmptyCell = /*#__PURE__*/Joi.object({
|
|
|
20949
21327
|
});
|
|
20950
21328
|
var isPopulatedCell = function isPopulatedCell(queryEngineConfig) {
|
|
20951
21329
|
return Joi.object({
|
|
20952
|
-
attributes: attributesSchema$
|
|
21330
|
+
attributes: attributesSchema$i({
|
|
20953
21331
|
queryEngineConfig: queryEngineConfig
|
|
20954
21332
|
}),
|
|
20955
21333
|
colSpan: colSpanSchema
|
|
@@ -20960,7 +21338,7 @@ var saveableDashboardDefinitionSchema = function saveableDashboardDefinitionSche
|
|
|
20960
21338
|
id: Joi.string(),
|
|
20961
21339
|
display: displaySchema(queryEngineConfig),
|
|
20962
21340
|
componentLibrary: Joi.array().required().items(Joi.object({
|
|
20963
|
-
attributes: attributesSchema$
|
|
21341
|
+
attributes: attributesSchema$i({
|
|
20964
21342
|
queryEngineConfig: queryEngineConfig
|
|
20965
21343
|
})
|
|
20966
21344
|
})),
|
|
@@ -20971,7 +21349,7 @@ var saveableDashboardDefinitionSchema = function saveableDashboardDefinitionSche
|
|
|
20971
21349
|
function displaySchema(queryEngineConfig) {
|
|
20972
21350
|
return Joi.array().required().items(Joi.object({
|
|
20973
21351
|
height: Joi.number().required(),
|
|
20974
|
-
components: Joi.array().required().min(1).items(Joi.alternatives(isEmptyCell, isPopulatedCell(queryEngineConfig), attributesSchema$
|
|
21352
|
+
components: Joi.array().required().min(1).items(Joi.alternatives(isEmptyCell, isPopulatedCell(queryEngineConfig), attributesSchema$j))
|
|
20975
21353
|
}));
|
|
20976
21354
|
}
|
|
20977
21355
|
|
|
@@ -21693,7 +22071,7 @@ var setHeaderComponent = function setHeaderComponent(state, action) {
|
|
|
21693
22071
|
newDisplayState.dashboard.display[rowIndex].components[cellIndex] = component;
|
|
21694
22072
|
return newDisplayState;
|
|
21695
22073
|
};
|
|
21696
|
-
var setAttributes$
|
|
22074
|
+
var setAttributes$h = function setAttributes(state, action) {
|
|
21697
22075
|
var attributes = action.attributes,
|
|
21698
22076
|
rowIndex = action.rowIndex,
|
|
21699
22077
|
cellIndex = action.cellIndex;
|
|
@@ -21978,7 +22356,7 @@ var reducer = function reducer(pipelineTransformationOptions) {
|
|
|
21978
22356
|
case 'swapComponents':
|
|
21979
22357
|
return swapComponents$1(state, action);
|
|
21980
22358
|
case 'setAttributes':
|
|
21981
|
-
return setAttributes$
|
|
22359
|
+
return setAttributes$h(state, action);
|
|
21982
22360
|
case 'addComponentToLibrary':
|
|
21983
22361
|
return addComponentToLibrary(state, action);
|
|
21984
22362
|
case 'setLocalFilters':
|
|
@@ -25323,7 +25701,7 @@ var RichText$1 = function RichText(props) {
|
|
|
25323
25701
|
})
|
|
25324
25702
|
}));
|
|
25325
25703
|
};
|
|
25326
|
-
var AreaChart$
|
|
25704
|
+
var AreaChart$2 = function AreaChart(props) {
|
|
25327
25705
|
return jsx("svg", _extends({
|
|
25328
25706
|
xmlns: "http://www.w3.org/2000/svg",
|
|
25329
25707
|
viewBox: "0 0 512 512"
|
|
@@ -25592,7 +25970,10 @@ var WaterfallChart$1 = function WaterfallChart(props) {
|
|
|
25592
25970
|
|
|
25593
25971
|
var componentTypeToIconMapping = {
|
|
25594
25972
|
areaChart: function areaChart(props) {
|
|
25595
|
-
return AreaChart$
|
|
25973
|
+
return AreaChart$2(props);
|
|
25974
|
+
},
|
|
25975
|
+
areaChartV2: function areaChartV2(props) {
|
|
25976
|
+
return AreaChart$2(props);
|
|
25596
25977
|
},
|
|
25597
25978
|
barChart: function barChart(props) {
|
|
25598
25979
|
return BarChart$2(props);
|
|
@@ -32700,7 +33081,7 @@ var VizzlyXYChart = function VizzlyXYChart(props) {
|
|
|
32700
33081
|
});
|
|
32701
33082
|
};
|
|
32702
33083
|
|
|
32703
|
-
var AreaChart$
|
|
33084
|
+
var AreaChart$3 = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
32704
33085
|
var forceRerender = useChartForceRerender(ref);
|
|
32705
33086
|
if (forceRerender) return null;
|
|
32706
33087
|
return jsx(ParentSize, {
|
|
@@ -33651,7 +34032,7 @@ var AreaChartView = function AreaChartView(props) {
|
|
|
33651
34032
|
paddingBottom: showHeadline ? '0.5rem' : undefined
|
|
33652
34033
|
})), showHeadline && jsx(HeadlineStats, _extends({}, props.propsForHeadline)), jsx(ChartWrapper, {
|
|
33653
34034
|
disabledFeatures: (_props$library2 = props == null ? void 0 : props.library) != null ? _props$library2 : false,
|
|
33654
|
-
children: jsx(AreaChart$
|
|
34035
|
+
children: jsx(AreaChart$3, {
|
|
33655
34036
|
approxXAxisLabelCount: props.approxXAxisLabelCount,
|
|
33656
34037
|
approxYAxisLabelCount: props.approxYAxisLabelCount,
|
|
33657
34038
|
ref: ref,
|
|
@@ -33785,7 +34166,7 @@ var isDrilldownAvailable = function isDrilldownAvailable(props) {
|
|
|
33785
34166
|
return (props == null || (_props$component = props.component) == null || (_props$component = _props$component.attributes) == null || (_props$component = _props$component.drilldown) == null ? void 0 : _props$component.length) > 0;
|
|
33786
34167
|
};
|
|
33787
34168
|
|
|
33788
|
-
var AreaChart$
|
|
34169
|
+
var AreaChart$4 = function AreaChart(props) {
|
|
33789
34170
|
var _props$dashboardBehav;
|
|
33790
34171
|
var _useState = useState(null),
|
|
33791
34172
|
onDrilldown = _useState[0],
|
|
@@ -41920,6 +42301,22 @@ function howManyTicksFitInWidth(ticks, maxWidth, avgCharWidth) {
|
|
|
41920
42301
|
}
|
|
41921
42302
|
return fittedTicks.length;
|
|
41922
42303
|
}
|
|
42304
|
+
function howManyTicksFitInHeight(ticks, height) {
|
|
42305
|
+
if (height > 180) return undefined;
|
|
42306
|
+
var currentHeight = 0;
|
|
42307
|
+
var fittedTicks = 0;
|
|
42308
|
+
var ASSUMED_AVERAGE_CHAR_HEIGHT = 28;
|
|
42309
|
+
for (var i = 0; i < ticks.length; i++) {
|
|
42310
|
+
var wordHeight = ASSUMED_AVERAGE_CHAR_HEIGHT;
|
|
42311
|
+
if (currentHeight + wordHeight <= height) {
|
|
42312
|
+
fittedTicks++;
|
|
42313
|
+
currentHeight += wordHeight;
|
|
42314
|
+
} else {
|
|
42315
|
+
break;
|
|
42316
|
+
}
|
|
42317
|
+
}
|
|
42318
|
+
return fittedTicks;
|
|
42319
|
+
}
|
|
41923
42320
|
function pickEquallySpaced(arr, numPicks) {
|
|
41924
42321
|
if (numPicks >= arr.length) {
|
|
41925
42322
|
return arr; // If numPicks is greater than or equal to the array length, return the whole array
|
|
@@ -41932,17 +42329,22 @@ function pickEquallySpaced(arr, numPicks) {
|
|
|
41932
42329
|
}
|
|
41933
42330
|
return result;
|
|
41934
42331
|
}
|
|
41935
|
-
|
|
41936
|
-
|
|
42332
|
+
function adjustTicks(representation, width, height) {
|
|
42333
|
+
representation = cloneDeep(representation);
|
|
41937
42334
|
|
|
41938
42335
|
// TODO; take this from the theme override...
|
|
41939
42336
|
var averageCharacterWidth = ASSUMED_AVERAGE_CHAR_WIDTH;
|
|
41940
|
-
var
|
|
42337
|
+
var numberOfXTicksFittingIntoSpace = howManyTicksFitInWidth(representation.x.ticks || [], width, averageCharacterWidth);
|
|
42338
|
+
var numberOfYTicksFittingIntoSpace = howManyTicksFitInHeight(representation.y.ticks || [], height);
|
|
41941
42339
|
|
|
41942
42340
|
// @ts-ignore
|
|
41943
|
-
|
|
41944
|
-
|
|
41945
|
-
|
|
42341
|
+
representation.x.ticks = pickEquallySpaced(representation.x.ticks, numberOfXTicksFittingIntoSpace);
|
|
42342
|
+
if (numberOfYTicksFittingIntoSpace) {
|
|
42343
|
+
// @ts-ignore
|
|
42344
|
+
representation.y.ticks = pickEquallySpaced(representation.y.ticks, numberOfYTicksFittingIntoSpace);
|
|
42345
|
+
}
|
|
42346
|
+
return representation;
|
|
42347
|
+
}
|
|
41946
42348
|
|
|
41947
42349
|
var buildMargin = function buildMargin(yTicks, showYAxisLabels, hasYAxisTitle, hasXAxisTitle) {
|
|
41948
42350
|
var maxWidth = max(yTicks.map(function (tick) {
|
|
@@ -42912,135 +43314,6 @@ function getStyleDefinition(_ref) {
|
|
|
42912
43314
|
});
|
|
42913
43315
|
}
|
|
42914
43316
|
|
|
42915
|
-
var getMinAndMax = function getMinAndMax(_ref) {
|
|
42916
|
-
var data = _ref.data,
|
|
42917
|
-
keys = _ref.keys,
|
|
42918
|
-
dataType = _ref.dataType,
|
|
42919
|
-
goalLines = _ref.goalLines;
|
|
42920
|
-
if (keys.length === 0) return {
|
|
42921
|
-
max: null,
|
|
42922
|
-
min: null
|
|
42923
|
-
};
|
|
42924
|
-
if (dataType === 'date_time') {
|
|
42925
|
-
var dataToAnalyse = [].concat(data.flatMap(function (dataItem) {
|
|
42926
|
-
return keys.map(function (key) {
|
|
42927
|
-
return dataItem[key] ? new Date(dataItem[key].value).valueOf() : 0;
|
|
42928
|
-
});
|
|
42929
|
-
}));
|
|
42930
|
-
return {
|
|
42931
|
-
max: Math.max.apply(Math, dataToAnalyse),
|
|
42932
|
-
min: Math.min.apply(Math, dataToAnalyse)
|
|
42933
|
-
};
|
|
42934
|
-
} else if (dataType === 'number') {
|
|
42935
|
-
var _dataToAnalyse = [].concat(data.flatMap(function (dataItem) {
|
|
42936
|
-
return keys.map(function (key) {
|
|
42937
|
-
return dataItem[key] ? dataItem[key].value : 0;
|
|
42938
|
-
});
|
|
42939
|
-
}), goalLines ? goalLines.map(function (gL) {
|
|
42940
|
-
return gL.value;
|
|
42941
|
-
}) : []);
|
|
42942
|
-
return {
|
|
42943
|
-
max: Math.max.apply(Math, _dataToAnalyse),
|
|
42944
|
-
min: Math.min.apply(Math, _dataToAnalyse)
|
|
42945
|
-
};
|
|
42946
|
-
} else {
|
|
42947
|
-
return {
|
|
42948
|
-
max: null,
|
|
42949
|
-
min: null
|
|
42950
|
-
};
|
|
42951
|
-
}
|
|
42952
|
-
};
|
|
42953
|
-
|
|
42954
|
-
function getNiceInterval(interval) {
|
|
42955
|
-
// Round the interval to a "nice" value (1, 2, 5, etc.)
|
|
42956
|
-
var exponent = Math.floor(Math.log10(interval));
|
|
42957
|
-
var fraction = interval / Math.pow(10, exponent);
|
|
42958
|
-
var niceFraction;
|
|
42959
|
-
if (fraction <= 1.5) niceFraction = 1;else if (fraction <= 3) niceFraction = 2;else if (fraction <= 7) niceFraction = 5;else niceFraction = 10;
|
|
42960
|
-
return niceFraction * Math.pow(10, exponent);
|
|
42961
|
-
}
|
|
42962
|
-
var getScaleAndTicks = function getScaleAndTicks(_ref) {
|
|
42963
|
-
var _order$;
|
|
42964
|
-
var data = _ref.data,
|
|
42965
|
-
xKey = _ref.xKey,
|
|
42966
|
-
yKeys = _ref.yKeys,
|
|
42967
|
-
xScaleDataType = _ref.xScaleDataType,
|
|
42968
|
-
nullValue = _ref.nullValue,
|
|
42969
|
-
tickCountYAxis = _ref.tickCountYAxis,
|
|
42970
|
-
formattingFunctionX = _ref.formattingFunctionX,
|
|
42971
|
-
formattingFunctionY = _ref.formattingFunctionY,
|
|
42972
|
-
order = _ref.order,
|
|
42973
|
-
goalLines = _ref.goalLines;
|
|
42974
|
-
var xTicks = [];
|
|
42975
|
-
var yTicks = [];
|
|
42976
|
-
var xScale = {
|
|
42977
|
-
dataType: xScaleDataType,
|
|
42978
|
-
key: xKey,
|
|
42979
|
-
ordering: ((_order$ = order[0]) == null ? void 0 : _order$.direction) || null
|
|
42980
|
-
};
|
|
42981
|
-
var x = getMinAndMax({
|
|
42982
|
-
data: data,
|
|
42983
|
-
keys: xScale.key === null ? [] : [xScale.key],
|
|
42984
|
-
dataType: xScale.dataType
|
|
42985
|
-
});
|
|
42986
|
-
if (xKey) {
|
|
42987
|
-
xTicks = data.map(function (dataItem) {
|
|
42988
|
-
var _dataItem$xKey, _dataItem$xScale$key, _dataItem$xScale$key2;
|
|
42989
|
-
var xValue = (_dataItem$xKey = dataItem[xKey]) != null && _dataItem$xKey.value ? dataItem[xKey].value : null;
|
|
42990
|
-
var xformattedValue = formattingFunctionX(xValue, nullValue);
|
|
42991
|
-
var xScaleValue = xScale.key !== null && (_dataItem$xScale$key = dataItem[xScale.key]) != null && _dataItem$xScale$key.value ? (_dataItem$xScale$key2 = dataItem[xScale.key]) == null ? void 0 : _dataItem$xScale$key2.value : '';
|
|
42992
|
-
var xScaleValueAdjusted = xScale.dataType === 'date_time' ? new Date(xScaleValue) : xScale.dataType === 'string' ? String(xScaleValue) : xScale.dataType === 'number' ? Number(xScaleValue) : xScaleValue;
|
|
42993
|
-
return {
|
|
42994
|
-
value: xValue !== null ? xValue : '',
|
|
42995
|
-
formattedValue: xformattedValue !== null ? "" + xformattedValue : null,
|
|
42996
|
-
scaleValue: xScaleValueAdjusted
|
|
42997
|
-
};
|
|
42998
|
-
});
|
|
42999
|
-
}
|
|
43000
|
-
// ----- Y Axis ("number") -----
|
|
43001
|
-
|
|
43002
|
-
var y = getMinAndMax({
|
|
43003
|
-
data: data,
|
|
43004
|
-
keys: yKeys,
|
|
43005
|
-
dataType: 'number',
|
|
43006
|
-
goalLines: goalLines
|
|
43007
|
-
});
|
|
43008
|
-
var maxY = y.max || 0;
|
|
43009
|
-
var minY = Math.min(y.min || 0, 0);
|
|
43010
|
-
var yTickInterval = getNiceInterval((maxY - minY) / (tickCountYAxis - 1));
|
|
43011
|
-
for (var i = 0; i < tickCountYAxis; i++) {
|
|
43012
|
-
var _value = yTickInterval * i;
|
|
43013
|
-
var formattedValue = formattingFunctionY(_value, nullValue);
|
|
43014
|
-
yTicks.push({
|
|
43015
|
-
value: _value,
|
|
43016
|
-
formattedValue: formattedValue,
|
|
43017
|
-
scaleValue: _value
|
|
43018
|
-
});
|
|
43019
|
-
}
|
|
43020
|
-
return {
|
|
43021
|
-
x: {
|
|
43022
|
-
ticks: xTicks,
|
|
43023
|
-
scale: {
|
|
43024
|
-
dataType: xScale.dataType,
|
|
43025
|
-
max: x.max,
|
|
43026
|
-
min: x.min,
|
|
43027
|
-
key: xScale.key,
|
|
43028
|
-
ordering: xScale.ordering
|
|
43029
|
-
}
|
|
43030
|
-
},
|
|
43031
|
-
y: {
|
|
43032
|
-
ticks: yTicks,
|
|
43033
|
-
scale: {
|
|
43034
|
-
dataType: 'number',
|
|
43035
|
-
key: null,
|
|
43036
|
-
ordering: 'asc',
|
|
43037
|
-
max: maxY,
|
|
43038
|
-
min: minY
|
|
43039
|
-
}
|
|
43040
|
-
}
|
|
43041
|
-
};
|
|
43042
|
-
};
|
|
43043
|
-
|
|
43044
43317
|
/**
|
|
43045
43318
|
* When provided with a result, and formatting parameters, it returns a
|
|
43046
43319
|
* populated result including the formatted value to show.
|
|
@@ -43489,6 +43762,180 @@ function buildFieldFormatMaps(result, pivotConfig, xAxisPrefix, xAxisPostfix, xA
|
|
|
43489
43762
|
};
|
|
43490
43763
|
}
|
|
43491
43764
|
|
|
43765
|
+
var getStackedMinAndMax = function getStackedMinAndMax(_ref) {
|
|
43766
|
+
var data = _ref.data,
|
|
43767
|
+
keys = _ref.keys,
|
|
43768
|
+
dataType = _ref.dataType,
|
|
43769
|
+
goalLines = _ref.goalLines,
|
|
43770
|
+
stacked = _ref.stacked;
|
|
43771
|
+
if (keys.length === 0) return {
|
|
43772
|
+
max: null,
|
|
43773
|
+
min: null
|
|
43774
|
+
};
|
|
43775
|
+
if (stacked) {
|
|
43776
|
+
var totals = data.map(function (dataItem) {
|
|
43777
|
+
return keys.reduce(function (sum, key) {
|
|
43778
|
+
var value = dataItem[key] ? dataItem[key].value : 0;
|
|
43779
|
+
return sum + (typeof value === 'number' ? value : 0);
|
|
43780
|
+
}, 0);
|
|
43781
|
+
});
|
|
43782
|
+
var maxTotal = Math.max.apply(Math, totals);
|
|
43783
|
+
var minTotal = Math.min.apply(Math, totals);
|
|
43784
|
+
return {
|
|
43785
|
+
max: maxTotal,
|
|
43786
|
+
min: minTotal
|
|
43787
|
+
};
|
|
43788
|
+
}
|
|
43789
|
+
if (dataType === 'date_time') {
|
|
43790
|
+
var dataToAnalyse = [].concat(data.flatMap(function (dataItem) {
|
|
43791
|
+
return keys.map(function (key) {
|
|
43792
|
+
return dataItem[key] ? new Date(dataItem[key].value).valueOf() : 0;
|
|
43793
|
+
});
|
|
43794
|
+
}));
|
|
43795
|
+
return {
|
|
43796
|
+
max: Math.max.apply(Math, dataToAnalyse),
|
|
43797
|
+
min: Math.min.apply(Math, dataToAnalyse)
|
|
43798
|
+
};
|
|
43799
|
+
} else if (dataType === 'number') {
|
|
43800
|
+
var _dataToAnalyse = [].concat(data.flatMap(function (dataItem) {
|
|
43801
|
+
return keys.map(function (key) {
|
|
43802
|
+
return dataItem[key] ? dataItem[key].value : 0;
|
|
43803
|
+
});
|
|
43804
|
+
}), goalLines ? goalLines.map(function (gL) {
|
|
43805
|
+
return gL.value;
|
|
43806
|
+
}) : []);
|
|
43807
|
+
return {
|
|
43808
|
+
max: Math.max.apply(Math, _dataToAnalyse),
|
|
43809
|
+
min: Math.min.apply(Math, _dataToAnalyse)
|
|
43810
|
+
};
|
|
43811
|
+
} else {
|
|
43812
|
+
return {
|
|
43813
|
+
max: null,
|
|
43814
|
+
min: null
|
|
43815
|
+
};
|
|
43816
|
+
}
|
|
43817
|
+
};
|
|
43818
|
+
|
|
43819
|
+
function getNiceInterval(interval) {
|
|
43820
|
+
var exponent = Math.floor(Math.log10(interval));
|
|
43821
|
+
var fraction = interval / Math.pow(10, exponent);
|
|
43822
|
+
var niceFraction;
|
|
43823
|
+
if (fraction <= 1) {
|
|
43824
|
+
niceFraction = 1;
|
|
43825
|
+
} else if (fraction <= 1.25) {
|
|
43826
|
+
niceFraction = 1.25;
|
|
43827
|
+
} else if (fraction <= 1.5) {
|
|
43828
|
+
niceFraction = 1.5;
|
|
43829
|
+
} else if (fraction <= 2) {
|
|
43830
|
+
niceFraction = 2;
|
|
43831
|
+
} else if (fraction <= 2.5) {
|
|
43832
|
+
niceFraction = 2.5;
|
|
43833
|
+
} else if (fraction <= 3) {
|
|
43834
|
+
niceFraction = 3;
|
|
43835
|
+
} else if (fraction <= 5) {
|
|
43836
|
+
niceFraction = 5;
|
|
43837
|
+
} else if (fraction <= 7) {
|
|
43838
|
+
niceFraction = 7;
|
|
43839
|
+
} else if (fraction <= 10) {
|
|
43840
|
+
niceFraction = 10;
|
|
43841
|
+
} else {
|
|
43842
|
+
niceFraction = 10;
|
|
43843
|
+
}
|
|
43844
|
+
return niceFraction * Math.pow(10, exponent);
|
|
43845
|
+
}
|
|
43846
|
+
var getScaleAndTicks = function getScaleAndTicks(_ref) {
|
|
43847
|
+
var _order$;
|
|
43848
|
+
var data = _ref.data,
|
|
43849
|
+
xKey = _ref.xKey,
|
|
43850
|
+
yKeys = _ref.yKeys,
|
|
43851
|
+
xScaleDataType = _ref.xScaleDataType,
|
|
43852
|
+
nullValue = _ref.nullValue,
|
|
43853
|
+
tickCountYAxis = _ref.tickCountYAxis,
|
|
43854
|
+
formattingFunctionX = _ref.formattingFunctionX,
|
|
43855
|
+
formattingFunctionY = _ref.formattingFunctionY,
|
|
43856
|
+
order = _ref.order,
|
|
43857
|
+
goalLines = _ref.goalLines,
|
|
43858
|
+
stacked = _ref.stacked;
|
|
43859
|
+
var xTicks = [];
|
|
43860
|
+
var xScale = {
|
|
43861
|
+
dataType: xScaleDataType,
|
|
43862
|
+
key: xKey,
|
|
43863
|
+
ordering: ((_order$ = order[0]) == null ? void 0 : _order$.direction) || null
|
|
43864
|
+
};
|
|
43865
|
+
var x = getStackedMinAndMax({
|
|
43866
|
+
data: data,
|
|
43867
|
+
keys: xScale.key === null ? [] : [xScale.key],
|
|
43868
|
+
dataType: xScale.dataType
|
|
43869
|
+
});
|
|
43870
|
+
if (xKey) {
|
|
43871
|
+
xTicks = data.map(function (dataItem) {
|
|
43872
|
+
var _dataItem$xKey, _dataItem$xScale$key, _dataItem$xScale$key2;
|
|
43873
|
+
var xValue = (_dataItem$xKey = dataItem[xKey]) != null && _dataItem$xKey.value ? dataItem[xKey].value : null;
|
|
43874
|
+
var xformattedValue = formattingFunctionX(xValue, nullValue);
|
|
43875
|
+
var xScaleValue = xScale.key !== null && (_dataItem$xScale$key = dataItem[xScale.key]) != null && _dataItem$xScale$key.value ? (_dataItem$xScale$key2 = dataItem[xScale.key]) == null ? void 0 : _dataItem$xScale$key2.value : '';
|
|
43876
|
+
var xScaleValueAdjusted = xScale.dataType === 'date_time' ? new Date(xScaleValue) : xScale.dataType === 'string' ? String(xScaleValue) : xScale.dataType === 'number' ? Number(xScaleValue) : xScaleValue;
|
|
43877
|
+
return {
|
|
43878
|
+
value: xValue !== null ? xValue : '',
|
|
43879
|
+
formattedValue: xformattedValue !== null ? "" + xformattedValue : null,
|
|
43880
|
+
scaleValue: xScaleValueAdjusted
|
|
43881
|
+
};
|
|
43882
|
+
});
|
|
43883
|
+
}
|
|
43884
|
+
// ----- Y Axis ("number") -----
|
|
43885
|
+
|
|
43886
|
+
var y = getStackedMinAndMax({
|
|
43887
|
+
data: data,
|
|
43888
|
+
keys: yKeys,
|
|
43889
|
+
dataType: 'number',
|
|
43890
|
+
goalLines: goalLines,
|
|
43891
|
+
stacked: stacked
|
|
43892
|
+
});
|
|
43893
|
+
var maxY = y.max || 0;
|
|
43894
|
+
var minY = Math.min(y.min || 0, 0);
|
|
43895
|
+
var yTickInterval = getNiceInterval((maxY - minY) / (tickCountYAxis - 1));
|
|
43896
|
+
var yTicks = [];
|
|
43897
|
+
for (var i = 0; i < tickCountYAxis; i++) {
|
|
43898
|
+
var _value = minY + yTickInterval * i;
|
|
43899
|
+
var formattedValue = formattingFunctionY(_value, nullValue);
|
|
43900
|
+
yTicks.push({
|
|
43901
|
+
value: _value,
|
|
43902
|
+
formattedValue: formattedValue,
|
|
43903
|
+
scaleValue: _value
|
|
43904
|
+
});
|
|
43905
|
+
}
|
|
43906
|
+
return {
|
|
43907
|
+
x: {
|
|
43908
|
+
ticks: xTicks,
|
|
43909
|
+
scale: {
|
|
43910
|
+
dataType: xScale.dataType,
|
|
43911
|
+
max: x.max,
|
|
43912
|
+
min: x.min,
|
|
43913
|
+
key: xScale.key,
|
|
43914
|
+
ordering: xScale.ordering
|
|
43915
|
+
}
|
|
43916
|
+
},
|
|
43917
|
+
y: {
|
|
43918
|
+
ticks: yTicks,
|
|
43919
|
+
scale: {
|
|
43920
|
+
dataType: 'number',
|
|
43921
|
+
key: null,
|
|
43922
|
+
ordering: 'asc',
|
|
43923
|
+
max: maxY,
|
|
43924
|
+
min: minY
|
|
43925
|
+
}
|
|
43926
|
+
}
|
|
43927
|
+
};
|
|
43928
|
+
};
|
|
43929
|
+
|
|
43930
|
+
var formattingFunctionX = function formattingFunctionX(value, formattedResult, xKeyField) {
|
|
43931
|
+
if (!xKeyField) return '';
|
|
43932
|
+
return formattedResult.formatterFunc(value, {
|
|
43933
|
+
fieldId: xKeyField.fieldId,
|
|
43934
|
+
"function": xKeyField["function"],
|
|
43935
|
+
outputDataType: xKeyField.outputDataType
|
|
43936
|
+
}).formattedValue;
|
|
43937
|
+
};
|
|
43938
|
+
|
|
43492
43939
|
var buildLineChartRepresentation = function buildLineChartRepresentation(_ref) {
|
|
43493
43940
|
var _xKeys$, _axisTitles$x, _axisTitles$y;
|
|
43494
43941
|
var axisTitles = _ref.axisTitles,
|
|
@@ -43561,15 +44008,6 @@ var buildLineChartRepresentation = function buildLineChartRepresentation(_ref) {
|
|
|
43561
44008
|
|
|
43562
44009
|
// ----- Formatting -----
|
|
43563
44010
|
|
|
43564
|
-
var formattingFunctionX = function formattingFunctionX(value) {
|
|
43565
|
-
if (!xKeyField) return '';
|
|
43566
|
-
return formattedResult.formatterFunc(value, {
|
|
43567
|
-
fieldId: xKeyField.fieldId,
|
|
43568
|
-
"function": xKeyField["function"],
|
|
43569
|
-
outputDataType: xKeyField.outputDataType
|
|
43570
|
-
}).formattedValue;
|
|
43571
|
-
};
|
|
43572
|
-
|
|
43573
44011
|
// (value: any, noValueReplacement?: string) => string;
|
|
43574
44012
|
var formattingFunctionY = function formattingFunctionY(value) {
|
|
43575
44013
|
// Use any y axis field as they are all formatted in the same way (for now...);
|
|
@@ -43598,7 +44036,9 @@ var buildLineChartRepresentation = function buildLineChartRepresentation(_ref) {
|
|
|
43598
44036
|
var orderFunction = order.length > 0 ? order[0]["function"] : undefined;
|
|
43599
44037
|
var trendsAndForecastData = getTrendsAndForecastsData({
|
|
43600
44038
|
chartData: chartData,
|
|
43601
|
-
formattingFunctionX: formattingFunctionX
|
|
44039
|
+
formattingFunctionX: function formattingFunctionX$1(value) {
|
|
44040
|
+
return formattingFunctionX(value, formattedResult, xKeyField);
|
|
44041
|
+
},
|
|
43602
44042
|
formattingFunctionY: formattingFunctionY,
|
|
43603
44043
|
keys: keys,
|
|
43604
44044
|
nullValue: nullValue,
|
|
@@ -43628,7 +44068,9 @@ var buildLineChartRepresentation = function buildLineChartRepresentation(_ref) {
|
|
|
43628
44068
|
xScaleDataType: xScaleDataType,
|
|
43629
44069
|
yKeys: yKeys,
|
|
43630
44070
|
tickCountYAxis: approxYAxisLabelCount,
|
|
43631
|
-
formattingFunctionX: formattingFunctionX
|
|
44071
|
+
formattingFunctionX: function formattingFunctionX$1(value) {
|
|
44072
|
+
return formattingFunctionX(value, formattedResult, xKeyField);
|
|
44073
|
+
},
|
|
43632
44074
|
formattingFunctionY: formattingFunctionY,
|
|
43633
44075
|
nullValue: nullValue,
|
|
43634
44076
|
order: order,
|
|
@@ -43690,62 +44132,6 @@ var buildLineChartRepresentation = function buildLineChartRepresentation(_ref) {
|
|
|
43690
44132
|
return chart;
|
|
43691
44133
|
};
|
|
43692
44134
|
|
|
43693
|
-
var ASSUMED_AVERAGE_CHAR_WIDTH$1 = 8.8;
|
|
43694
|
-
function calculateWordWidth$1(word, avgCharWidth) {
|
|
43695
|
-
if (avgCharWidth === void 0) {
|
|
43696
|
-
avgCharWidth = ASSUMED_AVERAGE_CHAR_WIDTH$1;
|
|
43697
|
-
}
|
|
43698
|
-
return word.length * avgCharWidth;
|
|
43699
|
-
}
|
|
43700
|
-
|
|
43701
|
-
/** Reduce width proportionally to simulate spacing / padding between ticks. */
|
|
43702
|
-
var widthWithSpacing$1 = function widthWithSpacing(width) {
|
|
43703
|
-
var THIRTY_PERCENT = 0.3;
|
|
43704
|
-
return width - width * THIRTY_PERCENT;
|
|
43705
|
-
};
|
|
43706
|
-
function howManyTicksFitInWidth$1(ticks, maxWidth, avgCharWidth) {
|
|
43707
|
-
if (avgCharWidth === void 0) {
|
|
43708
|
-
avgCharWidth = ASSUMED_AVERAGE_CHAR_WIDTH$1;
|
|
43709
|
-
}
|
|
43710
|
-
var fittedTicks = [];
|
|
43711
|
-
var currentWidth = 0;
|
|
43712
|
-
for (var _iterator = _createForOfIteratorHelperLoose(ticks), _step; !(_step = _iterator()).done;) {
|
|
43713
|
-
var tick = _step.value;
|
|
43714
|
-
var word = (tick == null ? void 0 : tick.formattedValue) || '';
|
|
43715
|
-
var wordWidth = calculateWordWidth$1(word, avgCharWidth);
|
|
43716
|
-
if (currentWidth + wordWidth <= widthWithSpacing$1(maxWidth)) {
|
|
43717
|
-
fittedTicks.push(tick);
|
|
43718
|
-
currentWidth += wordWidth + avgCharWidth; // Add space between words
|
|
43719
|
-
} else {
|
|
43720
|
-
break; // Stop if adding the word exceeds maxWidth
|
|
43721
|
-
}
|
|
43722
|
-
}
|
|
43723
|
-
return fittedTicks.length;
|
|
43724
|
-
}
|
|
43725
|
-
function pickEquallySpaced$1(arr, numPicks) {
|
|
43726
|
-
if (numPicks >= arr.length) {
|
|
43727
|
-
return arr; // If numPicks is greater than or equal to the array length, return the whole array
|
|
43728
|
-
}
|
|
43729
|
-
var result = [];
|
|
43730
|
-
var interval = (arr.length - 1) / (numPicks - 1);
|
|
43731
|
-
for (var i = 0; i < numPicks; i++) {
|
|
43732
|
-
var index = Math.round(i * interval); // Calculate index and round it
|
|
43733
|
-
result.push(arr[index]);
|
|
43734
|
-
}
|
|
43735
|
-
return result;
|
|
43736
|
-
}
|
|
43737
|
-
var adjustTicks$1 = function adjustTicks(lineChartRepresentation, width) {
|
|
43738
|
-
lineChartRepresentation = cloneDeep(lineChartRepresentation);
|
|
43739
|
-
|
|
43740
|
-
// TODO; take this from the theme override...
|
|
43741
|
-
var averageCharacterWidth = ASSUMED_AVERAGE_CHAR_WIDTH$1;
|
|
43742
|
-
var numberOfTicksFittingIntoSpace = howManyTicksFitInWidth$1(lineChartRepresentation.x.ticks || [], width, averageCharacterWidth);
|
|
43743
|
-
|
|
43744
|
-
// @ts-ignore
|
|
43745
|
-
lineChartRepresentation.x.ticks = pickEquallySpaced$1(lineChartRepresentation.x.ticks, numberOfTicksFittingIntoSpace);
|
|
43746
|
-
return lineChartRepresentation;
|
|
43747
|
-
};
|
|
43748
|
-
|
|
43749
44135
|
var LineChartV2View = function LineChartV2View(props) {
|
|
43750
44136
|
var _props$library, _props$attributes$vie;
|
|
43751
44137
|
var _useDashboardBehaviou = useDashboardBehaviourContext(),
|
|
@@ -43854,7 +44240,7 @@ var LineChartV2View = function LineChartV2View(props) {
|
|
|
43854
44240
|
return jsx(LineChart$5, {
|
|
43855
44241
|
width: parent.width,
|
|
43856
44242
|
height: parent.height,
|
|
43857
|
-
chart: adjustTicks
|
|
44243
|
+
chart: adjustTicks(chartRepresentation, parent.width, parent.height),
|
|
43858
44244
|
options: {
|
|
43859
44245
|
lineCurve: props.attributes.lineCurve,
|
|
43860
44246
|
removeStroke: false,
|
|
@@ -43862,8 +44248,7 @@ var LineChartV2View = function LineChartV2View(props) {
|
|
|
43862
44248
|
showLegend: props.attributes.legend,
|
|
43863
44249
|
axis: {
|
|
43864
44250
|
showXAxisLabels: props.attributes.approxXAxisLabelCount !== 0,
|
|
43865
|
-
|
|
43866
|
-
showYAxisLabels: props.attributes.approxYAxisLabelCount !== 0 // shared-ui/src/library/StylePanel/AxisPreferenceSection.tsx
|
|
44251
|
+
showYAxisLabels: props.attributes.approxYAxisLabelCount !== 0
|
|
43867
44252
|
}
|
|
43868
44253
|
},
|
|
43869
44254
|
theme: theme == null ? void 0 : theme.charts
|
|
@@ -47185,171 +47570,6 @@ var Progress$2 = function Progress(props) {
|
|
|
47185
47570
|
}));
|
|
47186
47571
|
};
|
|
47187
47572
|
|
|
47188
|
-
var getMinAndMax$1 = function getMinAndMax(_ref) {
|
|
47189
|
-
var data = _ref.data,
|
|
47190
|
-
keys = _ref.keys,
|
|
47191
|
-
dataType = _ref.dataType,
|
|
47192
|
-
goalLines = _ref.goalLines,
|
|
47193
|
-
stacked = _ref.stacked;
|
|
47194
|
-
if (keys.length === 0) return {
|
|
47195
|
-
max: null,
|
|
47196
|
-
min: null
|
|
47197
|
-
};
|
|
47198
|
-
if (stacked) {
|
|
47199
|
-
var totals = data.map(function (dataItem) {
|
|
47200
|
-
return keys.reduce(function (sum, key) {
|
|
47201
|
-
var value = dataItem[key] ? dataItem[key].value : 0;
|
|
47202
|
-
return sum + (typeof value === 'number' ? value : 0);
|
|
47203
|
-
}, 0);
|
|
47204
|
-
});
|
|
47205
|
-
var maxTotal = Math.max.apply(Math, totals);
|
|
47206
|
-
var minTotal = Math.min.apply(Math, totals);
|
|
47207
|
-
return {
|
|
47208
|
-
max: maxTotal,
|
|
47209
|
-
min: minTotal
|
|
47210
|
-
};
|
|
47211
|
-
}
|
|
47212
|
-
if (dataType === 'date_time') {
|
|
47213
|
-
var dataToAnalyse = [].concat(data.flatMap(function (dataItem) {
|
|
47214
|
-
return keys.map(function (key) {
|
|
47215
|
-
return dataItem[key] ? new Date(dataItem[key].value).valueOf() : 0;
|
|
47216
|
-
});
|
|
47217
|
-
}));
|
|
47218
|
-
return {
|
|
47219
|
-
max: Math.max.apply(Math, dataToAnalyse),
|
|
47220
|
-
min: Math.min.apply(Math, dataToAnalyse)
|
|
47221
|
-
};
|
|
47222
|
-
} else if (dataType === 'number') {
|
|
47223
|
-
var _dataToAnalyse = [].concat(data.flatMap(function (dataItem) {
|
|
47224
|
-
return keys.map(function (key) {
|
|
47225
|
-
return dataItem[key] ? dataItem[key].value : 0;
|
|
47226
|
-
});
|
|
47227
|
-
}), goalLines ? goalLines.map(function (gL) {
|
|
47228
|
-
return gL.value;
|
|
47229
|
-
}) : []);
|
|
47230
|
-
return {
|
|
47231
|
-
max: Math.max.apply(Math, _dataToAnalyse),
|
|
47232
|
-
min: Math.min.apply(Math, _dataToAnalyse)
|
|
47233
|
-
};
|
|
47234
|
-
} else {
|
|
47235
|
-
return {
|
|
47236
|
-
max: null,
|
|
47237
|
-
min: null
|
|
47238
|
-
};
|
|
47239
|
-
}
|
|
47240
|
-
};
|
|
47241
|
-
|
|
47242
|
-
function getNiceInterval$1(interval) {
|
|
47243
|
-
var exponent = Math.floor(Math.log10(interval));
|
|
47244
|
-
var fraction = interval / Math.pow(10, exponent);
|
|
47245
|
-
var niceFraction;
|
|
47246
|
-
if (fraction <= 1) {
|
|
47247
|
-
niceFraction = 1;
|
|
47248
|
-
} else if (fraction <= 1.25) {
|
|
47249
|
-
niceFraction = 1.25;
|
|
47250
|
-
} else if (fraction <= 1.5) {
|
|
47251
|
-
niceFraction = 1.5;
|
|
47252
|
-
} else if (fraction <= 2) {
|
|
47253
|
-
niceFraction = 2;
|
|
47254
|
-
} else if (fraction <= 2.5) {
|
|
47255
|
-
niceFraction = 2.5;
|
|
47256
|
-
} else if (fraction <= 3) {
|
|
47257
|
-
niceFraction = 3;
|
|
47258
|
-
} else if (fraction <= 5) {
|
|
47259
|
-
niceFraction = 5;
|
|
47260
|
-
} else if (fraction <= 7) {
|
|
47261
|
-
niceFraction = 7;
|
|
47262
|
-
} else if (fraction <= 10) {
|
|
47263
|
-
niceFraction = 10;
|
|
47264
|
-
} else {
|
|
47265
|
-
niceFraction = 10;
|
|
47266
|
-
}
|
|
47267
|
-
return niceFraction * Math.pow(10, exponent);
|
|
47268
|
-
}
|
|
47269
|
-
var getScaleAndTicks$1 = function getScaleAndTicks(_ref) {
|
|
47270
|
-
var _order$;
|
|
47271
|
-
var data = _ref.data,
|
|
47272
|
-
xKey = _ref.xKey,
|
|
47273
|
-
yKeys = _ref.yKeys,
|
|
47274
|
-
xScaleDataType = _ref.xScaleDataType,
|
|
47275
|
-
nullValue = _ref.nullValue,
|
|
47276
|
-
tickCountYAxis = _ref.tickCountYAxis,
|
|
47277
|
-
formattingFunctionX = _ref.formattingFunctionX,
|
|
47278
|
-
formattingFunctionY = _ref.formattingFunctionY,
|
|
47279
|
-
order = _ref.order,
|
|
47280
|
-
goalLines = _ref.goalLines,
|
|
47281
|
-
stacked = _ref.stacked;
|
|
47282
|
-
var xTicks = [];
|
|
47283
|
-
var xScale = {
|
|
47284
|
-
dataType: xScaleDataType,
|
|
47285
|
-
key: xKey,
|
|
47286
|
-
ordering: ((_order$ = order[0]) == null ? void 0 : _order$.direction) || null
|
|
47287
|
-
};
|
|
47288
|
-
var x = getMinAndMax$1({
|
|
47289
|
-
data: data,
|
|
47290
|
-
keys: xScale.key === null ? [] : [xScale.key],
|
|
47291
|
-
dataType: xScale.dataType
|
|
47292
|
-
});
|
|
47293
|
-
if (xKey) {
|
|
47294
|
-
xTicks = data.map(function (dataItem) {
|
|
47295
|
-
var _dataItem$xKey, _dataItem$xScale$key, _dataItem$xScale$key2;
|
|
47296
|
-
var xValue = (_dataItem$xKey = dataItem[xKey]) != null && _dataItem$xKey.value ? dataItem[xKey].value : null;
|
|
47297
|
-
var xformattedValue = formattingFunctionX(xValue, nullValue);
|
|
47298
|
-
var xScaleValue = xScale.key !== null && (_dataItem$xScale$key = dataItem[xScale.key]) != null && _dataItem$xScale$key.value ? (_dataItem$xScale$key2 = dataItem[xScale.key]) == null ? void 0 : _dataItem$xScale$key2.value : '';
|
|
47299
|
-
var xScaleValueAdjusted = xScale.dataType === 'date_time' ? new Date(xScaleValue) : xScale.dataType === 'string' ? String(xScaleValue) : xScale.dataType === 'number' ? Number(xScaleValue) : xScaleValue;
|
|
47300
|
-
return {
|
|
47301
|
-
value: xValue !== null ? xValue : '',
|
|
47302
|
-
formattedValue: xformattedValue !== null ? "" + xformattedValue : null,
|
|
47303
|
-
scaleValue: xScaleValueAdjusted
|
|
47304
|
-
};
|
|
47305
|
-
});
|
|
47306
|
-
}
|
|
47307
|
-
// ----- Y Axis ("number") -----
|
|
47308
|
-
|
|
47309
|
-
var y = getMinAndMax$1({
|
|
47310
|
-
data: data,
|
|
47311
|
-
keys: yKeys,
|
|
47312
|
-
dataType: 'number',
|
|
47313
|
-
goalLines: goalLines,
|
|
47314
|
-
stacked: stacked
|
|
47315
|
-
});
|
|
47316
|
-
var maxY = y.max || 0;
|
|
47317
|
-
var minY = Math.min(y.min || 0, 0);
|
|
47318
|
-
var yTickInterval = getNiceInterval$1((maxY - minY) / (tickCountYAxis - 1));
|
|
47319
|
-
var yTicks = [];
|
|
47320
|
-
for (var i = 0; i < tickCountYAxis; i++) {
|
|
47321
|
-
var _value = minY + yTickInterval * i;
|
|
47322
|
-
var formattedValue = formattingFunctionY(_value, nullValue);
|
|
47323
|
-
yTicks.push({
|
|
47324
|
-
value: _value,
|
|
47325
|
-
formattedValue: formattedValue,
|
|
47326
|
-
scaleValue: _value
|
|
47327
|
-
});
|
|
47328
|
-
}
|
|
47329
|
-
return {
|
|
47330
|
-
x: {
|
|
47331
|
-
ticks: xTicks,
|
|
47332
|
-
scale: {
|
|
47333
|
-
dataType: xScale.dataType,
|
|
47334
|
-
max: x.max,
|
|
47335
|
-
min: x.min,
|
|
47336
|
-
key: xScale.key,
|
|
47337
|
-
ordering: xScale.ordering
|
|
47338
|
-
}
|
|
47339
|
-
},
|
|
47340
|
-
y: {
|
|
47341
|
-
ticks: yTicks,
|
|
47342
|
-
scale: {
|
|
47343
|
-
dataType: 'number',
|
|
47344
|
-
key: null,
|
|
47345
|
-
ordering: 'asc',
|
|
47346
|
-
max: maxY,
|
|
47347
|
-
min: minY
|
|
47348
|
-
}
|
|
47349
|
-
}
|
|
47350
|
-
};
|
|
47351
|
-
};
|
|
47352
|
-
|
|
47353
47573
|
function fillMissingKeysForChartData(data) {
|
|
47354
47574
|
var allKeys = new Set();
|
|
47355
47575
|
data.forEach(function (item) {
|
|
@@ -47443,15 +47663,6 @@ var buildBarChartRepresentation = function buildBarChartRepresentation(_ref) {
|
|
|
47443
47663
|
|
|
47444
47664
|
// ----- Formatting -----
|
|
47445
47665
|
|
|
47446
|
-
var formattingFunctionX = function formattingFunctionX(value) {
|
|
47447
|
-
if (!xKeyField) return '';
|
|
47448
|
-
return formattedResult.formatterFunc(value, {
|
|
47449
|
-
fieldId: xKeyField.fieldId,
|
|
47450
|
-
"function": xKeyField["function"],
|
|
47451
|
-
outputDataType: xKeyField.outputDataType
|
|
47452
|
-
}).formattedValue;
|
|
47453
|
-
};
|
|
47454
|
-
|
|
47455
47666
|
// (value: any, noValueReplacement?: string) => string;
|
|
47456
47667
|
var formattingFunctionY = function formattingFunctionY(value) {
|
|
47457
47668
|
// Use any y axis field as they are all formatted in the same way (for now...);
|
|
@@ -47495,13 +47706,15 @@ var buildBarChartRepresentation = function buildBarChartRepresentation(_ref) {
|
|
|
47495
47706
|
|
|
47496
47707
|
// ----- Ticks -----
|
|
47497
47708
|
|
|
47498
|
-
var ticks = getScaleAndTicks
|
|
47709
|
+
var ticks = getScaleAndTicks({
|
|
47499
47710
|
data: updatedData,
|
|
47500
47711
|
xKey: xKey,
|
|
47501
47712
|
xScaleDataType: xScaleDataType,
|
|
47502
47713
|
yKeys: yKeys,
|
|
47503
47714
|
tickCountYAxis: approxYAxisLabelCount,
|
|
47504
|
-
formattingFunctionX: formattingFunctionX
|
|
47715
|
+
formattingFunctionX: function formattingFunctionX$1(value) {
|
|
47716
|
+
return formattingFunctionX(value, formattedResult, xKeyField);
|
|
47717
|
+
},
|
|
47505
47718
|
formattingFunctionY: formattingFunctionY,
|
|
47506
47719
|
nullValue: nullValue,
|
|
47507
47720
|
order: order,
|
|
@@ -47713,7 +47926,7 @@ var BarChartV2View = function BarChartV2View(props) {
|
|
|
47713
47926
|
return jsx(BarChart$5, {
|
|
47714
47927
|
width: parent.width,
|
|
47715
47928
|
height: parent.height,
|
|
47716
|
-
chart: adjustTicks(chartRepresentation, parent.width),
|
|
47929
|
+
chart: adjustTicks(chartRepresentation, parent.width, parent.height),
|
|
47717
47930
|
options: {
|
|
47718
47931
|
stacked: !!props.attributes.stacked,
|
|
47719
47932
|
removeStroke: false,
|
|
@@ -47721,8 +47934,7 @@ var BarChartV2View = function BarChartV2View(props) {
|
|
|
47721
47934
|
showLegend: props.attributes.legend,
|
|
47722
47935
|
axis: {
|
|
47723
47936
|
showXAxisLabels: props.attributes.approxXAxisLabelCount !== 0,
|
|
47724
|
-
|
|
47725
|
-
showYAxisLabels: props.attributes.approxYAxisLabelCount !== 0 // shared-ui/src/library/StylePanel/AxisPreferenceSection.tsx
|
|
47937
|
+
showYAxisLabels: props.attributes.approxYAxisLabelCount !== 0
|
|
47726
47938
|
}
|
|
47727
47939
|
},
|
|
47728
47940
|
theme: theme == null ? void 0 : theme.charts,
|
|
@@ -47811,30 +48023,30 @@ function getBarFill$1(bars, conditionalFormattingRules, barKey, barValues) {
|
|
|
47811
48023
|
return fill;
|
|
47812
48024
|
}
|
|
47813
48025
|
|
|
47814
|
-
var ASSUMED_AVERAGE_CHAR_WIDTH$
|
|
47815
|
-
function calculateWordWidth$
|
|
48026
|
+
var ASSUMED_AVERAGE_CHAR_WIDTH$1 = 8.8;
|
|
48027
|
+
function calculateWordWidth$1(word, avgCharWidth) {
|
|
47816
48028
|
if (avgCharWidth === void 0) {
|
|
47817
|
-
avgCharWidth = ASSUMED_AVERAGE_CHAR_WIDTH$
|
|
48029
|
+
avgCharWidth = ASSUMED_AVERAGE_CHAR_WIDTH$1;
|
|
47818
48030
|
}
|
|
47819
48031
|
return word.length * avgCharWidth;
|
|
47820
48032
|
}
|
|
47821
48033
|
|
|
47822
48034
|
/** Reduce width proportionally to simulate spacing / padding between ticks. */
|
|
47823
|
-
var widthWithSpacing$
|
|
48035
|
+
var widthWithSpacing$1 = function widthWithSpacing(width) {
|
|
47824
48036
|
var THIRTY_PERCENT = 0.3;
|
|
47825
48037
|
return width - width * THIRTY_PERCENT;
|
|
47826
48038
|
};
|
|
47827
|
-
function howManyTicksFitInWidth$
|
|
48039
|
+
function howManyTicksFitInWidth$1(ticks, maxWidth, avgCharWidth) {
|
|
47828
48040
|
if (avgCharWidth === void 0) {
|
|
47829
|
-
avgCharWidth = ASSUMED_AVERAGE_CHAR_WIDTH$
|
|
48041
|
+
avgCharWidth = ASSUMED_AVERAGE_CHAR_WIDTH$1;
|
|
47830
48042
|
}
|
|
47831
48043
|
var fittedTicks = [];
|
|
47832
48044
|
var currentWidth = 0;
|
|
47833
48045
|
for (var _iterator = _createForOfIteratorHelperLoose(ticks), _step; !(_step = _iterator()).done;) {
|
|
47834
48046
|
var tick = _step.value;
|
|
47835
48047
|
var word = (tick == null ? void 0 : tick.formattedValue) || '';
|
|
47836
|
-
var wordWidth = calculateWordWidth$
|
|
47837
|
-
if (currentWidth + wordWidth <= widthWithSpacing$
|
|
48048
|
+
var wordWidth = calculateWordWidth$1(word, avgCharWidth);
|
|
48049
|
+
if (currentWidth + wordWidth <= widthWithSpacing$1(maxWidth)) {
|
|
47838
48050
|
fittedTicks.push(tick);
|
|
47839
48051
|
currentWidth += wordWidth + avgCharWidth; // Add space between words
|
|
47840
48052
|
} else {
|
|
@@ -47843,7 +48055,7 @@ function howManyTicksFitInWidth$2(ticks, maxWidth, avgCharWidth) {
|
|
|
47843
48055
|
}
|
|
47844
48056
|
return fittedTicks.length;
|
|
47845
48057
|
}
|
|
47846
|
-
function pickEquallySpaced$
|
|
48058
|
+
function pickEquallySpaced$1(arr, numPicks) {
|
|
47847
48059
|
if (numPicks >= arr.length) {
|
|
47848
48060
|
return arr; // If numPicks is greater than or equal to the array length, return the whole array
|
|
47849
48061
|
}
|
|
@@ -47855,19 +48067,19 @@ function pickEquallySpaced$2(arr, numPicks) {
|
|
|
47855
48067
|
}
|
|
47856
48068
|
return result;
|
|
47857
48069
|
}
|
|
47858
|
-
var adjustTicks$
|
|
48070
|
+
var adjustTicks$1 = function adjustTicks(waterfallChartRepresentation, width) {
|
|
47859
48071
|
waterfallChartRepresentation = cloneDeep(waterfallChartRepresentation);
|
|
47860
48072
|
|
|
47861
48073
|
// TODO; take this from the theme override...
|
|
47862
|
-
var averageCharacterWidth = ASSUMED_AVERAGE_CHAR_WIDTH$
|
|
47863
|
-
var numberOfTicksFittingIntoSpace = howManyTicksFitInWidth$
|
|
48074
|
+
var averageCharacterWidth = ASSUMED_AVERAGE_CHAR_WIDTH$1;
|
|
48075
|
+
var numberOfTicksFittingIntoSpace = howManyTicksFitInWidth$1(waterfallChartRepresentation.x.ticks || [], width, averageCharacterWidth);
|
|
47864
48076
|
var MINIMUM_NUMBER_OF_TICKS = 2;
|
|
47865
48077
|
if (numberOfTicksFittingIntoSpace < MINIMUM_NUMBER_OF_TICKS) {
|
|
47866
48078
|
numberOfTicksFittingIntoSpace = MINIMUM_NUMBER_OF_TICKS;
|
|
47867
48079
|
}
|
|
47868
48080
|
|
|
47869
48081
|
// @ts-ignore
|
|
47870
|
-
waterfallChartRepresentation.x.ticks = pickEquallySpaced$
|
|
48082
|
+
waterfallChartRepresentation.x.ticks = pickEquallySpaced$1(waterfallChartRepresentation.x.ticks, numberOfTicksFittingIntoSpace);
|
|
47871
48083
|
return waterfallChartRepresentation;
|
|
47872
48084
|
};
|
|
47873
48085
|
|
|
@@ -48115,7 +48327,7 @@ var WaterfallChart$2 = function WaterfallChart(_ref) {
|
|
|
48115
48327
|
keys: [y.key]
|
|
48116
48328
|
});
|
|
48117
48329
|
var adjustedChartRepresentation = useMemo(function () {
|
|
48118
|
-
return adjustTicks$
|
|
48330
|
+
return adjustTicks$1(_extends({}, chartCopy), width);
|
|
48119
48331
|
}, [chartCopy, width]);
|
|
48120
48332
|
var formattedChartDataForBarChart = _extends({}, adjustedChartRepresentation, {
|
|
48121
48333
|
y: formattedYAxisForBarChart,
|
|
@@ -48389,7 +48601,7 @@ var Bar$1 = function Bar(_ref4) {
|
|
|
48389
48601
|
});
|
|
48390
48602
|
};
|
|
48391
48603
|
|
|
48392
|
-
function getNiceInterval$
|
|
48604
|
+
function getNiceInterval$1(interval) {
|
|
48393
48605
|
// Round the interval to a "nice" value (1, 2, 5, etc.)
|
|
48394
48606
|
var exponent = Math.floor(Math.log10(interval));
|
|
48395
48607
|
var fraction = interval / Math.pow(10, exponent);
|
|
@@ -48521,7 +48733,7 @@ var buildWaterfallChartRepresentation = function buildWaterfallChartRepresentati
|
|
|
48521
48733
|
outputDataType: nonPivotField.outputDataType
|
|
48522
48734
|
}).formattedValue;
|
|
48523
48735
|
};
|
|
48524
|
-
var yTickInterval = getNiceInterval$
|
|
48736
|
+
var yTickInterval = getNiceInterval$1((yMaxValue - yMinValue) / (approxYAxisLabelCount - 1));
|
|
48525
48737
|
for (var i = 0; i < approxYAxisLabelCount; i++) {
|
|
48526
48738
|
var value = (yMinValue + i) * yTickInterval;
|
|
48527
48739
|
var formattedValue = formattingFunctionY(value);
|
|
@@ -48746,6 +48958,352 @@ var WaterfallChart$3 = function WaterfallChart(_ref) {
|
|
|
48746
48958
|
}));
|
|
48747
48959
|
};
|
|
48748
48960
|
|
|
48961
|
+
var buildAreaChartRepresentation = function buildAreaChartRepresentation(_ref) {
|
|
48962
|
+
var _xKeys$, _axisTitles$x, _axisTitles$y;
|
|
48963
|
+
var axisTitles = _ref.axisTitles,
|
|
48964
|
+
colors = _ref.colors,
|
|
48965
|
+
conditionalFormattingAttributes = _ref.conditionalFormattingAttributes,
|
|
48966
|
+
dateTimeFormatOptions = _ref.dateTimeFormatOptions,
|
|
48967
|
+
defaultFormats = _ref.defaultFormats,
|
|
48968
|
+
goalLineAttributes = _ref.goalLineAttributes,
|
|
48969
|
+
nullValue = _ref.nullValue,
|
|
48970
|
+
numberFormatOptions = _ref.numberFormatOptions,
|
|
48971
|
+
order = _ref.order,
|
|
48972
|
+
pivotConfig = _ref.pivotConfig,
|
|
48973
|
+
result = _ref.result,
|
|
48974
|
+
xAxisFormat = _ref.xAxisFormat,
|
|
48975
|
+
xAxisPostfix = _ref.xAxisPostfix,
|
|
48976
|
+
xAxisPrefix = _ref.xAxisPrefix,
|
|
48977
|
+
yAxisFormat = _ref.yAxisFormat,
|
|
48978
|
+
yAxisPostfix = _ref.yAxisPostfix,
|
|
48979
|
+
yAxisPrefix = _ref.yAxisPrefix,
|
|
48980
|
+
approxYAxisLabelCount = _ref.approxYAxisLabelCount,
|
|
48981
|
+
seriesLabelFormatter = _ref.seriesLabelFormatter,
|
|
48982
|
+
_valueAlias = _ref.valueAlias,
|
|
48983
|
+
stacked = _ref.stacked;
|
|
48984
|
+
var activeDateTimeFormats = {};
|
|
48985
|
+
var _buildFieldFormatMaps = buildFieldFormatMaps(result, pivotConfig, xAxisPrefix, xAxisPostfix, xAxisFormat, yAxisPrefix, yAxisPostfix, yAxisFormat, nullValue, numberFormatOptions),
|
|
48986
|
+
allPrefixes = _buildFieldFormatMaps.allPrefixes,
|
|
48987
|
+
allPostfixes = _buildFieldFormatMaps.allPostfixes,
|
|
48988
|
+
nullValues = _buildFieldFormatMaps.nullValues,
|
|
48989
|
+
activeNumberFormats = _buildFieldFormatMaps.activeNumberFormats;
|
|
48990
|
+
|
|
48991
|
+
// Build params for the result formatter.
|
|
48992
|
+
var params = {
|
|
48993
|
+
defaultFormats: defaultFormats,
|
|
48994
|
+
dateTimeFormatOptions: dateTimeFormatOptions,
|
|
48995
|
+
numberFormatOptions: numberFormatOptions,
|
|
48996
|
+
valueAlias: function valueAlias(params) {
|
|
48997
|
+
if (typeof _valueAlias === 'function') {
|
|
48998
|
+
// TODO; it is more useful providing this information separate,
|
|
48999
|
+
// rather than building it into an ID and returning it. Ideally all would be returned
|
|
49000
|
+
return String(_valueAlias({
|
|
49001
|
+
fieldId: id({
|
|
49002
|
+
field: params.fieldId,
|
|
49003
|
+
"function": params["function"]
|
|
49004
|
+
}),
|
|
49005
|
+
value: params.value
|
|
49006
|
+
}));
|
|
49007
|
+
}
|
|
49008
|
+
return undefined;
|
|
49009
|
+
},
|
|
49010
|
+
nullValue: nullValues,
|
|
49011
|
+
prefixes: allPrefixes,
|
|
49012
|
+
postfixes: allPostfixes,
|
|
49013
|
+
activeNumberFormats: activeNumberFormats,
|
|
49014
|
+
activeDateTimeFormats: activeDateTimeFormats
|
|
49015
|
+
};
|
|
49016
|
+
var formattedResult = formatResult(result, params);
|
|
49017
|
+
|
|
49018
|
+
// --------------------------------------------
|
|
49019
|
+
// --------------------------------------------
|
|
49020
|
+
// --------------------------------------------
|
|
49021
|
+
// --------------------------------------------
|
|
49022
|
+
// --------------------------------------------
|
|
49023
|
+
// --------------------------------------------
|
|
49024
|
+
// --------------------------------------------
|
|
49025
|
+
// --------------------------------------------
|
|
49026
|
+
|
|
49027
|
+
// ----- xKey -----
|
|
49028
|
+
|
|
49029
|
+
var xKeyField = getXKeyField(pivotConfig, result.fields);
|
|
49030
|
+
|
|
49031
|
+
// ----- Formatting ----
|
|
49032
|
+
// (value: any, noValueReplacement?: string) => string;
|
|
49033
|
+
var formattingFunctionY = function formattingFunctionY(value) {
|
|
49034
|
+
// Use any y axis field as they are all formatted in the same way (for now...);
|
|
49035
|
+
var nonPivotField = formattedResult.fields.find(function (resultField) {
|
|
49036
|
+
return ![].concat(pivotConfig.x, pivotConfig.y).includes(resultField.id);
|
|
49037
|
+
});
|
|
49038
|
+
if (!nonPivotField) return '';
|
|
49039
|
+
return formattedResult.formatterFunc(value, {
|
|
49040
|
+
fieldId: nonPivotField.fieldId,
|
|
49041
|
+
"function": nonPivotField["function"],
|
|
49042
|
+
outputDataType: nonPivotField.outputDataType
|
|
49043
|
+
}).formattedValue;
|
|
49044
|
+
};
|
|
49045
|
+
|
|
49046
|
+
// ----- Keys & Prep -----
|
|
49047
|
+
var xScaleDataType = (xKeyField == null ? void 0 : xKeyField.outputDataType) || 'string';
|
|
49048
|
+
var _formattedResultToSer = formattedResultToSeries(formattedResult, pivotConfig, seriesLabelFormatter),
|
|
49049
|
+
keys = _formattedResultToSer.keys,
|
|
49050
|
+
yKeys = _formattedResultToSer.yKeys,
|
|
49051
|
+
xKeys = _formattedResultToSer.xKeys,
|
|
49052
|
+
chartData = _formattedResultToSer.seriesData;
|
|
49053
|
+
var xKey = (_xKeys$ = xKeys[0]) != null ? _xKeys$ : null;
|
|
49054
|
+
var updatedData = function () {
|
|
49055
|
+
var hasMultipleGroups = result.fields.length > 2;
|
|
49056
|
+
var data = chartData;
|
|
49057
|
+
if (hasMultipleGroups) {
|
|
49058
|
+
data = fillMissingKeysForChartData(chartData);
|
|
49059
|
+
}
|
|
49060
|
+
if (stacked) {
|
|
49061
|
+
data = fillMissingKeysForChartData(data);
|
|
49062
|
+
}
|
|
49063
|
+
return data;
|
|
49064
|
+
}();
|
|
49065
|
+
|
|
49066
|
+
// ----- Goal Lines -----
|
|
49067
|
+
|
|
49068
|
+
var goalLines = getGoalLines({
|
|
49069
|
+
goalLineAttributes: goalLineAttributes,
|
|
49070
|
+
formattingFunctionY: formattingFunctionY
|
|
49071
|
+
});
|
|
49072
|
+
|
|
49073
|
+
// ----- Ticks -----
|
|
49074
|
+
|
|
49075
|
+
var ticks = getScaleAndTicks({
|
|
49076
|
+
data: updatedData,
|
|
49077
|
+
xKey: xKey,
|
|
49078
|
+
xScaleDataType: xScaleDataType,
|
|
49079
|
+
yKeys: yKeys,
|
|
49080
|
+
tickCountYAxis: approxYAxisLabelCount,
|
|
49081
|
+
formattingFunctionX: function formattingFunctionX$1(value) {
|
|
49082
|
+
return formattingFunctionX(value, formattedResult, xKeyField);
|
|
49083
|
+
},
|
|
49084
|
+
formattingFunctionY: formattingFunctionY,
|
|
49085
|
+
nullValue: nullValue,
|
|
49086
|
+
order: order,
|
|
49087
|
+
goalLines: goalLines
|
|
49088
|
+
});
|
|
49089
|
+
|
|
49090
|
+
// ----- Lines -----
|
|
49091
|
+
|
|
49092
|
+
var styleDefinition = getStyleDefinition({
|
|
49093
|
+
colors: colors,
|
|
49094
|
+
yKeys: yKeys,
|
|
49095
|
+
style: {
|
|
49096
|
+
toOpacity: 0.5,
|
|
49097
|
+
fromOpacity: 0.9,
|
|
49098
|
+
type: 'area'
|
|
49099
|
+
}
|
|
49100
|
+
});
|
|
49101
|
+
|
|
49102
|
+
// ----- Conditional Formatting -----
|
|
49103
|
+
|
|
49104
|
+
var conditionalFormattingRules = getConditionalFormatting({
|
|
49105
|
+
conditionalFormattingAttributes: conditionalFormattingAttributes
|
|
49106
|
+
});
|
|
49107
|
+
var chart = {
|
|
49108
|
+
keys: keys,
|
|
49109
|
+
x: {
|
|
49110
|
+
ticks: ticks.x.ticks,
|
|
49111
|
+
scale: {
|
|
49112
|
+
dataType: ticks.x.scale.dataType,
|
|
49113
|
+
key: ticks.x.scale.key,
|
|
49114
|
+
ordering: ticks.x.scale.ordering,
|
|
49115
|
+
min: ticks.x.scale.min,
|
|
49116
|
+
max: ticks.x.scale.max
|
|
49117
|
+
},
|
|
49118
|
+
key: xKey,
|
|
49119
|
+
postfix: xAxisPostfix,
|
|
49120
|
+
prefix: xAxisPrefix,
|
|
49121
|
+
title: (_axisTitles$x = axisTitles == null ? void 0 : axisTitles.x) != null ? _axisTitles$x : null
|
|
49122
|
+
},
|
|
49123
|
+
y: {
|
|
49124
|
+
ticks: ticks.y.ticks,
|
|
49125
|
+
scale: {
|
|
49126
|
+
dataType: ticks.y.scale.dataType,
|
|
49127
|
+
key: ticks.y.scale.key,
|
|
49128
|
+
ordering: ticks.y.scale.ordering,
|
|
49129
|
+
min: ticks.y.scale.min,
|
|
49130
|
+
max: ticks.y.scale.max
|
|
49131
|
+
},
|
|
49132
|
+
keys: yKeys,
|
|
49133
|
+
postfix: yAxisPostfix,
|
|
49134
|
+
prefix: yAxisPrefix,
|
|
49135
|
+
title: (_axisTitles$y = axisTitles == null ? void 0 : axisTitles.y) != null ? _axisTitles$y : null
|
|
49136
|
+
},
|
|
49137
|
+
data: updatedData,
|
|
49138
|
+
areas: styleDefinition,
|
|
49139
|
+
conditionalFormattingRules: conditionalFormattingRules,
|
|
49140
|
+
goalLines: goalLines
|
|
49141
|
+
};
|
|
49142
|
+
return chart;
|
|
49143
|
+
};
|
|
49144
|
+
|
|
49145
|
+
var AreaChartV2View = function AreaChartV2View(props) {
|
|
49146
|
+
var _props$library, _props$attributes$vie;
|
|
49147
|
+
var _useDashboardBehaviou = useDashboardBehaviourContext(),
|
|
49148
|
+
textOverride = _useDashboardBehaviou.textOverride,
|
|
49149
|
+
valueAlias = _useDashboardBehaviou.valueAlias,
|
|
49150
|
+
labelFormat = _useDashboardBehaviou.labelFormat,
|
|
49151
|
+
queryEngineConfig = _useDashboardBehaviou.queryEngineConfig;
|
|
49152
|
+
var headerProps = {
|
|
49153
|
+
displayTitle: props.attributes.displayTitle,
|
|
49154
|
+
displaySubject: props.attributes.displaySubject,
|
|
49155
|
+
verified: props.attributes.protectedByOrganisation,
|
|
49156
|
+
library: (_props$library = props.library) != null ? _props$library : false,
|
|
49157
|
+
localFilters: props.localFilters,
|
|
49158
|
+
setLocalFilters: props.setLocalFilters,
|
|
49159
|
+
dataSet: props.dataSet,
|
|
49160
|
+
parameters: props == null ? void 0 : props.attributes.parameters,
|
|
49161
|
+
componentType: props == null ? void 0 : props.attributes.type,
|
|
49162
|
+
measure: props == null ? void 0 : props.attributes.measure,
|
|
49163
|
+
dimension: props == null ? void 0 : props.attributes.dimension,
|
|
49164
|
+
timeDimension: props.attributes.timeDimension,
|
|
49165
|
+
setPartialAttributes: props.setPartialAttributes,
|
|
49166
|
+
viewId: (_props$attributes$vie = props == null ? void 0 : props.attributes.viewId) != null ? _props$attributes$vie : '',
|
|
49167
|
+
order: props.attributes.order
|
|
49168
|
+
};
|
|
49169
|
+
var showHeadline = headlineAvailable(props.attributes.order, props.attributes.headline, null);
|
|
49170
|
+
var theme = useTheme();
|
|
49171
|
+
var AreaChartV2Component = getComponentInterface(props.attributes.type);
|
|
49172
|
+
var pivotConfig = init$c(props.attributes);
|
|
49173
|
+
var chartRepresentation = null;
|
|
49174
|
+
if (!isLoading(props.result) && !hasFailed(props.result) && !isEmpty(props.result) && AreaChartV2Component.isRunnable(props.attributes)) {
|
|
49175
|
+
var _theme$charts$colors, _theme$charts, _props$attributes$goa;
|
|
49176
|
+
chartRepresentation = buildAreaChartRepresentation({
|
|
49177
|
+
axisTitles: props.attributes.axisTitles,
|
|
49178
|
+
xAxisPostfix: props.attributes.xAxisPostfix,
|
|
49179
|
+
xAxisPrefix: props.attributes.xAxisPrefix,
|
|
49180
|
+
yAxisPostfix: props.attributes.yAxisPostfix,
|
|
49181
|
+
yAxisPrefix: props.attributes.yAxisPrefix,
|
|
49182
|
+
yAxisFormat: props.attributes.yAxisFormat,
|
|
49183
|
+
xAxisFormat: props.attributes.xAxisFormat,
|
|
49184
|
+
approxYAxisLabelCount: props.attributes.approxYAxisLabelCount === 'auto' ? 10 : props.attributes.approxYAxisLabelCount,
|
|
49185
|
+
colors: (_theme$charts$colors = theme == null || (_theme$charts = theme.charts) == null ? void 0 : _theme$charts.colors) != null ? _theme$charts$colors : DEFAULT_CHART_COLORS,
|
|
49186
|
+
valueAlias: valueAlias,
|
|
49187
|
+
nullValue: checkForNullValue(props.attributes.dataSetId, props.attributes.dimension, props.attributes.timeDimension, textOverride, valueAlias),
|
|
49188
|
+
result: props.result,
|
|
49189
|
+
pivotConfig: pivotConfig,
|
|
49190
|
+
order: props.attributes.order,
|
|
49191
|
+
numberFormatOptions: props.numberFormatOptions,
|
|
49192
|
+
dateTimeFormatOptions: props.dateTimeFormatOptions,
|
|
49193
|
+
goalLineAttributes: (_props$attributes$goa = props.attributes.goalLines) != null ? _props$attributes$goa : [],
|
|
49194
|
+
conditionalFormattingAttributes: props.attributes.conditionalFormattingRules,
|
|
49195
|
+
defaultFormats: props.defaultFormats,
|
|
49196
|
+
seriesLabelFormatter: function seriesLabelFormatter(labelFormatParams) {
|
|
49197
|
+
var _queryEngineConfig$su, _queryEngineConfig$su2, _queryEngineConfig$su3;
|
|
49198
|
+
var yResultField = labelFormatParams.yResultField,
|
|
49199
|
+
yPivotFields = labelFormatParams.yPivotFields,
|
|
49200
|
+
row = labelFormatParams.row;
|
|
49201
|
+
var formattedFunctionName = ((_queryEngineConfig$su = queryEngineConfig.supportedAggregates[yResultField["function"]]) == null ? void 0 : _queryEngineConfig$su.publicName) || ((_queryEngineConfig$su2 = queryEngineConfig.supportedTimeTruncFunctions[yResultField["function"]]) == null ? void 0 : _queryEngineConfig$su2.publicName) || ((_queryEngineConfig$su3 = queryEngineConfig.supportedTransformationFunctions[yResultField["function"]]) == null ? void 0 : _queryEngineConfig$su3.publicName);
|
|
49202
|
+
var formattedFunction = yResultField["function"] === 'none' ? '' : " \u2022 " + formattedFunctionName;
|
|
49203
|
+
var defaultLabelFormat = "" + yPivotFields.map(function (field) {
|
|
49204
|
+
return row[field.id].formattedValue;
|
|
49205
|
+
}).join(' • ') + (yPivotFields.length === 0 ? '' : ' • ') + yResultField.publicName + formattedFunction;
|
|
49206
|
+
if (!labelFormat) return defaultLabelFormat;
|
|
49207
|
+
return labelFormat({
|
|
49208
|
+
viewId: props.attributes.viewId,
|
|
49209
|
+
fieldId: yResultField.fieldId,
|
|
49210
|
+
func: yResultField["function"],
|
|
49211
|
+
type: 'areaChartV2',
|
|
49212
|
+
defaultLabel: defaultLabelFormat
|
|
49213
|
+
}) || defaultLabelFormat;
|
|
49214
|
+
},
|
|
49215
|
+
stacked: props.attributes.stacked
|
|
49216
|
+
});
|
|
49217
|
+
}
|
|
49218
|
+
|
|
49219
|
+
// When these are triggered they don't render the chart after they're resolved, potentially because component did no re-render?
|
|
49220
|
+
if (!AreaChartV2Component.isRunnable(props.attributes)) {
|
|
49221
|
+
return jsx(QueryUnderConstructionNotice, {
|
|
49222
|
+
title: "Missing parameters"
|
|
49223
|
+
});
|
|
49224
|
+
}
|
|
49225
|
+
if (isLoading(props.result)) return jsx(LoadingComponent, {});
|
|
49226
|
+
if (hasFailed(props.result)) return jsx(FailedToLoadDataNotice, {});
|
|
49227
|
+
if (isEmpty(props.result)) return jsx(NoResultContentToShowNotice, _extends({}, headerProps));
|
|
49228
|
+
return jsx(Suspense, {
|
|
49229
|
+
fallback: jsx(LoadingComponent, {}),
|
|
49230
|
+
children: jsxs(ViewWrapper, {
|
|
49231
|
+
id: props.id,
|
|
49232
|
+
queriesAreChanging: props.queriesAreChanging,
|
|
49233
|
+
children: [jsx(ViewHeader, _extends({}, headerProps, {
|
|
49234
|
+
paddingBottom: showHeadline ? '0.5rem' : undefined
|
|
49235
|
+
})), showHeadline && jsx(HeadlineStats, _extends({}, props.propsForHeadline)), jsx("div", {
|
|
49236
|
+
className: styles({
|
|
49237
|
+
flex: '1',
|
|
49238
|
+
position: 'relative'
|
|
49239
|
+
}),
|
|
49240
|
+
"aria-disabled": props.library,
|
|
49241
|
+
children: chartRepresentation && jsx(ParentSize, {
|
|
49242
|
+
style: {
|
|
49243
|
+
position: 'absolute',
|
|
49244
|
+
width: '100%',
|
|
49245
|
+
height: '100%',
|
|
49246
|
+
overflowX: 'hidden'
|
|
49247
|
+
},
|
|
49248
|
+
children: function children(parent) {
|
|
49249
|
+
var _props$attributes$vie2, _props$attributes$sta;
|
|
49250
|
+
if (chartRepresentation.areas.length === 0) return jsx(LoadingComponent, {});
|
|
49251
|
+
return jsx(AreaChartV2$1, {
|
|
49252
|
+
width: parent.width,
|
|
49253
|
+
height: parent.height,
|
|
49254
|
+
chart: adjustTicks(chartRepresentation, parent.width, parent.height),
|
|
49255
|
+
uniqueId: (_props$attributes$vie2 = props.attributes.viewId) != null ? _props$attributes$vie2 : 'area-chart',
|
|
49256
|
+
options: {
|
|
49257
|
+
stacked: (_props$attributes$sta = props.attributes.stacked) != null ? _props$attributes$sta : false,
|
|
49258
|
+
curve: props.attributes.lineCurve,
|
|
49259
|
+
removeStroke: false,
|
|
49260
|
+
showRoundedTotal: false,
|
|
49261
|
+
showLegend: props.attributes.legend,
|
|
49262
|
+
axis: {
|
|
49263
|
+
showXAxisLabels: props.attributes.approxXAxisLabelCount !== 0,
|
|
49264
|
+
showYAxisLabels: props.attributes.approxYAxisLabelCount !== 0
|
|
49265
|
+
}
|
|
49266
|
+
},
|
|
49267
|
+
theme: theme == null ? void 0 : theme.charts
|
|
49268
|
+
});
|
|
49269
|
+
}
|
|
49270
|
+
})
|
|
49271
|
+
})]
|
|
49272
|
+
})
|
|
49273
|
+
});
|
|
49274
|
+
};
|
|
49275
|
+
|
|
49276
|
+
var AreaChartV2 = function AreaChartV2(props) {
|
|
49277
|
+
var _props$component = props.component,
|
|
49278
|
+
results = _props$component.results,
|
|
49279
|
+
attributes = _props$component.attributes,
|
|
49280
|
+
localFilters = _props$component.localFilters;
|
|
49281
|
+
var dashboardBehaviour = props.dashboardBehaviour;
|
|
49282
|
+
var _useComponentEffect = useComponentEffect(attributes, props.dataSet, dashboardBehaviour.queryEngineConfig, {
|
|
49283
|
+
localFilters: localFilters,
|
|
49284
|
+
globalFilters: props.globalFilters
|
|
49285
|
+
}, props.updateComponentAttributes, props.runQueriesCallback, props.setResults, dashboardBehaviour.variables),
|
|
49286
|
+
queriesAreChanging = _useComponentEffect.queriesAreChanging;
|
|
49287
|
+
return jsx(AreaChartV2View, {
|
|
49288
|
+
id: props.id,
|
|
49289
|
+
attributes: attributes,
|
|
49290
|
+
dataSet: props.dataSet,
|
|
49291
|
+
localFilters: props.component.localFilters,
|
|
49292
|
+
setLocalFilters: props.setLocalFilters,
|
|
49293
|
+
setPartialAttributes: function setPartialAttributes(changes) {
|
|
49294
|
+
return props.setPartialAttributes(changes);
|
|
49295
|
+
},
|
|
49296
|
+
result: results && results[0],
|
|
49297
|
+
queriesAreChanging: queriesAreChanging,
|
|
49298
|
+
numberFormatOptions: dashboardBehaviour.numberFormatOptions,
|
|
49299
|
+
dateTimeFormatOptions: dashboardBehaviour.dateTimeFormatOptions,
|
|
49300
|
+
defaultFormats: dashboardBehaviour.defaultFormats,
|
|
49301
|
+
propsForHeadline: props,
|
|
49302
|
+
idPrefix: props.idPrefix,
|
|
49303
|
+
library: props == null ? void 0 : props.library
|
|
49304
|
+
});
|
|
49305
|
+
};
|
|
49306
|
+
|
|
48749
49307
|
var Component = function Component(props) {
|
|
48750
49308
|
var _useDashboardContext = useDashboardContext(),
|
|
48751
49309
|
dashboard = _useDashboardContext.dashboard;
|
|
@@ -48888,7 +49446,7 @@ var Component = function Component(props) {
|
|
|
48888
49446
|
});
|
|
48889
49447
|
},
|
|
48890
49448
|
onError: dashboardBehaviour.onError,
|
|
48891
|
-
children: jsx(AreaChart$
|
|
49449
|
+
children: jsx(AreaChart$4, {
|
|
48892
49450
|
id: props.id,
|
|
48893
49451
|
setLocalFilters: props.setLocalFilters,
|
|
48894
49452
|
dataSet: dataSet,
|
|
@@ -48986,6 +49544,32 @@ var Component = function Component(props) {
|
|
|
48986
49544
|
})
|
|
48987
49545
|
});
|
|
48988
49546
|
}
|
|
49547
|
+
if (props.component.attributes.type == 'areaChartV2') {
|
|
49548
|
+
return jsx(ErrorBoundary, {
|
|
49549
|
+
renderOnError: function renderOnError(onManualRetry) {
|
|
49550
|
+
return jsx(ComponentErrorNotice, {
|
|
49551
|
+
onManualRetry: onManualRetry
|
|
49552
|
+
});
|
|
49553
|
+
},
|
|
49554
|
+
onError: dashboardBehaviour.onError,
|
|
49555
|
+
children: jsx(AreaChartV2, {
|
|
49556
|
+
id: props.id,
|
|
49557
|
+
setLocalFilters: props.setLocalFilters,
|
|
49558
|
+
dataSet: dataSet,
|
|
49559
|
+
updateComponentAttributes: function updateComponentAttributes(newAttributes) {
|
|
49560
|
+
return _updateComponentAttributes(newAttributes);
|
|
49561
|
+
},
|
|
49562
|
+
runQueriesCallback: props.runQueriesCallback,
|
|
49563
|
+
component: props.component,
|
|
49564
|
+
setResults: props.setResults,
|
|
49565
|
+
globalFilters: dashboard.globalFilters,
|
|
49566
|
+
dashboardBehaviour: dashboardBehaviour,
|
|
49567
|
+
library: props == null ? void 0 : props.library,
|
|
49568
|
+
idPrefix: idPrefix,
|
|
49569
|
+
setPartialAttributes: setPartialAttributes
|
|
49570
|
+
})
|
|
49571
|
+
});
|
|
49572
|
+
}
|
|
48989
49573
|
if (props.component.attributes.type == 'pieChart') {
|
|
48990
49574
|
return jsx(ErrorBoundary, {
|
|
48991
49575
|
renderOnError: function renderOnError(onManualRetry) {
|
|
@@ -65398,7 +65982,7 @@ var View$3 = /*#__PURE__*/function () {
|
|
|
65398
65982
|
};
|
|
65399
65983
|
return View;
|
|
65400
65984
|
}();
|
|
65401
|
-
var AreaChart$
|
|
65985
|
+
var AreaChart$5 = /*#__PURE__*/function (_View2) {
|
|
65402
65986
|
function AreaChart(attributes) {
|
|
65403
65987
|
return _View2.call(this, _extends({}, attributes, {
|
|
65404
65988
|
type: 'areaChart'
|
|
@@ -65767,6 +66351,8 @@ var toQueries$9 = commonToQueries;
|
|
|
65767
66351
|
|
|
65768
66352
|
var toQueries$a = commonToQueries;
|
|
65769
66353
|
|
|
66354
|
+
var toQueries$b = commonToQueries;
|
|
66355
|
+
|
|
65770
66356
|
var buildMainQueries = function buildMainQueries(attributes, dataSet, queryEngineConfig, params) {
|
|
65771
66357
|
var line = build$a(dataSet, attributes.lineMeasure, attributes.order, attributes.lineDimension, attributes.timeDimension, attributes.limit, attributes.offset, queryEngineConfig, params);
|
|
65772
66358
|
var bar = build$a(dataSet, attributes.barMeasure, attributes.order, attributes.barDimension, attributes.timeDimension, attributes.limit, attributes.offset, queryEngineConfig, params);
|
|
@@ -65775,7 +66361,7 @@ var buildMainQueries = function buildMainQueries(attributes, dataSet, queryEngin
|
|
|
65775
66361
|
line: line
|
|
65776
66362
|
};
|
|
65777
66363
|
};
|
|
65778
|
-
var toQueries$
|
|
66364
|
+
var toQueries$c = function toQueries(attributes, dataSet, queryEngineConfig, params) {
|
|
65779
66365
|
var _buildMainQueries = buildMainQueries(attributes, dataSet, queryEngineConfig, params),
|
|
65780
66366
|
line = _buildMainQueries.line,
|
|
65781
66367
|
bar = _buildMainQueries.bar;
|
|
@@ -65833,7 +66419,7 @@ var buildQueries = function buildQueries(attributes, dataSet, queryEngineConfig,
|
|
|
65833
66419
|
measureDescription: deltaQuery ? [mainQuery.measureDescription, deltaQuery.measureDescription] : [mainQuery.measureDescription]
|
|
65834
66420
|
};
|
|
65835
66421
|
};
|
|
65836
|
-
var toQueries$
|
|
66422
|
+
var toQueries$d = function toQueries(attributes, dataSet, queryEngineConfig, params) {
|
|
65837
66423
|
var _buildQueries = buildQueries(attributes, dataSet, queryEngineConfig, params),
|
|
65838
66424
|
queries = _buildQueries.queries,
|
|
65839
66425
|
measureDescription = _buildQueries.measureDescription;
|
|
@@ -65844,7 +66430,7 @@ var toQueries$c = function toQueries(attributes, dataSet, queryEngineConfig, par
|
|
|
65844
66430
|
};
|
|
65845
66431
|
};
|
|
65846
66432
|
|
|
65847
|
-
var toQueries$
|
|
66433
|
+
var toQueries$e = function toQueries(attributes, dataSet, queryEngineConfig, params) {
|
|
65848
66434
|
var measures = [];
|
|
65849
66435
|
attributes.xMeasure && measures.push(attributes.xMeasure);
|
|
65850
66436
|
attributes.yMeasure && measures.push(attributes.yMeasure);
|
|
@@ -65858,7 +66444,7 @@ var toQueries$d = function toQueries(attributes, dataSet, queryEngineConfig, par
|
|
|
65858
66444
|
};
|
|
65859
66445
|
};
|
|
65860
66446
|
|
|
65861
|
-
var toQueries$
|
|
66447
|
+
var toQueries$f = function toQueries(attributes, dataSet, queryEngineConfig, params) {
|
|
65862
66448
|
var measures = [];
|
|
65863
66449
|
attributes.xMeasure && measures.push(attributes.xMeasure);
|
|
65864
66450
|
attributes.yMeasure && measures.push(attributes.yMeasure);
|
|
@@ -65872,7 +66458,7 @@ var toQueries$e = function toQueries(attributes, dataSet, queryEngineConfig, par
|
|
|
65872
66458
|
};
|
|
65873
66459
|
};
|
|
65874
66460
|
|
|
65875
|
-
var toQueries$
|
|
66461
|
+
var toQueries$g = function toQueries$1(attributes, dataSet, queryEngineConfig, params) {
|
|
65876
66462
|
return toQueries([dataSet], [{
|
|
65877
66463
|
measure: attributes.measure,
|
|
65878
66464
|
dataSetId: dataSet.id,
|
|
@@ -65884,12 +66470,12 @@ var toQueries$f = function toQueries$1(attributes, dataSet, queryEngineConfig, p
|
|
|
65884
66470
|
}], queryEngineConfig, params);
|
|
65885
66471
|
};
|
|
65886
66472
|
|
|
65887
|
-
var toQueries$g = commonToQueries;
|
|
65888
|
-
|
|
65889
66473
|
var toQueries$h = commonToQueries;
|
|
65890
66474
|
|
|
65891
66475
|
var toQueries$i = commonToQueries;
|
|
65892
66476
|
|
|
66477
|
+
var toQueries$j = commonToQueries;
|
|
66478
|
+
|
|
65893
66479
|
var buildVizzlyViewQueries = function buildVizzlyViewQueries(attributes, dataSet, queryEngineConfig, params) {
|
|
65894
66480
|
switch (attributes.type) {
|
|
65895
66481
|
case 'areaChart':
|
|
@@ -65904,30 +66490,32 @@ var buildVizzlyViewQueries = function buildVizzlyViewQueries(attributes, dataSet
|
|
|
65904
66490
|
return toQueries$6(attributes, dataSet, queryEngineConfig, params);
|
|
65905
66491
|
case 'lineChartV2':
|
|
65906
66492
|
return toQueries$7(attributes, dataSet, queryEngineConfig, params);
|
|
65907
|
-
case '
|
|
66493
|
+
case 'areaChartV2':
|
|
65908
66494
|
return toQueries$8(attributes, dataSet, queryEngineConfig, params);
|
|
65909
|
-
case '
|
|
66495
|
+
case 'pieChart':
|
|
65910
66496
|
return toQueries$9(attributes, dataSet, queryEngineConfig, params);
|
|
65911
|
-
case '
|
|
66497
|
+
case 'dataTable':
|
|
65912
66498
|
return toQueries$a(attributes, dataSet, queryEngineConfig, params);
|
|
65913
|
-
case '
|
|
66499
|
+
case 'basicTable':
|
|
65914
66500
|
return toQueries$b(attributes, dataSet, queryEngineConfig, params);
|
|
65915
|
-
case '
|
|
66501
|
+
case 'comboChart':
|
|
65916
66502
|
return toQueries$c(attributes, dataSet, queryEngineConfig, params);
|
|
66503
|
+
case 'singleStat':
|
|
66504
|
+
return toQueries$d(attributes, dataSet, queryEngineConfig, params);
|
|
65917
66505
|
case 'progress':
|
|
65918
|
-
return toQueries$c(attributes, dataSet, queryEngineConfig, params);
|
|
65919
|
-
case 'scatterChart':
|
|
65920
66506
|
return toQueries$d(attributes, dataSet, queryEngineConfig, params);
|
|
65921
|
-
case '
|
|
66507
|
+
case 'scatterChart':
|
|
65922
66508
|
return toQueries$e(attributes, dataSet, queryEngineConfig, params);
|
|
65923
|
-
case '
|
|
66509
|
+
case 'bubbleChart':
|
|
65924
66510
|
return toQueries$f(attributes, dataSet, queryEngineConfig, params);
|
|
65925
|
-
case '
|
|
66511
|
+
case 'mercatorMap':
|
|
65926
66512
|
return toQueries$g(attributes, dataSet, queryEngineConfig, params);
|
|
65927
|
-
case '
|
|
66513
|
+
case 'funnelChart':
|
|
65928
66514
|
return toQueries$h(attributes, dataSet, queryEngineConfig, params);
|
|
65929
|
-
case '
|
|
66515
|
+
case 'richText':
|
|
65930
66516
|
return toQueries$i(attributes, dataSet, queryEngineConfig, params);
|
|
66517
|
+
case 'waterfallChart':
|
|
66518
|
+
return toQueries$j(attributes, dataSet, queryEngineConfig, params);
|
|
65931
66519
|
default:
|
|
65932
66520
|
throw 'Unsupported view when building query.';
|
|
65933
66521
|
}
|
|
@@ -67475,7 +68063,7 @@ VizzlyServices.Dashboard = Dashboard$1;
|
|
|
67475
68063
|
VizzlyServices.Editor = Editor;
|
|
67476
68064
|
VizzlyServices.Header = Header;
|
|
67477
68065
|
VizzlyServices.Library = Library$1;
|
|
67478
|
-
VizzlyServices.AreaChart = AreaChart$
|
|
68066
|
+
VizzlyServices.AreaChart = AreaChart$5;
|
|
67479
68067
|
VizzlyServices.LineChart = LineChart$6;
|
|
67480
68068
|
VizzlyServices.BarChart = BarChart$6;
|
|
67481
68069
|
VizzlyServices.PieChart = PieChart$4;
|
|
@@ -68799,7 +69387,8 @@ var attributesToAiView = function attributesToAiView(dataSet, originalAttributes
|
|
|
68799
69387
|
if (attributes.type === 'richText') throw 'Rich text views are not supported by Vizzly AI.';
|
|
68800
69388
|
if (attributes.type === 'lineChartV2') throw 'Line Chart V2 views are not supported by Vizzly AI.';
|
|
68801
69389
|
if (attributes.type === 'bubbleChart') throw 'Bubble Chart views are not supported by Vizzly AI.';
|
|
68802
|
-
if (attributes.type === 'barChartV2') throw '
|
|
69390
|
+
if (attributes.type === 'barChartV2') throw 'Bar Chart V2 views are not supported by Vizzly AI.';
|
|
69391
|
+
if (attributes.type === 'areaChartV2') throw 'Area Chart V2 views are not supported by Vizzly AI.';
|
|
68803
69392
|
if (attributes.type === 'waterfallChart') throw 'Waterfall chart views are not supported by Vizzly AI.';
|
|
68804
69393
|
var select = [];
|
|
68805
69394
|
var group = [];
|