@vizzly/dashboard 0.15.0-dev-65c3e5d7491389a56cc8409b046f92683dd4725f → 0.15.0
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/useXAxisLabelCount.d.ts +1 -1
- package/dist/charts/src/v2/components/Axis/AxisBottom.d.ts +1 -1
- package/dist/charts/src/v2/components/BarChart/BarChart.d.ts +2 -2
- package/dist/charts/src/v2/components/ChartWrapper/ChartWrapper.d.ts +2 -4
- package/dist/charts/src/v2/components/Tooltip/Tooltip.d.ts +1 -2
- package/dist/charts/src/v2/components/WaterfallChart/Tooltip.d.ts +2 -2
- package/dist/charts/src/v2/utils/components/BarGroup.d.ts +4 -4
- package/dist/charts/src/v2/utils/components/BarStacked.d.ts +4 -4
- package/dist/dashboard.cjs.development.js +1604 -1124
- package/dist/dashboard.cjs.production.min.js +1 -1
- package/dist/dashboard.esm.js +1605 -1125
- package/dist/results-driver/src/driver/VizzlyQuery/AreaChart/toQueries.d.ts +1 -1
- package/dist/results-driver/src/driver/VizzlyQuery/AreaChartV2/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/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/RadarChart/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/SunburstChart/toQueries.d.ts +1 -1
- package/dist/results-driver/src/driver/VizzlyQuery/WaterfallChart/toQueries.d.ts +1 -1
- package/dist/shared-logic/src/AdditionalFilter/types.d.ts +1 -4
- package/dist/shared-logic/src/BubbleChart/types.d.ts +0 -7
- package/dist/shared-logic/src/BubbleChartV2/buildBubbleChartRepresentation.d.ts +7 -4
- package/dist/shared-logic/src/BubbleChartV2/getScaleAndTicks.d.ts +3 -4
- package/dist/shared-logic/src/BubbleChartV2/types.d.ts +0 -8
- package/dist/shared-logic/src/ChartsV2/adjustTicks.d.ts +3 -3
- package/dist/shared-logic/src/Component/types.d.ts +1 -0
- package/dist/shared-logic/src/CustomField/SimpleMath/index.d.ts +1 -1
- package/dist/shared-logic/src/Filter/Filter.d.ts +1 -1
- package/dist/shared-logic/src/Filter/Where.d.ts +6 -0
- package/dist/shared-logic/src/Filter/types.d.ts +4 -2
- package/dist/shared-logic/src/JSQueryEngine/types.d.ts +8 -2
- package/dist/shared-logic/src/Query/Query.d.ts +3 -9
- package/dist/shared-logic/src/Query/buildFromQueryAttributes.d.ts +1 -1
- package/dist/shared-logic/src/Query/types.d.ts +109 -6
- package/dist/shared-logic/src/TimeDimension/TimeDimension.d.ts +1 -3
- package/dist/shared-logic/src/api/queryEngine/getRunQueriesCallback.d.ts +1 -1
- package/dist/shared-ui/src/api/useQueryEffect.d.ts +1 -2
- package/dist/shared-ui/src/base/Panel/Panel.d.ts +1 -1
- package/dist/shared-ui/src/components/BarChartV2/BarChartV2View.d.ts +3 -3
- package/dist/shared-ui/src/components/Component/types.d.ts +2 -0
- package/dist/shared-ui/src/components/Component.d.ts +2 -0
- package/dist/shared-ui/src/components/Studio/StudioApp/Cell.d.ts +2 -0
- package/dist/shared-ui/src/components/WaterfallChart/WaterfallChartView.d.ts +3 -3
- package/dist/shared-ui/src/components/useComponentEffect.d.ts +2 -2
- package/dist/shared-ui/src/contexts/DashboardContext/types.d.ts +17 -1
- package/dist/shared-ui/src/library/Editor/useEditor.d.ts +2 -0
- package/dist/shared-ui/src/library/Library/ComponentInLibrary.d.ts +1 -0
- package/dist/shared-ui/src/library/Library/Library.d.ts +4 -0
- package/dist/shared-ui/src/library/Library/types.d.ts +2 -0
- package/package.json +3 -3
- package/dist/shared-logic/src/PivotConfigForMetricAxis/index.d.ts +0 -3
- package/dist/shared-logic/src/Result/formattedResultToSeriesForMetricAxis.d.ts +0 -25
|
@@ -1117,6 +1117,33 @@ var FieldNotFoundInDataSet = /*#__PURE__*/function (_ValidationError) {
|
|
|
1117
1117
|
return FieldNotFoundInDataSet;
|
|
1118
1118
|
}(ValidationError);
|
|
1119
1119
|
|
|
1120
|
+
var timeDimensionsConstants = semanticLayerPublic.QueryEngineConfig.Constants.timeDimensionsConstants;
|
|
1121
|
+
|
|
1122
|
+
// All the aggregates Vizzly supports somewhere...
|
|
1123
|
+
// Not necessarily all the aggregates that are supported because each
|
|
1124
|
+
// integration could support different aggregates
|
|
1125
|
+
|
|
1126
|
+
var id$1 = function id(metric) {
|
|
1127
|
+
if (!(metric != null && metric.truncate) || (metric == null ? void 0 : metric.truncate) == 'none') return metric == null ? void 0 : metric.field;
|
|
1128
|
+
return metric.field + "_" + metric.truncate;
|
|
1129
|
+
};
|
|
1130
|
+
var decodeId$1 = function decodeId(metric, supportedTimeTruncFunctions) {
|
|
1131
|
+
var parts = metric.split('_');
|
|
1132
|
+
var truncate = parts.pop();
|
|
1133
|
+
if (truncate && !isSupportedTimeTruncFunction(supportedTimeTruncFunctions, truncate)) {
|
|
1134
|
+
return null;
|
|
1135
|
+
}
|
|
1136
|
+
var field = parts.join('_');
|
|
1137
|
+
return {
|
|
1138
|
+
field: field,
|
|
1139
|
+
truncate: truncate != null ? truncate : ''
|
|
1140
|
+
};
|
|
1141
|
+
};
|
|
1142
|
+
var vizzlyManagedTimeDimensions = timeDimensionsConstants;
|
|
1143
|
+
var isSupportedTimeTruncFunction = function isSupportedTimeTruncFunction(supportedTimeFunctions, proposedFunction) {
|
|
1144
|
+
return [].concat(Object.keys(supportedTimeFunctions), ['none']).includes(proposedFunction);
|
|
1145
|
+
};
|
|
1146
|
+
|
|
1120
1147
|
var filterIsDate = function filterIsDate(filter) {
|
|
1121
1148
|
var isoDateRegex = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/;
|
|
1122
1149
|
if (!isoDateRegex.test(filter.value)) {
|
|
@@ -1351,6 +1378,103 @@ function extractValue(variables, key) {
|
|
|
1351
1378
|
return variables[key].value;
|
|
1352
1379
|
}
|
|
1353
1380
|
|
|
1381
|
+
var addAndFilters = function addAndFilters(filter, filterToAddToAll) {
|
|
1382
|
+
if (!filter || _.isEmpty(filter)) filter = [[]];
|
|
1383
|
+
return [].concat(filter).map(function (andFilter) {
|
|
1384
|
+
return [].concat(andFilter, filterToAddToAll);
|
|
1385
|
+
});
|
|
1386
|
+
};
|
|
1387
|
+
var filterAttributeToQueryFilter = function filterAttributeToQueryFilter(filters, queryEngineConfig, dataSet, params) {
|
|
1388
|
+
return filters.map(function (andFilters) {
|
|
1389
|
+
return [].concat(andFilters).flatMap(function (andFilter) {
|
|
1390
|
+
var _andFilter$function;
|
|
1391
|
+
// Stop unsupported time functions being used.
|
|
1392
|
+
if (andFilter["function"] && !isSupportedTimeTruncFunction(queryEngineConfig.supportedTimeTruncFunctions, andFilter["function"])) {
|
|
1393
|
+
throw "Query engine does not support the query function " + andFilter["function"] + ".";
|
|
1394
|
+
}
|
|
1395
|
+
var dataSetField = findField(dataSet, andFilter.field);
|
|
1396
|
+
var field = {
|
|
1397
|
+
type: 'field',
|
|
1398
|
+
value: andFilter.field,
|
|
1399
|
+
"function": (_andFilter$function = andFilter["function"]) != null ? _andFilter$function : 'none'
|
|
1400
|
+
};
|
|
1401
|
+
if (isCustomField(dataSetField)) {
|
|
1402
|
+
var _andFilter$function2;
|
|
1403
|
+
field = toQueryMeasure({
|
|
1404
|
+
field: dataSetField.id,
|
|
1405
|
+
"function": (_andFilter$function2 = andFilter["function"]) != null ? _andFilter$function2 : 'none'
|
|
1406
|
+
}, dataSetField, queryEngineConfig, dataSet, false, params);
|
|
1407
|
+
}
|
|
1408
|
+
// If `array_contains` operation has multiple. Then split these out into individual
|
|
1409
|
+
// checks.
|
|
1410
|
+
if ((andFilter.op == 'array_contains' || andFilter.op == 'array_does_not_contain') && Array.isArray(andFilter.value)) {
|
|
1411
|
+
return [].concat(andFilter.value).map(function (value) {
|
|
1412
|
+
return {
|
|
1413
|
+
field: field,
|
|
1414
|
+
op: andFilter.op,
|
|
1415
|
+
value: value
|
|
1416
|
+
};
|
|
1417
|
+
});
|
|
1418
|
+
}
|
|
1419
|
+
var value = useValue(andFilter.value, params.variables);
|
|
1420
|
+
if (isRelativeDateDefined(andFilter.value)) {
|
|
1421
|
+
value = calculateRelativeDate(andFilter.value);
|
|
1422
|
+
}
|
|
1423
|
+
if (filterIsDate(andFilter)) {
|
|
1424
|
+
value = getUTCDate(andFilter.value);
|
|
1425
|
+
}
|
|
1426
|
+
return [{
|
|
1427
|
+
field: field,
|
|
1428
|
+
op: andFilter.op,
|
|
1429
|
+
value: value
|
|
1430
|
+
}];
|
|
1431
|
+
});
|
|
1432
|
+
});
|
|
1433
|
+
};
|
|
1434
|
+
var isAvailable = function isAvailable(filter) {
|
|
1435
|
+
return filter && _.isArray(filter) && _.isArray(filter[0]);
|
|
1436
|
+
};
|
|
1437
|
+
var isAdditionalFilter = function isAdditionalFilter(value) {
|
|
1438
|
+
return value && _.isArray(value) && _.isArray(value[0]) && 'field' in value[0][0] && 'op' in value[0][0] && 'value' in value[0][0];
|
|
1439
|
+
};
|
|
1440
|
+
|
|
1441
|
+
var combineFilters = function combineFilters(array1, array2) {
|
|
1442
|
+
var validArray1 = array1.length > 0 && array1[0] ? array1 : [[]];
|
|
1443
|
+
var validArray2 = array2.length > 0 && array2[0] ? array2 : [[]];
|
|
1444
|
+
|
|
1445
|
+
// If array1 has more than one sub-array, loop through each sub-array in array1
|
|
1446
|
+
if (validArray1.length > 1) {
|
|
1447
|
+
return validArray1.map(function (subArray) {
|
|
1448
|
+
return [].concat(validArray2[0] || [], subArray || []);
|
|
1449
|
+
});
|
|
1450
|
+
}
|
|
1451
|
+
// Otherwise, if array2 has more than one sub-array, loop through array2
|
|
1452
|
+
else if (validArray2.length > 1) {
|
|
1453
|
+
return validArray2.map(function (subArray) {
|
|
1454
|
+
return [].concat(validArray1[0] || [], subArray || []);
|
|
1455
|
+
});
|
|
1456
|
+
}
|
|
1457
|
+
// Default: merge both single sub-arrays
|
|
1458
|
+
else {
|
|
1459
|
+
return [[].concat(validArray1[0] || [], validArray2[0] || [])];
|
|
1460
|
+
}
|
|
1461
|
+
};
|
|
1462
|
+
function combineForCustomMetricFilters(filters, customFilters) {
|
|
1463
|
+
var combinedFilters = [];
|
|
1464
|
+
if (customFilters && isAvailable(customFilters)) {
|
|
1465
|
+
customFilters.forEach(function (orFilterGroup) {
|
|
1466
|
+
combinedFilters = [].concat(combinedFilters, addAndFilters(filters != null ? filters : [], orFilterGroup));
|
|
1467
|
+
});
|
|
1468
|
+
} else {
|
|
1469
|
+
combinedFilters = filters != null ? filters : [];
|
|
1470
|
+
}
|
|
1471
|
+
return combinedFilters;
|
|
1472
|
+
}
|
|
1473
|
+
|
|
1474
|
+
var generateId = function generateId() {
|
|
1475
|
+
return uuid.v4().replace(/-/g, '');
|
|
1476
|
+
};
|
|
1477
|
+
|
|
1354
1478
|
/** Upcasts from an old global filter, to a new "additional filter" */
|
|
1355
1479
|
var upcastToAdditionalFilter = function upcastToAdditionalFilter(globalFilter) {
|
|
1356
1480
|
if (globalFilter.type == 'globalSelectFilter') {
|
|
@@ -1780,125 +1904,6 @@ var fromFilterConfig = function fromFilterConfig(filterConfig, dataSet, timeRang
|
|
|
1780
1904
|
return filters;
|
|
1781
1905
|
};
|
|
1782
1906
|
|
|
1783
|
-
var addAndFilters = function addAndFilters(filter, filterToAddToAll) {
|
|
1784
|
-
if (_.isEmpty(filterToAddToAll)) return [].concat(filter);
|
|
1785
|
-
if (!filter || _.isEmpty(filter)) filter = [[]];
|
|
1786
|
-
return [].concat(filter).map(function (andFilter) {
|
|
1787
|
-
return [].concat(andFilter, filterToAddToAll);
|
|
1788
|
-
});
|
|
1789
|
-
};
|
|
1790
|
-
var filterAttributeToQueryFilter = function filterAttributeToQueryFilter(filterAttrs, queryEngineConfig, dataSet, params) {
|
|
1791
|
-
var _params$filterConfig;
|
|
1792
|
-
// Either build using the filter attributes passed in, or take the viewFilters in the filter config.
|
|
1793
|
-
// They represent the same thing, however some view-filters are passed around in the filter config
|
|
1794
|
-
// to reduce custom metrics arguments being passed around.
|
|
1795
|
-
var filter = filterAttrs.length > 0 ? filterAttrs : ((_params$filterConfig = params.filterConfig) == null ? void 0 : _params$filterConfig.viewFilters) || [];
|
|
1796
|
-
var extraFilters = fromFilterConfig(params.filterConfig, dataSet, params.timeRangeOptions);
|
|
1797
|
-
var combinedFilters = addAndFilters(filter, extraFilters);
|
|
1798
|
-
if (Array.isArray(filter)) {
|
|
1799
|
-
return {
|
|
1800
|
-
type: 'orWhere',
|
|
1801
|
-
value: combinedFilters.map(function (andFilters) {
|
|
1802
|
-
return {
|
|
1803
|
-
type: 'andWhere',
|
|
1804
|
-
value: andFilters.map(function (filter) {
|
|
1805
|
-
var dataSetField = findField(dataSet, filter.field);
|
|
1806
|
-
var field = {
|
|
1807
|
-
type: 'field',
|
|
1808
|
-
value: filter.field,
|
|
1809
|
-
"function": filter["function"] || 'none'
|
|
1810
|
-
};
|
|
1811
|
-
if (isCustomField(dataSetField)) {
|
|
1812
|
-
var _filter$function;
|
|
1813
|
-
field = toQueryMeasure({
|
|
1814
|
-
field: dataSetField.id,
|
|
1815
|
-
"function": (_filter$function = filter["function"]) != null ? _filter$function : 'none'
|
|
1816
|
-
}, dataSetField, queryEngineConfig, dataSet, false, params);
|
|
1817
|
-
}
|
|
1818
|
-
|
|
1819
|
-
// If the value is an array, and we're checking that all values ARE or ARE NOT in a field, then we need to split
|
|
1820
|
-
// out this check into multiple filters, as a value in a filter cannot be an array.
|
|
1821
|
-
if ((filter.op == 'array_contains' || filter.op == 'array_does_not_contain') && Array.isArray(filter.value)) {
|
|
1822
|
-
return {
|
|
1823
|
-
type: 'andWhere',
|
|
1824
|
-
value: [].concat(filter.value).map(function (value) {
|
|
1825
|
-
return {
|
|
1826
|
-
type: 'where',
|
|
1827
|
-
value: {
|
|
1828
|
-
field: field,
|
|
1829
|
-
op: filter.op,
|
|
1830
|
-
value: value
|
|
1831
|
-
}
|
|
1832
|
-
};
|
|
1833
|
-
})
|
|
1834
|
-
};
|
|
1835
|
-
}
|
|
1836
|
-
var value = useValue(filter.value, params.variables);
|
|
1837
|
-
if (isRelativeDateDefined(filter.value)) {
|
|
1838
|
-
value = calculateRelativeDate(filter.value);
|
|
1839
|
-
}
|
|
1840
|
-
if (filterIsDate(filter)) {
|
|
1841
|
-
value = getUTCDate(filter.value);
|
|
1842
|
-
}
|
|
1843
|
-
return {
|
|
1844
|
-
type: 'where',
|
|
1845
|
-
value: {
|
|
1846
|
-
field: field,
|
|
1847
|
-
op: filter.op,
|
|
1848
|
-
value: value
|
|
1849
|
-
}
|
|
1850
|
-
};
|
|
1851
|
-
})
|
|
1852
|
-
};
|
|
1853
|
-
})
|
|
1854
|
-
};
|
|
1855
|
-
}
|
|
1856
|
-
return filter;
|
|
1857
|
-
};
|
|
1858
|
-
var isAvailable = function isAvailable(filter) {
|
|
1859
|
-
return filter && _.isArray(filter) && _.isArray(filter[0]);
|
|
1860
|
-
};
|
|
1861
|
-
var isAdditionalFilter = function isAdditionalFilter(value) {
|
|
1862
|
-
return value && _.isArray(value) && _.isArray(value[0]) && 'field' in value[0][0] && 'op' in value[0][0] && 'value' in value[0][0];
|
|
1863
|
-
};
|
|
1864
|
-
|
|
1865
|
-
var combineFilters = function combineFilters(array1, array2) {
|
|
1866
|
-
var validArray1 = array1.length > 0 && array1[0] ? array1 : [[]];
|
|
1867
|
-
var validArray2 = array2.length > 0 && array2[0] ? array2 : [[]];
|
|
1868
|
-
|
|
1869
|
-
// If array1 has more than one sub-array, loop through each sub-array in array1
|
|
1870
|
-
if (validArray1.length > 1) {
|
|
1871
|
-
return validArray1.map(function (subArray) {
|
|
1872
|
-
return [].concat(validArray2[0] || [], subArray || []);
|
|
1873
|
-
});
|
|
1874
|
-
}
|
|
1875
|
-
// Otherwise, if array2 has more than one sub-array, loop through array2
|
|
1876
|
-
else if (validArray2.length > 1) {
|
|
1877
|
-
return validArray2.map(function (subArray) {
|
|
1878
|
-
return [].concat(validArray1[0] || [], subArray || []);
|
|
1879
|
-
});
|
|
1880
|
-
}
|
|
1881
|
-
// Default: merge both single sub-arrays
|
|
1882
|
-
else {
|
|
1883
|
-
return [[].concat(validArray1[0] || [], validArray2[0] || [])];
|
|
1884
|
-
}
|
|
1885
|
-
};
|
|
1886
|
-
function combineForCustomMetricFilters(filters, customFilters) {
|
|
1887
|
-
var combinedFilters = [];
|
|
1888
|
-
if (customFilters && isAvailable(customFilters)) {
|
|
1889
|
-
customFilters.forEach(function (orFilterGroup) {
|
|
1890
|
-
combinedFilters = [].concat(combinedFilters, addAndFilters(filters != null ? filters : [], orFilterGroup));
|
|
1891
|
-
});
|
|
1892
|
-
} else {
|
|
1893
|
-
combinedFilters = filters != null ? filters : [];
|
|
1894
|
-
}
|
|
1895
|
-
return combinedFilters;
|
|
1896
|
-
}
|
|
1897
|
-
|
|
1898
|
-
var generateId = function generateId() {
|
|
1899
|
-
return uuid.v4().replace(/-/g, '');
|
|
1900
|
-
};
|
|
1901
|
-
|
|
1902
1907
|
/**
|
|
1903
1908
|
* Creates a new custom percentage field.
|
|
1904
1909
|
*/
|
|
@@ -1925,7 +1930,7 @@ var init$1 = function init(publicName, denominatorFieldId, denominatorAggregate,
|
|
|
1925
1930
|
var build$2 = function build(customField, queryEngineConfig, dataSet, _queryHasDimension, params) {
|
|
1926
1931
|
var _params$filterConfig$, _params$filterConfig, _customField$numerato, _customField$numerato2, _customField$denomina, _customField$denomina2;
|
|
1927
1932
|
var localAndDashboardFilters = fromFilterConfig(params.filterConfig, dataSet, params.timeRangeOptions);
|
|
1928
|
-
var _buildPercentageFilte = buildPercentageFilters(addAndFilters((_params$filterConfig$ = params == null || (_params$filterConfig = params.filterConfig) == null ? void 0 : _params$filterConfig.
|
|
1933
|
+
var _buildPercentageFilte = buildPercentageFilters(addAndFilters((_params$filterConfig$ = params == null || (_params$filterConfig = params.filterConfig) == null ? void 0 : _params$filterConfig.advancedFilter) != null ? _params$filterConfig$ : [], localAndDashboardFilters), customField),
|
|
1929
1934
|
combinedNominatorFilters = _buildPercentageFilte.combinedNominatorFilters,
|
|
1930
1935
|
combinedDenominatorFilters = _buildPercentageFilte.combinedDenominatorFilters;
|
|
1931
1936
|
var left = {
|
|
@@ -1947,36 +1952,24 @@ var build$2 = function build(customField, queryEngineConfig, dataSet, _queryHasD
|
|
|
1947
1952
|
filter: filterAttributeToQueryFilter(combinedDenominatorFilters || [], queryEngineConfig, dataSet, params)
|
|
1948
1953
|
}
|
|
1949
1954
|
};
|
|
1950
|
-
var denominatorForWithinGroupingScope = buildSide(right, isAvailable(customField.denominatorFilter) ? filterAttributeToQueryFilter(combinedDenominatorFilters, queryEngineConfig, dataSet, params) :
|
|
1951
|
-
type: 'andWhere',
|
|
1952
|
-
value: []
|
|
1953
|
-
});
|
|
1955
|
+
var denominatorForWithinGroupingScope = buildSide(right, isAvailable(customField.denominatorFilter) ? filterAttributeToQueryFilter(combinedDenominatorFilters, queryEngineConfig, dataSet, params) : []);
|
|
1954
1956
|
return {
|
|
1955
1957
|
type: 'maths',
|
|
1956
|
-
left: buildSide(left, isAvailable(customField.numeratorFilter) ? filterAttributeToQueryFilter(combinedNominatorFilters, queryEngineConfig, dataSet, params) :
|
|
1957
|
-
type: 'andWhere',
|
|
1958
|
-
value: []
|
|
1959
|
-
}),
|
|
1958
|
+
left: buildSide(left, isAvailable(customField.numeratorFilter) ? filterAttributeToQueryFilter(combinedNominatorFilters, queryEngineConfig, dataSet, params) : []),
|
|
1960
1959
|
op: '/',
|
|
1961
1960
|
right: customField.denominatorScope === 'withinGrouping' ? denominatorForWithinGroupingScope : denominatorForAllScope
|
|
1962
1961
|
};
|
|
1963
1962
|
};
|
|
1964
1963
|
var buildSide = function buildSide(field, filter) {
|
|
1965
|
-
var alwaysTrueFilter = {
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
op: '=',
|
|
1975
|
-
value: 2
|
|
1976
|
-
}
|
|
1977
|
-
}]
|
|
1978
|
-
};
|
|
1979
|
-
var hasNumeratorFilter = filter.type === 'where' || filter.value.length > 0;
|
|
1964
|
+
var alwaysTrueFilter = [[{
|
|
1965
|
+
value: 1,
|
|
1966
|
+
op: '=',
|
|
1967
|
+
field: {
|
|
1968
|
+
type: 'number',
|
|
1969
|
+
value: 1
|
|
1970
|
+
}
|
|
1971
|
+
}]];
|
|
1972
|
+
var hasNumeratorFilter = filter.length > 0 && filter[0].length > 0;
|
|
1980
1973
|
if (!hasNumeratorFilter) {
|
|
1981
1974
|
return {
|
|
1982
1975
|
type: 'field',
|
|
@@ -2350,7 +2343,7 @@ var buildIfLogic = function buildIfLogic(ifLogic, dataSet, localAndDashboardFilt
|
|
|
2350
2343
|
var cases = function () {
|
|
2351
2344
|
var thenCases = ifLogic.cases.map(function (c) {
|
|
2352
2345
|
var _params$filterConfig$, _params$filterConfig;
|
|
2353
|
-
var customMetricFilter = combineForCustomMetricFilters(addAndFilters((_params$filterConfig$ = params == null || (_params$filterConfig = params.filterConfig) == null ? void 0 : _params$filterConfig.
|
|
2346
|
+
var customMetricFilter = combineForCustomMetricFilters(addAndFilters((_params$filterConfig$ = params == null || (_params$filterConfig = params.filterConfig) == null ? void 0 : _params$filterConfig.advancedFilter) != null ? _params$filterConfig$ : [], localAndDashboardFilters), c.filter);
|
|
2354
2347
|
return {
|
|
2355
2348
|
returns: buildMetric(c.returns, dataSet, params, measureAttribute),
|
|
2356
2349
|
filter: filterAttributeToQueryFilter(customMetricFilter, queryEngineConfig, dataSet, params)
|
|
@@ -2658,33 +2651,6 @@ var mergeAttributes = function mergeAttributes(partial, existingProps) {
|
|
|
2658
2651
|
return _doMerge(existingProps, partial);
|
|
2659
2652
|
};
|
|
2660
2653
|
|
|
2661
|
-
var timeDimensionsConstants = semanticLayerPublic.QueryEngineConfig.Constants.timeDimensionsConstants;
|
|
2662
|
-
|
|
2663
|
-
// All the aggregates Vizzly supports somewhere...
|
|
2664
|
-
// Not necessarily all the aggregates that are supported because each
|
|
2665
|
-
// integration could support different aggregates
|
|
2666
|
-
|
|
2667
|
-
var id$1 = function id(metric) {
|
|
2668
|
-
if (!(metric != null && metric.truncate) || (metric == null ? void 0 : metric.truncate) == 'none') return metric == null ? void 0 : metric.field;
|
|
2669
|
-
return metric.field + "_" + metric.truncate;
|
|
2670
|
-
};
|
|
2671
|
-
var decodeId$1 = function decodeId(metric, supportedTimeTruncFunctions) {
|
|
2672
|
-
var parts = metric.split('_');
|
|
2673
|
-
var truncate = parts.pop();
|
|
2674
|
-
if (truncate && !isSupportedTimeTruncFunction(supportedTimeTruncFunctions, truncate)) {
|
|
2675
|
-
return null;
|
|
2676
|
-
}
|
|
2677
|
-
var field = parts.join('_');
|
|
2678
|
-
return {
|
|
2679
|
-
field: field,
|
|
2680
|
-
truncate: truncate != null ? truncate : ''
|
|
2681
|
-
};
|
|
2682
|
-
};
|
|
2683
|
-
var vizzlyManagedTimeDimensions = timeDimensionsConstants;
|
|
2684
|
-
var isSupportedTimeTruncFunction = function isSupportedTimeTruncFunction(supportedTimeFunctions, proposedFunction) {
|
|
2685
|
-
return [].concat(Object.keys(supportedTimeFunctions), ['none']).includes(proposedFunction);
|
|
2686
|
-
};
|
|
2687
|
-
|
|
2688
2654
|
var id$2 = id;
|
|
2689
2655
|
var decodeId$2 = decodeId;
|
|
2690
2656
|
var hasAggregate = function hasAggregate(metric) {
|
|
@@ -10562,7 +10528,7 @@ var WaterfallChart = function WaterfallChart(config) {
|
|
|
10562
10528
|
return removeField$1(attrs, fieldId, config.queryEngineConfig);
|
|
10563
10529
|
},
|
|
10564
10530
|
isRunnable: function isRunnable(hydrated) {
|
|
10565
|
-
return hydrated.measure.length > 0
|
|
10531
|
+
return hydrated.measure.length > 0;
|
|
10566
10532
|
},
|
|
10567
10533
|
autoGenerate: function autoGenerate(dataSet) {
|
|
10568
10534
|
var _DataSet$buildQueryAt = buildQueryAttributes(dataSet, config.queryEngineConfig, 'waterfallChart'),
|
|
@@ -10587,8 +10553,7 @@ var WaterfallChart = function WaterfallChart(config) {
|
|
|
10587
10553
|
getValues: function getValues(attrs) {
|
|
10588
10554
|
return attrs.measure;
|
|
10589
10555
|
},
|
|
10590
|
-
testId: 'metric-input'
|
|
10591
|
-
maxAllowed: 1
|
|
10556
|
+
testId: 'metric-input'
|
|
10592
10557
|
}), _extends({}, namespace(CONSTANTS$l, 'field_x_axis'), {
|
|
10593
10558
|
fieldFilterOptions: {
|
|
10594
10559
|
forComponent: 'waterfallChart',
|
|
@@ -10601,7 +10566,7 @@ var WaterfallChart = function WaterfallChart(config) {
|
|
|
10601
10566
|
getValues: function getValues(attrs) {
|
|
10602
10567
|
return getGroupingWithTimeDimension(attrs);
|
|
10603
10568
|
},
|
|
10604
|
-
maxAllowed:
|
|
10569
|
+
maxAllowed: 2,
|
|
10605
10570
|
testId: 'add-dimension'
|
|
10606
10571
|
}), namespace(CONSTANTS$l, 'sort'), namespace(CONSTANTS$l, 'filter'), namespace(CONSTANTS$l, 'custom_metrics'), namespace(CONSTANTS$l, 'limit')];
|
|
10607
10572
|
},
|
|
@@ -14558,7 +14523,7 @@ var buildDefaults = function buildDefaults(partialFeatureToggles) {
|
|
|
14558
14523
|
};
|
|
14559
14524
|
};
|
|
14560
14525
|
|
|
14561
|
-
var ALL_COMPONENT_TYPES = ['barChart', '
|
|
14526
|
+
var ALL_COMPONENT_TYPES = ['barChart', 'bubbleChart', 'bubbleChartV2', 'horizontalBarChart', 'funnelChart', 'areaChart', 'areaChartV2', 'lineChart', 'lineChartV2', 'barChartV2', 'comboChartV2', 'scatterChart', 'pieChart', 'sunburstChart', 'singleStat', 'dataTable', 'basicTable', 'comboChart', 'mercatorMap', 'progress', 'richText', 'custom', 'waterfallChart', 'radarChart'];
|
|
14562
14527
|
var ALL_VIZZLY_COMPONENT_TYPES = /*#__PURE__*/[].concat(ALL_COMPONENT_TYPES).filter(function (type) {
|
|
14563
14528
|
return type != 'custom';
|
|
14564
14529
|
});
|
|
@@ -14568,6 +14533,7 @@ var initial = function initial(attributes) {
|
|
|
14568
14533
|
return {
|
|
14569
14534
|
attributes: attributes,
|
|
14570
14535
|
localFilters: [],
|
|
14536
|
+
results: [],
|
|
14571
14537
|
colSpan: POPULATE_ONE_CELL,
|
|
14572
14538
|
reports: []
|
|
14573
14539
|
};
|
|
@@ -15011,12 +14977,10 @@ var load$2 = function load$1(dumped, componentInterfaceConfig) {
|
|
|
15011
14977
|
delete dumped['addOns'];
|
|
15012
14978
|
// @ts-ignore
|
|
15013
14979
|
delete attributes['addOns'];
|
|
15014
|
-
|
|
15015
|
-
// @ts-ignore
|
|
15016
|
-
delete attributes['results'];
|
|
15017
14980
|
return _extends({}, dumped, {
|
|
15018
14981
|
localFilters: localFilters,
|
|
15019
|
-
attributes: attributes
|
|
14982
|
+
attributes: attributes,
|
|
14983
|
+
results: []
|
|
15020
14984
|
});
|
|
15021
14985
|
};
|
|
15022
14986
|
var dump$2 = function dump$1(hydrated) {
|
|
@@ -15043,6 +15007,7 @@ var saveable = function saveable(component, protectedComponent) {
|
|
|
15043
15007
|
}),
|
|
15044
15008
|
localFilters: (_component$localFilte = component.localFilters) != null ? _component$localFilte : [],
|
|
15045
15009
|
colSpan: 1,
|
|
15010
|
+
results: [],
|
|
15046
15011
|
reports: []
|
|
15047
15012
|
};
|
|
15048
15013
|
};
|
|
@@ -15518,6 +15483,8 @@ var init$b = function init(overrides, includeComponentTypes, excludeComponentTyp
|
|
|
15518
15483
|
var temporaryExcludedComponentTypes = [];
|
|
15519
15484
|
// TODO: Remove this once RichText is supported in the UI
|
|
15520
15485
|
temporaryExcludedComponentTypes.push('richText');
|
|
15486
|
+
// TODO: Remove this once representation charts (aka v2 charts) are finished and working as expected
|
|
15487
|
+
temporaryExcludedComponentTypes.push('areaChartV2', 'barChartV2', 'bubbleChartV2', 'comboChartV2', 'lineChartV2', 'radarChart', 'waterfallChart');
|
|
15521
15488
|
var allowedView = filterIncludedAndExcludedViews(ALL_VIZZLY_COMPONENT_TYPES, includeComponentTypes, excludeComponentTypes ? [].concat(excludeComponentTypes, temporaryExcludedComponentTypes) : [].concat(temporaryExcludedComponentTypes));
|
|
15522
15489
|
return allowedView.filter(function (view) {
|
|
15523
15490
|
var hasSupportForPreAggregatedDataSets = !!getComponentInterface(view).setDataAttributesFromPreAggregatedDataSet;
|
|
@@ -23076,6 +23043,18 @@ var pickComponentFromLibraryForDisplay = function pickComponentFromLibraryForDis
|
|
|
23076
23043
|
pickFromComponentLibrary: null
|
|
23077
23044
|
});
|
|
23078
23045
|
};
|
|
23046
|
+
var setResultsForComponentInDisplay = function setResultsForComponentInDisplay(state, action) {
|
|
23047
|
+
var results = action.results,
|
|
23048
|
+
rowIndex = action.rowIndex,
|
|
23049
|
+
cellIndex = action.cellIndex;
|
|
23050
|
+
var currentComponent = state.dashboard.display[rowIndex].components[cellIndex];
|
|
23051
|
+
if (!currentComponent) throw 'We can only set results on an existing component on the dashboard.';
|
|
23052
|
+
var newComponent = _extends({}, currentComponent, {
|
|
23053
|
+
results: results
|
|
23054
|
+
});
|
|
23055
|
+
var newState = _setComponentInDisplayHelper(state, newComponent, rowIndex, cellIndex);
|
|
23056
|
+
return _extends({}, newState);
|
|
23057
|
+
};
|
|
23079
23058
|
var updateComponentLibraryAttributes = function updateComponentLibraryAttributes(state, action) {
|
|
23080
23059
|
var libraryIndex = action.libraryIndex,
|
|
23081
23060
|
attributes = action.attributes;
|
|
@@ -23089,6 +23068,31 @@ var updateComponentLibraryAttributes = function updateComponentLibraryAttributes
|
|
|
23089
23068
|
})
|
|
23090
23069
|
});
|
|
23091
23070
|
};
|
|
23071
|
+
var setResultsForComponentInEditor = function setResultsForComponentInEditor(state, action) {
|
|
23072
|
+
if (!state.componentEditor) throw 'Cannot set results for a closed editor.';
|
|
23073
|
+
if (!state.componentEditor.component) throw 'Cannot set results for a non-existant component in editor.';
|
|
23074
|
+
var results = action.results;
|
|
23075
|
+
return _extends({}, state, {
|
|
23076
|
+
componentEditor: _extends({}, state.componentEditor, {
|
|
23077
|
+
component: _extends({}, state.componentEditor.component, {
|
|
23078
|
+
results: results
|
|
23079
|
+
})
|
|
23080
|
+
})
|
|
23081
|
+
});
|
|
23082
|
+
};
|
|
23083
|
+
var setResultsForComponentInLibrary = function setResultsForComponentInLibrary(state, action) {
|
|
23084
|
+
var libraryIndex = action.libraryIndex,
|
|
23085
|
+
results = action.results;
|
|
23086
|
+
var componentLibrary = [].concat(state.dashboard.componentLibrary);
|
|
23087
|
+
componentLibrary[libraryIndex] = _extends({}, componentLibrary[libraryIndex], {
|
|
23088
|
+
results: results
|
|
23089
|
+
});
|
|
23090
|
+
return _extends({}, state, {
|
|
23091
|
+
dashboard: _extends({}, state.dashboard, {
|
|
23092
|
+
componentLibrary: componentLibrary
|
|
23093
|
+
})
|
|
23094
|
+
});
|
|
23095
|
+
};
|
|
23092
23096
|
var clearModal = function clearModal(state, _action) {
|
|
23093
23097
|
return _extends({}, state, {
|
|
23094
23098
|
pickFromComponentLibrary: null,
|
|
@@ -23484,6 +23488,12 @@ var reducer = function reducer(pipelineTransformationOptions) {
|
|
|
23484
23488
|
return clearModal(state);
|
|
23485
23489
|
case 'updateEditorComponent':
|
|
23486
23490
|
return updateEditorComponent(state, action);
|
|
23491
|
+
case 'setResultsForComponentInDisplay':
|
|
23492
|
+
return setResultsForComponentInDisplay(state, action);
|
|
23493
|
+
case 'setResultsForComponentInLibrary':
|
|
23494
|
+
return setResultsForComponentInLibrary(state, action);
|
|
23495
|
+
case 'setResultsForComponentInEditor':
|
|
23496
|
+
return setResultsForComponentInEditor(state, action);
|
|
23487
23497
|
case 'pickComponentFromLibraryForDisplay':
|
|
23488
23498
|
return pickComponentFromLibraryForDisplay(state, action);
|
|
23489
23499
|
case 'setDashboard':
|
|
@@ -25872,15 +25882,149 @@ var filterStyles = /*#__PURE__*/Object.assign(function () {
|
|
|
25872
25882
|
complete: complete
|
|
25873
25883
|
});
|
|
25874
25884
|
|
|
25885
|
+
var Clause = /*#__PURE__*/function (Clause) {
|
|
25886
|
+
Clause["AND_WHERE"] = "andWhere";
|
|
25887
|
+
Clause["OR_WHERE"] = "orWhere";
|
|
25888
|
+
Clause["WHERE"] = "where";
|
|
25889
|
+
return Clause;
|
|
25890
|
+
}({});
|
|
25891
|
+
|
|
25892
|
+
// export type WhereClause = SqlAST.MultiWhereToken<any>;
|
|
25893
|
+
|
|
25894
|
+
var filterConfigToWhere = function filterConfigToWhere(dataSet, queryEngineConfig, params) {
|
|
25895
|
+
if (!params) return undefined;
|
|
25896
|
+
var filterConfig = params.filterConfig;
|
|
25897
|
+
if (!params || !filterConfig || (!filterConfig.globalFilters || filterConfig.globalFilters.length === 0) && (!filterConfig.localFilters || filterConfig.localFilters.length === 0) && (!filterConfig.advancedFilter || filterConfig.advancedFilter.length === 0 || filterConfig.advancedFilter.every(function (arr) {
|
|
25898
|
+
return arr.length === 0;
|
|
25899
|
+
}))) {
|
|
25900
|
+
return undefined;
|
|
25901
|
+
}
|
|
25902
|
+
var dash = buildAndWhere(dataSet, queryEngineConfig, params, filterConfig.globalFilters);
|
|
25903
|
+
var local = buildAndWhere(dataSet, queryEngineConfig, params, filterConfig.localFilters);
|
|
25904
|
+
var advancedFilters = buildFromFiltersArray(dataSet, queryEngineConfig, params, filterConfig.advancedFilter);
|
|
25905
|
+
var combinedAndWhere = [dash, local, advancedFilters].filter(Boolean).filter(function (whereClause) {
|
|
25906
|
+
return whereClause && whereClause.value.length > 0;
|
|
25907
|
+
});
|
|
25908
|
+
if (combinedAndWhere.length === 0) return undefined;
|
|
25909
|
+
return {
|
|
25910
|
+
type: Clause.AND_WHERE,
|
|
25911
|
+
value: combinedAndWhere
|
|
25912
|
+
};
|
|
25913
|
+
};
|
|
25914
|
+
var buildAndWhere = function buildAndWhere(dataSet, queryEngineConfig, params, additionalFilters) {
|
|
25915
|
+
if (!additionalFilters || additionalFilters.length === 0) return undefined;
|
|
25916
|
+
var whereClauses = [];
|
|
25917
|
+
additionalFilters.forEach(function (additionalFilter) {
|
|
25918
|
+
if (additionalFilter.type === DATE_AND_TIME_FILTER || additionalFilter.type === DATE_FILTER) {
|
|
25919
|
+
toRelativeQueryAttributesFilters(additionalFilter, dataSet).forEach(function (f) {
|
|
25920
|
+
whereClauses.push(buildWhereFromSingleFilter(dataSet, f, queryEngineConfig, params));
|
|
25921
|
+
});
|
|
25922
|
+
}
|
|
25923
|
+
if (Array.isArray(additionalFilter.value) && additionalFilter.value.length > 1 && isAdditionalFilter(additionalFilter.value)) {
|
|
25924
|
+
additionalFilter.appliesToFields.flatMap(function (field) {
|
|
25925
|
+
if (field.dataSetId != dataSet.id) return [];
|
|
25926
|
+
var convertedToWhere = buildFromFiltersArray(dataSet, queryEngineConfig, params, additionalFilter.value);
|
|
25927
|
+
if (convertedToWhere) {
|
|
25928
|
+
whereClauses.push(convertedToWhere);
|
|
25929
|
+
}
|
|
25930
|
+
return;
|
|
25931
|
+
});
|
|
25932
|
+
} else {
|
|
25933
|
+
toQueryAttributesFilter(dataSet, additionalFilter, params.timeRangeOptions).forEach(function (f) {
|
|
25934
|
+
whereClauses.push(buildWhereFromSingleFilter(dataSet, f, queryEngineConfig, params));
|
|
25935
|
+
});
|
|
25936
|
+
}
|
|
25937
|
+
});
|
|
25938
|
+
return {
|
|
25939
|
+
type: Clause.AND_WHERE,
|
|
25940
|
+
value: whereClauses
|
|
25941
|
+
};
|
|
25942
|
+
};
|
|
25943
|
+
var buildWhereFromSingleFilter = function buildWhereFromSingleFilter(dataSet, f, queryEngineConfig, params) {
|
|
25944
|
+
var field;
|
|
25945
|
+
if (f["function"] && !isSupportedTimeTruncFunction(queryEngineConfig.supportedTimeTruncFunctions, f["function"])) {
|
|
25946
|
+
throw "Query engine does not support the query function " + f["function"] + ".";
|
|
25947
|
+
}
|
|
25948
|
+
var dataSetField = findField(dataSet, f.field);
|
|
25949
|
+
if (isCustomField(dataSetField)) {
|
|
25950
|
+
var _f$function;
|
|
25951
|
+
field = toQueryMeasure({
|
|
25952
|
+
field: dataSetField.id,
|
|
25953
|
+
"function": (_f$function = f["function"]) != null ? _f$function : 'none'
|
|
25954
|
+
}, dataSetField, queryEngineConfig, dataSet, false, params);
|
|
25955
|
+
} else {
|
|
25956
|
+
var _decodedField$functio;
|
|
25957
|
+
var decodedField = decodeId(f.field, queryEngineConfig);
|
|
25958
|
+
field = {
|
|
25959
|
+
type: 'field',
|
|
25960
|
+
value: decodedField.field,
|
|
25961
|
+
"function": (_decodedField$functio = decodedField["function"]) != null ? _decodedField$functio : 'none'
|
|
25962
|
+
};
|
|
25963
|
+
}
|
|
25964
|
+
if ((f.op == 'array_contains' || f.op == 'array_does_not_contain') && Array.isArray(f.value)) {
|
|
25965
|
+
return arrayContainsFilters(f, dataSet, queryEngineConfig, params);
|
|
25966
|
+
}
|
|
25967
|
+
var value = useValue(f.value, params.variables);
|
|
25968
|
+
if (isRelativeDateDefined(f.value)) {
|
|
25969
|
+
value = calculateRelativeDate(f.value);
|
|
25970
|
+
}
|
|
25971
|
+
if (filterIsDate(f)) {
|
|
25972
|
+
value = getUTCDate(f.value);
|
|
25973
|
+
}
|
|
25974
|
+
return {
|
|
25975
|
+
type: Clause.WHERE,
|
|
25976
|
+
value: {
|
|
25977
|
+
op: f.op,
|
|
25978
|
+
value: value,
|
|
25979
|
+
field: field
|
|
25980
|
+
}
|
|
25981
|
+
};
|
|
25982
|
+
};
|
|
25983
|
+
var buildFromFiltersArray = function buildFromFiltersArray(dataSet, queryEngineConfig, params, filters) {
|
|
25984
|
+
if (!filters || filters.length === 0 || filters.every(function (arr) {
|
|
25985
|
+
return arr.length === 0;
|
|
25986
|
+
})) {
|
|
25987
|
+
return undefined;
|
|
25988
|
+
}
|
|
25989
|
+
if (filters.length === 1) return buildFromFilters(filters[0], dataSet, queryEngineConfig, params);
|
|
25990
|
+
return {
|
|
25991
|
+
type: Clause.OR_WHERE,
|
|
25992
|
+
value: filters.map(function (filter) {
|
|
25993
|
+
return buildFromFilters(filter, dataSet, queryEngineConfig, params);
|
|
25994
|
+
})
|
|
25995
|
+
};
|
|
25996
|
+
};
|
|
25997
|
+
var buildFromFilters = function buildFromFilters(filter, dataSet, queryEngineConfig, params) {
|
|
25998
|
+
return {
|
|
25999
|
+
type: Clause.AND_WHERE,
|
|
26000
|
+
value: filter.map(function (filter) {
|
|
26001
|
+
if ((filter.op == 'array_contains' || filter.op == 'array_does_not_contain') && Array.isArray(filter.value)) {
|
|
26002
|
+
return arrayContainsFilters(filter, dataSet, queryEngineConfig, params);
|
|
26003
|
+
}
|
|
26004
|
+
return buildWhereFromSingleFilter(dataSet, filter, queryEngineConfig, params);
|
|
26005
|
+
})
|
|
26006
|
+
};
|
|
26007
|
+
};
|
|
26008
|
+
var arrayContainsFilters = function arrayContainsFilters(filter, dataSet, queryEngineConfig, params) {
|
|
26009
|
+
return {
|
|
26010
|
+
type: Clause.AND_WHERE,
|
|
26011
|
+
value: [].concat(filter.value).map(function (value) {
|
|
26012
|
+
return buildWhereFromSingleFilter(dataSet, _extends({}, filter, {
|
|
26013
|
+
value: value
|
|
26014
|
+
}), queryEngineConfig, params);
|
|
26015
|
+
})
|
|
26016
|
+
};
|
|
26017
|
+
};
|
|
26018
|
+
|
|
25875
26019
|
var addMeasure = function addMeasure(current, toAdd) {
|
|
25876
26020
|
return [[].concat(current, [toAdd]), current.length];
|
|
25877
26021
|
};
|
|
25878
|
-
var buildFromQueryAttributes = function buildFromQueryAttributes(dataSet, measureAttr,
|
|
26022
|
+
var buildFromQueryAttributes = function buildFromQueryAttributes(dataSet, measureAttr, orderAttr, dimensionAttr, timeDimensionAttr, limitAttr, offsetAttr, queryEngineConfig, params, prebuiltFilters) {
|
|
25879
26023
|
var measureDescription = [];
|
|
25880
26024
|
var measure = [];
|
|
25881
26025
|
var group = [];
|
|
25882
26026
|
var order = [];
|
|
25883
|
-
var filters =
|
|
26027
|
+
var filters = buildFilters(dataSet, queryEngineConfig, params, prebuiltFilters);
|
|
25884
26028
|
if (timeDimensionAttr) {
|
|
25885
26029
|
// Add the measure for the time field.
|
|
25886
26030
|
var addedAt = undefined;
|
|
@@ -25938,19 +26082,24 @@ var buildFromQueryAttributes = function buildFromQueryAttributes(dataSet, measur
|
|
|
25938
26082
|
field: findField(dataSet, individualMeasure.field)
|
|
25939
26083
|
}]);
|
|
25940
26084
|
});
|
|
25941
|
-
orderAttr.forEach(function (
|
|
26085
|
+
orderAttr.forEach(function (apiQueryOrderItem) {
|
|
25942
26086
|
var index = measure.findIndex(function (individualMeasure) {
|
|
25943
26087
|
if (individualMeasure.type == 'field') {
|
|
25944
|
-
var sameFunction = individualMeasure["function"] ==
|
|
25945
|
-
|
|
26088
|
+
var sameFunction = individualMeasure["function"] == apiQueryOrderItem["function"];
|
|
26089
|
+
// const isTimeFunc = Object.keys(queryEngineConfig.supportedTimeTruncFunctions).includes(
|
|
26090
|
+
// individualMeasure.function
|
|
26091
|
+
// );
|
|
26092
|
+
var sameField = individualMeasure.value == apiQueryOrderItem.field;
|
|
25946
26093
|
return sameField && sameFunction;
|
|
26094
|
+
|
|
26095
|
+
// return found;
|
|
25947
26096
|
}
|
|
25948
26097
|
return false;
|
|
25949
26098
|
});
|
|
25950
26099
|
if (index >= 0) {
|
|
25951
26100
|
order = [].concat(order, [{
|
|
25952
26101
|
index: index,
|
|
25953
|
-
direction:
|
|
26102
|
+
direction: apiQueryOrderItem.direction
|
|
25954
26103
|
}]);
|
|
25955
26104
|
}
|
|
25956
26105
|
});
|
|
@@ -25975,6 +26124,7 @@ var buildFromQueryAttributes = function buildFromQueryAttributes(dataSet, measur
|
|
|
25975
26124
|
dataSetId: dataSet.id,
|
|
25976
26125
|
measure: measure,
|
|
25977
26126
|
group: group,
|
|
26127
|
+
// TODO: Fix this type
|
|
25978
26128
|
filter: filters,
|
|
25979
26129
|
order: order,
|
|
25980
26130
|
limit: limitAttr,
|
|
@@ -25983,6 +26133,19 @@ var buildFromQueryAttributes = function buildFromQueryAttributes(dataSet, measur
|
|
|
25983
26133
|
measureDescription: measureDescription
|
|
25984
26134
|
};
|
|
25985
26135
|
};
|
|
26136
|
+
var buildFilters = function buildFilters(dataSet, queryEngineConfig, params, prebuiltFilters) {
|
|
26137
|
+
if (prebuiltFilters && prebuiltFilters.length > 0) {
|
|
26138
|
+
var filter = [];
|
|
26139
|
+
prebuiltFilters.forEach(function (andFilters) {
|
|
26140
|
+
var newAndFilters = filterAttributeToQueryFilter([andFilters], queryEngineConfig, dataSet, params);
|
|
26141
|
+
filter = [].concat(filter, [newAndFilters[0]]);
|
|
26142
|
+
});
|
|
26143
|
+
return filter;
|
|
26144
|
+
}
|
|
26145
|
+
var whereClause = filterConfigToWhere(dataSet, queryEngineConfig, params);
|
|
26146
|
+
if (whereClause) return whereClause;
|
|
26147
|
+
return [];
|
|
26148
|
+
};
|
|
25986
26149
|
|
|
25987
26150
|
var build$c = buildFromQueryAttributes;
|
|
25988
26151
|
var hasDimensions = function hasDimensions(query) {
|
|
@@ -26010,10 +26173,7 @@ var buildUniqueArrayValuesPreparedQuery = function buildUniqueArrayValuesPrepare
|
|
|
26010
26173
|
preparedQueryType: 'uniqueArrayValues',
|
|
26011
26174
|
dataSetId: dataSetId,
|
|
26012
26175
|
fieldId: dataSetField.id,
|
|
26013
|
-
filter: optionsFilters ||
|
|
26014
|
-
type: 'andWhere',
|
|
26015
|
-
value: []
|
|
26016
|
-
}
|
|
26176
|
+
filter: optionsFilters || []
|
|
26017
26177
|
},
|
|
26018
26178
|
resultFields: [{
|
|
26019
26179
|
id: dataSetField.id,
|
|
@@ -26060,16 +26220,9 @@ var watchDataSetFieldChanges = function watchDataSetFieldChanges(dataSet, querya
|
|
|
26060
26220
|
// Custom fields are the only ones that can have their definition changed. So
|
|
26061
26221
|
// we only need to watch them.
|
|
26062
26222
|
var watchedCustomFields = watchFields.flatMap(function (fieldId) {
|
|
26063
|
-
|
|
26064
|
-
|
|
26065
|
-
|
|
26066
|
-
return [];
|
|
26067
|
-
} catch (err) {
|
|
26068
|
-
if (err instanceof FieldNotFoundInDataSet) {
|
|
26069
|
-
return [];
|
|
26070
|
-
}
|
|
26071
|
-
throw err;
|
|
26072
|
-
}
|
|
26223
|
+
var dataSetField = findField(dataSet, fieldId);
|
|
26224
|
+
if (isCustomField(dataSetField)) return [dataSetField];
|
|
26225
|
+
return [];
|
|
26073
26226
|
});
|
|
26074
26227
|
return JSON.stringify(watchedCustomFields);
|
|
26075
26228
|
} else {
|
|
@@ -26229,70 +26382,78 @@ var useVariablesInDataSet = function useVariablesInDataSet(dataSet, queryable, v
|
|
|
26229
26382
|
// How to make sure the queries run when a field in a data set has been changed.
|
|
26230
26383
|
// need to pass in the data sets here
|
|
26231
26384
|
|
|
26232
|
-
var useQueryEffect = function useQueryEffect(queries, runQueriesCallback, filterConfig, dataSet, componentType, variables) {
|
|
26233
|
-
var _useState = React.useState(
|
|
26234
|
-
|
|
26235
|
-
|
|
26236
|
-
var _useState2 = React.useState(false),
|
|
26237
|
-
queriesAreChanging = _useState2[0],
|
|
26238
|
-
setQueriesAreChanging = _useState2[1];
|
|
26385
|
+
var useQueryEffect = function useQueryEffect(queries, runQueriesCallback, onResultsCallback, filterConfig, dataSet, componentType, variables) {
|
|
26386
|
+
var _useState = React.useState(false),
|
|
26387
|
+
queriesAreChanging = _useState[0],
|
|
26388
|
+
setQueriesAreChanging = _useState[1];
|
|
26239
26389
|
var _useVariablesInDataSe = useVariablesInDataSet(dataSet, queries, variables),
|
|
26240
26390
|
noOfVariableChanges = _useVariablesInDataSe.noOfVariableChanges;
|
|
26241
|
-
|
|
26242
|
-
|
|
26243
|
-
|
|
26244
|
-
|
|
26245
|
-
var
|
|
26246
|
-
var
|
|
26247
|
-
|
|
26248
|
-
|
|
26249
|
-
|
|
26250
|
-
|
|
26251
|
-
|
|
26252
|
-
|
|
26253
|
-
|
|
26254
|
-
|
|
26255
|
-
|
|
26256
|
-
|
|
26257
|
-
|
|
26258
|
-
|
|
26259
|
-
|
|
26260
|
-
|
|
26261
|
-
|
|
26262
|
-
if (Array.isArray(queries)) {
|
|
26263
|
-
setResults(queries.map(function (_q) {
|
|
26264
|
-
return null;
|
|
26265
|
-
}));
|
|
26391
|
+
try {
|
|
26392
|
+
var watchCustomFieldChangesKey = watchDataSetFieldChanges(dataSet, queries);
|
|
26393
|
+
React.useEffect(function () {
|
|
26394
|
+
var abortController = new AbortController();
|
|
26395
|
+
var fetch$1 = /*#__PURE__*/function () {
|
|
26396
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
26397
|
+
var hasResults;
|
|
26398
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
26399
|
+
while (1) switch (_context.prev = _context.next) {
|
|
26400
|
+
case 0:
|
|
26401
|
+
setQueriesAreChanging(true);
|
|
26402
|
+
_context.next = 3;
|
|
26403
|
+
return fetch(queries, runQueriesCallback, abortController.signal, filterConfig);
|
|
26404
|
+
case 3:
|
|
26405
|
+
hasResults = _context.sent;
|
|
26406
|
+
if (hasResults) {
|
|
26407
|
+
setQueriesAreChanging(false);
|
|
26408
|
+
if (!abortController.signal.aborted) {
|
|
26409
|
+
// Only set the results if the signal was not aborted...
|
|
26410
|
+
onResultsCallback(hasResults);
|
|
26411
|
+
}
|
|
26266
26412
|
} else {
|
|
26267
|
-
|
|
26413
|
+
if (Array.isArray(queries)) {
|
|
26414
|
+
onResultsCallback(queries.map(function (_q) {
|
|
26415
|
+
return null;
|
|
26416
|
+
}));
|
|
26417
|
+
} else {
|
|
26418
|
+
onResultsCallback([null]);
|
|
26419
|
+
}
|
|
26268
26420
|
}
|
|
26269
|
-
|
|
26270
|
-
|
|
26271
|
-
|
|
26272
|
-
|
|
26273
|
-
}
|
|
26274
|
-
}
|
|
26275
|
-
|
|
26276
|
-
|
|
26277
|
-
|
|
26421
|
+
case 5:
|
|
26422
|
+
case "end":
|
|
26423
|
+
return _context.stop();
|
|
26424
|
+
}
|
|
26425
|
+
}, _callee);
|
|
26426
|
+
}));
|
|
26427
|
+
return function fetch() {
|
|
26428
|
+
return _ref.apply(this, arguments);
|
|
26429
|
+
};
|
|
26430
|
+
}();
|
|
26431
|
+
fetch$1();
|
|
26432
|
+
return function () {
|
|
26433
|
+
abortController.abort('useQueryEffect unmounted');
|
|
26278
26434
|
};
|
|
26279
|
-
}(
|
|
26280
|
-
|
|
26281
|
-
|
|
26282
|
-
|
|
26435
|
+
}, [JSON.stringify({
|
|
26436
|
+
componentType: componentType,
|
|
26437
|
+
dataSetId: dataSet.id,
|
|
26438
|
+
queries: queries,
|
|
26439
|
+
filterConfig: filterConfig,
|
|
26440
|
+
watchCustomFieldChangesKey: watchCustomFieldChangesKey,
|
|
26441
|
+
noOfVariableChanges: noOfVariableChanges
|
|
26442
|
+
})]);
|
|
26443
|
+
return {
|
|
26444
|
+
queriesAreChanging: queriesAreChanging
|
|
26283
26445
|
};
|
|
26284
|
-
}
|
|
26285
|
-
|
|
26286
|
-
|
|
26287
|
-
|
|
26288
|
-
|
|
26289
|
-
|
|
26290
|
-
|
|
26291
|
-
|
|
26292
|
-
|
|
26293
|
-
|
|
26294
|
-
|
|
26295
|
-
};
|
|
26446
|
+
} catch (err) {
|
|
26447
|
+
setQueriesAreChanging(false);
|
|
26448
|
+
if (err instanceof FieldNotFoundInDataSet) {
|
|
26449
|
+
return {
|
|
26450
|
+
queriesAreChanging: false
|
|
26451
|
+
};
|
|
26452
|
+
}
|
|
26453
|
+
|
|
26454
|
+
// Re-throw
|
|
26455
|
+
throw err;
|
|
26456
|
+
}
|
|
26296
26457
|
};
|
|
26297
26458
|
|
|
26298
26459
|
/** Fetches unique field values for a given field. */
|
|
@@ -26301,6 +26462,9 @@ var useUniqueFieldValues = function useUniqueFieldValues(dataSet, fieldId) {
|
|
|
26301
26462
|
runQueriesCallback = _useDashboardContext.runQueriesCallback;
|
|
26302
26463
|
var _useDashboardBehaviou = useDashboardBehaviourContext(),
|
|
26303
26464
|
variables = _useDashboardBehaviou.variables;
|
|
26465
|
+
var _useState = React.useState(undefined),
|
|
26466
|
+
result = _useState[0],
|
|
26467
|
+
setResult = _useState[1];
|
|
26304
26468
|
var queries = [];
|
|
26305
26469
|
var dataSetField = findField(dataSet, fieldId);
|
|
26306
26470
|
if (dataSetField.dataType == 'string[]') {
|
|
@@ -26312,9 +26476,10 @@ var useUniqueFieldValues = function useUniqueFieldValues(dataSet, fieldId) {
|
|
|
26312
26476
|
var filterQuery = buildFilterQuery(dataSet, fieldId);
|
|
26313
26477
|
queries = [filterQuery];
|
|
26314
26478
|
}
|
|
26315
|
-
|
|
26316
|
-
|
|
26317
|
-
|
|
26479
|
+
useQueryEffect(queries, runQueriesCallback, function (results) {
|
|
26480
|
+
if (results === null) setResult(null);
|
|
26481
|
+
if (results) setResult(results[0]);
|
|
26482
|
+
}, {}, dataSet, undefined, variables);
|
|
26318
26483
|
return {
|
|
26319
26484
|
result: result != null ? result : null,
|
|
26320
26485
|
loading: result === undefined,
|
|
@@ -26736,7 +26901,7 @@ var useEditor = function useEditor() {
|
|
|
26736
26901
|
/* Infinite re-render loop
|
|
26737
26902
|
- When chaning dataset
|
|
26738
26903
|
- If not using default metric / grouping
|
|
26739
|
-
- Only when switching to 'Stock data' not to another dataset
|
|
26904
|
+
- Only when switching to 'Stock data' not to another dataset
|
|
26740
26905
|
*/
|
|
26741
26906
|
|
|
26742
26907
|
dispatch({
|
|
@@ -26753,6 +26918,12 @@ var useEditor = function useEditor() {
|
|
|
26753
26918
|
return _ref2.apply(this, arguments);
|
|
26754
26919
|
};
|
|
26755
26920
|
}();
|
|
26921
|
+
var setResults = function setResults(results) {
|
|
26922
|
+
dispatch({
|
|
26923
|
+
type: 'setResultsForComponentInEditor',
|
|
26924
|
+
results: results
|
|
26925
|
+
});
|
|
26926
|
+
};
|
|
26756
26927
|
var setDataSets = function setDataSets(dataSets) {
|
|
26757
26928
|
dispatch({
|
|
26758
26929
|
type: 'setDataSets',
|
|
@@ -26824,6 +26995,7 @@ var useEditor = function useEditor() {
|
|
|
26824
26995
|
numberFormatOptions: numberFormatOptions,
|
|
26825
26996
|
setAttributes: setAttributes,
|
|
26826
26997
|
setPartialAttributes: setPartialAttributes,
|
|
26998
|
+
setResults: setResults,
|
|
26827
26999
|
mode: mode,
|
|
26828
27000
|
origin: origin,
|
|
26829
27001
|
componentEditor: componentEditor,
|
|
@@ -33205,28 +33377,26 @@ var Legend = function Legend(props) {
|
|
|
33205
33377
|
});
|
|
33206
33378
|
};
|
|
33207
33379
|
|
|
33208
|
-
var useXAxisLabelCount = function useXAxisLabelCount(override, forceXAxisAsTime
|
|
33380
|
+
var useXAxisLabelCount = function useXAxisLabelCount(override, forceXAxisAsTime) {
|
|
33209
33381
|
var ref = React.useRef(null);
|
|
33210
33382
|
var _useState = React.useState(0),
|
|
33211
|
-
|
|
33212
|
-
|
|
33383
|
+
width = _useState[0],
|
|
33384
|
+
setWidth = _useState[1];
|
|
33213
33385
|
React.useEffect(function () {
|
|
33214
33386
|
var handleResize = _.throttle(function () {
|
|
33215
|
-
|
|
33216
|
-
var measurement = horizontal ? ref.current.clientHeight : ref.current.clientWidth;
|
|
33217
|
-
setSize(measurement);
|
|
33387
|
+
setWidth(ref.current ? ref.current.clientWidth : 0);
|
|
33218
33388
|
}, 100);
|
|
33219
33389
|
handleResize();
|
|
33220
|
-
window.addEventListener('resize',
|
|
33390
|
+
window.addEventListener('resize', function () {
|
|
33391
|
+
return handleResize;
|
|
33392
|
+
});
|
|
33221
33393
|
return function () {
|
|
33222
33394
|
window.removeEventListener('resize', handleResize);
|
|
33223
|
-
handleResize.cancel();
|
|
33224
33395
|
};
|
|
33225
33396
|
});
|
|
33226
|
-
|
|
33227
|
-
|
|
33228
|
-
|
|
33229
|
-
return [ref, approximateTickCount * multiplier];
|
|
33397
|
+
var approximateXTickCount = Math.min(width < 1000 ? parseInt(("" + width)[0]) : 12, 12);
|
|
33398
|
+
if (override != 'auto') return [ref, override];
|
|
33399
|
+
return [ref, approximateXTickCount * (forceXAxisAsTime ? 4 : 1)];
|
|
33230
33400
|
};
|
|
33231
33401
|
|
|
33232
33402
|
var buildTooltipStyles = function buildTooltipStyles(_ref) {
|
|
@@ -33968,7 +34138,7 @@ var VizzlyXYChart = function VizzlyXYChart(props) {
|
|
|
33968
34138
|
scaleToFit: 'shrink-only'
|
|
33969
34139
|
};
|
|
33970
34140
|
};
|
|
33971
|
-
var _useXAxisLabelCount = useXAxisLabelCount(approxXAxisLabelCount, props
|
|
34141
|
+
var _useXAxisLabelCount = useXAxisLabelCount(approxXAxisLabelCount, !(props != null && props.horizontal) && (props == null ? void 0 : props.forceXAxisAsTime)),
|
|
33972
34142
|
widthRef = _useXAxisLabelCount[0],
|
|
33973
34143
|
approximateXTickCount = _useXAxisLabelCount[1];
|
|
33974
34144
|
var _useState = React.useState(undefined),
|
|
@@ -35210,6 +35380,9 @@ var HeadlineStats = function HeadlineStats(props) {
|
|
|
35210
35380
|
var _props$component$attr, _props$component$attr2, _attributes$viewId, _props$dashboardBehav;
|
|
35211
35381
|
var _useDashboardBehaviou = useDashboardBehaviourContext(),
|
|
35212
35382
|
queryEngineConfig = _useDashboardBehaviou.queryEngineConfig;
|
|
35383
|
+
var _useState = React.useState([]),
|
|
35384
|
+
results = _useState[0],
|
|
35385
|
+
setResults = _useState[1];
|
|
35213
35386
|
var comparisonEnabled = Object.keys(props.component.attributes.timeDimension || {}).length !== 0 && ((_props$component$attr = props.component.attributes.headline) == null ? void 0 : _props$component$attr.func) === 'current';
|
|
35214
35387
|
var deltaTimeDimension = function () {
|
|
35215
35388
|
if (!comparisonEnabled) return null;
|
|
@@ -35231,12 +35404,11 @@ var HeadlineStats = function HeadlineStats(props) {
|
|
|
35231
35404
|
measure: measure,
|
|
35232
35405
|
filter: props.component.attributes.filter
|
|
35233
35406
|
});
|
|
35234
|
-
var _useQueryEffect = useQueryEffect(attributes, props.runQueriesCallback, {
|
|
35407
|
+
var _useQueryEffect = useQueryEffect(attributes, props.runQueriesCallback, setResults, {
|
|
35235
35408
|
localFilters: props.component.localFilters,
|
|
35236
35409
|
globalFilters: props.globalFilters
|
|
35237
35410
|
}, props.dataSet, undefined, props.dashboardBehaviour.variables),
|
|
35238
|
-
queriesAreChanging = _useQueryEffect.queriesAreChanging
|
|
35239
|
-
results = _useQueryEffect.results;
|
|
35411
|
+
queriesAreChanging = _useQueryEffect.queriesAreChanging;
|
|
35240
35412
|
return jsxRuntime.jsx(View, {
|
|
35241
35413
|
minHeight: comparisonEnabled ? 80 : 56,
|
|
35242
35414
|
children: jsxRuntime.jsx(SingleStatView, _extends({}, attributes, {
|
|
@@ -35524,14 +35696,17 @@ var AreaChart$4 = function AreaChart(props) {
|
|
|
35524
35696
|
onDrilldown = _useState[0],
|
|
35525
35697
|
setOnDrilldown = _useState[1];
|
|
35526
35698
|
var _props$component = props.component,
|
|
35699
|
+
results = _props$component.results,
|
|
35527
35700
|
attributes = _props$component.attributes,
|
|
35528
35701
|
localFilters = _props$component.localFilters;
|
|
35529
|
-
var _useQueryEffect = useQueryEffect(attributes, props.runQueriesCallback, {
|
|
35702
|
+
var _useQueryEffect = useQueryEffect(attributes, props.runQueriesCallback, props.setResults, {
|
|
35530
35703
|
localFilters: props.component.localFilters,
|
|
35531
35704
|
globalFilters: props.globalFilters
|
|
35532
35705
|
}, props.dataSet, undefined, props.dashboardBehaviour.variables),
|
|
35533
|
-
queriesAreChanging = _useQueryEffect.queriesAreChanging
|
|
35534
|
-
|
|
35706
|
+
queriesAreChanging = _useQueryEffect.queriesAreChanging;
|
|
35707
|
+
var componentInterface = getComponentInterface(props.component.attributes.type, {
|
|
35708
|
+
queryEngineConfig: props.dashboardBehaviour.queryEngineConfig
|
|
35709
|
+
});
|
|
35535
35710
|
return jsxRuntime.jsxs(React.Fragment, {
|
|
35536
35711
|
children: [jsxRuntime.jsx(memoized, _extends({
|
|
35537
35712
|
id: props.id
|
|
@@ -36764,18 +36939,16 @@ var usePreAggregatedDataSet = function usePreAggregatedDataSet(dataSet, attribut
|
|
|
36764
36939
|
})]);
|
|
36765
36940
|
};
|
|
36766
36941
|
|
|
36767
|
-
var useComponentEffect = function useComponentEffect(attributes, dataSet, queryEngineConfig, filterConfig, updateComponentAttributes, runQueriesCallback, variables) {
|
|
36942
|
+
var useComponentEffect = function useComponentEffect(attributes, dataSet, queryEngineConfig, filterConfig, updateComponentAttributes, runQueriesCallback, setResults, variables) {
|
|
36768
36943
|
var queryable = attributes;
|
|
36769
36944
|
if (dataSet.preAggregated) {
|
|
36770
36945
|
queryable = [buildViewOnlyQuery(dataSet)];
|
|
36771
36946
|
}
|
|
36772
36947
|
usePreAggregatedDataSet(dataSet, attributes, queryEngineConfig, updateComponentAttributes);
|
|
36773
|
-
var _useQueryEffect = useQueryEffect(queryable, runQueriesCallback, filterConfig, dataSet, attributes.type, variables),
|
|
36774
|
-
queriesAreChanging = _useQueryEffect.queriesAreChanging
|
|
36775
|
-
results = _useQueryEffect.results;
|
|
36948
|
+
var _useQueryEffect = useQueryEffect(queryable, runQueriesCallback, setResults, filterConfig, dataSet, attributes.type, variables),
|
|
36949
|
+
queriesAreChanging = _useQueryEffect.queriesAreChanging;
|
|
36776
36950
|
return {
|
|
36777
|
-
queriesAreChanging: queriesAreChanging
|
|
36778
|
-
results: results
|
|
36951
|
+
queriesAreChanging: queriesAreChanging
|
|
36779
36952
|
};
|
|
36780
36953
|
};
|
|
36781
36954
|
|
|
@@ -36827,7 +37000,9 @@ function useDrilldownSelection(results, attributes, setAttributes, dataSet, quer
|
|
|
36827
37000
|
|
|
36828
37001
|
var BarChart$4 = function BarChart(props) {
|
|
36829
37002
|
var _props$dashboardBehav;
|
|
36830
|
-
var
|
|
37003
|
+
var _props$component = props.component,
|
|
37004
|
+
localFilters = _props$component.localFilters,
|
|
37005
|
+
results = _props$component.results;
|
|
36831
37006
|
var dashboardBehaviour = props.dashboardBehaviour;
|
|
36832
37007
|
var _useState = React.useState(props.component.attributes),
|
|
36833
37008
|
attributes = _useState[0],
|
|
@@ -36838,18 +37013,17 @@ var BarChart$4 = function BarChart(props) {
|
|
|
36838
37013
|
setDrilldownSelections([]);
|
|
36839
37014
|
}
|
|
36840
37015
|
}, [JSON.stringify(props.component.attributes)]);
|
|
36841
|
-
var _useComponentEffect = useComponentEffect(attributes, props.dataSet, props.dashboardBehaviour.queryEngineConfig, {
|
|
36842
|
-
localFilters: localFilters,
|
|
36843
|
-
globalFilters: props.globalFilters
|
|
36844
|
-
}, props.updateComponentAttributes, props.runQueriesCallback, props.dashboardBehaviour.variables),
|
|
36845
|
-
queriesAreChanging = _useComponentEffect.queriesAreChanging,
|
|
36846
|
-
results = _useComponentEffect.results;
|
|
36847
37016
|
var _useDrilldownSelectio = useDrilldownSelection(results, attributes, function (newAttributes) {
|
|
36848
37017
|
return setAttributes(newAttributes);
|
|
36849
37018
|
}, props.dataSet, dashboardBehaviour.queryEngineConfig),
|
|
36850
37019
|
onDrilldownChange = _useDrilldownSelectio.onDrilldownChange,
|
|
36851
37020
|
setDrilldownSelections = _useDrilldownSelectio.setDrilldownSelections,
|
|
36852
37021
|
drilldownSelections = _useDrilldownSelectio.drilldownSelections;
|
|
37022
|
+
var _useComponentEffect = useComponentEffect(drilldownSelections.length > 0 ? attributes : props.component.attributes, props.dataSet, props.dashboardBehaviour.queryEngineConfig, {
|
|
37023
|
+
localFilters: localFilters,
|
|
37024
|
+
globalFilters: props.globalFilters
|
|
37025
|
+
}, props.updateComponentAttributes, props.runQueriesCallback, props.setResults, props.dashboardBehaviour.variables),
|
|
37026
|
+
queriesAreChanging = _useComponentEffect.queriesAreChanging;
|
|
36853
37027
|
var runViewClickQuery = /*#__PURE__*/function () {
|
|
36854
37028
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(queries, existingField) {
|
|
36855
37029
|
var filter, attributes, abortController, queryResults;
|
|
@@ -37156,14 +37330,14 @@ var LineChart$4 = function LineChart(props) {
|
|
|
37156
37330
|
onDrilldown = _useState[0],
|
|
37157
37331
|
setOnDrilldown = _useState[1];
|
|
37158
37332
|
var _props$component = props.component,
|
|
37333
|
+
results = _props$component.results,
|
|
37159
37334
|
attributes = _props$component.attributes,
|
|
37160
37335
|
localFilters = _props$component.localFilters;
|
|
37161
37336
|
var _useComponentEffect = useComponentEffect(attributes, props.dataSet, props.dashboardBehaviour.queryEngineConfig, {
|
|
37162
37337
|
localFilters: localFilters,
|
|
37163
37338
|
globalFilters: props.globalFilters
|
|
37164
|
-
}, props.updateComponentAttributes, props.runQueriesCallback, props.dashboardBehaviour.variables),
|
|
37165
|
-
queriesAreChanging = _useComponentEffect.queriesAreChanging
|
|
37166
|
-
results = _useComponentEffect.results;
|
|
37339
|
+
}, props.updateComponentAttributes, props.runQueriesCallback, props.setResults, props.dashboardBehaviour.variables),
|
|
37340
|
+
queriesAreChanging = _useComponentEffect.queriesAreChanging;
|
|
37167
37341
|
return jsxRuntime.jsxs(React.Fragment, {
|
|
37168
37342
|
children: [jsxRuntime.jsx(memoized$1, _extends({
|
|
37169
37343
|
id: props.id
|
|
@@ -37377,14 +37551,14 @@ var memoized$2 = /*#__PURE__*/React.memo(ScatterChartView, shouldUpdate);
|
|
|
37377
37551
|
var ScatterChart$3 = function ScatterChart(props) {
|
|
37378
37552
|
var _props$dashboardBehav;
|
|
37379
37553
|
var _props$component = props.component,
|
|
37554
|
+
results = _props$component.results,
|
|
37380
37555
|
attributes = _props$component.attributes,
|
|
37381
37556
|
localFilters = _props$component.localFilters;
|
|
37382
|
-
var _useQueryEffect = useQueryEffect(attributes, props.runQueriesCallback, {
|
|
37557
|
+
var _useQueryEffect = useQueryEffect(attributes, props.runQueriesCallback, props.setResults, {
|
|
37383
37558
|
localFilters: localFilters,
|
|
37384
37559
|
globalFilters: props.globalFilters
|
|
37385
37560
|
}, props.dataSet, undefined, props.dashboardBehaviour.variables),
|
|
37386
|
-
queriesAreChanging = _useQueryEffect.queriesAreChanging
|
|
37387
|
-
results = _useQueryEffect.results;
|
|
37561
|
+
queriesAreChanging = _useQueryEffect.queriesAreChanging;
|
|
37388
37562
|
return jsxRuntime.jsx(memoized$2, _extends({
|
|
37389
37563
|
id: props.id
|
|
37390
37564
|
}, attributes, {
|
|
@@ -38760,7 +38934,9 @@ var memoized$3 = /*#__PURE__*/React.memo(PieChartView, shouldUpdate);
|
|
|
38760
38934
|
|
|
38761
38935
|
var PieChart$3 = function PieChart(props) {
|
|
38762
38936
|
var _props$dashboardBehav;
|
|
38763
|
-
var
|
|
38937
|
+
var _props$component = props.component,
|
|
38938
|
+
results = _props$component.results,
|
|
38939
|
+
localFilters = _props$component.localFilters;
|
|
38764
38940
|
var dashboardBehaviour = props.dashboardBehaviour;
|
|
38765
38941
|
var _useState = React.useState(props.component.attributes),
|
|
38766
38942
|
attributes = _useState[0],
|
|
@@ -38771,18 +38947,17 @@ var PieChart$3 = function PieChart(props) {
|
|
|
38771
38947
|
setDrilldownSelections([]);
|
|
38772
38948
|
}
|
|
38773
38949
|
}, [JSON.stringify(props.component.attributes)]);
|
|
38774
|
-
var _useQueryEffect = useQueryEffect(attributes, props.runQueriesCallback, {
|
|
38775
|
-
localFilters: localFilters,
|
|
38776
|
-
globalFilters: props.globalFilters
|
|
38777
|
-
}, props.dataSet, undefined, props.dashboardBehaviour.variables),
|
|
38778
|
-
queriesAreChanging = _useQueryEffect.queriesAreChanging,
|
|
38779
|
-
results = _useQueryEffect.results;
|
|
38780
38950
|
var _useDrilldownSelectio = useDrilldownSelection(results, attributes, function (newAttributes) {
|
|
38781
38951
|
return setAttributes(newAttributes);
|
|
38782
38952
|
}, props.dataSet, dashboardBehaviour.queryEngineConfig),
|
|
38783
38953
|
onDrilldownChange = _useDrilldownSelectio.onDrilldownChange,
|
|
38784
38954
|
setDrilldownSelections = _useDrilldownSelectio.setDrilldownSelections,
|
|
38785
38955
|
drilldownSelections = _useDrilldownSelectio.drilldownSelections;
|
|
38956
|
+
var _useQueryEffect = useQueryEffect(attributes, props.runQueriesCallback, props.setResults, {
|
|
38957
|
+
localFilters: localFilters,
|
|
38958
|
+
globalFilters: props.globalFilters
|
|
38959
|
+
}, props.dataSet, undefined, props.dashboardBehaviour.variables),
|
|
38960
|
+
queriesAreChanging = _useQueryEffect.queriesAreChanging;
|
|
38786
38961
|
var runViewClickQuery = /*#__PURE__*/function () {
|
|
38787
38962
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(queries, existingField) {
|
|
38788
38963
|
var filter, attributes, abortController, queryResults;
|
|
@@ -42912,14 +43087,14 @@ var memoized$4 = /*#__PURE__*/React.memo(BubbleChartView, shouldUpdate);
|
|
|
42912
43087
|
var BubbleChart$3 = function BubbleChart(props) {
|
|
42913
43088
|
var _props$dashboardBehav;
|
|
42914
43089
|
var _props$component = props.component,
|
|
43090
|
+
results = _props$component.results,
|
|
42915
43091
|
attributes = _props$component.attributes,
|
|
42916
43092
|
localFilters = _props$component.localFilters;
|
|
42917
|
-
var _useQueryEffect = useQueryEffect(attributes, props.runQueriesCallback, {
|
|
43093
|
+
var _useQueryEffect = useQueryEffect(attributes, props.runQueriesCallback, props.setResults, {
|
|
42918
43094
|
localFilters: localFilters,
|
|
42919
43095
|
globalFilters: props.globalFilters
|
|
42920
43096
|
}, props.dataSet, undefined, props.dashboardBehaviour.variables),
|
|
42921
|
-
queriesAreChanging = _useQueryEffect.queriesAreChanging
|
|
42922
|
-
results = _useQueryEffect.results;
|
|
43097
|
+
queriesAreChanging = _useQueryEffect.queriesAreChanging;
|
|
42923
43098
|
return jsxRuntime.jsx(memoized$4, _extends({
|
|
42924
43099
|
id: props.id
|
|
42925
43100
|
}, attributes, {
|
|
@@ -43282,9 +43457,7 @@ var Tooltip$1 = function Tooltip(_ref) {
|
|
|
43282
43457
|
xKey = _ref.xKey,
|
|
43283
43458
|
yKeys = _ref.yKeys,
|
|
43284
43459
|
theme = _ref.theme,
|
|
43285
|
-
items = _ref.items
|
|
43286
|
-
_ref$shouldShowColorL = _ref.shouldShowColorLegend,
|
|
43287
|
-
shouldShowColorLegend = _ref$shouldShowColorL === void 0 ? true : _ref$shouldShowColorL;
|
|
43460
|
+
items = _ref.items;
|
|
43288
43461
|
var tooltipRef = React.useRef(null);
|
|
43289
43462
|
var _useState = React.useState({
|
|
43290
43463
|
left: tooltipLeft
|
|
@@ -43333,7 +43506,7 @@ var Tooltip$1 = function Tooltip(_ref) {
|
|
|
43333
43506
|
fontSize: '15px',
|
|
43334
43507
|
width: '100%',
|
|
43335
43508
|
minWidth: MIN_TOOLTIP_WIDTH
|
|
43336
|
-
}, ";label:Tooltip;", "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,
|
|
43509
|
+
}, ";label:Tooltip;", "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIlRvb2x0aXAudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQTJGcUIiLCJmaWxlIjoiVG9vbHRpcC50c3giLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgUmVhY3QsIHsgQ1NTUHJvcGVydGllcywgRnJhZ21lbnQsIHVzZUVmZmVjdCwgdXNlUmVmLCB1c2VTdGF0ZSB9IGZyb20gJ3JlYWN0JztcbmltcG9ydCB7IGNyZWF0ZVBvcnRhbCB9IGZyb20gJ3JlYWN0LWRvbSc7XG5cbmltcG9ydCB7I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VpZ2h0OiAnaW5oZXJpdCcsXG4gICAgICAgICAgICBsZXR0ZXJTcGFjaW5nOiAnaW5oZXJpdCcsXG4gICAgICAgICAgICBmb250V2VpZ2h0OiAnYm9sZCcsXG4gICAgICAgICAgICBmb250U2l6ZTogJzE1cHgnLFxuICAgICAgICAgICAgd2lkdGg6ICcxMDAlJyxcbiAgICAgICAgICAgIG1pbldpZHRoOiBNSU5fVE9PTFRJUF9XSURUSCxcbiAgICAgICAgICB9KX1cbiAgICAgICAgPlxuICAgICAgICAgIHt0b29sdGlwRGF0YVt4S2V5XT8uZm9ybWF0dGVkVmFsdWUgPz8gdG9vbHRpcERhdGFbeEtleV0udmFsdWV9XG4gICAgICAgIDwvZGl2PlxuICAgICAgICA8dGFibGVcbiAgICAgICAgICBjZWxsUGFkZGluZz17MH1cbiAgICAgICAgICBjZWxsU3BhY2luZz17MH1cbiAgICAgICAgICBjbGFzc05hbWU9e2Nzcyh7XG4gICAgICAgICAgICBtYXJnaW46ICcwJyxcbiAgICAgICAgICAgIGJvcmRlclNwYWNpbmc6ICcwJyxcbiAgICAgICAgICAgIGJvcmRlckNvbGxhcHNlOiAnaW5oZXJpdCcsXG4gICAgICAgICAgICBib3JkZXI6ICdub25lJyxcbiAgICAgICAgICB9KX1cbiAgICAgICAgPlxuICAgICAgICAgIDx0Ym9keT5cbiAgICAgICAgICAgIHtpdGVtcy5tYXAoKGl0ZW0sIGluZGV4KSA9PiB7XG4gICAgICAgICAgICAgIHJldHVybiAoXG4gICAgICAgICAgICAgICAgPEZyYWdtZW50IGtleT17aW5kZXh9PlxuICAgICAgICAgICAgICAgICAge2l0ZW0ubGVnZW5kSXRlbXM/Lm1hcCgobGVnZW5kSXRlbSwgaW5kZXgpID0+IHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCF0b29sdGlwRGF0YVtsZWdlbmRJdGVtLnlLZXldIHx8IHRvb2x0aXBEYXRhW2xlZ2VuZEl0ZW0ueUtleV0udmFsdWUgPT09IG51bGwpIHtcbiAgICAgICAgICAgICAgICAgICAgICAvLyB5S2V5IGNvdWxkIG5vdCBiZSBmb3VuZCBpbiB0b29sdGlwRGF0YVxuICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBudWxsO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAoXG4gICAgICAgICAgICAgICAgICAgICAgaXRlbS52aXNpYmxlWUtleXM/LmluY2x1ZGVzKGxlZ2VuZEl0ZW0ueUtleSkgJiYgKFxuICAgICAgICAgICAgICAgICAgICAgICAgPHRyIGtleT17bGVnZW5kSXRlbS55S2V5fT5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgPHRkXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc3R5bGU9e3tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZlcnRpY2FsQWxpZ246ICdtaWRkbGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFkZGluZzogaW5kZXggPT09IDAgPyAnMTJweCA4cHggMCAwJyA6ICc4cHggOHB4IDAgMCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aWR0aDogJ2F1dG8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH19XG4gICAgICAgICAgICAgICAgICAgICAgICAgID5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8TGVnZW5kSXRlbUJveFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29sb3I9e2dldENvbG9yKHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVmYXVsdENvbG9yOiBsZWdlbmRJdGVtLmNvbG9yLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZTogdG9vbHRpcERhdGFbbGVnZW5kSXRlbS55S2V5XS52YWx1ZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeUtleTogbGVnZW5kSXRlbS55S2V5LFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25kaXRpb25hbEZvcm1hdHRpbmdSdWxlczogaXRlbS5jb25kaXRpb25hbEZvcm1hdHRpbmdSdWxlcyA/PyBbXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3R5bGU9e2xlZ2VuZEl0ZW0uc3R5bGUgYXMgTGluZVN0eWxlc31cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHlLZXk9e2xlZ2VuZEl0ZW0ueUtleX1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvPlxuICAgICAgICAgICAgICAgICAgICAgICAgICA8L3RkPlxuICAgICAgICAgICAgICAgICAgICAgICAgICA8dGQgc3R5bGU9e3sgcGFkZGluZzogJzhweCAwIDAgMCcgfX0+e2tleXNbbGVnZW5kSXRlbS55S2V5XS5rZXlGb3JtYXR0ZWR9PC90ZD5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgPHRkIHN0eWxlPXt7IGZvbnRXZWlnaHQ6ICdib2xkJywgcGFkZGluZzogJzhweCAwIDAgMTZweCcgfX0+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAge3Rvb2x0aXBEYXRhW2xlZ2VuZEl0ZW0ueUtleV0uZm9ybWF0dGVkVmFsdWVcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gdG9vbHRpcERhdGFbbGVnZW5kSXRlbS55S2V5XS5mb3JtYXR0ZWRWYWx1ZVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiB0b29sdGlwRGF0YVtsZWdlbmRJdGVtLnlLZXldLnZhbHVlfVxuICAgICAgICAgICAgICAgICAgICAgICAgICA8L3RkPlxuICAgICAgICAgICAgICAgICAgICAgICAgPC90cj5cbiAgICAgICAgICAgICAgICAgICAgICApXG4gICAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgICB9KX1cbiAgICAgICAgICAgICAgICA8L0ZyYWdtZW50PlxuICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgfSl9XG5cbiAgICAgICAgICAgIHtzaG93Um91bmRlZFRvdGFsICYmIHlLZXlzICYmIChcbiAgICAgICAgICAgICAgPHRyPlxuICAgICAgICAgICAgICAgIDx0ZCBjb2xTcGFuPXsyfSBzdHlsZT17eyBwYWRkaW5nOiAnMTJweCAwIDAgMCcgfX0+XG4gICAgICAgICAgICAgICAgICBSb3VuZGVkIFRvdGFsXG4gICAgICAgICAgICAgICAgPC90ZD5cbiAgICAgICAgICAgICAgICA8dGQgc3R5bGU9e3sgZm9udFdlaWdodDogJ2JvbGQnLCBwYWRkaW5nOiAnMTJweCAwIDAgMTZweCcgfX0+XG4gICAgICAgICAgICAgICAgICB7eUtleXMucmVkdWNlKCh0b3RhbCwga2V5KSA9PiB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiB0b3RhbCArIE1hdGgucm91bmQodG9vbHRpcERhdGFba2V5XS52YWx1ZSBhcyBudW1iZXIpO1xuICAgICAgICAgICAgICAgICAgfSwgMCl9XG4gICAgICAgICAgICAgICAgPC90ZD5cbiAgICAgICAgICAgICAgPC90cj5cbiAgICAgICAgICAgICl9XG4gICAgICAgICAgPC90Ym9keT5cbiAgICAgICAgPC90YWJsZT5cbiAgICAgIDwvZGl2PlxuICAgIDwvZGl2PixcbiAgICBkb2N1bWVudC5ib2R5XG4gICk7XG59O1xuIl19 */"),
|
|
43337
43510
|
children: (_tooltipData$xKey$for = (_tooltipData$xKey = tooltipData[xKey]) == null ? void 0 : _tooltipData$xKey.formattedValue) != null ? _tooltipData$xKey$for : tooltipData[xKey].value
|
|
43338
43511
|
}), jsxRuntime.jsx("table", {
|
|
43339
43512
|
cellPadding: 0,
|
|
@@ -43341,7 +43514,7 @@ var Tooltip$1 = function Tooltip(_ref) {
|
|
|
43341
43514
|
className: /*#__PURE__*/css$1.css( {
|
|
43342
43515
|
name: "9a1sa-Tooltip",
|
|
43343
43516
|
styles: "margin:0;border-spacing:0;border-collapse:inherit;border:none;label:Tooltip;",
|
|
43344
|
-
map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,
|
|
43517
|
+
map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIlRvb2x0aXAudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQTBHcUIiLCJmaWxlIjoiVG9vbHRpcC50c3giLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgUmVhY3QsIHsgQ1NTUHJvcGVydGllcywgRnJhZ21lbnQsIHVzZUVmZmVjdCwgdXNlUmVmLCB1c2VTdGF0ZSB9IGZyb20gJ3JlYWN0JztcbmltcG9ydCB7IGNyZWF0ZVBvcnRhbCB9IGZyb20gJ3JlYWN0LWRvbSc7XG5cbmltcG9ydCB7IGdldENvbG9yIH0gZnJvbSAnLi4vLi4vdXRpbHMnO1xuaW1wb3J0IHsgTGVnZW5kSXRlbUJveCB9IGZyb20gJy4uL0xlZ2VuZC9MZWdlbmRJdGVtQm94JztcbmltcG9ydCB7IFNoYXBlRGVmaW5pdGlvbiwgQ29uZGl0aW9uYWxGb3JtYXR0aW5nUnVsZSwgRGF0YUl0ZW0sIEtleSB9IGZyb20gJ3NoYXJlZC1sb2dpYy9zcmMvQ2hhcnRzVjIvdHlwZXMnO1xuaW1wb3J0IHsgTGluZVN0eWxlcyB9IGZyb20gJ3NoYXJlZC1sb2dpYy9zcmMvTGluZUNoYXJ0VjIvdHlwZXMnO1xuaW1wb3J0IHsgQmFyU3R5bGVzIH0gZnJvbSAnc2hhcmVkLWxvZ2ljL3NyYy9CYXJDaGFydFYyL3R5cGVzJztcbmltcG9ydCB7IEFyZWFTdHlsZXMgfSBmcm9tICdzaGFyZWQtbG9naWMvc3JjL0FyZWFDaGFydFYyL3R5cGVzJztcbmltcG9ydCB7IEJ1YmJsZVN0eWxlcyB9IGZyb20gJ3NoYXJlZC1sb2dpYy9zcmMvQnViYmxlQ2hhcnRWM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gICAgPGRpdlxuICAgICAgcmVmPXt0b29sdGlwUmVmfVxuICAgICAgc3R5bGU9e3tcbiAgICAgICAgcG9zaXRpb246ICdhYnNvbHV0ZScsXG4gICAgICAgIGxlZnQ6IHBvc2l0aW9uLmxlZnQsXG4gICAgICAgIHRvcDogdG9vbHRpcFRvcCxcbiAgICAgICAgekluZGV4OiAyMTQ3NDgzNjQ3ICogMTAsXG4gICAgICAgIC4uLnRoZW1lLFxuICAgICAgfX1cbiAgICA+XG4gICAgICA8ZGl2IHN0eWxlPXt7IHdvcmRCcmVhazogJ2JyZWFrLWFsbCcgfX0+XG4gICAgICAgIDxkaXZcbiAgICAgICAgICBjbGFzc05hbWU9e2Nzcyh7XG4gICAgICAgICAgICBmb250RmFtaWx5OiAnaW5oZXJpdCcsXG4gICAgICAgICAgICBsaW5lSGVpZ2h0OiAnaW5oZXJpdCcsXG4gICAgICAgICAgICBsZXR0ZXJTcGFjaW5nOiAnaW5oZXJpdCcsXG4gICAgICAgICAgICBmb250V2VpZ2h0OiAnYm9sZCcsXG4gICAgICAgICAgICBmb250U2l6ZTogJzE1cHgnLFxuICAgICAgICAgICAgd2lkdGg6ICcxMDAlJyxcbiAgICAgICAgICAgIG1pbldpZHRoOiBNSU5fVE9PTFRJUF9XSURUSCxcbiAgICAgICAgICB9KX1cbiAgICAgICAgPlxuICAgICAgICAgIHt0b29sdGlwRGF0YVt4S2V5XT8uZm9ybWF0dGVkVmFsdWUgPz8gdG9vbHRpcERhdGFbeEtleV0udmFsdWV9XG4gICAgICAgIDwvZGl2PlxuICAgICAgICA8dGFibGVcbiAgICAgICAgICBjZWxsUGFkZGluZz17MH1cbiAgICAgICAgICBjZWxsU3BhY2luZz17MH1cbiAgICAgICAgICBjbGFzc05hbWU9e2Nzcyh7XG4gICAgICAgICAgICBtYXJnaW46ICcwJyxcbiAgICAgICAgICAgIGJvcmRlclNwYWNpbmc6ICcwJyxcbiAgICAgICAgICAgIGJvcmRlckNvbGxhcHNlOiAnaW5oZXJpdCcsXG4gICAgICAgICAgICBib3JkZXI6ICdub25lJyxcbiAgICAgICAgICB9KX1cbiAgICAgICAgPlxuICAgICAgICAgIDx0Ym9keT5cbiAgICAgICAgICAgIHtpdGVtcy5tYXAoKGl0ZW0sIGluZGV4KSA9PiB7XG4gICAgICAgICAgICAgIHJldHVybiAoXG4gICAgICAgICAgICAgICAgPEZyYWdtZW50IGtleT17aW5kZXh9PlxuICAgICAgICAgICAgICAgICAge2l0ZW0ubGVnZW5kSXRlbXM/Lm1hcCgobGVnZW5kSXRlbSwgaW5kZXgpID0+IHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCF0b29sdGlwRGF0YVtsZWdlbmRJdGVtLnlLZXldIHx8IHRvb2x0aXBEYXRhW2xlZ2VuZEl0ZW0ueUtleV0udmFsdWUgPT09IG51bGwpIHtcbiAgICAgICAgICAgICAgICAgICAgICAvLyB5S2V5IGNvdWxkIG5vdCBiZSBmb3VuZCBpbiB0b29sdGlwRGF0YVxuICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBudWxsO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAoXG4gICAgICAgICAgICAgICAgICAgICAgaXRlbS52aXNpYmxlWUtleXM/LmluY2x1ZGVzKGxlZ2VuZEl0ZW0ueUtleSkgJiYgKFxuICAgICAgICAgICAgICAgICAgICAgICAgPHRyIGtleT17bGVnZW5kSXRlbS55S2V5fT5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgPHRkXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc3R5bGU9e3tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZlcnRpY2FsQWxpZ246ICdtaWRkbGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFkZGluZzogaW5kZXggPT09IDAgPyAnMTJweCA4cHggMCAwJyA6ICc4cHggOHB4IDAgMCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aWR0aDogJ2F1dG8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH19XG4gICAgICAgICAgICAgICAgICAgICAgICAgID5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8TGVnZW5kSXRlbUJveFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29sb3I9e2dldENvbG9yKHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVmYXVsdENvbG9yOiBsZWdlbmRJdGVtLmNvbG9yLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZTogdG9vbHRpcERhdGFbbGVnZW5kSXRlbS55S2V5XS52YWx1ZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeUtleTogbGVnZW5kSXRlbS55S2V5LFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25kaXRpb25hbEZvcm1hdHRpbmdSdWxlczogaXRlbS5jb25kaXRpb25hbEZvcm1hdHRpbmdSdWxlcyA/PyBbXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3R5bGU9e2xlZ2VuZEl0ZW0uc3R5bGUgYXMgTGluZVN0eWxlc31cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHlLZXk9e2xlZ2VuZEl0ZW0ueUtleX1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvPlxuICAgICAgICAgICAgICAgICAgICAgICAgICA8L3RkPlxuICAgICAgICAgICAgICAgICAgICAgICAgICA8dGQgc3R5bGU9e3sgcGFkZGluZzogJzhweCAwIDAgMCcgfX0+e2tleXNbbGVnZW5kSXRlbS55S2V5XS5rZXlGb3JtYXR0ZWR9PC90ZD5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgPHRkIHN0eWxlPXt7IGZvbnRXZWlnaHQ6ICdib2xkJywgcGFkZGluZzogJzhweCAwIDAgMTZweCcgfX0+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAge3Rvb2x0aXBEYXRhW2xlZ2VuZEl0ZW0ueUtleV0uZm9ybWF0dGVkVmFsdWVcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gdG9vbHRpcERhdGFbbGVnZW5kSXRlbS55S2V5XS5mb3JtYXR0ZWRWYWx1ZVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiB0b29sdGlwRGF0YVtsZWdlbmRJdGVtLnlLZXldLnZhbHVlfVxuICAgICAgICAgICAgICAgICAgICAgICAgICA8L3RkPlxuICAgICAgICAgICAgICAgICAgICAgICAgPC90cj5cbiAgICAgICAgICAgICAgICAgICAgICApXG4gICAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgICB9KX1cbiAgICAgICAgICAgICAgICA8L0ZyYWdtZW50PlxuICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgfSl9XG5cbiAgICAgICAgICAgIHtzaG93Um91bmRlZFRvdGFsICYmIHlLZXlzICYmIChcbiAgICAgICAgICAgICAgPHRyPlxuICAgICAgICAgICAgICAgIDx0ZCBjb2xTcGFuPXsyfSBzdHlsZT17eyBwYWRkaW5nOiAnMTJweCAwIDAgMCcgfX0+XG4gICAgICAgICAgICAgICAgICBSb3VuZGVkIFRvdGFsXG4gICAgICAgICAgICAgICAgPC90ZD5cbiAgICAgICAgICAgICAgICA8dGQgc3R5bGU9e3sgZm9udFdlaWdodDogJ2JvbGQnLCBwYWRkaW5nOiAnMTJweCAwIDAgMTZweCcgfX0+XG4gICAgICAgICAgICAgICAgICB7eUtleXMucmVkdWNlKCh0b3RhbCwga2V5KSA9PiB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiB0b3RhbCArIE1hdGgucm91bmQodG9vbHRpcERhdGFba2V5XS52YWx1ZSBhcyBudW1iZXIpO1xuICAgICAgICAgICAgICAgICAgfSwgMCl9XG4gICAgICAgICAgICAgICAgPC90ZD5cbiAgICAgICAgICAgICAgPC90cj5cbiAgICAgICAgICAgICl9XG4gICAgICAgICAgPC90Ym9keT5cbiAgICAgICAgPC90YWJsZT5cbiAgICAgIDwvZGl2PlxuICAgIDwvZGl2PixcbiAgICBkb2N1bWVudC5ib2R5XG4gICk7XG59O1xuIl19 */",
|
|
43345
43518
|
toString: _EMOTION_STRINGIFIED_CSS_ERROR__$5
|
|
43346
43519
|
}),
|
|
43347
43520
|
children: jsxRuntime.jsxs("tbody", {
|
|
@@ -43355,7 +43528,7 @@ var Tooltip$1 = function Tooltip(_ref) {
|
|
|
43355
43528
|
return null;
|
|
43356
43529
|
}
|
|
43357
43530
|
return ((_item$visibleYKeys = item.visibleYKeys) == null ? void 0 : _item$visibleYKeys.includes(legendItem.yKey)) && jsxRuntime.jsxs("tr", {
|
|
43358
|
-
children: [
|
|
43531
|
+
children: [jsxRuntime.jsx("td", {
|
|
43359
43532
|
style: {
|
|
43360
43533
|
verticalAlign: 'middle',
|
|
43361
43534
|
padding: index === 0 ? '12px 8px 0 0' : '8px 8px 0 0',
|
|
@@ -43383,7 +43556,7 @@ var Tooltip$1 = function Tooltip(_ref) {
|
|
|
43383
43556
|
},
|
|
43384
43557
|
children: tooltipData[legendItem.yKey].formattedValue ? tooltipData[legendItem.yKey].formattedValue : tooltipData[legendItem.yKey].value
|
|
43385
43558
|
})]
|
|
43386
|
-
}, legendItem.yKey
|
|
43559
|
+
}, legendItem.yKey);
|
|
43387
43560
|
})
|
|
43388
43561
|
}, index);
|
|
43389
43562
|
}), showRoundedTotal && yKeys && jsxRuntime.jsxs("tr", {
|
|
@@ -43556,64 +43729,33 @@ var Legend$1 = function Legend(_ref) {
|
|
|
43556
43729
|
});
|
|
43557
43730
|
};
|
|
43558
43731
|
|
|
43559
|
-
var ASSUMED_AVERAGE_CHAR_WIDTH =
|
|
43560
|
-
|
|
43732
|
+
var ASSUMED_AVERAGE_CHAR_WIDTH = 4;
|
|
43561
43733
|
function calculateWordWidth(word, avgCharWidth) {
|
|
43562
43734
|
return word.length * avgCharWidth;
|
|
43563
43735
|
}
|
|
43564
|
-
|
|
43565
|
-
|
|
43566
|
-
|
|
43567
|
-
|
|
43568
|
-
|
|
43569
|
-
|
|
43570
|
-
divisors.push(i);
|
|
43571
|
-
var divisor = (numElements - 1) / i;
|
|
43572
|
-
if (i === divisor) {
|
|
43573
|
-
continue;
|
|
43574
|
-
}
|
|
43575
|
-
divisors.push(divisor);
|
|
43576
|
-
}
|
|
43577
|
-
divisors.sort(function (a, b) {
|
|
43578
|
-
return b - a;
|
|
43579
|
-
});
|
|
43580
|
-
return divisors;
|
|
43581
|
-
}
|
|
43582
|
-
function isTickIntervalValid(interval, maxWidth, wordWidths) {
|
|
43583
|
-
var totalWidth = 0;
|
|
43584
|
-
for (var i = 0; i < wordWidths.length; i += interval) {
|
|
43585
|
-
var spacing = i > 0 ? 12 : 0; // Add spacing only after the first tick
|
|
43586
|
-
totalWidth += wordWidths[i] + spacing;
|
|
43587
|
-
}
|
|
43588
|
-
return totalWidth <= maxWidth;
|
|
43589
|
-
}
|
|
43736
|
+
|
|
43737
|
+
/** Reduce width proportionally to simulate spacing / padding between ticks. */
|
|
43738
|
+
var widthWithSpacing = function widthWithSpacing(width) {
|
|
43739
|
+
var THIRTY_PERCENT = 0.3;
|
|
43740
|
+
return width - width * THIRTY_PERCENT;
|
|
43741
|
+
};
|
|
43590
43742
|
function howManyTicksFitInWidth(ticks, maxWidth, avgCharWidth) {
|
|
43591
43743
|
if (avgCharWidth === void 0) {
|
|
43592
43744
|
avgCharWidth = ASSUMED_AVERAGE_CHAR_WIDTH;
|
|
43593
43745
|
}
|
|
43594
|
-
var
|
|
43595
|
-
var
|
|
43596
|
-
|
|
43597
|
-
|
|
43598
|
-
|
|
43599
|
-
|
|
43600
|
-
|
|
43601
|
-
|
|
43602
|
-
|
|
43603
|
-
// Binary search for the largest step that fits all elements
|
|
43604
|
-
while (left <= right) {
|
|
43605
|
-
var mid = Math.floor((left + right) / 2);
|
|
43606
|
-
var step = ticksIntervals[mid];
|
|
43607
|
-
if (isTickIntervalValid(step, maxWidth, ticksWidths)) {
|
|
43608
|
-
optimalInterval = step; // Found a valid step, try to find a larger one
|
|
43609
|
-
left = mid + 1;
|
|
43746
|
+
var fittedTicks = [];
|
|
43747
|
+
var currentWidth = 0;
|
|
43748
|
+
for (var _iterator = _createForOfIteratorHelperLoose(ticks), _step; !(_step = _iterator()).done;) {
|
|
43749
|
+
var tick = _step.value;
|
|
43750
|
+
var word = (tick == null ? void 0 : tick.formattedValue) || '';
|
|
43751
|
+
var wordWidth = calculateWordWidth(word, avgCharWidth);
|
|
43752
|
+
if (currentWidth + wordWidth <= widthWithSpacing(maxWidth)) {
|
|
43753
|
+
fittedTicks.push(tick);
|
|
43754
|
+
currentWidth += wordWidth + avgCharWidth; // Add space between words
|
|
43610
43755
|
} else {
|
|
43611
|
-
|
|
43756
|
+
break; // Stop if adding the word exceeds maxWidth
|
|
43612
43757
|
}
|
|
43613
43758
|
}
|
|
43614
|
-
var fittedTicks = ticks.filter(function (_, index) {
|
|
43615
|
-
return index % optimalInterval === 0;
|
|
43616
|
-
});
|
|
43617
43759
|
return fittedTicks.length;
|
|
43618
43760
|
}
|
|
43619
43761
|
function determineYTicks(ticks, height) {
|
|
@@ -43650,14 +43792,16 @@ function pickEquallySpaced(arr, numPicks) {
|
|
|
43650
43792
|
return result;
|
|
43651
43793
|
}
|
|
43652
43794
|
function adjustTicks(representation, width, height, xKeyField) {
|
|
43653
|
-
var _representation$x$tic, _representation$y$tic;
|
|
43654
43795
|
representation = _.cloneDeep(representation);
|
|
43655
43796
|
|
|
43656
43797
|
// TODO; take this from the theme override...
|
|
43657
43798
|
var averageCharacterWidth = ASSUMED_AVERAGE_CHAR_WIDTH;
|
|
43658
|
-
var numberOfXTicksFittingIntoSpace = howManyTicksFitInWidth(
|
|
43799
|
+
var numberOfXTicksFittingIntoSpace = howManyTicksFitInWidth(representation.x.ticks || [], width, averageCharacterWidth);
|
|
43800
|
+
|
|
43801
|
+
// @ts-ignore
|
|
43659
43802
|
representation.x.ticks = getEvenlySpacedTicks(representation.x.ticks, numberOfXTicksFittingIntoSpace, xKeyField);
|
|
43660
|
-
|
|
43803
|
+
// @ts-ignore
|
|
43804
|
+
representation.y.ticks = determineYTicks(representation.y.ticks || [], height);
|
|
43661
43805
|
return representation;
|
|
43662
43806
|
}
|
|
43663
43807
|
function toNumeric(value) {
|
|
@@ -43690,9 +43834,9 @@ function getEvenlySpacedNumericTicks(sorted, count) {
|
|
|
43690
43834
|
var _toNumeric3;
|
|
43691
43835
|
var closest = sorted[0];
|
|
43692
43836
|
var minDiff = Math.abs(((_toNumeric3 = toNumeric(sorted[0].scaleValue)) != null ? _toNumeric3 : 0) - target);
|
|
43693
|
-
for (var
|
|
43837
|
+
for (var _iterator2 = _createForOfIteratorHelperLoose(sorted), _step2; !(_step2 = _iterator2()).done;) {
|
|
43694
43838
|
var _toNumeric4;
|
|
43695
|
-
var tick =
|
|
43839
|
+
var tick = _step2.value;
|
|
43696
43840
|
var numericVal = (_toNumeric4 = toNumeric(tick.scaleValue)) != null ? _toNumeric4 : 0;
|
|
43697
43841
|
var diff = Math.abs(numericVal - target);
|
|
43698
43842
|
if (diff < minDiff) {
|
|
@@ -43714,9 +43858,16 @@ function getEvenlySpacedStringTicks(ticks, count) {
|
|
|
43714
43858
|
return result;
|
|
43715
43859
|
}
|
|
43716
43860
|
function getEvenlySpacedTicks(ticks, count, xKeyField) {
|
|
43861
|
+
if (count === void 0) {
|
|
43862
|
+
count = 4;
|
|
43863
|
+
}
|
|
43717
43864
|
if (ticks.length === 0) return [];
|
|
43718
43865
|
if ((xKeyField == null ? void 0 : xKeyField.dataType) === 'number' || (xKeyField == null ? void 0 : xKeyField.dataType) === 'date_time') {
|
|
43719
|
-
|
|
43866
|
+
var sorted = [].concat(ticks).sort(function (a, b) {
|
|
43867
|
+
var _toNumeric5, _toNumeric6;
|
|
43868
|
+
return ((_toNumeric5 = toNumeric(a.scaleValue)) != null ? _toNumeric5 : 0) - ((_toNumeric6 = toNumeric(b.scaleValue)) != null ? _toNumeric6 : 0);
|
|
43869
|
+
});
|
|
43870
|
+
return getEvenlySpacedNumericTicks(sorted, count);
|
|
43720
43871
|
} else {
|
|
43721
43872
|
return getEvenlySpacedStringTicks(ticks, count);
|
|
43722
43873
|
}
|
|
@@ -43997,30 +44148,21 @@ var GridRows = function GridRows(_ref) {
|
|
|
43997
44148
|
});
|
|
43998
44149
|
};
|
|
43999
44150
|
|
|
44000
|
-
var _excluded$g = ["children", "width", "height", "showLegend", "onMouseMove", "onMouseLeave"];
|
|
44001
44151
|
function _EMOTION_STRINGIFIED_CSS_ERROR__$8() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
|
|
44002
|
-
var ChartWrapper$1 = function ChartWrapper(
|
|
44003
|
-
|
|
44004
|
-
width
|
|
44005
|
-
height
|
|
44006
|
-
|
|
44007
|
-
|
|
44008
|
-
onMouseLeave = _ref.onMouseLeave,
|
|
44009
|
-
svgProps = _objectWithoutPropertiesLoose(_ref, _excluded$g);
|
|
44010
|
-
return jsxRuntime.jsx("svg", _extends({
|
|
44011
|
-
width: width,
|
|
44012
|
-
height: height - (showLegend ? 40 : 0),
|
|
44013
|
-
onMouseMove: onMouseMove,
|
|
44014
|
-
onMouseLeave: onMouseLeave,
|
|
44152
|
+
var ChartWrapper$1 = function ChartWrapper(props) {
|
|
44153
|
+
return jsxRuntime.jsx("svg", {
|
|
44154
|
+
width: props.width,
|
|
44155
|
+
height: props.height - (props.showLegend ? 40 : 0),
|
|
44156
|
+
onMouseMove: props.onMouseMove,
|
|
44157
|
+
onMouseLeave: props.onMouseLeave,
|
|
44015
44158
|
className: /*#__PURE__*/css$1.css( {
|
|
44016
44159
|
name: "fx4tbw-ChartWrapper",
|
|
44017
44160
|
styles: "display:block;label:ChartWrapper;",
|
|
44018
|
-
map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,
|
|
44161
|
+
map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkNoYXJ0V3JhcHBlci50c3giXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBZ0JpQiIsImZpbGUiOiJDaGFydFdyYXBwZXIudHN4Iiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgY3NzIH0gZnJvbSAnQGVtb3Rpb24vY3NzJztcblxuZXhwb3J0IGNvbnN0IENoYXJ0V3JhcHBlciA9IChwcm9wczoge1xuICBjaGlsZHJlbjogUmVhY3QuUmVhY3ROb2RlO1xuICB3aWR0aDogbnVtYmVyO1xuICBoZWlnaHQ6IG51bWJlcjtcbiAgc2hvd0xlZ2VuZDogYm9vbGVhbjtcbiAgb25Nb3VzZU1vdmU/OiBSZWFjdC5Nb3VzZUV2ZW50SGFuZGxlcjxTVkdTVkdFbGVtZW50PjtcbiAgb25Nb3VzZUxlYXZlPzogUmVhY3QuTW91c2VFdmVudEhhbmRsZXI8U1ZHU1ZHRWxlbWVudD47XG59KSA9PiB7XG4gIHJldHVybiAoXG4gICAgPHN2Z1xuICAgICAgd2lkdGg9e3Byb3BzLndpZHRofVxuICAgICAgaGVpZ2h0PXtwcm9wcy5oZWlnaHQgLSAocHJvcHMuc2hvd0xlZ2VuZCA/IDQwIDogMCl9XG4gICAgICBvbk1vdXNlTW92ZT17cHJvcHMub25Nb3VzZU1vdmV9XG4gICAgICBvbk1vdXNlTGVhdmU9e3Byb3BzLm9uTW91c2VMZWF2ZX1cbiAgICAgIGNsYXNzTmFtZT17Y3NzKHsgZGlzcGxheTogJ2Jsb2NrJyB9KX1cbiAgICA+XG4gICAgICB7cHJvcHMuY2hpbGRyZW59XG4gICAgPC9zdmc+XG4gICk7XG59O1xuIl19 */",
|
|
44019
44162
|
toString: _EMOTION_STRINGIFIED_CSS_ERROR__$8
|
|
44020
|
-
})
|
|
44021
|
-
|
|
44022
|
-
|
|
44023
|
-
}));
|
|
44163
|
+
}),
|
|
44164
|
+
children: props.children
|
|
44165
|
+
});
|
|
44024
44166
|
};
|
|
44025
44167
|
|
|
44026
44168
|
var CrosshairCircle = function CrosshairCircle(_ref) {
|
|
@@ -44085,7 +44227,7 @@ var Line = function Line(_ref) {
|
|
|
44085
44227
|
});
|
|
44086
44228
|
};
|
|
44087
44229
|
|
|
44088
|
-
var _excluded$
|
|
44230
|
+
var _excluded$g = ["tooltipOpen"];
|
|
44089
44231
|
function useTooltip$1(initialTooltipState) {
|
|
44090
44232
|
var _useState = React.useState(_extends({
|
|
44091
44233
|
tooltipOpen: false
|
|
@@ -44094,7 +44236,7 @@ function useTooltip$1(initialTooltipState) {
|
|
|
44094
44236
|
setTooltipState = _useState[1];
|
|
44095
44237
|
var showTooltip = React.useCallback(function (showArgs) {
|
|
44096
44238
|
return setTooltipState(typeof showArgs === 'function' ? function (_ref) {
|
|
44097
|
-
var show = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
44239
|
+
var show = _objectWithoutPropertiesLoose(_ref, _excluded$g);
|
|
44098
44240
|
return _extends({}, showArgs(show), {
|
|
44099
44241
|
tooltipOpen: true
|
|
44100
44242
|
});
|
|
@@ -44426,7 +44568,58 @@ function Lines(_ref2) {
|
|
|
44426
44568
|
});
|
|
44427
44569
|
}
|
|
44428
44570
|
|
|
44429
|
-
var
|
|
44571
|
+
var PADDING = {
|
|
44572
|
+
paddingOuter: 0.05,
|
|
44573
|
+
paddingInner: 0.3
|
|
44574
|
+
};
|
|
44575
|
+
|
|
44576
|
+
function useBarXScale(xScaleDataType, innerWidth, xScaleKey, data) {
|
|
44577
|
+
return React.useMemo(function () {
|
|
44578
|
+
if (xScaleDataType === 'string') {
|
|
44579
|
+
return scale.scaleBand(_extends({
|
|
44580
|
+
range: [0, innerWidth],
|
|
44581
|
+
domain: xScaleKey ? [].concat(data.map(function (d) {
|
|
44582
|
+
return d[xScaleKey] && d[xScaleKey].value !== null ? String(d[xScaleKey].value) : '';
|
|
44583
|
+
})) : []
|
|
44584
|
+
}, PADDING));
|
|
44585
|
+
}
|
|
44586
|
+
if (xScaleDataType === 'date_time' && xScaleKey) {
|
|
44587
|
+
return scale.scaleBand(_extends({
|
|
44588
|
+
range: [0, innerWidth],
|
|
44589
|
+
domain: data.map(function (d) {
|
|
44590
|
+
return new Date(d[xScaleKey].value);
|
|
44591
|
+
})
|
|
44592
|
+
}, PADDING));
|
|
44593
|
+
}
|
|
44594
|
+
if (xScaleDataType === 'number' && xScaleKey) {
|
|
44595
|
+
return scale.scaleBand(_extends({
|
|
44596
|
+
range: [0, innerWidth],
|
|
44597
|
+
domain: data.map(function (d) {
|
|
44598
|
+
return d[xScaleKey] && d[xScaleKey].value !== null ? Number(d[xScaleKey].value) : 0;
|
|
44599
|
+
})
|
|
44600
|
+
}, PADDING));
|
|
44601
|
+
}
|
|
44602
|
+
return null;
|
|
44603
|
+
}, [innerWidth, data]);
|
|
44604
|
+
}
|
|
44605
|
+
|
|
44606
|
+
var useBottomAxisBaseLineShift = function useBottomAxisBaseLineShift(_ref) {
|
|
44607
|
+
var showDetailedSubGroupingLabels = _ref.showDetailedSubGroupingLabels,
|
|
44608
|
+
hasBottomTitle = _ref.hasBottomTitle,
|
|
44609
|
+
hasLeftTitle = _ref.hasLeftTitle;
|
|
44610
|
+
if (!showDetailedSubGroupingLabels) {
|
|
44611
|
+
return {
|
|
44612
|
+
bottomAxisBaselineShift: 0,
|
|
44613
|
+
bottomOffset: 0,
|
|
44614
|
+
leftOffset: 0
|
|
44615
|
+
};
|
|
44616
|
+
}
|
|
44617
|
+
return {
|
|
44618
|
+
bottomAxisBaselineShift: hasBottomTitle ? -65 : -60,
|
|
44619
|
+
bottomOffset: hasBottomTitle ? -15 : 10,
|
|
44620
|
+
leftOffset: hasLeftTitle ? -10 : 0
|
|
44621
|
+
};
|
|
44622
|
+
};
|
|
44430
44623
|
|
|
44431
44624
|
function getBarFill(bars, conditionalFormattingRules, barKey, barValues) {
|
|
44432
44625
|
var _bars$find;
|
|
@@ -44452,6 +44645,73 @@ function getBarFill(bars, conditionalFormattingRules, barKey, barValues) {
|
|
|
44452
44645
|
return fill;
|
|
44453
44646
|
}
|
|
44454
44647
|
|
|
44648
|
+
var BAR_RADIUS = 2;
|
|
44649
|
+
|
|
44650
|
+
var BarStacked = function BarStacked(_ref) {
|
|
44651
|
+
var xScaleDataType = _ref.xScaleDataType,
|
|
44652
|
+
data = _ref.data,
|
|
44653
|
+
xScaleKey = _ref.xScaleKey,
|
|
44654
|
+
yScale = _ref.yScale,
|
|
44655
|
+
keys = _ref.keys,
|
|
44656
|
+
bars = _ref.bars,
|
|
44657
|
+
conditionalFormattingRules = _ref.conditionalFormattingRules,
|
|
44658
|
+
xScale = _ref.xScale,
|
|
44659
|
+
height = _ref.height,
|
|
44660
|
+
width = _ref.width;
|
|
44661
|
+
var handleGetXValue = function handleGetXValue(d) {
|
|
44662
|
+
var xValue = d[xScaleKey];
|
|
44663
|
+
if (xScaleDataType === 'string') return String(xValue);
|
|
44664
|
+
if (xScaleDataType === 'date_time') {
|
|
44665
|
+
return new Date(xValue);
|
|
44666
|
+
}
|
|
44667
|
+
if (xScaleDataType === 'number') {
|
|
44668
|
+
return Number(xValue);
|
|
44669
|
+
}
|
|
44670
|
+
return String(xValue);
|
|
44671
|
+
};
|
|
44672
|
+
return jsxRuntime.jsx(shape.BarStack, {
|
|
44673
|
+
x: handleGetXValue,
|
|
44674
|
+
xScale: xScale,
|
|
44675
|
+
yScale: yScale,
|
|
44676
|
+
data: data,
|
|
44677
|
+
keys: keys,
|
|
44678
|
+
color: function color() {
|
|
44679
|
+
return '';
|
|
44680
|
+
},
|
|
44681
|
+
height: height,
|
|
44682
|
+
width: width,
|
|
44683
|
+
offset: "none",
|
|
44684
|
+
children: function children(barStacks) {
|
|
44685
|
+
return barStacks.map(function (barStack) {
|
|
44686
|
+
return barStack.bars.map(function (bar) {
|
|
44687
|
+
return jsxRuntime.jsx(Bar, {
|
|
44688
|
+
bar: bar,
|
|
44689
|
+
barStack: barStack,
|
|
44690
|
+
bars: bars,
|
|
44691
|
+
conditionalFormattingRules: conditionalFormattingRules
|
|
44692
|
+
}, bar.key.toString());
|
|
44693
|
+
});
|
|
44694
|
+
});
|
|
44695
|
+
}
|
|
44696
|
+
});
|
|
44697
|
+
};
|
|
44698
|
+
var Bar = function Bar(_ref2) {
|
|
44699
|
+
var bar = _ref2.bar,
|
|
44700
|
+
barStack = _ref2.barStack,
|
|
44701
|
+
bars = _ref2.bars,
|
|
44702
|
+
conditionalFormattingRules = _ref2.conditionalFormattingRules;
|
|
44703
|
+
var BAR_PADDING = 1.5;
|
|
44704
|
+
if (bar.height < 3) return null;
|
|
44705
|
+
return jsxRuntime.jsx("rect", {
|
|
44706
|
+
x: bar.x,
|
|
44707
|
+
y: bar.y,
|
|
44708
|
+
width: bar.width,
|
|
44709
|
+
height: bar.height - BAR_PADDING,
|
|
44710
|
+
fill: getBarFill(bars, conditionalFormattingRules, bar.key, bar.bar.data),
|
|
44711
|
+
rx: BAR_RADIUS
|
|
44712
|
+
}, "bar-stack-" + barStack.index + "-" + bar.index);
|
|
44713
|
+
};
|
|
44714
|
+
|
|
44455
44715
|
function _EMOTION_STRINGIFIED_CSS_ERROR__$9() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
|
|
44456
44716
|
function BarGroup(_ref) {
|
|
44457
44717
|
var data = _ref.data,
|
|
@@ -44501,7 +44761,7 @@ function BarGroup(_ref) {
|
|
|
44501
44761
|
return jsxRuntime.jsx(group.Group, {
|
|
44502
44762
|
left: barGroup.x0,
|
|
44503
44763
|
children: barGroup.bars.map(function (bar) {
|
|
44504
|
-
return jsxRuntime.jsx(Bar, {
|
|
44764
|
+
return jsxRuntime.jsx(Bar$1, {
|
|
44505
44765
|
bar: bar,
|
|
44506
44766
|
barGroup: barGroup,
|
|
44507
44767
|
bars: bars,
|
|
@@ -44519,7 +44779,7 @@ function BarGroup(_ref) {
|
|
|
44519
44779
|
}
|
|
44520
44780
|
});
|
|
44521
44781
|
}
|
|
44522
|
-
var Bar = function Bar(_ref2) {
|
|
44782
|
+
var Bar$1 = function Bar(_ref2) {
|
|
44523
44783
|
var bar = _ref2.bar,
|
|
44524
44784
|
barGroup = _ref2.barGroup,
|
|
44525
44785
|
bars = _ref2.bars,
|
|
@@ -44533,7 +44793,6 @@ var Bar = function Bar(_ref2) {
|
|
|
44533
44793
|
var showBar = bar.value !== null && bar.height > 0 && bar.width > 0;
|
|
44534
44794
|
return jsxRuntime.jsxs(React.Fragment, {
|
|
44535
44795
|
children: [showBar && jsxRuntime.jsx(BarRect, {
|
|
44536
|
-
barRectKey: "bar-group-bar-" + barGroup.index + "-" + bar.index + "-" + bar.value + "-" + String(bar.key),
|
|
44537
44796
|
x: bar.x,
|
|
44538
44797
|
y: bar.y,
|
|
44539
44798
|
width: bar.width,
|
|
@@ -44543,7 +44802,7 @@ var Bar = function Bar(_ref2) {
|
|
|
44543
44802
|
return _onClick(e, barGroup, bar);
|
|
44544
44803
|
},
|
|
44545
44804
|
enableHover: enableHover
|
|
44546
|
-
}), jsxRuntime.jsx(BarLabel, {
|
|
44805
|
+
}, "bar-group-bar-" + barGroup.index + "-" + bar.index + "-" + bar.value + "-" + String(bar.key)), jsxRuntime.jsx(BarLabel, {
|
|
44547
44806
|
bar: bar,
|
|
44548
44807
|
barGroup: barGroup,
|
|
44549
44808
|
yLabelPosition: yLabelPosition,
|
|
@@ -44560,7 +44819,7 @@ var BarRect = function BarRect(_ref3) {
|
|
|
44560
44819
|
y = _ref3.y,
|
|
44561
44820
|
width = _ref3.width,
|
|
44562
44821
|
height = _ref3.height,
|
|
44563
|
-
|
|
44822
|
+
key = _ref3.key,
|
|
44564
44823
|
enableHover = _ref3.enableHover;
|
|
44565
44824
|
var _useState = React.useState(fill),
|
|
44566
44825
|
fillColor = _useState[0],
|
|
@@ -44568,7 +44827,7 @@ var BarRect = function BarRect(_ref3) {
|
|
|
44568
44827
|
var classes = enableHover ? /*#__PURE__*/css$1.css( {
|
|
44569
44828
|
name: "1ltmijl-classes",
|
|
44570
44829
|
styles: "cursor:pointer;label:classes;",
|
|
44571
|
-
map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkJhckdyb3VwLnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUE0S2dDIiwiZmlsZSI6IkJhckdyb3VwLnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IGNzcyB9IGZyb20gJ0BlbW90aW9uL2Nzcyc7XG5pbXBvcnQgeyBHcm91cCB9IGZyb20gJ0B2aXN4L2dyb3VwJztcbmltcG9ydCB7IEJhckdyb3VwIGFzIFZpc3hCYXJHcm91cCB9IGZyb20gJ0B2aXN4L3NoYXBlJztcbmltcG9ydCB7IERhdHVtT2JqZWN0IH0gZnJvbSAnQHZpc3gvc2hhcGUvbGliL3R5cGVzJztcbmltcG9ydCB7IFNjYWxlQmFuZCwgU2NhbGVMaW5lYXIgfSBmcm9tICdAdmlzeC92ZW5kb3IvZDMtc2NhbGUnO1xuaW1wb3J0IHsgRnJhZ21lbnQsIHVzZVN0YXRlIH0gZnJvbSAncmVhY3QnO1xuaW1wb3J0IHsgQmFyU3R5bGVzIH0gZnJvbSAnc2hhcmVkLWxvZ2ljL3NyYy9CYXJDaGFydFYyL3R5cGVzJztcbmltcG9ydCB7IENoYXJ0RGF0YURlZmluaXRpb24sIENvbmRpdGlvbmFsRm9ybWF0dGluZ1J1bGUsIFNoYXBlRGVmaW5pdGlvbiB9IGZyb20gJ3NoYXJlZC1sb2dpYy9zcmMvQ2hhcnRzVjIvdHlwZXMnO1xuaW1wb3J0IHsgRGF0YVR5cGUgfSBmcm9tICdzaGFyZWQtbG9naWMvc3JjL0ZpZWxkL3R5cGVzJztcbmltcG9ydCB7IGxpZ2h0ZW5Db2xvciB9IGZyb20gJy4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Hcm91cFBvc2l0aW9ufVxuICAgICAgLy8gQHRzLWlnbm9yZVxuICAgICAgeDBTY2FsZT17eFNjYWxlfVxuICAgICAgLy8gQHRzLWlnbm9yZVxuICAgICAgeDFTY2FsZT17aW5uZXJYU2NhbGV9XG4gICAgICB5U2NhbGU9e3lTY2FsZX1cbiAgICAgIGNvbG9yPXsoKSA9PiAnJ31cbiAgICA+XG4gICAgICB7KGJhckdyb3VwcykgPT4ge1xuICAgICAgICByZXR1cm4gYmFyR3JvdXBzLm1hcCgoYmFyR3JvdXApID0+IChcbiAgICAgICAgICA8R3JvdXAga2V5PXtgYmFyLWdyb3VwLSR7YmFyR3JvdXAuaW5kZXh9LSR7YmFyR3JvdXAueDB9YH0gbGVmdD17YmFyR3JvdXAueDB9PlxuICAgICAgICAgICAge2Jhckdyb3VwLmJhcnMubWFwKChiYXIpID0+IChcbiAgICAgICAgICAgICAgPEJhclxuICAgICAgICAgICAgICAgIGtleT17YGJhci0ke2Jhci5pbmRleH0tJHtiYXIueH1gfVxuICAgICAgICAgICAgICAgIGJhcj17YmFyfVxuICAgICAgICAgICAgICAgIGJhckdyb3VwPXtiYXJHcm91cH1cbiAgICAgICAgICAgICAgICBiYXJzPXtiYXJzfVxuICAgICAgICAgICAgICAgIGNvbmRpdGlvbmFsRm9ybWF0dGluZ1J1bGVzPXtjb25kaXRpb25hbEZvcm1hdHRpbmdSdWxlc31cbiAgICAgICAgICAgICAgICBlbmFibGVIb3Zlcj17ZW5hYmxlSG92ZXJ9XG4gICAgICAgICAgICAgICAgbGFiZWxTdHlsZT17bGFiZWxTdHlsZX1cbiAgICAgICAgICAgICAgICBvbkNsaWNrPXtvbkNsaWNrfVxuICAgICAgICAgICAgICAgIHNob3dEZXRhaWxlZFN1Ykdyb3VwaW5nTGFiZWxzPXtzaG93RGV0YWlsZWRTdWJHcm91cGluZ0xhYmVsc31cbiAgICAgICAgICAgICAgICB5QXhpc0xhYmVscz17eUF4aXNMYWJlbHN9XG4gICAgICAgICA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ICAgICAgID5cbiAgICAgICAgICAgIHtiYXJHcm91cHMgPT4ge1xuICAgICAgICAgICAgICAgIHJldHVybiBiYXJHcm91cHMubWFwKGJhckdyb3VwID0+IChcbiAgICAgICAgICAgICAgICAgICAgPEdyb3VwIGtleT17YGJhci1ncm91cC0ke2Jhckdyb3VwLmluZGV4fS0ke2Jhckdyb3VwLngwfWB9IGxlZnQ9e2Jhckdyb3VwLngwfT5cbiAgICAgICAgICAgICAgICAgICAgICAgIHtiYXJHcm91cC5iYXJzLm1hcChiYXIgPT4gKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxCYXJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAga2V5PXtgYmFyLSR7YmFyLmluZGV4fS0ke2Jhci54fWB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJhcj17YmFyfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBiYXJHcm91cD17YmFyR3JvdXB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJhcnM9e2JhcnN9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbmRpdGlvbmFsRm9ybWF0dGluZ1J1bGVzPXtjb25kaXRpb25hbEZvcm1hdHRpbmdSdWxlc31cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZW5hYmxlSG92ZXI9e2VuYWJsZUhvdmVyfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsYWJlbFN0eWxlPXtsYWJlbFN0eWxlfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvbkNsaWNrPXtvbkNsaWNrfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaG93RGV0YWlsZWRTdWJHcm91cGluZ0xhYmVscz17c2hvd0RldGFpbGVkU3ViR3JvdXBpbmdMYWJlbHN9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHlBeGlzTGFiZWxzPXt5QXhpc0xhYmVsc31c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XNMYWJlbHMsXG4gICAgeUxhYmVsUG9zaXRpb24sXG59OiBCYXJQcm9wcykgPT4ge1xuICAgIGNvbnN0IHNob3dCYXIgPSBiYXIudmFsdWUgIT09IG51bGwgJiYgYmFyLmhlaWdodCA+IDAgJiYgYmFyLndpZHRoID4gMDtcblxuICAgIHJldHVybiAoXG4gICAgICAgIDxGcmFnbWVudD5cbiAgICAgICAgICAgIHtzaG93QmFyICYmIDxCYXJSZWN0XG4gICAgICAgICAgICAgICAga2V5PXtgYmFyLWdyb3VwLWJhci0ke2Jhckdyb3VwLmluZGV4fS0ke2Jhci5pbmRleH0tJHtiYXIudmFsdWV9LSR7U3RyaW5nKGJhci5rZXkpfWB9XG4gICAgICAgICAgICAgICAgeD17YmFyLnh9XG4gICAgICAgICAgICAgICAgeT17YmFyLnl9XG4gICAgICAgICAgICAgICAgd2lkdGg9e2Jhci53aWR0aH1cbiAgICAgICAgICAgICAgICBoZWlnaHQ9e2Jhci5oZWlnaHR9XG4gICAgICAgICAgICAgICAgZmlsbD17Z2V0QmFyRmlsbChiYXJzLCBjb25kaXRpb25hbEZvcm1hdHRpbmdSdWxlcywgU3RyaW5nKGJhci5rZXkpLCBiYXIudmFsdWUpfVxuICAgICAgICAgICAgICAgIG9uQ2xpY2s9e2UgPT4gb25DbGljayhlLCBiYXJHcm91cCwgYmFyKX1cbiAgICAgICAgICAgICAgICBlbmFibGVIb3Zlcj17ZW5hYmxlSG92ZXJ9XG4gICAgICAgICAgICAvPn1cbiAgICAgICAgICAgIFxuICAgICAgICAgICAgPEJhckxhYmVsXG4gICAgICAgICAgICAgICAgYmFyPXtiYXJ9XG4gICAgICAgICAgICAgICAgYmFyR3JvdXA9e2Jhckdyb3VwfVxuICAgICAgICAgICAgICAgIHlMYWJlbFBvc2l0aW9uPXt5TGFiZWxQb3NpdGlvbn1cbiAgICAgICAgICAgICAgICB5QXhpc0xhYmVscz17eUF4aXNMYWJlbHN9XG4gICAgICAgICAgICAgICAgc2hvd0RldGFp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AgICAgICBpZiAoZW5hYmxlSG92ZXIpIHtcbiAgICAgICAgICAgIHNldEZpbGxDb2xvcihmaWxsKTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIHJldHVybiAoXG4gICAgICAgIDxyZWN0XG4gICAgICAgICAgICBrZXk9e2tleX1cbiAgICAgICAgICAgIHg9e3h9XG4gICAgICAgICAgICB5PXt5fVxuICAgICAgICAgICAgd2lkdGg9e3dpZHRofVxuICAgICAgICAgICAgaGVpZ2h0PXtoZWlnaHR9XG4gICAgICAgICAgICBmaWxsPXtmaWxsQ29sb3J9XG4gICAgICAgICAgICByeD17QkFSX1JBRElVU31cbiAgICAgICAgICAgIG9uQ2xpY2s9e29uQ2xpY2t9XG4gICAgICAgICAgICBvbk1vdXNlRW50ZXI9e2hhbmRsZU9uTW91c2VFbnRlcn1cbiAgICAgICAgICAgIG9uTW91c2VMZWF2ZT17aGFuZGxlT25Nb3VzZUxlYXZlfVxuICAgICAgICAgICAgY2xhc3NOYW1lPXtjbGFzc2VzfVxuICAgICAgICAvPlxuICAgICk7XG59O1xuXG50eXBlIEJhckxhYmVsUHJvcHMgPSB7XG4gICAgYmFyOiBhbnk7XG4gICAgYmFyR3JvdXA6IGFueTtcbiAgICB5TGFiZWxQb3NpdGlvbj86IG51bWJlcjtcbiAgICB5QXhpc0xhYmVscz86IHN0cmluZ1tdO1xuICAgIHNob3dEZXRhaWxlZFN1Ykdyb3VwaW5nTGFiZWxzOiBib29sZWFuO1xuICAgIGxhYmVsU3R5bGU/OiBSZWFjdC5DU1NQcm9wZXJ0aWVzO1xufTtcblxuY29uc3QgQmFyTGFiZWwgPSAoe1xuICAgIGJhcixcbiAgICBiYXJHcm91cCxcbiAgICB5TGFiZWxQb3NpdGlvbixcbiAgICB5QXhpc0xhYmVscyxcbiAgICBzaG93RGV0YWlsZWRTdWJHcm91cGluZ0xhYmVscyxcbiAgICBsYWJlbFN0eWxlLFxufTogQmFyTGFiZWxQcm9wcykgPT4ge1xuICAgIGlmIC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0sICR7bGFiZWxZUG9zaXRpb259KWB9XG4gICAgICAgIHRleHRBbmNob3I9J2VuZCdcbiAgICA+XG4gICAgICAgIHtmb3JtYXR0ZWRDb2x1bW5MYWJlbH1cbiAgICA8L3RleHQ+XG59Il19 */",
|
|
44572
44831
|
toString: _EMOTION_STRINGIFIED_CSS_ERROR__$9
|
|
44573
44832
|
}) : '';
|
|
44574
44833
|
var handleOnMouseEnter = function handleOnMouseEnter() {
|
|
@@ -44592,7 +44851,7 @@ var BarRect = function BarRect(_ref3) {
|
|
|
44592
44851
|
onMouseEnter: handleOnMouseEnter,
|
|
44593
44852
|
onMouseLeave: handleOnMouseLeave,
|
|
44594
44853
|
className: classes
|
|
44595
|
-
},
|
|
44854
|
+
}, key);
|
|
44596
44855
|
};
|
|
44597
44856
|
var BarLabel = function BarLabel(_ref4) {
|
|
44598
44857
|
var bar = _ref4.bar,
|
|
@@ -44625,124 +44884,6 @@ var BarLabel = function BarLabel(_ref4) {
|
|
|
44625
44884
|
}, labelKey);
|
|
44626
44885
|
};
|
|
44627
44886
|
|
|
44628
|
-
var BarStacked = function BarStacked(_ref) {
|
|
44629
|
-
var xScaleDataType = _ref.xScaleDataType,
|
|
44630
|
-
data = _ref.data,
|
|
44631
|
-
xScaleKey = _ref.xScaleKey,
|
|
44632
|
-
yScale = _ref.yScale,
|
|
44633
|
-
keys = _ref.keys,
|
|
44634
|
-
bars = _ref.bars,
|
|
44635
|
-
conditionalFormattingRules = _ref.conditionalFormattingRules,
|
|
44636
|
-
xScale = _ref.xScale,
|
|
44637
|
-
height = _ref.height,
|
|
44638
|
-
width = _ref.width;
|
|
44639
|
-
var handleGetXValue = function handleGetXValue(d) {
|
|
44640
|
-
var xValue = d[xScaleKey];
|
|
44641
|
-
if (xScaleDataType === 'string') return String(xValue);
|
|
44642
|
-
if (xScaleDataType === 'date_time') {
|
|
44643
|
-
return new Date(xValue);
|
|
44644
|
-
}
|
|
44645
|
-
if (xScaleDataType === 'number') {
|
|
44646
|
-
return Number(xValue);
|
|
44647
|
-
}
|
|
44648
|
-
return String(xValue);
|
|
44649
|
-
};
|
|
44650
|
-
return jsxRuntime.jsx(shape.BarStack, {
|
|
44651
|
-
x: handleGetXValue,
|
|
44652
|
-
xScale: xScale,
|
|
44653
|
-
yScale: yScale,
|
|
44654
|
-
data: data,
|
|
44655
|
-
keys: keys,
|
|
44656
|
-
color: function color() {
|
|
44657
|
-
return '';
|
|
44658
|
-
},
|
|
44659
|
-
height: height,
|
|
44660
|
-
width: width,
|
|
44661
|
-
offset: "none",
|
|
44662
|
-
children: function children(barStacks) {
|
|
44663
|
-
return barStacks.map(function (barStack) {
|
|
44664
|
-
return barStack.bars.map(function (bar) {
|
|
44665
|
-
return jsxRuntime.jsx(Bar$1, {
|
|
44666
|
-
bar: bar,
|
|
44667
|
-
barStack: barStack,
|
|
44668
|
-
bars: bars,
|
|
44669
|
-
conditionalFormattingRules: conditionalFormattingRules
|
|
44670
|
-
}, bar.key.toString() + "-" + bar.index + "-" + bar.x);
|
|
44671
|
-
});
|
|
44672
|
-
});
|
|
44673
|
-
}
|
|
44674
|
-
});
|
|
44675
|
-
};
|
|
44676
|
-
var Bar$1 = function Bar(_ref2) {
|
|
44677
|
-
var bar = _ref2.bar,
|
|
44678
|
-
barStack = _ref2.barStack,
|
|
44679
|
-
bars = _ref2.bars,
|
|
44680
|
-
conditionalFormattingRules = _ref2.conditionalFormattingRules;
|
|
44681
|
-
var BAR_PADDING = 1.5;
|
|
44682
|
-
if (bar.height < 3) return null;
|
|
44683
|
-
return jsxRuntime.jsx("rect", {
|
|
44684
|
-
x: bar.x,
|
|
44685
|
-
y: bar.y,
|
|
44686
|
-
width: bar.width,
|
|
44687
|
-
height: bar.height - BAR_PADDING,
|
|
44688
|
-
fill: getBarFill(bars, conditionalFormattingRules, bar.key, bar.bar.data),
|
|
44689
|
-
rx: BAR_RADIUS
|
|
44690
|
-
}, "bar-stack-" + barStack.index + "-" + bar.index);
|
|
44691
|
-
};
|
|
44692
|
-
|
|
44693
|
-
var useBottomAxisBaseLineShift = function useBottomAxisBaseLineShift(_ref) {
|
|
44694
|
-
var showDetailedSubGroupingLabels = _ref.showDetailedSubGroupingLabels,
|
|
44695
|
-
hasBottomTitle = _ref.hasBottomTitle,
|
|
44696
|
-
hasLeftTitle = _ref.hasLeftTitle;
|
|
44697
|
-
if (!showDetailedSubGroupingLabels) {
|
|
44698
|
-
return {
|
|
44699
|
-
bottomAxisBaselineShift: 0,
|
|
44700
|
-
bottomOffset: 0,
|
|
44701
|
-
leftOffset: 0
|
|
44702
|
-
};
|
|
44703
|
-
}
|
|
44704
|
-
return {
|
|
44705
|
-
bottomAxisBaselineShift: hasBottomTitle ? -65 : -60,
|
|
44706
|
-
bottomOffset: hasBottomTitle ? -15 : 10,
|
|
44707
|
-
leftOffset: hasLeftTitle ? -10 : 0
|
|
44708
|
-
};
|
|
44709
|
-
};
|
|
44710
|
-
|
|
44711
|
-
var PADDING = {
|
|
44712
|
-
paddingOuter: 0.05,
|
|
44713
|
-
paddingInner: 0.3
|
|
44714
|
-
};
|
|
44715
|
-
|
|
44716
|
-
function useBarXScale(xScaleDataType, innerWidth, xScaleKey, data) {
|
|
44717
|
-
return React.useMemo(function () {
|
|
44718
|
-
if (xScaleDataType === 'string') {
|
|
44719
|
-
return scale.scaleBand(_extends({
|
|
44720
|
-
range: [0, innerWidth],
|
|
44721
|
-
domain: xScaleKey ? [].concat(data.map(function (d) {
|
|
44722
|
-
return d[xScaleKey] && d[xScaleKey].value !== null ? String(d[xScaleKey].value) : '';
|
|
44723
|
-
})) : []
|
|
44724
|
-
}, PADDING));
|
|
44725
|
-
}
|
|
44726
|
-
if (xScaleDataType === 'date_time' && xScaleKey) {
|
|
44727
|
-
return scale.scaleBand(_extends({
|
|
44728
|
-
range: [0, innerWidth],
|
|
44729
|
-
domain: data.map(function (d) {
|
|
44730
|
-
return new Date(d[xScaleKey].value);
|
|
44731
|
-
})
|
|
44732
|
-
}, PADDING));
|
|
44733
|
-
}
|
|
44734
|
-
if (xScaleDataType === 'number' && xScaleKey) {
|
|
44735
|
-
return scale.scaleBand(_extends({
|
|
44736
|
-
range: [0, innerWidth],
|
|
44737
|
-
domain: data.map(function (d) {
|
|
44738
|
-
return d[xScaleKey] && d[xScaleKey].value !== null ? Number(d[xScaleKey].value) : 0;
|
|
44739
|
-
})
|
|
44740
|
-
}, PADDING));
|
|
44741
|
-
}
|
|
44742
|
-
return null;
|
|
44743
|
-
}, [innerWidth, data]);
|
|
44744
|
-
}
|
|
44745
|
-
|
|
44746
44887
|
var BarChart$5 = function BarChart(_ref) {
|
|
44747
44888
|
var _theme$axis;
|
|
44748
44889
|
var chart = _ref.chart,
|
|
@@ -44764,7 +44905,7 @@ var BarChart$5 = function BarChart(_ref) {
|
|
|
44764
44905
|
tooltipData = _useTooltip.tooltipData,
|
|
44765
44906
|
hideTooltip = _useTooltip.hideTooltip,
|
|
44766
44907
|
showTooltip = _useTooltip.showTooltip;
|
|
44767
|
-
var showDetailedSubGroupingLabels =
|
|
44908
|
+
var showDetailedSubGroupingLabels = numberOfDimensions === 2 && width > 450;
|
|
44768
44909
|
var hasBottomTitle = chart.x.title != null;
|
|
44769
44910
|
var hasLeftTitle = chart.y.title != null;
|
|
44770
44911
|
var _useBottomAxisBaseLin = useBottomAxisBaseLineShift({
|
|
@@ -44777,7 +44918,7 @@ var BarChart$5 = function BarChart(_ref) {
|
|
|
44777
44918
|
leftOffset = _useBottomAxisBaseLin.leftOffset;
|
|
44778
44919
|
var margin = buildMargin(chart.y.ticks, options.axis.showYAxisLabels, hasLeftTitle, hasBottomTitle, showDetailedSubGroupingLabels);
|
|
44779
44920
|
var innerWidth = width - margin.left - margin.right;
|
|
44780
|
-
var innerHeight = height - margin.top - margin.bottom - (options.showLegend ? 50 : 0) - (showDetailedSubGroupingLabels ? 50 : 0)
|
|
44921
|
+
var innerHeight = height - margin.top - margin.bottom - (options.showLegend ? 50 : 0) - (showDetailedSubGroupingLabels ? 50 : 0);
|
|
44781
44922
|
var xKey = chart.x.key;
|
|
44782
44923
|
var xScaleKey = chart.x.scale.key;
|
|
44783
44924
|
var xScaleDataType = chart.x.scale.dataType;
|
|
@@ -45371,7 +45512,6 @@ function Area(_ref3) {
|
|
|
45371
45512
|
});
|
|
45372
45513
|
}
|
|
45373
45514
|
|
|
45374
|
-
var MAX_BUBBLE_RADIUS = 30;
|
|
45375
45515
|
var BubbleChart$4 = function BubbleChart(_ref) {
|
|
45376
45516
|
var _theme$axis;
|
|
45377
45517
|
var chart = _ref.chart,
|
|
@@ -45393,34 +45533,25 @@ var BubbleChart$4 = function BubbleChart(_ref) {
|
|
|
45393
45533
|
var zValues = chart.z ? chart.data.map(function (d) {
|
|
45394
45534
|
return d[chart.z];
|
|
45395
45535
|
}).map(function (d) {
|
|
45396
|
-
return d
|
|
45536
|
+
return d.value;
|
|
45397
45537
|
}) : [];
|
|
45398
45538
|
var normaliseArray = function normaliseArray(array, min, max) {
|
|
45399
45539
|
var arrayMin = Math.min.apply(Math, array);
|
|
45400
45540
|
var arrayMax = Math.max.apply(Math, array);
|
|
45401
|
-
if (arrayMin === arrayMax) {
|
|
45402
|
-
return array.map(function () {
|
|
45403
|
-
return min;
|
|
45404
|
-
});
|
|
45405
|
-
}
|
|
45406
45541
|
return array.map(function (value) {
|
|
45407
45542
|
return (value - arrayMin) / (arrayMax - arrayMin) * (max - min) + min;
|
|
45408
45543
|
});
|
|
45409
45544
|
};
|
|
45410
|
-
var scaledSizeValues = normaliseArray(zValues, 5,
|
|
45545
|
+
var scaledSizeValues = normaliseArray(zValues, 5, 30);
|
|
45411
45546
|
var margin = buildMargin(chart.y.ticks, options.axis.showYAxisLabels, chart.y.title != null, chart.x.title != null);
|
|
45412
45547
|
var _useState = React.useState(chart.lines.map(function (legendItem) {
|
|
45413
45548
|
return legendItem.yKey;
|
|
45414
|
-
}).filter(function (yKey) {
|
|
45415
|
-
return yKey !== chart.groupByKey;
|
|
45416
45549
|
})),
|
|
45417
45550
|
visibleYKeys = _useState[0],
|
|
45418
45551
|
setVisibleYKeys = _useState[1];
|
|
45419
45552
|
React.useEffect(function () {
|
|
45420
45553
|
setVisibleYKeys(chart.lines.map(function (legendItem) {
|
|
45421
45554
|
return legendItem.yKey;
|
|
45422
|
-
}).filter(function (yKey) {
|
|
45423
|
-
return yKey !== chart.groupByKey;
|
|
45424
45555
|
}));
|
|
45425
45556
|
return function () {
|
|
45426
45557
|
setVisibleYKeys([]);
|
|
@@ -45446,13 +45577,13 @@ var BubbleChart$4 = function BubbleChart(_ref) {
|
|
|
45446
45577
|
if (xScaleDataType === 'date_time') {
|
|
45447
45578
|
return scale.scaleTime({
|
|
45448
45579
|
range: [0, innerWidth],
|
|
45449
|
-
domain: chart.x.scale.ordering === '
|
|
45580
|
+
domain: chart.x.scale.ordering === 'asc' ? [chart.x.scale.min, chart.x.scale.max] : [chart.x.scale.max, chart.x.scale.min]
|
|
45450
45581
|
});
|
|
45451
45582
|
}
|
|
45452
45583
|
if (xScaleDataType === 'number') {
|
|
45453
45584
|
return scale.scaleLinear({
|
|
45454
45585
|
range: [0, innerWidth],
|
|
45455
|
-
domain: chart.x.scale.ordering === '
|
|
45586
|
+
domain: chart.x.scale.ordering === 'asc' ? [chart.x.scale.min, chart.x.scale.max] : [chart.x.scale.max, chart.x.scale.min],
|
|
45456
45587
|
nice: true
|
|
45457
45588
|
});
|
|
45458
45589
|
}
|
|
@@ -45491,18 +45622,11 @@ var BubbleChart$4 = function BubbleChart(_ref) {
|
|
|
45491
45622
|
var yTickValues = chart.y.ticks.map(function (tick) {
|
|
45492
45623
|
return Number(tick.value);
|
|
45493
45624
|
});
|
|
45494
|
-
var
|
|
45625
|
+
var legendTooltipItems = [{
|
|
45495
45626
|
legendItems: chart.lines,
|
|
45496
45627
|
visibleYKeys: visibleYKeys,
|
|
45497
45628
|
conditionalFormattingRules: chart.conditionalFormattingRules
|
|
45498
45629
|
}];
|
|
45499
|
-
var legendItems = chart.legend.items.map(function (legendItem) {
|
|
45500
|
-
return {
|
|
45501
|
-
legendItems: [legendItem],
|
|
45502
|
-
visibleYKeys: [legendItem.yKey],
|
|
45503
|
-
conditionalFormattingRules: chart.conditionalFormattingRules
|
|
45504
|
-
};
|
|
45505
|
-
});
|
|
45506
45630
|
return jsxRuntime.jsxs(React__default.Fragment, {
|
|
45507
45631
|
children: [jsxRuntime.jsxs(ChartWrapper$1, {
|
|
45508
45632
|
width: width,
|
|
@@ -45580,20 +45704,20 @@ var BubbleChart$4 = function BubbleChart(_ref) {
|
|
|
45580
45704
|
width: innerWidth
|
|
45581
45705
|
})]
|
|
45582
45706
|
}), options.showLegend && jsxRuntime.jsx(Legend$1, {
|
|
45583
|
-
items:
|
|
45584
|
-
|
|
45707
|
+
items: legendTooltipItems,
|
|
45708
|
+
setVisibleYKeys: setVisibleYKeys,
|
|
45709
|
+
keys: chart.keys,
|
|
45585
45710
|
marginLeft: margin.left - margin.leftTitleOffset
|
|
45586
45711
|
}), tooltipOpen && tooltipData && xKey && jsxRuntime.jsx(Tooltip$1, {
|
|
45587
|
-
items:
|
|
45712
|
+
items: legendTooltipItems,
|
|
45588
45713
|
tooltipData: tooltipData,
|
|
45589
45714
|
tooltipLeft: tooltipLeft,
|
|
45590
45715
|
tooltipTop: tooltipTop,
|
|
45591
|
-
xKey:
|
|
45716
|
+
xKey: xKey,
|
|
45592
45717
|
keys: chart.keys,
|
|
45593
45718
|
yKeys: chart.y.keys,
|
|
45594
45719
|
showRoundedTotal: options.showRoundedTotal,
|
|
45595
|
-
theme: themeCSS.popoverMenus
|
|
45596
|
-
shouldShowColorLegend: false
|
|
45720
|
+
theme: themeCSS.popoverMenus
|
|
45597
45721
|
})]
|
|
45598
45722
|
});
|
|
45599
45723
|
};
|
|
@@ -45604,9 +45728,6 @@ function Bubbles(_ref2) {
|
|
|
45604
45728
|
xScale = _ref2.xScale,
|
|
45605
45729
|
yScale = _ref2.yScale,
|
|
45606
45730
|
chart = _ref2.chart;
|
|
45607
|
-
var getBubbleColor = function getBubbleColor(index) {
|
|
45608
|
-
return chart.legend.items[index % chart.legend.items.length].color;
|
|
45609
|
-
};
|
|
45610
45731
|
return jsxRuntime.jsx(React.Fragment, {
|
|
45611
45732
|
children: data.map(function (d, index) {
|
|
45612
45733
|
var _ref3, _yScale2;
|
|
@@ -45614,7 +45735,10 @@ function Bubbles(_ref2) {
|
|
|
45614
45735
|
r: d.bubbleSize,
|
|
45615
45736
|
cx: (_ref3 = xScale(d[xScaleKey])) != null ? _ref3 : 0,
|
|
45616
45737
|
cy: (_yScale2 = yScale(d[yKeys[0]])) != null ? _yScale2 : 0,
|
|
45617
|
-
fill:
|
|
45738
|
+
fill: chart.lines[0].color,
|
|
45739
|
+
style: {
|
|
45740
|
+
zIndex: -d.bubbleSize
|
|
45741
|
+
}
|
|
45618
45742
|
}, "bubble_chart_" + index);
|
|
45619
45743
|
})
|
|
45620
45744
|
});
|
|
@@ -45889,21 +46013,6 @@ var RadarChart$2 = function RadarChart(_ref) {
|
|
|
45889
46013
|
});
|
|
45890
46014
|
};
|
|
45891
46015
|
|
|
45892
|
-
var init$d = function init(xMeasure, yMeasure) {
|
|
45893
|
-
return {
|
|
45894
|
-
x: xMeasure.map(function (measure) {
|
|
45895
|
-
return id(measure);
|
|
45896
|
-
}),
|
|
45897
|
-
y: yMeasure.map(function (measure) {
|
|
45898
|
-
return id(measure);
|
|
45899
|
-
}),
|
|
45900
|
-
detailed: {
|
|
45901
|
-
x: xMeasure,
|
|
45902
|
-
y: yMeasure
|
|
45903
|
-
}
|
|
45904
|
-
};
|
|
45905
|
-
};
|
|
45906
|
-
|
|
45907
46016
|
var getStyleDefinition = function getStyleDefinition(_ref) {
|
|
45908
46017
|
var colors = _ref.colors,
|
|
45909
46018
|
yKeys = _ref.yKeys;
|
|
@@ -45982,7 +46091,7 @@ var getScaleAndTicks = function getScaleAndTicks(_ref) {
|
|
|
45982
46091
|
yKeys = _ref.yKeys,
|
|
45983
46092
|
xScaleDataType = _ref.xScaleDataType,
|
|
45984
46093
|
nullValue = _ref.nullValue,
|
|
45985
|
-
|
|
46094
|
+
tickCountYAxis = _ref.tickCountYAxis,
|
|
45986
46095
|
formattingFunctionX = _ref.formattingFunctionX,
|
|
45987
46096
|
formattingFunctionY = _ref.formattingFunctionY,
|
|
45988
46097
|
order = _ref.order,
|
|
@@ -45999,18 +46108,32 @@ var getScaleAndTicks = function getScaleAndTicks(_ref) {
|
|
|
45999
46108
|
keys: xScale.key === null ? [] : [xScale.key],
|
|
46000
46109
|
dataType: xScale.dataType
|
|
46001
46110
|
});
|
|
46111
|
+
if (xKey) {
|
|
46112
|
+
xTicks = data.map(function (dataItem) {
|
|
46113
|
+
var _dataItem$xKey, _dataItem$xScale$key, _dataItem$xScale$key2;
|
|
46114
|
+
var xValue = (_dataItem$xKey = dataItem[xKey]) != null && _dataItem$xKey.value ? dataItem[xKey].value : null;
|
|
46115
|
+
var xformattedValue = formattingFunctionX(xValue, nullValue);
|
|
46116
|
+
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 : '';
|
|
46117
|
+
var xScaleValueAdjusted = xScale.dataType === 'date_time' ? new Date(xScaleValue) : xScale.dataType === 'string' ? String(xScaleValue) : xScale.dataType === 'number' ? Number(xScaleValue) : xScaleValue;
|
|
46118
|
+
return {
|
|
46119
|
+
value: xValue !== null ? xValue : '',
|
|
46120
|
+
formattedValue: xformattedValue !== null ? "" + xformattedValue : null,
|
|
46121
|
+
scaleValue: xScaleValueAdjusted
|
|
46122
|
+
};
|
|
46123
|
+
});
|
|
46124
|
+
}
|
|
46125
|
+
// ----- Y Axis ("number") -----
|
|
46126
|
+
|
|
46002
46127
|
var y = getMinAndMax({
|
|
46003
46128
|
data: data,
|
|
46004
46129
|
keys: yKeys,
|
|
46005
46130
|
dataType: 'number',
|
|
46006
46131
|
goalLines: goalLines
|
|
46007
46132
|
});
|
|
46008
|
-
var maxY = y.max
|
|
46133
|
+
var maxY = y.max || 0;
|
|
46009
46134
|
var minY = Math.min(y.min || 0, 0);
|
|
46010
|
-
var tickCountYAxis = approxYAxisLabelCount === 'auto' ? 10 : approxYAxisLabelCount;
|
|
46011
46135
|
var yTickInterval = getNiceInterval((maxY - minY) / (tickCountYAxis - 1));
|
|
46012
|
-
var i = 0;
|
|
46013
|
-
while (yTickInterval * i <= maxY + yTickInterval) {
|
|
46136
|
+
for (var i = 0; i < tickCountYAxis; i++) {
|
|
46014
46137
|
var _value = yTickInterval * i;
|
|
46015
46138
|
var formattedValue = formattingFunctionY(_value, nullValue);
|
|
46016
46139
|
yTicks.push({
|
|
@@ -46018,29 +46141,14 @@ var getScaleAndTicks = function getScaleAndTicks(_ref) {
|
|
|
46018
46141
|
formattedValue: formattedValue,
|
|
46019
46142
|
scaleValue: _value
|
|
46020
46143
|
});
|
|
46021
|
-
i++;
|
|
46022
|
-
}
|
|
46023
|
-
var maxX = x.max ? x.max * 1.05 : x.max || 1;
|
|
46024
|
-
var minX = Math.min(x.min || 0, 0);
|
|
46025
|
-
var xTickInterval = getNiceInterval((maxX - minX) / (10 - 1));
|
|
46026
|
-
i = 0;
|
|
46027
|
-
while (xTickInterval * i <= maxX + xTickInterval) {
|
|
46028
|
-
var _value2 = xTickInterval * i;
|
|
46029
|
-
var _formattedValue = formattingFunctionX(_value2, nullValue);
|
|
46030
|
-
xTicks.push({
|
|
46031
|
-
value: _value2,
|
|
46032
|
-
formattedValue: _formattedValue,
|
|
46033
|
-
scaleValue: _value2
|
|
46034
|
-
});
|
|
46035
|
-
i++;
|
|
46036
46144
|
}
|
|
46037
46145
|
return {
|
|
46038
46146
|
x: {
|
|
46039
46147
|
ticks: xTicks,
|
|
46040
46148
|
scale: {
|
|
46041
46149
|
dataType: xScale.dataType,
|
|
46042
|
-
max:
|
|
46043
|
-
min:
|
|
46150
|
+
max: x.max,
|
|
46151
|
+
min: x.min,
|
|
46044
46152
|
key: xScale.key,
|
|
46045
46153
|
ordering: xScale.ordering
|
|
46046
46154
|
}
|
|
@@ -46049,7 +46157,7 @@ var getScaleAndTicks = function getScaleAndTicks(_ref) {
|
|
|
46049
46157
|
ticks: yTicks,
|
|
46050
46158
|
scale: {
|
|
46051
46159
|
dataType: 'number',
|
|
46052
|
-
key:
|
|
46160
|
+
key: null,
|
|
46053
46161
|
ordering: 'asc',
|
|
46054
46162
|
max: maxY,
|
|
46055
46163
|
min: minY
|
|
@@ -46087,6 +46195,223 @@ var getGoalLines = function getGoalLines(_ref) {
|
|
|
46087
46195
|
});
|
|
46088
46196
|
};
|
|
46089
46197
|
|
|
46198
|
+
var buildTrendAndForecast = function buildTrendAndForecast(_ref) {
|
|
46199
|
+
var data = _ref.data,
|
|
46200
|
+
forecastUnits = _ref.forecastUnits,
|
|
46201
|
+
xKey = _ref.xKey,
|
|
46202
|
+
yKey = _ref.yKey,
|
|
46203
|
+
timeUnit = _ref.timeUnit,
|
|
46204
|
+
includeForecast = _ref.includeForecast;
|
|
46205
|
+
var forecastKey = yKey + "_forecast";
|
|
46206
|
+
var trendKey = yKey + "_trend";
|
|
46207
|
+
var trendData = [];
|
|
46208
|
+
var forecastData = [];
|
|
46209
|
+
var values = data.map(function (point) {
|
|
46210
|
+
return Number(point[yKey].value);
|
|
46211
|
+
});
|
|
46212
|
+
var dates = data.map(function (point) {
|
|
46213
|
+
return new Date(point[xKey].value);
|
|
46214
|
+
});
|
|
46215
|
+
var n = values.length;
|
|
46216
|
+
var daysSinceStart = dates.map(function (date) {
|
|
46217
|
+
return (date.getTime() - dates[0].getTime()) / 86400000;
|
|
46218
|
+
});
|
|
46219
|
+
var meanX = daysSinceStart.reduce(function (a, b) {
|
|
46220
|
+
return a + b;
|
|
46221
|
+
}, 0) / n;
|
|
46222
|
+
var meanY = values.reduce(function (a, b) {
|
|
46223
|
+
return a + b;
|
|
46224
|
+
}, 0) / n;
|
|
46225
|
+
var numerator = 0,
|
|
46226
|
+
denominator = 0;
|
|
46227
|
+
for (var i = 0; i < n; i++) {
|
|
46228
|
+
numerator += (daysSinceStart[i] - meanX) * (values[i] - meanY);
|
|
46229
|
+
denominator += Math.pow(daysSinceStart[i] - meanX, 2);
|
|
46230
|
+
}
|
|
46231
|
+
var slope = numerator / denominator;
|
|
46232
|
+
var intercept = meanY - slope * meanX;
|
|
46233
|
+
var forecastDate = new Date(dates[n - 1]); // Start from the last date in the data
|
|
46234
|
+
|
|
46235
|
+
for (var _i = 0; _i < n + (includeForecast ? forecastUnits : 0); _i++) {
|
|
46236
|
+
var x = void 0;
|
|
46237
|
+
if (_i < n) {
|
|
46238
|
+
// Use existing dates for current trend values
|
|
46239
|
+
x = dates[_i];
|
|
46240
|
+
} else if (includeForecast) {
|
|
46241
|
+
// Generate future dates for forecast values if includeForecast is true
|
|
46242
|
+
switch (timeUnit) {
|
|
46243
|
+
case 'week':
|
|
46244
|
+
forecastDate.setDate(forecastDate.getDate() + 7);
|
|
46245
|
+
break;
|
|
46246
|
+
case 'month':
|
|
46247
|
+
forecastDate.setMonth(forecastDate.getMonth() + 1);
|
|
46248
|
+
break;
|
|
46249
|
+
case 'quarter':
|
|
46250
|
+
forecastDate.setMonth(forecastDate.getMonth() + 3);
|
|
46251
|
+
break;
|
|
46252
|
+
case 'year':
|
|
46253
|
+
forecastDate.setFullYear(forecastDate.getFullYear() + 1);
|
|
46254
|
+
break;
|
|
46255
|
+
}
|
|
46256
|
+
x = new Date(forecastDate);
|
|
46257
|
+
} else {
|
|
46258
|
+
continue; // Skip this iteration if forecasting is not included
|
|
46259
|
+
}
|
|
46260
|
+
var dayCount = (x.getTime() - dates[0].getTime()) / 86400000; // 1 day in milliseconds
|
|
46261
|
+
var forecastedValue = slope * dayCount + intercept;
|
|
46262
|
+
var currentValue = slope * dayCount + intercept;
|
|
46263
|
+
if (_i >= n - 1) {
|
|
46264
|
+
if (_i === n - 1) {
|
|
46265
|
+
trendData.push({
|
|
46266
|
+
date: x.toISOString(),
|
|
46267
|
+
value: parseFloat(currentValue.toFixed(2))
|
|
46268
|
+
});
|
|
46269
|
+
}
|
|
46270
|
+
if (includeForecast) {
|
|
46271
|
+
forecastData.push({
|
|
46272
|
+
date: x.toISOString(),
|
|
46273
|
+
value: parseFloat(forecastedValue.toFixed(2))
|
|
46274
|
+
});
|
|
46275
|
+
}
|
|
46276
|
+
} else {
|
|
46277
|
+
trendData.push({
|
|
46278
|
+
date: x.toISOString(),
|
|
46279
|
+
value: parseFloat(currentValue.toFixed(2))
|
|
46280
|
+
});
|
|
46281
|
+
}
|
|
46282
|
+
}
|
|
46283
|
+
return {
|
|
46284
|
+
trendData: trendData,
|
|
46285
|
+
trendKey: trendKey,
|
|
46286
|
+
forecastData: forecastData,
|
|
46287
|
+
forecastKey: forecastKey
|
|
46288
|
+
};
|
|
46289
|
+
};
|
|
46290
|
+
|
|
46291
|
+
var getTrendsAndForecastsData = function getTrendsAndForecastsData(_ref) {
|
|
46292
|
+
var _trendsAndForecasts$;
|
|
46293
|
+
var chartData = _ref.chartData,
|
|
46294
|
+
formattingFunctionX = _ref.formattingFunctionX,
|
|
46295
|
+
formattingFunctionY = _ref.formattingFunctionY,
|
|
46296
|
+
keys = _ref.keys,
|
|
46297
|
+
nullValue = _ref.nullValue,
|
|
46298
|
+
orderFunction = _ref.orderFunction,
|
|
46299
|
+
trendsAndForecasts = _ref.trendsAndForecasts,
|
|
46300
|
+
xAxisPostfix = _ref.xAxisPostfix,
|
|
46301
|
+
xAxisPrefix = _ref.xAxisPrefix,
|
|
46302
|
+
xKey = _ref.xKey,
|
|
46303
|
+
xScaleDataType = _ref.xScaleDataType,
|
|
46304
|
+
yAxisPostfix = _ref.yAxisPostfix,
|
|
46305
|
+
yAxisPrefix = _ref.yAxisPrefix,
|
|
46306
|
+
yKeys = _ref.yKeys;
|
|
46307
|
+
if (!trendsAndForecasts || trendsAndForecasts.length === 0 || xScaleDataType !== 'date_time') return {
|
|
46308
|
+
chartData: chartData
|
|
46309
|
+
};
|
|
46310
|
+
if (!orderFunction || !['week', 'month', 'quarter', 'year'].includes(orderFunction)) return {
|
|
46311
|
+
chartData: chartData
|
|
46312
|
+
};
|
|
46313
|
+
|
|
46314
|
+
// ----- Technically we should do a loop here but at the moment we'll only have one trend/forecast so use trendsAndForecasts[0] -----
|
|
46315
|
+
|
|
46316
|
+
var includeForecast = trendsAndForecasts[0].type === 'Forecast';
|
|
46317
|
+
var forecastUnits = trendsAndForecasts[0].type === 'Forecast' ? (_trendsAndForecasts$ = trendsAndForecasts[0].value) != null ? _trendsAndForecasts$ : 0 : 0;
|
|
46318
|
+
var yKey = yKeys[0];
|
|
46319
|
+
var newKeys = _.cloneDeep(keys);
|
|
46320
|
+
var _buildTrendAndForecas = buildTrendAndForecast({
|
|
46321
|
+
data: chartData,
|
|
46322
|
+
forecastUnits: forecastUnits,
|
|
46323
|
+
xKey: xKey,
|
|
46324
|
+
yKey: yKey,
|
|
46325
|
+
timeUnit: orderFunction,
|
|
46326
|
+
includeForecast: includeForecast
|
|
46327
|
+
}),
|
|
46328
|
+
trendData = _buildTrendAndForecas.trendData,
|
|
46329
|
+
trendKey = _buildTrendAndForecas.trendKey,
|
|
46330
|
+
forecastData = _buildTrendAndForecas.forecastData,
|
|
46331
|
+
forecastKey = _buildTrendAndForecas.forecastKey;
|
|
46332
|
+
|
|
46333
|
+
// ----- Add Trend To Existing Data Array And Trend Key -----
|
|
46334
|
+
|
|
46335
|
+
var newData = chartData.map(function (dataItem) {
|
|
46336
|
+
var date = dataItem[xKey].value;
|
|
46337
|
+
var trend = trendData.find(function (trendItem) {
|
|
46338
|
+
return trendItem.date === date;
|
|
46339
|
+
});
|
|
46340
|
+
if (trend) {
|
|
46341
|
+
var trendDataItem = {
|
|
46342
|
+
value: trend.value,
|
|
46343
|
+
formattedValue: "" + yAxisPrefix + formattingFunctionY(trend.value, nullValue) + yAxisPostfix
|
|
46344
|
+
};
|
|
46345
|
+
if (includeForecast && forecastData.length > 0) {
|
|
46346
|
+
var _extends2;
|
|
46347
|
+
return _extends({}, dataItem, (_extends2 = {}, _extends2[trendKey] = trendDataItem, _extends2[forecastKey] = {
|
|
46348
|
+
value: null,
|
|
46349
|
+
formattedValue: null
|
|
46350
|
+
}, _extends2));
|
|
46351
|
+
} else {
|
|
46352
|
+
var _extends3;
|
|
46353
|
+
return _extends({}, dataItem, (_extends3 = {}, _extends3[trendKey] = trendDataItem, _extends3));
|
|
46354
|
+
}
|
|
46355
|
+
}
|
|
46356
|
+
return null;
|
|
46357
|
+
});
|
|
46358
|
+
|
|
46359
|
+
// ----- Add New Array Items For Forecast & Forecast Key -----
|
|
46360
|
+
|
|
46361
|
+
if (includeForecast && forecastData.length > 0) {
|
|
46362
|
+
var _loop = function _loop() {
|
|
46363
|
+
var _forecastIncrement;
|
|
46364
|
+
var forecastDataItem = forecastData[index];
|
|
46365
|
+
var forecastIncrement = (_forecastIncrement = {}, _forecastIncrement[xKey] = {
|
|
46366
|
+
value: forecastDataItem.date,
|
|
46367
|
+
formattedValue: "" + xAxisPrefix + formattingFunctionX(forecastDataItem.date, nullValue) + xAxisPostfix
|
|
46368
|
+
}, _forecastIncrement[trendKey] = {
|
|
46369
|
+
value: null,
|
|
46370
|
+
formattedValue: null
|
|
46371
|
+
}, _forecastIncrement[forecastKey] = {
|
|
46372
|
+
value: forecastDataItem.value,
|
|
46373
|
+
formattedValue: "" + yAxisPrefix + formattingFunctionY(forecastDataItem.value, nullValue) + yAxisPostfix
|
|
46374
|
+
}, _forecastIncrement);
|
|
46375
|
+
yKeys.forEach(function (key) {
|
|
46376
|
+
forecastIncrement[key] = {
|
|
46377
|
+
value: null,
|
|
46378
|
+
formattedValue: null
|
|
46379
|
+
};
|
|
46380
|
+
});
|
|
46381
|
+
newData.push(forecastIncrement);
|
|
46382
|
+
};
|
|
46383
|
+
for (var index = 0; index < forecastUnits; index++) {
|
|
46384
|
+
_loop();
|
|
46385
|
+
}
|
|
46386
|
+
}
|
|
46387
|
+
|
|
46388
|
+
// ----- Update Keys -----
|
|
46389
|
+
|
|
46390
|
+
var newYKeys = includeForecast && forecastData.length > 0 ? [].concat(yKeys, [trendKey, forecastKey]) : [].concat(yKeys, [trendKey]);
|
|
46391
|
+
newKeys[trendKey] = {
|
|
46392
|
+
key: trendKey,
|
|
46393
|
+
keyFormatted: newKeys[yKey].keyFormatted + " \u2022 Trend",
|
|
46394
|
+
dataType: 'number'
|
|
46395
|
+
};
|
|
46396
|
+
if (includeForecast && forecastData.length > 0) {
|
|
46397
|
+
newKeys[forecastKey] = {
|
|
46398
|
+
key: forecastKey,
|
|
46399
|
+
keyFormatted: newKeys[yKey].keyFormatted + " \u2022 Forecast",
|
|
46400
|
+
dataType: 'number'
|
|
46401
|
+
};
|
|
46402
|
+
}
|
|
46403
|
+
|
|
46404
|
+
// ----- Create style definitions for trend and forecast in the form of legend items to append to getStyleDefinition() -----
|
|
46405
|
+
|
|
46406
|
+
// TODO
|
|
46407
|
+
|
|
46408
|
+
return {
|
|
46409
|
+
newChartData: newData,
|
|
46410
|
+
newYKeys: newYKeys,
|
|
46411
|
+
newKeys: newKeys
|
|
46412
|
+
};
|
|
46413
|
+
};
|
|
46414
|
+
|
|
46090
46415
|
/**
|
|
46091
46416
|
* When provided with a result, and formatting parameters, it returns a
|
|
46092
46417
|
* populated result including the formatted value to show.
|
|
@@ -46183,28 +46508,77 @@ var formatResult = function formatResult(result, params) {
|
|
|
46183
46508
|
};
|
|
46184
46509
|
};
|
|
46185
46510
|
|
|
46186
|
-
var formattedResultToSeries = function formattedResultToSeries(formattedResult, pivotConfig, zFieldId) {
|
|
46511
|
+
var formattedResultToSeries = function formattedResultToSeries(formattedResult, pivotConfig, seriesLabelFormatter, zFieldId) {
|
|
46512
|
+
var _formattedResult$fiel, _formattedResult$fiel2;
|
|
46187
46513
|
var keys = {};
|
|
46188
|
-
|
|
46189
|
-
|
|
46190
|
-
|
|
46191
|
-
|
|
46192
|
-
|
|
46193
|
-
|
|
46194
|
-
};
|
|
46514
|
+
|
|
46515
|
+
// Collect the result fields which are going to be used on the Y axis.
|
|
46516
|
+
var yResultFields = formattedResult.fields.filter(function (resultField) {
|
|
46517
|
+
var isNotXPivot = !pivotConfig.x.includes(resultField.id);
|
|
46518
|
+
var isNotYPivot = !pivotConfig.y.includes(resultField.id);
|
|
46519
|
+
return isNotXPivot && isNotYPivot;
|
|
46195
46520
|
});
|
|
46521
|
+
var xPivotFields = formattedResult.fields.filter(function (resultField) {
|
|
46522
|
+
return pivotConfig.x.includes(resultField.id);
|
|
46523
|
+
});
|
|
46524
|
+
var yPivotFields = formattedResult.fields.filter(function (resultField) {
|
|
46525
|
+
return pivotConfig.y.includes(resultField.id);
|
|
46526
|
+
});
|
|
46527
|
+
var pivotedData = {};
|
|
46528
|
+
var xKeyOrdering = [];
|
|
46529
|
+
var yKeys = {};
|
|
46530
|
+
formattedResult.contentMapped.forEach(function (row) {
|
|
46531
|
+
xPivotFields.forEach(function (xPivotField) {
|
|
46532
|
+
var _extends2;
|
|
46533
|
+
var uniqueXValue = xPivotField.id + ":" + row[xPivotField.id].value;
|
|
46534
|
+
xKeyOrdering.push(uniqueXValue);
|
|
46535
|
+
|
|
46536
|
+
// Add any existing values, and the x key itself
|
|
46537
|
+
|
|
46538
|
+
var yPivotPrefix = yPivotFields.map(function (yPivotField) {
|
|
46539
|
+
return yPivotField.id + ":" + row[yPivotField.id].value;
|
|
46540
|
+
}).join('_');
|
|
46541
|
+
pivotedData[uniqueXValue] = _extends({}, pivotedData[uniqueXValue] || {}, (_extends2 = {}, _extends2[xPivotField.id] = row[xPivotField.id], _extends2));
|
|
46542
|
+
yResultFields.forEach(function (yResultField) {
|
|
46543
|
+
var _extends3;
|
|
46544
|
+
var key = yPivotFields.length > 0 ? [yPivotPrefix, yResultField.id].join('_') : yResultField.id;
|
|
46545
|
+
yKeys[key] = true;
|
|
46546
|
+
keys[key] = {
|
|
46547
|
+
key: key,
|
|
46548
|
+
dataType: yResultField.dataType,
|
|
46549
|
+
outputDataType: yResultField.outputDataType,
|
|
46550
|
+
keyFormatted: seriesLabelFormatter({
|
|
46551
|
+
yResultField: yResultField,
|
|
46552
|
+
yPivotFields: yPivotFields,
|
|
46553
|
+
row: row
|
|
46554
|
+
})
|
|
46555
|
+
};
|
|
46556
|
+
pivotedData[uniqueXValue] = _extends({}, pivotedData[uniqueXValue] || {}, (_extends3 = {}, _extends3[key] = row[yResultField.id], _extends3));
|
|
46557
|
+
});
|
|
46558
|
+
});
|
|
46559
|
+
});
|
|
46560
|
+
var seriesDataFlattened = _.uniq(xKeyOrdering).map(function (xKey) {
|
|
46561
|
+
return pivotedData[xKey];
|
|
46562
|
+
});
|
|
46563
|
+
var mappedXKeys = xPivotFields.map(function (r) {
|
|
46564
|
+
return r.id;
|
|
46565
|
+
});
|
|
46566
|
+
var mappedYKeys = Object.keys(yKeys);
|
|
46567
|
+
var mappedZKey = (_formattedResult$fiel = (_formattedResult$fiel2 = formattedResult.fields.find(function (resultField) {
|
|
46568
|
+
return resultField.fieldId === zFieldId;
|
|
46569
|
+
})) == null ? void 0 : _formattedResult$fiel2.id) != null ? _formattedResult$fiel : '';
|
|
46196
46570
|
var formattedResultReturn = {
|
|
46197
|
-
xKeys:
|
|
46198
|
-
yKeys:
|
|
46199
|
-
zKey:
|
|
46571
|
+
xKeys: mappedXKeys,
|
|
46572
|
+
yKeys: mappedYKeys,
|
|
46573
|
+
zKey: mappedZKey,
|
|
46200
46574
|
keys: keys,
|
|
46201
|
-
seriesData:
|
|
46575
|
+
seriesData: seriesDataFlattened
|
|
46202
46576
|
};
|
|
46203
46577
|
return formattedResultReturn;
|
|
46204
46578
|
};
|
|
46205
46579
|
|
|
46206
46580
|
var buildBubbleChartRepresentation = function buildBubbleChartRepresentation(_ref) {
|
|
46207
|
-
var _pivotConfig$x$, _xKeys$,
|
|
46581
|
+
var _pivotConfig$x$, _xKeys$, _axisTitles$x, _axisTitles$y;
|
|
46208
46582
|
var axisTitles = _ref.axisTitles,
|
|
46209
46583
|
colors = _ref.colors,
|
|
46210
46584
|
conditionalFormattingAttributes = _ref.conditionalFormattingAttributes,
|
|
@@ -46216,6 +46590,7 @@ var buildBubbleChartRepresentation = function buildBubbleChartRepresentation(_re
|
|
|
46216
46590
|
order = _ref.order,
|
|
46217
46591
|
pivotConfig = _ref.pivotConfig,
|
|
46218
46592
|
result = _ref.result,
|
|
46593
|
+
trendsAndForecasts = _ref.trendsAndForecasts,
|
|
46219
46594
|
xAxisFormat = _ref.xAxisFormat,
|
|
46220
46595
|
xAxisPostfix = _ref.xAxisPostfix,
|
|
46221
46596
|
xAxisPrefix = _ref.xAxisPrefix,
|
|
@@ -46223,6 +46598,7 @@ var buildBubbleChartRepresentation = function buildBubbleChartRepresentation(_re
|
|
|
46223
46598
|
yAxisPostfix = _ref.yAxisPostfix,
|
|
46224
46599
|
yAxisPrefix = _ref.yAxisPrefix,
|
|
46225
46600
|
approxYAxisLabelCount = _ref.approxYAxisLabelCount,
|
|
46601
|
+
seriesLabelFormatter = _ref.seriesLabelFormatter,
|
|
46226
46602
|
_valueAlias = _ref.valueAlias,
|
|
46227
46603
|
zFieldId = _ref.zFieldId;
|
|
46228
46604
|
var allPrefixes = {};
|
|
@@ -46305,6 +46681,7 @@ var buildBubbleChartRepresentation = function buildBubbleChartRepresentation(_re
|
|
|
46305
46681
|
var xKeyField = result.fields.find(function (field) {
|
|
46306
46682
|
return field.id === xKeyTemp;
|
|
46307
46683
|
});
|
|
46684
|
+
var orderFunction = order.length > 0 ? order[0]["function"] : undefined;
|
|
46308
46685
|
|
|
46309
46686
|
// ----- Formatting -----
|
|
46310
46687
|
|
|
@@ -46321,7 +46698,7 @@ var buildBubbleChartRepresentation = function buildBubbleChartRepresentation(_re
|
|
|
46321
46698
|
var formattingFunctionY = function formattingFunctionY(value) {
|
|
46322
46699
|
// Use any y axis field as they are all formatted in the same way (for now...);
|
|
46323
46700
|
var nonPivotField = formattedResult.fields.find(function (resultField) {
|
|
46324
|
-
return pivotConfig.y.includes(resultField.id);
|
|
46701
|
+
return ![].concat(pivotConfig.x, pivotConfig.y).includes(resultField.id);
|
|
46325
46702
|
});
|
|
46326
46703
|
if (!nonPivotField) return '';
|
|
46327
46704
|
return formattedResult.formatterFunc(value, {
|
|
@@ -46333,23 +46710,33 @@ var buildBubbleChartRepresentation = function buildBubbleChartRepresentation(_re
|
|
|
46333
46710
|
|
|
46334
46711
|
// ----- Keys & Prep -----
|
|
46335
46712
|
var xScaleDataType = (xKeyField == null ? void 0 : xKeyField.outputDataType) || 'string';
|
|
46336
|
-
var _formattedResultToSer = formattedResultToSeries(formattedResult, pivotConfig, zFieldId),
|
|
46713
|
+
var _formattedResultToSer = formattedResultToSeries(formattedResult, pivotConfig, seriesLabelFormatter, zFieldId),
|
|
46337
46714
|
keys = _formattedResultToSer.keys,
|
|
46338
46715
|
yKeys = _formattedResultToSer.yKeys,
|
|
46339
46716
|
xKeys = _formattedResultToSer.xKeys,
|
|
46340
46717
|
zKey = _formattedResultToSer.zKey,
|
|
46341
46718
|
chartData = _formattedResultToSer.seriesData;
|
|
46342
|
-
var sortedChartData = chartData.sort(function (a, b) {
|
|
46343
|
-
var _order$, _a$pivotConfig$x$, _b$pivotConfig$x$;
|
|
46344
|
-
var isDescending = ((_order$ = order[0]) == null ? void 0 : _order$.direction) === 'desc';
|
|
46345
|
-
var xValueA = (_a$pivotConfig$x$ = a[pivotConfig.x[0]]) == null ? void 0 : _a$pivotConfig$x$.value;
|
|
46346
|
-
var xValueB = (_b$pivotConfig$x$ = b[pivotConfig.x[0]]) == null ? void 0 : _b$pivotConfig$x$.value;
|
|
46347
|
-
if (xValueA < xValueB) return isDescending ? 1 : -1;
|
|
46348
|
-
if (xValueA > xValueB) return isDescending ? -1 : 1;
|
|
46349
|
-
return 0;
|
|
46350
|
-
});
|
|
46351
46719
|
var xKey = (_xKeys$ = xKeys[0]) != null ? _xKeys$ : null;
|
|
46352
46720
|
|
|
46721
|
+
// ----- Trends & Forecasts -----
|
|
46722
|
+
|
|
46723
|
+
var trendsAndForecastData = getTrendsAndForecastsData({
|
|
46724
|
+
chartData: chartData,
|
|
46725
|
+
formattingFunctionX: formattingFunctionX,
|
|
46726
|
+
formattingFunctionY: formattingFunctionY,
|
|
46727
|
+
keys: keys,
|
|
46728
|
+
nullValue: nullValue,
|
|
46729
|
+
trendsAndForecasts: trendsAndForecasts,
|
|
46730
|
+
xAxisPostfix: xAxisPostfix,
|
|
46731
|
+
xKey: xKey,
|
|
46732
|
+
yKeys: yKeys,
|
|
46733
|
+
xAxisPrefix: xAxisPrefix,
|
|
46734
|
+
xScaleDataType: xScaleDataType,
|
|
46735
|
+
yAxisPostfix: yAxisPostfix,
|
|
46736
|
+
yAxisPrefix: yAxisPrefix,
|
|
46737
|
+
orderFunction: orderFunction
|
|
46738
|
+
});
|
|
46739
|
+
|
|
46353
46740
|
// ----- Goal Lines -----
|
|
46354
46741
|
|
|
46355
46742
|
var goalLines = getGoalLines({
|
|
@@ -46360,11 +46747,11 @@ var buildBubbleChartRepresentation = function buildBubbleChartRepresentation(_re
|
|
|
46360
46747
|
// ----- Ticks -----
|
|
46361
46748
|
|
|
46362
46749
|
var ticks = getScaleAndTicks({
|
|
46363
|
-
data:
|
|
46750
|
+
data: chartData,
|
|
46364
46751
|
xKey: xKey,
|
|
46365
46752
|
xScaleDataType: xScaleDataType,
|
|
46366
46753
|
yKeys: yKeys,
|
|
46367
|
-
|
|
46754
|
+
tickCountYAxis: approxYAxisLabelCount,
|
|
46368
46755
|
formattingFunctionX: formattingFunctionX,
|
|
46369
46756
|
formattingFunctionY: formattingFunctionY,
|
|
46370
46757
|
nullValue: nullValue,
|
|
@@ -46374,36 +46761,9 @@ var buildBubbleChartRepresentation = function buildBubbleChartRepresentation(_re
|
|
|
46374
46761
|
|
|
46375
46762
|
// ----- Lines -----
|
|
46376
46763
|
|
|
46377
|
-
var groupByKey = (_formattedResult$fiel = (_formattedResult$fiel2 = formattedResult.fields.find(function (field) {
|
|
46378
|
-
return field["function"] === 'none';
|
|
46379
|
-
})) == null ? void 0 : _formattedResult$fiel2.id) != null ? _formattedResult$fiel : '';
|
|
46380
46764
|
var styleDefinition = getStyleDefinition({
|
|
46381
|
-
colors: colors,
|
|
46382
|
-
yKeys:
|
|
46383
|
-
});
|
|
46384
|
-
|
|
46385
|
-
// ----- Legend -----
|
|
46386
|
-
var colorScale = themeToColorScale(colors, sortedChartData.length);
|
|
46387
|
-
var legendItems = sortedChartData.map(function (d, index) {
|
|
46388
|
-
var _d$groupByKey, _colorScale;
|
|
46389
|
-
return {
|
|
46390
|
-
yKey: (_d$groupByKey = d[groupByKey]) == null ? void 0 : _d$groupByKey.value,
|
|
46391
|
-
color: (_colorScale = colorScale[index % colorScale.length]) != null ? _colorScale : '',
|
|
46392
|
-
style: {
|
|
46393
|
-
strokeWidth: 3,
|
|
46394
|
-
strokeDasharray: null,
|
|
46395
|
-
type: 'line'
|
|
46396
|
-
}
|
|
46397
|
-
};
|
|
46398
|
-
});
|
|
46399
|
-
var legendKeys = {};
|
|
46400
|
-
sortedChartData.forEach(function (row) {
|
|
46401
|
-
var _row$groupByKey, _row$groupByKey$value, _row$groupByKey2, _row$groupByKey$forma, _row$groupByKey3;
|
|
46402
|
-
legendKeys[(_row$groupByKey = row[groupByKey]) == null ? void 0 : _row$groupByKey.value] = {
|
|
46403
|
-
key: (_row$groupByKey$value = (_row$groupByKey2 = row[groupByKey]) == null ? void 0 : _row$groupByKey2.value) != null ? _row$groupByKey$value : '',
|
|
46404
|
-
dataType: 'string',
|
|
46405
|
-
keyFormatted: (_row$groupByKey$forma = (_row$groupByKey3 = row[groupByKey]) == null ? void 0 : _row$groupByKey3.formattedValue) != null ? _row$groupByKey$forma : ''
|
|
46406
|
-
};
|
|
46765
|
+
colors: colors != null ? colors : ['#feae4a', '#5fbaff', '#e15e9d'],
|
|
46766
|
+
yKeys: yKeys
|
|
46407
46767
|
});
|
|
46408
46768
|
|
|
46409
46769
|
// ----- Conditional Formatting -----
|
|
@@ -46442,24 +46802,21 @@ var buildBubbleChartRepresentation = function buildBubbleChartRepresentation(_re
|
|
|
46442
46802
|
title: (_axisTitles$y = axisTitles == null ? void 0 : axisTitles.y) != null ? _axisTitles$y : null
|
|
46443
46803
|
},
|
|
46444
46804
|
z: zKey,
|
|
46445
|
-
data:
|
|
46805
|
+
data: chartData,
|
|
46446
46806
|
lines: styleDefinition,
|
|
46447
46807
|
conditionalFormattingRules: conditionalFormattingRules,
|
|
46448
|
-
goalLines: goalLines
|
|
46449
|
-
groupByKey: groupByKey,
|
|
46450
|
-
legend: {
|
|
46451
|
-
keys: legendKeys,
|
|
46452
|
-
items: legendItems
|
|
46453
|
-
}
|
|
46808
|
+
goalLines: goalLines
|
|
46454
46809
|
};
|
|
46455
46810
|
return chart;
|
|
46456
46811
|
};
|
|
46457
46812
|
|
|
46458
46813
|
var BubbleChartV2View = function BubbleChartV2View(props) {
|
|
46459
|
-
var _props$library, _props$attributes$vie
|
|
46814
|
+
var _props$library, _props$attributes$vie;
|
|
46460
46815
|
var _useDashboardBehaviou = useDashboardBehaviourContext(),
|
|
46461
46816
|
textOverride = _useDashboardBehaviou.textOverride,
|
|
46462
|
-
valueAlias = _useDashboardBehaviou.valueAlias
|
|
46817
|
+
valueAlias = _useDashboardBehaviou.valueAlias,
|
|
46818
|
+
labelFormat = _useDashboardBehaviou.labelFormat,
|
|
46819
|
+
queryEngineConfig = _useDashboardBehaviou.queryEngineConfig;
|
|
46463
46820
|
var headerProps = {
|
|
46464
46821
|
displayTitle: props.attributes.displayTitle,
|
|
46465
46822
|
displaySubject: props.attributes.displaySubject,
|
|
@@ -46480,12 +46837,12 @@ var BubbleChartV2View = function BubbleChartV2View(props) {
|
|
|
46480
46837
|
var showHeadline = headlineAvailable(props.attributes.order, props.attributes.headline, null);
|
|
46481
46838
|
var theme = useTheme();
|
|
46482
46839
|
var BubbleChartV2Component = getComponentInterface(props.attributes.type);
|
|
46483
|
-
var pivotConfig = init$
|
|
46840
|
+
var pivotConfig = init$c(props.attributes);
|
|
46484
46841
|
var chartRepresentation = null;
|
|
46485
46842
|
if (!isLoading(props.result) && !hasFailed(props.result) && !isEmpty(props.result) && BubbleChartV2Component.isRunnable(props.attributes)) {
|
|
46486
46843
|
var _theme$charts$colors, _theme$charts, _props$attributes$goa;
|
|
46487
46844
|
chartRepresentation = buildBubbleChartRepresentation({
|
|
46488
|
-
zFieldId:
|
|
46845
|
+
zFieldId: props.attributes.zMeasure[0].field,
|
|
46489
46846
|
axisTitles: props.attributes.axisTitles,
|
|
46490
46847
|
xAxisPostfix: props.attributes.xAxisPostfix,
|
|
46491
46848
|
xAxisPrefix: props.attributes.xAxisPrefix,
|
|
@@ -46493,7 +46850,7 @@ var BubbleChartV2View = function BubbleChartV2View(props) {
|
|
|
46493
46850
|
yAxisPrefix: props.attributes.yAxisPrefix,
|
|
46494
46851
|
yAxisFormat: props.attributes.yAxisFormat,
|
|
46495
46852
|
xAxisFormat: props.attributes.xAxisFormat,
|
|
46496
|
-
approxYAxisLabelCount: props.attributes.approxYAxisLabelCount,
|
|
46853
|
+
approxYAxisLabelCount: props.attributes.approxYAxisLabelCount === 'auto' ? 10 : props.attributes.approxYAxisLabelCount,
|
|
46497
46854
|
colors: (_theme$charts$colors = theme == null || (_theme$charts = theme.charts) == null ? void 0 : _theme$charts.colors) != null ? _theme$charts$colors : DEFAULT_CHART_COLORS,
|
|
46498
46855
|
valueAlias: valueAlias,
|
|
46499
46856
|
nullValue: checkForNullValue(props.attributes.dataSetId, props.attributes.dimension, props.attributes.timeDimension, textOverride, valueAlias),
|
|
@@ -46504,7 +46861,27 @@ var BubbleChartV2View = function BubbleChartV2View(props) {
|
|
|
46504
46861
|
dateTimeFormatOptions: props.dateTimeFormatOptions,
|
|
46505
46862
|
goalLineAttributes: (_props$attributes$goa = props.attributes.goalLines) != null ? _props$attributes$goa : [],
|
|
46506
46863
|
conditionalFormattingAttributes: props.attributes.conditionalFormattingRules,
|
|
46507
|
-
|
|
46864
|
+
trendsAndForecasts: props.attributes.trends,
|
|
46865
|
+
defaultFormats: props.defaultFormats,
|
|
46866
|
+
seriesLabelFormatter: function seriesLabelFormatter(labelFormatParams) {
|
|
46867
|
+
var _queryEngineConfig$su, _queryEngineConfig$su2, _queryEngineConfig$su3;
|
|
46868
|
+
var yResultField = labelFormatParams.yResultField,
|
|
46869
|
+
yPivotFields = labelFormatParams.yPivotFields,
|
|
46870
|
+
row = labelFormatParams.row;
|
|
46871
|
+
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);
|
|
46872
|
+
var formattedFunction = yResultField["function"] === 'none' ? '' : " \u2022 " + formattedFunctionName;
|
|
46873
|
+
var defaultLabelFormat = "" + yPivotFields.map(function (field) {
|
|
46874
|
+
return row[field.id].formattedValue;
|
|
46875
|
+
}).join(' • ') + (yPivotFields.length === 0 ? '' : ' • ') + yResultField.publicName + formattedFunction;
|
|
46876
|
+
if (!labelFormat) return defaultLabelFormat;
|
|
46877
|
+
return labelFormat({
|
|
46878
|
+
viewId: props.attributes.viewId,
|
|
46879
|
+
fieldId: yResultField.fieldId,
|
|
46880
|
+
func: yResultField["function"],
|
|
46881
|
+
type: 'bubbleChartV2',
|
|
46882
|
+
defaultLabel: defaultLabelFormat
|
|
46883
|
+
}) || defaultLabelFormat;
|
|
46884
|
+
}
|
|
46508
46885
|
});
|
|
46509
46886
|
}
|
|
46510
46887
|
|
|
@@ -46514,16 +46891,6 @@ var BubbleChartV2View = function BubbleChartV2View(props) {
|
|
|
46514
46891
|
title: "Missing parameters"
|
|
46515
46892
|
});
|
|
46516
46893
|
}
|
|
46517
|
-
if (((_props$result = props.result) == null ? void 0 : _props$result.fields.filter(function (r) {
|
|
46518
|
-
return pivotConfig.x.includes(r.id);
|
|
46519
|
-
}).length) === 0) return jsxRuntime.jsx(LoadingComponent, {});
|
|
46520
|
-
if (((_props$result2 = props.result) == null ? void 0 : _props$result2.fields.filter(function (r) {
|
|
46521
|
-
return pivotConfig.y.includes(r.id);
|
|
46522
|
-
}).length) === 0) return jsxRuntime.jsx(LoadingComponent, {});
|
|
46523
|
-
if (((_props$result3 = props.result) == null ? void 0 : _props$result3.fields.filter(function (r) {
|
|
46524
|
-
var _Field$id;
|
|
46525
|
-
return (_Field$id = id(props.attributes.zMeasure[0])) == null ? void 0 : _Field$id.includes(r.id);
|
|
46526
|
-
}).length) === 0) return jsxRuntime.jsx(LoadingComponent, {});
|
|
46527
46894
|
if (isLoading(props.result)) return jsxRuntime.jsx(LoadingComponent, {});
|
|
46528
46895
|
if (hasFailed(props.result)) return jsxRuntime.jsx(FailedToLoadDataNotice, {});
|
|
46529
46896
|
if (isEmpty(props.result)) return jsxRuntime.jsx(NoResultContentToShowNotice, _extends({}, headerProps));
|
|
@@ -46573,15 +46940,15 @@ var BubbleChartV2View = function BubbleChartV2View(props) {
|
|
|
46573
46940
|
|
|
46574
46941
|
var BubbleChartV2$1 = function BubbleChartV2(props) {
|
|
46575
46942
|
var _props$component = props.component,
|
|
46943
|
+
results = _props$component.results,
|
|
46576
46944
|
attributes = _props$component.attributes,
|
|
46577
46945
|
localFilters = _props$component.localFilters;
|
|
46578
46946
|
var dashboardBehaviour = props.dashboardBehaviour;
|
|
46579
46947
|
var _useComponentEffect = useComponentEffect(attributes, props.dataSet, dashboardBehaviour.queryEngineConfig, {
|
|
46580
46948
|
localFilters: localFilters,
|
|
46581
46949
|
globalFilters: props.globalFilters
|
|
46582
|
-
}, props.updateComponentAttributes, props.runQueriesCallback, dashboardBehaviour.variables),
|
|
46583
|
-
queriesAreChanging = _useComponentEffect.queriesAreChanging
|
|
46584
|
-
results = _useComponentEffect.results;
|
|
46950
|
+
}, props.updateComponentAttributes, props.runQueriesCallback, props.setResults, dashboardBehaviour.variables),
|
|
46951
|
+
queriesAreChanging = _useComponentEffect.queriesAreChanging;
|
|
46585
46952
|
return jsxRuntime.jsx(BubbleChartV2View, {
|
|
46586
46953
|
id: props.id,
|
|
46587
46954
|
attributes: attributes,
|
|
@@ -46735,76 +47102,7 @@ function getStyleDefinition$1(_ref) {
|
|
|
46735
47102
|
});
|
|
46736
47103
|
}
|
|
46737
47104
|
|
|
46738
|
-
var
|
|
46739
|
-
var _formattedResult$fiel, _formattedResult$fiel2;
|
|
46740
|
-
var keys = {};
|
|
46741
|
-
|
|
46742
|
-
// Collect the result fields which are going to be used on the Y axis.
|
|
46743
|
-
var yResultFields = formattedResult.fields.filter(function (resultField) {
|
|
46744
|
-
var isNotXPivot = !pivotConfig.x.includes(resultField.id);
|
|
46745
|
-
var isNotYPivot = !pivotConfig.y.includes(resultField.id);
|
|
46746
|
-
return isNotXPivot && isNotYPivot;
|
|
46747
|
-
});
|
|
46748
|
-
var xPivotFields = formattedResult.fields.filter(function (resultField) {
|
|
46749
|
-
return pivotConfig.x.includes(resultField.id);
|
|
46750
|
-
});
|
|
46751
|
-
var yPivotFields = formattedResult.fields.filter(function (resultField) {
|
|
46752
|
-
return pivotConfig.y.includes(resultField.id);
|
|
46753
|
-
});
|
|
46754
|
-
var pivotedData = {};
|
|
46755
|
-
var xKeyOrdering = [];
|
|
46756
|
-
var yKeys = {};
|
|
46757
|
-
formattedResult.contentMapped.forEach(function (row) {
|
|
46758
|
-
xPivotFields.forEach(function (xPivotField) {
|
|
46759
|
-
var _extends2;
|
|
46760
|
-
var uniqueXValue = xPivotField.id + ":" + row[xPivotField.id].value;
|
|
46761
|
-
xKeyOrdering.push(uniqueXValue);
|
|
46762
|
-
|
|
46763
|
-
// Add any existing values, and the x key itself
|
|
46764
|
-
|
|
46765
|
-
var yPivotPrefix = yPivotFields.map(function (yPivotField) {
|
|
46766
|
-
return yPivotField.id + ":" + row[yPivotField.id].value;
|
|
46767
|
-
}).join('_');
|
|
46768
|
-
pivotedData[uniqueXValue] = _extends({}, pivotedData[uniqueXValue] || {}, (_extends2 = {}, _extends2[xPivotField.id] = row[xPivotField.id], _extends2));
|
|
46769
|
-
yResultFields.forEach(function (yResultField) {
|
|
46770
|
-
var _extends3;
|
|
46771
|
-
var key = yPivotFields.length > 0 ? [yPivotPrefix, yResultField.id].join('_') : yResultField.id;
|
|
46772
|
-
yKeys[key] = true;
|
|
46773
|
-
keys[key] = {
|
|
46774
|
-
key: key,
|
|
46775
|
-
dataType: yResultField.dataType,
|
|
46776
|
-
outputDataType: yResultField.outputDataType,
|
|
46777
|
-
keyFormatted: seriesLabelFormatter({
|
|
46778
|
-
yResultField: yResultField,
|
|
46779
|
-
yPivotFields: yPivotFields,
|
|
46780
|
-
row: row
|
|
46781
|
-
})
|
|
46782
|
-
};
|
|
46783
|
-
pivotedData[uniqueXValue] = _extends({}, pivotedData[uniqueXValue] || {}, (_extends3 = {}, _extends3[key] = row[yResultField.id], _extends3));
|
|
46784
|
-
});
|
|
46785
|
-
});
|
|
46786
|
-
});
|
|
46787
|
-
var seriesDataFlattened = _.uniq(xKeyOrdering).map(function (xKey) {
|
|
46788
|
-
return pivotedData[xKey];
|
|
46789
|
-
});
|
|
46790
|
-
var mappedXKeys = xPivotFields.map(function (r) {
|
|
46791
|
-
return r.id;
|
|
46792
|
-
});
|
|
46793
|
-
var mappedYKeys = Object.keys(yKeys);
|
|
46794
|
-
var mappedZKey = (_formattedResult$fiel = (_formattedResult$fiel2 = formattedResult.fields.find(function (resultField) {
|
|
46795
|
-
return resultField.fieldId === zFieldId;
|
|
46796
|
-
})) == null ? void 0 : _formattedResult$fiel2.id) != null ? _formattedResult$fiel : '';
|
|
46797
|
-
var formattedResultReturn = {
|
|
46798
|
-
xKeys: mappedXKeys,
|
|
46799
|
-
yKeys: mappedYKeys,
|
|
46800
|
-
zKey: mappedZKey,
|
|
46801
|
-
keys: keys,
|
|
46802
|
-
seriesData: seriesDataFlattened
|
|
46803
|
-
};
|
|
46804
|
-
return formattedResultReturn;
|
|
46805
|
-
};
|
|
46806
|
-
|
|
46807
|
-
var buildTrendAndForecast = function buildTrendAndForecast(_ref) {
|
|
47105
|
+
var buildTrendAndForecast$1 = function buildTrendAndForecast(_ref) {
|
|
46808
47106
|
var data = _ref.data,
|
|
46809
47107
|
forecastUnits = _ref.forecastUnits,
|
|
46810
47108
|
xKey = _ref.xKey,
|
|
@@ -46897,7 +47195,7 @@ var buildTrendAndForecast = function buildTrendAndForecast(_ref) {
|
|
|
46897
47195
|
};
|
|
46898
47196
|
};
|
|
46899
47197
|
|
|
46900
|
-
var getTrendsAndForecastsData = function getTrendsAndForecastsData(_ref) {
|
|
47198
|
+
var getTrendsAndForecastsData$1 = function getTrendsAndForecastsData(_ref) {
|
|
46901
47199
|
var _trendsAndForecasts$;
|
|
46902
47200
|
var chartData = _ref.chartData,
|
|
46903
47201
|
formattingFunctionX = _ref.formattingFunctionX,
|
|
@@ -46926,7 +47224,7 @@ var getTrendsAndForecastsData = function getTrendsAndForecastsData(_ref) {
|
|
|
46926
47224
|
var forecastUnits = trendsAndForecasts[0].type === 'Forecast' ? (_trendsAndForecasts$ = trendsAndForecasts[0].value) != null ? _trendsAndForecasts$ : 0 : 0;
|
|
46927
47225
|
var yKey = yKeys[0];
|
|
46928
47226
|
var newKeys = _.cloneDeep(keys);
|
|
46929
|
-
var _buildTrendAndForecas = buildTrendAndForecast({
|
|
47227
|
+
var _buildTrendAndForecas = buildTrendAndForecast$1({
|
|
46930
47228
|
data: chartData,
|
|
46931
47229
|
forecastUnits: forecastUnits,
|
|
46932
47230
|
xKey: xKey,
|
|
@@ -47365,7 +47663,7 @@ var buildLineChartRepresentation = function buildLineChartRepresentation(_ref) {
|
|
|
47365
47663
|
|
|
47366
47664
|
// ----- Keys & Prep -----
|
|
47367
47665
|
var xScaleDataType = (xKeyField == null ? void 0 : xKeyField.outputDataType) || 'string';
|
|
47368
|
-
var _formattedResultToSer = formattedResultToSeries
|
|
47666
|
+
var _formattedResultToSer = formattedResultToSeries(formattedResult, pivotConfig, seriesLabelFormatter),
|
|
47369
47667
|
keys = _formattedResultToSer.keys,
|
|
47370
47668
|
yKeys = _formattedResultToSer.yKeys,
|
|
47371
47669
|
xKeys = _formattedResultToSer.xKeys,
|
|
@@ -47375,7 +47673,7 @@ var buildLineChartRepresentation = function buildLineChartRepresentation(_ref) {
|
|
|
47375
47673
|
// ----- Trends & Forecasts -----
|
|
47376
47674
|
|
|
47377
47675
|
var orderFunction = order.length > 0 ? order[0]["function"] : undefined;
|
|
47378
|
-
var trendsAndForecastData = getTrendsAndForecastsData({
|
|
47676
|
+
var trendsAndForecastData = getTrendsAndForecastsData$1({
|
|
47379
47677
|
chartData: chartData,
|
|
47380
47678
|
formattingFunctionX: function formattingFunctionX$1(value) {
|
|
47381
47679
|
return formattingFunctionX(value, formattedResult, xKeyField);
|
|
@@ -47607,15 +47905,15 @@ var LineChartV2View = function LineChartV2View(props) {
|
|
|
47607
47905
|
|
|
47608
47906
|
var LineChartV2 = function LineChartV2(props) {
|
|
47609
47907
|
var _props$component = props.component,
|
|
47908
|
+
results = _props$component.results,
|
|
47610
47909
|
attributes = _props$component.attributes,
|
|
47611
47910
|
localFilters = _props$component.localFilters;
|
|
47612
47911
|
var dashboardBehaviour = props.dashboardBehaviour;
|
|
47613
47912
|
var _useComponentEffect = useComponentEffect(attributes, props.dataSet, dashboardBehaviour.queryEngineConfig, {
|
|
47614
47913
|
localFilters: localFilters,
|
|
47615
47914
|
globalFilters: props.globalFilters
|
|
47616
|
-
}, props.updateComponentAttributes, props.runQueriesCallback, dashboardBehaviour.variables),
|
|
47617
|
-
queriesAreChanging = _useComponentEffect.queriesAreChanging
|
|
47618
|
-
results = _useComponentEffect.results;
|
|
47915
|
+
}, props.updateComponentAttributes, props.runQueriesCallback, props.setResults, dashboardBehaviour.variables),
|
|
47916
|
+
queriesAreChanging = _useComponentEffect.queriesAreChanging;
|
|
47619
47917
|
return jsxRuntime.jsx(LineChartV2View, {
|
|
47620
47918
|
id: props.id,
|
|
47621
47919
|
attributes: attributes,
|
|
@@ -47744,7 +48042,7 @@ var buildAreaChartRepresentation = function buildAreaChartRepresentation(_ref) {
|
|
|
47744
48042
|
|
|
47745
48043
|
// ----- Keys & Prep -----
|
|
47746
48044
|
var xScaleDataType = (xKeyField == null ? void 0 : xKeyField.outputDataType) || 'string';
|
|
47747
|
-
var _formattedResultToSer = formattedResultToSeries
|
|
48045
|
+
var _formattedResultToSer = formattedResultToSeries(formattedResult, pivotConfig, seriesLabelFormatter),
|
|
47748
48046
|
keys = _formattedResultToSer.keys,
|
|
47749
48047
|
yKeys = _formattedResultToSer.yKeys,
|
|
47750
48048
|
xKeys = _formattedResultToSer.xKeys,
|
|
@@ -47979,15 +48277,15 @@ var AreaChartV2View = function AreaChartV2View(props) {
|
|
|
47979
48277
|
|
|
47980
48278
|
var AreaChartV2 = function AreaChartV2(props) {
|
|
47981
48279
|
var _props$component = props.component,
|
|
48280
|
+
results = _props$component.results,
|
|
47982
48281
|
attributes = _props$component.attributes,
|
|
47983
48282
|
localFilters = _props$component.localFilters;
|
|
47984
48283
|
var dashboardBehaviour = props.dashboardBehaviour;
|
|
47985
48284
|
var _useComponentEffect = useComponentEffect(attributes, props.dataSet, dashboardBehaviour.queryEngineConfig, {
|
|
47986
48285
|
localFilters: localFilters,
|
|
47987
48286
|
globalFilters: props.globalFilters
|
|
47988
|
-
}, props.updateComponentAttributes, props.runQueriesCallback, dashboardBehaviour.variables),
|
|
47989
|
-
queriesAreChanging = _useComponentEffect.queriesAreChanging
|
|
47990
|
-
results = _useComponentEffect.results;
|
|
48287
|
+
}, props.updateComponentAttributes, props.runQueriesCallback, props.setResults, dashboardBehaviour.variables),
|
|
48288
|
+
queriesAreChanging = _useComponentEffect.queriesAreChanging;
|
|
47991
48289
|
return jsxRuntime.jsx(AreaChartV2View, {
|
|
47992
48290
|
id: props.id,
|
|
47993
48291
|
attributes: attributes,
|
|
@@ -48096,7 +48394,7 @@ var buildBarChartRepresentation = function buildBarChartRepresentation(_ref) {
|
|
|
48096
48394
|
|
|
48097
48395
|
// ----- Keys & Prep -----
|
|
48098
48396
|
var xScaleDataType = (xKeyField == null ? void 0 : xKeyField.outputDataType) || 'string';
|
|
48099
|
-
var _formattedResultToSer = formattedResultToSeries
|
|
48397
|
+
var _formattedResultToSer = formattedResultToSeries(formattedResult, pivotConfig, seriesLabelFormatter),
|
|
48100
48398
|
keys = _formattedResultToSer.keys,
|
|
48101
48399
|
yKeys = _formattedResultToSer.yKeys,
|
|
48102
48400
|
xKeys = _formattedResultToSer.xKeys,
|
|
@@ -48372,7 +48670,9 @@ var BarChartV2View = function BarChartV2View(props) {
|
|
|
48372
48670
|
};
|
|
48373
48671
|
|
|
48374
48672
|
var BarChartV2 = function BarChartV2(props) {
|
|
48375
|
-
var
|
|
48673
|
+
var _props$component = props.component,
|
|
48674
|
+
results = _props$component.results,
|
|
48675
|
+
localFilters = _props$component.localFilters;
|
|
48376
48676
|
var dashboardBehaviour = props.dashboardBehaviour;
|
|
48377
48677
|
var _useState = React.useState(props.component.attributes),
|
|
48378
48678
|
attributes = _useState[0],
|
|
@@ -48383,18 +48683,17 @@ var BarChartV2 = function BarChartV2(props) {
|
|
|
48383
48683
|
setDrilldownSelections([]);
|
|
48384
48684
|
}
|
|
48385
48685
|
}, [JSON.stringify(props.component.attributes)]);
|
|
48386
|
-
var _useComponentEffect = useComponentEffect(attributes, props.dataSet, dashboardBehaviour.queryEngineConfig, {
|
|
48387
|
-
localFilters: localFilters,
|
|
48388
|
-
globalFilters: props.globalFilters
|
|
48389
|
-
}, props.updateComponentAttributes, props.runQueriesCallback, dashboardBehaviour.variables),
|
|
48390
|
-
queriesAreChanging = _useComponentEffect.queriesAreChanging,
|
|
48391
|
-
results = _useComponentEffect.results;
|
|
48392
48686
|
var _useDrilldownSelectio = useDrilldownSelection(results, attributes, function (newAttributes) {
|
|
48393
48687
|
return setAttributes(newAttributes);
|
|
48394
48688
|
}, props.dataSet, dashboardBehaviour.queryEngineConfig, props.component.attributes.type === 'barChartV2'),
|
|
48395
48689
|
onDrilldownChange = _useDrilldownSelectio.onDrilldownChange,
|
|
48396
48690
|
setDrilldownSelections = _useDrilldownSelectio.setDrilldownSelections,
|
|
48397
48691
|
drilldownSelections = _useDrilldownSelectio.drilldownSelections;
|
|
48692
|
+
var _useComponentEffect = useComponentEffect(attributes, props.dataSet, dashboardBehaviour.queryEngineConfig, {
|
|
48693
|
+
localFilters: localFilters,
|
|
48694
|
+
globalFilters: props.globalFilters
|
|
48695
|
+
}, props.updateComponentAttributes, props.runQueriesCallback, props.setResults, dashboardBehaviour.variables),
|
|
48696
|
+
queriesAreChanging = _useComponentEffect.queriesAreChanging;
|
|
48398
48697
|
return jsxRuntime.jsx(BarChartV2View, {
|
|
48399
48698
|
id: props.id,
|
|
48400
48699
|
attributes: attributes,
|
|
@@ -48556,16 +48855,16 @@ var LINE_QUERY_INDEX = 0,
|
|
|
48556
48855
|
BAR_QUERY_INDEX = 1;
|
|
48557
48856
|
var ComboChart$3 = function ComboChart(props) {
|
|
48558
48857
|
var _props$component = props.component,
|
|
48858
|
+
results = _props$component.results,
|
|
48559
48859
|
attributes = _props$component.attributes,
|
|
48560
48860
|
localFilters = _props$component.localFilters;
|
|
48561
48861
|
var _useDashboardContext = useDashboardContext(),
|
|
48562
48862
|
dashboard = _useDashboardContext.dashboard;
|
|
48563
|
-
var _useQueryEffect = useQueryEffect(attributes, props.runQueriesCallback, {
|
|
48863
|
+
var _useQueryEffect = useQueryEffect(attributes, props.runQueriesCallback, props.setResults, {
|
|
48564
48864
|
localFilters: localFilters,
|
|
48565
48865
|
globalFilters: props.globalFilters
|
|
48566
48866
|
}, props.dataSet, undefined, props.dashboardBehaviour.variables),
|
|
48567
|
-
queriesAreChanging = _useQueryEffect.queriesAreChanging
|
|
48568
|
-
results = _useQueryEffect.results;
|
|
48867
|
+
queriesAreChanging = _useQueryEffect.queriesAreChanging;
|
|
48569
48868
|
return jsxRuntime.jsx(ComboChartView$1, _extends({
|
|
48570
48869
|
id: props.id
|
|
48571
48870
|
}, attributes, {
|
|
@@ -49066,16 +49365,16 @@ var LINE_QUERY_INDEX$1 = 0,
|
|
|
49066
49365
|
BAR_QUERY_INDEX$1 = 1;
|
|
49067
49366
|
var ComboChartV2$1 = function ComboChartV2(props) {
|
|
49068
49367
|
var _props$component = props.component,
|
|
49368
|
+
results = _props$component.results,
|
|
49069
49369
|
attributes = _props$component.attributes,
|
|
49070
49370
|
localFilters = _props$component.localFilters;
|
|
49071
49371
|
var _useDashboardContext = useDashboardContext(),
|
|
49072
49372
|
dashboard = _useDashboardContext.dashboard;
|
|
49073
|
-
var _useQueryEffect = useQueryEffect(attributes, props.runQueriesCallback, {
|
|
49373
|
+
var _useQueryEffect = useQueryEffect(attributes, props.runQueriesCallback, props.setResults, {
|
|
49074
49374
|
localFilters: localFilters,
|
|
49075
49375
|
globalFilters: props.globalFilters
|
|
49076
49376
|
}, props.dataSet, undefined, props.dashboardBehaviour.variables),
|
|
49077
|
-
queriesAreChanging = _useQueryEffect.queriesAreChanging
|
|
49078
|
-
results = _useQueryEffect.results;
|
|
49377
|
+
queriesAreChanging = _useQueryEffect.queriesAreChanging;
|
|
49079
49378
|
return jsxRuntime.jsx(ComboChartView$2, _extends({
|
|
49080
49379
|
id: props.id
|
|
49081
49380
|
}, attributes, {
|
|
@@ -50867,6 +51166,9 @@ var DataTableRow = function DataTableRow(props) {
|
|
|
50867
51166
|
React.useEffect(function () {
|
|
50868
51167
|
return setSelectedRow(undefined);
|
|
50869
51168
|
}, [props.queriesAreChanging]);
|
|
51169
|
+
var _useState = React.useState(),
|
|
51170
|
+
results = _useState[0],
|
|
51171
|
+
_setResults = _useState[1];
|
|
50870
51172
|
var expanded = selectedRow !== undefined;
|
|
50871
51173
|
var hasDrilldown = drilldown && (drilldown == null ? void 0 : drilldown.length) > 0;
|
|
50872
51174
|
var _useDashboardBehaviou = useDashboardBehaviourContext(),
|
|
@@ -50892,7 +51194,13 @@ var DataTableRow = function DataTableRow(props) {
|
|
|
50892
51194
|
renderTableCell: handleRenderTableCell
|
|
50893
51195
|
}))
|
|
50894
51196
|
}), (props == null ? void 0 : props.drilldownInputProps) && expanded && hasDrilldown && jsxRuntime.jsx(DrilldownRow, {
|
|
51197
|
+
setResults: function setResults(value) {
|
|
51198
|
+
return _setResults({
|
|
51199
|
+
results: value
|
|
51200
|
+
});
|
|
51201
|
+
},
|
|
50895
51202
|
dataSet: dataSet,
|
|
51203
|
+
result: results == null ? void 0 : results.results[0],
|
|
50896
51204
|
drilldownInputProps: props == null ? void 0 : props.drilldownInputProps,
|
|
50897
51205
|
drilldown: drilldown,
|
|
50898
51206
|
selectedRow: selectedRow,
|
|
@@ -50905,10 +51213,10 @@ var DataTableRow = function DataTableRow(props) {
|
|
|
50905
51213
|
});
|
|
50906
51214
|
};
|
|
50907
51215
|
var DrilldownRow = function DrilldownRow(props) {
|
|
50908
|
-
var _tableRepresentation$;
|
|
50909
|
-
var
|
|
50910
|
-
offset =
|
|
50911
|
-
setOffset =
|
|
51216
|
+
var _props$result, _tableRepresentation$;
|
|
51217
|
+
var _useState2 = React.useState(0),
|
|
51218
|
+
offset = _useState2[0],
|
|
51219
|
+
setOffset = _useState2[1];
|
|
50912
51220
|
var _props$drilldownInput = props.drilldownInputProps,
|
|
50913
51221
|
component = _props$drilldownInput.component,
|
|
50914
51222
|
runQueriesCallback = _props$drilldownInput.runQueriesCallback;
|
|
@@ -50922,12 +51230,10 @@ var DrilldownRow = function DrilldownRow(props) {
|
|
|
50922
51230
|
variables = _useDashboardBehaviou2.variables,
|
|
50923
51231
|
valueAlias = _useDashboardBehaviou2.valueAlias;
|
|
50924
51232
|
var updatedAttributes = buildDrilldownAttributes(component.attributes, decodeId(props.drilldown[0].subsetDimension, queryEngineConfig), props.dimension, props.selectedRow, offset);
|
|
50925
|
-
|
|
50926
|
-
|
|
50927
|
-
|
|
50928
|
-
|
|
50929
|
-
_useQueryEffect$resul = _useQueryEffect.results,
|
|
50930
|
-
result = _useQueryEffect$resul[0];
|
|
51233
|
+
useQueryEffect(updatedAttributes, runQueriesCallback, props == null ? void 0 : props.setResults, {
|
|
51234
|
+
localFilters: component.localFilters,
|
|
51235
|
+
globalFilters: props.drilldownInputProps.globalFilters
|
|
51236
|
+
}, props.dataSet, undefined, variables);
|
|
50931
51237
|
var nullReplacementWithFieldId = function nullReplacementWithFieldId(fieldId) {
|
|
50932
51238
|
return checkForNullValue(props.dataSet.id, [{
|
|
50933
51239
|
field: fieldId,
|
|
@@ -50937,7 +51243,7 @@ var DrilldownRow = function DrilldownRow(props) {
|
|
|
50937
51243
|
var tableRepresentation = React.useMemo(function () {
|
|
50938
51244
|
return buildTableRepresentation({
|
|
50939
51245
|
type: updatedAttributes.type,
|
|
50940
|
-
result: result,
|
|
51246
|
+
result: props.result,
|
|
50941
51247
|
exportNames: updatedAttributes.exportNames,
|
|
50942
51248
|
prefixes: updatedAttributes.prefixes,
|
|
50943
51249
|
dateTimeFormat: updatedAttributes.dateTimeFormat,
|
|
@@ -50957,10 +51263,10 @@ var DrilldownRow = function DrilldownRow(props) {
|
|
|
50957
51263
|
hiddenFields: updatedAttributes.hiddenFields,
|
|
50958
51264
|
valueAlias: valueAlias
|
|
50959
51265
|
});
|
|
50960
|
-
}, [updatedAttributes.type, result, updatedAttributes.exportNames, updatedAttributes.prefixes, updatedAttributes.dateTimeFormat, dateTimeFormatOptions, updatedAttributes.numberFormat, numberFormatOptions, queryEngineConfig.supportedAggregates, queryEngineConfig.supportedTimeTruncFunctions, undefined, updatedAttributes.measure, updatedAttributes.xMeasure, updatedAttributes.yMeasure, updatedAttributes.dimension]);
|
|
51266
|
+
}, [updatedAttributes.type, props.result, updatedAttributes.exportNames, updatedAttributes.prefixes, updatedAttributes.dateTimeFormat, dateTimeFormatOptions, updatedAttributes.numberFormat, numberFormatOptions, queryEngineConfig.supportedAggregates, queryEngineConfig.supportedTimeTruncFunctions, undefined, updatedAttributes.measure, updatedAttributes.xMeasure, updatedAttributes.yMeasure, updatedAttributes.dimension]);
|
|
50961
51267
|
var TableFooter = React.useMemo(function () {
|
|
50962
51268
|
return jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
50963
|
-
children: result && jsxRuntime.jsx(Pagination, {
|
|
51269
|
+
children: props.result && jsxRuntime.jsx(Pagination, {
|
|
50964
51270
|
offset: offset,
|
|
50965
51271
|
limit: limit,
|
|
50966
51272
|
onNext: function onNext() {
|
|
@@ -50980,10 +51286,10 @@ var DrilldownRow = function DrilldownRow(props) {
|
|
|
50980
51286
|
textOverride: textOverride
|
|
50981
51287
|
})
|
|
50982
51288
|
});
|
|
50983
|
-
}, [offset, limit, result == null ? void 0 : result.content.length, setOffset, tableRepresentation == null ? void 0 : tableRepresentation.content.length]);
|
|
51289
|
+
}, [offset, limit, (_props$result = props.result) == null ? void 0 : _props$result.content.length, setOffset, tableRepresentation == null ? void 0 : tableRepresentation.content.length]);
|
|
50984
51290
|
var hidePaginations = offset === 0 && ((_tableRepresentation$ = tableRepresentation == null ? void 0 : tableRepresentation.content.length) != null ? _tableRepresentation$ : 0) < (limit != null ? limit : 0);
|
|
50985
51291
|
var columnsNumber = props == null ? void 0 : props.tableRowProps.row.length;
|
|
50986
|
-
if (isLoading(result)) return jsxRuntime.jsx(Table.TR, {
|
|
51292
|
+
if (isLoading(props.result)) return jsxRuntime.jsx(Table.TR, {
|
|
50987
51293
|
level: 2,
|
|
50988
51294
|
children: jsxRuntime.jsx(Table.TH, {
|
|
50989
51295
|
colSpan: columnsNumber,
|
|
@@ -50992,7 +51298,7 @@ var DrilldownRow = function DrilldownRow(props) {
|
|
|
50992
51298
|
})
|
|
50993
51299
|
})
|
|
50994
51300
|
});
|
|
50995
|
-
if (hasFailed(result)) return jsxRuntime.jsx(FailedToLoadDataNotice, {});
|
|
51301
|
+
if (hasFailed(props.result)) return jsxRuntime.jsx(FailedToLoadDataNotice, {});
|
|
50996
51302
|
return jsxRuntime.jsxs(React.Fragment, {
|
|
50997
51303
|
children: [(tableRepresentation == null ? void 0 : tableRepresentation.content) && jsxRuntime.jsx(React.Fragment, {
|
|
50998
51304
|
children: (tableRepresentation == null ? void 0 : tableRepresentation.content.length) > 0 ? jsxRuntime.jsx(React.Fragment, {
|
|
@@ -51448,14 +51754,14 @@ var DataTableView$1 = (function (props) {
|
|
|
51448
51754
|
|
|
51449
51755
|
var DataTable$2 = function DataTable(props) {
|
|
51450
51756
|
var _props$component = props.component,
|
|
51757
|
+
results = _props$component.results,
|
|
51451
51758
|
attributes = _props$component.attributes,
|
|
51452
51759
|
localFilters = _props$component.localFilters;
|
|
51453
|
-
var _useQueryEffect = useQueryEffect(attributes, props.runQueriesCallback, {
|
|
51760
|
+
var _useQueryEffect = useQueryEffect(attributes, props.runQueriesCallback, props.setResults, {
|
|
51454
51761
|
localFilters: localFilters,
|
|
51455
51762
|
globalFilters: props.globalFilters
|
|
51456
51763
|
}, props.dataSet, undefined, props.dashboardBehaviour.variables),
|
|
51457
|
-
queriesAreChanging = _useQueryEffect.queriesAreChanging
|
|
51458
|
-
results = _useQueryEffect.results;
|
|
51764
|
+
queriesAreChanging = _useQueryEffect.queriesAreChanging;
|
|
51459
51765
|
var onNext = function onNext() {
|
|
51460
51766
|
var _attributes$limit, _attributes$offset, _results$0$content$le, _results$;
|
|
51461
51767
|
if (!hasNext({
|
|
@@ -51717,13 +52023,14 @@ var FunnelChart$2 = function FunnelChart(props) {
|
|
|
51717
52023
|
var _useState = React.useState(props.component.attributes),
|
|
51718
52024
|
attributes = _useState[0],
|
|
51719
52025
|
setAttributes = _useState[1];
|
|
51720
|
-
var
|
|
52026
|
+
var _props$component = props.component,
|
|
52027
|
+
localFilters = _props$component.localFilters,
|
|
52028
|
+
results = _props$component.results;
|
|
51721
52029
|
var _useComponentEffect = useComponentEffect(attributes, props.dataSet, props.dashboardBehaviour.queryEngineConfig, {
|
|
51722
52030
|
localFilters: localFilters,
|
|
51723
52031
|
globalFilters: props.globalFilters
|
|
51724
|
-
}, props.updateComponentAttributes, props.runQueriesCallback),
|
|
51725
|
-
queriesAreChanging = _useComponentEffect.queriesAreChanging
|
|
51726
|
-
results = _useComponentEffect.results;
|
|
52032
|
+
}, props.updateComponentAttributes, props.runQueriesCallback, props.setResults),
|
|
52033
|
+
queriesAreChanging = _useComponentEffect.queriesAreChanging;
|
|
51727
52034
|
React.useEffect(function () {
|
|
51728
52035
|
if (!queriesAreChanging) {
|
|
51729
52036
|
setAttributes(props.component.attributes);
|
|
@@ -51833,14 +52140,14 @@ var View$2 = (function (props) {
|
|
|
51833
52140
|
|
|
51834
52141
|
var MercatorMap$3 = function MercatorMap(props) {
|
|
51835
52142
|
var _props$component = props.component,
|
|
52143
|
+
results = _props$component.results,
|
|
51836
52144
|
attributes = _props$component.attributes,
|
|
51837
52145
|
localFilters = _props$component.localFilters;
|
|
51838
|
-
var _useQueryEffect = useQueryEffect(attributes, props.runQueriesCallback, {
|
|
52146
|
+
var _useQueryEffect = useQueryEffect(attributes, props.runQueriesCallback, props.setResults, {
|
|
51839
52147
|
localFilters: localFilters,
|
|
51840
52148
|
globalFilters: props.globalFilters
|
|
51841
52149
|
}, props.dataSet, undefined, props.dashboardBehaviour.variables),
|
|
51842
|
-
queriesAreChanging = _useQueryEffect.queriesAreChanging
|
|
51843
|
-
results = _useQueryEffect.results;
|
|
52150
|
+
queriesAreChanging = _useQueryEffect.queriesAreChanging;
|
|
51844
52151
|
return jsxRuntime.jsx(View$2, _extends({}, attributes, {
|
|
51845
52152
|
id: props.id,
|
|
51846
52153
|
result: results && results[0],
|
|
@@ -52099,14 +52406,14 @@ ProgressView$1.defaultProps = defaultProps$9;
|
|
|
52099
52406
|
var Progress$2 = function Progress(props) {
|
|
52100
52407
|
var _props$dashboardBehav;
|
|
52101
52408
|
var _props$component = props.component,
|
|
52409
|
+
results = _props$component.results,
|
|
52102
52410
|
attributes = _props$component.attributes,
|
|
52103
52411
|
localFilters = _props$component.localFilters;
|
|
52104
|
-
var _useQueryEffect = useQueryEffect(attributes, props.runQueriesCallback, {
|
|
52412
|
+
var _useQueryEffect = useQueryEffect(attributes, props.runQueriesCallback, props.setResults, {
|
|
52105
52413
|
localFilters: localFilters,
|
|
52106
52414
|
globalFilters: props.globalFilters
|
|
52107
52415
|
}, props.dataSet, undefined, props.dashboardBehaviour.variables),
|
|
52108
|
-
queriesAreChanging = _useQueryEffect.queriesAreChanging
|
|
52109
|
-
results = _useQueryEffect.results;
|
|
52416
|
+
queriesAreChanging = _useQueryEffect.queriesAreChanging;
|
|
52110
52417
|
return jsxRuntime.jsx(ProgressView$1, _extends({}, attributes, {
|
|
52111
52418
|
id: props.id,
|
|
52112
52419
|
dataSet: props.dataSet,
|
|
@@ -52313,7 +52620,7 @@ var buildRadarChartRepresentation = function buildRadarChartRepresentation(_ref)
|
|
|
52313
52620
|
}).formattedValue;
|
|
52314
52621
|
};
|
|
52315
52622
|
var xScaleDataType = (xKeyField == null ? void 0 : xKeyField.outputDataType) || 'string';
|
|
52316
|
-
var _formattedResultToSer = formattedResultToSeries
|
|
52623
|
+
var _formattedResultToSer = formattedResultToSeries(formattedResult, pivotConfig, seriesLabelFormatter),
|
|
52317
52624
|
keys = _formattedResultToSer.keys,
|
|
52318
52625
|
yKeys = _formattedResultToSer.yKeys,
|
|
52319
52626
|
xKeys = _formattedResultToSer.xKeys,
|
|
@@ -52595,17 +52902,18 @@ var RadarChart$3 = function RadarChart(_ref) {
|
|
|
52595
52902
|
runQueriesCallback = _ref.runQueriesCallback,
|
|
52596
52903
|
setLocalFilters = _ref.setLocalFilters,
|
|
52597
52904
|
_setPartialAttributes = _ref.setPartialAttributes,
|
|
52905
|
+
setResults = _ref.setResults,
|
|
52598
52906
|
updateComponentAttributes = _ref.updateComponentAttributes;
|
|
52599
|
-
var localFilters = component.localFilters
|
|
52907
|
+
var localFilters = component.localFilters,
|
|
52908
|
+
results = component.results;
|
|
52600
52909
|
var _useState = React.useState(component.attributes),
|
|
52601
52910
|
attributes = _useState[0],
|
|
52602
52911
|
setAttributes = _useState[1];
|
|
52603
52912
|
var _useComponentEffect = useComponentEffect(component.attributes, dataSet, dashboardBehaviour.queryEngineConfig, {
|
|
52604
52913
|
localFilters: localFilters,
|
|
52605
52914
|
globalFilters: globalFilters
|
|
52606
|
-
}, updateComponentAttributes, runQueriesCallback, dashboardBehaviour.variables),
|
|
52607
|
-
queriesAreChanging = _useComponentEffect.queriesAreChanging
|
|
52608
|
-
results = _useComponentEffect.results;
|
|
52915
|
+
}, updateComponentAttributes, runQueriesCallback, setResults, dashboardBehaviour.variables),
|
|
52916
|
+
queriesAreChanging = _useComponentEffect.queriesAreChanging;
|
|
52609
52917
|
React.useEffect(function () {
|
|
52610
52918
|
if (!queriesAreChanging) {
|
|
52611
52919
|
setAttributes(component.attributes);
|
|
@@ -52678,14 +52986,14 @@ var RichText$2 = function RichText(_props) {
|
|
|
52678
52986
|
var SingleStat$2 = function SingleStat(props) {
|
|
52679
52987
|
var _props$dashboardBehav;
|
|
52680
52988
|
var _props$component = props.component,
|
|
52989
|
+
results = _props$component.results,
|
|
52681
52990
|
attributes = _props$component.attributes,
|
|
52682
52991
|
localFilters = _props$component.localFilters;
|
|
52683
52992
|
var _useComponentEffect = useComponentEffect(attributes, props.dataSet, props.dashboardBehaviour.queryEngineConfig, {
|
|
52684
52993
|
localFilters: localFilters,
|
|
52685
52994
|
globalFilters: props.globalFilters
|
|
52686
|
-
}, props.updateComponentAttributes, props.runQueriesCallback, props.dashboardBehaviour.variables),
|
|
52687
|
-
queriesAreChanging = _useComponentEffect.queriesAreChanging
|
|
52688
|
-
results = _useComponentEffect.results;
|
|
52995
|
+
}, props.updateComponentAttributes, props.runQueriesCallback, props.setResults, props.dashboardBehaviour.variables),
|
|
52996
|
+
queriesAreChanging = _useComponentEffect.queriesAreChanging;
|
|
52689
52997
|
return jsxRuntime.jsx(SingleStatView, _extends({}, attributes, {
|
|
52690
52998
|
id: props.id,
|
|
52691
52999
|
dataSet: props.dataSet,
|
|
@@ -52844,10 +53152,8 @@ var SunburstChartView = function SunburstChartView(props) {
|
|
|
52844
53152
|
setTooltipLabel = _useState5[1];
|
|
52845
53153
|
var xScale = d3Scale.scaleLinear().domain(xDomain).range(xRange);
|
|
52846
53154
|
var yScale = d3Scale.scaleSqrt().domain(yDomain).range(yRange);
|
|
52847
|
-
var width = props.width * 3 /
|
|
52848
|
-
var height =
|
|
52849
|
-
var minDimension = Math.min(props.width, props.height);
|
|
52850
|
-
var centeredRatio = minDimension / 2.5;
|
|
53155
|
+
var width = props.width * 3 / 5;
|
|
53156
|
+
var height = 500;
|
|
52851
53157
|
var sunburstChartComponent = getComponentInterface(props.attributes.type);
|
|
52852
53158
|
var headerProps = {
|
|
52853
53159
|
displayTitle: props.attributes.displayTitle,
|
|
@@ -52867,8 +53173,8 @@ var SunburstChartView = function SunburstChartView(props) {
|
|
|
52867
53173
|
order: props.attributes.order
|
|
52868
53174
|
};
|
|
52869
53175
|
React.useEffect(function () {
|
|
52870
|
-
setYRange([yRange[0],
|
|
52871
|
-
}, [
|
|
53176
|
+
setYRange([yRange[0], width / 2]);
|
|
53177
|
+
}, [width]);
|
|
52872
53178
|
var arc = d3Shape.arc().startAngle(function (d) {
|
|
52873
53179
|
return Math.max(0, Math.min(2 * Math.PI, xScale(d.x0)));
|
|
52874
53180
|
}).endAngle(function (d) {
|
|
@@ -52881,7 +53187,7 @@ var SunburstChartView = function SunburstChartView(props) {
|
|
|
52881
53187
|
var handleClick = function handleClick(d) {
|
|
52882
53188
|
setXDomain([d.x0, d.x1]);
|
|
52883
53189
|
setYDomain([d.y0, 1]);
|
|
52884
|
-
setYRange([d.y0 ? 20 : 0,
|
|
53190
|
+
setYRange([d.y0 ? 20 : 0, width / 2]);
|
|
52885
53191
|
};
|
|
52886
53192
|
var handleUpdate = function handleUpdate(t, xd, yd, yr) {
|
|
52887
53193
|
xScale.domain(xd(t));
|
|
@@ -52968,7 +53274,7 @@ var SunburstChartView = function SunburstChartView(props) {
|
|
|
52968
53274
|
height: height,
|
|
52969
53275
|
children: jsxRuntime.jsx(Partition, {
|
|
52970
53276
|
top: 0,
|
|
52971
|
-
left: centerX
|
|
53277
|
+
left: centerX * 2 / 3,
|
|
52972
53278
|
root: root,
|
|
52973
53279
|
children: jsxRuntime.jsx(web.Spring, {
|
|
52974
53280
|
reset: true,
|
|
@@ -53048,12 +53354,13 @@ var SunburstChartView = function SunburstChartView(props) {
|
|
|
53048
53354
|
};
|
|
53049
53355
|
|
|
53050
53356
|
var SunburstChart$2 = function SunburstChart(props) {
|
|
53051
|
-
var
|
|
53052
|
-
|
|
53053
|
-
|
|
53054
|
-
|
|
53055
|
-
|
|
53056
|
-
|
|
53357
|
+
var _props$component = props.component,
|
|
53358
|
+
results = _props$component.results,
|
|
53359
|
+
attributes = _props$component.attributes;
|
|
53360
|
+
useQueryEffect(attributes, props.runQueriesCallback, props.setResults, {
|
|
53361
|
+
localFilters: props.component.localFilters,
|
|
53362
|
+
globalFilters: props.globalFilters
|
|
53363
|
+
}, props.dataSet, undefined, props.dashboardBehaviour.variables);
|
|
53057
53364
|
var params = {
|
|
53058
53365
|
defaultFormats: props.dashboardBehaviour.defaultFormats,
|
|
53059
53366
|
dateTimeFormatOptions: props.dashboardBehaviour.dateTimeFormatOptions,
|
|
@@ -53084,246 +53391,6 @@ var SunburstChart$2 = function SunburstChart(props) {
|
|
|
53084
53391
|
});
|
|
53085
53392
|
};
|
|
53086
53393
|
|
|
53087
|
-
function getNiceInterval$3(interval) {
|
|
53088
|
-
// Round the interval to a "nice" value (1, 2, 5, etc.)
|
|
53089
|
-
var exponent = Math.floor(Math.log10(interval));
|
|
53090
|
-
var fraction = interval / Math.pow(10, exponent);
|
|
53091
|
-
var niceFraction;
|
|
53092
|
-
if (fraction <= 1.5) niceFraction = 1;else if (fraction <= 3) niceFraction = 2;else if (fraction <= 7) niceFraction = 5;else niceFraction = 10;
|
|
53093
|
-
return niceFraction * Math.pow(10, exponent);
|
|
53094
|
-
}
|
|
53095
|
-
|
|
53096
|
-
var getYTicks = function getYTicks(_ref) {
|
|
53097
|
-
var yMinValue = _ref.yMinValue,
|
|
53098
|
-
yMaxValue = _ref.yMaxValue,
|
|
53099
|
-
approxYAxisLabelCount = _ref.approxYAxisLabelCount,
|
|
53100
|
-
formattingFunctionY = _ref.formattingFunctionY;
|
|
53101
|
-
var yTicks = [];
|
|
53102
|
-
var yTickInterval = getNiceInterval$3((yMaxValue - yMinValue) / (approxYAxisLabelCount - 1));
|
|
53103
|
-
for (var i = 0; i < approxYAxisLabelCount; i++) {
|
|
53104
|
-
var value = (yMinValue + i) * yTickInterval;
|
|
53105
|
-
var formattedValue = formattingFunctionY(value);
|
|
53106
|
-
yTicks.push({
|
|
53107
|
-
value: value,
|
|
53108
|
-
formattedValue: formattedValue,
|
|
53109
|
-
scaleValue: value
|
|
53110
|
-
});
|
|
53111
|
-
}
|
|
53112
|
-
return yTicks;
|
|
53113
|
-
};
|
|
53114
|
-
|
|
53115
|
-
var getRepresentationData = function getRepresentationData(_ref) {
|
|
53116
|
-
var content = _ref.content,
|
|
53117
|
-
xKey = _ref.xKey,
|
|
53118
|
-
yKey = _ref.yKey,
|
|
53119
|
-
approxYAxisLabelCount = _ref.approxYAxisLabelCount,
|
|
53120
|
-
showTotalBar = _ref.showTotalBar,
|
|
53121
|
-
formattingFunctionY = _ref.formattingFunctionY;
|
|
53122
|
-
var data = [];
|
|
53123
|
-
var steps = [];
|
|
53124
|
-
var xTicks = [];
|
|
53125
|
-
var yValueSum = 0;
|
|
53126
|
-
var yMinValue = 0;
|
|
53127
|
-
var yMaxValue = 0;
|
|
53128
|
-
content.forEach(function (dataItem, index) {
|
|
53129
|
-
var _dataItem$xValueIndex, _dataItem$xValueIndex2, _dataItem$yValueIndex, _dataItem$yValueIndex2, _data$push;
|
|
53130
|
-
var xValueIndex = 0;
|
|
53131
|
-
var yValueIndex = 1;
|
|
53132
|
-
var xValue = (_dataItem$xValueIndex = dataItem[xValueIndex]) == null ? void 0 : _dataItem$xValueIndex.value;
|
|
53133
|
-
var xFormattedValue = (_dataItem$xValueIndex2 = dataItem[xValueIndex]) == null ? void 0 : _dataItem$xValueIndex2.formattedValue;
|
|
53134
|
-
var yValue = Number((_dataItem$yValueIndex = (_dataItem$yValueIndex2 = dataItem[yValueIndex]) == null ? void 0 : _dataItem$yValueIndex2.value) != null ? _dataItem$yValueIndex : 0);
|
|
53135
|
-
var yValueDiff = yValue;
|
|
53136
|
-
if (index > 0) {
|
|
53137
|
-
var _content$yValueIndex;
|
|
53138
|
-
var prevYValue = Number((_content$yValueIndex = content[index - 1][yValueIndex]) == null ? void 0 : _content$yValueIndex.value);
|
|
53139
|
-
yValueDiff = yValue - prevYValue;
|
|
53140
|
-
}
|
|
53141
|
-
var prevYValueSum = yValueSum;
|
|
53142
|
-
yValueSum += yValueDiff;
|
|
53143
|
-
data.push((_data$push = {}, _data$push[xKey] = {
|
|
53144
|
-
value: xValue,
|
|
53145
|
-
formattedValue: xFormattedValue
|
|
53146
|
-
}, _data$push[yKey] = {
|
|
53147
|
-
value: yValueDiff,
|
|
53148
|
-
formattedValue: formattingFunctionY(yValueDiff)
|
|
53149
|
-
}, _data$push));
|
|
53150
|
-
xTicks.push({
|
|
53151
|
-
value: xValue,
|
|
53152
|
-
formattedValue: xFormattedValue,
|
|
53153
|
-
scaleValue: xValue
|
|
53154
|
-
});
|
|
53155
|
-
steps.push({
|
|
53156
|
-
x: xValue,
|
|
53157
|
-
y: yValue,
|
|
53158
|
-
start: prevYValueSum,
|
|
53159
|
-
end: yValueSum
|
|
53160
|
-
});
|
|
53161
|
-
yMinValue = Math.floor(Math.min(yMinValue, yValue));
|
|
53162
|
-
yMaxValue = Math.ceil(Math.max(yMaxValue, yValue));
|
|
53163
|
-
});
|
|
53164
|
-
if (showTotalBar) {
|
|
53165
|
-
var _data$push2;
|
|
53166
|
-
var totalLabel = 'Total';
|
|
53167
|
-
steps.push({
|
|
53168
|
-
x: totalLabel,
|
|
53169
|
-
y: yValueSum,
|
|
53170
|
-
start: 0,
|
|
53171
|
-
end: yValueSum
|
|
53172
|
-
});
|
|
53173
|
-
data.push((_data$push2 = {}, _data$push2[xKey] = {
|
|
53174
|
-
value: totalLabel,
|
|
53175
|
-
formattedValue: totalLabel
|
|
53176
|
-
}, _data$push2[yKey] = {
|
|
53177
|
-
value: yValueSum,
|
|
53178
|
-
formattedValue: formattingFunctionY(yValueSum)
|
|
53179
|
-
}, _data$push2));
|
|
53180
|
-
xTicks.push({
|
|
53181
|
-
value: totalLabel,
|
|
53182
|
-
formattedValue: totalLabel,
|
|
53183
|
-
scaleValue: totalLabel
|
|
53184
|
-
});
|
|
53185
|
-
}
|
|
53186
|
-
var yTicks = getYTicks({
|
|
53187
|
-
yMinValue: yMinValue,
|
|
53188
|
-
yMaxValue: yMaxValue,
|
|
53189
|
-
approxYAxisLabelCount: approxYAxisLabelCount,
|
|
53190
|
-
formattingFunctionY: formattingFunctionY
|
|
53191
|
-
});
|
|
53192
|
-
return {
|
|
53193
|
-
data: data,
|
|
53194
|
-
steps: steps,
|
|
53195
|
-
xTicks: xTicks,
|
|
53196
|
-
yTicks: yTicks,
|
|
53197
|
-
yMinValue: yMinValue,
|
|
53198
|
-
yMaxValue: yMaxValue
|
|
53199
|
-
};
|
|
53200
|
-
};
|
|
53201
|
-
|
|
53202
|
-
var buildWaterfallChartRepresentation = function buildWaterfallChartRepresentation(_ref) {
|
|
53203
|
-
var _formattedResult$fiel, _formattedResult$fiel2, _axisTitles$x, _axisTitles$y;
|
|
53204
|
-
var approxYAxisLabelCount = _ref.approxYAxisLabelCount,
|
|
53205
|
-
axisTitles = _ref.axisTitles,
|
|
53206
|
-
dateTimeFormatOptions = _ref.dateTimeFormatOptions,
|
|
53207
|
-
defaultFormats = _ref.defaultFormats,
|
|
53208
|
-
nullValue = _ref.nullValue,
|
|
53209
|
-
numberFormatOptions = _ref.numberFormatOptions,
|
|
53210
|
-
pivotConfig = _ref.pivotConfig,
|
|
53211
|
-
result = _ref.result,
|
|
53212
|
-
showTotalBar = _ref.showTotalBar,
|
|
53213
|
-
_valueAlias = _ref.valueAlias,
|
|
53214
|
-
xAxisFormat = _ref.xAxisFormat,
|
|
53215
|
-
xAxisPrefix = _ref.xAxisPrefix,
|
|
53216
|
-
xAxisPostfix = _ref.xAxisPostfix,
|
|
53217
|
-
yAxisFormat = _ref.yAxisFormat,
|
|
53218
|
-
yAxisPrefix = _ref.yAxisPrefix,
|
|
53219
|
-
yAxisPostfix = _ref.yAxisPostfix;
|
|
53220
|
-
var activeDateTimeFormats = {};
|
|
53221
|
-
var _buildFieldFormatMaps = buildFieldFormatMaps(result, pivotConfig, xAxisPrefix, xAxisPostfix, xAxisFormat, yAxisPrefix, yAxisPostfix, yAxisFormat, nullValue, numberFormatOptions),
|
|
53222
|
-
allPrefixes = _buildFieldFormatMaps.allPrefixes,
|
|
53223
|
-
allPostfixes = _buildFieldFormatMaps.allPostfixes,
|
|
53224
|
-
nullValues = _buildFieldFormatMaps.nullValues,
|
|
53225
|
-
activeNumberFormats = _buildFieldFormatMaps.activeNumberFormats;
|
|
53226
|
-
var params = {
|
|
53227
|
-
defaultFormats: defaultFormats,
|
|
53228
|
-
dateTimeFormatOptions: dateTimeFormatOptions,
|
|
53229
|
-
numberFormatOptions: numberFormatOptions,
|
|
53230
|
-
valueAlias: function valueAlias(params) {
|
|
53231
|
-
if (typeof _valueAlias === 'function') {
|
|
53232
|
-
return String(_valueAlias({
|
|
53233
|
-
fieldId: id({
|
|
53234
|
-
field: params.fieldId,
|
|
53235
|
-
"function": params["function"]
|
|
53236
|
-
}),
|
|
53237
|
-
value: params.value
|
|
53238
|
-
}));
|
|
53239
|
-
}
|
|
53240
|
-
return undefined;
|
|
53241
|
-
},
|
|
53242
|
-
nullValue: nullValues,
|
|
53243
|
-
prefixes: allPrefixes,
|
|
53244
|
-
postfixes: allPostfixes,
|
|
53245
|
-
activeNumberFormats: activeNumberFormats,
|
|
53246
|
-
activeDateTimeFormats: activeDateTimeFormats
|
|
53247
|
-
};
|
|
53248
|
-
var formattedResult = formatResult(result, params);
|
|
53249
|
-
var formattingFunctionY = function formattingFunctionY(value) {
|
|
53250
|
-
// Use any y axis field as they are all formatted in the same way (for now...);
|
|
53251
|
-
var nonPivotField = formattedResult.fields.find(function (resultField) {
|
|
53252
|
-
return ![].concat(pivotConfig.x, pivotConfig.y).includes(resultField.id);
|
|
53253
|
-
});
|
|
53254
|
-
if (!nonPivotField) return '';
|
|
53255
|
-
return formattedResult.formatterFunc(value, {
|
|
53256
|
-
fieldId: nonPivotField.fieldId,
|
|
53257
|
-
"function": nonPivotField["function"],
|
|
53258
|
-
outputDataType: nonPivotField.outputDataType
|
|
53259
|
-
}).formattedValue;
|
|
53260
|
-
};
|
|
53261
|
-
var keys = formattedResult.fields.map(function (field) {
|
|
53262
|
-
var _ref2;
|
|
53263
|
-
var key = field.fieldId;
|
|
53264
|
-
var keyFormatted = field.publicName;
|
|
53265
|
-
var dataType = field.dataType;
|
|
53266
|
-
return _ref2 = {}, _ref2[key] = {
|
|
53267
|
-
key: key,
|
|
53268
|
-
keyFormatted: keyFormatted,
|
|
53269
|
-
dataType: dataType
|
|
53270
|
-
}, _ref2;
|
|
53271
|
-
});
|
|
53272
|
-
var xKey = (_formattedResult$fiel = formattedResult.fields[0]) == null ? void 0 : _formattedResult$fiel.fieldId;
|
|
53273
|
-
var yKey = (_formattedResult$fiel2 = formattedResult.fields[1]) == null ? void 0 : _formattedResult$fiel2.fieldId;
|
|
53274
|
-
var content = formattedResult.content;
|
|
53275
|
-
var _getRepresentationDat = getRepresentationData({
|
|
53276
|
-
content: content,
|
|
53277
|
-
xKey: xKey,
|
|
53278
|
-
yKey: yKey,
|
|
53279
|
-
approxYAxisLabelCount: approxYAxisLabelCount,
|
|
53280
|
-
showTotalBar: showTotalBar,
|
|
53281
|
-
formattingFunctionY: formattingFunctionY
|
|
53282
|
-
}),
|
|
53283
|
-
data = _getRepresentationDat.data,
|
|
53284
|
-
steps = _getRepresentationDat.steps,
|
|
53285
|
-
xTicks = _getRepresentationDat.xTicks,
|
|
53286
|
-
yTicks = _getRepresentationDat.yTicks,
|
|
53287
|
-
yMinValue = _getRepresentationDat.yMinValue,
|
|
53288
|
-
yMaxValue = _getRepresentationDat.yMaxValue;
|
|
53289
|
-
var chartRepresentation = {
|
|
53290
|
-
keys: _extends({}, keys[0], keys[1]),
|
|
53291
|
-
x: {
|
|
53292
|
-
title: (_axisTitles$x = axisTitles == null ? void 0 : axisTitles.x) != null ? _axisTitles$x : null,
|
|
53293
|
-
ticks: xTicks,
|
|
53294
|
-
prefix: xAxisPrefix,
|
|
53295
|
-
postfix: xAxisPostfix,
|
|
53296
|
-
key: xKey,
|
|
53297
|
-
scale: {
|
|
53298
|
-
dataType: 'string',
|
|
53299
|
-
key: xKey,
|
|
53300
|
-
ordering: null,
|
|
53301
|
-
min: null,
|
|
53302
|
-
max: null
|
|
53303
|
-
}
|
|
53304
|
-
},
|
|
53305
|
-
y: {
|
|
53306
|
-
title: (_axisTitles$y = axisTitles == null ? void 0 : axisTitles.y) != null ? _axisTitles$y : null,
|
|
53307
|
-
ticks: yTicks,
|
|
53308
|
-
key: yKey,
|
|
53309
|
-
prefix: yAxisPrefix,
|
|
53310
|
-
postfix: yAxisPostfix,
|
|
53311
|
-
scale: {
|
|
53312
|
-
dataType: 'number',
|
|
53313
|
-
key: null,
|
|
53314
|
-
ordering: 'asc',
|
|
53315
|
-
min: yMinValue,
|
|
53316
|
-
max: yMaxValue
|
|
53317
|
-
}
|
|
53318
|
-
},
|
|
53319
|
-
data: data
|
|
53320
|
-
};
|
|
53321
|
-
return {
|
|
53322
|
-
waterfallChartRepresentation: chartRepresentation,
|
|
53323
|
-
waterfallChartSteps: steps
|
|
53324
|
-
};
|
|
53325
|
-
};
|
|
53326
|
-
|
|
53327
53394
|
var ASSUMED_AVERAGE_CHAR_WIDTH$2 = 8.8;
|
|
53328
53395
|
function calculateWordWidth$1(word, avgCharWidth) {
|
|
53329
53396
|
if (avgCharWidth === void 0) {
|
|
@@ -53333,7 +53400,7 @@ function calculateWordWidth$1(word, avgCharWidth) {
|
|
|
53333
53400
|
}
|
|
53334
53401
|
|
|
53335
53402
|
/** Reduce width proportionally to simulate spacing / padding between ticks. */
|
|
53336
|
-
var widthWithSpacing = function widthWithSpacing(width) {
|
|
53403
|
+
var widthWithSpacing$1 = function widthWithSpacing(width) {
|
|
53337
53404
|
var THIRTY_PERCENT = 0.3;
|
|
53338
53405
|
return width - width * THIRTY_PERCENT;
|
|
53339
53406
|
};
|
|
@@ -53347,7 +53414,7 @@ function howManyTicksFitInWidth$1(ticks, maxWidth, avgCharWidth) {
|
|
|
53347
53414
|
var tick = _step.value;
|
|
53348
53415
|
var word = (tick == null ? void 0 : tick.formattedValue) || '';
|
|
53349
53416
|
var wordWidth = calculateWordWidth$1(word, avgCharWidth);
|
|
53350
|
-
if (currentWidth + wordWidth <= widthWithSpacing(maxWidth)) {
|
|
53417
|
+
if (currentWidth + wordWidth <= widthWithSpacing$1(maxWidth)) {
|
|
53351
53418
|
fittedTicks.push(tick);
|
|
53352
53419
|
currentWidth += wordWidth + avgCharWidth; // Add space between words
|
|
53353
53420
|
} else {
|
|
@@ -53425,7 +53492,7 @@ var Tooltip$2 = function Tooltip(_ref) {
|
|
|
53425
53492
|
if (!showTooltip || !tooltipData) return null;
|
|
53426
53493
|
var value = tooltipData[yKey].value;
|
|
53427
53494
|
var isPositiveValue = Number(value) > 0;
|
|
53428
|
-
return
|
|
53495
|
+
return jsxRuntime.jsx(tooltip$3.TooltipWithBounds, {
|
|
53429
53496
|
left: tooltipLeft,
|
|
53430
53497
|
top: tooltipTop,
|
|
53431
53498
|
style: theme,
|
|
@@ -53460,7 +53527,7 @@ var Tooltip$2 = function Tooltip(_ref) {
|
|
|
53460
53527
|
})]
|
|
53461
53528
|
})]
|
|
53462
53529
|
})
|
|
53463
|
-
}, Math.random())
|
|
53530
|
+
}, Math.random());
|
|
53464
53531
|
};
|
|
53465
53532
|
var IconNarrowRight$1 = function IconNarrowRight() {
|
|
53466
53533
|
var style = {
|
|
@@ -53468,7 +53535,7 @@ var IconNarrowRight$1 = function IconNarrowRight() {
|
|
|
53468
53535
|
height: 20,
|
|
53469
53536
|
display: 'block'
|
|
53470
53537
|
};
|
|
53471
|
-
var fill =
|
|
53538
|
+
var fill = "#12B76A";
|
|
53472
53539
|
return jsxRuntime.jsx("svg", {
|
|
53473
53540
|
fill: "none",
|
|
53474
53541
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -53488,7 +53555,7 @@ var IconTrendingDown$1 = function IconTrendingDown() {
|
|
|
53488
53555
|
height: 20,
|
|
53489
53556
|
display: 'block'
|
|
53490
53557
|
};
|
|
53491
|
-
var fill =
|
|
53558
|
+
var fill = "#F04438";
|
|
53492
53559
|
return jsxRuntime.jsx("svg", {
|
|
53493
53560
|
fill: "none",
|
|
53494
53561
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -53546,7 +53613,7 @@ var Legend$2 = function Legend(_ref) {
|
|
|
53546
53613
|
});
|
|
53547
53614
|
};
|
|
53548
53615
|
|
|
53549
|
-
var _excluded$
|
|
53616
|
+
var _excluded$h = ["formattedValue"],
|
|
53550
53617
|
_excluded2$4 = ["formattedValue"];
|
|
53551
53618
|
var AXIS_TITLE_STYLES$1 = {
|
|
53552
53619
|
opacity: '0.75',
|
|
@@ -53656,8 +53723,8 @@ var WaterfallChart$2 = function WaterfallChart(_ref) {
|
|
|
53656
53723
|
return Number(tick.value);
|
|
53657
53724
|
});
|
|
53658
53725
|
var xTickValues = formattedChartDataForBarChart.x.ticks.length > 0 ? formattedChartDataForBarChart.x.ticks.map(function (tick) {
|
|
53659
|
-
var
|
|
53660
|
-
return (
|
|
53726
|
+
var _tick$scaleValue;
|
|
53727
|
+
return (_tick$scaleValue = tick.scaleValue) != null ? _tick$scaleValue : 0;
|
|
53661
53728
|
}) : undefined;
|
|
53662
53729
|
var handleMouseMove = React.useCallback(function (event) {
|
|
53663
53730
|
if (!xKey || !xScaleKey || xScale === null) return;
|
|
@@ -53690,7 +53757,7 @@ var WaterfallChart$2 = function WaterfallChart(_ref) {
|
|
|
53690
53757
|
tick = matchingTickValue || null;
|
|
53691
53758
|
} else {
|
|
53692
53759
|
var _matchingTickValue = formattedChartDataForBarChart.x.ticks.find(function (tickValue) {
|
|
53693
|
-
return
|
|
53760
|
+
return tickValue.scaleValue === value;
|
|
53694
53761
|
});
|
|
53695
53762
|
tick = _matchingTickValue || null;
|
|
53696
53763
|
}
|
|
@@ -53715,10 +53782,10 @@ var WaterfallChart$2 = function WaterfallChart(_ref) {
|
|
|
53715
53782
|
return '';
|
|
53716
53783
|
}, [formattedChartDataForBarChart.y.ticks]);
|
|
53717
53784
|
var getBarGroupPosition = React.useCallback(function (d) {
|
|
53718
|
-
if (xScaleKey == null || d == null) return
|
|
53785
|
+
if (xScaleKey == null || d == null) return;
|
|
53719
53786
|
var xValue = d[xScaleKey];
|
|
53720
|
-
if (xScaleDataType === 'string') return
|
|
53721
|
-
return
|
|
53787
|
+
if (xScaleDataType === 'string') return xValue;
|
|
53788
|
+
return;
|
|
53722
53789
|
}, [xScaleKey, xScaleDataType]);
|
|
53723
53790
|
if (width === 0 || height === 0 || xScale == null) return null;
|
|
53724
53791
|
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
@@ -53756,7 +53823,7 @@ var WaterfallChart$2 = function WaterfallChart(_ref) {
|
|
|
53756
53823
|
tickValues: xTickValues,
|
|
53757
53824
|
tickComponent: function tickComponent(_ref2) {
|
|
53758
53825
|
var formattedValue = _ref2.formattedValue,
|
|
53759
|
-
tickProps = _objectWithoutPropertiesLoose(_ref2, _excluded$
|
|
53826
|
+
tickProps = _objectWithoutPropertiesLoose(_ref2, _excluded$h);
|
|
53760
53827
|
return jsxRuntime.jsx(text$3.Text, _extends({
|
|
53761
53828
|
style: themeCSS.labels
|
|
53762
53829
|
}, tickProps, {
|
|
@@ -53868,6 +53935,245 @@ var Bar$2 = function Bar(_ref4) {
|
|
|
53868
53935
|
});
|
|
53869
53936
|
};
|
|
53870
53937
|
|
|
53938
|
+
function getNiceInterval$3(interval) {
|
|
53939
|
+
// Round the interval to a "nice" value (1, 2, 5, etc.)
|
|
53940
|
+
var exponent = Math.floor(Math.log10(interval));
|
|
53941
|
+
var fraction = interval / Math.pow(10, exponent);
|
|
53942
|
+
var niceFraction;
|
|
53943
|
+
if (fraction <= 1.5) niceFraction = 1;else if (fraction <= 3) niceFraction = 2;else if (fraction <= 7) niceFraction = 5;else niceFraction = 10;
|
|
53944
|
+
return niceFraction * Math.pow(10, exponent);
|
|
53945
|
+
}
|
|
53946
|
+
|
|
53947
|
+
var getYTicks = function getYTicks(_ref) {
|
|
53948
|
+
var yMinValue = _ref.yMinValue,
|
|
53949
|
+
yMaxValue = _ref.yMaxValue,
|
|
53950
|
+
approxYAxisLabelCount = _ref.approxYAxisLabelCount,
|
|
53951
|
+
formattingFunctionY = _ref.formattingFunctionY;
|
|
53952
|
+
var yTicks = [];
|
|
53953
|
+
var yTickInterval = getNiceInterval$3((yMaxValue - yMinValue) / (approxYAxisLabelCount - 1));
|
|
53954
|
+
for (var i = 0; i < approxYAxisLabelCount; i++) {
|
|
53955
|
+
var value = (yMinValue + i) * yTickInterval;
|
|
53956
|
+
var formattedValue = formattingFunctionY(value);
|
|
53957
|
+
yTicks.push({
|
|
53958
|
+
value: value,
|
|
53959
|
+
formattedValue: formattedValue,
|
|
53960
|
+
scaleValue: value
|
|
53961
|
+
});
|
|
53962
|
+
}
|
|
53963
|
+
return yTicks;
|
|
53964
|
+
};
|
|
53965
|
+
|
|
53966
|
+
var getRepresentationData = function getRepresentationData(_ref) {
|
|
53967
|
+
var content = _ref.content,
|
|
53968
|
+
xKey = _ref.xKey,
|
|
53969
|
+
yKey = _ref.yKey,
|
|
53970
|
+
approxYAxisLabelCount = _ref.approxYAxisLabelCount,
|
|
53971
|
+
showTotalBar = _ref.showTotalBar,
|
|
53972
|
+
formattingFunctionY = _ref.formattingFunctionY;
|
|
53973
|
+
var data = [];
|
|
53974
|
+
var steps = [];
|
|
53975
|
+
var xTicks = [];
|
|
53976
|
+
var yValueSum = 0;
|
|
53977
|
+
var yMinValue = 0;
|
|
53978
|
+
var yMaxValue = 0;
|
|
53979
|
+
content.forEach(function (dataItem, index) {
|
|
53980
|
+
var _data$push;
|
|
53981
|
+
var xValueIndex = 0;
|
|
53982
|
+
var yValueIndex = 1;
|
|
53983
|
+
var xValue = dataItem[xValueIndex].value;
|
|
53984
|
+
var xFormattedValue = dataItem[xValueIndex].formattedValue;
|
|
53985
|
+
var yValue = Number(dataItem[yValueIndex].value);
|
|
53986
|
+
var yValueDiff = yValue;
|
|
53987
|
+
if (index > 0) {
|
|
53988
|
+
var prevYValue = Number(content[index - 1][yValueIndex].value);
|
|
53989
|
+
yValueDiff = yValue - prevYValue;
|
|
53990
|
+
}
|
|
53991
|
+
var prevYValueSum = yValueSum;
|
|
53992
|
+
yValueSum += yValueDiff;
|
|
53993
|
+
data.push((_data$push = {}, _data$push[xKey] = {
|
|
53994
|
+
value: xValue,
|
|
53995
|
+
formattedValue: xFormattedValue
|
|
53996
|
+
}, _data$push[yKey] = {
|
|
53997
|
+
value: yValueDiff,
|
|
53998
|
+
formattedValue: formattingFunctionY(yValueDiff)
|
|
53999
|
+
}, _data$push));
|
|
54000
|
+
xTicks.push({
|
|
54001
|
+
value: xValue,
|
|
54002
|
+
formattedValue: xFormattedValue,
|
|
54003
|
+
scaleValue: xValue
|
|
54004
|
+
});
|
|
54005
|
+
steps.push({
|
|
54006
|
+
x: xValue,
|
|
54007
|
+
y: yValue,
|
|
54008
|
+
start: prevYValueSum,
|
|
54009
|
+
end: yValueSum
|
|
54010
|
+
});
|
|
54011
|
+
yMinValue = Math.floor(Math.min(yMinValue, yValue));
|
|
54012
|
+
yMaxValue = Math.ceil(Math.max(yMaxValue, yValue));
|
|
54013
|
+
});
|
|
54014
|
+
if (showTotalBar) {
|
|
54015
|
+
var _data$push2;
|
|
54016
|
+
var totalLabel = 'Total';
|
|
54017
|
+
steps.push({
|
|
54018
|
+
x: totalLabel,
|
|
54019
|
+
y: yValueSum,
|
|
54020
|
+
start: 0,
|
|
54021
|
+
end: yValueSum
|
|
54022
|
+
});
|
|
54023
|
+
data.push((_data$push2 = {}, _data$push2[xKey] = {
|
|
54024
|
+
value: totalLabel,
|
|
54025
|
+
formattedValue: totalLabel
|
|
54026
|
+
}, _data$push2[yKey] = {
|
|
54027
|
+
value: yValueSum,
|
|
54028
|
+
formattedValue: formattingFunctionY(yValueSum)
|
|
54029
|
+
}, _data$push2));
|
|
54030
|
+
xTicks.push({
|
|
54031
|
+
value: totalLabel,
|
|
54032
|
+
formattedValue: totalLabel,
|
|
54033
|
+
scaleValue: totalLabel
|
|
54034
|
+
});
|
|
54035
|
+
}
|
|
54036
|
+
var yTicks = getYTicks({
|
|
54037
|
+
yMinValue: yMinValue,
|
|
54038
|
+
yMaxValue: yMaxValue,
|
|
54039
|
+
approxYAxisLabelCount: approxYAxisLabelCount,
|
|
54040
|
+
formattingFunctionY: formattingFunctionY
|
|
54041
|
+
});
|
|
54042
|
+
return {
|
|
54043
|
+
data: data,
|
|
54044
|
+
steps: steps,
|
|
54045
|
+
xTicks: xTicks,
|
|
54046
|
+
yTicks: yTicks,
|
|
54047
|
+
yMinValue: yMinValue,
|
|
54048
|
+
yMaxValue: yMaxValue
|
|
54049
|
+
};
|
|
54050
|
+
};
|
|
54051
|
+
|
|
54052
|
+
var buildWaterfallChartRepresentation = function buildWaterfallChartRepresentation(_ref) {
|
|
54053
|
+
var _formattedResult$fiel, _formattedResult$fiel2, _axisTitles$x, _axisTitles$y;
|
|
54054
|
+
var approxYAxisLabelCount = _ref.approxYAxisLabelCount,
|
|
54055
|
+
axisTitles = _ref.axisTitles,
|
|
54056
|
+
dateTimeFormatOptions = _ref.dateTimeFormatOptions,
|
|
54057
|
+
defaultFormats = _ref.defaultFormats,
|
|
54058
|
+
nullValue = _ref.nullValue,
|
|
54059
|
+
numberFormatOptions = _ref.numberFormatOptions,
|
|
54060
|
+
pivotConfig = _ref.pivotConfig,
|
|
54061
|
+
result = _ref.result,
|
|
54062
|
+
showTotalBar = _ref.showTotalBar,
|
|
54063
|
+
_valueAlias = _ref.valueAlias,
|
|
54064
|
+
xAxisFormat = _ref.xAxisFormat,
|
|
54065
|
+
xAxisPrefix = _ref.xAxisPrefix,
|
|
54066
|
+
xAxisPostfix = _ref.xAxisPostfix,
|
|
54067
|
+
yAxisFormat = _ref.yAxisFormat,
|
|
54068
|
+
yAxisPrefix = _ref.yAxisPrefix,
|
|
54069
|
+
yAxisPostfix = _ref.yAxisPostfix;
|
|
54070
|
+
var activeDateTimeFormats = {};
|
|
54071
|
+
var _buildFieldFormatMaps = buildFieldFormatMaps(result, pivotConfig, xAxisPrefix, xAxisPostfix, xAxisFormat, yAxisPrefix, yAxisPostfix, yAxisFormat, nullValue, numberFormatOptions),
|
|
54072
|
+
allPrefixes = _buildFieldFormatMaps.allPrefixes,
|
|
54073
|
+
allPostfixes = _buildFieldFormatMaps.allPostfixes,
|
|
54074
|
+
nullValues = _buildFieldFormatMaps.nullValues,
|
|
54075
|
+
activeNumberFormats = _buildFieldFormatMaps.activeNumberFormats;
|
|
54076
|
+
var params = {
|
|
54077
|
+
defaultFormats: defaultFormats,
|
|
54078
|
+
dateTimeFormatOptions: dateTimeFormatOptions,
|
|
54079
|
+
numberFormatOptions: numberFormatOptions,
|
|
54080
|
+
valueAlias: function valueAlias(params) {
|
|
54081
|
+
if (typeof _valueAlias === 'function') {
|
|
54082
|
+
return String(_valueAlias({
|
|
54083
|
+
fieldId: id({
|
|
54084
|
+
field: params.fieldId,
|
|
54085
|
+
"function": params["function"]
|
|
54086
|
+
}),
|
|
54087
|
+
value: params.value
|
|
54088
|
+
}));
|
|
54089
|
+
}
|
|
54090
|
+
return undefined;
|
|
54091
|
+
},
|
|
54092
|
+
nullValue: nullValues,
|
|
54093
|
+
prefixes: allPrefixes,
|
|
54094
|
+
postfixes: allPostfixes,
|
|
54095
|
+
activeNumberFormats: activeNumberFormats,
|
|
54096
|
+
activeDateTimeFormats: activeDateTimeFormats
|
|
54097
|
+
};
|
|
54098
|
+
var formattedResult = formatResult(result, params);
|
|
54099
|
+
var formattingFunctionY = function formattingFunctionY(value) {
|
|
54100
|
+
// Use any y axis field as they are all formatted in the same way (for now...);
|
|
54101
|
+
var nonPivotField = formattedResult.fields.find(function (resultField) {
|
|
54102
|
+
return ![].concat(pivotConfig.x, pivotConfig.y).includes(resultField.id);
|
|
54103
|
+
});
|
|
54104
|
+
if (!nonPivotField) return '';
|
|
54105
|
+
return formattedResult.formatterFunc(value, {
|
|
54106
|
+
fieldId: nonPivotField.fieldId,
|
|
54107
|
+
"function": nonPivotField["function"],
|
|
54108
|
+
outputDataType: nonPivotField.outputDataType
|
|
54109
|
+
}).formattedValue;
|
|
54110
|
+
};
|
|
54111
|
+
var keys = formattedResult.fields.map(function (field) {
|
|
54112
|
+
var _ref2;
|
|
54113
|
+
var key = field.fieldId;
|
|
54114
|
+
var keyFormatted = field.publicName;
|
|
54115
|
+
var dataType = field.dataType;
|
|
54116
|
+
return _ref2 = {}, _ref2[key] = {
|
|
54117
|
+
key: key,
|
|
54118
|
+
keyFormatted: keyFormatted,
|
|
54119
|
+
dataType: dataType
|
|
54120
|
+
}, _ref2;
|
|
54121
|
+
});
|
|
54122
|
+
var xKey = (_formattedResult$fiel = formattedResult.fields[0]) == null ? void 0 : _formattedResult$fiel.fieldId;
|
|
54123
|
+
var yKey = (_formattedResult$fiel2 = formattedResult.fields[1]) == null ? void 0 : _formattedResult$fiel2.fieldId;
|
|
54124
|
+
var content = formattedResult.content;
|
|
54125
|
+
var _getRepresentationDat = getRepresentationData({
|
|
54126
|
+
content: content,
|
|
54127
|
+
xKey: xKey,
|
|
54128
|
+
yKey: yKey,
|
|
54129
|
+
approxYAxisLabelCount: approxYAxisLabelCount,
|
|
54130
|
+
showTotalBar: showTotalBar,
|
|
54131
|
+
formattingFunctionY: formattingFunctionY
|
|
54132
|
+
}),
|
|
54133
|
+
data = _getRepresentationDat.data,
|
|
54134
|
+
steps = _getRepresentationDat.steps,
|
|
54135
|
+
xTicks = _getRepresentationDat.xTicks,
|
|
54136
|
+
yTicks = _getRepresentationDat.yTicks,
|
|
54137
|
+
yMinValue = _getRepresentationDat.yMinValue,
|
|
54138
|
+
yMaxValue = _getRepresentationDat.yMaxValue;
|
|
54139
|
+
var chartRepresentation = {
|
|
54140
|
+
keys: _extends({}, keys[0], keys[1]),
|
|
54141
|
+
x: {
|
|
54142
|
+
title: (_axisTitles$x = axisTitles == null ? void 0 : axisTitles.x) != null ? _axisTitles$x : null,
|
|
54143
|
+
ticks: xTicks,
|
|
54144
|
+
prefix: xAxisPrefix,
|
|
54145
|
+
postfix: xAxisPostfix,
|
|
54146
|
+
key: xKey,
|
|
54147
|
+
scale: {
|
|
54148
|
+
dataType: 'string',
|
|
54149
|
+
key: xKey,
|
|
54150
|
+
ordering: null,
|
|
54151
|
+
min: null,
|
|
54152
|
+
max: null
|
|
54153
|
+
}
|
|
54154
|
+
},
|
|
54155
|
+
y: {
|
|
54156
|
+
title: (_axisTitles$y = axisTitles == null ? void 0 : axisTitles.y) != null ? _axisTitles$y : null,
|
|
54157
|
+
ticks: yTicks,
|
|
54158
|
+
key: yKey,
|
|
54159
|
+
prefix: yAxisPrefix,
|
|
54160
|
+
postfix: yAxisPostfix,
|
|
54161
|
+
scale: {
|
|
54162
|
+
dataType: 'number',
|
|
54163
|
+
key: null,
|
|
54164
|
+
ordering: 'asc',
|
|
54165
|
+
min: yMinValue,
|
|
54166
|
+
max: yMaxValue
|
|
54167
|
+
}
|
|
54168
|
+
},
|
|
54169
|
+
data: data
|
|
54170
|
+
};
|
|
54171
|
+
return {
|
|
54172
|
+
waterfallChartRepresentation: chartRepresentation,
|
|
54173
|
+
waterfallChartSteps: steps
|
|
54174
|
+
};
|
|
54175
|
+
};
|
|
54176
|
+
|
|
53871
54177
|
var WaterfallChartView = function WaterfallChartView(props) {
|
|
53872
54178
|
var approxXAxisLabelCount = props.approxXAxisLabelCount,
|
|
53873
54179
|
approxYAxisLabelCount = props.approxYAxisLabelCount,
|
|
@@ -53935,7 +54241,6 @@ var WaterfallChartView = function WaterfallChartView(props) {
|
|
|
53935
54241
|
title: "Missing parameters"
|
|
53936
54242
|
});
|
|
53937
54243
|
if (isLoading(result)) return jsxRuntime.jsx(LoadingComponent, {});
|
|
53938
|
-
if (isLoadingResult(result)) return jsxRuntime.jsx(LoadingComponent, {});
|
|
53939
54244
|
if (hasFailed(result)) return jsxRuntime.jsx(FailedToLoadDataNotice, {});
|
|
53940
54245
|
if (isEmpty(result)) return jsxRuntime.jsx(NoResultContentToShowNotice, _extends({}, headerProps));
|
|
53941
54246
|
var showHeadline = headlineAvailable(order, headline, timeDimension);
|
|
@@ -54006,9 +54311,6 @@ var WaterfallChartView = function WaterfallChartView(props) {
|
|
|
54006
54311
|
})
|
|
54007
54312
|
});
|
|
54008
54313
|
};
|
|
54009
|
-
function isLoadingResult(result) {
|
|
54010
|
-
return result != null && result.content[0].length ? (result == null ? void 0 : result.content[0].length) < 2 : false;
|
|
54011
|
-
}
|
|
54012
54314
|
var WaterfallChartView$1 = /*#__PURE__*/React.memo(WaterfallChartView, shouldUpdate);
|
|
54013
54315
|
|
|
54014
54316
|
var WaterfallChart$3 = function WaterfallChart(_ref) {
|
|
@@ -54021,17 +54323,18 @@ var WaterfallChart$3 = function WaterfallChart(_ref) {
|
|
|
54021
54323
|
runQueriesCallback = _ref.runQueriesCallback,
|
|
54022
54324
|
setLocalFilters = _ref.setLocalFilters,
|
|
54023
54325
|
_setPartialAttributes = _ref.setPartialAttributes,
|
|
54326
|
+
setResults = _ref.setResults,
|
|
54024
54327
|
updateComponentAttributes = _ref.updateComponentAttributes;
|
|
54025
|
-
var localFilters = component.localFilters
|
|
54328
|
+
var localFilters = component.localFilters,
|
|
54329
|
+
results = component.results;
|
|
54026
54330
|
var _useState = React.useState(component.attributes),
|
|
54027
54331
|
attributes = _useState[0],
|
|
54028
54332
|
setAttributes = _useState[1];
|
|
54029
54333
|
var _useComponentEffect = useComponentEffect(component.attributes, dataSet, dashboardBehaviour.queryEngineConfig, {
|
|
54030
54334
|
localFilters: localFilters,
|
|
54031
54335
|
globalFilters: globalFilters
|
|
54032
|
-
}, updateComponentAttributes, runQueriesCallback, dashboardBehaviour.variables),
|
|
54033
|
-
queriesAreChanging = _useComponentEffect.queriesAreChanging
|
|
54034
|
-
results = _useComponentEffect.results;
|
|
54336
|
+
}, updateComponentAttributes, runQueriesCallback, setResults, dashboardBehaviour.variables),
|
|
54337
|
+
queriesAreChanging = _useComponentEffect.queriesAreChanging;
|
|
54035
54338
|
React.useEffect(function () {
|
|
54036
54339
|
if (!queriesAreChanging) {
|
|
54037
54340
|
setAttributes(component.attributes);
|
|
@@ -54130,6 +54433,7 @@ var Component = function Component(props) {
|
|
|
54130
54433
|
dataSet: dataSet,
|
|
54131
54434
|
runQueriesCallback: props.runQueriesCallback,
|
|
54132
54435
|
component: props.component,
|
|
54436
|
+
setResults: props.setResults,
|
|
54133
54437
|
globalFilters: dashboard.globalFilters,
|
|
54134
54438
|
dashboardBehaviour: dashboardBehaviour,
|
|
54135
54439
|
sm: smallVersion,
|
|
@@ -54153,6 +54457,7 @@ var Component = function Component(props) {
|
|
|
54153
54457
|
dataSet: dataSet,
|
|
54154
54458
|
runQueriesCallback: props.runQueriesCallback,
|
|
54155
54459
|
component: props.component,
|
|
54460
|
+
setResults: props.setResults,
|
|
54156
54461
|
globalFilters: dashboard.globalFilters,
|
|
54157
54462
|
dashboardBehaviour: dashboardBehaviour,
|
|
54158
54463
|
sm: smallVersion,
|
|
@@ -54179,6 +54484,7 @@ var Component = function Component(props) {
|
|
|
54179
54484
|
},
|
|
54180
54485
|
runQueriesCallback: props.runQueriesCallback,
|
|
54181
54486
|
component: props.component,
|
|
54487
|
+
setResults: props.setResults,
|
|
54182
54488
|
globalFilters: dashboard.globalFilters,
|
|
54183
54489
|
dashboardBehaviour: dashboardBehaviour,
|
|
54184
54490
|
library: props == null ? void 0 : props.library,
|
|
@@ -54204,6 +54510,7 @@ var Component = function Component(props) {
|
|
|
54204
54510
|
return _updateComponentAttributes(newAttributes);
|
|
54205
54511
|
},
|
|
54206
54512
|
component: props.component,
|
|
54513
|
+
setResults: props.setResults,
|
|
54207
54514
|
globalFilters: dashboard.globalFilters,
|
|
54208
54515
|
dashboardBehaviour: dashboardBehaviour,
|
|
54209
54516
|
sm: smallVersion,
|
|
@@ -54229,6 +54536,7 @@ var Component = function Component(props) {
|
|
|
54229
54536
|
dataSet: dataSet,
|
|
54230
54537
|
runQueriesCallback: props.runQueriesCallback,
|
|
54231
54538
|
component: props.component,
|
|
54539
|
+
setResults: props.setResults,
|
|
54232
54540
|
globalFilters: dashboard.globalFilters,
|
|
54233
54541
|
dashboardBehaviour: dashboardBehaviour,
|
|
54234
54542
|
sm: smallVersion,
|
|
@@ -54258,6 +54566,7 @@ var Component = function Component(props) {
|
|
|
54258
54566
|
},
|
|
54259
54567
|
runQueriesCallback: props.runQueriesCallback,
|
|
54260
54568
|
component: props.component,
|
|
54569
|
+
setResults: props.setResults,
|
|
54261
54570
|
globalFilters: dashboard.globalFilters,
|
|
54262
54571
|
dashboardBehaviour: dashboardBehaviour,
|
|
54263
54572
|
sm: smallVersion,
|
|
@@ -54284,6 +54593,7 @@ var Component = function Component(props) {
|
|
|
54284
54593
|
},
|
|
54285
54594
|
runQueriesCallback: props.runQueriesCallback,
|
|
54286
54595
|
component: props.component,
|
|
54596
|
+
setResults: props.setResults,
|
|
54287
54597
|
globalFilters: dashboard.globalFilters,
|
|
54288
54598
|
dashboardBehaviour: dashboardBehaviour,
|
|
54289
54599
|
library: props == null ? void 0 : props.library,
|
|
@@ -54309,6 +54619,7 @@ var Component = function Component(props) {
|
|
|
54309
54619
|
},
|
|
54310
54620
|
runQueriesCallback: props.runQueriesCallback,
|
|
54311
54621
|
component: props.component,
|
|
54622
|
+
setResults: props.setResults,
|
|
54312
54623
|
globalFilters: dashboard.globalFilters,
|
|
54313
54624
|
dashboardBehaviour: dashboardBehaviour,
|
|
54314
54625
|
library: props == null ? void 0 : props.library,
|
|
@@ -54334,6 +54645,7 @@ var Component = function Component(props) {
|
|
|
54334
54645
|
},
|
|
54335
54646
|
runQueriesCallback: props.runQueriesCallback,
|
|
54336
54647
|
component: props.component,
|
|
54648
|
+
setResults: props.setResults,
|
|
54337
54649
|
globalFilters: dashboard.globalFilters,
|
|
54338
54650
|
dashboardBehaviour: dashboardBehaviour,
|
|
54339
54651
|
library: props == null ? void 0 : props.library,
|
|
@@ -54356,6 +54668,7 @@ var Component = function Component(props) {
|
|
|
54356
54668
|
dataSet: dataSet,
|
|
54357
54669
|
runQueriesCallback: props.runQueriesCallback,
|
|
54358
54670
|
component: props.component,
|
|
54671
|
+
setResults: props.setResults,
|
|
54359
54672
|
globalFilters: dashboard.globalFilters,
|
|
54360
54673
|
dashboardBehaviour: dashboardBehaviour,
|
|
54361
54674
|
library: props == null ? void 0 : props.library,
|
|
@@ -54379,6 +54692,7 @@ var Component = function Component(props) {
|
|
|
54379
54692
|
dataSet: dataSet,
|
|
54380
54693
|
runQueriesCallback: props.runQueriesCallback,
|
|
54381
54694
|
component: props.component,
|
|
54695
|
+
setResults: props.setResults,
|
|
54382
54696
|
globalFilters: dashboard.globalFilters,
|
|
54383
54697
|
dashboardBehaviour: dashboardBehaviour,
|
|
54384
54698
|
library: props == null ? void 0 : props.library,
|
|
@@ -54402,6 +54716,7 @@ var Component = function Component(props) {
|
|
|
54402
54716
|
dataSet: dataSet,
|
|
54403
54717
|
runQueriesCallback: props.runQueriesCallback,
|
|
54404
54718
|
component: props.component,
|
|
54719
|
+
setResults: props.setResults,
|
|
54405
54720
|
globalFilters: dashboard.globalFilters,
|
|
54406
54721
|
dashboardBehaviour: dashboardBehaviour,
|
|
54407
54722
|
library: props == null ? void 0 : props.library,
|
|
@@ -54425,6 +54740,7 @@ var Component = function Component(props) {
|
|
|
54425
54740
|
dataSet: dataSet,
|
|
54426
54741
|
runQueriesCallback: props.runQueriesCallback,
|
|
54427
54742
|
component: props.component,
|
|
54743
|
+
setResults: props.setResults,
|
|
54428
54744
|
globalFilters: dashboard.globalFilters,
|
|
54429
54745
|
dashboardBehaviour: dashboardBehaviour,
|
|
54430
54746
|
library: props == null ? void 0 : props.library,
|
|
@@ -54451,6 +54767,7 @@ var Component = function Component(props) {
|
|
|
54451
54767
|
dataSet: dataSet,
|
|
54452
54768
|
runQueriesCallback: props.runQueriesCallback,
|
|
54453
54769
|
component: props.component,
|
|
54770
|
+
setResults: props.setResults,
|
|
54454
54771
|
globalFilters: dashboard.globalFilters,
|
|
54455
54772
|
dashboardBehaviour: dashboardBehaviour,
|
|
54456
54773
|
library: props == null ? void 0 : props.library,
|
|
@@ -54474,6 +54791,7 @@ var Component = function Component(props) {
|
|
|
54474
54791
|
dataSet: dataSet,
|
|
54475
54792
|
runQueriesCallback: props.runQueriesCallback,
|
|
54476
54793
|
component: props.component,
|
|
54794
|
+
setResults: props.setResults,
|
|
54477
54795
|
globalFilters: dashboard.globalFilters,
|
|
54478
54796
|
updateComponentAttributes: function updateComponentAttributes(newAttributes) {
|
|
54479
54797
|
return _updateComponentAttributes(newAttributes);
|
|
@@ -54500,6 +54818,7 @@ var Component = function Component(props) {
|
|
|
54500
54818
|
dataSet: dataSet,
|
|
54501
54819
|
runQueriesCallback: props.runQueriesCallback,
|
|
54502
54820
|
component: props.component,
|
|
54821
|
+
setResults: props.setResults,
|
|
54503
54822
|
globalFilters: dashboard.globalFilters,
|
|
54504
54823
|
dashboardBehaviour: dashboardBehaviour,
|
|
54505
54824
|
sm: smallVersion,
|
|
@@ -54547,6 +54866,7 @@ var Component = function Component(props) {
|
|
|
54547
54866
|
dataSet: dataSet,
|
|
54548
54867
|
runQueriesCallback: props.runQueriesCallback,
|
|
54549
54868
|
component: props.component,
|
|
54869
|
+
setResults: props.setResults,
|
|
54550
54870
|
globalFilters: dashboard.globalFilters,
|
|
54551
54871
|
dashboardBehaviour: dashboardBehaviour
|
|
54552
54872
|
})
|
|
@@ -54569,6 +54889,7 @@ var Component = function Component(props) {
|
|
|
54569
54889
|
return _updateComponentAttributes(newAttributes);
|
|
54570
54890
|
},
|
|
54571
54891
|
component: props.component,
|
|
54892
|
+
setResults: props.setResults,
|
|
54572
54893
|
globalFilters: dashboard.globalFilters,
|
|
54573
54894
|
dashboardBehaviour: dashboardBehaviour,
|
|
54574
54895
|
sm: smallVersion,
|
|
@@ -54595,6 +54916,7 @@ var Component = function Component(props) {
|
|
|
54595
54916
|
dataSet: dataSet,
|
|
54596
54917
|
runQueriesCallback: props.runQueriesCallback,
|
|
54597
54918
|
component: props.component,
|
|
54919
|
+
setResults: props.setResults,
|
|
54598
54920
|
globalFilters: dashboard.globalFilters,
|
|
54599
54921
|
dashboardBehaviour: dashboardBehaviour,
|
|
54600
54922
|
library: props == null ? void 0 : props.library,
|
|
@@ -54622,6 +54944,7 @@ var Component = function Component(props) {
|
|
|
54622
54944
|
return _updateComponentAttributes(newAttributes);
|
|
54623
54945
|
},
|
|
54624
54946
|
component: props.component,
|
|
54947
|
+
setResults: props.setResults,
|
|
54625
54948
|
globalFilters: dashboard.globalFilters,
|
|
54626
54949
|
dashboardBehaviour: dashboardBehaviour,
|
|
54627
54950
|
library: props == null ? void 0 : props.library,
|
|
@@ -54647,6 +54970,7 @@ var Component = function Component(props) {
|
|
|
54647
54970
|
return _updateComponentAttributes(newAttributes);
|
|
54648
54971
|
},
|
|
54649
54972
|
component: props.component,
|
|
54973
|
+
setResults: props.setResults,
|
|
54650
54974
|
globalFilters: dashboard.globalFilters,
|
|
54651
54975
|
dashboardBehaviour: dashboardBehaviour,
|
|
54652
54976
|
library: props == null ? void 0 : props.library,
|
|
@@ -57452,6 +57776,18 @@ var ModalType = /*#__PURE__*/function (ModalType) {
|
|
|
57452
57776
|
----------------------------------------------
|
|
57453
57777
|
*/
|
|
57454
57778
|
|
|
57779
|
+
/*
|
|
57780
|
+
----------------------------------------------
|
|
57781
|
+
----------------------------------------------
|
|
57782
|
+
----------------------------------------------
|
|
57783
|
+
|
|
57784
|
+
Setting results
|
|
57785
|
+
|
|
57786
|
+
----------------------------------------------
|
|
57787
|
+
----------------------------------------------
|
|
57788
|
+
----------------------------------------------
|
|
57789
|
+
*/
|
|
57790
|
+
|
|
57455
57791
|
/*
|
|
57456
57792
|
----------------------------------------------
|
|
57457
57793
|
----------------------------------------------
|
|
@@ -58489,6 +58825,65 @@ var ParametersModalView = function ParametersModalView(props) {
|
|
|
58489
58825
|
});
|
|
58490
58826
|
};
|
|
58491
58827
|
|
|
58828
|
+
var ViewRawResultsModal = function ViewRawResultsModal(props) {
|
|
58829
|
+
var _useDashboardBehaviou = useDashboardBehaviourContext(),
|
|
58830
|
+
textOverride = _useDashboardBehaviou.textOverride;
|
|
58831
|
+
var _useToastContext = useToastContext(),
|
|
58832
|
+
addToast = _useToastContext.addToast;
|
|
58833
|
+
return jsxRuntime.jsxs(Modal, {
|
|
58834
|
+
width: "4xl",
|
|
58835
|
+
isOpen: props == null ? void 0 : props.show,
|
|
58836
|
+
onClose: function onClose() {
|
|
58837
|
+
return props == null ? void 0 : props.onClose(false);
|
|
58838
|
+
},
|
|
58839
|
+
children: [jsxRuntime.jsx(Modal.Header, {
|
|
58840
|
+
title: textOverride('json_results', 'Data in raw JSON format'),
|
|
58841
|
+
show: true
|
|
58842
|
+
}), jsxRuntime.jsx(Modal.Content, {
|
|
58843
|
+
children: jsxRuntime.jsx(View, {
|
|
58844
|
+
maxHeight: "400px",
|
|
58845
|
+
overflowY: "scroll",
|
|
58846
|
+
children: jsxRuntime.jsx("pre", {
|
|
58847
|
+
"data-testid": "raw-results-" + props.rowIndex + "-" + props.cellIndex,
|
|
58848
|
+
children: JSON.stringify(props.results, null, 2)
|
|
58849
|
+
})
|
|
58850
|
+
})
|
|
58851
|
+
}), jsxRuntime.jsx(Modal.Footer, {
|
|
58852
|
+
buttons: "end",
|
|
58853
|
+
children: jsxRuntime.jsxs(ButtonGroup, {
|
|
58854
|
+
children: [jsxRuntime.jsx(Button, {
|
|
58855
|
+
secondary: true,
|
|
58856
|
+
testId: "modal-close-btn",
|
|
58857
|
+
onClick: function onClick() {
|
|
58858
|
+
return props == null ? void 0 : props.onClose(false);
|
|
58859
|
+
},
|
|
58860
|
+
children: textOverride('close', 'Close')
|
|
58861
|
+
}), jsxRuntime.jsx(Button, {
|
|
58862
|
+
primary: true,
|
|
58863
|
+
testId: "modal-copy-json-results-btn",
|
|
58864
|
+
onClick: function onClick() {
|
|
58865
|
+
var copied = copy(JSON.stringify(props.results));
|
|
58866
|
+
if (copied) {
|
|
58867
|
+
addToast(function () {
|
|
58868
|
+
return jsxRuntime.jsx(ToastSuccess, {
|
|
58869
|
+
message: "Copied results"
|
|
58870
|
+
});
|
|
58871
|
+
});
|
|
58872
|
+
} else {
|
|
58873
|
+
addToast(function () {
|
|
58874
|
+
return jsxRuntime.jsx(ToastError, {
|
|
58875
|
+
message: "Failed to copy results"
|
|
58876
|
+
});
|
|
58877
|
+
});
|
|
58878
|
+
}
|
|
58879
|
+
},
|
|
58880
|
+
children: textOverride('copy', 'Copy')
|
|
58881
|
+
})]
|
|
58882
|
+
})
|
|
58883
|
+
})]
|
|
58884
|
+
});
|
|
58885
|
+
};
|
|
58886
|
+
|
|
58492
58887
|
var ViewRawAttributesModal = function ViewRawAttributesModal(props) {
|
|
58493
58888
|
var _useDashboardBehaviou = useDashboardBehaviourContext(),
|
|
58494
58889
|
textOverride = _useDashboardBehaviou.textOverride;
|
|
@@ -58870,6 +59265,7 @@ var PopulatedCell = function PopulatedCell(props) {
|
|
|
58870
59265
|
localFiltersModal = _useState2[0],
|
|
58871
59266
|
showLocalFiltersModal = _useState2[1];
|
|
58872
59267
|
var _useState3 = React.useState(false),
|
|
59268
|
+
viewRawJSONResults = _useState3[0],
|
|
58873
59269
|
showViewRawJSONResults = _useState3[1];
|
|
58874
59270
|
var _useState4 = React.useState(false),
|
|
58875
59271
|
viewRawAttributes = _useState4[0],
|
|
@@ -59044,6 +59440,7 @@ var PopulatedCell = function PopulatedCell(props) {
|
|
|
59044
59440
|
isBeingSizeAdjusted: props.isBeingSizeAdjusted,
|
|
59045
59441
|
runQueriesCallback: props.runQueriesCallback,
|
|
59046
59442
|
component: props.component,
|
|
59443
|
+
setResults: props.setResults,
|
|
59047
59444
|
updateComponentAttributes: props.updateComponentAttributes,
|
|
59048
59445
|
height: props.height
|
|
59049
59446
|
}), !showComponent && jsxRuntime.jsx(LoadingComponent, {})]
|
|
@@ -59069,6 +59466,14 @@ var PopulatedCell = function PopulatedCell(props) {
|
|
|
59069
59466
|
onClose: function onClose() {
|
|
59070
59467
|
return showParametersModal(false);
|
|
59071
59468
|
}
|
|
59469
|
+
}), jsxRuntime.jsx(ViewRawResultsModal, {
|
|
59470
|
+
cellIndex: props.cellIndex,
|
|
59471
|
+
rowIndex: props.rowIndex,
|
|
59472
|
+
show: viewRawJSONResults,
|
|
59473
|
+
results: props.component.results,
|
|
59474
|
+
onClose: function onClose() {
|
|
59475
|
+
return showViewRawJSONResults(false);
|
|
59476
|
+
}
|
|
59072
59477
|
}), jsxRuntime.jsx(ViewRawAttributesModal, {
|
|
59073
59478
|
cellIndex: props.cellIndex,
|
|
59074
59479
|
rowIndex: props.rowIndex,
|
|
@@ -59098,6 +59503,7 @@ var PopulatedCell = function PopulatedCell(props) {
|
|
|
59098
59503
|
isBeingSizeAdjusted: props.isBeingSizeAdjusted,
|
|
59099
59504
|
runQueriesCallback: props.runQueriesCallback,
|
|
59100
59505
|
component: props.component,
|
|
59506
|
+
setResults: props.setResults,
|
|
59101
59507
|
updateComponentAttributes: props.updateComponentAttributes,
|
|
59102
59508
|
height: props.height
|
|
59103
59509
|
})
|
|
@@ -59763,6 +60169,14 @@ var ResizableRowCell = function ResizableRowCell(props) {
|
|
|
59763
60169
|
});
|
|
59764
60170
|
},
|
|
59765
60171
|
height: props.height,
|
|
60172
|
+
setResults: function setResults(results) {
|
|
60173
|
+
dispatch({
|
|
60174
|
+
type: 'setResultsForComponentInDisplay',
|
|
60175
|
+
rowIndex: rowIndex,
|
|
60176
|
+
cellIndex: cellIndex,
|
|
60177
|
+
results: results
|
|
60178
|
+
});
|
|
60179
|
+
},
|
|
59766
60180
|
onEdit: function onEdit() {
|
|
59767
60181
|
trackEvent('component.startEditing');
|
|
59768
60182
|
dispatch({
|
|
@@ -61067,6 +61481,9 @@ var ComponentInLibrary = function ComponentInLibrary(props) {
|
|
|
61067
61481
|
setLocalFilters: function setLocalFilters() {},
|
|
61068
61482
|
runQueriesCallback: props.runQueriesCallback,
|
|
61069
61483
|
component: component,
|
|
61484
|
+
setResults: function setResults(results) {
|
|
61485
|
+
return props.setResults(results, libraryIndex);
|
|
61486
|
+
},
|
|
61070
61487
|
updateComponentAttributes: props.updateComponentAttributes,
|
|
61071
61488
|
library: true
|
|
61072
61489
|
})]
|
|
@@ -61389,6 +61806,7 @@ var ViewsInLibrary = function ViewsInLibrary(props) {
|
|
|
61389
61806
|
refIndex = _ref.refIndex;
|
|
61390
61807
|
return jsxRuntime.jsx(ComponentInLibrary, {
|
|
61391
61808
|
updateComponentAttributes: props.updateComponentAttributes,
|
|
61809
|
+
setResults: props.setResults,
|
|
61392
61810
|
component: item.component,
|
|
61393
61811
|
libraryIndex: refIndex,
|
|
61394
61812
|
onSelectComponent: props == null ? void 0 : props.onSelectComponent,
|
|
@@ -61431,6 +61849,20 @@ var Library = function Library() {
|
|
|
61431
61849
|
featureToggles = _useDashboardBehaviou.featureToggles,
|
|
61432
61850
|
textOverride = _useDashboardBehaviou.textOverride;
|
|
61433
61851
|
var canEditComponentLibrary = featureToggles.canEditComponentLibrary;
|
|
61852
|
+
var setResults = function setResults(results, libraryIndex) {
|
|
61853
|
+
dispatch({
|
|
61854
|
+
type: 'setResultsForComponentInLibrary',
|
|
61855
|
+
results: results,
|
|
61856
|
+
libraryIndex: libraryIndex
|
|
61857
|
+
});
|
|
61858
|
+
};
|
|
61859
|
+
var setFocussedComponentResults = function setFocussedComponentResults(results) {
|
|
61860
|
+
dispatch({
|
|
61861
|
+
type: 'setResultsForComponentInLibrary',
|
|
61862
|
+
results: results,
|
|
61863
|
+
libraryIndex: selectedLibraryIndex
|
|
61864
|
+
});
|
|
61865
|
+
};
|
|
61434
61866
|
var selectComponentFromLibrary = function selectComponentFromLibrary() {
|
|
61435
61867
|
dispatch({
|
|
61436
61868
|
type: 'pickComponentFromLibraryForDisplay',
|
|
@@ -61498,8 +61930,10 @@ var Library = function Library() {
|
|
|
61498
61930
|
onClose: clearModal,
|
|
61499
61931
|
onSelect: selectComponentFromLibrary,
|
|
61500
61932
|
updateComponentAttributes: updateComponentAttributes,
|
|
61933
|
+
setFocussedComponentResults: setFocussedComponentResults,
|
|
61501
61934
|
dashboard: dashboard,
|
|
61502
61935
|
selectedLibraryIndex: selectedLibraryIndex,
|
|
61936
|
+
setResults: setResults,
|
|
61503
61937
|
canEditComponentLibrary: canEditComponentLibrary,
|
|
61504
61938
|
onEdit: startEditingSelectedComponent,
|
|
61505
61939
|
onDelete: setShowDeleteConfirmationModal,
|
|
@@ -61542,6 +61976,7 @@ var ViewLibraryDisplay = function ViewLibraryDisplay(props) {
|
|
|
61542
61976
|
"data-component": "library-content",
|
|
61543
61977
|
children: jsxRuntime.jsx(ViewsInLibrary, {
|
|
61544
61978
|
runQueriesCallback: props == null ? void 0 : props.runQueriesCallback,
|
|
61979
|
+
setResults: props == null ? void 0 : props.setResults,
|
|
61545
61980
|
components: props.dashboard.componentLibrary,
|
|
61546
61981
|
onSelectComponent: function onSelectComponent(index) {
|
|
61547
61982
|
return props == null ? void 0 : props.onSelectComponent(index);
|
|
@@ -64793,12 +65228,14 @@ var handleFeedbackMessage = function handleFeedbackMessage(_ref) {
|
|
|
64793
65228
|
|
|
64794
65229
|
// By using message ids we ensure there will only be 1 message of a type, and it can be easily removed
|
|
64795
65230
|
var chartDimensionMessageId = 'grouping';
|
|
65231
|
+
var limitWarningMessageId = 'limit';
|
|
64796
65232
|
var EditorComponent = function EditorComponent(props) {
|
|
64797
65233
|
var _theme$editor$gap, _theme$editor, _theme$editor2, _props$usingBeta, _theme$editor3;
|
|
64798
65234
|
var theme = useTheme();
|
|
64799
65235
|
var editorFeedback = useEditorFeedback();
|
|
64800
65236
|
var _props$editor = props.editor,
|
|
64801
65237
|
setAttributes = _props$editor.setAttributes,
|
|
65238
|
+
setResults = _props$editor.setResults,
|
|
64802
65239
|
runQueriesCallback = _props$editor.runQueriesCallback,
|
|
64803
65240
|
component = _props$editor.component,
|
|
64804
65241
|
dataSet = _props$editor.dataSet,
|
|
@@ -64819,25 +65256,26 @@ var EditorComponent = function EditorComponent(props) {
|
|
|
64819
65256
|
editorFeedback.removeFeedbackMessage(chartDimensionMessageId);
|
|
64820
65257
|
};
|
|
64821
65258
|
}, [component.attributes]);
|
|
64822
|
-
|
|
64823
|
-
|
|
64824
|
-
|
|
64825
|
-
|
|
64826
|
-
|
|
64827
|
-
|
|
64828
|
-
|
|
64829
|
-
|
|
64830
|
-
|
|
64831
|
-
|
|
64832
|
-
|
|
64833
|
-
|
|
64834
|
-
|
|
64835
|
-
|
|
64836
|
-
|
|
64837
|
-
|
|
64838
|
-
|
|
64839
|
-
|
|
64840
|
-
|
|
65259
|
+
React.useEffect(function () {
|
|
65260
|
+
handleFeedbackMessage({
|
|
65261
|
+
message: {
|
|
65262
|
+
id: limitWarningMessageId,
|
|
65263
|
+
type: 'info',
|
|
65264
|
+
children: "More data is available for this view. Increase 'Limit' (Advanced Options) to show all data."
|
|
65265
|
+
},
|
|
65266
|
+
showCondition: component.results.some(function (result) {
|
|
65267
|
+
return result == null ? void 0 : result.hasMoreResults;
|
|
65268
|
+
}),
|
|
65269
|
+
hideCondition: !component.results.some(function (result) {
|
|
65270
|
+
return result == null ? void 0 : result.hasMoreResults;
|
|
65271
|
+
}),
|
|
65272
|
+
addFeedbackMessage: editorFeedback.addFeedbackMessage,
|
|
65273
|
+
removeFeedbackMessage: editorFeedback.removeFeedbackMessage
|
|
65274
|
+
});
|
|
65275
|
+
return function () {
|
|
65276
|
+
editorFeedback.removeFeedbackMessage(limitWarningMessageId);
|
|
65277
|
+
};
|
|
65278
|
+
}, [component.results]);
|
|
64841
65279
|
return jsxRuntime.jsx(RichTextEditorContextProvider, {
|
|
64842
65280
|
setContent: function setContent(content) {
|
|
64843
65281
|
// @ts-ignore
|
|
@@ -64876,6 +65314,7 @@ var EditorComponent = function EditorComponent(props) {
|
|
|
64876
65314
|
isBeingSizeAdjusted: false,
|
|
64877
65315
|
setLocalFilters: props.editor.setLocalFilters,
|
|
64878
65316
|
runQueriesCallback: runQueriesCallback,
|
|
65317
|
+
setResults: setResults,
|
|
64879
65318
|
component: component,
|
|
64880
65319
|
updateComponentAttributes: setAttributes,
|
|
64881
65320
|
editor: true
|
|
@@ -64889,10 +65328,10 @@ var EditorComponent = function EditorComponent(props) {
|
|
|
64889
65328
|
|
|
64890
65329
|
var EditorModal = function EditorModal(props) {
|
|
64891
65330
|
var _theme$modals, _theme$modals2;
|
|
65331
|
+
var editor = useEditor();
|
|
64892
65332
|
var _React$useState = React__default.useState(false),
|
|
64893
65333
|
ai = _React$useState[0],
|
|
64894
65334
|
openAI = _React$useState[1];
|
|
64895
|
-
var editor = useEditor();
|
|
64896
65335
|
var usingBeta = useBetaFeatures();
|
|
64897
65336
|
var _useAIBehaviour = useAIBehaviour(),
|
|
64898
65337
|
fetchSuggestions = _useAIBehaviour.fetchSuggestions;
|
|
@@ -69922,7 +70361,7 @@ var fromToken = function fromToken(token) {
|
|
|
69922
70361
|
});
|
|
69923
70362
|
};
|
|
69924
70363
|
|
|
69925
|
-
var init$
|
|
70364
|
+
var init$d = function init(dashboardSessionToken, dataAccessToken, queryEngineAccessToken, dashboardAdminOverrideToken) {
|
|
69926
70365
|
var dashboardAccessContent = fromToken(dashboardSessionToken);
|
|
69927
70366
|
if (!('scope' in dashboardAccessContent)) {
|
|
69928
70367
|
dashboardAccessContent.scope = 'read_write';
|
|
@@ -69988,7 +70427,7 @@ var fetchIdentityConfig = /*#__PURE__*/function () {
|
|
|
69988
70427
|
throw new FailedToLoadIdentity('Failed to fetch identity config.');
|
|
69989
70428
|
case 6:
|
|
69990
70429
|
dashboardAdminOverride = isClientSide() ? getDashboardAdminOverride(window.location.href) : null;
|
|
69991
|
-
identityConfig = init$
|
|
70430
|
+
identityConfig = init$d(tokens.dashboardAccessToken, tokens.dataAccessToken, tokens.queryEngineAccessToken, dashboardAdminOverride);
|
|
69992
70431
|
return _context.abrupt("return", {
|
|
69993
70432
|
identityConfig: identityConfig,
|
|
69994
70433
|
tokens: tokens
|
|
@@ -70796,6 +71235,7 @@ var buildComponentLibrary = function buildComponentLibrary(cells) {
|
|
|
70796
71235
|
newComponentLibrary.push({
|
|
70797
71236
|
attributes: cell.component.attributes,
|
|
70798
71237
|
localFilters: (_cell$localFilters2 = cell.localFilters) != null ? _cell$localFilters2 : [],
|
|
71238
|
+
results: [],
|
|
70799
71239
|
colSpan: 1,
|
|
70800
71240
|
reports: []
|
|
70801
71241
|
});
|
|
@@ -71163,6 +71603,32 @@ var TimeoutWaitingForVizzlyInstance = /*#__PURE__*/function (_Error) {
|
|
|
71163
71603
|
return TimeoutWaitingForVizzlyInstance;
|
|
71164
71604
|
}( /*#__PURE__*/_wrapNativeSuper(Error));
|
|
71165
71605
|
|
|
71606
|
+
var joiOptions$1 = {
|
|
71607
|
+
convert: false,
|
|
71608
|
+
stripUnknown: false,
|
|
71609
|
+
allowUnknown: true
|
|
71610
|
+
};
|
|
71611
|
+
var validateQuery = function validateQuery(params, queryEngineConfig) {
|
|
71612
|
+
var validationResult = Joi.array().items(schema(queryEngineConfig)).validate(params, joiOptions$1);
|
|
71613
|
+
if (validationResult.error) {
|
|
71614
|
+
throw new ServicesValidationError(validationResult.error.message);
|
|
71615
|
+
}
|
|
71616
|
+
};
|
|
71617
|
+
var filterSchema$1 = function filterSchema(queryEngineConfig) {
|
|
71618
|
+
var _Joi$string;
|
|
71619
|
+
return Joi.array().items(Joi.alternatives()["try"](Joi.object({
|
|
71620
|
+
field: Joi.string().required().description('The ID of the field from the data set to reference.'),
|
|
71621
|
+
op: (_Joi$string = Joi.string()).valid.apply(_Joi$string, Object.keys(queryEngineConfig.supportedOperators)).required(),
|
|
71622
|
+
value: Joi.any().required()
|
|
71623
|
+
}).description('A filter object to apply to the data set.'), Joi.array()));
|
|
71624
|
+
};
|
|
71625
|
+
var schema = function schema(queryEngineConfig) {
|
|
71626
|
+
return Joi.object(_extends({}, querySchema(queryEngineConfig, {}), {
|
|
71627
|
+
filter: filterSchema$1(queryEngineConfig),
|
|
71628
|
+
timeDimension: Joi.alternatives(timeDimensionSchema(queryEngineConfig.supportedTimeTruncFunctions), Joi.valid(null))
|
|
71629
|
+
}));
|
|
71630
|
+
};
|
|
71631
|
+
|
|
71166
71632
|
var validateDashboardJoiOptions = {
|
|
71167
71633
|
convert: false,
|
|
71168
71634
|
stripUnknown: false,
|
|
@@ -71240,7 +71706,7 @@ var toQueries = function toQueries(dataSets, queryAttributes, queryEngineConfig,
|
|
|
71240
71706
|
var queries = queryAttributes.map(function (qA) {
|
|
71241
71707
|
var dataSet = find(dataSets, qA.dataSetId);
|
|
71242
71708
|
if (!dataSet) throw 'Data set not found for query attributes query';
|
|
71243
|
-
return buildFromQueryAttributes(dataSet, qA.measure, qA.
|
|
71709
|
+
return buildFromQueryAttributes(dataSet, qA.measure, qA.order, qA.dimension, qA.timeDimension, qA.limit, qA.offset, queryEngineConfig, params, qA.filter);
|
|
71244
71710
|
});
|
|
71245
71711
|
return {
|
|
71246
71712
|
queries: queries.map(function (q) {
|
|
@@ -71298,7 +71764,7 @@ function getOptionsOrders(dataSetField) {
|
|
|
71298
71764
|
}
|
|
71299
71765
|
|
|
71300
71766
|
var commonToQueries = function commonToQueries(attributes, dataSet, queryEngineConfig, params) {
|
|
71301
|
-
var _Query$build = build$c(dataSet, attributes.measure, attributes.
|
|
71767
|
+
var _Query$build = build$c(dataSet, attributes.measure, attributes.order, attributes.dimension,
|
|
71302
71768
|
// @ts-ignore
|
|
71303
71769
|
attributes.timeDimension || null, attributes.limit, attributes.offset, queryEngineConfig, params),
|
|
71304
71770
|
query = _Query$build.query,
|
|
@@ -71323,8 +71789,8 @@ var toQueries$6 = commonToQueries;
|
|
|
71323
71789
|
var toQueries$7 = commonToQueries;
|
|
71324
71790
|
|
|
71325
71791
|
var buildMainQueries = function buildMainQueries(attributes, dataSet, queryEngineConfig, params) {
|
|
71326
|
-
var line = build$c(dataSet, attributes.lineMeasure, attributes.
|
|
71327
|
-
var bar = build$c(dataSet, attributes.barMeasure, attributes.
|
|
71792
|
+
var line = build$c(dataSet, attributes.lineMeasure, attributes.order, attributes.lineDimension, attributes.timeDimension, attributes.limit, attributes.offset, queryEngineConfig, params);
|
|
71793
|
+
var bar = build$c(dataSet, attributes.barMeasure, attributes.order, attributes.barDimension, attributes.timeDimension, attributes.limit, attributes.offset, queryEngineConfig, params);
|
|
71328
71794
|
return {
|
|
71329
71795
|
bar: bar,
|
|
71330
71796
|
line: line
|
|
@@ -71351,8 +71817,8 @@ var toQueries$b = commonToQueries;
|
|
|
71351
71817
|
var toQueries$c = commonToQueries;
|
|
71352
71818
|
|
|
71353
71819
|
var buildMainQueries$1 = function buildMainQueries(attributes, dataSet, queryEngineConfig, params) {
|
|
71354
|
-
var line = build$c(dataSet, attributes.lineMeasure, attributes.
|
|
71355
|
-
var bar = build$c(dataSet, attributes.barMeasure, attributes.
|
|
71820
|
+
var line = build$c(dataSet, attributes.lineMeasure, attributes.order, attributes.lineDimension, attributes.timeDimension, attributes.limit, attributes.offset, queryEngineConfig, params);
|
|
71821
|
+
var bar = build$c(dataSet, attributes.barMeasure, attributes.order, attributes.barDimension, attributes.timeDimension, attributes.limit, attributes.offset, queryEngineConfig, params);
|
|
71356
71822
|
return {
|
|
71357
71823
|
bar: bar,
|
|
71358
71824
|
line: line
|
|
@@ -71371,7 +71837,7 @@ var toQueries$d = function toQueries(attributes, dataSet, queryEngineConfig, par
|
|
|
71371
71837
|
};
|
|
71372
71838
|
|
|
71373
71839
|
var buildMainQuery = function buildMainQuery(attributes, dataSet, queryEngineConfig, params) {
|
|
71374
|
-
var _Query$build = build$c(dataSet, attributes.measure,
|
|
71840
|
+
var _Query$build = build$c(dataSet, attributes.measure, [], [], null, 1, attributes.offset, queryEngineConfig, params),
|
|
71375
71841
|
query = _Query$build.query,
|
|
71376
71842
|
measureDescription = _Query$build.measureDescription;
|
|
71377
71843
|
|
|
@@ -71399,7 +71865,7 @@ var buildMainQuery = function buildMainQuery(attributes, dataSet, queryEngineCon
|
|
|
71399
71865
|
};
|
|
71400
71866
|
var buildDeltaQuery = function buildDeltaQuery(dataSet, attributes, queryEngineConfig, params) {
|
|
71401
71867
|
if (!attributes.deltaTimeDimension) return null;
|
|
71402
|
-
return build$c(dataSet, attributes.measure,
|
|
71868
|
+
return build$c(dataSet, attributes.measure, [{
|
|
71403
71869
|
field: attributes.deltaTimeDimension.field,
|
|
71404
71870
|
direction: 'asc',
|
|
71405
71871
|
"function": attributes.deltaTimeDimension.truncate
|
|
@@ -71431,7 +71897,7 @@ var toQueries$f = function toQueries(attributes, dataSet, queryEngineConfig, par
|
|
|
71431
71897
|
var measures = [];
|
|
71432
71898
|
attributes.xMeasure && measures.push(attributes.xMeasure);
|
|
71433
71899
|
attributes.yMeasure && measures.push(attributes.yMeasure);
|
|
71434
|
-
var _Query$build = build$c(dataSet, measures, attributes.
|
|
71900
|
+
var _Query$build = build$c(dataSet, measures, attributes.order, attributes.dimension, attributes.timeDimension, attributes.limit, attributes.offset, queryEngineConfig, params),
|
|
71435
71901
|
query = _Query$build.query,
|
|
71436
71902
|
measureDescription = _Query$build.measureDescription;
|
|
71437
71903
|
var resultFields = toResultFields([measureDescription], queryEngineConfig);
|
|
@@ -71445,7 +71911,7 @@ var toQueries$g = function toQueries(attributes, dataSet, queryEngineConfig, par
|
|
|
71445
71911
|
var measures = [];
|
|
71446
71912
|
attributes.xMeasure && measures.push(attributes.xMeasure);
|
|
71447
71913
|
attributes.yMeasure && measures.push(attributes.yMeasure);
|
|
71448
|
-
var _Query$build = build$c(dataSet, measures, attributes.
|
|
71914
|
+
var _Query$build = build$c(dataSet, measures, attributes.order, attributes.dimension, attributes.timeDimension, attributes.limit, attributes.offset, queryEngineConfig, params),
|
|
71449
71915
|
query = _Query$build.query,
|
|
71450
71916
|
measureDescription = _Query$build.measureDescription;
|
|
71451
71917
|
var resultFields = toResultFields([measureDescription], queryEngineConfig);
|
|
@@ -71457,7 +71923,7 @@ var toQueries$g = function toQueries(attributes, dataSet, queryEngineConfig, par
|
|
|
71457
71923
|
|
|
71458
71924
|
var toQueries$h = function toQueries(attributes, dataSet, queryEngineConfig, params) {
|
|
71459
71925
|
var measures = [].concat(attributes.measure || [], attributes.xMeasure || [], attributes.zMeasure || []);
|
|
71460
|
-
var _Query$build = build$c(dataSet, measures, attributes.
|
|
71926
|
+
var _Query$build = build$c(dataSet, measures, attributes.order, attributes.dimension, attributes.timeDimension, attributes.limit, attributes.offset, queryEngineConfig, params),
|
|
71461
71927
|
query = _Query$build.query,
|
|
71462
71928
|
measureDescription = _Query$build.measureDescription;
|
|
71463
71929
|
var resultFields = toResultFields([measureDescription], queryEngineConfig);
|
|
@@ -71569,7 +72035,20 @@ var buildVizzlyQuery = function buildVizzlyQuery(thing, queryEngineConfig, param
|
|
|
71569
72035
|
queriesToSend = [_query];
|
|
71570
72036
|
resultFields = [_rF];
|
|
71571
72037
|
} else if (Array.isArray(thing)) {
|
|
71572
|
-
var
|
|
72038
|
+
var queriesInAttributesFormat = [].concat(thing).map(function (queryAttributes) {
|
|
72039
|
+
var dataSet = find(params.dataSets, queryAttributes.dataSetId);
|
|
72040
|
+
if (!dataSet) throw 'Data set not found for query-attributes query';
|
|
72041
|
+
return _extends({}, queryAttributes, {
|
|
72042
|
+
// TODO; this means that services queries that povide a query, cannot work... GTDEV-6947
|
|
72043
|
+
filter: [],
|
|
72044
|
+
whereClause: filterConfigToWhere(dataSet, queryEngineConfig, _extends({}, params, {
|
|
72045
|
+
filterConfig: _extends({}, params.filterConfig, {
|
|
72046
|
+
advancedFilter: queryAttributes.filter
|
|
72047
|
+
})
|
|
72048
|
+
}))
|
|
72049
|
+
});
|
|
72050
|
+
});
|
|
72051
|
+
var _fromQueryAttributes = toQueries(params.dataSets, queriesInAttributesFormat, queryEngineConfig, params),
|
|
71573
72052
|
q = _fromQueryAttributes.queries,
|
|
71574
72053
|
_rF2 = _fromQueryAttributes.resultFields;
|
|
71575
72054
|
queriesToSend = q;
|
|
@@ -71581,7 +72060,7 @@ var buildVizzlyQuery = function buildVizzlyQuery(thing, queryEngineConfig, param
|
|
|
71581
72060
|
if (!_dataSet) throw 'Data set not found for view attributes query';
|
|
71582
72061
|
var _buildVizzlyViewQueri = buildVizzlyViewQueries(thing, _dataSet, queryEngineConfig, _extends({}, params, {
|
|
71583
72062
|
filterConfig: _extends({}, params.filterConfig, {
|
|
71584
|
-
|
|
72063
|
+
advancedFilter: thing.filter
|
|
71585
72064
|
})
|
|
71586
72065
|
})),
|
|
71587
72066
|
_q = _buildVizzlyViewQueri.queries,
|
|
@@ -71618,7 +72097,7 @@ var set = function set(cacheKey, item, expiryInSeconds) {
|
|
|
71618
72097
|
var key = JSON.stringify(cacheKey);
|
|
71619
72098
|
var expires = new Date();
|
|
71620
72099
|
expires.setSeconds(expires.getSeconds() + expiryInSeconds);
|
|
71621
|
-
logDebug(
|
|
72100
|
+
logDebug("Browser cache new object set.", key);
|
|
71622
72101
|
cache$1[key] = {
|
|
71623
72102
|
item: item,
|
|
71624
72103
|
expires: expires
|
|
@@ -71628,10 +72107,10 @@ var get = function get(cacheKey) {
|
|
|
71628
72107
|
var key = JSON.stringify(cacheKey);
|
|
71629
72108
|
var retrieved = cache$1[key];
|
|
71630
72109
|
if (!retrieved) {
|
|
71631
|
-
logDebug(
|
|
72110
|
+
logDebug("Browser cache miss.", cacheKey);
|
|
71632
72111
|
return null;
|
|
71633
72112
|
}
|
|
71634
|
-
logDebug(
|
|
72113
|
+
logDebug("Browser cache hit.", cacheKey);
|
|
71635
72114
|
var item = retrieved.item,
|
|
71636
72115
|
expires = retrieved.expires;
|
|
71637
72116
|
var now = new Date();
|
|
@@ -71643,7 +72122,7 @@ var get = function get(cacheKey) {
|
|
|
71643
72122
|
return null;
|
|
71644
72123
|
};
|
|
71645
72124
|
var clear$1 = function clear() {
|
|
71646
|
-
logDebug(
|
|
72125
|
+
logDebug("Browser cache cleared.");
|
|
71647
72126
|
cache$1 = {};
|
|
71648
72127
|
};
|
|
71649
72128
|
|
|
@@ -72807,6 +73286,7 @@ var VizzlyServices = /*#__PURE__*/function () {
|
|
|
72807
73286
|
instanceId = params.instanceId;
|
|
72808
73287
|
}
|
|
72809
73288
|
service = VizzlyServices._instanceStore[instanceId];
|
|
73289
|
+
validateQuery(queries, service.queryEngineConfig);
|
|
72810
73290
|
queryEngineEndpoint = function () {
|
|
72811
73291
|
if (params != null && params.queryEngineEndpoint) {
|
|
72812
73292
|
return params.queryEngineEndpoint;
|
|
@@ -72852,14 +73332,14 @@ var VizzlyServices = /*#__PURE__*/function () {
|
|
|
72852
73332
|
return _ref.apply(this, arguments);
|
|
72853
73333
|
};
|
|
72854
73334
|
}();
|
|
72855
|
-
_context11.next =
|
|
73335
|
+
_context11.next = 10;
|
|
72856
73336
|
return fetch();
|
|
72857
|
-
case
|
|
73337
|
+
case 10:
|
|
72858
73338
|
_context11.t0 = _context11.sent;
|
|
72859
73339
|
return _context11.abrupt("return", {
|
|
72860
73340
|
results: _context11.t0
|
|
72861
73341
|
});
|
|
72862
|
-
case
|
|
73342
|
+
case 12:
|
|
72863
73343
|
case "end":
|
|
72864
73344
|
return _context11.stop();
|
|
72865
73345
|
}
|
|
@@ -73085,7 +73565,7 @@ VizzlyServices.HorizontalBarChart = HorizontalBarChart$2;
|
|
|
73085
73565
|
VizzlyServices.MercatorMap = MercatorMap$4;
|
|
73086
73566
|
VizzlyServices.SingleStat = SingleStat$3;
|
|
73087
73567
|
VizzlyServices.Progress = Progress$3;
|
|
73088
|
-
VizzlyServices.WaterfallChart = WaterfallChart$4;
|
|
73568
|
+
VizzlyServices.WaterfallChart = WaterfallChart$4;
|
|
73089
73569
|
// @ts-ignore
|
|
73090
73570
|
if (typeof window !== 'undefined' && !window.Vizzly) {
|
|
73091
73571
|
// @ts-ignore
|
|
@@ -75939,7 +76419,7 @@ var GlobalProviderContents = function GlobalProviderContents(props) {
|
|
|
75939
76419
|
});
|
|
75940
76420
|
};
|
|
75941
76421
|
|
|
75942
|
-
var _excluded$
|
|
76422
|
+
var _excluded$i = ["view"];
|
|
75943
76423
|
var Dashboard$2 = function Dashboard(props) {
|
|
75944
76424
|
var handleOnError = function handleOnError(error, errorInfo) {
|
|
75945
76425
|
return (props == null ? void 0 : props.onError) && (props == null ? void 0 : props.onError(error, errorInfo));
|
|
@@ -75960,7 +76440,7 @@ var Editor$1 = function Editor(props) {
|
|
|
75960
76440
|
var handleOnError = function handleOnError(error, errorInfo) {
|
|
75961
76441
|
return (props == null ? void 0 : props.onError) && (props == null ? void 0 : props.onError(error, errorInfo));
|
|
75962
76442
|
};
|
|
75963
|
-
var resetProps = _objectWithoutPropertiesLoose(props, _excluded$
|
|
76443
|
+
var resetProps = _objectWithoutPropertiesLoose(props, _excluded$i);
|
|
75964
76444
|
return jsxRuntime.jsxs(ErrorBoundary, {
|
|
75965
76445
|
renderOnError: function renderOnError() {
|
|
75966
76446
|
return jsxRuntime.jsx("p", {
|