@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
|
@@ -64,6 +64,7 @@ var axis = require('@visx/axis');
|
|
|
64
64
|
var text$3 = require('@visx/text');
|
|
65
65
|
var grid = require('@visx/grid');
|
|
66
66
|
require('@visx/point');
|
|
67
|
+
var v2 = require('./charts/src/v2');
|
|
67
68
|
var VisibilitySensor = _interopDefault(require('react-visibility-sensor'));
|
|
68
69
|
var ExcelJS = _interopDefault(require('exceljs'));
|
|
69
70
|
var fileSaver = require('file-saver');
|
|
@@ -2731,6 +2732,7 @@ var timeDimensionQuerySchema = function timeDimensionQuerySchema(queryEngineConf
|
|
|
2731
2732
|
});
|
|
2732
2733
|
};
|
|
2733
2734
|
var lineCurveSchema = /*#__PURE__*/Joi.string().valid('natural', 'straight', 'step', 'stepBefore', 'stepAfter', 'dotted');
|
|
2735
|
+
var areaCurveSchema = /*#__PURE__*/Joi.string().valid('natural', 'straight', 'step');
|
|
2734
2736
|
var protectedFieldsMeasure = function protectedFieldsMeasure(queryEngineConfig) {
|
|
2735
2737
|
var _Joi$string6;
|
|
2736
2738
|
return Joi.array().items(Joi.object({
|
|
@@ -8171,7 +8173,7 @@ var RichText = function RichText(config) {
|
|
|
8171
8173
|
};
|
|
8172
8174
|
};
|
|
8173
8175
|
|
|
8174
|
-
var componentTypes = ['areaChart', 'barChart', 'basicTable', 'bubbleChart', 'comboChart', 'custom', 'dataTable', 'funnelChart', 'horizontalBarChart', 'lineChart', 'lineChartV2', 'barChartV2', 'mercatorMap', 'pieChart', 'progress', 'richText', 'scatterChart', 'singleStat', 'waterfallChart'];
|
|
8176
|
+
var componentTypes = ['areaChart', 'barChart', 'basicTable', 'bubbleChart', 'comboChart', 'custom', 'dataTable', 'funnelChart', 'horizontalBarChart', 'lineChart', 'lineChartV2', 'areaChartV2', 'barChartV2', 'mercatorMap', 'pieChart', 'progress', 'richText', 'scatterChart', 'singleStat', 'waterfallChart'];
|
|
8175
8177
|
/** @deprecated */
|
|
8176
8178
|
|
|
8177
8179
|
var ProgressType = /*#__PURE__*/function (ProgressType) {
|
|
@@ -8968,7 +8970,6 @@ var attributesSchema$e = function attributesSchema(config) {
|
|
|
8968
8970
|
var setAttributes$d = (function (config) {
|
|
8969
8971
|
return function (bubbleChart, partial) {
|
|
8970
8972
|
var newAttributes = setAttributes(bubbleChart, partial, attributesSchema$e(config));
|
|
8971
|
-
console.log(newAttributes, 'HERE');
|
|
8972
8973
|
var allowedOrderSpec = [];
|
|
8973
8974
|
if (newAttributes.xMeasure) {
|
|
8974
8975
|
allowedOrderSpec.push(newAttributes.xMeasure);
|
|
@@ -10019,6 +10020,379 @@ var WaterfallChart = function WaterfallChart(config) {
|
|
|
10019
10020
|
};
|
|
10020
10021
|
};
|
|
10021
10022
|
|
|
10023
|
+
var attributesSchema$h = function attributesSchema(config) {
|
|
10024
|
+
return Joi.object(_extends({}, baseAttributesSchema(config.attributesSchemaOptions), timeDimensionQuerySchema(config.queryEngineConfig, config.attributesSchemaOptions), {
|
|
10025
|
+
stacked: Joi.valid(true, false),
|
|
10026
|
+
legend: Joi.valid(true, false),
|
|
10027
|
+
type: Joi.valid('areaChartV2').required(),
|
|
10028
|
+
parameters: parametersSchema(config.queryEngineConfig, config.attributesSchemaOptions),
|
|
10029
|
+
lineCurve: areaCurveSchema,
|
|
10030
|
+
conditionalFormattingRules: conditionalFormattingRulesSchema(config.queryEngineConfig),
|
|
10031
|
+
goalLines: goalLinesSchema(),
|
|
10032
|
+
axisTitles: axisTitleSchema(),
|
|
10033
|
+
headline: headlineSchema(),
|
|
10034
|
+
tags: tagsSchema(),
|
|
10035
|
+
trends: trendsSchema()
|
|
10036
|
+
}));
|
|
10037
|
+
};
|
|
10038
|
+
|
|
10039
|
+
var setAttributes$g = (function (config) {
|
|
10040
|
+
return function (lineChart, partial) {
|
|
10041
|
+
var newAttributes = setAttributes(lineChart, partial, attributesSchema$h(config));
|
|
10042
|
+
newAttributes = removeUnusedOrderFieldsFromTimeSeriesComponent(newAttributes);
|
|
10043
|
+
return newAttributes;
|
|
10044
|
+
};
|
|
10045
|
+
});
|
|
10046
|
+
|
|
10047
|
+
var CONSTANTS$j = {
|
|
10048
|
+
title: 'Area chart',
|
|
10049
|
+
description: 'Ideal for illustrating changes and trends over time with area graphs.',
|
|
10050
|
+
namespace: 'area_chart',
|
|
10051
|
+
data_panel: {
|
|
10052
|
+
data_set: {
|
|
10053
|
+
type: 'dataSet',
|
|
10054
|
+
title: 'Data set',
|
|
10055
|
+
description: 'What data do you want to use in this area chart?'
|
|
10056
|
+
},
|
|
10057
|
+
views: {
|
|
10058
|
+
type: 'views',
|
|
10059
|
+
title: 'View',
|
|
10060
|
+
description: ''
|
|
10061
|
+
},
|
|
10062
|
+
field_y_axis: {
|
|
10063
|
+
type: 'fieldCollector',
|
|
10064
|
+
title: 'Metric - Y Axis',
|
|
10065
|
+
description: 'What do you want each area to measure?',
|
|
10066
|
+
callToAction: 'Add metric'
|
|
10067
|
+
},
|
|
10068
|
+
drilldown: {
|
|
10069
|
+
type: 'drilldown',
|
|
10070
|
+
title: 'Drilldown',
|
|
10071
|
+
description: 'After clicking on a segment of this area chart, what information do you want to see next?'
|
|
10072
|
+
},
|
|
10073
|
+
field_x_axis: {
|
|
10074
|
+
type: 'fieldCollector',
|
|
10075
|
+
title: 'Grouping - X Axis',
|
|
10076
|
+
description: 'What do you want each area to represent? An example might be a `product category` field to represent each category as a area.',
|
|
10077
|
+
callToAction: 'Add grouping'
|
|
10078
|
+
},
|
|
10079
|
+
sort: {
|
|
10080
|
+
type: 'sort',
|
|
10081
|
+
title: 'Sort',
|
|
10082
|
+
description: 'Select the order of categories or time on the x Axis.'
|
|
10083
|
+
},
|
|
10084
|
+
filter: {
|
|
10085
|
+
type: 'filter',
|
|
10086
|
+
title: 'Filters',
|
|
10087
|
+
description: 'Only include the information you want to use in this area chart.'
|
|
10088
|
+
},
|
|
10089
|
+
custom_metrics: {
|
|
10090
|
+
type: 'customMetrics',
|
|
10091
|
+
title: 'Custom metrics',
|
|
10092
|
+
description: 'Build your own metrics, such as a percentage.'
|
|
10093
|
+
},
|
|
10094
|
+
limit: {
|
|
10095
|
+
type: 'limit',
|
|
10096
|
+
title: 'Limit',
|
|
10097
|
+
description: 'Set the maximum number of records to show on this area chart.'
|
|
10098
|
+
}
|
|
10099
|
+
},
|
|
10100
|
+
format_panel: {
|
|
10101
|
+
heading: {
|
|
10102
|
+
type: 'heading',
|
|
10103
|
+
title: 'Heading',
|
|
10104
|
+
description: '',
|
|
10105
|
+
subSectionDefinition: {
|
|
10106
|
+
title: {
|
|
10107
|
+
type: 'title',
|
|
10108
|
+
title: 'Title',
|
|
10109
|
+
description: '',
|
|
10110
|
+
namespace: 'title'
|
|
10111
|
+
},
|
|
10112
|
+
subject: {
|
|
10113
|
+
title: 'Subject',
|
|
10114
|
+
type: 'subject',
|
|
10115
|
+
description: '',
|
|
10116
|
+
namespace: 'subject'
|
|
10117
|
+
}
|
|
10118
|
+
}
|
|
10119
|
+
},
|
|
10120
|
+
chart_styles: {
|
|
10121
|
+
type: 'chartStyles',
|
|
10122
|
+
title: 'Chart Settings',
|
|
10123
|
+
description: '',
|
|
10124
|
+
subSectionDefinition: {
|
|
10125
|
+
stacked: {
|
|
10126
|
+
type: 'stacked',
|
|
10127
|
+
title: 'Layout',
|
|
10128
|
+
description: '',
|
|
10129
|
+
namespace: 'stacked'
|
|
10130
|
+
},
|
|
10131
|
+
curve: {
|
|
10132
|
+
type: 'curve',
|
|
10133
|
+
title: 'Area Style',
|
|
10134
|
+
description: '',
|
|
10135
|
+
namespace: 'curve'
|
|
10136
|
+
},
|
|
10137
|
+
legend: {
|
|
10138
|
+
type: 'legend',
|
|
10139
|
+
title: 'Show Legend',
|
|
10140
|
+
description: '',
|
|
10141
|
+
namespace: 'legend'
|
|
10142
|
+
}
|
|
10143
|
+
}
|
|
10144
|
+
},
|
|
10145
|
+
axis_labels: {
|
|
10146
|
+
type: 'axisLabels',
|
|
10147
|
+
title: 'Axis Preferences',
|
|
10148
|
+
description: '',
|
|
10149
|
+
subSectionDefinition: {
|
|
10150
|
+
x: {
|
|
10151
|
+
title: 'X Axis',
|
|
10152
|
+
description: '',
|
|
10153
|
+
namespace: 'x'
|
|
10154
|
+
},
|
|
10155
|
+
'x.prefix': {
|
|
10156
|
+
title: 'Prefix',
|
|
10157
|
+
description: '',
|
|
10158
|
+
namespace: 'x.prefix'
|
|
10159
|
+
},
|
|
10160
|
+
'x.postfix': {
|
|
10161
|
+
title: 'Postfix',
|
|
10162
|
+
description: '',
|
|
10163
|
+
namespace: 'x.postfix'
|
|
10164
|
+
},
|
|
10165
|
+
'x.format': {
|
|
10166
|
+
title: 'Format',
|
|
10167
|
+
description: '',
|
|
10168
|
+
namespace: 'x.format'
|
|
10169
|
+
},
|
|
10170
|
+
'x.count': {
|
|
10171
|
+
title: 'Label count',
|
|
10172
|
+
description: '',
|
|
10173
|
+
namespace: 'x.count'
|
|
10174
|
+
},
|
|
10175
|
+
'x.axis_title': {
|
|
10176
|
+
title: 'Title',
|
|
10177
|
+
description: '',
|
|
10178
|
+
namespace: 'x.axis_title'
|
|
10179
|
+
},
|
|
10180
|
+
y: {
|
|
10181
|
+
title: 'Y Axis',
|
|
10182
|
+
description: '',
|
|
10183
|
+
namespace: 'y'
|
|
10184
|
+
},
|
|
10185
|
+
'y.prefix': {
|
|
10186
|
+
title: 'Prefix',
|
|
10187
|
+
description: '',
|
|
10188
|
+
namespace: 'y.prefix'
|
|
10189
|
+
},
|
|
10190
|
+
'y.postfix': {
|
|
10191
|
+
title: 'Postfix',
|
|
10192
|
+
description: '',
|
|
10193
|
+
namespace: 'y.postfix'
|
|
10194
|
+
},
|
|
10195
|
+
'y.format': {
|
|
10196
|
+
title: 'Format',
|
|
10197
|
+
description: '',
|
|
10198
|
+
namespace: 'y.format'
|
|
10199
|
+
},
|
|
10200
|
+
'y.count': {
|
|
10201
|
+
title: 'Label count',
|
|
10202
|
+
description: '',
|
|
10203
|
+
namespace: 'y.count'
|
|
10204
|
+
},
|
|
10205
|
+
'y.axis_title': {
|
|
10206
|
+
title: 'Title',
|
|
10207
|
+
description: '',
|
|
10208
|
+
namespace: 'y.axis_title'
|
|
10209
|
+
}
|
|
10210
|
+
}
|
|
10211
|
+
},
|
|
10212
|
+
conditional_formatting: {
|
|
10213
|
+
type: 'conditionalFormatting',
|
|
10214
|
+
title: 'Conditional Formatting',
|
|
10215
|
+
description: ''
|
|
10216
|
+
},
|
|
10217
|
+
headline: {
|
|
10218
|
+
type: 'headline',
|
|
10219
|
+
title: 'Headarea',
|
|
10220
|
+
description: ''
|
|
10221
|
+
},
|
|
10222
|
+
trends: {
|
|
10223
|
+
type: 'trends',
|
|
10224
|
+
title: 'Trend lines',
|
|
10225
|
+
description: 'Specify a trend type for the area chart.'
|
|
10226
|
+
},
|
|
10227
|
+
goal_line: {
|
|
10228
|
+
type: 'goalLine',
|
|
10229
|
+
title: 'Goal lines',
|
|
10230
|
+
description: ''
|
|
10231
|
+
}
|
|
10232
|
+
}
|
|
10233
|
+
};
|
|
10234
|
+
|
|
10235
|
+
var AreaChart$1 = function AreaChart(config) {
|
|
10236
|
+
return {
|
|
10237
|
+
title: 'Area chart V2',
|
|
10238
|
+
description: 'Ideal for illustrating changes and trends over time with area graphs.',
|
|
10239
|
+
servicesClass: 'AreaChart',
|
|
10240
|
+
namespace: 'area_chart',
|
|
10241
|
+
dump: function dump(hydrated) {
|
|
10242
|
+
return hydrated;
|
|
10243
|
+
},
|
|
10244
|
+
load: function load(dumped) {
|
|
10245
|
+
var _dumped$tags, _dumped$trends;
|
|
10246
|
+
return {
|
|
10247
|
+
type: dumped.type,
|
|
10248
|
+
measure: upcastMeasure(dumped.measure),
|
|
10249
|
+
order: upcastOrder(dumped.order, dumped.timeDimension),
|
|
10250
|
+
dimension: upcastStringDimensionsToObject(dumped.dimension),
|
|
10251
|
+
// TODO: upcast dumped.timeDimension -> dimension
|
|
10252
|
+
displayTitle: dumped.displayTitle,
|
|
10253
|
+
displaySubject: dumped.displaySubject,
|
|
10254
|
+
protectedByOrganisation: dumped.protectedByOrganisation,
|
|
10255
|
+
viewId: upcastViewId(dumped.viewId),
|
|
10256
|
+
filter: upcastFilter(dumped.filter),
|
|
10257
|
+
dataSetId: dumped.dataSetId,
|
|
10258
|
+
limit: dumped.limit,
|
|
10259
|
+
timeDimension: null,
|
|
10260
|
+
xAxisPostfix: dumped.xAxisPostfix,
|
|
10261
|
+
xAxisPrefix: dumped.xAxisPrefix,
|
|
10262
|
+
yAxisPostfix: dumped.yAxisPostfix,
|
|
10263
|
+
yAxisPrefix: dumped.yAxisPrefix,
|
|
10264
|
+
yAxisFormat: dumped.yAxisFormat,
|
|
10265
|
+
xAxisFormat: dumped.xAxisFormat,
|
|
10266
|
+
lineCurve: dumped.lineCurve,
|
|
10267
|
+
conditionalFormattingRules: upcast$1(config.queryEngineConfig, dumped.conditionalFormattingRules),
|
|
10268
|
+
drilldown: dumped.drilldown,
|
|
10269
|
+
legend: dumped.legend,
|
|
10270
|
+
goalLines: dumped.goalLines,
|
|
10271
|
+
headline: upcastHeadline(dumped.headline, dumped.timeDimension),
|
|
10272
|
+
parameters: upcastParameters(dumped.parameters),
|
|
10273
|
+
approxXAxisLabelCount: upcastAxisLabel(dumped.approxXAxisLabelCount),
|
|
10274
|
+
approxYAxisLabelCount: upcastAxisLabel(dumped.approxYAxisLabelCount),
|
|
10275
|
+
axisTitles: dumped.axisTitles,
|
|
10276
|
+
tags: (_dumped$tags = dumped.tags) != null ? _dumped$tags : [],
|
|
10277
|
+
trends: (_dumped$trends = dumped.trends) != null ? _dumped$trends : [],
|
|
10278
|
+
stacked: dumped.stacked
|
|
10279
|
+
};
|
|
10280
|
+
},
|
|
10281
|
+
setAttributes: setAttributes$g(config),
|
|
10282
|
+
validate: function validate(attrs, dataSets) {
|
|
10283
|
+
return validateView(attrs, dataSets, config.queryEngineConfig);
|
|
10284
|
+
},
|
|
10285
|
+
init: function init(dataSetId, overrides) {
|
|
10286
|
+
return _extends({
|
|
10287
|
+
type: 'areaChartV2',
|
|
10288
|
+
measure: [],
|
|
10289
|
+
dimension: [],
|
|
10290
|
+
timeDimension: null,
|
|
10291
|
+
displayTitle: '',
|
|
10292
|
+
displaySubject: '',
|
|
10293
|
+
protectedByOrganisation: undefined,
|
|
10294
|
+
viewId: upcastViewId(overrides == null ? void 0 : overrides.viewId),
|
|
10295
|
+
filter: [],
|
|
10296
|
+
order: [],
|
|
10297
|
+
dataSetId: dataSetId,
|
|
10298
|
+
limit: 5000,
|
|
10299
|
+
xAxisPostfix: '',
|
|
10300
|
+
xAxisPrefix: '',
|
|
10301
|
+
yAxisPostfix: '',
|
|
10302
|
+
yAxisPrefix: '',
|
|
10303
|
+
yAxisFormat: null,
|
|
10304
|
+
xAxisFormat: null,
|
|
10305
|
+
lineCurve: 'natural',
|
|
10306
|
+
conditionalFormattingRules: [],
|
|
10307
|
+
drilldown: [],
|
|
10308
|
+
legend: true,
|
|
10309
|
+
goalLines: undefined,
|
|
10310
|
+
approxXAxisLabelCount: 'auto',
|
|
10311
|
+
approxYAxisLabelCount: 'auto',
|
|
10312
|
+
parameters: {},
|
|
10313
|
+
axisTitles: undefined,
|
|
10314
|
+
headline: undefined,
|
|
10315
|
+
tags: [],
|
|
10316
|
+
trends: [],
|
|
10317
|
+
stacked: false
|
|
10318
|
+
}, overrides);
|
|
10319
|
+
},
|
|
10320
|
+
createFeedback: createFeedback,
|
|
10321
|
+
schema: attributesSchema$h(config),
|
|
10322
|
+
removeField: function removeField(attrs, fieldId) {
|
|
10323
|
+
return removeField$1(attrs, fieldId, config.queryEngineConfig);
|
|
10324
|
+
},
|
|
10325
|
+
isRunnable: function isRunnable(hydrated) {
|
|
10326
|
+
return hydrated.measure.length > 0 && hydrated.dimension.length > 0;
|
|
10327
|
+
},
|
|
10328
|
+
autoGenerate: function autoGenerate(dataSet) {
|
|
10329
|
+
var _DataSet$buildQueryAt = buildQueryAttributes(dataSet, config.queryEngineConfig, 'lineChart'),
|
|
10330
|
+
measure = _DataSet$buildQueryAt.measure,
|
|
10331
|
+
dimension = _DataSet$buildQueryAt.dimension;
|
|
10332
|
+
return this.init(dataSet.id, {
|
|
10333
|
+
measure: [measure[0]],
|
|
10334
|
+
dimension: dimension
|
|
10335
|
+
});
|
|
10336
|
+
},
|
|
10337
|
+
dataPanelConfig: function dataPanelConfig() {
|
|
10338
|
+
return [namespace(CONSTANTS$j, 'data_set'), namespace(CONSTANTS$j, 'views'), _extends({}, namespace(CONSTANTS$j, 'field_y_axis'), {
|
|
10339
|
+
fieldFilterOptions: {
|
|
10340
|
+
forComponent: 'lineChart'
|
|
10341
|
+
},
|
|
10342
|
+
preSetPartialAttributes: function preSetPartialAttributes(values) {
|
|
10343
|
+
return {
|
|
10344
|
+
measure: values
|
|
10345
|
+
};
|
|
10346
|
+
},
|
|
10347
|
+
getValues: function getValues(attrs) {
|
|
10348
|
+
return attrs.measure;
|
|
10349
|
+
},
|
|
10350
|
+
testId: 'metric-input'
|
|
10351
|
+
}), _extends({}, namespace(CONSTANTS$j, 'field_x_axis'), {
|
|
10352
|
+
fieldFilterOptions: {
|
|
10353
|
+
forComponent: 'lineChart',
|
|
10354
|
+
onlyDimensions: true
|
|
10355
|
+
},
|
|
10356
|
+
preventDuplicates: false,
|
|
10357
|
+
// return all values in the dimension array instead of seperating out timeDimension
|
|
10358
|
+
preSetPartialAttributes: function preSetPartialAttributes(values) {
|
|
10359
|
+
return {
|
|
10360
|
+
dimension: [].concat(values)
|
|
10361
|
+
};
|
|
10362
|
+
},
|
|
10363
|
+
// does this need to be updated too?
|
|
10364
|
+
getValues: function getValues(attrs) {
|
|
10365
|
+
return [].concat(attrs.dimension);
|
|
10366
|
+
},
|
|
10367
|
+
maxAllowed: 2,
|
|
10368
|
+
testId: 'add-dimension'
|
|
10369
|
+
}), namespace(CONSTANTS$j, 'sort'), namespace(CONSTANTS$j, 'filter'), namespace(CONSTANTS$j, 'custom_metrics'), namespace(CONSTANTS$j, 'limit')];
|
|
10370
|
+
},
|
|
10371
|
+
formatPanelConfig: function formatPanelConfig() {
|
|
10372
|
+
return [headingConstant(CONSTANTS$j), chartStylesConstant(CONSTANTS$j, true, false), axisLabelsConstants(CONSTANTS$j), _extends({}, namespace(CONSTANTS$j, 'conditional_formatting'), {
|
|
10373
|
+
ruleType: 'lineColor'
|
|
10374
|
+
}), namespace(CONSTANTS$j, 'goal_line')];
|
|
10375
|
+
},
|
|
10376
|
+
supportedCustomFields: {
|
|
10377
|
+
calculatedField: false,
|
|
10378
|
+
percentages: true,
|
|
10379
|
+
dateCalculations: true,
|
|
10380
|
+
simpleMaths: true,
|
|
10381
|
+
rules: true,
|
|
10382
|
+
aggregateMaths: true,
|
|
10383
|
+
roundedNumbers: true,
|
|
10384
|
+
conditional: true
|
|
10385
|
+
},
|
|
10386
|
+
supportedFeatures: {
|
|
10387
|
+
parameters: true,
|
|
10388
|
+
colorGradient: false
|
|
10389
|
+
},
|
|
10390
|
+
setDataAttributesFromPreAggregatedDataSet: function setDataAttributesFromPreAggregatedDataSet$1(attributes, dataSet) {
|
|
10391
|
+
return setDataAttributesFromPreAggregatedDataSet(attributes, dataSet, this.setAttributes);
|
|
10392
|
+
}
|
|
10393
|
+
};
|
|
10394
|
+
};
|
|
10395
|
+
|
|
10022
10396
|
var EMPTY_CONFIG = {
|
|
10023
10397
|
queryEngineConfig: {
|
|
10024
10398
|
supportedFeatures: [],
|
|
@@ -10045,6 +10419,7 @@ function getComponentInterface(type, config) {
|
|
|
10045
10419
|
if (type == 'lineChart') return textOverrideComponent(LineChart(config || EMPTY_CONFIG), config == null ? void 0 : config.textOverride);
|
|
10046
10420
|
if (type == 'lineChartV2') return textOverrideComponent(LineChart$1(config || EMPTY_CONFIG), config == null ? void 0 : config.textOverride);
|
|
10047
10421
|
if (type == 'barChartV2') return textOverrideComponent(BarChart$1(config || EMPTY_CONFIG), config == null ? void 0 : config.textOverride);
|
|
10422
|
+
if (type == 'areaChartV2') return textOverrideComponent(AreaChart$1(config || EMPTY_CONFIG), config == null ? void 0 : config.textOverride);
|
|
10048
10423
|
if (type == 'mercatorMap') return textOverrideComponent(MercatorMap(config || EMPTY_CONFIG), config == null ? void 0 : config.textOverride);
|
|
10049
10424
|
if (type == 'pieChart') return textOverrideComponent(PieChart(config || EMPTY_CONFIG), config == null ? void 0 : config.textOverride);
|
|
10050
10425
|
if (type == 'progress') return textOverrideComponent(Progress(config || EMPTY_CONFIG), config == null ? void 0 : config.textOverride);
|
|
@@ -13197,7 +13572,7 @@ var buildDefaults = function buildDefaults(partialFeatureToggles) {
|
|
|
13197
13572
|
};
|
|
13198
13573
|
};
|
|
13199
13574
|
|
|
13200
|
-
var ALL_COMPONENT_TYPES = ['barChart', 'bubbleChart', 'horizontalBarChart', 'funnelChart', 'areaChart', 'lineChart', 'lineChartV2', 'barChartV2', 'scatterChart', 'pieChart', 'singleStat', 'dataTable', 'basicTable', 'comboChart', 'mercatorMap', 'progress', 'richText', 'custom', 'waterfallChart'];
|
|
13575
|
+
var ALL_COMPONENT_TYPES = ['barChart', 'bubbleChart', 'horizontalBarChart', 'funnelChart', 'areaChart', 'areaChartV2', 'lineChart', 'lineChartV2', 'barChartV2', 'scatterChart', 'pieChart', 'singleStat', 'dataTable', 'basicTable', 'comboChart', 'mercatorMap', 'progress', 'richText', 'custom', 'waterfallChart'];
|
|
13201
13576
|
var ALL_VIZZLY_COMPONENT_TYPES = /*#__PURE__*/[].concat(ALL_COMPONENT_TYPES).filter(function (type) {
|
|
13202
13577
|
return type != 'custom';
|
|
13203
13578
|
});
|
|
@@ -13537,7 +13912,7 @@ var saveable = function saveable(component, protectedComponent) {
|
|
|
13537
13912
|
};
|
|
13538
13913
|
};
|
|
13539
13914
|
|
|
13540
|
-
var attributesSchema$
|
|
13915
|
+
var attributesSchema$i = function attributesSchema(config) {
|
|
13541
13916
|
return Joi.alternatives().conditional('.type', {
|
|
13542
13917
|
is: 'barChart',
|
|
13543
13918
|
then: BarChart(config).schema
|
|
@@ -13559,6 +13934,9 @@ var attributesSchema$h = function attributesSchema(config) {
|
|
|
13559
13934
|
}).conditional('.type', {
|
|
13560
13935
|
is: 'barChartV2',
|
|
13561
13936
|
then: BarChart$1(config).schema
|
|
13937
|
+
}).conditional('.type', {
|
|
13938
|
+
is: 'areaChartV2',
|
|
13939
|
+
then: AreaChart$1(config).schema
|
|
13562
13940
|
}).conditional('.type', {
|
|
13563
13941
|
is: 'comboChart',
|
|
13564
13942
|
then: ComboChart(config).schema
|
|
@@ -20904,7 +21282,7 @@ var Combobox = function Combobox(props) {
|
|
|
20904
21282
|
});
|
|
20905
21283
|
};
|
|
20906
21284
|
|
|
20907
|
-
var attributesSchema$
|
|
21285
|
+
var attributesSchema$j = /*#__PURE__*/Joi.object({
|
|
20908
21286
|
displayTitle: /*#__PURE__*/Joi.string().min(1).required(),
|
|
20909
21287
|
colSpan: /*#__PURE__*/Joi.number().valid(12).required()
|
|
20910
21288
|
});
|
|
@@ -20921,7 +21299,7 @@ var isEmptyCell = /*#__PURE__*/Joi.object({
|
|
|
20921
21299
|
});
|
|
20922
21300
|
var isPopulatedCell = function isPopulatedCell(queryEngineConfig) {
|
|
20923
21301
|
return Joi.object({
|
|
20924
|
-
attributes: attributesSchema$
|
|
21302
|
+
attributes: attributesSchema$i({
|
|
20925
21303
|
queryEngineConfig: queryEngineConfig
|
|
20926
21304
|
}),
|
|
20927
21305
|
colSpan: colSpanSchema
|
|
@@ -20932,7 +21310,7 @@ var saveableDashboardDefinitionSchema = function saveableDashboardDefinitionSche
|
|
|
20932
21310
|
id: Joi.string(),
|
|
20933
21311
|
display: displaySchema(queryEngineConfig),
|
|
20934
21312
|
componentLibrary: Joi.array().required().items(Joi.object({
|
|
20935
|
-
attributes: attributesSchema$
|
|
21313
|
+
attributes: attributesSchema$i({
|
|
20936
21314
|
queryEngineConfig: queryEngineConfig
|
|
20937
21315
|
})
|
|
20938
21316
|
})),
|
|
@@ -20943,7 +21321,7 @@ var saveableDashboardDefinitionSchema = function saveableDashboardDefinitionSche
|
|
|
20943
21321
|
function displaySchema(queryEngineConfig) {
|
|
20944
21322
|
return Joi.array().required().items(Joi.object({
|
|
20945
21323
|
height: Joi.number().required(),
|
|
20946
|
-
components: Joi.array().required().min(1).items(Joi.alternatives(isEmptyCell, isPopulatedCell(queryEngineConfig), attributesSchema$
|
|
21324
|
+
components: Joi.array().required().min(1).items(Joi.alternatives(isEmptyCell, isPopulatedCell(queryEngineConfig), attributesSchema$j))
|
|
20947
21325
|
}));
|
|
20948
21326
|
}
|
|
20949
21327
|
|
|
@@ -21665,7 +22043,7 @@ var setHeaderComponent = function setHeaderComponent(state, action) {
|
|
|
21665
22043
|
newDisplayState.dashboard.display[rowIndex].components[cellIndex] = component;
|
|
21666
22044
|
return newDisplayState;
|
|
21667
22045
|
};
|
|
21668
|
-
var setAttributes$
|
|
22046
|
+
var setAttributes$h = function setAttributes(state, action) {
|
|
21669
22047
|
var attributes = action.attributes,
|
|
21670
22048
|
rowIndex = action.rowIndex,
|
|
21671
22049
|
cellIndex = action.cellIndex;
|
|
@@ -21950,7 +22328,7 @@ var reducer = function reducer(pipelineTransformationOptions) {
|
|
|
21950
22328
|
case 'swapComponents':
|
|
21951
22329
|
return swapComponents$1(state, action);
|
|
21952
22330
|
case 'setAttributes':
|
|
21953
|
-
return setAttributes$
|
|
22331
|
+
return setAttributes$h(state, action);
|
|
21954
22332
|
case 'addComponentToLibrary':
|
|
21955
22333
|
return addComponentToLibrary(state, action);
|
|
21956
22334
|
case 'setLocalFilters':
|
|
@@ -25295,7 +25673,7 @@ var RichText$1 = function RichText(props) {
|
|
|
25295
25673
|
})
|
|
25296
25674
|
}));
|
|
25297
25675
|
};
|
|
25298
|
-
var AreaChart$
|
|
25676
|
+
var AreaChart$2 = function AreaChart(props) {
|
|
25299
25677
|
return jsxRuntime.jsx("svg", _extends({
|
|
25300
25678
|
xmlns: "http://www.w3.org/2000/svg",
|
|
25301
25679
|
viewBox: "0 0 512 512"
|
|
@@ -25564,7 +25942,10 @@ var WaterfallChart$1 = function WaterfallChart(props) {
|
|
|
25564
25942
|
|
|
25565
25943
|
var componentTypeToIconMapping = {
|
|
25566
25944
|
areaChart: function areaChart(props) {
|
|
25567
|
-
return AreaChart$
|
|
25945
|
+
return AreaChart$2(props);
|
|
25946
|
+
},
|
|
25947
|
+
areaChartV2: function areaChartV2(props) {
|
|
25948
|
+
return AreaChart$2(props);
|
|
25568
25949
|
},
|
|
25569
25950
|
barChart: function barChart(props) {
|
|
25570
25951
|
return BarChart$2(props);
|
|
@@ -32663,7 +33044,7 @@ var VizzlyXYChart = function VizzlyXYChart(props) {
|
|
|
32663
33044
|
});
|
|
32664
33045
|
};
|
|
32665
33046
|
|
|
32666
|
-
var AreaChart$
|
|
33047
|
+
var AreaChart$3 = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
32667
33048
|
var forceRerender = useChartForceRerender(ref);
|
|
32668
33049
|
if (forceRerender) return null;
|
|
32669
33050
|
return jsxRuntime.jsx(responsive.ParentSize, {
|
|
@@ -33614,7 +33995,7 @@ var AreaChartView = function AreaChartView(props) {
|
|
|
33614
33995
|
paddingBottom: showHeadline ? '0.5rem' : undefined
|
|
33615
33996
|
})), showHeadline && jsxRuntime.jsx(HeadlineStats, _extends({}, props.propsForHeadline)), jsxRuntime.jsx(ChartWrapper, {
|
|
33616
33997
|
disabledFeatures: (_props$library2 = props == null ? void 0 : props.library) != null ? _props$library2 : false,
|
|
33617
|
-
children: jsxRuntime.jsx(AreaChart$
|
|
33998
|
+
children: jsxRuntime.jsx(AreaChart$3, {
|
|
33618
33999
|
approxXAxisLabelCount: props.approxXAxisLabelCount,
|
|
33619
34000
|
approxYAxisLabelCount: props.approxYAxisLabelCount,
|
|
33620
34001
|
ref: ref,
|
|
@@ -33748,7 +34129,7 @@ var isDrilldownAvailable = function isDrilldownAvailable(props) {
|
|
|
33748
34129
|
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;
|
|
33749
34130
|
};
|
|
33750
34131
|
|
|
33751
|
-
var AreaChart$
|
|
34132
|
+
var AreaChart$4 = function AreaChart(props) {
|
|
33752
34133
|
var _props$dashboardBehav;
|
|
33753
34134
|
var _useState = React.useState(null),
|
|
33754
34135
|
onDrilldown = _useState[0],
|
|
@@ -41871,6 +42252,22 @@ function howManyTicksFitInWidth(ticks, maxWidth, avgCharWidth) {
|
|
|
41871
42252
|
}
|
|
41872
42253
|
return fittedTicks.length;
|
|
41873
42254
|
}
|
|
42255
|
+
function howManyTicksFitInHeight(ticks, height) {
|
|
42256
|
+
if (height > 180) return undefined;
|
|
42257
|
+
var currentHeight = 0;
|
|
42258
|
+
var fittedTicks = 0;
|
|
42259
|
+
var ASSUMED_AVERAGE_CHAR_HEIGHT = 28;
|
|
42260
|
+
for (var i = 0; i < ticks.length; i++) {
|
|
42261
|
+
var wordHeight = ASSUMED_AVERAGE_CHAR_HEIGHT;
|
|
42262
|
+
if (currentHeight + wordHeight <= height) {
|
|
42263
|
+
fittedTicks++;
|
|
42264
|
+
currentHeight += wordHeight;
|
|
42265
|
+
} else {
|
|
42266
|
+
break;
|
|
42267
|
+
}
|
|
42268
|
+
}
|
|
42269
|
+
return fittedTicks;
|
|
42270
|
+
}
|
|
41874
42271
|
function pickEquallySpaced(arr, numPicks) {
|
|
41875
42272
|
if (numPicks >= arr.length) {
|
|
41876
42273
|
return arr; // If numPicks is greater than or equal to the array length, return the whole array
|
|
@@ -41883,17 +42280,22 @@ function pickEquallySpaced(arr, numPicks) {
|
|
|
41883
42280
|
}
|
|
41884
42281
|
return result;
|
|
41885
42282
|
}
|
|
41886
|
-
|
|
41887
|
-
|
|
42283
|
+
function adjustTicks(representation, width, height) {
|
|
42284
|
+
representation = _.cloneDeep(representation);
|
|
41888
42285
|
|
|
41889
42286
|
// TODO; take this from the theme override...
|
|
41890
42287
|
var averageCharacterWidth = ASSUMED_AVERAGE_CHAR_WIDTH;
|
|
41891
|
-
var
|
|
42288
|
+
var numberOfXTicksFittingIntoSpace = howManyTicksFitInWidth(representation.x.ticks || [], width, averageCharacterWidth);
|
|
42289
|
+
var numberOfYTicksFittingIntoSpace = howManyTicksFitInHeight(representation.y.ticks || [], height);
|
|
41892
42290
|
|
|
41893
42291
|
// @ts-ignore
|
|
41894
|
-
|
|
41895
|
-
|
|
41896
|
-
|
|
42292
|
+
representation.x.ticks = pickEquallySpaced(representation.x.ticks, numberOfXTicksFittingIntoSpace);
|
|
42293
|
+
if (numberOfYTicksFittingIntoSpace) {
|
|
42294
|
+
// @ts-ignore
|
|
42295
|
+
representation.y.ticks = pickEquallySpaced(representation.y.ticks, numberOfYTicksFittingIntoSpace);
|
|
42296
|
+
}
|
|
42297
|
+
return representation;
|
|
42298
|
+
}
|
|
41897
42299
|
|
|
41898
42300
|
var buildMargin = function buildMargin(yTicks, showYAxisLabels, hasYAxisTitle, hasXAxisTitle) {
|
|
41899
42301
|
var maxWidth = _.max(yTicks.map(function (tick) {
|
|
@@ -42857,135 +43259,6 @@ function getStyleDefinition(_ref) {
|
|
|
42857
43259
|
});
|
|
42858
43260
|
}
|
|
42859
43261
|
|
|
42860
|
-
var getMinAndMax = function getMinAndMax(_ref) {
|
|
42861
|
-
var data = _ref.data,
|
|
42862
|
-
keys = _ref.keys,
|
|
42863
|
-
dataType = _ref.dataType,
|
|
42864
|
-
goalLines = _ref.goalLines;
|
|
42865
|
-
if (keys.length === 0) return {
|
|
42866
|
-
max: null,
|
|
42867
|
-
min: null
|
|
42868
|
-
};
|
|
42869
|
-
if (dataType === 'date_time') {
|
|
42870
|
-
var dataToAnalyse = [].concat(data.flatMap(function (dataItem) {
|
|
42871
|
-
return keys.map(function (key) {
|
|
42872
|
-
return dataItem[key] ? new Date(dataItem[key].value).valueOf() : 0;
|
|
42873
|
-
});
|
|
42874
|
-
}));
|
|
42875
|
-
return {
|
|
42876
|
-
max: Math.max.apply(Math, dataToAnalyse),
|
|
42877
|
-
min: Math.min.apply(Math, dataToAnalyse)
|
|
42878
|
-
};
|
|
42879
|
-
} else if (dataType === 'number') {
|
|
42880
|
-
var _dataToAnalyse = [].concat(data.flatMap(function (dataItem) {
|
|
42881
|
-
return keys.map(function (key) {
|
|
42882
|
-
return dataItem[key] ? dataItem[key].value : 0;
|
|
42883
|
-
});
|
|
42884
|
-
}), goalLines ? goalLines.map(function (gL) {
|
|
42885
|
-
return gL.value;
|
|
42886
|
-
}) : []);
|
|
42887
|
-
return {
|
|
42888
|
-
max: Math.max.apply(Math, _dataToAnalyse),
|
|
42889
|
-
min: Math.min.apply(Math, _dataToAnalyse)
|
|
42890
|
-
};
|
|
42891
|
-
} else {
|
|
42892
|
-
return {
|
|
42893
|
-
max: null,
|
|
42894
|
-
min: null
|
|
42895
|
-
};
|
|
42896
|
-
}
|
|
42897
|
-
};
|
|
42898
|
-
|
|
42899
|
-
function getNiceInterval(interval) {
|
|
42900
|
-
// Round the interval to a "nice" value (1, 2, 5, etc.)
|
|
42901
|
-
var exponent = Math.floor(Math.log10(interval));
|
|
42902
|
-
var fraction = interval / Math.pow(10, exponent);
|
|
42903
|
-
var niceFraction;
|
|
42904
|
-
if (fraction <= 1.5) niceFraction = 1;else if (fraction <= 3) niceFraction = 2;else if (fraction <= 7) niceFraction = 5;else niceFraction = 10;
|
|
42905
|
-
return niceFraction * Math.pow(10, exponent);
|
|
42906
|
-
}
|
|
42907
|
-
var getScaleAndTicks = function getScaleAndTicks(_ref) {
|
|
42908
|
-
var _order$;
|
|
42909
|
-
var data = _ref.data,
|
|
42910
|
-
xKey = _ref.xKey,
|
|
42911
|
-
yKeys = _ref.yKeys,
|
|
42912
|
-
xScaleDataType = _ref.xScaleDataType,
|
|
42913
|
-
nullValue = _ref.nullValue,
|
|
42914
|
-
tickCountYAxis = _ref.tickCountYAxis,
|
|
42915
|
-
formattingFunctionX = _ref.formattingFunctionX,
|
|
42916
|
-
formattingFunctionY = _ref.formattingFunctionY,
|
|
42917
|
-
order = _ref.order,
|
|
42918
|
-
goalLines = _ref.goalLines;
|
|
42919
|
-
var xTicks = [];
|
|
42920
|
-
var yTicks = [];
|
|
42921
|
-
var xScale = {
|
|
42922
|
-
dataType: xScaleDataType,
|
|
42923
|
-
key: xKey,
|
|
42924
|
-
ordering: ((_order$ = order[0]) == null ? void 0 : _order$.direction) || null
|
|
42925
|
-
};
|
|
42926
|
-
var x = getMinAndMax({
|
|
42927
|
-
data: data,
|
|
42928
|
-
keys: xScale.key === null ? [] : [xScale.key],
|
|
42929
|
-
dataType: xScale.dataType
|
|
42930
|
-
});
|
|
42931
|
-
if (xKey) {
|
|
42932
|
-
xTicks = data.map(function (dataItem) {
|
|
42933
|
-
var _dataItem$xKey, _dataItem$xScale$key, _dataItem$xScale$key2;
|
|
42934
|
-
var xValue = (_dataItem$xKey = dataItem[xKey]) != null && _dataItem$xKey.value ? dataItem[xKey].value : null;
|
|
42935
|
-
var xformattedValue = formattingFunctionX(xValue, nullValue);
|
|
42936
|
-
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 : '';
|
|
42937
|
-
var xScaleValueAdjusted = xScale.dataType === 'date_time' ? new Date(xScaleValue) : xScale.dataType === 'string' ? String(xScaleValue) : xScale.dataType === 'number' ? Number(xScaleValue) : xScaleValue;
|
|
42938
|
-
return {
|
|
42939
|
-
value: xValue !== null ? xValue : '',
|
|
42940
|
-
formattedValue: xformattedValue !== null ? "" + xformattedValue : null,
|
|
42941
|
-
scaleValue: xScaleValueAdjusted
|
|
42942
|
-
};
|
|
42943
|
-
});
|
|
42944
|
-
}
|
|
42945
|
-
// ----- Y Axis ("number") -----
|
|
42946
|
-
|
|
42947
|
-
var y = getMinAndMax({
|
|
42948
|
-
data: data,
|
|
42949
|
-
keys: yKeys,
|
|
42950
|
-
dataType: 'number',
|
|
42951
|
-
goalLines: goalLines
|
|
42952
|
-
});
|
|
42953
|
-
var maxY = y.max || 0;
|
|
42954
|
-
var minY = Math.min(y.min || 0, 0);
|
|
42955
|
-
var yTickInterval = getNiceInterval((maxY - minY) / (tickCountYAxis - 1));
|
|
42956
|
-
for (var i = 0; i < tickCountYAxis; i++) {
|
|
42957
|
-
var _value = yTickInterval * i;
|
|
42958
|
-
var formattedValue = formattingFunctionY(_value, nullValue);
|
|
42959
|
-
yTicks.push({
|
|
42960
|
-
value: _value,
|
|
42961
|
-
formattedValue: formattedValue,
|
|
42962
|
-
scaleValue: _value
|
|
42963
|
-
});
|
|
42964
|
-
}
|
|
42965
|
-
return {
|
|
42966
|
-
x: {
|
|
42967
|
-
ticks: xTicks,
|
|
42968
|
-
scale: {
|
|
42969
|
-
dataType: xScale.dataType,
|
|
42970
|
-
max: x.max,
|
|
42971
|
-
min: x.min,
|
|
42972
|
-
key: xScale.key,
|
|
42973
|
-
ordering: xScale.ordering
|
|
42974
|
-
}
|
|
42975
|
-
},
|
|
42976
|
-
y: {
|
|
42977
|
-
ticks: yTicks,
|
|
42978
|
-
scale: {
|
|
42979
|
-
dataType: 'number',
|
|
42980
|
-
key: null,
|
|
42981
|
-
ordering: 'asc',
|
|
42982
|
-
max: maxY,
|
|
42983
|
-
min: minY
|
|
42984
|
-
}
|
|
42985
|
-
}
|
|
42986
|
-
};
|
|
42987
|
-
};
|
|
42988
|
-
|
|
42989
43262
|
/**
|
|
42990
43263
|
* When provided with a result, and formatting parameters, it returns a
|
|
42991
43264
|
* populated result including the formatted value to show.
|
|
@@ -43434,6 +43707,180 @@ function buildFieldFormatMaps(result, pivotConfig, xAxisPrefix, xAxisPostfix, xA
|
|
|
43434
43707
|
};
|
|
43435
43708
|
}
|
|
43436
43709
|
|
|
43710
|
+
var getStackedMinAndMax = function getStackedMinAndMax(_ref) {
|
|
43711
|
+
var data = _ref.data,
|
|
43712
|
+
keys = _ref.keys,
|
|
43713
|
+
dataType = _ref.dataType,
|
|
43714
|
+
goalLines = _ref.goalLines,
|
|
43715
|
+
stacked = _ref.stacked;
|
|
43716
|
+
if (keys.length === 0) return {
|
|
43717
|
+
max: null,
|
|
43718
|
+
min: null
|
|
43719
|
+
};
|
|
43720
|
+
if (stacked) {
|
|
43721
|
+
var totals = data.map(function (dataItem) {
|
|
43722
|
+
return keys.reduce(function (sum, key) {
|
|
43723
|
+
var value = dataItem[key] ? dataItem[key].value : 0;
|
|
43724
|
+
return sum + (typeof value === 'number' ? value : 0);
|
|
43725
|
+
}, 0);
|
|
43726
|
+
});
|
|
43727
|
+
var maxTotal = Math.max.apply(Math, totals);
|
|
43728
|
+
var minTotal = Math.min.apply(Math, totals);
|
|
43729
|
+
return {
|
|
43730
|
+
max: maxTotal,
|
|
43731
|
+
min: minTotal
|
|
43732
|
+
};
|
|
43733
|
+
}
|
|
43734
|
+
if (dataType === 'date_time') {
|
|
43735
|
+
var dataToAnalyse = [].concat(data.flatMap(function (dataItem) {
|
|
43736
|
+
return keys.map(function (key) {
|
|
43737
|
+
return dataItem[key] ? new Date(dataItem[key].value).valueOf() : 0;
|
|
43738
|
+
});
|
|
43739
|
+
}));
|
|
43740
|
+
return {
|
|
43741
|
+
max: Math.max.apply(Math, dataToAnalyse),
|
|
43742
|
+
min: Math.min.apply(Math, dataToAnalyse)
|
|
43743
|
+
};
|
|
43744
|
+
} else if (dataType === 'number') {
|
|
43745
|
+
var _dataToAnalyse = [].concat(data.flatMap(function (dataItem) {
|
|
43746
|
+
return keys.map(function (key) {
|
|
43747
|
+
return dataItem[key] ? dataItem[key].value : 0;
|
|
43748
|
+
});
|
|
43749
|
+
}), goalLines ? goalLines.map(function (gL) {
|
|
43750
|
+
return gL.value;
|
|
43751
|
+
}) : []);
|
|
43752
|
+
return {
|
|
43753
|
+
max: Math.max.apply(Math, _dataToAnalyse),
|
|
43754
|
+
min: Math.min.apply(Math, _dataToAnalyse)
|
|
43755
|
+
};
|
|
43756
|
+
} else {
|
|
43757
|
+
return {
|
|
43758
|
+
max: null,
|
|
43759
|
+
min: null
|
|
43760
|
+
};
|
|
43761
|
+
}
|
|
43762
|
+
};
|
|
43763
|
+
|
|
43764
|
+
function getNiceInterval(interval) {
|
|
43765
|
+
var exponent = Math.floor(Math.log10(interval));
|
|
43766
|
+
var fraction = interval / Math.pow(10, exponent);
|
|
43767
|
+
var niceFraction;
|
|
43768
|
+
if (fraction <= 1) {
|
|
43769
|
+
niceFraction = 1;
|
|
43770
|
+
} else if (fraction <= 1.25) {
|
|
43771
|
+
niceFraction = 1.25;
|
|
43772
|
+
} else if (fraction <= 1.5) {
|
|
43773
|
+
niceFraction = 1.5;
|
|
43774
|
+
} else if (fraction <= 2) {
|
|
43775
|
+
niceFraction = 2;
|
|
43776
|
+
} else if (fraction <= 2.5) {
|
|
43777
|
+
niceFraction = 2.5;
|
|
43778
|
+
} else if (fraction <= 3) {
|
|
43779
|
+
niceFraction = 3;
|
|
43780
|
+
} else if (fraction <= 5) {
|
|
43781
|
+
niceFraction = 5;
|
|
43782
|
+
} else if (fraction <= 7) {
|
|
43783
|
+
niceFraction = 7;
|
|
43784
|
+
} else if (fraction <= 10) {
|
|
43785
|
+
niceFraction = 10;
|
|
43786
|
+
} else {
|
|
43787
|
+
niceFraction = 10;
|
|
43788
|
+
}
|
|
43789
|
+
return niceFraction * Math.pow(10, exponent);
|
|
43790
|
+
}
|
|
43791
|
+
var getScaleAndTicks = function getScaleAndTicks(_ref) {
|
|
43792
|
+
var _order$;
|
|
43793
|
+
var data = _ref.data,
|
|
43794
|
+
xKey = _ref.xKey,
|
|
43795
|
+
yKeys = _ref.yKeys,
|
|
43796
|
+
xScaleDataType = _ref.xScaleDataType,
|
|
43797
|
+
nullValue = _ref.nullValue,
|
|
43798
|
+
tickCountYAxis = _ref.tickCountYAxis,
|
|
43799
|
+
formattingFunctionX = _ref.formattingFunctionX,
|
|
43800
|
+
formattingFunctionY = _ref.formattingFunctionY,
|
|
43801
|
+
order = _ref.order,
|
|
43802
|
+
goalLines = _ref.goalLines,
|
|
43803
|
+
stacked = _ref.stacked;
|
|
43804
|
+
var xTicks = [];
|
|
43805
|
+
var xScale = {
|
|
43806
|
+
dataType: xScaleDataType,
|
|
43807
|
+
key: xKey,
|
|
43808
|
+
ordering: ((_order$ = order[0]) == null ? void 0 : _order$.direction) || null
|
|
43809
|
+
};
|
|
43810
|
+
var x = getStackedMinAndMax({
|
|
43811
|
+
data: data,
|
|
43812
|
+
keys: xScale.key === null ? [] : [xScale.key],
|
|
43813
|
+
dataType: xScale.dataType
|
|
43814
|
+
});
|
|
43815
|
+
if (xKey) {
|
|
43816
|
+
xTicks = data.map(function (dataItem) {
|
|
43817
|
+
var _dataItem$xKey, _dataItem$xScale$key, _dataItem$xScale$key2;
|
|
43818
|
+
var xValue = (_dataItem$xKey = dataItem[xKey]) != null && _dataItem$xKey.value ? dataItem[xKey].value : null;
|
|
43819
|
+
var xformattedValue = formattingFunctionX(xValue, nullValue);
|
|
43820
|
+
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 : '';
|
|
43821
|
+
var xScaleValueAdjusted = xScale.dataType === 'date_time' ? new Date(xScaleValue) : xScale.dataType === 'string' ? String(xScaleValue) : xScale.dataType === 'number' ? Number(xScaleValue) : xScaleValue;
|
|
43822
|
+
return {
|
|
43823
|
+
value: xValue !== null ? xValue : '',
|
|
43824
|
+
formattedValue: xformattedValue !== null ? "" + xformattedValue : null,
|
|
43825
|
+
scaleValue: xScaleValueAdjusted
|
|
43826
|
+
};
|
|
43827
|
+
});
|
|
43828
|
+
}
|
|
43829
|
+
// ----- Y Axis ("number") -----
|
|
43830
|
+
|
|
43831
|
+
var y = getStackedMinAndMax({
|
|
43832
|
+
data: data,
|
|
43833
|
+
keys: yKeys,
|
|
43834
|
+
dataType: 'number',
|
|
43835
|
+
goalLines: goalLines,
|
|
43836
|
+
stacked: stacked
|
|
43837
|
+
});
|
|
43838
|
+
var maxY = y.max || 0;
|
|
43839
|
+
var minY = Math.min(y.min || 0, 0);
|
|
43840
|
+
var yTickInterval = getNiceInterval((maxY - minY) / (tickCountYAxis - 1));
|
|
43841
|
+
var yTicks = [];
|
|
43842
|
+
for (var i = 0; i < tickCountYAxis; i++) {
|
|
43843
|
+
var _value = minY + yTickInterval * i;
|
|
43844
|
+
var formattedValue = formattingFunctionY(_value, nullValue);
|
|
43845
|
+
yTicks.push({
|
|
43846
|
+
value: _value,
|
|
43847
|
+
formattedValue: formattedValue,
|
|
43848
|
+
scaleValue: _value
|
|
43849
|
+
});
|
|
43850
|
+
}
|
|
43851
|
+
return {
|
|
43852
|
+
x: {
|
|
43853
|
+
ticks: xTicks,
|
|
43854
|
+
scale: {
|
|
43855
|
+
dataType: xScale.dataType,
|
|
43856
|
+
max: x.max,
|
|
43857
|
+
min: x.min,
|
|
43858
|
+
key: xScale.key,
|
|
43859
|
+
ordering: xScale.ordering
|
|
43860
|
+
}
|
|
43861
|
+
},
|
|
43862
|
+
y: {
|
|
43863
|
+
ticks: yTicks,
|
|
43864
|
+
scale: {
|
|
43865
|
+
dataType: 'number',
|
|
43866
|
+
key: null,
|
|
43867
|
+
ordering: 'asc',
|
|
43868
|
+
max: maxY,
|
|
43869
|
+
min: minY
|
|
43870
|
+
}
|
|
43871
|
+
}
|
|
43872
|
+
};
|
|
43873
|
+
};
|
|
43874
|
+
|
|
43875
|
+
var formattingFunctionX = function formattingFunctionX(value, formattedResult, xKeyField) {
|
|
43876
|
+
if (!xKeyField) return '';
|
|
43877
|
+
return formattedResult.formatterFunc(value, {
|
|
43878
|
+
fieldId: xKeyField.fieldId,
|
|
43879
|
+
"function": xKeyField["function"],
|
|
43880
|
+
outputDataType: xKeyField.outputDataType
|
|
43881
|
+
}).formattedValue;
|
|
43882
|
+
};
|
|
43883
|
+
|
|
43437
43884
|
var buildLineChartRepresentation = function buildLineChartRepresentation(_ref) {
|
|
43438
43885
|
var _xKeys$, _axisTitles$x, _axisTitles$y;
|
|
43439
43886
|
var axisTitles = _ref.axisTitles,
|
|
@@ -43506,15 +43953,6 @@ var buildLineChartRepresentation = function buildLineChartRepresentation(_ref) {
|
|
|
43506
43953
|
|
|
43507
43954
|
// ----- Formatting -----
|
|
43508
43955
|
|
|
43509
|
-
var formattingFunctionX = function formattingFunctionX(value) {
|
|
43510
|
-
if (!xKeyField) return '';
|
|
43511
|
-
return formattedResult.formatterFunc(value, {
|
|
43512
|
-
fieldId: xKeyField.fieldId,
|
|
43513
|
-
"function": xKeyField["function"],
|
|
43514
|
-
outputDataType: xKeyField.outputDataType
|
|
43515
|
-
}).formattedValue;
|
|
43516
|
-
};
|
|
43517
|
-
|
|
43518
43956
|
// (value: any, noValueReplacement?: string) => string;
|
|
43519
43957
|
var formattingFunctionY = function formattingFunctionY(value) {
|
|
43520
43958
|
// Use any y axis field as they are all formatted in the same way (for now...);
|
|
@@ -43543,7 +43981,9 @@ var buildLineChartRepresentation = function buildLineChartRepresentation(_ref) {
|
|
|
43543
43981
|
var orderFunction = order.length > 0 ? order[0]["function"] : undefined;
|
|
43544
43982
|
var trendsAndForecastData = getTrendsAndForecastsData({
|
|
43545
43983
|
chartData: chartData,
|
|
43546
|
-
formattingFunctionX: formattingFunctionX
|
|
43984
|
+
formattingFunctionX: function formattingFunctionX$1(value) {
|
|
43985
|
+
return formattingFunctionX(value, formattedResult, xKeyField);
|
|
43986
|
+
},
|
|
43547
43987
|
formattingFunctionY: formattingFunctionY,
|
|
43548
43988
|
keys: keys,
|
|
43549
43989
|
nullValue: nullValue,
|
|
@@ -43573,7 +44013,9 @@ var buildLineChartRepresentation = function buildLineChartRepresentation(_ref) {
|
|
|
43573
44013
|
xScaleDataType: xScaleDataType,
|
|
43574
44014
|
yKeys: yKeys,
|
|
43575
44015
|
tickCountYAxis: approxYAxisLabelCount,
|
|
43576
|
-
formattingFunctionX: formattingFunctionX
|
|
44016
|
+
formattingFunctionX: function formattingFunctionX$1(value) {
|
|
44017
|
+
return formattingFunctionX(value, formattedResult, xKeyField);
|
|
44018
|
+
},
|
|
43577
44019
|
formattingFunctionY: formattingFunctionY,
|
|
43578
44020
|
nullValue: nullValue,
|
|
43579
44021
|
order: order,
|
|
@@ -43635,62 +44077,6 @@ var buildLineChartRepresentation = function buildLineChartRepresentation(_ref) {
|
|
|
43635
44077
|
return chart;
|
|
43636
44078
|
};
|
|
43637
44079
|
|
|
43638
|
-
var ASSUMED_AVERAGE_CHAR_WIDTH$1 = 8.8;
|
|
43639
|
-
function calculateWordWidth$1(word, avgCharWidth) {
|
|
43640
|
-
if (avgCharWidth === void 0) {
|
|
43641
|
-
avgCharWidth = ASSUMED_AVERAGE_CHAR_WIDTH$1;
|
|
43642
|
-
}
|
|
43643
|
-
return word.length * avgCharWidth;
|
|
43644
|
-
}
|
|
43645
|
-
|
|
43646
|
-
/** Reduce width proportionally to simulate spacing / padding between ticks. */
|
|
43647
|
-
var widthWithSpacing$1 = function widthWithSpacing(width) {
|
|
43648
|
-
var THIRTY_PERCENT = 0.3;
|
|
43649
|
-
return width - width * THIRTY_PERCENT;
|
|
43650
|
-
};
|
|
43651
|
-
function howManyTicksFitInWidth$1(ticks, maxWidth, avgCharWidth) {
|
|
43652
|
-
if (avgCharWidth === void 0) {
|
|
43653
|
-
avgCharWidth = ASSUMED_AVERAGE_CHAR_WIDTH$1;
|
|
43654
|
-
}
|
|
43655
|
-
var fittedTicks = [];
|
|
43656
|
-
var currentWidth = 0;
|
|
43657
|
-
for (var _iterator = _createForOfIteratorHelperLoose(ticks), _step; !(_step = _iterator()).done;) {
|
|
43658
|
-
var tick = _step.value;
|
|
43659
|
-
var word = (tick == null ? void 0 : tick.formattedValue) || '';
|
|
43660
|
-
var wordWidth = calculateWordWidth$1(word, avgCharWidth);
|
|
43661
|
-
if (currentWidth + wordWidth <= widthWithSpacing$1(maxWidth)) {
|
|
43662
|
-
fittedTicks.push(tick);
|
|
43663
|
-
currentWidth += wordWidth + avgCharWidth; // Add space between words
|
|
43664
|
-
} else {
|
|
43665
|
-
break; // Stop if adding the word exceeds maxWidth
|
|
43666
|
-
}
|
|
43667
|
-
}
|
|
43668
|
-
return fittedTicks.length;
|
|
43669
|
-
}
|
|
43670
|
-
function pickEquallySpaced$1(arr, numPicks) {
|
|
43671
|
-
if (numPicks >= arr.length) {
|
|
43672
|
-
return arr; // If numPicks is greater than or equal to the array length, return the whole array
|
|
43673
|
-
}
|
|
43674
|
-
var result = [];
|
|
43675
|
-
var interval = (arr.length - 1) / (numPicks - 1);
|
|
43676
|
-
for (var i = 0; i < numPicks; i++) {
|
|
43677
|
-
var index = Math.round(i * interval); // Calculate index and round it
|
|
43678
|
-
result.push(arr[index]);
|
|
43679
|
-
}
|
|
43680
|
-
return result;
|
|
43681
|
-
}
|
|
43682
|
-
var adjustTicks$1 = function adjustTicks(lineChartRepresentation, width) {
|
|
43683
|
-
lineChartRepresentation = _.cloneDeep(lineChartRepresentation);
|
|
43684
|
-
|
|
43685
|
-
// TODO; take this from the theme override...
|
|
43686
|
-
var averageCharacterWidth = ASSUMED_AVERAGE_CHAR_WIDTH$1;
|
|
43687
|
-
var numberOfTicksFittingIntoSpace = howManyTicksFitInWidth$1(lineChartRepresentation.x.ticks || [], width, averageCharacterWidth);
|
|
43688
|
-
|
|
43689
|
-
// @ts-ignore
|
|
43690
|
-
lineChartRepresentation.x.ticks = pickEquallySpaced$1(lineChartRepresentation.x.ticks, numberOfTicksFittingIntoSpace);
|
|
43691
|
-
return lineChartRepresentation;
|
|
43692
|
-
};
|
|
43693
|
-
|
|
43694
44080
|
var LineChartV2View = function LineChartV2View(props) {
|
|
43695
44081
|
var _props$library, _props$attributes$vie;
|
|
43696
44082
|
var _useDashboardBehaviou = useDashboardBehaviourContext(),
|
|
@@ -43799,7 +44185,7 @@ var LineChartV2View = function LineChartV2View(props) {
|
|
|
43799
44185
|
return jsxRuntime.jsx(LineChart$5, {
|
|
43800
44186
|
width: parent.width,
|
|
43801
44187
|
height: parent.height,
|
|
43802
|
-
chart: adjustTicks
|
|
44188
|
+
chart: adjustTicks(chartRepresentation, parent.width, parent.height),
|
|
43803
44189
|
options: {
|
|
43804
44190
|
lineCurve: props.attributes.lineCurve,
|
|
43805
44191
|
removeStroke: false,
|
|
@@ -43807,8 +44193,7 @@ var LineChartV2View = function LineChartV2View(props) {
|
|
|
43807
44193
|
showLegend: props.attributes.legend,
|
|
43808
44194
|
axis: {
|
|
43809
44195
|
showXAxisLabels: props.attributes.approxXAxisLabelCount !== 0,
|
|
43810
|
-
|
|
43811
|
-
showYAxisLabels: props.attributes.approxYAxisLabelCount !== 0 // shared-ui/src/library/StylePanel/AxisPreferenceSection.tsx
|
|
44196
|
+
showYAxisLabels: props.attributes.approxYAxisLabelCount !== 0
|
|
43812
44197
|
}
|
|
43813
44198
|
},
|
|
43814
44199
|
theme: theme == null ? void 0 : theme.charts
|
|
@@ -47130,171 +47515,6 @@ var Progress$2 = function Progress(props) {
|
|
|
47130
47515
|
}));
|
|
47131
47516
|
};
|
|
47132
47517
|
|
|
47133
|
-
var getMinAndMax$1 = function getMinAndMax(_ref) {
|
|
47134
|
-
var data = _ref.data,
|
|
47135
|
-
keys = _ref.keys,
|
|
47136
|
-
dataType = _ref.dataType,
|
|
47137
|
-
goalLines = _ref.goalLines,
|
|
47138
|
-
stacked = _ref.stacked;
|
|
47139
|
-
if (keys.length === 0) return {
|
|
47140
|
-
max: null,
|
|
47141
|
-
min: null
|
|
47142
|
-
};
|
|
47143
|
-
if (stacked) {
|
|
47144
|
-
var totals = data.map(function (dataItem) {
|
|
47145
|
-
return keys.reduce(function (sum, key) {
|
|
47146
|
-
var value = dataItem[key] ? dataItem[key].value : 0;
|
|
47147
|
-
return sum + (typeof value === 'number' ? value : 0);
|
|
47148
|
-
}, 0);
|
|
47149
|
-
});
|
|
47150
|
-
var maxTotal = Math.max.apply(Math, totals);
|
|
47151
|
-
var minTotal = Math.min.apply(Math, totals);
|
|
47152
|
-
return {
|
|
47153
|
-
max: maxTotal,
|
|
47154
|
-
min: minTotal
|
|
47155
|
-
};
|
|
47156
|
-
}
|
|
47157
|
-
if (dataType === 'date_time') {
|
|
47158
|
-
var dataToAnalyse = [].concat(data.flatMap(function (dataItem) {
|
|
47159
|
-
return keys.map(function (key) {
|
|
47160
|
-
return dataItem[key] ? new Date(dataItem[key].value).valueOf() : 0;
|
|
47161
|
-
});
|
|
47162
|
-
}));
|
|
47163
|
-
return {
|
|
47164
|
-
max: Math.max.apply(Math, dataToAnalyse),
|
|
47165
|
-
min: Math.min.apply(Math, dataToAnalyse)
|
|
47166
|
-
};
|
|
47167
|
-
} else if (dataType === 'number') {
|
|
47168
|
-
var _dataToAnalyse = [].concat(data.flatMap(function (dataItem) {
|
|
47169
|
-
return keys.map(function (key) {
|
|
47170
|
-
return dataItem[key] ? dataItem[key].value : 0;
|
|
47171
|
-
});
|
|
47172
|
-
}), goalLines ? goalLines.map(function (gL) {
|
|
47173
|
-
return gL.value;
|
|
47174
|
-
}) : []);
|
|
47175
|
-
return {
|
|
47176
|
-
max: Math.max.apply(Math, _dataToAnalyse),
|
|
47177
|
-
min: Math.min.apply(Math, _dataToAnalyse)
|
|
47178
|
-
};
|
|
47179
|
-
} else {
|
|
47180
|
-
return {
|
|
47181
|
-
max: null,
|
|
47182
|
-
min: null
|
|
47183
|
-
};
|
|
47184
|
-
}
|
|
47185
|
-
};
|
|
47186
|
-
|
|
47187
|
-
function getNiceInterval$1(interval) {
|
|
47188
|
-
var exponent = Math.floor(Math.log10(interval));
|
|
47189
|
-
var fraction = interval / Math.pow(10, exponent);
|
|
47190
|
-
var niceFraction;
|
|
47191
|
-
if (fraction <= 1) {
|
|
47192
|
-
niceFraction = 1;
|
|
47193
|
-
} else if (fraction <= 1.25) {
|
|
47194
|
-
niceFraction = 1.25;
|
|
47195
|
-
} else if (fraction <= 1.5) {
|
|
47196
|
-
niceFraction = 1.5;
|
|
47197
|
-
} else if (fraction <= 2) {
|
|
47198
|
-
niceFraction = 2;
|
|
47199
|
-
} else if (fraction <= 2.5) {
|
|
47200
|
-
niceFraction = 2.5;
|
|
47201
|
-
} else if (fraction <= 3) {
|
|
47202
|
-
niceFraction = 3;
|
|
47203
|
-
} else if (fraction <= 5) {
|
|
47204
|
-
niceFraction = 5;
|
|
47205
|
-
} else if (fraction <= 7) {
|
|
47206
|
-
niceFraction = 7;
|
|
47207
|
-
} else if (fraction <= 10) {
|
|
47208
|
-
niceFraction = 10;
|
|
47209
|
-
} else {
|
|
47210
|
-
niceFraction = 10;
|
|
47211
|
-
}
|
|
47212
|
-
return niceFraction * Math.pow(10, exponent);
|
|
47213
|
-
}
|
|
47214
|
-
var getScaleAndTicks$1 = function getScaleAndTicks(_ref) {
|
|
47215
|
-
var _order$;
|
|
47216
|
-
var data = _ref.data,
|
|
47217
|
-
xKey = _ref.xKey,
|
|
47218
|
-
yKeys = _ref.yKeys,
|
|
47219
|
-
xScaleDataType = _ref.xScaleDataType,
|
|
47220
|
-
nullValue = _ref.nullValue,
|
|
47221
|
-
tickCountYAxis = _ref.tickCountYAxis,
|
|
47222
|
-
formattingFunctionX = _ref.formattingFunctionX,
|
|
47223
|
-
formattingFunctionY = _ref.formattingFunctionY,
|
|
47224
|
-
order = _ref.order,
|
|
47225
|
-
goalLines = _ref.goalLines,
|
|
47226
|
-
stacked = _ref.stacked;
|
|
47227
|
-
var xTicks = [];
|
|
47228
|
-
var xScale = {
|
|
47229
|
-
dataType: xScaleDataType,
|
|
47230
|
-
key: xKey,
|
|
47231
|
-
ordering: ((_order$ = order[0]) == null ? void 0 : _order$.direction) || null
|
|
47232
|
-
};
|
|
47233
|
-
var x = getMinAndMax$1({
|
|
47234
|
-
data: data,
|
|
47235
|
-
keys: xScale.key === null ? [] : [xScale.key],
|
|
47236
|
-
dataType: xScale.dataType
|
|
47237
|
-
});
|
|
47238
|
-
if (xKey) {
|
|
47239
|
-
xTicks = data.map(function (dataItem) {
|
|
47240
|
-
var _dataItem$xKey, _dataItem$xScale$key, _dataItem$xScale$key2;
|
|
47241
|
-
var xValue = (_dataItem$xKey = dataItem[xKey]) != null && _dataItem$xKey.value ? dataItem[xKey].value : null;
|
|
47242
|
-
var xformattedValue = formattingFunctionX(xValue, nullValue);
|
|
47243
|
-
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 : '';
|
|
47244
|
-
var xScaleValueAdjusted = xScale.dataType === 'date_time' ? new Date(xScaleValue) : xScale.dataType === 'string' ? String(xScaleValue) : xScale.dataType === 'number' ? Number(xScaleValue) : xScaleValue;
|
|
47245
|
-
return {
|
|
47246
|
-
value: xValue !== null ? xValue : '',
|
|
47247
|
-
formattedValue: xformattedValue !== null ? "" + xformattedValue : null,
|
|
47248
|
-
scaleValue: xScaleValueAdjusted
|
|
47249
|
-
};
|
|
47250
|
-
});
|
|
47251
|
-
}
|
|
47252
|
-
// ----- Y Axis ("number") -----
|
|
47253
|
-
|
|
47254
|
-
var y = getMinAndMax$1({
|
|
47255
|
-
data: data,
|
|
47256
|
-
keys: yKeys,
|
|
47257
|
-
dataType: 'number',
|
|
47258
|
-
goalLines: goalLines,
|
|
47259
|
-
stacked: stacked
|
|
47260
|
-
});
|
|
47261
|
-
var maxY = y.max || 0;
|
|
47262
|
-
var minY = Math.min(y.min || 0, 0);
|
|
47263
|
-
var yTickInterval = getNiceInterval$1((maxY - minY) / (tickCountYAxis - 1));
|
|
47264
|
-
var yTicks = [];
|
|
47265
|
-
for (var i = 0; i < tickCountYAxis; i++) {
|
|
47266
|
-
var _value = minY + yTickInterval * i;
|
|
47267
|
-
var formattedValue = formattingFunctionY(_value, nullValue);
|
|
47268
|
-
yTicks.push({
|
|
47269
|
-
value: _value,
|
|
47270
|
-
formattedValue: formattedValue,
|
|
47271
|
-
scaleValue: _value
|
|
47272
|
-
});
|
|
47273
|
-
}
|
|
47274
|
-
return {
|
|
47275
|
-
x: {
|
|
47276
|
-
ticks: xTicks,
|
|
47277
|
-
scale: {
|
|
47278
|
-
dataType: xScale.dataType,
|
|
47279
|
-
max: x.max,
|
|
47280
|
-
min: x.min,
|
|
47281
|
-
key: xScale.key,
|
|
47282
|
-
ordering: xScale.ordering
|
|
47283
|
-
}
|
|
47284
|
-
},
|
|
47285
|
-
y: {
|
|
47286
|
-
ticks: yTicks,
|
|
47287
|
-
scale: {
|
|
47288
|
-
dataType: 'number',
|
|
47289
|
-
key: null,
|
|
47290
|
-
ordering: 'asc',
|
|
47291
|
-
max: maxY,
|
|
47292
|
-
min: minY
|
|
47293
|
-
}
|
|
47294
|
-
}
|
|
47295
|
-
};
|
|
47296
|
-
};
|
|
47297
|
-
|
|
47298
47518
|
function fillMissingKeysForChartData(data) {
|
|
47299
47519
|
var allKeys = new Set();
|
|
47300
47520
|
data.forEach(function (item) {
|
|
@@ -47388,15 +47608,6 @@ var buildBarChartRepresentation = function buildBarChartRepresentation(_ref) {
|
|
|
47388
47608
|
|
|
47389
47609
|
// ----- Formatting -----
|
|
47390
47610
|
|
|
47391
|
-
var formattingFunctionX = function formattingFunctionX(value) {
|
|
47392
|
-
if (!xKeyField) return '';
|
|
47393
|
-
return formattedResult.formatterFunc(value, {
|
|
47394
|
-
fieldId: xKeyField.fieldId,
|
|
47395
|
-
"function": xKeyField["function"],
|
|
47396
|
-
outputDataType: xKeyField.outputDataType
|
|
47397
|
-
}).formattedValue;
|
|
47398
|
-
};
|
|
47399
|
-
|
|
47400
47611
|
// (value: any, noValueReplacement?: string) => string;
|
|
47401
47612
|
var formattingFunctionY = function formattingFunctionY(value) {
|
|
47402
47613
|
// Use any y axis field as they are all formatted in the same way (for now...);
|
|
@@ -47440,13 +47651,15 @@ var buildBarChartRepresentation = function buildBarChartRepresentation(_ref) {
|
|
|
47440
47651
|
|
|
47441
47652
|
// ----- Ticks -----
|
|
47442
47653
|
|
|
47443
|
-
var ticks = getScaleAndTicks
|
|
47654
|
+
var ticks = getScaleAndTicks({
|
|
47444
47655
|
data: updatedData,
|
|
47445
47656
|
xKey: xKey,
|
|
47446
47657
|
xScaleDataType: xScaleDataType,
|
|
47447
47658
|
yKeys: yKeys,
|
|
47448
47659
|
tickCountYAxis: approxYAxisLabelCount,
|
|
47449
|
-
formattingFunctionX: formattingFunctionX
|
|
47660
|
+
formattingFunctionX: function formattingFunctionX$1(value) {
|
|
47661
|
+
return formattingFunctionX(value, formattedResult, xKeyField);
|
|
47662
|
+
},
|
|
47450
47663
|
formattingFunctionY: formattingFunctionY,
|
|
47451
47664
|
nullValue: nullValue,
|
|
47452
47665
|
order: order,
|
|
@@ -47658,7 +47871,7 @@ var BarChartV2View = function BarChartV2View(props) {
|
|
|
47658
47871
|
return jsxRuntime.jsx(BarChart$5, {
|
|
47659
47872
|
width: parent.width,
|
|
47660
47873
|
height: parent.height,
|
|
47661
|
-
chart: adjustTicks(chartRepresentation, parent.width),
|
|
47874
|
+
chart: adjustTicks(chartRepresentation, parent.width, parent.height),
|
|
47662
47875
|
options: {
|
|
47663
47876
|
stacked: !!props.attributes.stacked,
|
|
47664
47877
|
removeStroke: false,
|
|
@@ -47666,8 +47879,7 @@ var BarChartV2View = function BarChartV2View(props) {
|
|
|
47666
47879
|
showLegend: props.attributes.legend,
|
|
47667
47880
|
axis: {
|
|
47668
47881
|
showXAxisLabels: props.attributes.approxXAxisLabelCount !== 0,
|
|
47669
|
-
|
|
47670
|
-
showYAxisLabels: props.attributes.approxYAxisLabelCount !== 0 // shared-ui/src/library/StylePanel/AxisPreferenceSection.tsx
|
|
47882
|
+
showYAxisLabels: props.attributes.approxYAxisLabelCount !== 0
|
|
47671
47883
|
}
|
|
47672
47884
|
},
|
|
47673
47885
|
theme: theme == null ? void 0 : theme.charts,
|
|
@@ -47756,30 +47968,30 @@ function getBarFill$1(bars, conditionalFormattingRules, barKey, barValues) {
|
|
|
47756
47968
|
return fill;
|
|
47757
47969
|
}
|
|
47758
47970
|
|
|
47759
|
-
var ASSUMED_AVERAGE_CHAR_WIDTH$
|
|
47760
|
-
function calculateWordWidth$
|
|
47971
|
+
var ASSUMED_AVERAGE_CHAR_WIDTH$1 = 8.8;
|
|
47972
|
+
function calculateWordWidth$1(word, avgCharWidth) {
|
|
47761
47973
|
if (avgCharWidth === void 0) {
|
|
47762
|
-
avgCharWidth = ASSUMED_AVERAGE_CHAR_WIDTH$
|
|
47974
|
+
avgCharWidth = ASSUMED_AVERAGE_CHAR_WIDTH$1;
|
|
47763
47975
|
}
|
|
47764
47976
|
return word.length * avgCharWidth;
|
|
47765
47977
|
}
|
|
47766
47978
|
|
|
47767
47979
|
/** Reduce width proportionally to simulate spacing / padding between ticks. */
|
|
47768
|
-
var widthWithSpacing$
|
|
47980
|
+
var widthWithSpacing$1 = function widthWithSpacing(width) {
|
|
47769
47981
|
var THIRTY_PERCENT = 0.3;
|
|
47770
47982
|
return width - width * THIRTY_PERCENT;
|
|
47771
47983
|
};
|
|
47772
|
-
function howManyTicksFitInWidth$
|
|
47984
|
+
function howManyTicksFitInWidth$1(ticks, maxWidth, avgCharWidth) {
|
|
47773
47985
|
if (avgCharWidth === void 0) {
|
|
47774
|
-
avgCharWidth = ASSUMED_AVERAGE_CHAR_WIDTH$
|
|
47986
|
+
avgCharWidth = ASSUMED_AVERAGE_CHAR_WIDTH$1;
|
|
47775
47987
|
}
|
|
47776
47988
|
var fittedTicks = [];
|
|
47777
47989
|
var currentWidth = 0;
|
|
47778
47990
|
for (var _iterator = _createForOfIteratorHelperLoose(ticks), _step; !(_step = _iterator()).done;) {
|
|
47779
47991
|
var tick = _step.value;
|
|
47780
47992
|
var word = (tick == null ? void 0 : tick.formattedValue) || '';
|
|
47781
|
-
var wordWidth = calculateWordWidth$
|
|
47782
|
-
if (currentWidth + wordWidth <= widthWithSpacing$
|
|
47993
|
+
var wordWidth = calculateWordWidth$1(word, avgCharWidth);
|
|
47994
|
+
if (currentWidth + wordWidth <= widthWithSpacing$1(maxWidth)) {
|
|
47783
47995
|
fittedTicks.push(tick);
|
|
47784
47996
|
currentWidth += wordWidth + avgCharWidth; // Add space between words
|
|
47785
47997
|
} else {
|
|
@@ -47788,7 +48000,7 @@ function howManyTicksFitInWidth$2(ticks, maxWidth, avgCharWidth) {
|
|
|
47788
48000
|
}
|
|
47789
48001
|
return fittedTicks.length;
|
|
47790
48002
|
}
|
|
47791
|
-
function pickEquallySpaced$
|
|
48003
|
+
function pickEquallySpaced$1(arr, numPicks) {
|
|
47792
48004
|
if (numPicks >= arr.length) {
|
|
47793
48005
|
return arr; // If numPicks is greater than or equal to the array length, return the whole array
|
|
47794
48006
|
}
|
|
@@ -47800,19 +48012,19 @@ function pickEquallySpaced$2(arr, numPicks) {
|
|
|
47800
48012
|
}
|
|
47801
48013
|
return result;
|
|
47802
48014
|
}
|
|
47803
|
-
var adjustTicks$
|
|
48015
|
+
var adjustTicks$1 = function adjustTicks(waterfallChartRepresentation, width) {
|
|
47804
48016
|
waterfallChartRepresentation = _.cloneDeep(waterfallChartRepresentation);
|
|
47805
48017
|
|
|
47806
48018
|
// TODO; take this from the theme override...
|
|
47807
|
-
var averageCharacterWidth = ASSUMED_AVERAGE_CHAR_WIDTH$
|
|
47808
|
-
var numberOfTicksFittingIntoSpace = howManyTicksFitInWidth$
|
|
48019
|
+
var averageCharacterWidth = ASSUMED_AVERAGE_CHAR_WIDTH$1;
|
|
48020
|
+
var numberOfTicksFittingIntoSpace = howManyTicksFitInWidth$1(waterfallChartRepresentation.x.ticks || [], width, averageCharacterWidth);
|
|
47809
48021
|
var MINIMUM_NUMBER_OF_TICKS = 2;
|
|
47810
48022
|
if (numberOfTicksFittingIntoSpace < MINIMUM_NUMBER_OF_TICKS) {
|
|
47811
48023
|
numberOfTicksFittingIntoSpace = MINIMUM_NUMBER_OF_TICKS;
|
|
47812
48024
|
}
|
|
47813
48025
|
|
|
47814
48026
|
// @ts-ignore
|
|
47815
|
-
waterfallChartRepresentation.x.ticks = pickEquallySpaced$
|
|
48027
|
+
waterfallChartRepresentation.x.ticks = pickEquallySpaced$1(waterfallChartRepresentation.x.ticks, numberOfTicksFittingIntoSpace);
|
|
47816
48028
|
return waterfallChartRepresentation;
|
|
47817
48029
|
};
|
|
47818
48030
|
|
|
@@ -48060,7 +48272,7 @@ var WaterfallChart$2 = function WaterfallChart(_ref) {
|
|
|
48060
48272
|
keys: [y.key]
|
|
48061
48273
|
});
|
|
48062
48274
|
var adjustedChartRepresentation = React.useMemo(function () {
|
|
48063
|
-
return adjustTicks$
|
|
48275
|
+
return adjustTicks$1(_extends({}, chartCopy), width);
|
|
48064
48276
|
}, [chartCopy, width]);
|
|
48065
48277
|
var formattedChartDataForBarChart = _extends({}, adjustedChartRepresentation, {
|
|
48066
48278
|
y: formattedYAxisForBarChart,
|
|
@@ -48334,7 +48546,7 @@ var Bar$1 = function Bar(_ref4) {
|
|
|
48334
48546
|
});
|
|
48335
48547
|
};
|
|
48336
48548
|
|
|
48337
|
-
function getNiceInterval$
|
|
48549
|
+
function getNiceInterval$1(interval) {
|
|
48338
48550
|
// Round the interval to a "nice" value (1, 2, 5, etc.)
|
|
48339
48551
|
var exponent = Math.floor(Math.log10(interval));
|
|
48340
48552
|
var fraction = interval / Math.pow(10, exponent);
|
|
@@ -48466,7 +48678,7 @@ var buildWaterfallChartRepresentation = function buildWaterfallChartRepresentati
|
|
|
48466
48678
|
outputDataType: nonPivotField.outputDataType
|
|
48467
48679
|
}).formattedValue;
|
|
48468
48680
|
};
|
|
48469
|
-
var yTickInterval = getNiceInterval$
|
|
48681
|
+
var yTickInterval = getNiceInterval$1((yMaxValue - yMinValue) / (approxYAxisLabelCount - 1));
|
|
48470
48682
|
for (var i = 0; i < approxYAxisLabelCount; i++) {
|
|
48471
48683
|
var value = (yMinValue + i) * yTickInterval;
|
|
48472
48684
|
var formattedValue = formattingFunctionY(value);
|
|
@@ -48691,6 +48903,352 @@ var WaterfallChart$3 = function WaterfallChart(_ref) {
|
|
|
48691
48903
|
}));
|
|
48692
48904
|
};
|
|
48693
48905
|
|
|
48906
|
+
var buildAreaChartRepresentation = function buildAreaChartRepresentation(_ref) {
|
|
48907
|
+
var _xKeys$, _axisTitles$x, _axisTitles$y;
|
|
48908
|
+
var axisTitles = _ref.axisTitles,
|
|
48909
|
+
colors = _ref.colors,
|
|
48910
|
+
conditionalFormattingAttributes = _ref.conditionalFormattingAttributes,
|
|
48911
|
+
dateTimeFormatOptions = _ref.dateTimeFormatOptions,
|
|
48912
|
+
defaultFormats = _ref.defaultFormats,
|
|
48913
|
+
goalLineAttributes = _ref.goalLineAttributes,
|
|
48914
|
+
nullValue = _ref.nullValue,
|
|
48915
|
+
numberFormatOptions = _ref.numberFormatOptions,
|
|
48916
|
+
order = _ref.order,
|
|
48917
|
+
pivotConfig = _ref.pivotConfig,
|
|
48918
|
+
result = _ref.result,
|
|
48919
|
+
xAxisFormat = _ref.xAxisFormat,
|
|
48920
|
+
xAxisPostfix = _ref.xAxisPostfix,
|
|
48921
|
+
xAxisPrefix = _ref.xAxisPrefix,
|
|
48922
|
+
yAxisFormat = _ref.yAxisFormat,
|
|
48923
|
+
yAxisPostfix = _ref.yAxisPostfix,
|
|
48924
|
+
yAxisPrefix = _ref.yAxisPrefix,
|
|
48925
|
+
approxYAxisLabelCount = _ref.approxYAxisLabelCount,
|
|
48926
|
+
seriesLabelFormatter = _ref.seriesLabelFormatter,
|
|
48927
|
+
_valueAlias = _ref.valueAlias,
|
|
48928
|
+
stacked = _ref.stacked;
|
|
48929
|
+
var activeDateTimeFormats = {};
|
|
48930
|
+
var _buildFieldFormatMaps = buildFieldFormatMaps(result, pivotConfig, xAxisPrefix, xAxisPostfix, xAxisFormat, yAxisPrefix, yAxisPostfix, yAxisFormat, nullValue, numberFormatOptions),
|
|
48931
|
+
allPrefixes = _buildFieldFormatMaps.allPrefixes,
|
|
48932
|
+
allPostfixes = _buildFieldFormatMaps.allPostfixes,
|
|
48933
|
+
nullValues = _buildFieldFormatMaps.nullValues,
|
|
48934
|
+
activeNumberFormats = _buildFieldFormatMaps.activeNumberFormats;
|
|
48935
|
+
|
|
48936
|
+
// Build params for the result formatter.
|
|
48937
|
+
var params = {
|
|
48938
|
+
defaultFormats: defaultFormats,
|
|
48939
|
+
dateTimeFormatOptions: dateTimeFormatOptions,
|
|
48940
|
+
numberFormatOptions: numberFormatOptions,
|
|
48941
|
+
valueAlias: function valueAlias(params) {
|
|
48942
|
+
if (typeof _valueAlias === 'function') {
|
|
48943
|
+
// TODO; it is more useful providing this information separate,
|
|
48944
|
+
// rather than building it into an ID and returning it. Ideally all would be returned
|
|
48945
|
+
return String(_valueAlias({
|
|
48946
|
+
fieldId: id({
|
|
48947
|
+
field: params.fieldId,
|
|
48948
|
+
"function": params["function"]
|
|
48949
|
+
}),
|
|
48950
|
+
value: params.value
|
|
48951
|
+
}));
|
|
48952
|
+
}
|
|
48953
|
+
return undefined;
|
|
48954
|
+
},
|
|
48955
|
+
nullValue: nullValues,
|
|
48956
|
+
prefixes: allPrefixes,
|
|
48957
|
+
postfixes: allPostfixes,
|
|
48958
|
+
activeNumberFormats: activeNumberFormats,
|
|
48959
|
+
activeDateTimeFormats: activeDateTimeFormats
|
|
48960
|
+
};
|
|
48961
|
+
var formattedResult = formatResult(result, params);
|
|
48962
|
+
|
|
48963
|
+
// --------------------------------------------
|
|
48964
|
+
// --------------------------------------------
|
|
48965
|
+
// --------------------------------------------
|
|
48966
|
+
// --------------------------------------------
|
|
48967
|
+
// --------------------------------------------
|
|
48968
|
+
// --------------------------------------------
|
|
48969
|
+
// --------------------------------------------
|
|
48970
|
+
// --------------------------------------------
|
|
48971
|
+
|
|
48972
|
+
// ----- xKey -----
|
|
48973
|
+
|
|
48974
|
+
var xKeyField = getXKeyField(pivotConfig, result.fields);
|
|
48975
|
+
|
|
48976
|
+
// ----- Formatting ----
|
|
48977
|
+
// (value: any, noValueReplacement?: string) => string;
|
|
48978
|
+
var formattingFunctionY = function formattingFunctionY(value) {
|
|
48979
|
+
// Use any y axis field as they are all formatted in the same way (for now...);
|
|
48980
|
+
var nonPivotField = formattedResult.fields.find(function (resultField) {
|
|
48981
|
+
return ![].concat(pivotConfig.x, pivotConfig.y).includes(resultField.id);
|
|
48982
|
+
});
|
|
48983
|
+
if (!nonPivotField) return '';
|
|
48984
|
+
return formattedResult.formatterFunc(value, {
|
|
48985
|
+
fieldId: nonPivotField.fieldId,
|
|
48986
|
+
"function": nonPivotField["function"],
|
|
48987
|
+
outputDataType: nonPivotField.outputDataType
|
|
48988
|
+
}).formattedValue;
|
|
48989
|
+
};
|
|
48990
|
+
|
|
48991
|
+
// ----- Keys & Prep -----
|
|
48992
|
+
var xScaleDataType = (xKeyField == null ? void 0 : xKeyField.outputDataType) || 'string';
|
|
48993
|
+
var _formattedResultToSer = formattedResultToSeries(formattedResult, pivotConfig, seriesLabelFormatter),
|
|
48994
|
+
keys = _formattedResultToSer.keys,
|
|
48995
|
+
yKeys = _formattedResultToSer.yKeys,
|
|
48996
|
+
xKeys = _formattedResultToSer.xKeys,
|
|
48997
|
+
chartData = _formattedResultToSer.seriesData;
|
|
48998
|
+
var xKey = (_xKeys$ = xKeys[0]) != null ? _xKeys$ : null;
|
|
48999
|
+
var updatedData = function () {
|
|
49000
|
+
var hasMultipleGroups = result.fields.length > 2;
|
|
49001
|
+
var data = chartData;
|
|
49002
|
+
if (hasMultipleGroups) {
|
|
49003
|
+
data = fillMissingKeysForChartData(chartData);
|
|
49004
|
+
}
|
|
49005
|
+
if (stacked) {
|
|
49006
|
+
data = fillMissingKeysForChartData(data);
|
|
49007
|
+
}
|
|
49008
|
+
return data;
|
|
49009
|
+
}();
|
|
49010
|
+
|
|
49011
|
+
// ----- Goal Lines -----
|
|
49012
|
+
|
|
49013
|
+
var goalLines = getGoalLines({
|
|
49014
|
+
goalLineAttributes: goalLineAttributes,
|
|
49015
|
+
formattingFunctionY: formattingFunctionY
|
|
49016
|
+
});
|
|
49017
|
+
|
|
49018
|
+
// ----- Ticks -----
|
|
49019
|
+
|
|
49020
|
+
var ticks = getScaleAndTicks({
|
|
49021
|
+
data: updatedData,
|
|
49022
|
+
xKey: xKey,
|
|
49023
|
+
xScaleDataType: xScaleDataType,
|
|
49024
|
+
yKeys: yKeys,
|
|
49025
|
+
tickCountYAxis: approxYAxisLabelCount,
|
|
49026
|
+
formattingFunctionX: function formattingFunctionX$1(value) {
|
|
49027
|
+
return formattingFunctionX(value, formattedResult, xKeyField);
|
|
49028
|
+
},
|
|
49029
|
+
formattingFunctionY: formattingFunctionY,
|
|
49030
|
+
nullValue: nullValue,
|
|
49031
|
+
order: order,
|
|
49032
|
+
goalLines: goalLines
|
|
49033
|
+
});
|
|
49034
|
+
|
|
49035
|
+
// ----- Lines -----
|
|
49036
|
+
|
|
49037
|
+
var styleDefinition = getStyleDefinition({
|
|
49038
|
+
colors: colors,
|
|
49039
|
+
yKeys: yKeys,
|
|
49040
|
+
style: {
|
|
49041
|
+
toOpacity: 0.5,
|
|
49042
|
+
fromOpacity: 0.9,
|
|
49043
|
+
type: 'area'
|
|
49044
|
+
}
|
|
49045
|
+
});
|
|
49046
|
+
|
|
49047
|
+
// ----- Conditional Formatting -----
|
|
49048
|
+
|
|
49049
|
+
var conditionalFormattingRules = getConditionalFormatting({
|
|
49050
|
+
conditionalFormattingAttributes: conditionalFormattingAttributes
|
|
49051
|
+
});
|
|
49052
|
+
var chart = {
|
|
49053
|
+
keys: keys,
|
|
49054
|
+
x: {
|
|
49055
|
+
ticks: ticks.x.ticks,
|
|
49056
|
+
scale: {
|
|
49057
|
+
dataType: ticks.x.scale.dataType,
|
|
49058
|
+
key: ticks.x.scale.key,
|
|
49059
|
+
ordering: ticks.x.scale.ordering,
|
|
49060
|
+
min: ticks.x.scale.min,
|
|
49061
|
+
max: ticks.x.scale.max
|
|
49062
|
+
},
|
|
49063
|
+
key: xKey,
|
|
49064
|
+
postfix: xAxisPostfix,
|
|
49065
|
+
prefix: xAxisPrefix,
|
|
49066
|
+
title: (_axisTitles$x = axisTitles == null ? void 0 : axisTitles.x) != null ? _axisTitles$x : null
|
|
49067
|
+
},
|
|
49068
|
+
y: {
|
|
49069
|
+
ticks: ticks.y.ticks,
|
|
49070
|
+
scale: {
|
|
49071
|
+
dataType: ticks.y.scale.dataType,
|
|
49072
|
+
key: ticks.y.scale.key,
|
|
49073
|
+
ordering: ticks.y.scale.ordering,
|
|
49074
|
+
min: ticks.y.scale.min,
|
|
49075
|
+
max: ticks.y.scale.max
|
|
49076
|
+
},
|
|
49077
|
+
keys: yKeys,
|
|
49078
|
+
postfix: yAxisPostfix,
|
|
49079
|
+
prefix: yAxisPrefix,
|
|
49080
|
+
title: (_axisTitles$y = axisTitles == null ? void 0 : axisTitles.y) != null ? _axisTitles$y : null
|
|
49081
|
+
},
|
|
49082
|
+
data: updatedData,
|
|
49083
|
+
areas: styleDefinition,
|
|
49084
|
+
conditionalFormattingRules: conditionalFormattingRules,
|
|
49085
|
+
goalLines: goalLines
|
|
49086
|
+
};
|
|
49087
|
+
return chart;
|
|
49088
|
+
};
|
|
49089
|
+
|
|
49090
|
+
var AreaChartV2View = function AreaChartV2View(props) {
|
|
49091
|
+
var _props$library, _props$attributes$vie;
|
|
49092
|
+
var _useDashboardBehaviou = useDashboardBehaviourContext(),
|
|
49093
|
+
textOverride = _useDashboardBehaviou.textOverride,
|
|
49094
|
+
valueAlias = _useDashboardBehaviou.valueAlias,
|
|
49095
|
+
labelFormat = _useDashboardBehaviou.labelFormat,
|
|
49096
|
+
queryEngineConfig = _useDashboardBehaviou.queryEngineConfig;
|
|
49097
|
+
var headerProps = {
|
|
49098
|
+
displayTitle: props.attributes.displayTitle,
|
|
49099
|
+
displaySubject: props.attributes.displaySubject,
|
|
49100
|
+
verified: props.attributes.protectedByOrganisation,
|
|
49101
|
+
library: (_props$library = props.library) != null ? _props$library : false,
|
|
49102
|
+
localFilters: props.localFilters,
|
|
49103
|
+
setLocalFilters: props.setLocalFilters,
|
|
49104
|
+
dataSet: props.dataSet,
|
|
49105
|
+
parameters: props == null ? void 0 : props.attributes.parameters,
|
|
49106
|
+
componentType: props == null ? void 0 : props.attributes.type,
|
|
49107
|
+
measure: props == null ? void 0 : props.attributes.measure,
|
|
49108
|
+
dimension: props == null ? void 0 : props.attributes.dimension,
|
|
49109
|
+
timeDimension: props.attributes.timeDimension,
|
|
49110
|
+
setPartialAttributes: props.setPartialAttributes,
|
|
49111
|
+
viewId: (_props$attributes$vie = props == null ? void 0 : props.attributes.viewId) != null ? _props$attributes$vie : '',
|
|
49112
|
+
order: props.attributes.order
|
|
49113
|
+
};
|
|
49114
|
+
var showHeadline = headlineAvailable(props.attributes.order, props.attributes.headline, null);
|
|
49115
|
+
var theme = useTheme();
|
|
49116
|
+
var AreaChartV2Component = getComponentInterface(props.attributes.type);
|
|
49117
|
+
var pivotConfig = init$c(props.attributes);
|
|
49118
|
+
var chartRepresentation = null;
|
|
49119
|
+
if (!isLoading(props.result) && !hasFailed(props.result) && !isEmpty(props.result) && AreaChartV2Component.isRunnable(props.attributes)) {
|
|
49120
|
+
var _theme$charts$colors, _theme$charts, _props$attributes$goa;
|
|
49121
|
+
chartRepresentation = buildAreaChartRepresentation({
|
|
49122
|
+
axisTitles: props.attributes.axisTitles,
|
|
49123
|
+
xAxisPostfix: props.attributes.xAxisPostfix,
|
|
49124
|
+
xAxisPrefix: props.attributes.xAxisPrefix,
|
|
49125
|
+
yAxisPostfix: props.attributes.yAxisPostfix,
|
|
49126
|
+
yAxisPrefix: props.attributes.yAxisPrefix,
|
|
49127
|
+
yAxisFormat: props.attributes.yAxisFormat,
|
|
49128
|
+
xAxisFormat: props.attributes.xAxisFormat,
|
|
49129
|
+
approxYAxisLabelCount: props.attributes.approxYAxisLabelCount === 'auto' ? 10 : props.attributes.approxYAxisLabelCount,
|
|
49130
|
+
colors: (_theme$charts$colors = theme == null || (_theme$charts = theme.charts) == null ? void 0 : _theme$charts.colors) != null ? _theme$charts$colors : DEFAULT_CHART_COLORS,
|
|
49131
|
+
valueAlias: valueAlias,
|
|
49132
|
+
nullValue: checkForNullValue(props.attributes.dataSetId, props.attributes.dimension, props.attributes.timeDimension, textOverride, valueAlias),
|
|
49133
|
+
result: props.result,
|
|
49134
|
+
pivotConfig: pivotConfig,
|
|
49135
|
+
order: props.attributes.order,
|
|
49136
|
+
numberFormatOptions: props.numberFormatOptions,
|
|
49137
|
+
dateTimeFormatOptions: props.dateTimeFormatOptions,
|
|
49138
|
+
goalLineAttributes: (_props$attributes$goa = props.attributes.goalLines) != null ? _props$attributes$goa : [],
|
|
49139
|
+
conditionalFormattingAttributes: props.attributes.conditionalFormattingRules,
|
|
49140
|
+
defaultFormats: props.defaultFormats,
|
|
49141
|
+
seriesLabelFormatter: function seriesLabelFormatter(labelFormatParams) {
|
|
49142
|
+
var _queryEngineConfig$su, _queryEngineConfig$su2, _queryEngineConfig$su3;
|
|
49143
|
+
var yResultField = labelFormatParams.yResultField,
|
|
49144
|
+
yPivotFields = labelFormatParams.yPivotFields,
|
|
49145
|
+
row = labelFormatParams.row;
|
|
49146
|
+
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);
|
|
49147
|
+
var formattedFunction = yResultField["function"] === 'none' ? '' : " \u2022 " + formattedFunctionName;
|
|
49148
|
+
var defaultLabelFormat = "" + yPivotFields.map(function (field) {
|
|
49149
|
+
return row[field.id].formattedValue;
|
|
49150
|
+
}).join(' • ') + (yPivotFields.length === 0 ? '' : ' • ') + yResultField.publicName + formattedFunction;
|
|
49151
|
+
if (!labelFormat) return defaultLabelFormat;
|
|
49152
|
+
return labelFormat({
|
|
49153
|
+
viewId: props.attributes.viewId,
|
|
49154
|
+
fieldId: yResultField.fieldId,
|
|
49155
|
+
func: yResultField["function"],
|
|
49156
|
+
type: 'areaChartV2',
|
|
49157
|
+
defaultLabel: defaultLabelFormat
|
|
49158
|
+
}) || defaultLabelFormat;
|
|
49159
|
+
},
|
|
49160
|
+
stacked: props.attributes.stacked
|
|
49161
|
+
});
|
|
49162
|
+
}
|
|
49163
|
+
|
|
49164
|
+
// When these are triggered they don't render the chart after they're resolved, potentially because component did no re-render?
|
|
49165
|
+
if (!AreaChartV2Component.isRunnable(props.attributes)) {
|
|
49166
|
+
return jsxRuntime.jsx(QueryUnderConstructionNotice, {
|
|
49167
|
+
title: "Missing parameters"
|
|
49168
|
+
});
|
|
49169
|
+
}
|
|
49170
|
+
if (isLoading(props.result)) return jsxRuntime.jsx(LoadingComponent, {});
|
|
49171
|
+
if (hasFailed(props.result)) return jsxRuntime.jsx(FailedToLoadDataNotice, {});
|
|
49172
|
+
if (isEmpty(props.result)) return jsxRuntime.jsx(NoResultContentToShowNotice, _extends({}, headerProps));
|
|
49173
|
+
return jsxRuntime.jsx(React.Suspense, {
|
|
49174
|
+
fallback: jsxRuntime.jsx(LoadingComponent, {}),
|
|
49175
|
+
children: jsxRuntime.jsxs(ViewWrapper, {
|
|
49176
|
+
id: props.id,
|
|
49177
|
+
queriesAreChanging: props.queriesAreChanging,
|
|
49178
|
+
children: [jsxRuntime.jsx(ViewHeader, _extends({}, headerProps, {
|
|
49179
|
+
paddingBottom: showHeadline ? '0.5rem' : undefined
|
|
49180
|
+
})), showHeadline && jsxRuntime.jsx(HeadlineStats, _extends({}, props.propsForHeadline)), jsxRuntime.jsx("div", {
|
|
49181
|
+
className: styles({
|
|
49182
|
+
flex: '1',
|
|
49183
|
+
position: 'relative'
|
|
49184
|
+
}),
|
|
49185
|
+
"aria-disabled": props.library,
|
|
49186
|
+
children: chartRepresentation && jsxRuntime.jsx(responsive.ParentSize, {
|
|
49187
|
+
style: {
|
|
49188
|
+
position: 'absolute',
|
|
49189
|
+
width: '100%',
|
|
49190
|
+
height: '100%',
|
|
49191
|
+
overflowX: 'hidden'
|
|
49192
|
+
},
|
|
49193
|
+
children: function children(parent) {
|
|
49194
|
+
var _props$attributes$vie2, _props$attributes$sta;
|
|
49195
|
+
if (chartRepresentation.areas.length === 0) return jsxRuntime.jsx(LoadingComponent, {});
|
|
49196
|
+
return jsxRuntime.jsx(v2.AreaChartV2, {
|
|
49197
|
+
width: parent.width,
|
|
49198
|
+
height: parent.height,
|
|
49199
|
+
chart: adjustTicks(chartRepresentation, parent.width, parent.height),
|
|
49200
|
+
uniqueId: (_props$attributes$vie2 = props.attributes.viewId) != null ? _props$attributes$vie2 : 'area-chart',
|
|
49201
|
+
options: {
|
|
49202
|
+
stacked: (_props$attributes$sta = props.attributes.stacked) != null ? _props$attributes$sta : false,
|
|
49203
|
+
curve: props.attributes.lineCurve,
|
|
49204
|
+
removeStroke: false,
|
|
49205
|
+
showRoundedTotal: false,
|
|
49206
|
+
showLegend: props.attributes.legend,
|
|
49207
|
+
axis: {
|
|
49208
|
+
showXAxisLabels: props.attributes.approxXAxisLabelCount !== 0,
|
|
49209
|
+
showYAxisLabels: props.attributes.approxYAxisLabelCount !== 0
|
|
49210
|
+
}
|
|
49211
|
+
},
|
|
49212
|
+
theme: theme == null ? void 0 : theme.charts
|
|
49213
|
+
});
|
|
49214
|
+
}
|
|
49215
|
+
})
|
|
49216
|
+
})]
|
|
49217
|
+
})
|
|
49218
|
+
});
|
|
49219
|
+
};
|
|
49220
|
+
|
|
49221
|
+
var AreaChartV2 = function AreaChartV2(props) {
|
|
49222
|
+
var _props$component = props.component,
|
|
49223
|
+
results = _props$component.results,
|
|
49224
|
+
attributes = _props$component.attributes,
|
|
49225
|
+
localFilters = _props$component.localFilters;
|
|
49226
|
+
var dashboardBehaviour = props.dashboardBehaviour;
|
|
49227
|
+
var _useComponentEffect = useComponentEffect(attributes, props.dataSet, dashboardBehaviour.queryEngineConfig, {
|
|
49228
|
+
localFilters: localFilters,
|
|
49229
|
+
globalFilters: props.globalFilters
|
|
49230
|
+
}, props.updateComponentAttributes, props.runQueriesCallback, props.setResults, dashboardBehaviour.variables),
|
|
49231
|
+
queriesAreChanging = _useComponentEffect.queriesAreChanging;
|
|
49232
|
+
return jsxRuntime.jsx(AreaChartV2View, {
|
|
49233
|
+
id: props.id,
|
|
49234
|
+
attributes: attributes,
|
|
49235
|
+
dataSet: props.dataSet,
|
|
49236
|
+
localFilters: props.component.localFilters,
|
|
49237
|
+
setLocalFilters: props.setLocalFilters,
|
|
49238
|
+
setPartialAttributes: function setPartialAttributes(changes) {
|
|
49239
|
+
return props.setPartialAttributes(changes);
|
|
49240
|
+
},
|
|
49241
|
+
result: results && results[0],
|
|
49242
|
+
queriesAreChanging: queriesAreChanging,
|
|
49243
|
+
numberFormatOptions: dashboardBehaviour.numberFormatOptions,
|
|
49244
|
+
dateTimeFormatOptions: dashboardBehaviour.dateTimeFormatOptions,
|
|
49245
|
+
defaultFormats: dashboardBehaviour.defaultFormats,
|
|
49246
|
+
propsForHeadline: props,
|
|
49247
|
+
idPrefix: props.idPrefix,
|
|
49248
|
+
library: props == null ? void 0 : props.library
|
|
49249
|
+
});
|
|
49250
|
+
};
|
|
49251
|
+
|
|
48694
49252
|
var Component = function Component(props) {
|
|
48695
49253
|
var _useDashboardContext = useDashboardContext(),
|
|
48696
49254
|
dashboard = _useDashboardContext.dashboard;
|
|
@@ -48833,7 +49391,7 @@ var Component = function Component(props) {
|
|
|
48833
49391
|
});
|
|
48834
49392
|
},
|
|
48835
49393
|
onError: dashboardBehaviour.onError,
|
|
48836
|
-
children: jsxRuntime.jsx(AreaChart$
|
|
49394
|
+
children: jsxRuntime.jsx(AreaChart$4, {
|
|
48837
49395
|
id: props.id,
|
|
48838
49396
|
setLocalFilters: props.setLocalFilters,
|
|
48839
49397
|
dataSet: dataSet,
|
|
@@ -48931,6 +49489,32 @@ var Component = function Component(props) {
|
|
|
48931
49489
|
})
|
|
48932
49490
|
});
|
|
48933
49491
|
}
|
|
49492
|
+
if (props.component.attributes.type == 'areaChartV2') {
|
|
49493
|
+
return jsxRuntime.jsx(ErrorBoundary, {
|
|
49494
|
+
renderOnError: function renderOnError(onManualRetry) {
|
|
49495
|
+
return jsxRuntime.jsx(ComponentErrorNotice, {
|
|
49496
|
+
onManualRetry: onManualRetry
|
|
49497
|
+
});
|
|
49498
|
+
},
|
|
49499
|
+
onError: dashboardBehaviour.onError,
|
|
49500
|
+
children: jsxRuntime.jsx(AreaChartV2, {
|
|
49501
|
+
id: props.id,
|
|
49502
|
+
setLocalFilters: props.setLocalFilters,
|
|
49503
|
+
dataSet: dataSet,
|
|
49504
|
+
updateComponentAttributes: function updateComponentAttributes(newAttributes) {
|
|
49505
|
+
return _updateComponentAttributes(newAttributes);
|
|
49506
|
+
},
|
|
49507
|
+
runQueriesCallback: props.runQueriesCallback,
|
|
49508
|
+
component: props.component,
|
|
49509
|
+
setResults: props.setResults,
|
|
49510
|
+
globalFilters: dashboard.globalFilters,
|
|
49511
|
+
dashboardBehaviour: dashboardBehaviour,
|
|
49512
|
+
library: props == null ? void 0 : props.library,
|
|
49513
|
+
idPrefix: idPrefix,
|
|
49514
|
+
setPartialAttributes: setPartialAttributes
|
|
49515
|
+
})
|
|
49516
|
+
});
|
|
49517
|
+
}
|
|
48934
49518
|
if (props.component.attributes.type == 'pieChart') {
|
|
48935
49519
|
return jsxRuntime.jsx(ErrorBoundary, {
|
|
48936
49520
|
renderOnError: function renderOnError(onManualRetry) {
|
|
@@ -65343,7 +65927,7 @@ var View$3 = /*#__PURE__*/function () {
|
|
|
65343
65927
|
};
|
|
65344
65928
|
return View;
|
|
65345
65929
|
}();
|
|
65346
|
-
var AreaChart$
|
|
65930
|
+
var AreaChart$5 = /*#__PURE__*/function (_View2) {
|
|
65347
65931
|
function AreaChart(attributes) {
|
|
65348
65932
|
return _View2.call(this, _extends({}, attributes, {
|
|
65349
65933
|
type: 'areaChart'
|
|
@@ -65712,6 +66296,8 @@ var toQueries$9 = commonToQueries;
|
|
|
65712
66296
|
|
|
65713
66297
|
var toQueries$a = commonToQueries;
|
|
65714
66298
|
|
|
66299
|
+
var toQueries$b = commonToQueries;
|
|
66300
|
+
|
|
65715
66301
|
var buildMainQueries = function buildMainQueries(attributes, dataSet, queryEngineConfig, params) {
|
|
65716
66302
|
var line = build$a(dataSet, attributes.lineMeasure, attributes.order, attributes.lineDimension, attributes.timeDimension, attributes.limit, attributes.offset, queryEngineConfig, params);
|
|
65717
66303
|
var bar = build$a(dataSet, attributes.barMeasure, attributes.order, attributes.barDimension, attributes.timeDimension, attributes.limit, attributes.offset, queryEngineConfig, params);
|
|
@@ -65720,7 +66306,7 @@ var buildMainQueries = function buildMainQueries(attributes, dataSet, queryEngin
|
|
|
65720
66306
|
line: line
|
|
65721
66307
|
};
|
|
65722
66308
|
};
|
|
65723
|
-
var toQueries$
|
|
66309
|
+
var toQueries$c = function toQueries(attributes, dataSet, queryEngineConfig, params) {
|
|
65724
66310
|
var _buildMainQueries = buildMainQueries(attributes, dataSet, queryEngineConfig, params),
|
|
65725
66311
|
line = _buildMainQueries.line,
|
|
65726
66312
|
bar = _buildMainQueries.bar;
|
|
@@ -65778,7 +66364,7 @@ var buildQueries = function buildQueries(attributes, dataSet, queryEngineConfig,
|
|
|
65778
66364
|
measureDescription: deltaQuery ? [mainQuery.measureDescription, deltaQuery.measureDescription] : [mainQuery.measureDescription]
|
|
65779
66365
|
};
|
|
65780
66366
|
};
|
|
65781
|
-
var toQueries$
|
|
66367
|
+
var toQueries$d = function toQueries(attributes, dataSet, queryEngineConfig, params) {
|
|
65782
66368
|
var _buildQueries = buildQueries(attributes, dataSet, queryEngineConfig, params),
|
|
65783
66369
|
queries = _buildQueries.queries,
|
|
65784
66370
|
measureDescription = _buildQueries.measureDescription;
|
|
@@ -65789,7 +66375,7 @@ var toQueries$c = function toQueries(attributes, dataSet, queryEngineConfig, par
|
|
|
65789
66375
|
};
|
|
65790
66376
|
};
|
|
65791
66377
|
|
|
65792
|
-
var toQueries$
|
|
66378
|
+
var toQueries$e = function toQueries(attributes, dataSet, queryEngineConfig, params) {
|
|
65793
66379
|
var measures = [];
|
|
65794
66380
|
attributes.xMeasure && measures.push(attributes.xMeasure);
|
|
65795
66381
|
attributes.yMeasure && measures.push(attributes.yMeasure);
|
|
@@ -65803,7 +66389,7 @@ var toQueries$d = function toQueries(attributes, dataSet, queryEngineConfig, par
|
|
|
65803
66389
|
};
|
|
65804
66390
|
};
|
|
65805
66391
|
|
|
65806
|
-
var toQueries$
|
|
66392
|
+
var toQueries$f = function toQueries(attributes, dataSet, queryEngineConfig, params) {
|
|
65807
66393
|
var measures = [];
|
|
65808
66394
|
attributes.xMeasure && measures.push(attributes.xMeasure);
|
|
65809
66395
|
attributes.yMeasure && measures.push(attributes.yMeasure);
|
|
@@ -65817,7 +66403,7 @@ var toQueries$e = function toQueries(attributes, dataSet, queryEngineConfig, par
|
|
|
65817
66403
|
};
|
|
65818
66404
|
};
|
|
65819
66405
|
|
|
65820
|
-
var toQueries$
|
|
66406
|
+
var toQueries$g = function toQueries$1(attributes, dataSet, queryEngineConfig, params) {
|
|
65821
66407
|
return toQueries([dataSet], [{
|
|
65822
66408
|
measure: attributes.measure,
|
|
65823
66409
|
dataSetId: dataSet.id,
|
|
@@ -65829,12 +66415,12 @@ var toQueries$f = function toQueries$1(attributes, dataSet, queryEngineConfig, p
|
|
|
65829
66415
|
}], queryEngineConfig, params);
|
|
65830
66416
|
};
|
|
65831
66417
|
|
|
65832
|
-
var toQueries$g = commonToQueries;
|
|
65833
|
-
|
|
65834
66418
|
var toQueries$h = commonToQueries;
|
|
65835
66419
|
|
|
65836
66420
|
var toQueries$i = commonToQueries;
|
|
65837
66421
|
|
|
66422
|
+
var toQueries$j = commonToQueries;
|
|
66423
|
+
|
|
65838
66424
|
var buildVizzlyViewQueries = function buildVizzlyViewQueries(attributes, dataSet, queryEngineConfig, params) {
|
|
65839
66425
|
switch (attributes.type) {
|
|
65840
66426
|
case 'areaChart':
|
|
@@ -65849,30 +66435,32 @@ var buildVizzlyViewQueries = function buildVizzlyViewQueries(attributes, dataSet
|
|
|
65849
66435
|
return toQueries$6(attributes, dataSet, queryEngineConfig, params);
|
|
65850
66436
|
case 'lineChartV2':
|
|
65851
66437
|
return toQueries$7(attributes, dataSet, queryEngineConfig, params);
|
|
65852
|
-
case '
|
|
66438
|
+
case 'areaChartV2':
|
|
65853
66439
|
return toQueries$8(attributes, dataSet, queryEngineConfig, params);
|
|
65854
|
-
case '
|
|
66440
|
+
case 'pieChart':
|
|
65855
66441
|
return toQueries$9(attributes, dataSet, queryEngineConfig, params);
|
|
65856
|
-
case '
|
|
66442
|
+
case 'dataTable':
|
|
65857
66443
|
return toQueries$a(attributes, dataSet, queryEngineConfig, params);
|
|
65858
|
-
case '
|
|
66444
|
+
case 'basicTable':
|
|
65859
66445
|
return toQueries$b(attributes, dataSet, queryEngineConfig, params);
|
|
65860
|
-
case '
|
|
66446
|
+
case 'comboChart':
|
|
65861
66447
|
return toQueries$c(attributes, dataSet, queryEngineConfig, params);
|
|
66448
|
+
case 'singleStat':
|
|
66449
|
+
return toQueries$d(attributes, dataSet, queryEngineConfig, params);
|
|
65862
66450
|
case 'progress':
|
|
65863
|
-
return toQueries$c(attributes, dataSet, queryEngineConfig, params);
|
|
65864
|
-
case 'scatterChart':
|
|
65865
66451
|
return toQueries$d(attributes, dataSet, queryEngineConfig, params);
|
|
65866
|
-
case '
|
|
66452
|
+
case 'scatterChart':
|
|
65867
66453
|
return toQueries$e(attributes, dataSet, queryEngineConfig, params);
|
|
65868
|
-
case '
|
|
66454
|
+
case 'bubbleChart':
|
|
65869
66455
|
return toQueries$f(attributes, dataSet, queryEngineConfig, params);
|
|
65870
|
-
case '
|
|
66456
|
+
case 'mercatorMap':
|
|
65871
66457
|
return toQueries$g(attributes, dataSet, queryEngineConfig, params);
|
|
65872
|
-
case '
|
|
66458
|
+
case 'funnelChart':
|
|
65873
66459
|
return toQueries$h(attributes, dataSet, queryEngineConfig, params);
|
|
65874
|
-
case '
|
|
66460
|
+
case 'richText':
|
|
65875
66461
|
return toQueries$i(attributes, dataSet, queryEngineConfig, params);
|
|
66462
|
+
case 'waterfallChart':
|
|
66463
|
+
return toQueries$j(attributes, dataSet, queryEngineConfig, params);
|
|
65876
66464
|
default:
|
|
65877
66465
|
throw 'Unsupported view when building query.';
|
|
65878
66466
|
}
|
|
@@ -67420,7 +68008,7 @@ VizzlyServices.Dashboard = Dashboard$1;
|
|
|
67420
68008
|
VizzlyServices.Editor = Editor;
|
|
67421
68009
|
VizzlyServices.Header = Header;
|
|
67422
68010
|
VizzlyServices.Library = Library$1;
|
|
67423
|
-
VizzlyServices.AreaChart = AreaChart$
|
|
68011
|
+
VizzlyServices.AreaChart = AreaChart$5;
|
|
67424
68012
|
VizzlyServices.LineChart = LineChart$6;
|
|
67425
68013
|
VizzlyServices.BarChart = BarChart$6;
|
|
67426
68014
|
VizzlyServices.PieChart = PieChart$4;
|
|
@@ -68744,7 +69332,8 @@ var attributesToAiView = function attributesToAiView(dataSet, originalAttributes
|
|
|
68744
69332
|
if (attributes.type === 'richText') throw 'Rich text views are not supported by Vizzly AI.';
|
|
68745
69333
|
if (attributes.type === 'lineChartV2') throw 'Line Chart V2 views are not supported by Vizzly AI.';
|
|
68746
69334
|
if (attributes.type === 'bubbleChart') throw 'Bubble Chart views are not supported by Vizzly AI.';
|
|
68747
|
-
if (attributes.type === 'barChartV2') throw '
|
|
69335
|
+
if (attributes.type === 'barChartV2') throw 'Bar Chart V2 views are not supported by Vizzly AI.';
|
|
69336
|
+
if (attributes.type === 'areaChartV2') throw 'Area Chart V2 views are not supported by Vizzly AI.';
|
|
68748
69337
|
if (attributes.type === 'waterfallChart') throw 'Waterfall chart views are not supported by Vizzly AI.';
|
|
68749
69338
|
var select = [];
|
|
68750
69339
|
var group = [];
|