@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
package/dist/dashboard.esm.js
CHANGED
|
@@ -33,7 +33,7 @@ import { LegendItem as LegendItem$1, LegendLabel } from '@visx/legend';
|
|
|
33
33
|
import { scaleOrdinal, scaleQuantize, scaleLinear, scalePoint, scaleTime, scaleBand } from '@visx/scale';
|
|
34
34
|
import Ordinal from '@visx/legend/lib/legends/Ordinal';
|
|
35
35
|
import { curveNatural, curveMonotoneX, curveMonotoneY, curveLinear, curveStep, curveStepBefore, curveStepAfter } from '@visx/curve';
|
|
36
|
-
import { Line as Line$1, LinePath,
|
|
36
|
+
import { Line as Line$1, LinePath, BarStack as BarStack$1, BarGroup as BarGroup$2, AreaStack as AreaStack$1, AreaClosed, LineRadial } from '@visx/shape';
|
|
37
37
|
import { Mercator, Graticule } from '@visx/geo';
|
|
38
38
|
import { feature } from 'topojson-client';
|
|
39
39
|
import ParentSize$1 from '@visx/responsive/lib/components/ParentSize';
|
|
@@ -1108,6 +1108,33 @@ var FieldNotFoundInDataSet = /*#__PURE__*/function (_ValidationError) {
|
|
|
1108
1108
|
return FieldNotFoundInDataSet;
|
|
1109
1109
|
}(ValidationError);
|
|
1110
1110
|
|
|
1111
|
+
var timeDimensionsConstants = QueryEngineConfig.Constants.timeDimensionsConstants;
|
|
1112
|
+
|
|
1113
|
+
// All the aggregates Vizzly supports somewhere...
|
|
1114
|
+
// Not necessarily all the aggregates that are supported because each
|
|
1115
|
+
// integration could support different aggregates
|
|
1116
|
+
|
|
1117
|
+
var id$1 = function id(metric) {
|
|
1118
|
+
if (!(metric != null && metric.truncate) || (metric == null ? void 0 : metric.truncate) == 'none') return metric == null ? void 0 : metric.field;
|
|
1119
|
+
return metric.field + "_" + metric.truncate;
|
|
1120
|
+
};
|
|
1121
|
+
var decodeId$1 = function decodeId(metric, supportedTimeTruncFunctions) {
|
|
1122
|
+
var parts = metric.split('_');
|
|
1123
|
+
var truncate = parts.pop();
|
|
1124
|
+
if (truncate && !isSupportedTimeTruncFunction(supportedTimeTruncFunctions, truncate)) {
|
|
1125
|
+
return null;
|
|
1126
|
+
}
|
|
1127
|
+
var field = parts.join('_');
|
|
1128
|
+
return {
|
|
1129
|
+
field: field,
|
|
1130
|
+
truncate: truncate != null ? truncate : ''
|
|
1131
|
+
};
|
|
1132
|
+
};
|
|
1133
|
+
var vizzlyManagedTimeDimensions = timeDimensionsConstants;
|
|
1134
|
+
var isSupportedTimeTruncFunction = function isSupportedTimeTruncFunction(supportedTimeFunctions, proposedFunction) {
|
|
1135
|
+
return [].concat(Object.keys(supportedTimeFunctions), ['none']).includes(proposedFunction);
|
|
1136
|
+
};
|
|
1137
|
+
|
|
1111
1138
|
var filterIsDate = function filterIsDate(filter) {
|
|
1112
1139
|
var isoDateRegex = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/;
|
|
1113
1140
|
if (!isoDateRegex.test(filter.value)) {
|
|
@@ -1342,6 +1369,103 @@ function extractValue(variables, key) {
|
|
|
1342
1369
|
return variables[key].value;
|
|
1343
1370
|
}
|
|
1344
1371
|
|
|
1372
|
+
var addAndFilters = function addAndFilters(filter, filterToAddToAll) {
|
|
1373
|
+
if (!filter || isEmpty$2(filter)) filter = [[]];
|
|
1374
|
+
return [].concat(filter).map(function (andFilter) {
|
|
1375
|
+
return [].concat(andFilter, filterToAddToAll);
|
|
1376
|
+
});
|
|
1377
|
+
};
|
|
1378
|
+
var filterAttributeToQueryFilter = function filterAttributeToQueryFilter(filters, queryEngineConfig, dataSet, params) {
|
|
1379
|
+
return filters.map(function (andFilters) {
|
|
1380
|
+
return [].concat(andFilters).flatMap(function (andFilter) {
|
|
1381
|
+
var _andFilter$function;
|
|
1382
|
+
// Stop unsupported time functions being used.
|
|
1383
|
+
if (andFilter["function"] && !isSupportedTimeTruncFunction(queryEngineConfig.supportedTimeTruncFunctions, andFilter["function"])) {
|
|
1384
|
+
throw "Query engine does not support the query function " + andFilter["function"] + ".";
|
|
1385
|
+
}
|
|
1386
|
+
var dataSetField = findField(dataSet, andFilter.field);
|
|
1387
|
+
var field = {
|
|
1388
|
+
type: 'field',
|
|
1389
|
+
value: andFilter.field,
|
|
1390
|
+
"function": (_andFilter$function = andFilter["function"]) != null ? _andFilter$function : 'none'
|
|
1391
|
+
};
|
|
1392
|
+
if (isCustomField(dataSetField)) {
|
|
1393
|
+
var _andFilter$function2;
|
|
1394
|
+
field = toQueryMeasure({
|
|
1395
|
+
field: dataSetField.id,
|
|
1396
|
+
"function": (_andFilter$function2 = andFilter["function"]) != null ? _andFilter$function2 : 'none'
|
|
1397
|
+
}, dataSetField, queryEngineConfig, dataSet, false, params);
|
|
1398
|
+
}
|
|
1399
|
+
// If `array_contains` operation has multiple. Then split these out into individual
|
|
1400
|
+
// checks.
|
|
1401
|
+
if ((andFilter.op == 'array_contains' || andFilter.op == 'array_does_not_contain') && Array.isArray(andFilter.value)) {
|
|
1402
|
+
return [].concat(andFilter.value).map(function (value) {
|
|
1403
|
+
return {
|
|
1404
|
+
field: field,
|
|
1405
|
+
op: andFilter.op,
|
|
1406
|
+
value: value
|
|
1407
|
+
};
|
|
1408
|
+
});
|
|
1409
|
+
}
|
|
1410
|
+
var value = useValue(andFilter.value, params.variables);
|
|
1411
|
+
if (isRelativeDateDefined(andFilter.value)) {
|
|
1412
|
+
value = calculateRelativeDate(andFilter.value);
|
|
1413
|
+
}
|
|
1414
|
+
if (filterIsDate(andFilter)) {
|
|
1415
|
+
value = getUTCDate(andFilter.value);
|
|
1416
|
+
}
|
|
1417
|
+
return [{
|
|
1418
|
+
field: field,
|
|
1419
|
+
op: andFilter.op,
|
|
1420
|
+
value: value
|
|
1421
|
+
}];
|
|
1422
|
+
});
|
|
1423
|
+
});
|
|
1424
|
+
};
|
|
1425
|
+
var isAvailable = function isAvailable(filter) {
|
|
1426
|
+
return filter && isArray(filter) && isArray(filter[0]);
|
|
1427
|
+
};
|
|
1428
|
+
var isAdditionalFilter = function isAdditionalFilter(value) {
|
|
1429
|
+
return value && isArray(value) && isArray(value[0]) && 'field' in value[0][0] && 'op' in value[0][0] && 'value' in value[0][0];
|
|
1430
|
+
};
|
|
1431
|
+
|
|
1432
|
+
var combineFilters = function combineFilters(array1, array2) {
|
|
1433
|
+
var validArray1 = array1.length > 0 && array1[0] ? array1 : [[]];
|
|
1434
|
+
var validArray2 = array2.length > 0 && array2[0] ? array2 : [[]];
|
|
1435
|
+
|
|
1436
|
+
// If array1 has more than one sub-array, loop through each sub-array in array1
|
|
1437
|
+
if (validArray1.length > 1) {
|
|
1438
|
+
return validArray1.map(function (subArray) {
|
|
1439
|
+
return [].concat(validArray2[0] || [], subArray || []);
|
|
1440
|
+
});
|
|
1441
|
+
}
|
|
1442
|
+
// Otherwise, if array2 has more than one sub-array, loop through array2
|
|
1443
|
+
else if (validArray2.length > 1) {
|
|
1444
|
+
return validArray2.map(function (subArray) {
|
|
1445
|
+
return [].concat(validArray1[0] || [], subArray || []);
|
|
1446
|
+
});
|
|
1447
|
+
}
|
|
1448
|
+
// Default: merge both single sub-arrays
|
|
1449
|
+
else {
|
|
1450
|
+
return [[].concat(validArray1[0] || [], validArray2[0] || [])];
|
|
1451
|
+
}
|
|
1452
|
+
};
|
|
1453
|
+
function combineForCustomMetricFilters(filters, customFilters) {
|
|
1454
|
+
var combinedFilters = [];
|
|
1455
|
+
if (customFilters && isAvailable(customFilters)) {
|
|
1456
|
+
customFilters.forEach(function (orFilterGroup) {
|
|
1457
|
+
combinedFilters = [].concat(combinedFilters, addAndFilters(filters != null ? filters : [], orFilterGroup));
|
|
1458
|
+
});
|
|
1459
|
+
} else {
|
|
1460
|
+
combinedFilters = filters != null ? filters : [];
|
|
1461
|
+
}
|
|
1462
|
+
return combinedFilters;
|
|
1463
|
+
}
|
|
1464
|
+
|
|
1465
|
+
var generateId = function generateId() {
|
|
1466
|
+
return v4().replace(/-/g, '');
|
|
1467
|
+
};
|
|
1468
|
+
|
|
1345
1469
|
/** Upcasts from an old global filter, to a new "additional filter" */
|
|
1346
1470
|
var upcastToAdditionalFilter = function upcastToAdditionalFilter(globalFilter) {
|
|
1347
1471
|
if (globalFilter.type == 'globalSelectFilter') {
|
|
@@ -1771,125 +1895,6 @@ var fromFilterConfig = function fromFilterConfig(filterConfig, dataSet, timeRang
|
|
|
1771
1895
|
return filters;
|
|
1772
1896
|
};
|
|
1773
1897
|
|
|
1774
|
-
var addAndFilters = function addAndFilters(filter, filterToAddToAll) {
|
|
1775
|
-
if (isEmpty$2(filterToAddToAll)) return [].concat(filter);
|
|
1776
|
-
if (!filter || isEmpty$2(filter)) filter = [[]];
|
|
1777
|
-
return [].concat(filter).map(function (andFilter) {
|
|
1778
|
-
return [].concat(andFilter, filterToAddToAll);
|
|
1779
|
-
});
|
|
1780
|
-
};
|
|
1781
|
-
var filterAttributeToQueryFilter = function filterAttributeToQueryFilter(filterAttrs, queryEngineConfig, dataSet, params) {
|
|
1782
|
-
var _params$filterConfig;
|
|
1783
|
-
// Either build using the filter attributes passed in, or take the viewFilters in the filter config.
|
|
1784
|
-
// They represent the same thing, however some view-filters are passed around in the filter config
|
|
1785
|
-
// to reduce custom metrics arguments being passed around.
|
|
1786
|
-
var filter = filterAttrs.length > 0 ? filterAttrs : ((_params$filterConfig = params.filterConfig) == null ? void 0 : _params$filterConfig.viewFilters) || [];
|
|
1787
|
-
var extraFilters = fromFilterConfig(params.filterConfig, dataSet, params.timeRangeOptions);
|
|
1788
|
-
var combinedFilters = addAndFilters(filter, extraFilters);
|
|
1789
|
-
if (Array.isArray(filter)) {
|
|
1790
|
-
return {
|
|
1791
|
-
type: 'orWhere',
|
|
1792
|
-
value: combinedFilters.map(function (andFilters) {
|
|
1793
|
-
return {
|
|
1794
|
-
type: 'andWhere',
|
|
1795
|
-
value: andFilters.map(function (filter) {
|
|
1796
|
-
var dataSetField = findField(dataSet, filter.field);
|
|
1797
|
-
var field = {
|
|
1798
|
-
type: 'field',
|
|
1799
|
-
value: filter.field,
|
|
1800
|
-
"function": filter["function"] || 'none'
|
|
1801
|
-
};
|
|
1802
|
-
if (isCustomField(dataSetField)) {
|
|
1803
|
-
var _filter$function;
|
|
1804
|
-
field = toQueryMeasure({
|
|
1805
|
-
field: dataSetField.id,
|
|
1806
|
-
"function": (_filter$function = filter["function"]) != null ? _filter$function : 'none'
|
|
1807
|
-
}, dataSetField, queryEngineConfig, dataSet, false, params);
|
|
1808
|
-
}
|
|
1809
|
-
|
|
1810
|
-
// 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
|
|
1811
|
-
// out this check into multiple filters, as a value in a filter cannot be an array.
|
|
1812
|
-
if ((filter.op == 'array_contains' || filter.op == 'array_does_not_contain') && Array.isArray(filter.value)) {
|
|
1813
|
-
return {
|
|
1814
|
-
type: 'andWhere',
|
|
1815
|
-
value: [].concat(filter.value).map(function (value) {
|
|
1816
|
-
return {
|
|
1817
|
-
type: 'where',
|
|
1818
|
-
value: {
|
|
1819
|
-
field: field,
|
|
1820
|
-
op: filter.op,
|
|
1821
|
-
value: value
|
|
1822
|
-
}
|
|
1823
|
-
};
|
|
1824
|
-
})
|
|
1825
|
-
};
|
|
1826
|
-
}
|
|
1827
|
-
var value = useValue(filter.value, params.variables);
|
|
1828
|
-
if (isRelativeDateDefined(filter.value)) {
|
|
1829
|
-
value = calculateRelativeDate(filter.value);
|
|
1830
|
-
}
|
|
1831
|
-
if (filterIsDate(filter)) {
|
|
1832
|
-
value = getUTCDate(filter.value);
|
|
1833
|
-
}
|
|
1834
|
-
return {
|
|
1835
|
-
type: 'where',
|
|
1836
|
-
value: {
|
|
1837
|
-
field: field,
|
|
1838
|
-
op: filter.op,
|
|
1839
|
-
value: value
|
|
1840
|
-
}
|
|
1841
|
-
};
|
|
1842
|
-
})
|
|
1843
|
-
};
|
|
1844
|
-
})
|
|
1845
|
-
};
|
|
1846
|
-
}
|
|
1847
|
-
return filter;
|
|
1848
|
-
};
|
|
1849
|
-
var isAvailable = function isAvailable(filter) {
|
|
1850
|
-
return filter && isArray(filter) && isArray(filter[0]);
|
|
1851
|
-
};
|
|
1852
|
-
var isAdditionalFilter = function isAdditionalFilter(value) {
|
|
1853
|
-
return value && isArray(value) && isArray(value[0]) && 'field' in value[0][0] && 'op' in value[0][0] && 'value' in value[0][0];
|
|
1854
|
-
};
|
|
1855
|
-
|
|
1856
|
-
var combineFilters = function combineFilters(array1, array2) {
|
|
1857
|
-
var validArray1 = array1.length > 0 && array1[0] ? array1 : [[]];
|
|
1858
|
-
var validArray2 = array2.length > 0 && array2[0] ? array2 : [[]];
|
|
1859
|
-
|
|
1860
|
-
// If array1 has more than one sub-array, loop through each sub-array in array1
|
|
1861
|
-
if (validArray1.length > 1) {
|
|
1862
|
-
return validArray1.map(function (subArray) {
|
|
1863
|
-
return [].concat(validArray2[0] || [], subArray || []);
|
|
1864
|
-
});
|
|
1865
|
-
}
|
|
1866
|
-
// Otherwise, if array2 has more than one sub-array, loop through array2
|
|
1867
|
-
else if (validArray2.length > 1) {
|
|
1868
|
-
return validArray2.map(function (subArray) {
|
|
1869
|
-
return [].concat(validArray1[0] || [], subArray || []);
|
|
1870
|
-
});
|
|
1871
|
-
}
|
|
1872
|
-
// Default: merge both single sub-arrays
|
|
1873
|
-
else {
|
|
1874
|
-
return [[].concat(validArray1[0] || [], validArray2[0] || [])];
|
|
1875
|
-
}
|
|
1876
|
-
};
|
|
1877
|
-
function combineForCustomMetricFilters(filters, customFilters) {
|
|
1878
|
-
var combinedFilters = [];
|
|
1879
|
-
if (customFilters && isAvailable(customFilters)) {
|
|
1880
|
-
customFilters.forEach(function (orFilterGroup) {
|
|
1881
|
-
combinedFilters = [].concat(combinedFilters, addAndFilters(filters != null ? filters : [], orFilterGroup));
|
|
1882
|
-
});
|
|
1883
|
-
} else {
|
|
1884
|
-
combinedFilters = filters != null ? filters : [];
|
|
1885
|
-
}
|
|
1886
|
-
return combinedFilters;
|
|
1887
|
-
}
|
|
1888
|
-
|
|
1889
|
-
var generateId = function generateId() {
|
|
1890
|
-
return v4().replace(/-/g, '');
|
|
1891
|
-
};
|
|
1892
|
-
|
|
1893
1898
|
/**
|
|
1894
1899
|
* Creates a new custom percentage field.
|
|
1895
1900
|
*/
|
|
@@ -1916,7 +1921,7 @@ var init$1 = function init(publicName, denominatorFieldId, denominatorAggregate,
|
|
|
1916
1921
|
var build$2 = function build(customField, queryEngineConfig, dataSet, _queryHasDimension, params) {
|
|
1917
1922
|
var _params$filterConfig$, _params$filterConfig, _customField$numerato, _customField$numerato2, _customField$denomina, _customField$denomina2;
|
|
1918
1923
|
var localAndDashboardFilters = fromFilterConfig(params.filterConfig, dataSet, params.timeRangeOptions);
|
|
1919
|
-
var _buildPercentageFilte = buildPercentageFilters(addAndFilters((_params$filterConfig$ = params == null || (_params$filterConfig = params.filterConfig) == null ? void 0 : _params$filterConfig.
|
|
1924
|
+
var _buildPercentageFilte = buildPercentageFilters(addAndFilters((_params$filterConfig$ = params == null || (_params$filterConfig = params.filterConfig) == null ? void 0 : _params$filterConfig.advancedFilter) != null ? _params$filterConfig$ : [], localAndDashboardFilters), customField),
|
|
1920
1925
|
combinedNominatorFilters = _buildPercentageFilte.combinedNominatorFilters,
|
|
1921
1926
|
combinedDenominatorFilters = _buildPercentageFilte.combinedDenominatorFilters;
|
|
1922
1927
|
var left = {
|
|
@@ -1938,36 +1943,24 @@ var build$2 = function build(customField, queryEngineConfig, dataSet, _queryHasD
|
|
|
1938
1943
|
filter: filterAttributeToQueryFilter(combinedDenominatorFilters || [], queryEngineConfig, dataSet, params)
|
|
1939
1944
|
}
|
|
1940
1945
|
};
|
|
1941
|
-
var denominatorForWithinGroupingScope = buildSide(right, isAvailable(customField.denominatorFilter) ? filterAttributeToQueryFilter(combinedDenominatorFilters, queryEngineConfig, dataSet, params) :
|
|
1942
|
-
type: 'andWhere',
|
|
1943
|
-
value: []
|
|
1944
|
-
});
|
|
1946
|
+
var denominatorForWithinGroupingScope = buildSide(right, isAvailable(customField.denominatorFilter) ? filterAttributeToQueryFilter(combinedDenominatorFilters, queryEngineConfig, dataSet, params) : []);
|
|
1945
1947
|
return {
|
|
1946
1948
|
type: 'maths',
|
|
1947
|
-
left: buildSide(left, isAvailable(customField.numeratorFilter) ? filterAttributeToQueryFilter(combinedNominatorFilters, queryEngineConfig, dataSet, params) :
|
|
1948
|
-
type: 'andWhere',
|
|
1949
|
-
value: []
|
|
1950
|
-
}),
|
|
1949
|
+
left: buildSide(left, isAvailable(customField.numeratorFilter) ? filterAttributeToQueryFilter(combinedNominatorFilters, queryEngineConfig, dataSet, params) : []),
|
|
1951
1950
|
op: '/',
|
|
1952
1951
|
right: customField.denominatorScope === 'withinGrouping' ? denominatorForWithinGroupingScope : denominatorForAllScope
|
|
1953
1952
|
};
|
|
1954
1953
|
};
|
|
1955
1954
|
var buildSide = function buildSide(field, filter) {
|
|
1956
|
-
var alwaysTrueFilter = {
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
op: '=',
|
|
1966
|
-
value: 2
|
|
1967
|
-
}
|
|
1968
|
-
}]
|
|
1969
|
-
};
|
|
1970
|
-
var hasNumeratorFilter = filter.type === 'where' || filter.value.length > 0;
|
|
1955
|
+
var alwaysTrueFilter = [[{
|
|
1956
|
+
value: 1,
|
|
1957
|
+
op: '=',
|
|
1958
|
+
field: {
|
|
1959
|
+
type: 'number',
|
|
1960
|
+
value: 1
|
|
1961
|
+
}
|
|
1962
|
+
}]];
|
|
1963
|
+
var hasNumeratorFilter = filter.length > 0 && filter[0].length > 0;
|
|
1971
1964
|
if (!hasNumeratorFilter) {
|
|
1972
1965
|
return {
|
|
1973
1966
|
type: 'field',
|
|
@@ -2341,7 +2334,7 @@ var buildIfLogic = function buildIfLogic(ifLogic, dataSet, localAndDashboardFilt
|
|
|
2341
2334
|
var cases = function () {
|
|
2342
2335
|
var thenCases = ifLogic.cases.map(function (c) {
|
|
2343
2336
|
var _params$filterConfig$, _params$filterConfig;
|
|
2344
|
-
var customMetricFilter = combineForCustomMetricFilters(addAndFilters((_params$filterConfig$ = params == null || (_params$filterConfig = params.filterConfig) == null ? void 0 : _params$filterConfig.
|
|
2337
|
+
var customMetricFilter = combineForCustomMetricFilters(addAndFilters((_params$filterConfig$ = params == null || (_params$filterConfig = params.filterConfig) == null ? void 0 : _params$filterConfig.advancedFilter) != null ? _params$filterConfig$ : [], localAndDashboardFilters), c.filter);
|
|
2345
2338
|
return {
|
|
2346
2339
|
returns: buildMetric(c.returns, dataSet, params, measureAttribute),
|
|
2347
2340
|
filter: filterAttributeToQueryFilter(customMetricFilter, queryEngineConfig, dataSet, params)
|
|
@@ -2649,33 +2642,6 @@ var mergeAttributes = function mergeAttributes(partial, existingProps) {
|
|
|
2649
2642
|
return _doMerge(existingProps, partial);
|
|
2650
2643
|
};
|
|
2651
2644
|
|
|
2652
|
-
var timeDimensionsConstants = QueryEngineConfig.Constants.timeDimensionsConstants;
|
|
2653
|
-
|
|
2654
|
-
// All the aggregates Vizzly supports somewhere...
|
|
2655
|
-
// Not necessarily all the aggregates that are supported because each
|
|
2656
|
-
// integration could support different aggregates
|
|
2657
|
-
|
|
2658
|
-
var id$1 = function id(metric) {
|
|
2659
|
-
if (!(metric != null && metric.truncate) || (metric == null ? void 0 : metric.truncate) == 'none') return metric == null ? void 0 : metric.field;
|
|
2660
|
-
return metric.field + "_" + metric.truncate;
|
|
2661
|
-
};
|
|
2662
|
-
var decodeId$1 = function decodeId(metric, supportedTimeTruncFunctions) {
|
|
2663
|
-
var parts = metric.split('_');
|
|
2664
|
-
var truncate = parts.pop();
|
|
2665
|
-
if (truncate && !isSupportedTimeTruncFunction(supportedTimeTruncFunctions, truncate)) {
|
|
2666
|
-
return null;
|
|
2667
|
-
}
|
|
2668
|
-
var field = parts.join('_');
|
|
2669
|
-
return {
|
|
2670
|
-
field: field,
|
|
2671
|
-
truncate: truncate != null ? truncate : ''
|
|
2672
|
-
};
|
|
2673
|
-
};
|
|
2674
|
-
var vizzlyManagedTimeDimensions = timeDimensionsConstants;
|
|
2675
|
-
var isSupportedTimeTruncFunction = function isSupportedTimeTruncFunction(supportedTimeFunctions, proposedFunction) {
|
|
2676
|
-
return [].concat(Object.keys(supportedTimeFunctions), ['none']).includes(proposedFunction);
|
|
2677
|
-
};
|
|
2678
|
-
|
|
2679
2645
|
var id$2 = id;
|
|
2680
2646
|
var decodeId$2 = decodeId;
|
|
2681
2647
|
var hasAggregate = function hasAggregate(metric) {
|
|
@@ -10553,7 +10519,7 @@ var WaterfallChart = function WaterfallChart(config) {
|
|
|
10553
10519
|
return removeField$1(attrs, fieldId, config.queryEngineConfig);
|
|
10554
10520
|
},
|
|
10555
10521
|
isRunnable: function isRunnable(hydrated) {
|
|
10556
|
-
return hydrated.measure.length > 0
|
|
10522
|
+
return hydrated.measure.length > 0;
|
|
10557
10523
|
},
|
|
10558
10524
|
autoGenerate: function autoGenerate(dataSet) {
|
|
10559
10525
|
var _DataSet$buildQueryAt = buildQueryAttributes(dataSet, config.queryEngineConfig, 'waterfallChart'),
|
|
@@ -10578,8 +10544,7 @@ var WaterfallChart = function WaterfallChart(config) {
|
|
|
10578
10544
|
getValues: function getValues(attrs) {
|
|
10579
10545
|
return attrs.measure;
|
|
10580
10546
|
},
|
|
10581
|
-
testId: 'metric-input'
|
|
10582
|
-
maxAllowed: 1
|
|
10547
|
+
testId: 'metric-input'
|
|
10583
10548
|
}), _extends({}, namespace(CONSTANTS$l, 'field_x_axis'), {
|
|
10584
10549
|
fieldFilterOptions: {
|
|
10585
10550
|
forComponent: 'waterfallChart',
|
|
@@ -10592,7 +10557,7 @@ var WaterfallChart = function WaterfallChart(config) {
|
|
|
10592
10557
|
getValues: function getValues(attrs) {
|
|
10593
10558
|
return getGroupingWithTimeDimension(attrs);
|
|
10594
10559
|
},
|
|
10595
|
-
maxAllowed:
|
|
10560
|
+
maxAllowed: 2,
|
|
10596
10561
|
testId: 'add-dimension'
|
|
10597
10562
|
}), namespace(CONSTANTS$l, 'sort'), namespace(CONSTANTS$l, 'filter'), namespace(CONSTANTS$l, 'custom_metrics'), namespace(CONSTANTS$l, 'limit')];
|
|
10598
10563
|
},
|
|
@@ -14553,7 +14518,7 @@ var buildDefaults = function buildDefaults(partialFeatureToggles) {
|
|
|
14553
14518
|
};
|
|
14554
14519
|
};
|
|
14555
14520
|
|
|
14556
|
-
var ALL_COMPONENT_TYPES = ['barChart', '
|
|
14521
|
+
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'];
|
|
14557
14522
|
var ALL_VIZZLY_COMPONENT_TYPES = /*#__PURE__*/[].concat(ALL_COMPONENT_TYPES).filter(function (type) {
|
|
14558
14523
|
return type != 'custom';
|
|
14559
14524
|
});
|
|
@@ -14563,6 +14528,7 @@ var initial = function initial(attributes) {
|
|
|
14563
14528
|
return {
|
|
14564
14529
|
attributes: attributes,
|
|
14565
14530
|
localFilters: [],
|
|
14531
|
+
results: [],
|
|
14566
14532
|
colSpan: POPULATE_ONE_CELL,
|
|
14567
14533
|
reports: []
|
|
14568
14534
|
};
|
|
@@ -15006,12 +14972,10 @@ var load$2 = function load$1(dumped, componentInterfaceConfig) {
|
|
|
15006
14972
|
delete dumped['addOns'];
|
|
15007
14973
|
// @ts-ignore
|
|
15008
14974
|
delete attributes['addOns'];
|
|
15009
|
-
|
|
15010
|
-
// @ts-ignore
|
|
15011
|
-
delete attributes['results'];
|
|
15012
14975
|
return _extends({}, dumped, {
|
|
15013
14976
|
localFilters: localFilters,
|
|
15014
|
-
attributes: attributes
|
|
14977
|
+
attributes: attributes,
|
|
14978
|
+
results: []
|
|
15015
14979
|
});
|
|
15016
14980
|
};
|
|
15017
14981
|
var dump$2 = function dump$1(hydrated) {
|
|
@@ -15038,6 +15002,7 @@ var saveable = function saveable(component, protectedComponent) {
|
|
|
15038
15002
|
}),
|
|
15039
15003
|
localFilters: (_component$localFilte = component.localFilters) != null ? _component$localFilte : [],
|
|
15040
15004
|
colSpan: 1,
|
|
15005
|
+
results: [],
|
|
15041
15006
|
reports: []
|
|
15042
15007
|
};
|
|
15043
15008
|
};
|
|
@@ -15513,6 +15478,8 @@ var init$b = function init(overrides, includeComponentTypes, excludeComponentTyp
|
|
|
15513
15478
|
var temporaryExcludedComponentTypes = [];
|
|
15514
15479
|
// TODO: Remove this once RichText is supported in the UI
|
|
15515
15480
|
temporaryExcludedComponentTypes.push('richText');
|
|
15481
|
+
// TODO: Remove this once representation charts (aka v2 charts) are finished and working as expected
|
|
15482
|
+
temporaryExcludedComponentTypes.push('areaChartV2', 'barChartV2', 'bubbleChartV2', 'comboChartV2', 'lineChartV2', 'radarChart', 'waterfallChart');
|
|
15516
15483
|
var allowedView = filterIncludedAndExcludedViews(ALL_VIZZLY_COMPONENT_TYPES, includeComponentTypes, excludeComponentTypes ? [].concat(excludeComponentTypes, temporaryExcludedComponentTypes) : [].concat(temporaryExcludedComponentTypes));
|
|
15517
15484
|
return allowedView.filter(function (view) {
|
|
15518
15485
|
var hasSupportForPreAggregatedDataSets = !!getComponentInterface(view).setDataAttributesFromPreAggregatedDataSet;
|
|
@@ -23104,6 +23071,18 @@ var pickComponentFromLibraryForDisplay = function pickComponentFromLibraryForDis
|
|
|
23104
23071
|
pickFromComponentLibrary: null
|
|
23105
23072
|
});
|
|
23106
23073
|
};
|
|
23074
|
+
var setResultsForComponentInDisplay = function setResultsForComponentInDisplay(state, action) {
|
|
23075
|
+
var results = action.results,
|
|
23076
|
+
rowIndex = action.rowIndex,
|
|
23077
|
+
cellIndex = action.cellIndex;
|
|
23078
|
+
var currentComponent = state.dashboard.display[rowIndex].components[cellIndex];
|
|
23079
|
+
if (!currentComponent) throw 'We can only set results on an existing component on the dashboard.';
|
|
23080
|
+
var newComponent = _extends({}, currentComponent, {
|
|
23081
|
+
results: results
|
|
23082
|
+
});
|
|
23083
|
+
var newState = _setComponentInDisplayHelper(state, newComponent, rowIndex, cellIndex);
|
|
23084
|
+
return _extends({}, newState);
|
|
23085
|
+
};
|
|
23107
23086
|
var updateComponentLibraryAttributes = function updateComponentLibraryAttributes(state, action) {
|
|
23108
23087
|
var libraryIndex = action.libraryIndex,
|
|
23109
23088
|
attributes = action.attributes;
|
|
@@ -23117,6 +23096,31 @@ var updateComponentLibraryAttributes = function updateComponentLibraryAttributes
|
|
|
23117
23096
|
})
|
|
23118
23097
|
});
|
|
23119
23098
|
};
|
|
23099
|
+
var setResultsForComponentInEditor = function setResultsForComponentInEditor(state, action) {
|
|
23100
|
+
if (!state.componentEditor) throw 'Cannot set results for a closed editor.';
|
|
23101
|
+
if (!state.componentEditor.component) throw 'Cannot set results for a non-existant component in editor.';
|
|
23102
|
+
var results = action.results;
|
|
23103
|
+
return _extends({}, state, {
|
|
23104
|
+
componentEditor: _extends({}, state.componentEditor, {
|
|
23105
|
+
component: _extends({}, state.componentEditor.component, {
|
|
23106
|
+
results: results
|
|
23107
|
+
})
|
|
23108
|
+
})
|
|
23109
|
+
});
|
|
23110
|
+
};
|
|
23111
|
+
var setResultsForComponentInLibrary = function setResultsForComponentInLibrary(state, action) {
|
|
23112
|
+
var libraryIndex = action.libraryIndex,
|
|
23113
|
+
results = action.results;
|
|
23114
|
+
var componentLibrary = [].concat(state.dashboard.componentLibrary);
|
|
23115
|
+
componentLibrary[libraryIndex] = _extends({}, componentLibrary[libraryIndex], {
|
|
23116
|
+
results: results
|
|
23117
|
+
});
|
|
23118
|
+
return _extends({}, state, {
|
|
23119
|
+
dashboard: _extends({}, state.dashboard, {
|
|
23120
|
+
componentLibrary: componentLibrary
|
|
23121
|
+
})
|
|
23122
|
+
});
|
|
23123
|
+
};
|
|
23120
23124
|
var clearModal = function clearModal(state, _action) {
|
|
23121
23125
|
return _extends({}, state, {
|
|
23122
23126
|
pickFromComponentLibrary: null,
|
|
@@ -23512,6 +23516,12 @@ var reducer = function reducer(pipelineTransformationOptions) {
|
|
|
23512
23516
|
return clearModal(state);
|
|
23513
23517
|
case 'updateEditorComponent':
|
|
23514
23518
|
return updateEditorComponent(state, action);
|
|
23519
|
+
case 'setResultsForComponentInDisplay':
|
|
23520
|
+
return setResultsForComponentInDisplay(state, action);
|
|
23521
|
+
case 'setResultsForComponentInLibrary':
|
|
23522
|
+
return setResultsForComponentInLibrary(state, action);
|
|
23523
|
+
case 'setResultsForComponentInEditor':
|
|
23524
|
+
return setResultsForComponentInEditor(state, action);
|
|
23515
23525
|
case 'pickComponentFromLibraryForDisplay':
|
|
23516
23526
|
return pickComponentFromLibraryForDisplay(state, action);
|
|
23517
23527
|
case 'setDashboard':
|
|
@@ -25900,15 +25910,149 @@ var filterStyles = /*#__PURE__*/Object.assign(function () {
|
|
|
25900
25910
|
complete: complete
|
|
25901
25911
|
});
|
|
25902
25912
|
|
|
25913
|
+
var Clause = /*#__PURE__*/function (Clause) {
|
|
25914
|
+
Clause["AND_WHERE"] = "andWhere";
|
|
25915
|
+
Clause["OR_WHERE"] = "orWhere";
|
|
25916
|
+
Clause["WHERE"] = "where";
|
|
25917
|
+
return Clause;
|
|
25918
|
+
}({});
|
|
25919
|
+
|
|
25920
|
+
// export type WhereClause = SqlAST.MultiWhereToken<any>;
|
|
25921
|
+
|
|
25922
|
+
var filterConfigToWhere = function filterConfigToWhere(dataSet, queryEngineConfig, params) {
|
|
25923
|
+
if (!params) return undefined;
|
|
25924
|
+
var filterConfig = params.filterConfig;
|
|
25925
|
+
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) {
|
|
25926
|
+
return arr.length === 0;
|
|
25927
|
+
}))) {
|
|
25928
|
+
return undefined;
|
|
25929
|
+
}
|
|
25930
|
+
var dash = buildAndWhere(dataSet, queryEngineConfig, params, filterConfig.globalFilters);
|
|
25931
|
+
var local = buildAndWhere(dataSet, queryEngineConfig, params, filterConfig.localFilters);
|
|
25932
|
+
var advancedFilters = buildFromFiltersArray(dataSet, queryEngineConfig, params, filterConfig.advancedFilter);
|
|
25933
|
+
var combinedAndWhere = [dash, local, advancedFilters].filter(Boolean).filter(function (whereClause) {
|
|
25934
|
+
return whereClause && whereClause.value.length > 0;
|
|
25935
|
+
});
|
|
25936
|
+
if (combinedAndWhere.length === 0) return undefined;
|
|
25937
|
+
return {
|
|
25938
|
+
type: Clause.AND_WHERE,
|
|
25939
|
+
value: combinedAndWhere
|
|
25940
|
+
};
|
|
25941
|
+
};
|
|
25942
|
+
var buildAndWhere = function buildAndWhere(dataSet, queryEngineConfig, params, additionalFilters) {
|
|
25943
|
+
if (!additionalFilters || additionalFilters.length === 0) return undefined;
|
|
25944
|
+
var whereClauses = [];
|
|
25945
|
+
additionalFilters.forEach(function (additionalFilter) {
|
|
25946
|
+
if (additionalFilter.type === DATE_AND_TIME_FILTER || additionalFilter.type === DATE_FILTER) {
|
|
25947
|
+
toRelativeQueryAttributesFilters(additionalFilter, dataSet).forEach(function (f) {
|
|
25948
|
+
whereClauses.push(buildWhereFromSingleFilter(dataSet, f, queryEngineConfig, params));
|
|
25949
|
+
});
|
|
25950
|
+
}
|
|
25951
|
+
if (Array.isArray(additionalFilter.value) && additionalFilter.value.length > 1 && isAdditionalFilter(additionalFilter.value)) {
|
|
25952
|
+
additionalFilter.appliesToFields.flatMap(function (field) {
|
|
25953
|
+
if (field.dataSetId != dataSet.id) return [];
|
|
25954
|
+
var convertedToWhere = buildFromFiltersArray(dataSet, queryEngineConfig, params, additionalFilter.value);
|
|
25955
|
+
if (convertedToWhere) {
|
|
25956
|
+
whereClauses.push(convertedToWhere);
|
|
25957
|
+
}
|
|
25958
|
+
return;
|
|
25959
|
+
});
|
|
25960
|
+
} else {
|
|
25961
|
+
toQueryAttributesFilter(dataSet, additionalFilter, params.timeRangeOptions).forEach(function (f) {
|
|
25962
|
+
whereClauses.push(buildWhereFromSingleFilter(dataSet, f, queryEngineConfig, params));
|
|
25963
|
+
});
|
|
25964
|
+
}
|
|
25965
|
+
});
|
|
25966
|
+
return {
|
|
25967
|
+
type: Clause.AND_WHERE,
|
|
25968
|
+
value: whereClauses
|
|
25969
|
+
};
|
|
25970
|
+
};
|
|
25971
|
+
var buildWhereFromSingleFilter = function buildWhereFromSingleFilter(dataSet, f, queryEngineConfig, params) {
|
|
25972
|
+
var field;
|
|
25973
|
+
if (f["function"] && !isSupportedTimeTruncFunction(queryEngineConfig.supportedTimeTruncFunctions, f["function"])) {
|
|
25974
|
+
throw "Query engine does not support the query function " + f["function"] + ".";
|
|
25975
|
+
}
|
|
25976
|
+
var dataSetField = findField(dataSet, f.field);
|
|
25977
|
+
if (isCustomField(dataSetField)) {
|
|
25978
|
+
var _f$function;
|
|
25979
|
+
field = toQueryMeasure({
|
|
25980
|
+
field: dataSetField.id,
|
|
25981
|
+
"function": (_f$function = f["function"]) != null ? _f$function : 'none'
|
|
25982
|
+
}, dataSetField, queryEngineConfig, dataSet, false, params);
|
|
25983
|
+
} else {
|
|
25984
|
+
var _decodedField$functio;
|
|
25985
|
+
var decodedField = decodeId(f.field, queryEngineConfig);
|
|
25986
|
+
field = {
|
|
25987
|
+
type: 'field',
|
|
25988
|
+
value: decodedField.field,
|
|
25989
|
+
"function": (_decodedField$functio = decodedField["function"]) != null ? _decodedField$functio : 'none'
|
|
25990
|
+
};
|
|
25991
|
+
}
|
|
25992
|
+
if ((f.op == 'array_contains' || f.op == 'array_does_not_contain') && Array.isArray(f.value)) {
|
|
25993
|
+
return arrayContainsFilters(f, dataSet, queryEngineConfig, params);
|
|
25994
|
+
}
|
|
25995
|
+
var value = useValue(f.value, params.variables);
|
|
25996
|
+
if (isRelativeDateDefined(f.value)) {
|
|
25997
|
+
value = calculateRelativeDate(f.value);
|
|
25998
|
+
}
|
|
25999
|
+
if (filterIsDate(f)) {
|
|
26000
|
+
value = getUTCDate(f.value);
|
|
26001
|
+
}
|
|
26002
|
+
return {
|
|
26003
|
+
type: Clause.WHERE,
|
|
26004
|
+
value: {
|
|
26005
|
+
op: f.op,
|
|
26006
|
+
value: value,
|
|
26007
|
+
field: field
|
|
26008
|
+
}
|
|
26009
|
+
};
|
|
26010
|
+
};
|
|
26011
|
+
var buildFromFiltersArray = function buildFromFiltersArray(dataSet, queryEngineConfig, params, filters) {
|
|
26012
|
+
if (!filters || filters.length === 0 || filters.every(function (arr) {
|
|
26013
|
+
return arr.length === 0;
|
|
26014
|
+
})) {
|
|
26015
|
+
return undefined;
|
|
26016
|
+
}
|
|
26017
|
+
if (filters.length === 1) return buildFromFilters(filters[0], dataSet, queryEngineConfig, params);
|
|
26018
|
+
return {
|
|
26019
|
+
type: Clause.OR_WHERE,
|
|
26020
|
+
value: filters.map(function (filter) {
|
|
26021
|
+
return buildFromFilters(filter, dataSet, queryEngineConfig, params);
|
|
26022
|
+
})
|
|
26023
|
+
};
|
|
26024
|
+
};
|
|
26025
|
+
var buildFromFilters = function buildFromFilters(filter, dataSet, queryEngineConfig, params) {
|
|
26026
|
+
return {
|
|
26027
|
+
type: Clause.AND_WHERE,
|
|
26028
|
+
value: filter.map(function (filter) {
|
|
26029
|
+
if ((filter.op == 'array_contains' || filter.op == 'array_does_not_contain') && Array.isArray(filter.value)) {
|
|
26030
|
+
return arrayContainsFilters(filter, dataSet, queryEngineConfig, params);
|
|
26031
|
+
}
|
|
26032
|
+
return buildWhereFromSingleFilter(dataSet, filter, queryEngineConfig, params);
|
|
26033
|
+
})
|
|
26034
|
+
};
|
|
26035
|
+
};
|
|
26036
|
+
var arrayContainsFilters = function arrayContainsFilters(filter, dataSet, queryEngineConfig, params) {
|
|
26037
|
+
return {
|
|
26038
|
+
type: Clause.AND_WHERE,
|
|
26039
|
+
value: [].concat(filter.value).map(function (value) {
|
|
26040
|
+
return buildWhereFromSingleFilter(dataSet, _extends({}, filter, {
|
|
26041
|
+
value: value
|
|
26042
|
+
}), queryEngineConfig, params);
|
|
26043
|
+
})
|
|
26044
|
+
};
|
|
26045
|
+
};
|
|
26046
|
+
|
|
25903
26047
|
var addMeasure = function addMeasure(current, toAdd) {
|
|
25904
26048
|
return [[].concat(current, [toAdd]), current.length];
|
|
25905
26049
|
};
|
|
25906
|
-
var buildFromQueryAttributes = function buildFromQueryAttributes(dataSet, measureAttr,
|
|
26050
|
+
var buildFromQueryAttributes = function buildFromQueryAttributes(dataSet, measureAttr, orderAttr, dimensionAttr, timeDimensionAttr, limitAttr, offsetAttr, queryEngineConfig, params, prebuiltFilters) {
|
|
25907
26051
|
var measureDescription = [];
|
|
25908
26052
|
var measure = [];
|
|
25909
26053
|
var group = [];
|
|
25910
26054
|
var order = [];
|
|
25911
|
-
var filters =
|
|
26055
|
+
var filters = buildFilters(dataSet, queryEngineConfig, params, prebuiltFilters);
|
|
25912
26056
|
if (timeDimensionAttr) {
|
|
25913
26057
|
// Add the measure for the time field.
|
|
25914
26058
|
var addedAt = undefined;
|
|
@@ -25966,19 +26110,24 @@ var buildFromQueryAttributes = function buildFromQueryAttributes(dataSet, measur
|
|
|
25966
26110
|
field: findField(dataSet, individualMeasure.field)
|
|
25967
26111
|
}]);
|
|
25968
26112
|
});
|
|
25969
|
-
orderAttr.forEach(function (
|
|
26113
|
+
orderAttr.forEach(function (apiQueryOrderItem) {
|
|
25970
26114
|
var index = measure.findIndex(function (individualMeasure) {
|
|
25971
26115
|
if (individualMeasure.type == 'field') {
|
|
25972
|
-
var sameFunction = individualMeasure["function"] ==
|
|
25973
|
-
|
|
26116
|
+
var sameFunction = individualMeasure["function"] == apiQueryOrderItem["function"];
|
|
26117
|
+
// const isTimeFunc = Object.keys(queryEngineConfig.supportedTimeTruncFunctions).includes(
|
|
26118
|
+
// individualMeasure.function
|
|
26119
|
+
// );
|
|
26120
|
+
var sameField = individualMeasure.value == apiQueryOrderItem.field;
|
|
25974
26121
|
return sameField && sameFunction;
|
|
26122
|
+
|
|
26123
|
+
// return found;
|
|
25975
26124
|
}
|
|
25976
26125
|
return false;
|
|
25977
26126
|
});
|
|
25978
26127
|
if (index >= 0) {
|
|
25979
26128
|
order = [].concat(order, [{
|
|
25980
26129
|
index: index,
|
|
25981
|
-
direction:
|
|
26130
|
+
direction: apiQueryOrderItem.direction
|
|
25982
26131
|
}]);
|
|
25983
26132
|
}
|
|
25984
26133
|
});
|
|
@@ -26003,6 +26152,7 @@ var buildFromQueryAttributes = function buildFromQueryAttributes(dataSet, measur
|
|
|
26003
26152
|
dataSetId: dataSet.id,
|
|
26004
26153
|
measure: measure,
|
|
26005
26154
|
group: group,
|
|
26155
|
+
// TODO: Fix this type
|
|
26006
26156
|
filter: filters,
|
|
26007
26157
|
order: order,
|
|
26008
26158
|
limit: limitAttr,
|
|
@@ -26011,6 +26161,19 @@ var buildFromQueryAttributes = function buildFromQueryAttributes(dataSet, measur
|
|
|
26011
26161
|
measureDescription: measureDescription
|
|
26012
26162
|
};
|
|
26013
26163
|
};
|
|
26164
|
+
var buildFilters = function buildFilters(dataSet, queryEngineConfig, params, prebuiltFilters) {
|
|
26165
|
+
if (prebuiltFilters && prebuiltFilters.length > 0) {
|
|
26166
|
+
var filter = [];
|
|
26167
|
+
prebuiltFilters.forEach(function (andFilters) {
|
|
26168
|
+
var newAndFilters = filterAttributeToQueryFilter([andFilters], queryEngineConfig, dataSet, params);
|
|
26169
|
+
filter = [].concat(filter, [newAndFilters[0]]);
|
|
26170
|
+
});
|
|
26171
|
+
return filter;
|
|
26172
|
+
}
|
|
26173
|
+
var whereClause = filterConfigToWhere(dataSet, queryEngineConfig, params);
|
|
26174
|
+
if (whereClause) return whereClause;
|
|
26175
|
+
return [];
|
|
26176
|
+
};
|
|
26014
26177
|
|
|
26015
26178
|
var build$c = buildFromQueryAttributes;
|
|
26016
26179
|
var hasDimensions = function hasDimensions(query) {
|
|
@@ -26038,10 +26201,7 @@ var buildUniqueArrayValuesPreparedQuery = function buildUniqueArrayValuesPrepare
|
|
|
26038
26201
|
preparedQueryType: 'uniqueArrayValues',
|
|
26039
26202
|
dataSetId: dataSetId,
|
|
26040
26203
|
fieldId: dataSetField.id,
|
|
26041
|
-
filter: optionsFilters ||
|
|
26042
|
-
type: 'andWhere',
|
|
26043
|
-
value: []
|
|
26044
|
-
}
|
|
26204
|
+
filter: optionsFilters || []
|
|
26045
26205
|
},
|
|
26046
26206
|
resultFields: [{
|
|
26047
26207
|
id: dataSetField.id,
|
|
@@ -26088,16 +26248,9 @@ var watchDataSetFieldChanges = function watchDataSetFieldChanges(dataSet, querya
|
|
|
26088
26248
|
// Custom fields are the only ones that can have their definition changed. So
|
|
26089
26249
|
// we only need to watch them.
|
|
26090
26250
|
var watchedCustomFields = watchFields.flatMap(function (fieldId) {
|
|
26091
|
-
|
|
26092
|
-
|
|
26093
|
-
|
|
26094
|
-
return [];
|
|
26095
|
-
} catch (err) {
|
|
26096
|
-
if (err instanceof FieldNotFoundInDataSet) {
|
|
26097
|
-
return [];
|
|
26098
|
-
}
|
|
26099
|
-
throw err;
|
|
26100
|
-
}
|
|
26251
|
+
var dataSetField = findField(dataSet, fieldId);
|
|
26252
|
+
if (isCustomField(dataSetField)) return [dataSetField];
|
|
26253
|
+
return [];
|
|
26101
26254
|
});
|
|
26102
26255
|
return JSON.stringify(watchedCustomFields);
|
|
26103
26256
|
} else {
|
|
@@ -26257,70 +26410,78 @@ var useVariablesInDataSet = function useVariablesInDataSet(dataSet, queryable, v
|
|
|
26257
26410
|
// How to make sure the queries run when a field in a data set has been changed.
|
|
26258
26411
|
// need to pass in the data sets here
|
|
26259
26412
|
|
|
26260
|
-
var useQueryEffect = function useQueryEffect(queries, runQueriesCallback, filterConfig, dataSet, componentType, variables) {
|
|
26261
|
-
var _useState = useState(
|
|
26262
|
-
|
|
26263
|
-
|
|
26264
|
-
var _useState2 = useState(false),
|
|
26265
|
-
queriesAreChanging = _useState2[0],
|
|
26266
|
-
setQueriesAreChanging = _useState2[1];
|
|
26413
|
+
var useQueryEffect = function useQueryEffect(queries, runQueriesCallback, onResultsCallback, filterConfig, dataSet, componentType, variables) {
|
|
26414
|
+
var _useState = useState(false),
|
|
26415
|
+
queriesAreChanging = _useState[0],
|
|
26416
|
+
setQueriesAreChanging = _useState[1];
|
|
26267
26417
|
var _useVariablesInDataSe = useVariablesInDataSet(dataSet, queries, variables),
|
|
26268
26418
|
noOfVariableChanges = _useVariablesInDataSe.noOfVariableChanges;
|
|
26269
|
-
|
|
26270
|
-
|
|
26271
|
-
|
|
26272
|
-
|
|
26273
|
-
var
|
|
26274
|
-
var
|
|
26275
|
-
|
|
26276
|
-
|
|
26277
|
-
|
|
26278
|
-
|
|
26279
|
-
|
|
26280
|
-
|
|
26281
|
-
|
|
26282
|
-
|
|
26283
|
-
|
|
26284
|
-
|
|
26285
|
-
|
|
26286
|
-
|
|
26287
|
-
|
|
26288
|
-
|
|
26289
|
-
|
|
26290
|
-
if (Array.isArray(queries)) {
|
|
26291
|
-
setResults(queries.map(function (_q) {
|
|
26292
|
-
return null;
|
|
26293
|
-
}));
|
|
26419
|
+
try {
|
|
26420
|
+
var watchCustomFieldChangesKey = watchDataSetFieldChanges(dataSet, queries);
|
|
26421
|
+
useEffect(function () {
|
|
26422
|
+
var abortController = new AbortController();
|
|
26423
|
+
var fetch$1 = /*#__PURE__*/function () {
|
|
26424
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
26425
|
+
var hasResults;
|
|
26426
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
26427
|
+
while (1) switch (_context.prev = _context.next) {
|
|
26428
|
+
case 0:
|
|
26429
|
+
setQueriesAreChanging(true);
|
|
26430
|
+
_context.next = 3;
|
|
26431
|
+
return fetch(queries, runQueriesCallback, abortController.signal, filterConfig);
|
|
26432
|
+
case 3:
|
|
26433
|
+
hasResults = _context.sent;
|
|
26434
|
+
if (hasResults) {
|
|
26435
|
+
setQueriesAreChanging(false);
|
|
26436
|
+
if (!abortController.signal.aborted) {
|
|
26437
|
+
// Only set the results if the signal was not aborted...
|
|
26438
|
+
onResultsCallback(hasResults);
|
|
26439
|
+
}
|
|
26294
26440
|
} else {
|
|
26295
|
-
|
|
26441
|
+
if (Array.isArray(queries)) {
|
|
26442
|
+
onResultsCallback(queries.map(function (_q) {
|
|
26443
|
+
return null;
|
|
26444
|
+
}));
|
|
26445
|
+
} else {
|
|
26446
|
+
onResultsCallback([null]);
|
|
26447
|
+
}
|
|
26296
26448
|
}
|
|
26297
|
-
|
|
26298
|
-
|
|
26299
|
-
|
|
26300
|
-
|
|
26301
|
-
}
|
|
26302
|
-
}
|
|
26303
|
-
|
|
26304
|
-
|
|
26305
|
-
|
|
26449
|
+
case 5:
|
|
26450
|
+
case "end":
|
|
26451
|
+
return _context.stop();
|
|
26452
|
+
}
|
|
26453
|
+
}, _callee);
|
|
26454
|
+
}));
|
|
26455
|
+
return function fetch() {
|
|
26456
|
+
return _ref.apply(this, arguments);
|
|
26457
|
+
};
|
|
26458
|
+
}();
|
|
26459
|
+
fetch$1();
|
|
26460
|
+
return function () {
|
|
26461
|
+
abortController.abort('useQueryEffect unmounted');
|
|
26306
26462
|
};
|
|
26307
|
-
}(
|
|
26308
|
-
|
|
26309
|
-
|
|
26310
|
-
|
|
26463
|
+
}, [JSON.stringify({
|
|
26464
|
+
componentType: componentType,
|
|
26465
|
+
dataSetId: dataSet.id,
|
|
26466
|
+
queries: queries,
|
|
26467
|
+
filterConfig: filterConfig,
|
|
26468
|
+
watchCustomFieldChangesKey: watchCustomFieldChangesKey,
|
|
26469
|
+
noOfVariableChanges: noOfVariableChanges
|
|
26470
|
+
})]);
|
|
26471
|
+
return {
|
|
26472
|
+
queriesAreChanging: queriesAreChanging
|
|
26311
26473
|
};
|
|
26312
|
-
}
|
|
26313
|
-
|
|
26314
|
-
|
|
26315
|
-
|
|
26316
|
-
|
|
26317
|
-
|
|
26318
|
-
|
|
26319
|
-
|
|
26320
|
-
|
|
26321
|
-
|
|
26322
|
-
|
|
26323
|
-
};
|
|
26474
|
+
} catch (err) {
|
|
26475
|
+
setQueriesAreChanging(false);
|
|
26476
|
+
if (err instanceof FieldNotFoundInDataSet) {
|
|
26477
|
+
return {
|
|
26478
|
+
queriesAreChanging: false
|
|
26479
|
+
};
|
|
26480
|
+
}
|
|
26481
|
+
|
|
26482
|
+
// Re-throw
|
|
26483
|
+
throw err;
|
|
26484
|
+
}
|
|
26324
26485
|
};
|
|
26325
26486
|
|
|
26326
26487
|
/** Fetches unique field values for a given field. */
|
|
@@ -26329,6 +26490,9 @@ var useUniqueFieldValues = function useUniqueFieldValues(dataSet, fieldId) {
|
|
|
26329
26490
|
runQueriesCallback = _useDashboardContext.runQueriesCallback;
|
|
26330
26491
|
var _useDashboardBehaviou = useDashboardBehaviourContext(),
|
|
26331
26492
|
variables = _useDashboardBehaviou.variables;
|
|
26493
|
+
var _useState = useState(undefined),
|
|
26494
|
+
result = _useState[0],
|
|
26495
|
+
setResult = _useState[1];
|
|
26332
26496
|
var queries = [];
|
|
26333
26497
|
var dataSetField = findField(dataSet, fieldId);
|
|
26334
26498
|
if (dataSetField.dataType == 'string[]') {
|
|
@@ -26340,9 +26504,10 @@ var useUniqueFieldValues = function useUniqueFieldValues(dataSet, fieldId) {
|
|
|
26340
26504
|
var filterQuery = buildFilterQuery(dataSet, fieldId);
|
|
26341
26505
|
queries = [filterQuery];
|
|
26342
26506
|
}
|
|
26343
|
-
|
|
26344
|
-
|
|
26345
|
-
|
|
26507
|
+
useQueryEffect(queries, runQueriesCallback, function (results) {
|
|
26508
|
+
if (results === null) setResult(null);
|
|
26509
|
+
if (results) setResult(results[0]);
|
|
26510
|
+
}, {}, dataSet, undefined, variables);
|
|
26346
26511
|
return {
|
|
26347
26512
|
result: result != null ? result : null,
|
|
26348
26513
|
loading: result === undefined,
|
|
@@ -26764,7 +26929,7 @@ var useEditor = function useEditor() {
|
|
|
26764
26929
|
/* Infinite re-render loop
|
|
26765
26930
|
- When chaning dataset
|
|
26766
26931
|
- If not using default metric / grouping
|
|
26767
|
-
- Only when switching to 'Stock data' not to another dataset
|
|
26932
|
+
- Only when switching to 'Stock data' not to another dataset
|
|
26768
26933
|
*/
|
|
26769
26934
|
|
|
26770
26935
|
dispatch({
|
|
@@ -26781,6 +26946,12 @@ var useEditor = function useEditor() {
|
|
|
26781
26946
|
return _ref2.apply(this, arguments);
|
|
26782
26947
|
};
|
|
26783
26948
|
}();
|
|
26949
|
+
var setResults = function setResults(results) {
|
|
26950
|
+
dispatch({
|
|
26951
|
+
type: 'setResultsForComponentInEditor',
|
|
26952
|
+
results: results
|
|
26953
|
+
});
|
|
26954
|
+
};
|
|
26784
26955
|
var setDataSets = function setDataSets(dataSets) {
|
|
26785
26956
|
dispatch({
|
|
26786
26957
|
type: 'setDataSets',
|
|
@@ -26852,6 +27023,7 @@ var useEditor = function useEditor() {
|
|
|
26852
27023
|
numberFormatOptions: numberFormatOptions,
|
|
26853
27024
|
setAttributes: setAttributes,
|
|
26854
27025
|
setPartialAttributes: setPartialAttributes,
|
|
27026
|
+
setResults: setResults,
|
|
26855
27027
|
mode: mode,
|
|
26856
27028
|
origin: origin,
|
|
26857
27029
|
componentEditor: componentEditor,
|
|
@@ -33242,28 +33414,26 @@ var Legend = function Legend(props) {
|
|
|
33242
33414
|
});
|
|
33243
33415
|
};
|
|
33244
33416
|
|
|
33245
|
-
var useXAxisLabelCount = function useXAxisLabelCount(override, forceXAxisAsTime
|
|
33417
|
+
var useXAxisLabelCount = function useXAxisLabelCount(override, forceXAxisAsTime) {
|
|
33246
33418
|
var ref = useRef(null);
|
|
33247
33419
|
var _useState = useState(0),
|
|
33248
|
-
|
|
33249
|
-
|
|
33420
|
+
width = _useState[0],
|
|
33421
|
+
setWidth = _useState[1];
|
|
33250
33422
|
useEffect(function () {
|
|
33251
33423
|
var handleResize = throttle(function () {
|
|
33252
|
-
|
|
33253
|
-
var measurement = horizontal ? ref.current.clientHeight : ref.current.clientWidth;
|
|
33254
|
-
setSize(measurement);
|
|
33424
|
+
setWidth(ref.current ? ref.current.clientWidth : 0);
|
|
33255
33425
|
}, 100);
|
|
33256
33426
|
handleResize();
|
|
33257
|
-
window.addEventListener('resize',
|
|
33427
|
+
window.addEventListener('resize', function () {
|
|
33428
|
+
return handleResize;
|
|
33429
|
+
});
|
|
33258
33430
|
return function () {
|
|
33259
33431
|
window.removeEventListener('resize', handleResize);
|
|
33260
|
-
handleResize.cancel();
|
|
33261
33432
|
};
|
|
33262
33433
|
});
|
|
33263
|
-
|
|
33264
|
-
|
|
33265
|
-
|
|
33266
|
-
return [ref, approximateTickCount * multiplier];
|
|
33434
|
+
var approximateXTickCount = Math.min(width < 1000 ? parseInt(("" + width)[0]) : 12, 12);
|
|
33435
|
+
if (override != 'auto') return [ref, override];
|
|
33436
|
+
return [ref, approximateXTickCount * (forceXAxisAsTime ? 4 : 1)];
|
|
33267
33437
|
};
|
|
33268
33438
|
|
|
33269
33439
|
var buildTooltipStyles = function buildTooltipStyles(_ref) {
|
|
@@ -34005,7 +34175,7 @@ var VizzlyXYChart = function VizzlyXYChart(props) {
|
|
|
34005
34175
|
scaleToFit: 'shrink-only'
|
|
34006
34176
|
};
|
|
34007
34177
|
};
|
|
34008
|
-
var _useXAxisLabelCount = useXAxisLabelCount(approxXAxisLabelCount, props
|
|
34178
|
+
var _useXAxisLabelCount = useXAxisLabelCount(approxXAxisLabelCount, !(props != null && props.horizontal) && (props == null ? void 0 : props.forceXAxisAsTime)),
|
|
34009
34179
|
widthRef = _useXAxisLabelCount[0],
|
|
34010
34180
|
approximateXTickCount = _useXAxisLabelCount[1];
|
|
34011
34181
|
var _useState = useState(undefined),
|
|
@@ -35247,6 +35417,9 @@ var HeadlineStats = function HeadlineStats(props) {
|
|
|
35247
35417
|
var _props$component$attr, _props$component$attr2, _attributes$viewId, _props$dashboardBehav;
|
|
35248
35418
|
var _useDashboardBehaviou = useDashboardBehaviourContext(),
|
|
35249
35419
|
queryEngineConfig = _useDashboardBehaviou.queryEngineConfig;
|
|
35420
|
+
var _useState = useState([]),
|
|
35421
|
+
results = _useState[0],
|
|
35422
|
+
setResults = _useState[1];
|
|
35250
35423
|
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';
|
|
35251
35424
|
var deltaTimeDimension = function () {
|
|
35252
35425
|
if (!comparisonEnabled) return null;
|
|
@@ -35268,12 +35441,11 @@ var HeadlineStats = function HeadlineStats(props) {
|
|
|
35268
35441
|
measure: measure,
|
|
35269
35442
|
filter: props.component.attributes.filter
|
|
35270
35443
|
});
|
|
35271
|
-
var _useQueryEffect = useQueryEffect(attributes, props.runQueriesCallback, {
|
|
35444
|
+
var _useQueryEffect = useQueryEffect(attributes, props.runQueriesCallback, setResults, {
|
|
35272
35445
|
localFilters: props.component.localFilters,
|
|
35273
35446
|
globalFilters: props.globalFilters
|
|
35274
35447
|
}, props.dataSet, undefined, props.dashboardBehaviour.variables),
|
|
35275
|
-
queriesAreChanging = _useQueryEffect.queriesAreChanging
|
|
35276
|
-
results = _useQueryEffect.results;
|
|
35448
|
+
queriesAreChanging = _useQueryEffect.queriesAreChanging;
|
|
35277
35449
|
return jsx(View, {
|
|
35278
35450
|
minHeight: comparisonEnabled ? 80 : 56,
|
|
35279
35451
|
children: jsx(SingleStatView, _extends({}, attributes, {
|
|
@@ -35561,14 +35733,17 @@ var AreaChart$4 = function AreaChart(props) {
|
|
|
35561
35733
|
onDrilldown = _useState[0],
|
|
35562
35734
|
setOnDrilldown = _useState[1];
|
|
35563
35735
|
var _props$component = props.component,
|
|
35736
|
+
results = _props$component.results,
|
|
35564
35737
|
attributes = _props$component.attributes,
|
|
35565
35738
|
localFilters = _props$component.localFilters;
|
|
35566
|
-
var _useQueryEffect = useQueryEffect(attributes, props.runQueriesCallback, {
|
|
35739
|
+
var _useQueryEffect = useQueryEffect(attributes, props.runQueriesCallback, props.setResults, {
|
|
35567
35740
|
localFilters: props.component.localFilters,
|
|
35568
35741
|
globalFilters: props.globalFilters
|
|
35569
35742
|
}, props.dataSet, undefined, props.dashboardBehaviour.variables),
|
|
35570
|
-
queriesAreChanging = _useQueryEffect.queriesAreChanging
|
|
35571
|
-
|
|
35743
|
+
queriesAreChanging = _useQueryEffect.queriesAreChanging;
|
|
35744
|
+
var componentInterface = getComponentInterface(props.component.attributes.type, {
|
|
35745
|
+
queryEngineConfig: props.dashboardBehaviour.queryEngineConfig
|
|
35746
|
+
});
|
|
35572
35747
|
return jsxs(Fragment, {
|
|
35573
35748
|
children: [jsx(memoized, _extends({
|
|
35574
35749
|
id: props.id
|
|
@@ -36801,18 +36976,16 @@ var usePreAggregatedDataSet = function usePreAggregatedDataSet(dataSet, attribut
|
|
|
36801
36976
|
})]);
|
|
36802
36977
|
};
|
|
36803
36978
|
|
|
36804
|
-
var useComponentEffect = function useComponentEffect(attributes, dataSet, queryEngineConfig, filterConfig, updateComponentAttributes, runQueriesCallback, variables) {
|
|
36979
|
+
var useComponentEffect = function useComponentEffect(attributes, dataSet, queryEngineConfig, filterConfig, updateComponentAttributes, runQueriesCallback, setResults, variables) {
|
|
36805
36980
|
var queryable = attributes;
|
|
36806
36981
|
if (dataSet.preAggregated) {
|
|
36807
36982
|
queryable = [buildViewOnlyQuery(dataSet)];
|
|
36808
36983
|
}
|
|
36809
36984
|
usePreAggregatedDataSet(dataSet, attributes, queryEngineConfig, updateComponentAttributes);
|
|
36810
|
-
var _useQueryEffect = useQueryEffect(queryable, runQueriesCallback, filterConfig, dataSet, attributes.type, variables),
|
|
36811
|
-
queriesAreChanging = _useQueryEffect.queriesAreChanging
|
|
36812
|
-
results = _useQueryEffect.results;
|
|
36985
|
+
var _useQueryEffect = useQueryEffect(queryable, runQueriesCallback, setResults, filterConfig, dataSet, attributes.type, variables),
|
|
36986
|
+
queriesAreChanging = _useQueryEffect.queriesAreChanging;
|
|
36813
36987
|
return {
|
|
36814
|
-
queriesAreChanging: queriesAreChanging
|
|
36815
|
-
results: results
|
|
36988
|
+
queriesAreChanging: queriesAreChanging
|
|
36816
36989
|
};
|
|
36817
36990
|
};
|
|
36818
36991
|
|
|
@@ -36864,7 +37037,9 @@ function useDrilldownSelection(results, attributes, setAttributes, dataSet, quer
|
|
|
36864
37037
|
|
|
36865
37038
|
var BarChart$4 = function BarChart(props) {
|
|
36866
37039
|
var _props$dashboardBehav;
|
|
36867
|
-
var
|
|
37040
|
+
var _props$component = props.component,
|
|
37041
|
+
localFilters = _props$component.localFilters,
|
|
37042
|
+
results = _props$component.results;
|
|
36868
37043
|
var dashboardBehaviour = props.dashboardBehaviour;
|
|
36869
37044
|
var _useState = useState(props.component.attributes),
|
|
36870
37045
|
attributes = _useState[0],
|
|
@@ -36875,18 +37050,17 @@ var BarChart$4 = function BarChart(props) {
|
|
|
36875
37050
|
setDrilldownSelections([]);
|
|
36876
37051
|
}
|
|
36877
37052
|
}, [JSON.stringify(props.component.attributes)]);
|
|
36878
|
-
var _useComponentEffect = useComponentEffect(attributes, props.dataSet, props.dashboardBehaviour.queryEngineConfig, {
|
|
36879
|
-
localFilters: localFilters,
|
|
36880
|
-
globalFilters: props.globalFilters
|
|
36881
|
-
}, props.updateComponentAttributes, props.runQueriesCallback, props.dashboardBehaviour.variables),
|
|
36882
|
-
queriesAreChanging = _useComponentEffect.queriesAreChanging,
|
|
36883
|
-
results = _useComponentEffect.results;
|
|
36884
37053
|
var _useDrilldownSelectio = useDrilldownSelection(results, attributes, function (newAttributes) {
|
|
36885
37054
|
return setAttributes(newAttributes);
|
|
36886
37055
|
}, props.dataSet, dashboardBehaviour.queryEngineConfig),
|
|
36887
37056
|
onDrilldownChange = _useDrilldownSelectio.onDrilldownChange,
|
|
36888
37057
|
setDrilldownSelections = _useDrilldownSelectio.setDrilldownSelections,
|
|
36889
37058
|
drilldownSelections = _useDrilldownSelectio.drilldownSelections;
|
|
37059
|
+
var _useComponentEffect = useComponentEffect(drilldownSelections.length > 0 ? attributes : props.component.attributes, props.dataSet, props.dashboardBehaviour.queryEngineConfig, {
|
|
37060
|
+
localFilters: localFilters,
|
|
37061
|
+
globalFilters: props.globalFilters
|
|
37062
|
+
}, props.updateComponentAttributes, props.runQueriesCallback, props.setResults, props.dashboardBehaviour.variables),
|
|
37063
|
+
queriesAreChanging = _useComponentEffect.queriesAreChanging;
|
|
36890
37064
|
var runViewClickQuery = /*#__PURE__*/function () {
|
|
36891
37065
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(queries, existingField) {
|
|
36892
37066
|
var filter, attributes, abortController, queryResults;
|
|
@@ -37193,14 +37367,14 @@ var LineChart$4 = function LineChart(props) {
|
|
|
37193
37367
|
onDrilldown = _useState[0],
|
|
37194
37368
|
setOnDrilldown = _useState[1];
|
|
37195
37369
|
var _props$component = props.component,
|
|
37370
|
+
results = _props$component.results,
|
|
37196
37371
|
attributes = _props$component.attributes,
|
|
37197
37372
|
localFilters = _props$component.localFilters;
|
|
37198
37373
|
var _useComponentEffect = useComponentEffect(attributes, props.dataSet, props.dashboardBehaviour.queryEngineConfig, {
|
|
37199
37374
|
localFilters: localFilters,
|
|
37200
37375
|
globalFilters: props.globalFilters
|
|
37201
|
-
}, props.updateComponentAttributes, props.runQueriesCallback, props.dashboardBehaviour.variables),
|
|
37202
|
-
queriesAreChanging = _useComponentEffect.queriesAreChanging
|
|
37203
|
-
results = _useComponentEffect.results;
|
|
37376
|
+
}, props.updateComponentAttributes, props.runQueriesCallback, props.setResults, props.dashboardBehaviour.variables),
|
|
37377
|
+
queriesAreChanging = _useComponentEffect.queriesAreChanging;
|
|
37204
37378
|
return jsxs(Fragment, {
|
|
37205
37379
|
children: [jsx(memoized$1, _extends({
|
|
37206
37380
|
id: props.id
|
|
@@ -37414,14 +37588,14 @@ var memoized$2 = /*#__PURE__*/memo(ScatterChartView, shouldUpdate);
|
|
|
37414
37588
|
var ScatterChart$3 = function ScatterChart(props) {
|
|
37415
37589
|
var _props$dashboardBehav;
|
|
37416
37590
|
var _props$component = props.component,
|
|
37591
|
+
results = _props$component.results,
|
|
37417
37592
|
attributes = _props$component.attributes,
|
|
37418
37593
|
localFilters = _props$component.localFilters;
|
|
37419
|
-
var _useQueryEffect = useQueryEffect(attributes, props.runQueriesCallback, {
|
|
37594
|
+
var _useQueryEffect = useQueryEffect(attributes, props.runQueriesCallback, props.setResults, {
|
|
37420
37595
|
localFilters: localFilters,
|
|
37421
37596
|
globalFilters: props.globalFilters
|
|
37422
37597
|
}, props.dataSet, undefined, props.dashboardBehaviour.variables),
|
|
37423
|
-
queriesAreChanging = _useQueryEffect.queriesAreChanging
|
|
37424
|
-
results = _useQueryEffect.results;
|
|
37598
|
+
queriesAreChanging = _useQueryEffect.queriesAreChanging;
|
|
37425
37599
|
return jsx(memoized$2, _extends({
|
|
37426
37600
|
id: props.id
|
|
37427
37601
|
}, attributes, {
|
|
@@ -38797,7 +38971,9 @@ var memoized$3 = /*#__PURE__*/memo(PieChartView, shouldUpdate);
|
|
|
38797
38971
|
|
|
38798
38972
|
var PieChart$3 = function PieChart(props) {
|
|
38799
38973
|
var _props$dashboardBehav;
|
|
38800
|
-
var
|
|
38974
|
+
var _props$component = props.component,
|
|
38975
|
+
results = _props$component.results,
|
|
38976
|
+
localFilters = _props$component.localFilters;
|
|
38801
38977
|
var dashboardBehaviour = props.dashboardBehaviour;
|
|
38802
38978
|
var _useState = useState(props.component.attributes),
|
|
38803
38979
|
attributes = _useState[0],
|
|
@@ -38808,18 +38984,17 @@ var PieChart$3 = function PieChart(props) {
|
|
|
38808
38984
|
setDrilldownSelections([]);
|
|
38809
38985
|
}
|
|
38810
38986
|
}, [JSON.stringify(props.component.attributes)]);
|
|
38811
|
-
var _useQueryEffect = useQueryEffect(attributes, props.runQueriesCallback, {
|
|
38812
|
-
localFilters: localFilters,
|
|
38813
|
-
globalFilters: props.globalFilters
|
|
38814
|
-
}, props.dataSet, undefined, props.dashboardBehaviour.variables),
|
|
38815
|
-
queriesAreChanging = _useQueryEffect.queriesAreChanging,
|
|
38816
|
-
results = _useQueryEffect.results;
|
|
38817
38987
|
var _useDrilldownSelectio = useDrilldownSelection(results, attributes, function (newAttributes) {
|
|
38818
38988
|
return setAttributes(newAttributes);
|
|
38819
38989
|
}, props.dataSet, dashboardBehaviour.queryEngineConfig),
|
|
38820
38990
|
onDrilldownChange = _useDrilldownSelectio.onDrilldownChange,
|
|
38821
38991
|
setDrilldownSelections = _useDrilldownSelectio.setDrilldownSelections,
|
|
38822
38992
|
drilldownSelections = _useDrilldownSelectio.drilldownSelections;
|
|
38993
|
+
var _useQueryEffect = useQueryEffect(attributes, props.runQueriesCallback, props.setResults, {
|
|
38994
|
+
localFilters: localFilters,
|
|
38995
|
+
globalFilters: props.globalFilters
|
|
38996
|
+
}, props.dataSet, undefined, props.dashboardBehaviour.variables),
|
|
38997
|
+
queriesAreChanging = _useQueryEffect.queriesAreChanging;
|
|
38823
38998
|
var runViewClickQuery = /*#__PURE__*/function () {
|
|
38824
38999
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(queries, existingField) {
|
|
38825
39000
|
var filter, attributes, abortController, queryResults;
|
|
@@ -42949,14 +43124,14 @@ var memoized$4 = /*#__PURE__*/memo(BubbleChartView, shouldUpdate);
|
|
|
42949
43124
|
var BubbleChart$3 = function BubbleChart(props) {
|
|
42950
43125
|
var _props$dashboardBehav;
|
|
42951
43126
|
var _props$component = props.component,
|
|
43127
|
+
results = _props$component.results,
|
|
42952
43128
|
attributes = _props$component.attributes,
|
|
42953
43129
|
localFilters = _props$component.localFilters;
|
|
42954
|
-
var _useQueryEffect = useQueryEffect(attributes, props.runQueriesCallback, {
|
|
43130
|
+
var _useQueryEffect = useQueryEffect(attributes, props.runQueriesCallback, props.setResults, {
|
|
42955
43131
|
localFilters: localFilters,
|
|
42956
43132
|
globalFilters: props.globalFilters
|
|
42957
43133
|
}, props.dataSet, undefined, props.dashboardBehaviour.variables),
|
|
42958
|
-
queriesAreChanging = _useQueryEffect.queriesAreChanging
|
|
42959
|
-
results = _useQueryEffect.results;
|
|
43134
|
+
queriesAreChanging = _useQueryEffect.queriesAreChanging;
|
|
42960
43135
|
return jsx(memoized$4, _extends({
|
|
42961
43136
|
id: props.id
|
|
42962
43137
|
}, attributes, {
|
|
@@ -43319,9 +43494,7 @@ var Tooltip$1 = function Tooltip(_ref) {
|
|
|
43319
43494
|
xKey = _ref.xKey,
|
|
43320
43495
|
yKeys = _ref.yKeys,
|
|
43321
43496
|
theme = _ref.theme,
|
|
43322
|
-
items = _ref.items
|
|
43323
|
-
_ref$shouldShowColorL = _ref.shouldShowColorLegend,
|
|
43324
|
-
shouldShowColorLegend = _ref$shouldShowColorL === void 0 ? true : _ref$shouldShowColorL;
|
|
43497
|
+
items = _ref.items;
|
|
43325
43498
|
var tooltipRef = useRef(null);
|
|
43326
43499
|
var _useState = useState({
|
|
43327
43500
|
left: tooltipLeft
|
|
@@ -43370,7 +43543,7 @@ var Tooltip$1 = function Tooltip(_ref) {
|
|
|
43370
43543
|
fontSize: '15px',
|
|
43371
43544
|
width: '100%',
|
|
43372
43545
|
minWidth: MIN_TOOLTIP_WIDTH
|
|
43373
|
-
}, process.env.NODE_ENV === "production" ? "" : ";label:Tooltip;", process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,
|
|
43546
|
+
}, process.env.NODE_ENV === "production" ? "" : ";label:Tooltip;", process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIlRvb2x0aXAudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQTJGcUIiLCJmaWxlIjoiVG9vbHRpcC50c3giLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgUmVhY3QsIHsgQ1NTUHJvcGVydGllcywgRnJhZ21lbnQsIHVzZUVmZmVjdCwgdXNlUmVmLCB1c2VTdGF0ZSB9IGZyb20gJ3JlYWN0JztcbmltcG9ydCB7IGNyZWF0ZVBvcnRhbCB9IGZyb20gJ3JlYWN0LWRvbSc7XG5cbmltcG9ydCB7IGdldENvbG9yIH0gZnJvbSAnLi4vLi4vdXRpbHMnO1xuaW1wb3J0IHsgTGVnZW5kSXRlbUJveCB9IGZyb20gJy4uL0xlZ2VuZC9MZWdlbmRJdGVtQm94JztcbmltcG9ydCB7IFNoYXBlRGVmaW5pdGlvbiwgQ29uZGl0aW9uYWxGb3JtYXR0aW5nUnVsZSwgRGF0YUl0ZW0sIEtleSB9IGZyb20gJ3NoYXJlZC1sb2dpYy9zcmMvQ2hhcnRzVjIvdHlwZXMnO1xuaW1wb3J0IHsgTGluZVN0eWxlcyB9IGZyb20gJ3NoYXJlZC1sb2dpYy9zcmMvTGluZUNoYXJ0VjIvdHlwZXMnO1xuaW1wb3J0IHsgQmFyU3R5bGVzIH0gZnJvbSAnc2hhcmVkLWxvZ2ljL3NyYy9CYXJDaGFydFYyL3R5cGVzJztcbmltcG9ydCB7IEFyZWFTdHlsZXMgfSBmcm9tICdzaGFyZWQtbG9naWMvc3JjL0FyZWFDaGFydFYyL3R5cGVzJztcbmltcG9ydCB7IEJ1YmJsZVN0eWxlcyB9IGZyb20gJ3NoYXJlZC1sb2dpYy9zcmMvQnViYmxlQ2hhcnRWMi90eXBlcyc7XG5pbXBvcnQgeyBjc3MgfSB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UmVmfVxuICAgICAgc3R5bGU9e3tcbiAgICAgICAgcG9zaXRpb246ICdhYnNvbHV0ZScsXG4gICAgICAgIGxlZnQ6IHBvc2l0aW9uLmxlZnQsXG4gICAgICAgIHRvcDogdG9vbHRpcFRvcCxcbiAgICAgICAgekluZGV4OiAyMTQ3NDgzNjQ3ICogMTAsXG4gICAgICAgIC4uLnRoZW1lLFxuICAgICAgfX1cbiAgICA+XG4gICAgICA8ZGl2IHN0eWxlPXt7IHdvcmRCcmVhazogJ2JyZWFrLWFsbCcgfX0+XG4gICAgICAgIDxkaXZcbiAgICAgICAgICBjbGFzc05hbWU9e2Nzcyh7XG4gICAgICAgICAgICBmb250RmFtaWx5OiAnaW5oZXJpdCcsXG4gICAgICAgICAgICBsaW5lSGVpZ2h0OiAnaW5oZXJpdCcsXG4gICAgICAgICAgICBsZXR0ZXJTcGFjaW5nOiAnaW5oZXJpdCcsXG4gICAgICAgICAgICBmb250V2VpZ2h0OiAnYm9sZCcsXG4gICAgICAgICAgICBmb250U2l6ZTogJzE1cHgnLFxuICAgICAgICAgICAgd2lkdGg6ICcxMDAlJyxcbiAgICAgICAgICAgIG1pbldpZHRoOiBNSU5fVE9PTFRJUF9XSURUSCxcbiAgICAgICAgICB9KX1cbiAgICAgICAgPlxuICAgICAgICAgIHt0b29sdGlwRGF0YVt4S2V5XT8uZm9ybWF0dGVkVmFsdWUgPz8gdG9vbHRpcERhdGFbeEtleV0udmFsdWV9XG4gICAgICAgIDwvZGl2PlxuICAgICAgICA8dGFibGVcbiAgICAgICAgICBjZWxsUGFkZGluZz17MH1cbiAgICAgICAgICBjZWxsU3BhY2luZz17MH1cbiAgICAgICAgICBjbGFzc05hbWU9e2Nzcyh7XG4gICAgICAgICAgICBtYXJnaW46ICcwJyxcbiAgICAgICAgICAgIGJvcmRlclNwYWNpbmc6ICcwJyxcbiAgICAgICAgICAgIGJvcmRlckNvbGxhcHNlOiAnaW5oZXJpdCcsXG4gICAgICAgICAgICBib3JkZXI6ICdub25lJyxcbiAgICAgICAgICB9KX1cbiAgICAgICAgPlxuICAgICAgICAgIDx0Ym9keT5cbiAgICAgICAgICAgIHtpdGVtcy5tYXAoKGl0ZW0sIGluZGV4KSA9PiB7XG4gICAgICAgICAgICAgIHJldHVybiAoXG4gICAgICAgICAgICAgICAgPEZyYWdtZW50IGtleT17aW5kZXh9PlxuICAgICAgICAgICAgICAgICAge2l0ZW0ubGVnZW5kSXRlbXM/Lm1hcCgobGVnZW5kSXRlbSwgaW5kZXgpID0+IHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCF0b29sdGlwRGF0YVtsZWdlbmRJdGVtLnlLZXldIHx8IHRvb2x0aXBEYXRhW2xlZ2VuZEl0ZW0ueUtleV0udmFsdWUgPT09IG51bGwpIHtcbiAgICAgICAgICAgICAgICAgICAgICAvLyB5S2V5IGNvdWxkIG5vdCBiZSBmb3VuZCBpbiB0b29sdGlwRGF0YVxuICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBudWxsO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAoXG4gICAgICAgICAgICAgICAgICAgICAgaXRlbS52aXNpYmxlWUtleXM/LmluY2x1ZGVzKGxlZ2VuZEl0ZW0ueUtleSkgJiYgKFxuICAgICAgICAgICAgICAgICAgICAgICAgPHRyIGtleT17bGVnZW5kSXRlbS55S2V5fT5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgPHRkXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc3R5bGU9e3tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZlcnRpY2FsQWxpZ246ICdtaWRkbGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFkZGluZzogaW5kZXggPT09IDAgPyAnMTJweCA4cHggMCAwJyA6ICc4cHggOHB4IDAgMCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aWR0aDogJ2F1dG8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH19XG4gICAgICAgICAgICAgICAgICAgICAgICAgID5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8TGVnZW5kSXRlbUJveFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29sb3I9e2dldENvbG9yKHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVmYXVsdENvbG9yOiBsZWdlbmRJdGVtLmNvbG9yLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZTogdG9vbHRpcERhdGFbbGVnZW5kSXRlbS55S2V5XS52YWx1ZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeUtleTogbGVnZW5kSXRlbS55S2V5LFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25kaXRpb25hbEZvcm1hdHRpbmdSdWxlczogaXRlbS5jb25kaXRpb25hbEZvcm1hdHRpbmdSdWxlcyA/PyBbXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3R5bGU9e2xlZ2VuZEl0ZW0uc3R5bGUgYXMgTGluZVN0eWxlc31cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHlLZXk9e2xlZ2VuZEl0ZW0ueUtleX1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvPlxuICAgICAgICAgICAgICAgICAgICAgICAgICA8L3RkPlxuICAgICAgICAgICAgICAgICAgICAgICAgICA8dGQgc3R5bGU9e3sgcGFkZGluZzogJzhweCAwIDAgMCcgfX0+e2tleXNbbGVnZW5kSXRlbS55S2V5XS5rZXlGb3JtYXR0ZWR9PC90ZD5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgPHRkIHN0eWxlPXt7IGZvbnRXZWlnaHQ6ICdib2xkJywgcGFkZGluZzogJzhweCAwIDAgMTZweCcgfX0+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAge3Rvb2x0aXBEYXRhW2xlZ2VuZEl0ZW0ueUtleV0uZm9ybWF0dGVkVmFsdWVcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gdG9vbHRpcERhdGFbbGVnZW5kSXRlbS55S2V5XS5mb3JtYXR0ZWRWYWx1ZVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiB0b29sdGlwRGF0YVtsZWdlbmRJdGVtLnlLZXldLnZhbHVlfVxuICAgICAgICAgICAgICAgICAgICAgICAgICA8L3RkPlxuICAgICAgICAgICAgICAgICAgICAgICAgPC90cj5cbiAgICAgICAgICAgICAgICAgICAgICApXG4gICAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgICB9KX1cbiAgICAgICAgICAgICAgICA8L0ZyYWdtZW50PlxuICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgfSl9XG5cbiAgICAgICAgICAgIHtzaG93Um91bmRlZFRvdGFsICYmIHlLZXlzICYmIChcbiAgICAgICAgICAgICAgPHRyPlxuICAgICAgICAgICAgICAgIDx0ZCBjb2xTcGFuPXsyfSBzdHlsZT17eyBwYWRkaW5nOiAnMTJweCAwIDAgMCcgfX0+XG4gICAgICAgICAgICAgICAgICBSb3VuZGVkIFRvdGFsXG4gICAgICAgICAgICAgICAgPC90ZD5cbiAgICAgICAgICAgICAgICA8dGQgc3R5bGU9e3sgZm9udFdlaWdodDogJ2JvbGQnLCBwYWRkaW5nOiAnMTJweCAwIDAgMTZweCcgfX0+XG4gICAgICAgICAgICAgICAgICB7eUtleXMucmVkdWNlKCh0b3RhbCwga2V5KSA9PiB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiB0b3RhbCArIE1hdGgucm91bmQodG9vbHRpcERhdGFba2V5XS52YWx1ZSBhcyBudW1iZXIpO1xuICAgICAgICAgICAgICAgICAgfSwgMCl9XG4gICAgICAgICAgICAgICAgPC90ZD5cbiAgICAgICAgICAgICAgPC90cj5cbiAgICAgICAgICAgICl9XG4gICAgICAgICAgPC90Ym9keT5cbiAgICAgICAgPC90YWJsZT5cbiAgICAgIDwvZGl2PlxuICAgIDwvZGl2PixcbiAgICBkb2N1bWVudC5ib2R5XG4gICk7XG59O1xuIl19 */"),
|
|
43374
43547
|
children: (_tooltipData$xKey$for = (_tooltipData$xKey = tooltipData[xKey]) == null ? void 0 : _tooltipData$xKey.formattedValue) != null ? _tooltipData$xKey$for : tooltipData[xKey].value
|
|
43375
43548
|
}), jsx("table", {
|
|
43376
43549
|
cellPadding: 0,
|
|
@@ -43381,7 +43554,7 @@ var Tooltip$1 = function Tooltip(_ref) {
|
|
|
43381
43554
|
} : {
|
|
43382
43555
|
name: "9a1sa-Tooltip",
|
|
43383
43556
|
styles: "margin:0;border-spacing:0;border-collapse:inherit;border:none;label:Tooltip;",
|
|
43384
|
-
map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,
|
|
43557
|
+
map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIlRvb2x0aXAudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQTBHcUIiLCJmaWxlIjoiVG9vbHRpcC50c3giLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgUmVhY3QsIHsgQ1NTUHJvcGVydGllcywgRnJhZ21lbnQsIHVzZUVmZmVjdCwgdXNlUmVmLCB1c2VTdGF0ZSB9IGZyb20gJ3JlYWN0JztcbmltcG9ydCB7IGNyZWF0ZVBvcnRhbCB9IGZyb20gJ3JlYWN0LWRvbSc7XG5cbmltcG9ydCB7IGdldENvbG9yIH0gZnJvbSAnLi4vLi4vdXRpbHMnO1xuaW1wb3J0IHsgTGVnZW5kSXRlbUJveCB9IGZyb20gJy4uL0xlZ2VuZC9MZWdlbmRJdGVtQm94JztcbmltcG9ydCB7IFNoYXBlRGVmaW5pdGlvbiwgQ29uZGl0aW9uYWxGb3JtYXR0aW5nUnVsZSwgRGF0YUl0ZW0sIEtleSB9IGZyb20gJ3NoYXJlZC1s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SURUSCxcbiAgICAgICAgICB9KX1cbiAgICAgICAgPlxuICAgICAgICAgIHt0b29sdGlwRGF0YVt4S2V5XT8uZm9ybWF0dGVkVmFsdWUgPz8gdG9vbHRpcERhdGFbeEtleV0udmFsdWV9XG4gICAgICAgIDwvZGl2PlxuICAgICAgICA8dGFibGVcbiAgICAgICAgICBjZWxsUGFkZGluZz17MH1cbiAgICAgICAgICBjZWxsU3BhY2luZz17MH1cbiAgICAgICAgICBjbGFzc05hbWU9e2Nzcyh7XG4gICAgICAgICAgICBtYXJnaW46ICcwJyxcbiAgICAgICAgICAgIGJvcmRlclNwYWNpbmc6ICcwJyxcbiAgICAgICAgICAgIGJvcmRlckNvbGxhcHNlOiAnaW5oZXJpdCcsXG4gICAgICAgICAgICBib3JkZXI6ICdub25lJyxcbiAgICAgICAgICB9KX1cbiAgICAgICAgPlxuICAgICAgICAgIDx0Ym9keT5cbiAgICAgICAgICAgIHtpdGVtcy5tYXAoKGl0ZW0sIGluZGV4KSA9PiB7XG4gICAgICAgICAgICAgIHJldHVybiAoXG4gICAgICAgICAgICAgICAgPEZyYWdtZW50IGtleT17aW5kZXh9PlxuICAgICAgICAgICAgICAgICAge2l0ZW0ubGVnZW5kSXRlbXM/Lm1hcCgobGVnZW5kSXRlbSwgaW5kZXgpID0+IHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCF0b29sdGlwRGF0YVtsZWdlbmRJdGVtLnlLZXldIHx8IHRvb2x0aXBEYXRhW2xlZ2VuZEl0ZW0ueUtleV0udmFsdWUgPT09IG51bGwpIHtcbiAgICAgICAgICAgICAgICAgICAgICAvLyB5S2V5IGNvdWxkIG5vdCBiZSBmb3VuZCBpbiB0b29sdGlwRGF0YVxuICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBudWxsO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAoXG4gICAgICAgICAgICAgICAgICAgICAgaXRlbS52aXNpYmxlWUtleXM/LmluY2x1ZGVzKGxlZ2VuZEl0ZW0ueUtleSkgJiYgKFxuICAgICAgICAgICAgICAgICAgICAgICAgPHRyIGtleT17bGVnZW5kSXRlbS55S2V5fT5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgPHRkXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc3R5bGU9e3tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZlcnRpY2FsQWxpZ246ICdtaWRkbGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFkZGluZzogaW5kZXggPT09IDAgPyAnMTJweCA4cHggMCAwJyA6ICc4cHggOHB4IDAgMCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aWR0aDogJ2F1dG8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH19XG4gICAgICAgICAgICAgICAgICAgICAgICAgID5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8TGVnZW5kSXRlbUJveFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29sb3I9e2dldENvbG9yKHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVmYXVsdENvbG9yOiBsZWdlbmRJdGVtLmNvbG9yLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZTogdG9vbHRpcERhdGFbbGVnZW5kSXRlbS55S2V5XS52YWx1ZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeUtleTogbGVnZW5kSXRlbS55S2V5LFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25kaXRpb25hbEZvcm1hdHRpbmdSdWxlczogaXRlbS5jb25kaXRpb25hbEZvcm1hdHRpbmdSdWxlcyA/PyBbXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3R5bGU9e2xlZ2VuZEl0ZW0uc3R5bGUgYXMgTGluZVN0eWxlc31cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHlLZXk9e2xlZ2VuZEl0ZW0ueUtleX1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvPlxuICAgICAgICAgICAgICAgICAgICAgICAgICA8L3RkPlxuICAgICAgICAgICAgICAgICAgICAgICAgICA8dGQgc3R5bGU9e3sgcGFkZGluZzogJzhweCAwIDAgMCcgfX0+e2tleXNbbGVnZW5kSXRlbS55S2V5XS5rZXlGb3JtYXR0ZWR9PC90ZD5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgPHRkIHN0eWxlPXt7IGZvbnRXZWlnaHQ6ICdib2xkJywgcGFkZGluZzogJzhweCAwIDAgMTZweCcgfX0+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAge3Rvb2x0aXBEYXRhW2xlZ2VuZEl0ZW0ueUtleV0uZm9ybWF0dGVkVmFsdWVcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gdG9vbHRpcERhdGFbbGVnZW5kSXRlbS55S2V5XS5mb3JtYXR0ZWRWYWx1ZVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiB0b29sdGlwRGF0YVtsZWdlbmRJdGVtLnlLZXldLnZhbHVlfVxuICAgICAgICAgICAgICAgICAgICAgICAgICA8L3RkPlxuICAgICAgICAgICAgICAgICAgICAgICAgPC90cj5cbiAgICAgICAgICAgICAgICAgICAgICApXG4gICAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgICB9KX1cbiAgICAgICAgICAgICAgICA8L0ZyYWdtZW50PlxuICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgfSl9XG5cbiAgICAgICAgICAgIHtzaG93Um91bmRlZFRvdGFsICYmIHlLZXlzICYmIChcbiAgICAgICAgICAgICAgPHRyPlxuICAgICAgICAgICAgICAgIDx0ZCBjb2xTcGFuPXsyfSBzdHlsZT17eyBwYWRkaW5nOiAnMTJweCAwIDAgMCcgfX0+XG4gICAgICAgICAgICAgICAgICBSb3VuZGVkIFRvdGFsXG4gICAgICAgICAgICAgICAgPC90ZD5cbiAgICAgICAgICAgICAgICA8dGQgc3R5bGU9e3sgZm9udFdlaWdodDogJ2JvbGQnLCBwYWRkaW5nOiAnMTJweCAwIDAgMTZweCcgfX0+XG4gICAgICAgICAgICAgICAgICB7eUtleXMucmVkdWNlKCh0b3RhbCwga2V5KSA9PiB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiB0b3RhbCArIE1hdGgucm91bmQodG9vbHRpcERhdGFba2V5XS52YWx1ZSBhcyBudW1iZXIpO1xuICAgICAgICAgICAgICAgICAgfSwgMCl9XG4gICAgICAgICAgICAgICAgPC90ZD5cbiAgICAgICAgICAgICAgPC90cj5cbiAgICAgICAgICAgICl9XG4gICAgICAgICAgPC90Ym9keT5cbiAgICAgICAgPC90YWJsZT5cbiAgICAgIDwvZGl2PlxuICAgIDwvZGl2PixcbiAgICBkb2N1bWVudC5ib2R5XG4gICk7XG59O1xuIl19 */",
|
|
43385
43558
|
toString: _EMOTION_STRINGIFIED_CSS_ERROR__$5
|
|
43386
43559
|
}),
|
|
43387
43560
|
children: jsxs("tbody", {
|
|
@@ -43395,7 +43568,7 @@ var Tooltip$1 = function Tooltip(_ref) {
|
|
|
43395
43568
|
return null;
|
|
43396
43569
|
}
|
|
43397
43570
|
return ((_item$visibleYKeys = item.visibleYKeys) == null ? void 0 : _item$visibleYKeys.includes(legendItem.yKey)) && jsxs("tr", {
|
|
43398
|
-
children: [
|
|
43571
|
+
children: [jsx("td", {
|
|
43399
43572
|
style: {
|
|
43400
43573
|
verticalAlign: 'middle',
|
|
43401
43574
|
padding: index === 0 ? '12px 8px 0 0' : '8px 8px 0 0',
|
|
@@ -43423,7 +43596,7 @@ var Tooltip$1 = function Tooltip(_ref) {
|
|
|
43423
43596
|
},
|
|
43424
43597
|
children: tooltipData[legendItem.yKey].formattedValue ? tooltipData[legendItem.yKey].formattedValue : tooltipData[legendItem.yKey].value
|
|
43425
43598
|
})]
|
|
43426
|
-
}, legendItem.yKey
|
|
43599
|
+
}, legendItem.yKey);
|
|
43427
43600
|
})
|
|
43428
43601
|
}, index);
|
|
43429
43602
|
}), showRoundedTotal && yKeys && jsxs("tr", {
|
|
@@ -43608,64 +43781,33 @@ var Legend$1 = function Legend(_ref) {
|
|
|
43608
43781
|
});
|
|
43609
43782
|
};
|
|
43610
43783
|
|
|
43611
|
-
var ASSUMED_AVERAGE_CHAR_WIDTH =
|
|
43612
|
-
|
|
43784
|
+
var ASSUMED_AVERAGE_CHAR_WIDTH = 4;
|
|
43613
43785
|
function calculateWordWidth(word, avgCharWidth) {
|
|
43614
43786
|
return word.length * avgCharWidth;
|
|
43615
43787
|
}
|
|
43616
|
-
|
|
43617
|
-
|
|
43618
|
-
|
|
43619
|
-
|
|
43620
|
-
|
|
43621
|
-
|
|
43622
|
-
divisors.push(i);
|
|
43623
|
-
var divisor = (numElements - 1) / i;
|
|
43624
|
-
if (i === divisor) {
|
|
43625
|
-
continue;
|
|
43626
|
-
}
|
|
43627
|
-
divisors.push(divisor);
|
|
43628
|
-
}
|
|
43629
|
-
divisors.sort(function (a, b) {
|
|
43630
|
-
return b - a;
|
|
43631
|
-
});
|
|
43632
|
-
return divisors;
|
|
43633
|
-
}
|
|
43634
|
-
function isTickIntervalValid(interval, maxWidth, wordWidths) {
|
|
43635
|
-
var totalWidth = 0;
|
|
43636
|
-
for (var i = 0; i < wordWidths.length; i += interval) {
|
|
43637
|
-
var spacing = i > 0 ? 12 : 0; // Add spacing only after the first tick
|
|
43638
|
-
totalWidth += wordWidths[i] + spacing;
|
|
43639
|
-
}
|
|
43640
|
-
return totalWidth <= maxWidth;
|
|
43641
|
-
}
|
|
43788
|
+
|
|
43789
|
+
/** Reduce width proportionally to simulate spacing / padding between ticks. */
|
|
43790
|
+
var widthWithSpacing = function widthWithSpacing(width) {
|
|
43791
|
+
var THIRTY_PERCENT = 0.3;
|
|
43792
|
+
return width - width * THIRTY_PERCENT;
|
|
43793
|
+
};
|
|
43642
43794
|
function howManyTicksFitInWidth(ticks, maxWidth, avgCharWidth) {
|
|
43643
43795
|
if (avgCharWidth === void 0) {
|
|
43644
43796
|
avgCharWidth = ASSUMED_AVERAGE_CHAR_WIDTH;
|
|
43645
43797
|
}
|
|
43646
|
-
var
|
|
43647
|
-
var
|
|
43648
|
-
|
|
43649
|
-
|
|
43650
|
-
|
|
43651
|
-
|
|
43652
|
-
|
|
43653
|
-
|
|
43654
|
-
|
|
43655
|
-
// Binary search for the largest step that fits all elements
|
|
43656
|
-
while (left <= right) {
|
|
43657
|
-
var mid = Math.floor((left + right) / 2);
|
|
43658
|
-
var step = ticksIntervals[mid];
|
|
43659
|
-
if (isTickIntervalValid(step, maxWidth, ticksWidths)) {
|
|
43660
|
-
optimalInterval = step; // Found a valid step, try to find a larger one
|
|
43661
|
-
left = mid + 1;
|
|
43798
|
+
var fittedTicks = [];
|
|
43799
|
+
var currentWidth = 0;
|
|
43800
|
+
for (var _iterator = _createForOfIteratorHelperLoose(ticks), _step; !(_step = _iterator()).done;) {
|
|
43801
|
+
var tick = _step.value;
|
|
43802
|
+
var word = (tick == null ? void 0 : tick.formattedValue) || '';
|
|
43803
|
+
var wordWidth = calculateWordWidth(word, avgCharWidth);
|
|
43804
|
+
if (currentWidth + wordWidth <= widthWithSpacing(maxWidth)) {
|
|
43805
|
+
fittedTicks.push(tick);
|
|
43806
|
+
currentWidth += wordWidth + avgCharWidth; // Add space between words
|
|
43662
43807
|
} else {
|
|
43663
|
-
|
|
43808
|
+
break; // Stop if adding the word exceeds maxWidth
|
|
43664
43809
|
}
|
|
43665
43810
|
}
|
|
43666
|
-
var fittedTicks = ticks.filter(function (_, index) {
|
|
43667
|
-
return index % optimalInterval === 0;
|
|
43668
|
-
});
|
|
43669
43811
|
return fittedTicks.length;
|
|
43670
43812
|
}
|
|
43671
43813
|
function determineYTicks(ticks, height) {
|
|
@@ -43702,14 +43844,16 @@ function pickEquallySpaced(arr, numPicks) {
|
|
|
43702
43844
|
return result;
|
|
43703
43845
|
}
|
|
43704
43846
|
function adjustTicks(representation, width, height, xKeyField) {
|
|
43705
|
-
var _representation$x$tic, _representation$y$tic;
|
|
43706
43847
|
representation = cloneDeep(representation);
|
|
43707
43848
|
|
|
43708
43849
|
// TODO; take this from the theme override...
|
|
43709
43850
|
var averageCharacterWidth = ASSUMED_AVERAGE_CHAR_WIDTH;
|
|
43710
|
-
var numberOfXTicksFittingIntoSpace = howManyTicksFitInWidth(
|
|
43851
|
+
var numberOfXTicksFittingIntoSpace = howManyTicksFitInWidth(representation.x.ticks || [], width, averageCharacterWidth);
|
|
43852
|
+
|
|
43853
|
+
// @ts-ignore
|
|
43711
43854
|
representation.x.ticks = getEvenlySpacedTicks(representation.x.ticks, numberOfXTicksFittingIntoSpace, xKeyField);
|
|
43712
|
-
|
|
43855
|
+
// @ts-ignore
|
|
43856
|
+
representation.y.ticks = determineYTicks(representation.y.ticks || [], height);
|
|
43713
43857
|
return representation;
|
|
43714
43858
|
}
|
|
43715
43859
|
function toNumeric(value) {
|
|
@@ -43742,9 +43886,9 @@ function getEvenlySpacedNumericTicks(sorted, count) {
|
|
|
43742
43886
|
var _toNumeric3;
|
|
43743
43887
|
var closest = sorted[0];
|
|
43744
43888
|
var minDiff = Math.abs(((_toNumeric3 = toNumeric(sorted[0].scaleValue)) != null ? _toNumeric3 : 0) - target);
|
|
43745
|
-
for (var
|
|
43889
|
+
for (var _iterator2 = _createForOfIteratorHelperLoose(sorted), _step2; !(_step2 = _iterator2()).done;) {
|
|
43746
43890
|
var _toNumeric4;
|
|
43747
|
-
var tick =
|
|
43891
|
+
var tick = _step2.value;
|
|
43748
43892
|
var numericVal = (_toNumeric4 = toNumeric(tick.scaleValue)) != null ? _toNumeric4 : 0;
|
|
43749
43893
|
var diff = Math.abs(numericVal - target);
|
|
43750
43894
|
if (diff < minDiff) {
|
|
@@ -43766,9 +43910,16 @@ function getEvenlySpacedStringTicks(ticks, count) {
|
|
|
43766
43910
|
return result;
|
|
43767
43911
|
}
|
|
43768
43912
|
function getEvenlySpacedTicks(ticks, count, xKeyField) {
|
|
43913
|
+
if (count === void 0) {
|
|
43914
|
+
count = 4;
|
|
43915
|
+
}
|
|
43769
43916
|
if (ticks.length === 0) return [];
|
|
43770
43917
|
if ((xKeyField == null ? void 0 : xKeyField.dataType) === 'number' || (xKeyField == null ? void 0 : xKeyField.dataType) === 'date_time') {
|
|
43771
|
-
|
|
43918
|
+
var sorted = [].concat(ticks).sort(function (a, b) {
|
|
43919
|
+
var _toNumeric5, _toNumeric6;
|
|
43920
|
+
return ((_toNumeric5 = toNumeric(a.scaleValue)) != null ? _toNumeric5 : 0) - ((_toNumeric6 = toNumeric(b.scaleValue)) != null ? _toNumeric6 : 0);
|
|
43921
|
+
});
|
|
43922
|
+
return getEvenlySpacedNumericTicks(sorted, count);
|
|
43772
43923
|
} else {
|
|
43773
43924
|
return getEvenlySpacedStringTicks(ticks, count);
|
|
43774
43925
|
}
|
|
@@ -44049,33 +44200,24 @@ var GridRows = function GridRows(_ref) {
|
|
|
44049
44200
|
});
|
|
44050
44201
|
};
|
|
44051
44202
|
|
|
44052
|
-
var _excluded$g = ["children", "width", "height", "showLegend", "onMouseMove", "onMouseLeave"];
|
|
44053
44203
|
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)."; }
|
|
44054
|
-
var ChartWrapper$1 = function ChartWrapper(
|
|
44055
|
-
|
|
44056
|
-
width
|
|
44057
|
-
height
|
|
44058
|
-
|
|
44059
|
-
|
|
44060
|
-
onMouseLeave = _ref.onMouseLeave,
|
|
44061
|
-
svgProps = _objectWithoutPropertiesLoose(_ref, _excluded$g);
|
|
44062
|
-
return jsx("svg", _extends({
|
|
44063
|
-
width: width,
|
|
44064
|
-
height: height - (showLegend ? 40 : 0),
|
|
44065
|
-
onMouseMove: onMouseMove,
|
|
44066
|
-
onMouseLeave: onMouseLeave,
|
|
44204
|
+
var ChartWrapper$1 = function ChartWrapper(props) {
|
|
44205
|
+
return jsx("svg", {
|
|
44206
|
+
width: props.width,
|
|
44207
|
+
height: props.height - (props.showLegend ? 40 : 0),
|
|
44208
|
+
onMouseMove: props.onMouseMove,
|
|
44209
|
+
onMouseLeave: props.onMouseLeave,
|
|
44067
44210
|
className: /*#__PURE__*/css$1(process.env.NODE_ENV === "production" ? {
|
|
44068
44211
|
name: "4zleql",
|
|
44069
44212
|
styles: "display:block"
|
|
44070
44213
|
} : {
|
|
44071
44214
|
name: "fx4tbw-ChartWrapper",
|
|
44072
44215
|
styles: "display:block;label:ChartWrapper;",
|
|
44073
|
-
map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,
|
|
44216
|
+
map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkNoYXJ0V3JhcHBlci50c3giXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBZ0JpQiIsImZpbGUiOiJDaGFydFdyYXBwZXIudHN4Iiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgY3NzIH0gZnJvbSAnQGVtb3Rpb24vY3NzJztcblxuZXhwb3J0IGNvbnN0IENoYXJ0V3JhcHBlciA9IChwcm9wczoge1xuICBjaGlsZHJlbjogUmVhY3QuUmVhY3ROb2RlO1xuICB3aWR0aDogbnVtYmVyO1xuICBoZWlnaHQ6IG51bWJlcjtcbiAgc2hvd0xlZ2VuZDogYm9vbGVhbjtcbiAgb25Nb3VzZU1vdmU/OiBSZWFjdC5Nb3VzZUV2ZW50SGFuZGxlcjxTVkdTVkdFbGVtZW50PjtcbiAgb25Nb3VzZUxlYXZlPzogUmVhY3QuTW91c2VFdmVudEhhbmRsZXI8U1ZHU1ZHRWxlbWVudD47XG59KSA9PiB7XG4gIHJldHVybiAoXG4gICAgPHN2Z1xuICAgICAgd2lkdGg9e3Byb3BzLndpZHRofVxuICAgICAgaGVpZ2h0PXtwcm9wcy5oZWlnaHQgLSAocHJvcHMuc2hvd0xlZ2VuZCA/IDQwIDogMCl9XG4gICAgICBvbk1vdXNlTW92ZT17cHJvcHMub25Nb3VzZU1vdmV9XG4gICAgICBvbk1vdXNlTGVhdmU9e3Byb3BzLm9uTW91c2VMZWF2ZX1cbiAgICAgIGNsYXNzTmFtZT17Y3NzKHsgZGlzcGxheTogJ2Jsb2NrJyB9KX1cbiAgICA+XG4gICAgICB7cHJvcHMuY2hpbGRyZW59XG4gICAgPC9zdmc+XG4gICk7XG59O1xuIl19 */",
|
|
44074
44217
|
toString: _EMOTION_STRINGIFIED_CSS_ERROR__$8
|
|
44075
|
-
})
|
|
44076
|
-
|
|
44077
|
-
|
|
44078
|
-
}));
|
|
44218
|
+
}),
|
|
44219
|
+
children: props.children
|
|
44220
|
+
});
|
|
44079
44221
|
};
|
|
44080
44222
|
|
|
44081
44223
|
var CrosshairCircle = function CrosshairCircle(_ref) {
|
|
@@ -44140,7 +44282,7 @@ var Line = function Line(_ref) {
|
|
|
44140
44282
|
});
|
|
44141
44283
|
};
|
|
44142
44284
|
|
|
44143
|
-
var _excluded$
|
|
44285
|
+
var _excluded$g = ["tooltipOpen"];
|
|
44144
44286
|
function useTooltip$1(initialTooltipState) {
|
|
44145
44287
|
var _useState = useState(_extends({
|
|
44146
44288
|
tooltipOpen: false
|
|
@@ -44149,7 +44291,7 @@ function useTooltip$1(initialTooltipState) {
|
|
|
44149
44291
|
setTooltipState = _useState[1];
|
|
44150
44292
|
var showTooltip = useCallback(function (showArgs) {
|
|
44151
44293
|
return setTooltipState(typeof showArgs === 'function' ? function (_ref) {
|
|
44152
|
-
var show = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
44294
|
+
var show = _objectWithoutPropertiesLoose(_ref, _excluded$g);
|
|
44153
44295
|
return _extends({}, showArgs(show), {
|
|
44154
44296
|
tooltipOpen: true
|
|
44155
44297
|
});
|
|
@@ -44481,7 +44623,58 @@ function Lines(_ref2) {
|
|
|
44481
44623
|
});
|
|
44482
44624
|
}
|
|
44483
44625
|
|
|
44484
|
-
var
|
|
44626
|
+
var PADDING = {
|
|
44627
|
+
paddingOuter: 0.05,
|
|
44628
|
+
paddingInner: 0.3
|
|
44629
|
+
};
|
|
44630
|
+
|
|
44631
|
+
function useBarXScale(xScaleDataType, innerWidth, xScaleKey, data) {
|
|
44632
|
+
return useMemo(function () {
|
|
44633
|
+
if (xScaleDataType === 'string') {
|
|
44634
|
+
return scaleBand(_extends({
|
|
44635
|
+
range: [0, innerWidth],
|
|
44636
|
+
domain: xScaleKey ? [].concat(data.map(function (d) {
|
|
44637
|
+
return d[xScaleKey] && d[xScaleKey].value !== null ? String(d[xScaleKey].value) : '';
|
|
44638
|
+
})) : []
|
|
44639
|
+
}, PADDING));
|
|
44640
|
+
}
|
|
44641
|
+
if (xScaleDataType === 'date_time' && xScaleKey) {
|
|
44642
|
+
return scaleBand(_extends({
|
|
44643
|
+
range: [0, innerWidth],
|
|
44644
|
+
domain: data.map(function (d) {
|
|
44645
|
+
return new Date(d[xScaleKey].value);
|
|
44646
|
+
})
|
|
44647
|
+
}, PADDING));
|
|
44648
|
+
}
|
|
44649
|
+
if (xScaleDataType === 'number' && xScaleKey) {
|
|
44650
|
+
return scaleBand(_extends({
|
|
44651
|
+
range: [0, innerWidth],
|
|
44652
|
+
domain: data.map(function (d) {
|
|
44653
|
+
return d[xScaleKey] && d[xScaleKey].value !== null ? Number(d[xScaleKey].value) : 0;
|
|
44654
|
+
})
|
|
44655
|
+
}, PADDING));
|
|
44656
|
+
}
|
|
44657
|
+
return null;
|
|
44658
|
+
}, [innerWidth, data]);
|
|
44659
|
+
}
|
|
44660
|
+
|
|
44661
|
+
var useBottomAxisBaseLineShift = function useBottomAxisBaseLineShift(_ref) {
|
|
44662
|
+
var showDetailedSubGroupingLabels = _ref.showDetailedSubGroupingLabels,
|
|
44663
|
+
hasBottomTitle = _ref.hasBottomTitle,
|
|
44664
|
+
hasLeftTitle = _ref.hasLeftTitle;
|
|
44665
|
+
if (!showDetailedSubGroupingLabels) {
|
|
44666
|
+
return {
|
|
44667
|
+
bottomAxisBaselineShift: 0,
|
|
44668
|
+
bottomOffset: 0,
|
|
44669
|
+
leftOffset: 0
|
|
44670
|
+
};
|
|
44671
|
+
}
|
|
44672
|
+
return {
|
|
44673
|
+
bottomAxisBaselineShift: hasBottomTitle ? -65 : -60,
|
|
44674
|
+
bottomOffset: hasBottomTitle ? -15 : 10,
|
|
44675
|
+
leftOffset: hasLeftTitle ? -10 : 0
|
|
44676
|
+
};
|
|
44677
|
+
};
|
|
44485
44678
|
|
|
44486
44679
|
function getBarFill(bars, conditionalFormattingRules, barKey, barValues) {
|
|
44487
44680
|
var _bars$find;
|
|
@@ -44507,6 +44700,73 @@ function getBarFill(bars, conditionalFormattingRules, barKey, barValues) {
|
|
|
44507
44700
|
return fill;
|
|
44508
44701
|
}
|
|
44509
44702
|
|
|
44703
|
+
var BAR_RADIUS = 2;
|
|
44704
|
+
|
|
44705
|
+
var BarStacked = function BarStacked(_ref) {
|
|
44706
|
+
var xScaleDataType = _ref.xScaleDataType,
|
|
44707
|
+
data = _ref.data,
|
|
44708
|
+
xScaleKey = _ref.xScaleKey,
|
|
44709
|
+
yScale = _ref.yScale,
|
|
44710
|
+
keys = _ref.keys,
|
|
44711
|
+
bars = _ref.bars,
|
|
44712
|
+
conditionalFormattingRules = _ref.conditionalFormattingRules,
|
|
44713
|
+
xScale = _ref.xScale,
|
|
44714
|
+
height = _ref.height,
|
|
44715
|
+
width = _ref.width;
|
|
44716
|
+
var handleGetXValue = function handleGetXValue(d) {
|
|
44717
|
+
var xValue = d[xScaleKey];
|
|
44718
|
+
if (xScaleDataType === 'string') return String(xValue);
|
|
44719
|
+
if (xScaleDataType === 'date_time') {
|
|
44720
|
+
return new Date(xValue);
|
|
44721
|
+
}
|
|
44722
|
+
if (xScaleDataType === 'number') {
|
|
44723
|
+
return Number(xValue);
|
|
44724
|
+
}
|
|
44725
|
+
return String(xValue);
|
|
44726
|
+
};
|
|
44727
|
+
return jsx(BarStack$1, {
|
|
44728
|
+
x: handleGetXValue,
|
|
44729
|
+
xScale: xScale,
|
|
44730
|
+
yScale: yScale,
|
|
44731
|
+
data: data,
|
|
44732
|
+
keys: keys,
|
|
44733
|
+
color: function color() {
|
|
44734
|
+
return '';
|
|
44735
|
+
},
|
|
44736
|
+
height: height,
|
|
44737
|
+
width: width,
|
|
44738
|
+
offset: "none",
|
|
44739
|
+
children: function children(barStacks) {
|
|
44740
|
+
return barStacks.map(function (barStack) {
|
|
44741
|
+
return barStack.bars.map(function (bar) {
|
|
44742
|
+
return jsx(Bar, {
|
|
44743
|
+
bar: bar,
|
|
44744
|
+
barStack: barStack,
|
|
44745
|
+
bars: bars,
|
|
44746
|
+
conditionalFormattingRules: conditionalFormattingRules
|
|
44747
|
+
}, bar.key.toString());
|
|
44748
|
+
});
|
|
44749
|
+
});
|
|
44750
|
+
}
|
|
44751
|
+
});
|
|
44752
|
+
};
|
|
44753
|
+
var Bar = function Bar(_ref2) {
|
|
44754
|
+
var bar = _ref2.bar,
|
|
44755
|
+
barStack = _ref2.barStack,
|
|
44756
|
+
bars = _ref2.bars,
|
|
44757
|
+
conditionalFormattingRules = _ref2.conditionalFormattingRules;
|
|
44758
|
+
var BAR_PADDING = 1.5;
|
|
44759
|
+
if (bar.height < 3) return null;
|
|
44760
|
+
return jsx("rect", {
|
|
44761
|
+
x: bar.x,
|
|
44762
|
+
y: bar.y,
|
|
44763
|
+
width: bar.width,
|
|
44764
|
+
height: bar.height - BAR_PADDING,
|
|
44765
|
+
fill: getBarFill(bars, conditionalFormattingRules, bar.key, bar.bar.data),
|
|
44766
|
+
rx: BAR_RADIUS
|
|
44767
|
+
}, "bar-stack-" + barStack.index + "-" + bar.index);
|
|
44768
|
+
};
|
|
44769
|
+
|
|
44510
44770
|
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)."; }
|
|
44511
44771
|
function BarGroup(_ref) {
|
|
44512
44772
|
var data = _ref.data,
|
|
@@ -44556,7 +44816,7 @@ function BarGroup(_ref) {
|
|
|
44556
44816
|
return jsx(Group$2, {
|
|
44557
44817
|
left: barGroup.x0,
|
|
44558
44818
|
children: barGroup.bars.map(function (bar) {
|
|
44559
|
-
return jsx(Bar, {
|
|
44819
|
+
return jsx(Bar$1, {
|
|
44560
44820
|
bar: bar,
|
|
44561
44821
|
barGroup: barGroup,
|
|
44562
44822
|
bars: bars,
|
|
@@ -44574,7 +44834,7 @@ function BarGroup(_ref) {
|
|
|
44574
44834
|
}
|
|
44575
44835
|
});
|
|
44576
44836
|
}
|
|
44577
|
-
var Bar = function Bar(_ref2) {
|
|
44837
|
+
var Bar$1 = function Bar(_ref2) {
|
|
44578
44838
|
var bar = _ref2.bar,
|
|
44579
44839
|
barGroup = _ref2.barGroup,
|
|
44580
44840
|
bars = _ref2.bars,
|
|
@@ -44588,7 +44848,6 @@ var Bar = function Bar(_ref2) {
|
|
|
44588
44848
|
var showBar = bar.value !== null && bar.height > 0 && bar.width > 0;
|
|
44589
44849
|
return jsxs(Fragment, {
|
|
44590
44850
|
children: [showBar && jsx(BarRect, {
|
|
44591
|
-
barRectKey: "bar-group-bar-" + barGroup.index + "-" + bar.index + "-" + bar.value + "-" + String(bar.key),
|
|
44592
44851
|
x: bar.x,
|
|
44593
44852
|
y: bar.y,
|
|
44594
44853
|
width: bar.width,
|
|
@@ -44598,7 +44857,7 @@ var Bar = function Bar(_ref2) {
|
|
|
44598
44857
|
return _onClick(e, barGroup, bar);
|
|
44599
44858
|
},
|
|
44600
44859
|
enableHover: enableHover
|
|
44601
|
-
}), jsx(BarLabel, {
|
|
44860
|
+
}, "bar-group-bar-" + barGroup.index + "-" + bar.index + "-" + bar.value + "-" + String(bar.key)), jsx(BarLabel, {
|
|
44602
44861
|
bar: bar,
|
|
44603
44862
|
barGroup: barGroup,
|
|
44604
44863
|
yLabelPosition: yLabelPosition,
|
|
@@ -44615,7 +44874,7 @@ var BarRect = function BarRect(_ref3) {
|
|
|
44615
44874
|
y = _ref3.y,
|
|
44616
44875
|
width = _ref3.width,
|
|
44617
44876
|
height = _ref3.height,
|
|
44618
|
-
|
|
44877
|
+
key = _ref3.key,
|
|
44619
44878
|
enableHover = _ref3.enableHover;
|
|
44620
44879
|
var _useState = useState(fill),
|
|
44621
44880
|
fillColor = _useState[0],
|
|
@@ -44626,7 +44885,7 @@ var BarRect = function BarRect(_ref3) {
|
|
|
44626
44885
|
} : {
|
|
44627
44886
|
name: "1ltmijl-classes",
|
|
44628
44887
|
styles: "cursor:pointer;label:classes;",
|
|
44629
|
-
map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkJhckdyb3VwLnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUE0S2dDIiwiZmlsZSI6IkJhckdyb3VwLnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IGNzcyB9IGZyb20gJ0BlbW90aW9uL2Nzcyc7XG5pbXBvcnQgeyBHcm91cCB9IGZyb20gJ0B2aXN4L2dyb3VwJztcbmltcG9ydCB7IEJhckdyb3VwIGFzIFZpc3hCYXJHcm91cCB9IGZyb20gJ0B2aXN4L3NoYXBlJztcbmltcG9ydCB7IERhdHVtT2JqZWN0IH0gZnJvbSAnQHZpc3gvc2hhcGUvbGliL3R5cGVzJztcbmltcG9ydCB7IFNjYWxlQmFuZCwgU2NhbGVMaW5lYXIgfSBmcm9tICdAdmlzeC92ZW5kb3IvZDMtc2NhbGUnO1xuaW1wb3J0IHsgRnJhZ21lbnQsIHVzZVN0YXRlIH0gZnJvbSAncmVhY3QnO1xuaW1wb3J0IHsgQmFyU3R5bGVzIH0gZnJvbSAnc2hhcmVkLWxvZ2ljL3NyYy9CYXJDaGFydFYyL3R5cGVzJ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XInKSB7XG4gICAgICByZXR1cm4gTnVtYmVyKHhWYWx1ZSk7XG4gICAgfVxuXG4gICAgcmV0dXJuIFN0cmluZyh4VmFsdWUpO1xuICB9O1xuXG4gIHJldHVybiAoXG4gICAgPFZpc3hCYXJHcm91cDxEYXR1bU9iamVjdD5cbiAgICAgIGRhdGE9e2RhdGEgYXMgRGF0dW1PYmplY3RbXX1cbiAgICAgIGtleXM9e2tleXN9XG4gICAgICBoZWlnaHQ9e2hlaWdodH1cbiAgICAgIHgwPXtnZXRHcm91cFBvc2l0aW9ufVxuICAgICAgLy8gQHRzLWlnbm9yZVxuICAgICAgeDBTY2FsZT17eFNjYWxlfVxuICAgICAgLy8gQHRzLWlnbm9yZVxuICAgICAgeDFTY2FsZT17aW5uZXJYU2NhbGV9XG4gICAgICB5U2NhbGU9e3lTY2FsZX1cbiAgICAgIGNvbG9yPXsoKSA9PiAnJ31cbiAgICA+XG4gICAgICB7KGJhckdyb3VwcykgPT4ge1xuICAgICAgICByZXR1cm4gYmFyR3JvdXBzLm1hcCgoYmFyR3JvdXApID0+IChcbiAgICAgICAgICA8R3JvdXAga2V5PXtgYmFyLWdyb3VwLSR7YmFyR3JvdXAuaW5kZXh9LSR7YmFyR3JvdXAueDB9YH0gbGVmdD17YmFyR3JvdXAueDB9PlxuICAgICAgICAgICAge2Jhckdyb3VwLmJhcnMubWFwKChiYXIpID0+IChcbiAgICAgICAgICAgICAgPEJhclxuICAgICAgICAgICAgICAgIGtleT17YGJhci0ke2Jhci5pbmRleH0tJHtiYXIueH1gfVxuICAgICAgICAgICAgICAgIGJhcj17YmFyfVxuICAgICAgICAgICAgICAgIGJhckdyb3VwPXtiYXJHcm91cH1cbiAgICAgICAgICAgICAgICBiYXJzPXtiYXJzfVxuICAgICAgICAgICAgICAgIGNvbmRpdGlvbmFsRm9ybWF0dGluZ1J1bGVzPXtjb25kaXRpb25hbEZvcm1hdHRpbmdSdWxlc31cbiAgICAgICAgICAgICAgICBlbmFibGVIb3Zlc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ZWlnaHR9XG4gICAgICAgICAgICB4MD17Z2V0R3JvdXBQb3NpdGlvbn1cbiAgICAgICAgICAgIC8vIEB0cy1pZ25vcmVcbiAgICAgICAgICAgIHgwU2NhbGU9e3hTY2FsZX1cbiAgICAgICAgICAgIC8vIEB0cy1pZ25vcmVcbiAgICAgICAgICAgIHgxU2NhbGU9e2lubmVyWFNjYWxlfVxuICAgICAgICAgICAgeVNjYWxlPXt5U2NhbGV9XG4gICAgICAgICAgICBjb2xvcj17KCkgPT4gJyd9XG4gICAgICAgID5cbiAgICAgICAgICAgIHtiYXJHcm91cHMgPT4ge1xuICAgICAgICAgICAgICAgIHJldHVybiBiYXJHcm91cHMubWFwKGJhckdyb3VwID0+IChcbiAgICAgICAgICAgICAgICAgICAgPEdyb3VwIGtleT17YGJhci1ncm91cC0ke2Jhckdyb3VwLmluZGV4fS0ke2Jhckdyb3VwLngwfWB9IGxlZnQ9e2Jhckdyb3VwLngwfT5cbiAgICAgICAgICAgICAgICAgICAgICAgIHtiYXJHcm91cC5iYXJzLm1hcChiYXIgPT4gKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxCYXJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAga2V5PXtgYmFyLSR7YmFyLmluZGV4fS0ke2Jhci54fWB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJhcj17YmFyfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBiYXJHcm91cD17YmFyR3JvdXB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJhcnM9e2JhcnN9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbmRpdGlvbmFsRm9ybWF0dGluZ1J1bGVzPXtjb25kaXRpb25hbEZvcm1hdHRpbmdSdWxlc31cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZW5hYmxlSG92ZXI9e2VuYWJsZUhvdmVyfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsYWJlbFN0eWxlPXtsYWJlbFN0eWxlfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvbkNsaWNrPXtvbkNsaWNrfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaG93RGV0YWlsZWRTdWJHcm91cGluZ0xhYmVscz17c2hvd0RldGFpbGVkU3ViR3JvdXBpbmdMYWJlbHN9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHlBeGlzTGFiZWxzPXt5QXhpc0xhYmVsc31cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeUxhYmVsUG9zaXRpb249e3lMYWJlbFBvc2l0aW9ufVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8+XG4gICAgICAgICAgICAgICAgICAgICAgICApKX1cbiAgICAgICAgICAgICAgICAgICAgPC9Hcm91cD5cbiAgICAgICAgICAgICAgICApKTtcbiAgICAgICAgICAgIH19XG4gICAgICAgIDwvVmlzeEJhckdyb3VwPlxuICAgICk7XG59XG5cbnR5cGUgQmFyUHJvcHMgPSB7XG4gICAgYmFyOiBhbnksXG4gICAgYmFyR3JvdXA6IGFueSxcbiAgICBiYXJzOiBTaGFwZURlZmluaXRpb248QmFyU3R5bGVzPltdO1xuICAgIGNvbmRpdGlvbmFsRm9ybWF0dGluZ1J1bGVzOiBDb25kaXRpb25hbEZvcm1hdHRpbmdSdWxlW107XG4gICAgZW5hYmxlSG92ZXI/OiBib29sZWFuO1xuICAgIG9uQ2xpY2s6IChlOiBSZWFjdC5Nb3VzZUV2ZW50PFNWR1JlY3RFbGVtZW50LCBNb3VzZUV2ZW50PiwgYmFyR3JvdXA6IGFueSwgYmFyOiBhbnkpID0+IHZvaWQ7XG4gICAgc2hvd0RldGFpbGVkU3ViR3JvdXBpbmdMYWJlbHM6IGJvb2xlYW47XG4gICAgbGFiZWxTdHlsZT86IFJlYWN0LkNTU1Byb3BlcnRpZXM7XG4gICAgeUF4aXNMYWJlbHM/OiBzdHJpbmdb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ID8gY3NzKHsgY3Vyc29yOiAncG9pbnRlcicgfSkgOiAnJztcblxuICAgIGNvbnN0IGhhbmRsZU9uTW91c2VFbnRlciA9ICgpID0+IHtcbiAgICAgICAgaWYgKGVuYWJsZUhvdmVyKSB7XG4gICAgICAgICAgICBzZXRGaWxsQ29sb3IobGlnaHRlbkNvbG9yKGZpbGwsIDAuOCkpO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgY29uc3QgaGFuZGxlT25Nb3VzZUxlYXZlID0gKCkgPT4ge1xuICAgICAgICBpZiAoZW5hYmxlSG92ZXIpIHtcbiAgICAgICAgICAgIHNldEZpbGxDb2xvcihmaWxsKTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIHJldHVybiAoXG4gICAgICAgIDxyZWN0XG4gICAgICAgICAgICBrZXk9e2tleX1cbiAgICAgICAgICAgIHg9e3h9XG4gICAgICAgICAgICB5PXt5fVxuICAgICAgICAgICAgd2lkdGg9e3dpZHRofVxuICAgICAgICAgICAgaGVpZ2h0PXtoZWlnaHR9XG4gICAgICAgICAgICBmaWxsPXtmaWxsQ29sb3J9XG4gICAgICAgICAgICByeD17QkFSX1JBRElVU31cbiAgICAgICAgICAgIG9uQ2xpY2s9e29uQ2xpY2t9XG4gICAgICAgICAgICBvbk1vdXNlRW50ZXI9e2hhbmRsZU9uTW91c2VFbnRlcn1cbiAgICAgICAgICAgIG9uTW91c2VMZWF2ZT17aGFuZGxlT25Nb3VzZUxlYXZlfVxuICAgICAgICAgICAgY2xhc3NOYW1lPXtjbGFzc2VzfVxuICAgICAgICAvPlxuICAgICk7XG59O1xuXG50eXBlIEJhckxhYmVsUHJvcHMgPSB7XG4gICAgYmFyOiBhbnk7XG4gICAgYmFyR3JvdXA6IGFueTtcbiAgICB5TGFiZWxQb3NpdGlvbj86IG51bWJlcjtcbiAgICB5QXhpc0xhYmVscz86IHN0cmluZ1tdO1xuICAgIHNob3dEZXRhaWxlZFN1Ykdyb3VwaW5nTGFiZWxzOiBib29sZWF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SR7YmFyR3JvdXAuaW5kZXh9LSR7YmFyLmluZGV4fS0ke2xhYmVsfWA7XG5cbiAgICByZXR1cm4gPHRleHRcbiAgICAgICAga2V5PXtsYWJlbEtleX1cbiAgICAgICAgeD17bGFiZWxYUG9zaXRpb259XG4gICAgICAgIHk9e2xhYmVsWVBvc2l0aW9ufVxuICAgICAgICBzdHlsZT17bGFiZWxTdHlsZX1cbiAgICAgICAgdHJhbnNmb3JtPXtgcm90YXRlKC03MCwgJHtsYWJlbFhQb3NpdGlvbn0sICR7bGFiZWxZUG9zaXRpb259KWB9XG4gICAgICAgIHRleHRBbmNob3I9J2VuZCdcbiAgICA+XG4gICAgICAgIHtmb3JtYXR0ZWRDb2x1bW5MYWJlbH1cbiAgICA8L3RleHQ+XG59Il19 */",
|
|
44630
44889
|
toString: _EMOTION_STRINGIFIED_CSS_ERROR__$9
|
|
44631
44890
|
}) : '';
|
|
44632
44891
|
var handleOnMouseEnter = function handleOnMouseEnter() {
|
|
@@ -44650,7 +44909,7 @@ var BarRect = function BarRect(_ref3) {
|
|
|
44650
44909
|
onMouseEnter: handleOnMouseEnter,
|
|
44651
44910
|
onMouseLeave: handleOnMouseLeave,
|
|
44652
44911
|
className: classes
|
|
44653
|
-
},
|
|
44912
|
+
}, key);
|
|
44654
44913
|
};
|
|
44655
44914
|
var BarLabel = function BarLabel(_ref4) {
|
|
44656
44915
|
var bar = _ref4.bar,
|
|
@@ -44683,124 +44942,6 @@ var BarLabel = function BarLabel(_ref4) {
|
|
|
44683
44942
|
}, labelKey);
|
|
44684
44943
|
};
|
|
44685
44944
|
|
|
44686
|
-
var BarStacked = function BarStacked(_ref) {
|
|
44687
|
-
var xScaleDataType = _ref.xScaleDataType,
|
|
44688
|
-
data = _ref.data,
|
|
44689
|
-
xScaleKey = _ref.xScaleKey,
|
|
44690
|
-
yScale = _ref.yScale,
|
|
44691
|
-
keys = _ref.keys,
|
|
44692
|
-
bars = _ref.bars,
|
|
44693
|
-
conditionalFormattingRules = _ref.conditionalFormattingRules,
|
|
44694
|
-
xScale = _ref.xScale,
|
|
44695
|
-
height = _ref.height,
|
|
44696
|
-
width = _ref.width;
|
|
44697
|
-
var handleGetXValue = function handleGetXValue(d) {
|
|
44698
|
-
var xValue = d[xScaleKey];
|
|
44699
|
-
if (xScaleDataType === 'string') return String(xValue);
|
|
44700
|
-
if (xScaleDataType === 'date_time') {
|
|
44701
|
-
return new Date(xValue);
|
|
44702
|
-
}
|
|
44703
|
-
if (xScaleDataType === 'number') {
|
|
44704
|
-
return Number(xValue);
|
|
44705
|
-
}
|
|
44706
|
-
return String(xValue);
|
|
44707
|
-
};
|
|
44708
|
-
return jsx(BarStack$1, {
|
|
44709
|
-
x: handleGetXValue,
|
|
44710
|
-
xScale: xScale,
|
|
44711
|
-
yScale: yScale,
|
|
44712
|
-
data: data,
|
|
44713
|
-
keys: keys,
|
|
44714
|
-
color: function color() {
|
|
44715
|
-
return '';
|
|
44716
|
-
},
|
|
44717
|
-
height: height,
|
|
44718
|
-
width: width,
|
|
44719
|
-
offset: "none",
|
|
44720
|
-
children: function children(barStacks) {
|
|
44721
|
-
return barStacks.map(function (barStack) {
|
|
44722
|
-
return barStack.bars.map(function (bar) {
|
|
44723
|
-
return jsx(Bar$1, {
|
|
44724
|
-
bar: bar,
|
|
44725
|
-
barStack: barStack,
|
|
44726
|
-
bars: bars,
|
|
44727
|
-
conditionalFormattingRules: conditionalFormattingRules
|
|
44728
|
-
}, bar.key.toString() + "-" + bar.index + "-" + bar.x);
|
|
44729
|
-
});
|
|
44730
|
-
});
|
|
44731
|
-
}
|
|
44732
|
-
});
|
|
44733
|
-
};
|
|
44734
|
-
var Bar$1 = function Bar(_ref2) {
|
|
44735
|
-
var bar = _ref2.bar,
|
|
44736
|
-
barStack = _ref2.barStack,
|
|
44737
|
-
bars = _ref2.bars,
|
|
44738
|
-
conditionalFormattingRules = _ref2.conditionalFormattingRules;
|
|
44739
|
-
var BAR_PADDING = 1.5;
|
|
44740
|
-
if (bar.height < 3) return null;
|
|
44741
|
-
return jsx("rect", {
|
|
44742
|
-
x: bar.x,
|
|
44743
|
-
y: bar.y,
|
|
44744
|
-
width: bar.width,
|
|
44745
|
-
height: bar.height - BAR_PADDING,
|
|
44746
|
-
fill: getBarFill(bars, conditionalFormattingRules, bar.key, bar.bar.data),
|
|
44747
|
-
rx: BAR_RADIUS
|
|
44748
|
-
}, "bar-stack-" + barStack.index + "-" + bar.index);
|
|
44749
|
-
};
|
|
44750
|
-
|
|
44751
|
-
var useBottomAxisBaseLineShift = function useBottomAxisBaseLineShift(_ref) {
|
|
44752
|
-
var showDetailedSubGroupingLabels = _ref.showDetailedSubGroupingLabels,
|
|
44753
|
-
hasBottomTitle = _ref.hasBottomTitle,
|
|
44754
|
-
hasLeftTitle = _ref.hasLeftTitle;
|
|
44755
|
-
if (!showDetailedSubGroupingLabels) {
|
|
44756
|
-
return {
|
|
44757
|
-
bottomAxisBaselineShift: 0,
|
|
44758
|
-
bottomOffset: 0,
|
|
44759
|
-
leftOffset: 0
|
|
44760
|
-
};
|
|
44761
|
-
}
|
|
44762
|
-
return {
|
|
44763
|
-
bottomAxisBaselineShift: hasBottomTitle ? -65 : -60,
|
|
44764
|
-
bottomOffset: hasBottomTitle ? -15 : 10,
|
|
44765
|
-
leftOffset: hasLeftTitle ? -10 : 0
|
|
44766
|
-
};
|
|
44767
|
-
};
|
|
44768
|
-
|
|
44769
|
-
var PADDING = {
|
|
44770
|
-
paddingOuter: 0.05,
|
|
44771
|
-
paddingInner: 0.3
|
|
44772
|
-
};
|
|
44773
|
-
|
|
44774
|
-
function useBarXScale(xScaleDataType, innerWidth, xScaleKey, data) {
|
|
44775
|
-
return useMemo(function () {
|
|
44776
|
-
if (xScaleDataType === 'string') {
|
|
44777
|
-
return scaleBand(_extends({
|
|
44778
|
-
range: [0, innerWidth],
|
|
44779
|
-
domain: xScaleKey ? [].concat(data.map(function (d) {
|
|
44780
|
-
return d[xScaleKey] && d[xScaleKey].value !== null ? String(d[xScaleKey].value) : '';
|
|
44781
|
-
})) : []
|
|
44782
|
-
}, PADDING));
|
|
44783
|
-
}
|
|
44784
|
-
if (xScaleDataType === 'date_time' && xScaleKey) {
|
|
44785
|
-
return scaleBand(_extends({
|
|
44786
|
-
range: [0, innerWidth],
|
|
44787
|
-
domain: data.map(function (d) {
|
|
44788
|
-
return new Date(d[xScaleKey].value);
|
|
44789
|
-
})
|
|
44790
|
-
}, PADDING));
|
|
44791
|
-
}
|
|
44792
|
-
if (xScaleDataType === 'number' && xScaleKey) {
|
|
44793
|
-
return scaleBand(_extends({
|
|
44794
|
-
range: [0, innerWidth],
|
|
44795
|
-
domain: data.map(function (d) {
|
|
44796
|
-
return d[xScaleKey] && d[xScaleKey].value !== null ? Number(d[xScaleKey].value) : 0;
|
|
44797
|
-
})
|
|
44798
|
-
}, PADDING));
|
|
44799
|
-
}
|
|
44800
|
-
return null;
|
|
44801
|
-
}, [innerWidth, data]);
|
|
44802
|
-
}
|
|
44803
|
-
|
|
44804
44945
|
var BarChart$5 = function BarChart(_ref) {
|
|
44805
44946
|
var _theme$axis;
|
|
44806
44947
|
var chart = _ref.chart,
|
|
@@ -44822,7 +44963,7 @@ var BarChart$5 = function BarChart(_ref) {
|
|
|
44822
44963
|
tooltipData = _useTooltip.tooltipData,
|
|
44823
44964
|
hideTooltip = _useTooltip.hideTooltip,
|
|
44824
44965
|
showTooltip = _useTooltip.showTooltip;
|
|
44825
|
-
var showDetailedSubGroupingLabels =
|
|
44966
|
+
var showDetailedSubGroupingLabels = numberOfDimensions === 2 && width > 450;
|
|
44826
44967
|
var hasBottomTitle = chart.x.title != null;
|
|
44827
44968
|
var hasLeftTitle = chart.y.title != null;
|
|
44828
44969
|
var _useBottomAxisBaseLin = useBottomAxisBaseLineShift({
|
|
@@ -44835,7 +44976,7 @@ var BarChart$5 = function BarChart(_ref) {
|
|
|
44835
44976
|
leftOffset = _useBottomAxisBaseLin.leftOffset;
|
|
44836
44977
|
var margin = buildMargin(chart.y.ticks, options.axis.showYAxisLabels, hasLeftTitle, hasBottomTitle, showDetailedSubGroupingLabels);
|
|
44837
44978
|
var innerWidth = width - margin.left - margin.right;
|
|
44838
|
-
var innerHeight = height - margin.top - margin.bottom - (options.showLegend ? 50 : 0) - (showDetailedSubGroupingLabels ? 50 : 0)
|
|
44979
|
+
var innerHeight = height - margin.top - margin.bottom - (options.showLegend ? 50 : 0) - (showDetailedSubGroupingLabels ? 50 : 0);
|
|
44839
44980
|
var xKey = chart.x.key;
|
|
44840
44981
|
var xScaleKey = chart.x.scale.key;
|
|
44841
44982
|
var xScaleDataType = chart.x.scale.dataType;
|
|
@@ -45429,7 +45570,6 @@ function Area(_ref3) {
|
|
|
45429
45570
|
});
|
|
45430
45571
|
}
|
|
45431
45572
|
|
|
45432
|
-
var MAX_BUBBLE_RADIUS = 30;
|
|
45433
45573
|
var BubbleChart$4 = function BubbleChart(_ref) {
|
|
45434
45574
|
var _theme$axis;
|
|
45435
45575
|
var chart = _ref.chart,
|
|
@@ -45451,34 +45591,25 @@ var BubbleChart$4 = function BubbleChart(_ref) {
|
|
|
45451
45591
|
var zValues = chart.z ? chart.data.map(function (d) {
|
|
45452
45592
|
return d[chart.z];
|
|
45453
45593
|
}).map(function (d) {
|
|
45454
|
-
return d
|
|
45594
|
+
return d.value;
|
|
45455
45595
|
}) : [];
|
|
45456
45596
|
var normaliseArray = function normaliseArray(array, min, max) {
|
|
45457
45597
|
var arrayMin = Math.min.apply(Math, array);
|
|
45458
45598
|
var arrayMax = Math.max.apply(Math, array);
|
|
45459
|
-
if (arrayMin === arrayMax) {
|
|
45460
|
-
return array.map(function () {
|
|
45461
|
-
return min;
|
|
45462
|
-
});
|
|
45463
|
-
}
|
|
45464
45599
|
return array.map(function (value) {
|
|
45465
45600
|
return (value - arrayMin) / (arrayMax - arrayMin) * (max - min) + min;
|
|
45466
45601
|
});
|
|
45467
45602
|
};
|
|
45468
|
-
var scaledSizeValues = normaliseArray(zValues, 5,
|
|
45603
|
+
var scaledSizeValues = normaliseArray(zValues, 5, 30);
|
|
45469
45604
|
var margin = buildMargin(chart.y.ticks, options.axis.showYAxisLabels, chart.y.title != null, chart.x.title != null);
|
|
45470
45605
|
var _useState = useState(chart.lines.map(function (legendItem) {
|
|
45471
45606
|
return legendItem.yKey;
|
|
45472
|
-
}).filter(function (yKey) {
|
|
45473
|
-
return yKey !== chart.groupByKey;
|
|
45474
45607
|
})),
|
|
45475
45608
|
visibleYKeys = _useState[0],
|
|
45476
45609
|
setVisibleYKeys = _useState[1];
|
|
45477
45610
|
useEffect(function () {
|
|
45478
45611
|
setVisibleYKeys(chart.lines.map(function (legendItem) {
|
|
45479
45612
|
return legendItem.yKey;
|
|
45480
|
-
}).filter(function (yKey) {
|
|
45481
|
-
return yKey !== chart.groupByKey;
|
|
45482
45613
|
}));
|
|
45483
45614
|
return function () {
|
|
45484
45615
|
setVisibleYKeys([]);
|
|
@@ -45504,13 +45635,13 @@ var BubbleChart$4 = function BubbleChart(_ref) {
|
|
|
45504
45635
|
if (xScaleDataType === 'date_time') {
|
|
45505
45636
|
return scaleTime({
|
|
45506
45637
|
range: [0, innerWidth],
|
|
45507
|
-
domain: chart.x.scale.ordering === '
|
|
45638
|
+
domain: chart.x.scale.ordering === 'asc' ? [chart.x.scale.min, chart.x.scale.max] : [chart.x.scale.max, chart.x.scale.min]
|
|
45508
45639
|
});
|
|
45509
45640
|
}
|
|
45510
45641
|
if (xScaleDataType === 'number') {
|
|
45511
45642
|
return scaleLinear({
|
|
45512
45643
|
range: [0, innerWidth],
|
|
45513
|
-
domain: chart.x.scale.ordering === '
|
|
45644
|
+
domain: chart.x.scale.ordering === 'asc' ? [chart.x.scale.min, chart.x.scale.max] : [chart.x.scale.max, chart.x.scale.min],
|
|
45514
45645
|
nice: true
|
|
45515
45646
|
});
|
|
45516
45647
|
}
|
|
@@ -45549,18 +45680,11 @@ var BubbleChart$4 = function BubbleChart(_ref) {
|
|
|
45549
45680
|
var yTickValues = chart.y.ticks.map(function (tick) {
|
|
45550
45681
|
return Number(tick.value);
|
|
45551
45682
|
});
|
|
45552
|
-
var
|
|
45683
|
+
var legendTooltipItems = [{
|
|
45553
45684
|
legendItems: chart.lines,
|
|
45554
45685
|
visibleYKeys: visibleYKeys,
|
|
45555
45686
|
conditionalFormattingRules: chart.conditionalFormattingRules
|
|
45556
45687
|
}];
|
|
45557
|
-
var legendItems = chart.legend.items.map(function (legendItem) {
|
|
45558
|
-
return {
|
|
45559
|
-
legendItems: [legendItem],
|
|
45560
|
-
visibleYKeys: [legendItem.yKey],
|
|
45561
|
-
conditionalFormattingRules: chart.conditionalFormattingRules
|
|
45562
|
-
};
|
|
45563
|
-
});
|
|
45564
45688
|
return jsxs(React__default.Fragment, {
|
|
45565
45689
|
children: [jsxs(ChartWrapper$1, {
|
|
45566
45690
|
width: width,
|
|
@@ -45638,20 +45762,20 @@ var BubbleChart$4 = function BubbleChart(_ref) {
|
|
|
45638
45762
|
width: innerWidth
|
|
45639
45763
|
})]
|
|
45640
45764
|
}), options.showLegend && jsx(Legend$1, {
|
|
45641
|
-
items:
|
|
45642
|
-
|
|
45765
|
+
items: legendTooltipItems,
|
|
45766
|
+
setVisibleYKeys: setVisibleYKeys,
|
|
45767
|
+
keys: chart.keys,
|
|
45643
45768
|
marginLeft: margin.left - margin.leftTitleOffset
|
|
45644
45769
|
}), tooltipOpen && tooltipData && xKey && jsx(Tooltip$1, {
|
|
45645
|
-
items:
|
|
45770
|
+
items: legendTooltipItems,
|
|
45646
45771
|
tooltipData: tooltipData,
|
|
45647
45772
|
tooltipLeft: tooltipLeft,
|
|
45648
45773
|
tooltipTop: tooltipTop,
|
|
45649
|
-
xKey:
|
|
45774
|
+
xKey: xKey,
|
|
45650
45775
|
keys: chart.keys,
|
|
45651
45776
|
yKeys: chart.y.keys,
|
|
45652
45777
|
showRoundedTotal: options.showRoundedTotal,
|
|
45653
|
-
theme: themeCSS.popoverMenus
|
|
45654
|
-
shouldShowColorLegend: false
|
|
45778
|
+
theme: themeCSS.popoverMenus
|
|
45655
45779
|
})]
|
|
45656
45780
|
});
|
|
45657
45781
|
};
|
|
@@ -45662,9 +45786,6 @@ function Bubbles(_ref2) {
|
|
|
45662
45786
|
xScale = _ref2.xScale,
|
|
45663
45787
|
yScale = _ref2.yScale,
|
|
45664
45788
|
chart = _ref2.chart;
|
|
45665
|
-
var getBubbleColor = function getBubbleColor(index) {
|
|
45666
|
-
return chart.legend.items[index % chart.legend.items.length].color;
|
|
45667
|
-
};
|
|
45668
45789
|
return jsx(Fragment, {
|
|
45669
45790
|
children: data.map(function (d, index) {
|
|
45670
45791
|
var _ref3, _yScale2;
|
|
@@ -45672,7 +45793,10 @@ function Bubbles(_ref2) {
|
|
|
45672
45793
|
r: d.bubbleSize,
|
|
45673
45794
|
cx: (_ref3 = xScale(d[xScaleKey])) != null ? _ref3 : 0,
|
|
45674
45795
|
cy: (_yScale2 = yScale(d[yKeys[0]])) != null ? _yScale2 : 0,
|
|
45675
|
-
fill:
|
|
45796
|
+
fill: chart.lines[0].color,
|
|
45797
|
+
style: {
|
|
45798
|
+
zIndex: -d.bubbleSize
|
|
45799
|
+
}
|
|
45676
45800
|
}, "bubble_chart_" + index);
|
|
45677
45801
|
})
|
|
45678
45802
|
});
|
|
@@ -45947,21 +46071,6 @@ var RadarChart$2 = function RadarChart(_ref) {
|
|
|
45947
46071
|
});
|
|
45948
46072
|
};
|
|
45949
46073
|
|
|
45950
|
-
var init$d = function init(xMeasure, yMeasure) {
|
|
45951
|
-
return {
|
|
45952
|
-
x: xMeasure.map(function (measure) {
|
|
45953
|
-
return id(measure);
|
|
45954
|
-
}),
|
|
45955
|
-
y: yMeasure.map(function (measure) {
|
|
45956
|
-
return id(measure);
|
|
45957
|
-
}),
|
|
45958
|
-
detailed: {
|
|
45959
|
-
x: xMeasure,
|
|
45960
|
-
y: yMeasure
|
|
45961
|
-
}
|
|
45962
|
-
};
|
|
45963
|
-
};
|
|
45964
|
-
|
|
45965
46074
|
var getStyleDefinition = function getStyleDefinition(_ref) {
|
|
45966
46075
|
var colors = _ref.colors,
|
|
45967
46076
|
yKeys = _ref.yKeys;
|
|
@@ -46040,7 +46149,7 @@ var getScaleAndTicks = function getScaleAndTicks(_ref) {
|
|
|
46040
46149
|
yKeys = _ref.yKeys,
|
|
46041
46150
|
xScaleDataType = _ref.xScaleDataType,
|
|
46042
46151
|
nullValue = _ref.nullValue,
|
|
46043
|
-
|
|
46152
|
+
tickCountYAxis = _ref.tickCountYAxis,
|
|
46044
46153
|
formattingFunctionX = _ref.formattingFunctionX,
|
|
46045
46154
|
formattingFunctionY = _ref.formattingFunctionY,
|
|
46046
46155
|
order = _ref.order,
|
|
@@ -46057,18 +46166,32 @@ var getScaleAndTicks = function getScaleAndTicks(_ref) {
|
|
|
46057
46166
|
keys: xScale.key === null ? [] : [xScale.key],
|
|
46058
46167
|
dataType: xScale.dataType
|
|
46059
46168
|
});
|
|
46169
|
+
if (xKey) {
|
|
46170
|
+
xTicks = data.map(function (dataItem) {
|
|
46171
|
+
var _dataItem$xKey, _dataItem$xScale$key, _dataItem$xScale$key2;
|
|
46172
|
+
var xValue = (_dataItem$xKey = dataItem[xKey]) != null && _dataItem$xKey.value ? dataItem[xKey].value : null;
|
|
46173
|
+
var xformattedValue = formattingFunctionX(xValue, nullValue);
|
|
46174
|
+
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 : '';
|
|
46175
|
+
var xScaleValueAdjusted = xScale.dataType === 'date_time' ? new Date(xScaleValue) : xScale.dataType === 'string' ? String(xScaleValue) : xScale.dataType === 'number' ? Number(xScaleValue) : xScaleValue;
|
|
46176
|
+
return {
|
|
46177
|
+
value: xValue !== null ? xValue : '',
|
|
46178
|
+
formattedValue: xformattedValue !== null ? "" + xformattedValue : null,
|
|
46179
|
+
scaleValue: xScaleValueAdjusted
|
|
46180
|
+
};
|
|
46181
|
+
});
|
|
46182
|
+
}
|
|
46183
|
+
// ----- Y Axis ("number") -----
|
|
46184
|
+
|
|
46060
46185
|
var y = getMinAndMax({
|
|
46061
46186
|
data: data,
|
|
46062
46187
|
keys: yKeys,
|
|
46063
46188
|
dataType: 'number',
|
|
46064
46189
|
goalLines: goalLines
|
|
46065
46190
|
});
|
|
46066
|
-
var maxY = y.max
|
|
46191
|
+
var maxY = y.max || 0;
|
|
46067
46192
|
var minY = Math.min(y.min || 0, 0);
|
|
46068
|
-
var tickCountYAxis = approxYAxisLabelCount === 'auto' ? 10 : approxYAxisLabelCount;
|
|
46069
46193
|
var yTickInterval = getNiceInterval((maxY - minY) / (tickCountYAxis - 1));
|
|
46070
|
-
var i = 0;
|
|
46071
|
-
while (yTickInterval * i <= maxY + yTickInterval) {
|
|
46194
|
+
for (var i = 0; i < tickCountYAxis; i++) {
|
|
46072
46195
|
var _value = yTickInterval * i;
|
|
46073
46196
|
var formattedValue = formattingFunctionY(_value, nullValue);
|
|
46074
46197
|
yTicks.push({
|
|
@@ -46076,29 +46199,14 @@ var getScaleAndTicks = function getScaleAndTicks(_ref) {
|
|
|
46076
46199
|
formattedValue: formattedValue,
|
|
46077
46200
|
scaleValue: _value
|
|
46078
46201
|
});
|
|
46079
|
-
i++;
|
|
46080
|
-
}
|
|
46081
|
-
var maxX = x.max ? x.max * 1.05 : x.max || 1;
|
|
46082
|
-
var minX = Math.min(x.min || 0, 0);
|
|
46083
|
-
var xTickInterval = getNiceInterval((maxX - minX) / (10 - 1));
|
|
46084
|
-
i = 0;
|
|
46085
|
-
while (xTickInterval * i <= maxX + xTickInterval) {
|
|
46086
|
-
var _value2 = xTickInterval * i;
|
|
46087
|
-
var _formattedValue = formattingFunctionX(_value2, nullValue);
|
|
46088
|
-
xTicks.push({
|
|
46089
|
-
value: _value2,
|
|
46090
|
-
formattedValue: _formattedValue,
|
|
46091
|
-
scaleValue: _value2
|
|
46092
|
-
});
|
|
46093
|
-
i++;
|
|
46094
46202
|
}
|
|
46095
46203
|
return {
|
|
46096
46204
|
x: {
|
|
46097
46205
|
ticks: xTicks,
|
|
46098
46206
|
scale: {
|
|
46099
46207
|
dataType: xScale.dataType,
|
|
46100
|
-
max:
|
|
46101
|
-
min:
|
|
46208
|
+
max: x.max,
|
|
46209
|
+
min: x.min,
|
|
46102
46210
|
key: xScale.key,
|
|
46103
46211
|
ordering: xScale.ordering
|
|
46104
46212
|
}
|
|
@@ -46107,7 +46215,7 @@ var getScaleAndTicks = function getScaleAndTicks(_ref) {
|
|
|
46107
46215
|
ticks: yTicks,
|
|
46108
46216
|
scale: {
|
|
46109
46217
|
dataType: 'number',
|
|
46110
|
-
key:
|
|
46218
|
+
key: null,
|
|
46111
46219
|
ordering: 'asc',
|
|
46112
46220
|
max: maxY,
|
|
46113
46221
|
min: minY
|
|
@@ -46145,6 +46253,223 @@ var getGoalLines = function getGoalLines(_ref) {
|
|
|
46145
46253
|
});
|
|
46146
46254
|
};
|
|
46147
46255
|
|
|
46256
|
+
var buildTrendAndForecast = function buildTrendAndForecast(_ref) {
|
|
46257
|
+
var data = _ref.data,
|
|
46258
|
+
forecastUnits = _ref.forecastUnits,
|
|
46259
|
+
xKey = _ref.xKey,
|
|
46260
|
+
yKey = _ref.yKey,
|
|
46261
|
+
timeUnit = _ref.timeUnit,
|
|
46262
|
+
includeForecast = _ref.includeForecast;
|
|
46263
|
+
var forecastKey = yKey + "_forecast";
|
|
46264
|
+
var trendKey = yKey + "_trend";
|
|
46265
|
+
var trendData = [];
|
|
46266
|
+
var forecastData = [];
|
|
46267
|
+
var values = data.map(function (point) {
|
|
46268
|
+
return Number(point[yKey].value);
|
|
46269
|
+
});
|
|
46270
|
+
var dates = data.map(function (point) {
|
|
46271
|
+
return new Date(point[xKey].value);
|
|
46272
|
+
});
|
|
46273
|
+
var n = values.length;
|
|
46274
|
+
var daysSinceStart = dates.map(function (date) {
|
|
46275
|
+
return (date.getTime() - dates[0].getTime()) / 86400000;
|
|
46276
|
+
});
|
|
46277
|
+
var meanX = daysSinceStart.reduce(function (a, b) {
|
|
46278
|
+
return a + b;
|
|
46279
|
+
}, 0) / n;
|
|
46280
|
+
var meanY = values.reduce(function (a, b) {
|
|
46281
|
+
return a + b;
|
|
46282
|
+
}, 0) / n;
|
|
46283
|
+
var numerator = 0,
|
|
46284
|
+
denominator = 0;
|
|
46285
|
+
for (var i = 0; i < n; i++) {
|
|
46286
|
+
numerator += (daysSinceStart[i] - meanX) * (values[i] - meanY);
|
|
46287
|
+
denominator += Math.pow(daysSinceStart[i] - meanX, 2);
|
|
46288
|
+
}
|
|
46289
|
+
var slope = numerator / denominator;
|
|
46290
|
+
var intercept = meanY - slope * meanX;
|
|
46291
|
+
var forecastDate = new Date(dates[n - 1]); // Start from the last date in the data
|
|
46292
|
+
|
|
46293
|
+
for (var _i = 0; _i < n + (includeForecast ? forecastUnits : 0); _i++) {
|
|
46294
|
+
var x = void 0;
|
|
46295
|
+
if (_i < n) {
|
|
46296
|
+
// Use existing dates for current trend values
|
|
46297
|
+
x = dates[_i];
|
|
46298
|
+
} else if (includeForecast) {
|
|
46299
|
+
// Generate future dates for forecast values if includeForecast is true
|
|
46300
|
+
switch (timeUnit) {
|
|
46301
|
+
case 'week':
|
|
46302
|
+
forecastDate.setDate(forecastDate.getDate() + 7);
|
|
46303
|
+
break;
|
|
46304
|
+
case 'month':
|
|
46305
|
+
forecastDate.setMonth(forecastDate.getMonth() + 1);
|
|
46306
|
+
break;
|
|
46307
|
+
case 'quarter':
|
|
46308
|
+
forecastDate.setMonth(forecastDate.getMonth() + 3);
|
|
46309
|
+
break;
|
|
46310
|
+
case 'year':
|
|
46311
|
+
forecastDate.setFullYear(forecastDate.getFullYear() + 1);
|
|
46312
|
+
break;
|
|
46313
|
+
}
|
|
46314
|
+
x = new Date(forecastDate);
|
|
46315
|
+
} else {
|
|
46316
|
+
continue; // Skip this iteration if forecasting is not included
|
|
46317
|
+
}
|
|
46318
|
+
var dayCount = (x.getTime() - dates[0].getTime()) / 86400000; // 1 day in milliseconds
|
|
46319
|
+
var forecastedValue = slope * dayCount + intercept;
|
|
46320
|
+
var currentValue = slope * dayCount + intercept;
|
|
46321
|
+
if (_i >= n - 1) {
|
|
46322
|
+
if (_i === n - 1) {
|
|
46323
|
+
trendData.push({
|
|
46324
|
+
date: x.toISOString(),
|
|
46325
|
+
value: parseFloat(currentValue.toFixed(2))
|
|
46326
|
+
});
|
|
46327
|
+
}
|
|
46328
|
+
if (includeForecast) {
|
|
46329
|
+
forecastData.push({
|
|
46330
|
+
date: x.toISOString(),
|
|
46331
|
+
value: parseFloat(forecastedValue.toFixed(2))
|
|
46332
|
+
});
|
|
46333
|
+
}
|
|
46334
|
+
} else {
|
|
46335
|
+
trendData.push({
|
|
46336
|
+
date: x.toISOString(),
|
|
46337
|
+
value: parseFloat(currentValue.toFixed(2))
|
|
46338
|
+
});
|
|
46339
|
+
}
|
|
46340
|
+
}
|
|
46341
|
+
return {
|
|
46342
|
+
trendData: trendData,
|
|
46343
|
+
trendKey: trendKey,
|
|
46344
|
+
forecastData: forecastData,
|
|
46345
|
+
forecastKey: forecastKey
|
|
46346
|
+
};
|
|
46347
|
+
};
|
|
46348
|
+
|
|
46349
|
+
var getTrendsAndForecastsData = function getTrendsAndForecastsData(_ref) {
|
|
46350
|
+
var _trendsAndForecasts$;
|
|
46351
|
+
var chartData = _ref.chartData,
|
|
46352
|
+
formattingFunctionX = _ref.formattingFunctionX,
|
|
46353
|
+
formattingFunctionY = _ref.formattingFunctionY,
|
|
46354
|
+
keys = _ref.keys,
|
|
46355
|
+
nullValue = _ref.nullValue,
|
|
46356
|
+
orderFunction = _ref.orderFunction,
|
|
46357
|
+
trendsAndForecasts = _ref.trendsAndForecasts,
|
|
46358
|
+
xAxisPostfix = _ref.xAxisPostfix,
|
|
46359
|
+
xAxisPrefix = _ref.xAxisPrefix,
|
|
46360
|
+
xKey = _ref.xKey,
|
|
46361
|
+
xScaleDataType = _ref.xScaleDataType,
|
|
46362
|
+
yAxisPostfix = _ref.yAxisPostfix,
|
|
46363
|
+
yAxisPrefix = _ref.yAxisPrefix,
|
|
46364
|
+
yKeys = _ref.yKeys;
|
|
46365
|
+
if (!trendsAndForecasts || trendsAndForecasts.length === 0 || xScaleDataType !== 'date_time') return {
|
|
46366
|
+
chartData: chartData
|
|
46367
|
+
};
|
|
46368
|
+
if (!orderFunction || !['week', 'month', 'quarter', 'year'].includes(orderFunction)) return {
|
|
46369
|
+
chartData: chartData
|
|
46370
|
+
};
|
|
46371
|
+
|
|
46372
|
+
// ----- Technically we should do a loop here but at the moment we'll only have one trend/forecast so use trendsAndForecasts[0] -----
|
|
46373
|
+
|
|
46374
|
+
var includeForecast = trendsAndForecasts[0].type === 'Forecast';
|
|
46375
|
+
var forecastUnits = trendsAndForecasts[0].type === 'Forecast' ? (_trendsAndForecasts$ = trendsAndForecasts[0].value) != null ? _trendsAndForecasts$ : 0 : 0;
|
|
46376
|
+
var yKey = yKeys[0];
|
|
46377
|
+
var newKeys = cloneDeep(keys);
|
|
46378
|
+
var _buildTrendAndForecas = buildTrendAndForecast({
|
|
46379
|
+
data: chartData,
|
|
46380
|
+
forecastUnits: forecastUnits,
|
|
46381
|
+
xKey: xKey,
|
|
46382
|
+
yKey: yKey,
|
|
46383
|
+
timeUnit: orderFunction,
|
|
46384
|
+
includeForecast: includeForecast
|
|
46385
|
+
}),
|
|
46386
|
+
trendData = _buildTrendAndForecas.trendData,
|
|
46387
|
+
trendKey = _buildTrendAndForecas.trendKey,
|
|
46388
|
+
forecastData = _buildTrendAndForecas.forecastData,
|
|
46389
|
+
forecastKey = _buildTrendAndForecas.forecastKey;
|
|
46390
|
+
|
|
46391
|
+
// ----- Add Trend To Existing Data Array And Trend Key -----
|
|
46392
|
+
|
|
46393
|
+
var newData = chartData.map(function (dataItem) {
|
|
46394
|
+
var date = dataItem[xKey].value;
|
|
46395
|
+
var trend = trendData.find(function (trendItem) {
|
|
46396
|
+
return trendItem.date === date;
|
|
46397
|
+
});
|
|
46398
|
+
if (trend) {
|
|
46399
|
+
var trendDataItem = {
|
|
46400
|
+
value: trend.value,
|
|
46401
|
+
formattedValue: "" + yAxisPrefix + formattingFunctionY(trend.value, nullValue) + yAxisPostfix
|
|
46402
|
+
};
|
|
46403
|
+
if (includeForecast && forecastData.length > 0) {
|
|
46404
|
+
var _extends2;
|
|
46405
|
+
return _extends({}, dataItem, (_extends2 = {}, _extends2[trendKey] = trendDataItem, _extends2[forecastKey] = {
|
|
46406
|
+
value: null,
|
|
46407
|
+
formattedValue: null
|
|
46408
|
+
}, _extends2));
|
|
46409
|
+
} else {
|
|
46410
|
+
var _extends3;
|
|
46411
|
+
return _extends({}, dataItem, (_extends3 = {}, _extends3[trendKey] = trendDataItem, _extends3));
|
|
46412
|
+
}
|
|
46413
|
+
}
|
|
46414
|
+
return null;
|
|
46415
|
+
});
|
|
46416
|
+
|
|
46417
|
+
// ----- Add New Array Items For Forecast & Forecast Key -----
|
|
46418
|
+
|
|
46419
|
+
if (includeForecast && forecastData.length > 0) {
|
|
46420
|
+
var _loop = function _loop() {
|
|
46421
|
+
var _forecastIncrement;
|
|
46422
|
+
var forecastDataItem = forecastData[index];
|
|
46423
|
+
var forecastIncrement = (_forecastIncrement = {}, _forecastIncrement[xKey] = {
|
|
46424
|
+
value: forecastDataItem.date,
|
|
46425
|
+
formattedValue: "" + xAxisPrefix + formattingFunctionX(forecastDataItem.date, nullValue) + xAxisPostfix
|
|
46426
|
+
}, _forecastIncrement[trendKey] = {
|
|
46427
|
+
value: null,
|
|
46428
|
+
formattedValue: null
|
|
46429
|
+
}, _forecastIncrement[forecastKey] = {
|
|
46430
|
+
value: forecastDataItem.value,
|
|
46431
|
+
formattedValue: "" + yAxisPrefix + formattingFunctionY(forecastDataItem.value, nullValue) + yAxisPostfix
|
|
46432
|
+
}, _forecastIncrement);
|
|
46433
|
+
yKeys.forEach(function (key) {
|
|
46434
|
+
forecastIncrement[key] = {
|
|
46435
|
+
value: null,
|
|
46436
|
+
formattedValue: null
|
|
46437
|
+
};
|
|
46438
|
+
});
|
|
46439
|
+
newData.push(forecastIncrement);
|
|
46440
|
+
};
|
|
46441
|
+
for (var index = 0; index < forecastUnits; index++) {
|
|
46442
|
+
_loop();
|
|
46443
|
+
}
|
|
46444
|
+
}
|
|
46445
|
+
|
|
46446
|
+
// ----- Update Keys -----
|
|
46447
|
+
|
|
46448
|
+
var newYKeys = includeForecast && forecastData.length > 0 ? [].concat(yKeys, [trendKey, forecastKey]) : [].concat(yKeys, [trendKey]);
|
|
46449
|
+
newKeys[trendKey] = {
|
|
46450
|
+
key: trendKey,
|
|
46451
|
+
keyFormatted: newKeys[yKey].keyFormatted + " \u2022 Trend",
|
|
46452
|
+
dataType: 'number'
|
|
46453
|
+
};
|
|
46454
|
+
if (includeForecast && forecastData.length > 0) {
|
|
46455
|
+
newKeys[forecastKey] = {
|
|
46456
|
+
key: forecastKey,
|
|
46457
|
+
keyFormatted: newKeys[yKey].keyFormatted + " \u2022 Forecast",
|
|
46458
|
+
dataType: 'number'
|
|
46459
|
+
};
|
|
46460
|
+
}
|
|
46461
|
+
|
|
46462
|
+
// ----- Create style definitions for trend and forecast in the form of legend items to append to getStyleDefinition() -----
|
|
46463
|
+
|
|
46464
|
+
// TODO
|
|
46465
|
+
|
|
46466
|
+
return {
|
|
46467
|
+
newChartData: newData,
|
|
46468
|
+
newYKeys: newYKeys,
|
|
46469
|
+
newKeys: newKeys
|
|
46470
|
+
};
|
|
46471
|
+
};
|
|
46472
|
+
|
|
46148
46473
|
/**
|
|
46149
46474
|
* When provided with a result, and formatting parameters, it returns a
|
|
46150
46475
|
* populated result including the formatted value to show.
|
|
@@ -46241,28 +46566,77 @@ var formatResult = function formatResult(result, params) {
|
|
|
46241
46566
|
};
|
|
46242
46567
|
};
|
|
46243
46568
|
|
|
46244
|
-
var formattedResultToSeries = function formattedResultToSeries(formattedResult, pivotConfig, zFieldId) {
|
|
46569
|
+
var formattedResultToSeries = function formattedResultToSeries(formattedResult, pivotConfig, seriesLabelFormatter, zFieldId) {
|
|
46570
|
+
var _formattedResult$fiel, _formattedResult$fiel2;
|
|
46245
46571
|
var keys = {};
|
|
46246
|
-
|
|
46247
|
-
|
|
46248
|
-
|
|
46249
|
-
|
|
46250
|
-
|
|
46251
|
-
|
|
46252
|
-
};
|
|
46572
|
+
|
|
46573
|
+
// Collect the result fields which are going to be used on the Y axis.
|
|
46574
|
+
var yResultFields = formattedResult.fields.filter(function (resultField) {
|
|
46575
|
+
var isNotXPivot = !pivotConfig.x.includes(resultField.id);
|
|
46576
|
+
var isNotYPivot = !pivotConfig.y.includes(resultField.id);
|
|
46577
|
+
return isNotXPivot && isNotYPivot;
|
|
46253
46578
|
});
|
|
46579
|
+
var xPivotFields = formattedResult.fields.filter(function (resultField) {
|
|
46580
|
+
return pivotConfig.x.includes(resultField.id);
|
|
46581
|
+
});
|
|
46582
|
+
var yPivotFields = formattedResult.fields.filter(function (resultField) {
|
|
46583
|
+
return pivotConfig.y.includes(resultField.id);
|
|
46584
|
+
});
|
|
46585
|
+
var pivotedData = {};
|
|
46586
|
+
var xKeyOrdering = [];
|
|
46587
|
+
var yKeys = {};
|
|
46588
|
+
formattedResult.contentMapped.forEach(function (row) {
|
|
46589
|
+
xPivotFields.forEach(function (xPivotField) {
|
|
46590
|
+
var _extends2;
|
|
46591
|
+
var uniqueXValue = xPivotField.id + ":" + row[xPivotField.id].value;
|
|
46592
|
+
xKeyOrdering.push(uniqueXValue);
|
|
46593
|
+
|
|
46594
|
+
// Add any existing values, and the x key itself
|
|
46595
|
+
|
|
46596
|
+
var yPivotPrefix = yPivotFields.map(function (yPivotField) {
|
|
46597
|
+
return yPivotField.id + ":" + row[yPivotField.id].value;
|
|
46598
|
+
}).join('_');
|
|
46599
|
+
pivotedData[uniqueXValue] = _extends({}, pivotedData[uniqueXValue] || {}, (_extends2 = {}, _extends2[xPivotField.id] = row[xPivotField.id], _extends2));
|
|
46600
|
+
yResultFields.forEach(function (yResultField) {
|
|
46601
|
+
var _extends3;
|
|
46602
|
+
var key = yPivotFields.length > 0 ? [yPivotPrefix, yResultField.id].join('_') : yResultField.id;
|
|
46603
|
+
yKeys[key] = true;
|
|
46604
|
+
keys[key] = {
|
|
46605
|
+
key: key,
|
|
46606
|
+
dataType: yResultField.dataType,
|
|
46607
|
+
outputDataType: yResultField.outputDataType,
|
|
46608
|
+
keyFormatted: seriesLabelFormatter({
|
|
46609
|
+
yResultField: yResultField,
|
|
46610
|
+
yPivotFields: yPivotFields,
|
|
46611
|
+
row: row
|
|
46612
|
+
})
|
|
46613
|
+
};
|
|
46614
|
+
pivotedData[uniqueXValue] = _extends({}, pivotedData[uniqueXValue] || {}, (_extends3 = {}, _extends3[key] = row[yResultField.id], _extends3));
|
|
46615
|
+
});
|
|
46616
|
+
});
|
|
46617
|
+
});
|
|
46618
|
+
var seriesDataFlattened = uniq(xKeyOrdering).map(function (xKey) {
|
|
46619
|
+
return pivotedData[xKey];
|
|
46620
|
+
});
|
|
46621
|
+
var mappedXKeys = xPivotFields.map(function (r) {
|
|
46622
|
+
return r.id;
|
|
46623
|
+
});
|
|
46624
|
+
var mappedYKeys = Object.keys(yKeys);
|
|
46625
|
+
var mappedZKey = (_formattedResult$fiel = (_formattedResult$fiel2 = formattedResult.fields.find(function (resultField) {
|
|
46626
|
+
return resultField.fieldId === zFieldId;
|
|
46627
|
+
})) == null ? void 0 : _formattedResult$fiel2.id) != null ? _formattedResult$fiel : '';
|
|
46254
46628
|
var formattedResultReturn = {
|
|
46255
|
-
xKeys:
|
|
46256
|
-
yKeys:
|
|
46257
|
-
zKey:
|
|
46629
|
+
xKeys: mappedXKeys,
|
|
46630
|
+
yKeys: mappedYKeys,
|
|
46631
|
+
zKey: mappedZKey,
|
|
46258
46632
|
keys: keys,
|
|
46259
|
-
seriesData:
|
|
46633
|
+
seriesData: seriesDataFlattened
|
|
46260
46634
|
};
|
|
46261
46635
|
return formattedResultReturn;
|
|
46262
46636
|
};
|
|
46263
46637
|
|
|
46264
46638
|
var buildBubbleChartRepresentation = function buildBubbleChartRepresentation(_ref) {
|
|
46265
|
-
var _pivotConfig$x$, _xKeys$,
|
|
46639
|
+
var _pivotConfig$x$, _xKeys$, _axisTitles$x, _axisTitles$y;
|
|
46266
46640
|
var axisTitles = _ref.axisTitles,
|
|
46267
46641
|
colors = _ref.colors,
|
|
46268
46642
|
conditionalFormattingAttributes = _ref.conditionalFormattingAttributes,
|
|
@@ -46274,6 +46648,7 @@ var buildBubbleChartRepresentation = function buildBubbleChartRepresentation(_re
|
|
|
46274
46648
|
order = _ref.order,
|
|
46275
46649
|
pivotConfig = _ref.pivotConfig,
|
|
46276
46650
|
result = _ref.result,
|
|
46651
|
+
trendsAndForecasts = _ref.trendsAndForecasts,
|
|
46277
46652
|
xAxisFormat = _ref.xAxisFormat,
|
|
46278
46653
|
xAxisPostfix = _ref.xAxisPostfix,
|
|
46279
46654
|
xAxisPrefix = _ref.xAxisPrefix,
|
|
@@ -46281,6 +46656,7 @@ var buildBubbleChartRepresentation = function buildBubbleChartRepresentation(_re
|
|
|
46281
46656
|
yAxisPostfix = _ref.yAxisPostfix,
|
|
46282
46657
|
yAxisPrefix = _ref.yAxisPrefix,
|
|
46283
46658
|
approxYAxisLabelCount = _ref.approxYAxisLabelCount,
|
|
46659
|
+
seriesLabelFormatter = _ref.seriesLabelFormatter,
|
|
46284
46660
|
_valueAlias = _ref.valueAlias,
|
|
46285
46661
|
zFieldId = _ref.zFieldId;
|
|
46286
46662
|
var allPrefixes = {};
|
|
@@ -46363,6 +46739,7 @@ var buildBubbleChartRepresentation = function buildBubbleChartRepresentation(_re
|
|
|
46363
46739
|
var xKeyField = result.fields.find(function (field) {
|
|
46364
46740
|
return field.id === xKeyTemp;
|
|
46365
46741
|
});
|
|
46742
|
+
var orderFunction = order.length > 0 ? order[0]["function"] : undefined;
|
|
46366
46743
|
|
|
46367
46744
|
// ----- Formatting -----
|
|
46368
46745
|
|
|
@@ -46379,7 +46756,7 @@ var buildBubbleChartRepresentation = function buildBubbleChartRepresentation(_re
|
|
|
46379
46756
|
var formattingFunctionY = function formattingFunctionY(value) {
|
|
46380
46757
|
// Use any y axis field as they are all formatted in the same way (for now...);
|
|
46381
46758
|
var nonPivotField = formattedResult.fields.find(function (resultField) {
|
|
46382
|
-
return pivotConfig.y.includes(resultField.id);
|
|
46759
|
+
return ![].concat(pivotConfig.x, pivotConfig.y).includes(resultField.id);
|
|
46383
46760
|
});
|
|
46384
46761
|
if (!nonPivotField) return '';
|
|
46385
46762
|
return formattedResult.formatterFunc(value, {
|
|
@@ -46391,23 +46768,33 @@ var buildBubbleChartRepresentation = function buildBubbleChartRepresentation(_re
|
|
|
46391
46768
|
|
|
46392
46769
|
// ----- Keys & Prep -----
|
|
46393
46770
|
var xScaleDataType = (xKeyField == null ? void 0 : xKeyField.outputDataType) || 'string';
|
|
46394
|
-
var _formattedResultToSer = formattedResultToSeries(formattedResult, pivotConfig, zFieldId),
|
|
46771
|
+
var _formattedResultToSer = formattedResultToSeries(formattedResult, pivotConfig, seriesLabelFormatter, zFieldId),
|
|
46395
46772
|
keys = _formattedResultToSer.keys,
|
|
46396
46773
|
yKeys = _formattedResultToSer.yKeys,
|
|
46397
46774
|
xKeys = _formattedResultToSer.xKeys,
|
|
46398
46775
|
zKey = _formattedResultToSer.zKey,
|
|
46399
46776
|
chartData = _formattedResultToSer.seriesData;
|
|
46400
|
-
var sortedChartData = chartData.sort(function (a, b) {
|
|
46401
|
-
var _order$, _a$pivotConfig$x$, _b$pivotConfig$x$;
|
|
46402
|
-
var isDescending = ((_order$ = order[0]) == null ? void 0 : _order$.direction) === 'desc';
|
|
46403
|
-
var xValueA = (_a$pivotConfig$x$ = a[pivotConfig.x[0]]) == null ? void 0 : _a$pivotConfig$x$.value;
|
|
46404
|
-
var xValueB = (_b$pivotConfig$x$ = b[pivotConfig.x[0]]) == null ? void 0 : _b$pivotConfig$x$.value;
|
|
46405
|
-
if (xValueA < xValueB) return isDescending ? 1 : -1;
|
|
46406
|
-
if (xValueA > xValueB) return isDescending ? -1 : 1;
|
|
46407
|
-
return 0;
|
|
46408
|
-
});
|
|
46409
46777
|
var xKey = (_xKeys$ = xKeys[0]) != null ? _xKeys$ : null;
|
|
46410
46778
|
|
|
46779
|
+
// ----- Trends & Forecasts -----
|
|
46780
|
+
|
|
46781
|
+
var trendsAndForecastData = getTrendsAndForecastsData({
|
|
46782
|
+
chartData: chartData,
|
|
46783
|
+
formattingFunctionX: formattingFunctionX,
|
|
46784
|
+
formattingFunctionY: formattingFunctionY,
|
|
46785
|
+
keys: keys,
|
|
46786
|
+
nullValue: nullValue,
|
|
46787
|
+
trendsAndForecasts: trendsAndForecasts,
|
|
46788
|
+
xAxisPostfix: xAxisPostfix,
|
|
46789
|
+
xKey: xKey,
|
|
46790
|
+
yKeys: yKeys,
|
|
46791
|
+
xAxisPrefix: xAxisPrefix,
|
|
46792
|
+
xScaleDataType: xScaleDataType,
|
|
46793
|
+
yAxisPostfix: yAxisPostfix,
|
|
46794
|
+
yAxisPrefix: yAxisPrefix,
|
|
46795
|
+
orderFunction: orderFunction
|
|
46796
|
+
});
|
|
46797
|
+
|
|
46411
46798
|
// ----- Goal Lines -----
|
|
46412
46799
|
|
|
46413
46800
|
var goalLines = getGoalLines({
|
|
@@ -46418,11 +46805,11 @@ var buildBubbleChartRepresentation = function buildBubbleChartRepresentation(_re
|
|
|
46418
46805
|
// ----- Ticks -----
|
|
46419
46806
|
|
|
46420
46807
|
var ticks = getScaleAndTicks({
|
|
46421
|
-
data:
|
|
46808
|
+
data: chartData,
|
|
46422
46809
|
xKey: xKey,
|
|
46423
46810
|
xScaleDataType: xScaleDataType,
|
|
46424
46811
|
yKeys: yKeys,
|
|
46425
|
-
|
|
46812
|
+
tickCountYAxis: approxYAxisLabelCount,
|
|
46426
46813
|
formattingFunctionX: formattingFunctionX,
|
|
46427
46814
|
formattingFunctionY: formattingFunctionY,
|
|
46428
46815
|
nullValue: nullValue,
|
|
@@ -46432,36 +46819,9 @@ var buildBubbleChartRepresentation = function buildBubbleChartRepresentation(_re
|
|
|
46432
46819
|
|
|
46433
46820
|
// ----- Lines -----
|
|
46434
46821
|
|
|
46435
|
-
var groupByKey = (_formattedResult$fiel = (_formattedResult$fiel2 = formattedResult.fields.find(function (field) {
|
|
46436
|
-
return field["function"] === 'none';
|
|
46437
|
-
})) == null ? void 0 : _formattedResult$fiel2.id) != null ? _formattedResult$fiel : '';
|
|
46438
46822
|
var styleDefinition = getStyleDefinition({
|
|
46439
|
-
colors: colors,
|
|
46440
|
-
yKeys:
|
|
46441
|
-
});
|
|
46442
|
-
|
|
46443
|
-
// ----- Legend -----
|
|
46444
|
-
var colorScale = themeToColorScale(colors, sortedChartData.length);
|
|
46445
|
-
var legendItems = sortedChartData.map(function (d, index) {
|
|
46446
|
-
var _d$groupByKey, _colorScale;
|
|
46447
|
-
return {
|
|
46448
|
-
yKey: (_d$groupByKey = d[groupByKey]) == null ? void 0 : _d$groupByKey.value,
|
|
46449
|
-
color: (_colorScale = colorScale[index % colorScale.length]) != null ? _colorScale : '',
|
|
46450
|
-
style: {
|
|
46451
|
-
strokeWidth: 3,
|
|
46452
|
-
strokeDasharray: null,
|
|
46453
|
-
type: 'line'
|
|
46454
|
-
}
|
|
46455
|
-
};
|
|
46456
|
-
});
|
|
46457
|
-
var legendKeys = {};
|
|
46458
|
-
sortedChartData.forEach(function (row) {
|
|
46459
|
-
var _row$groupByKey, _row$groupByKey$value, _row$groupByKey2, _row$groupByKey$forma, _row$groupByKey3;
|
|
46460
|
-
legendKeys[(_row$groupByKey = row[groupByKey]) == null ? void 0 : _row$groupByKey.value] = {
|
|
46461
|
-
key: (_row$groupByKey$value = (_row$groupByKey2 = row[groupByKey]) == null ? void 0 : _row$groupByKey2.value) != null ? _row$groupByKey$value : '',
|
|
46462
|
-
dataType: 'string',
|
|
46463
|
-
keyFormatted: (_row$groupByKey$forma = (_row$groupByKey3 = row[groupByKey]) == null ? void 0 : _row$groupByKey3.formattedValue) != null ? _row$groupByKey$forma : ''
|
|
46464
|
-
};
|
|
46823
|
+
colors: colors != null ? colors : ['#feae4a', '#5fbaff', '#e15e9d'],
|
|
46824
|
+
yKeys: yKeys
|
|
46465
46825
|
});
|
|
46466
46826
|
|
|
46467
46827
|
// ----- Conditional Formatting -----
|
|
@@ -46500,24 +46860,21 @@ var buildBubbleChartRepresentation = function buildBubbleChartRepresentation(_re
|
|
|
46500
46860
|
title: (_axisTitles$y = axisTitles == null ? void 0 : axisTitles.y) != null ? _axisTitles$y : null
|
|
46501
46861
|
},
|
|
46502
46862
|
z: zKey,
|
|
46503
|
-
data:
|
|
46863
|
+
data: chartData,
|
|
46504
46864
|
lines: styleDefinition,
|
|
46505
46865
|
conditionalFormattingRules: conditionalFormattingRules,
|
|
46506
|
-
goalLines: goalLines
|
|
46507
|
-
groupByKey: groupByKey,
|
|
46508
|
-
legend: {
|
|
46509
|
-
keys: legendKeys,
|
|
46510
|
-
items: legendItems
|
|
46511
|
-
}
|
|
46866
|
+
goalLines: goalLines
|
|
46512
46867
|
};
|
|
46513
46868
|
return chart;
|
|
46514
46869
|
};
|
|
46515
46870
|
|
|
46516
46871
|
var BubbleChartV2View = function BubbleChartV2View(props) {
|
|
46517
|
-
var _props$library, _props$attributes$vie
|
|
46872
|
+
var _props$library, _props$attributes$vie;
|
|
46518
46873
|
var _useDashboardBehaviou = useDashboardBehaviourContext(),
|
|
46519
46874
|
textOverride = _useDashboardBehaviou.textOverride,
|
|
46520
|
-
valueAlias = _useDashboardBehaviou.valueAlias
|
|
46875
|
+
valueAlias = _useDashboardBehaviou.valueAlias,
|
|
46876
|
+
labelFormat = _useDashboardBehaviou.labelFormat,
|
|
46877
|
+
queryEngineConfig = _useDashboardBehaviou.queryEngineConfig;
|
|
46521
46878
|
var headerProps = {
|
|
46522
46879
|
displayTitle: props.attributes.displayTitle,
|
|
46523
46880
|
displaySubject: props.attributes.displaySubject,
|
|
@@ -46538,12 +46895,12 @@ var BubbleChartV2View = function BubbleChartV2View(props) {
|
|
|
46538
46895
|
var showHeadline = headlineAvailable(props.attributes.order, props.attributes.headline, null);
|
|
46539
46896
|
var theme = useTheme();
|
|
46540
46897
|
var BubbleChartV2Component = getComponentInterface(props.attributes.type);
|
|
46541
|
-
var pivotConfig = init$
|
|
46898
|
+
var pivotConfig = init$c(props.attributes);
|
|
46542
46899
|
var chartRepresentation = null;
|
|
46543
46900
|
if (!isLoading(props.result) && !hasFailed(props.result) && !isEmpty(props.result) && BubbleChartV2Component.isRunnable(props.attributes)) {
|
|
46544
46901
|
var _theme$charts$colors, _theme$charts, _props$attributes$goa;
|
|
46545
46902
|
chartRepresentation = buildBubbleChartRepresentation({
|
|
46546
|
-
zFieldId:
|
|
46903
|
+
zFieldId: props.attributes.zMeasure[0].field,
|
|
46547
46904
|
axisTitles: props.attributes.axisTitles,
|
|
46548
46905
|
xAxisPostfix: props.attributes.xAxisPostfix,
|
|
46549
46906
|
xAxisPrefix: props.attributes.xAxisPrefix,
|
|
@@ -46551,7 +46908,7 @@ var BubbleChartV2View = function BubbleChartV2View(props) {
|
|
|
46551
46908
|
yAxisPrefix: props.attributes.yAxisPrefix,
|
|
46552
46909
|
yAxisFormat: props.attributes.yAxisFormat,
|
|
46553
46910
|
xAxisFormat: props.attributes.xAxisFormat,
|
|
46554
|
-
approxYAxisLabelCount: props.attributes.approxYAxisLabelCount,
|
|
46911
|
+
approxYAxisLabelCount: props.attributes.approxYAxisLabelCount === 'auto' ? 10 : props.attributes.approxYAxisLabelCount,
|
|
46555
46912
|
colors: (_theme$charts$colors = theme == null || (_theme$charts = theme.charts) == null ? void 0 : _theme$charts.colors) != null ? _theme$charts$colors : DEFAULT_CHART_COLORS,
|
|
46556
46913
|
valueAlias: valueAlias,
|
|
46557
46914
|
nullValue: checkForNullValue(props.attributes.dataSetId, props.attributes.dimension, props.attributes.timeDimension, textOverride, valueAlias),
|
|
@@ -46562,7 +46919,27 @@ var BubbleChartV2View = function BubbleChartV2View(props) {
|
|
|
46562
46919
|
dateTimeFormatOptions: props.dateTimeFormatOptions,
|
|
46563
46920
|
goalLineAttributes: (_props$attributes$goa = props.attributes.goalLines) != null ? _props$attributes$goa : [],
|
|
46564
46921
|
conditionalFormattingAttributes: props.attributes.conditionalFormattingRules,
|
|
46565
|
-
|
|
46922
|
+
trendsAndForecasts: props.attributes.trends,
|
|
46923
|
+
defaultFormats: props.defaultFormats,
|
|
46924
|
+
seriesLabelFormatter: function seriesLabelFormatter(labelFormatParams) {
|
|
46925
|
+
var _queryEngineConfig$su, _queryEngineConfig$su2, _queryEngineConfig$su3;
|
|
46926
|
+
var yResultField = labelFormatParams.yResultField,
|
|
46927
|
+
yPivotFields = labelFormatParams.yPivotFields,
|
|
46928
|
+
row = labelFormatParams.row;
|
|
46929
|
+
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);
|
|
46930
|
+
var formattedFunction = yResultField["function"] === 'none' ? '' : " \u2022 " + formattedFunctionName;
|
|
46931
|
+
var defaultLabelFormat = "" + yPivotFields.map(function (field) {
|
|
46932
|
+
return row[field.id].formattedValue;
|
|
46933
|
+
}).join(' • ') + (yPivotFields.length === 0 ? '' : ' • ') + yResultField.publicName + formattedFunction;
|
|
46934
|
+
if (!labelFormat) return defaultLabelFormat;
|
|
46935
|
+
return labelFormat({
|
|
46936
|
+
viewId: props.attributes.viewId,
|
|
46937
|
+
fieldId: yResultField.fieldId,
|
|
46938
|
+
func: yResultField["function"],
|
|
46939
|
+
type: 'bubbleChartV2',
|
|
46940
|
+
defaultLabel: defaultLabelFormat
|
|
46941
|
+
}) || defaultLabelFormat;
|
|
46942
|
+
}
|
|
46566
46943
|
});
|
|
46567
46944
|
}
|
|
46568
46945
|
|
|
@@ -46572,16 +46949,6 @@ var BubbleChartV2View = function BubbleChartV2View(props) {
|
|
|
46572
46949
|
title: "Missing parameters"
|
|
46573
46950
|
});
|
|
46574
46951
|
}
|
|
46575
|
-
if (((_props$result = props.result) == null ? void 0 : _props$result.fields.filter(function (r) {
|
|
46576
|
-
return pivotConfig.x.includes(r.id);
|
|
46577
|
-
}).length) === 0) return jsx(LoadingComponent, {});
|
|
46578
|
-
if (((_props$result2 = props.result) == null ? void 0 : _props$result2.fields.filter(function (r) {
|
|
46579
|
-
return pivotConfig.y.includes(r.id);
|
|
46580
|
-
}).length) === 0) return jsx(LoadingComponent, {});
|
|
46581
|
-
if (((_props$result3 = props.result) == null ? void 0 : _props$result3.fields.filter(function (r) {
|
|
46582
|
-
var _Field$id;
|
|
46583
|
-
return (_Field$id = id(props.attributes.zMeasure[0])) == null ? void 0 : _Field$id.includes(r.id);
|
|
46584
|
-
}).length) === 0) return jsx(LoadingComponent, {});
|
|
46585
46952
|
if (isLoading(props.result)) return jsx(LoadingComponent, {});
|
|
46586
46953
|
if (hasFailed(props.result)) return jsx(FailedToLoadDataNotice, {});
|
|
46587
46954
|
if (isEmpty(props.result)) return jsx(NoResultContentToShowNotice, _extends({}, headerProps));
|
|
@@ -46631,15 +46998,15 @@ var BubbleChartV2View = function BubbleChartV2View(props) {
|
|
|
46631
46998
|
|
|
46632
46999
|
var BubbleChartV2$1 = function BubbleChartV2(props) {
|
|
46633
47000
|
var _props$component = props.component,
|
|
47001
|
+
results = _props$component.results,
|
|
46634
47002
|
attributes = _props$component.attributes,
|
|
46635
47003
|
localFilters = _props$component.localFilters;
|
|
46636
47004
|
var dashboardBehaviour = props.dashboardBehaviour;
|
|
46637
47005
|
var _useComponentEffect = useComponentEffect(attributes, props.dataSet, dashboardBehaviour.queryEngineConfig, {
|
|
46638
47006
|
localFilters: localFilters,
|
|
46639
47007
|
globalFilters: props.globalFilters
|
|
46640
|
-
}, props.updateComponentAttributes, props.runQueriesCallback, dashboardBehaviour.variables),
|
|
46641
|
-
queriesAreChanging = _useComponentEffect.queriesAreChanging
|
|
46642
|
-
results = _useComponentEffect.results;
|
|
47008
|
+
}, props.updateComponentAttributes, props.runQueriesCallback, props.setResults, dashboardBehaviour.variables),
|
|
47009
|
+
queriesAreChanging = _useComponentEffect.queriesAreChanging;
|
|
46643
47010
|
return jsx(BubbleChartV2View, {
|
|
46644
47011
|
id: props.id,
|
|
46645
47012
|
attributes: attributes,
|
|
@@ -46793,76 +47160,7 @@ function getStyleDefinition$1(_ref) {
|
|
|
46793
47160
|
});
|
|
46794
47161
|
}
|
|
46795
47162
|
|
|
46796
|
-
var
|
|
46797
|
-
var _formattedResult$fiel, _formattedResult$fiel2;
|
|
46798
|
-
var keys = {};
|
|
46799
|
-
|
|
46800
|
-
// Collect the result fields which are going to be used on the Y axis.
|
|
46801
|
-
var yResultFields = formattedResult.fields.filter(function (resultField) {
|
|
46802
|
-
var isNotXPivot = !pivotConfig.x.includes(resultField.id);
|
|
46803
|
-
var isNotYPivot = !pivotConfig.y.includes(resultField.id);
|
|
46804
|
-
return isNotXPivot && isNotYPivot;
|
|
46805
|
-
});
|
|
46806
|
-
var xPivotFields = formattedResult.fields.filter(function (resultField) {
|
|
46807
|
-
return pivotConfig.x.includes(resultField.id);
|
|
46808
|
-
});
|
|
46809
|
-
var yPivotFields = formattedResult.fields.filter(function (resultField) {
|
|
46810
|
-
return pivotConfig.y.includes(resultField.id);
|
|
46811
|
-
});
|
|
46812
|
-
var pivotedData = {};
|
|
46813
|
-
var xKeyOrdering = [];
|
|
46814
|
-
var yKeys = {};
|
|
46815
|
-
formattedResult.contentMapped.forEach(function (row) {
|
|
46816
|
-
xPivotFields.forEach(function (xPivotField) {
|
|
46817
|
-
var _extends2;
|
|
46818
|
-
var uniqueXValue = xPivotField.id + ":" + row[xPivotField.id].value;
|
|
46819
|
-
xKeyOrdering.push(uniqueXValue);
|
|
46820
|
-
|
|
46821
|
-
// Add any existing values, and the x key itself
|
|
46822
|
-
|
|
46823
|
-
var yPivotPrefix = yPivotFields.map(function (yPivotField) {
|
|
46824
|
-
return yPivotField.id + ":" + row[yPivotField.id].value;
|
|
46825
|
-
}).join('_');
|
|
46826
|
-
pivotedData[uniqueXValue] = _extends({}, pivotedData[uniqueXValue] || {}, (_extends2 = {}, _extends2[xPivotField.id] = row[xPivotField.id], _extends2));
|
|
46827
|
-
yResultFields.forEach(function (yResultField) {
|
|
46828
|
-
var _extends3;
|
|
46829
|
-
var key = yPivotFields.length > 0 ? [yPivotPrefix, yResultField.id].join('_') : yResultField.id;
|
|
46830
|
-
yKeys[key] = true;
|
|
46831
|
-
keys[key] = {
|
|
46832
|
-
key: key,
|
|
46833
|
-
dataType: yResultField.dataType,
|
|
46834
|
-
outputDataType: yResultField.outputDataType,
|
|
46835
|
-
keyFormatted: seriesLabelFormatter({
|
|
46836
|
-
yResultField: yResultField,
|
|
46837
|
-
yPivotFields: yPivotFields,
|
|
46838
|
-
row: row
|
|
46839
|
-
})
|
|
46840
|
-
};
|
|
46841
|
-
pivotedData[uniqueXValue] = _extends({}, pivotedData[uniqueXValue] || {}, (_extends3 = {}, _extends3[key] = row[yResultField.id], _extends3));
|
|
46842
|
-
});
|
|
46843
|
-
});
|
|
46844
|
-
});
|
|
46845
|
-
var seriesDataFlattened = uniq(xKeyOrdering).map(function (xKey) {
|
|
46846
|
-
return pivotedData[xKey];
|
|
46847
|
-
});
|
|
46848
|
-
var mappedXKeys = xPivotFields.map(function (r) {
|
|
46849
|
-
return r.id;
|
|
46850
|
-
});
|
|
46851
|
-
var mappedYKeys = Object.keys(yKeys);
|
|
46852
|
-
var mappedZKey = (_formattedResult$fiel = (_formattedResult$fiel2 = formattedResult.fields.find(function (resultField) {
|
|
46853
|
-
return resultField.fieldId === zFieldId;
|
|
46854
|
-
})) == null ? void 0 : _formattedResult$fiel2.id) != null ? _formattedResult$fiel : '';
|
|
46855
|
-
var formattedResultReturn = {
|
|
46856
|
-
xKeys: mappedXKeys,
|
|
46857
|
-
yKeys: mappedYKeys,
|
|
46858
|
-
zKey: mappedZKey,
|
|
46859
|
-
keys: keys,
|
|
46860
|
-
seriesData: seriesDataFlattened
|
|
46861
|
-
};
|
|
46862
|
-
return formattedResultReturn;
|
|
46863
|
-
};
|
|
46864
|
-
|
|
46865
|
-
var buildTrendAndForecast = function buildTrendAndForecast(_ref) {
|
|
47163
|
+
var buildTrendAndForecast$1 = function buildTrendAndForecast(_ref) {
|
|
46866
47164
|
var data = _ref.data,
|
|
46867
47165
|
forecastUnits = _ref.forecastUnits,
|
|
46868
47166
|
xKey = _ref.xKey,
|
|
@@ -46955,7 +47253,7 @@ var buildTrendAndForecast = function buildTrendAndForecast(_ref) {
|
|
|
46955
47253
|
};
|
|
46956
47254
|
};
|
|
46957
47255
|
|
|
46958
|
-
var getTrendsAndForecastsData = function getTrendsAndForecastsData(_ref) {
|
|
47256
|
+
var getTrendsAndForecastsData$1 = function getTrendsAndForecastsData(_ref) {
|
|
46959
47257
|
var _trendsAndForecasts$;
|
|
46960
47258
|
var chartData = _ref.chartData,
|
|
46961
47259
|
formattingFunctionX = _ref.formattingFunctionX,
|
|
@@ -46984,7 +47282,7 @@ var getTrendsAndForecastsData = function getTrendsAndForecastsData(_ref) {
|
|
|
46984
47282
|
var forecastUnits = trendsAndForecasts[0].type === 'Forecast' ? (_trendsAndForecasts$ = trendsAndForecasts[0].value) != null ? _trendsAndForecasts$ : 0 : 0;
|
|
46985
47283
|
var yKey = yKeys[0];
|
|
46986
47284
|
var newKeys = cloneDeep(keys);
|
|
46987
|
-
var _buildTrendAndForecas = buildTrendAndForecast({
|
|
47285
|
+
var _buildTrendAndForecas = buildTrendAndForecast$1({
|
|
46988
47286
|
data: chartData,
|
|
46989
47287
|
forecastUnits: forecastUnits,
|
|
46990
47288
|
xKey: xKey,
|
|
@@ -47423,7 +47721,7 @@ var buildLineChartRepresentation = function buildLineChartRepresentation(_ref) {
|
|
|
47423
47721
|
|
|
47424
47722
|
// ----- Keys & Prep -----
|
|
47425
47723
|
var xScaleDataType = (xKeyField == null ? void 0 : xKeyField.outputDataType) || 'string';
|
|
47426
|
-
var _formattedResultToSer = formattedResultToSeries
|
|
47724
|
+
var _formattedResultToSer = formattedResultToSeries(formattedResult, pivotConfig, seriesLabelFormatter),
|
|
47427
47725
|
keys = _formattedResultToSer.keys,
|
|
47428
47726
|
yKeys = _formattedResultToSer.yKeys,
|
|
47429
47727
|
xKeys = _formattedResultToSer.xKeys,
|
|
@@ -47433,7 +47731,7 @@ var buildLineChartRepresentation = function buildLineChartRepresentation(_ref) {
|
|
|
47433
47731
|
// ----- Trends & Forecasts -----
|
|
47434
47732
|
|
|
47435
47733
|
var orderFunction = order.length > 0 ? order[0]["function"] : undefined;
|
|
47436
|
-
var trendsAndForecastData = getTrendsAndForecastsData({
|
|
47734
|
+
var trendsAndForecastData = getTrendsAndForecastsData$1({
|
|
47437
47735
|
chartData: chartData,
|
|
47438
47736
|
formattingFunctionX: function formattingFunctionX$1(value) {
|
|
47439
47737
|
return formattingFunctionX(value, formattedResult, xKeyField);
|
|
@@ -47665,15 +47963,15 @@ var LineChartV2View = function LineChartV2View(props) {
|
|
|
47665
47963
|
|
|
47666
47964
|
var LineChartV2 = function LineChartV2(props) {
|
|
47667
47965
|
var _props$component = props.component,
|
|
47966
|
+
results = _props$component.results,
|
|
47668
47967
|
attributes = _props$component.attributes,
|
|
47669
47968
|
localFilters = _props$component.localFilters;
|
|
47670
47969
|
var dashboardBehaviour = props.dashboardBehaviour;
|
|
47671
47970
|
var _useComponentEffect = useComponentEffect(attributes, props.dataSet, dashboardBehaviour.queryEngineConfig, {
|
|
47672
47971
|
localFilters: localFilters,
|
|
47673
47972
|
globalFilters: props.globalFilters
|
|
47674
|
-
}, props.updateComponentAttributes, props.runQueriesCallback, dashboardBehaviour.variables),
|
|
47675
|
-
queriesAreChanging = _useComponentEffect.queriesAreChanging
|
|
47676
|
-
results = _useComponentEffect.results;
|
|
47973
|
+
}, props.updateComponentAttributes, props.runQueriesCallback, props.setResults, dashboardBehaviour.variables),
|
|
47974
|
+
queriesAreChanging = _useComponentEffect.queriesAreChanging;
|
|
47677
47975
|
return jsx(LineChartV2View, {
|
|
47678
47976
|
id: props.id,
|
|
47679
47977
|
attributes: attributes,
|
|
@@ -47802,7 +48100,7 @@ var buildAreaChartRepresentation = function buildAreaChartRepresentation(_ref) {
|
|
|
47802
48100
|
|
|
47803
48101
|
// ----- Keys & Prep -----
|
|
47804
48102
|
var xScaleDataType = (xKeyField == null ? void 0 : xKeyField.outputDataType) || 'string';
|
|
47805
|
-
var _formattedResultToSer = formattedResultToSeries
|
|
48103
|
+
var _formattedResultToSer = formattedResultToSeries(formattedResult, pivotConfig, seriesLabelFormatter),
|
|
47806
48104
|
keys = _formattedResultToSer.keys,
|
|
47807
48105
|
yKeys = _formattedResultToSer.yKeys,
|
|
47808
48106
|
xKeys = _formattedResultToSer.xKeys,
|
|
@@ -48037,15 +48335,15 @@ var AreaChartV2View = function AreaChartV2View(props) {
|
|
|
48037
48335
|
|
|
48038
48336
|
var AreaChartV2 = function AreaChartV2(props) {
|
|
48039
48337
|
var _props$component = props.component,
|
|
48338
|
+
results = _props$component.results,
|
|
48040
48339
|
attributes = _props$component.attributes,
|
|
48041
48340
|
localFilters = _props$component.localFilters;
|
|
48042
48341
|
var dashboardBehaviour = props.dashboardBehaviour;
|
|
48043
48342
|
var _useComponentEffect = useComponentEffect(attributes, props.dataSet, dashboardBehaviour.queryEngineConfig, {
|
|
48044
48343
|
localFilters: localFilters,
|
|
48045
48344
|
globalFilters: props.globalFilters
|
|
48046
|
-
}, props.updateComponentAttributes, props.runQueriesCallback, dashboardBehaviour.variables),
|
|
48047
|
-
queriesAreChanging = _useComponentEffect.queriesAreChanging
|
|
48048
|
-
results = _useComponentEffect.results;
|
|
48345
|
+
}, props.updateComponentAttributes, props.runQueriesCallback, props.setResults, dashboardBehaviour.variables),
|
|
48346
|
+
queriesAreChanging = _useComponentEffect.queriesAreChanging;
|
|
48049
48347
|
return jsx(AreaChartV2View, {
|
|
48050
48348
|
id: props.id,
|
|
48051
48349
|
attributes: attributes,
|
|
@@ -48154,7 +48452,7 @@ var buildBarChartRepresentation = function buildBarChartRepresentation(_ref) {
|
|
|
48154
48452
|
|
|
48155
48453
|
// ----- Keys & Prep -----
|
|
48156
48454
|
var xScaleDataType = (xKeyField == null ? void 0 : xKeyField.outputDataType) || 'string';
|
|
48157
|
-
var _formattedResultToSer = formattedResultToSeries
|
|
48455
|
+
var _formattedResultToSer = formattedResultToSeries(formattedResult, pivotConfig, seriesLabelFormatter),
|
|
48158
48456
|
keys = _formattedResultToSer.keys,
|
|
48159
48457
|
yKeys = _formattedResultToSer.yKeys,
|
|
48160
48458
|
xKeys = _formattedResultToSer.xKeys,
|
|
@@ -48430,7 +48728,9 @@ var BarChartV2View = function BarChartV2View(props) {
|
|
|
48430
48728
|
};
|
|
48431
48729
|
|
|
48432
48730
|
var BarChartV2 = function BarChartV2(props) {
|
|
48433
|
-
var
|
|
48731
|
+
var _props$component = props.component,
|
|
48732
|
+
results = _props$component.results,
|
|
48733
|
+
localFilters = _props$component.localFilters;
|
|
48434
48734
|
var dashboardBehaviour = props.dashboardBehaviour;
|
|
48435
48735
|
var _useState = useState(props.component.attributes),
|
|
48436
48736
|
attributes = _useState[0],
|
|
@@ -48441,18 +48741,17 @@ var BarChartV2 = function BarChartV2(props) {
|
|
|
48441
48741
|
setDrilldownSelections([]);
|
|
48442
48742
|
}
|
|
48443
48743
|
}, [JSON.stringify(props.component.attributes)]);
|
|
48444
|
-
var _useComponentEffect = useComponentEffect(attributes, props.dataSet, dashboardBehaviour.queryEngineConfig, {
|
|
48445
|
-
localFilters: localFilters,
|
|
48446
|
-
globalFilters: props.globalFilters
|
|
48447
|
-
}, props.updateComponentAttributes, props.runQueriesCallback, dashboardBehaviour.variables),
|
|
48448
|
-
queriesAreChanging = _useComponentEffect.queriesAreChanging,
|
|
48449
|
-
results = _useComponentEffect.results;
|
|
48450
48744
|
var _useDrilldownSelectio = useDrilldownSelection(results, attributes, function (newAttributes) {
|
|
48451
48745
|
return setAttributes(newAttributes);
|
|
48452
48746
|
}, props.dataSet, dashboardBehaviour.queryEngineConfig, props.component.attributes.type === 'barChartV2'),
|
|
48453
48747
|
onDrilldownChange = _useDrilldownSelectio.onDrilldownChange,
|
|
48454
48748
|
setDrilldownSelections = _useDrilldownSelectio.setDrilldownSelections,
|
|
48455
48749
|
drilldownSelections = _useDrilldownSelectio.drilldownSelections;
|
|
48750
|
+
var _useComponentEffect = useComponentEffect(attributes, props.dataSet, dashboardBehaviour.queryEngineConfig, {
|
|
48751
|
+
localFilters: localFilters,
|
|
48752
|
+
globalFilters: props.globalFilters
|
|
48753
|
+
}, props.updateComponentAttributes, props.runQueriesCallback, props.setResults, dashboardBehaviour.variables),
|
|
48754
|
+
queriesAreChanging = _useComponentEffect.queriesAreChanging;
|
|
48456
48755
|
return jsx(BarChartV2View, {
|
|
48457
48756
|
id: props.id,
|
|
48458
48757
|
attributes: attributes,
|
|
@@ -48614,16 +48913,16 @@ var LINE_QUERY_INDEX = 0,
|
|
|
48614
48913
|
BAR_QUERY_INDEX = 1;
|
|
48615
48914
|
var ComboChart$3 = function ComboChart(props) {
|
|
48616
48915
|
var _props$component = props.component,
|
|
48916
|
+
results = _props$component.results,
|
|
48617
48917
|
attributes = _props$component.attributes,
|
|
48618
48918
|
localFilters = _props$component.localFilters;
|
|
48619
48919
|
var _useDashboardContext = useDashboardContext(),
|
|
48620
48920
|
dashboard = _useDashboardContext.dashboard;
|
|
48621
|
-
var _useQueryEffect = useQueryEffect(attributes, props.runQueriesCallback, {
|
|
48921
|
+
var _useQueryEffect = useQueryEffect(attributes, props.runQueriesCallback, props.setResults, {
|
|
48622
48922
|
localFilters: localFilters,
|
|
48623
48923
|
globalFilters: props.globalFilters
|
|
48624
48924
|
}, props.dataSet, undefined, props.dashboardBehaviour.variables),
|
|
48625
|
-
queriesAreChanging = _useQueryEffect.queriesAreChanging
|
|
48626
|
-
results = _useQueryEffect.results;
|
|
48925
|
+
queriesAreChanging = _useQueryEffect.queriesAreChanging;
|
|
48627
48926
|
return jsx(ComboChartView$1, _extends({
|
|
48628
48927
|
id: props.id
|
|
48629
48928
|
}, attributes, {
|
|
@@ -49124,16 +49423,16 @@ var LINE_QUERY_INDEX$1 = 0,
|
|
|
49124
49423
|
BAR_QUERY_INDEX$1 = 1;
|
|
49125
49424
|
var ComboChartV2$1 = function ComboChartV2(props) {
|
|
49126
49425
|
var _props$component = props.component,
|
|
49426
|
+
results = _props$component.results,
|
|
49127
49427
|
attributes = _props$component.attributes,
|
|
49128
49428
|
localFilters = _props$component.localFilters;
|
|
49129
49429
|
var _useDashboardContext = useDashboardContext(),
|
|
49130
49430
|
dashboard = _useDashboardContext.dashboard;
|
|
49131
|
-
var _useQueryEffect = useQueryEffect(attributes, props.runQueriesCallback, {
|
|
49431
|
+
var _useQueryEffect = useQueryEffect(attributes, props.runQueriesCallback, props.setResults, {
|
|
49132
49432
|
localFilters: localFilters,
|
|
49133
49433
|
globalFilters: props.globalFilters
|
|
49134
49434
|
}, props.dataSet, undefined, props.dashboardBehaviour.variables),
|
|
49135
|
-
queriesAreChanging = _useQueryEffect.queriesAreChanging
|
|
49136
|
-
results = _useQueryEffect.results;
|
|
49435
|
+
queriesAreChanging = _useQueryEffect.queriesAreChanging;
|
|
49137
49436
|
return jsx(ComboChartView$2, _extends({
|
|
49138
49437
|
id: props.id
|
|
49139
49438
|
}, attributes, {
|
|
@@ -50925,6 +51224,9 @@ var DataTableRow = function DataTableRow(props) {
|
|
|
50925
51224
|
useEffect(function () {
|
|
50926
51225
|
return setSelectedRow(undefined);
|
|
50927
51226
|
}, [props.queriesAreChanging]);
|
|
51227
|
+
var _useState = useState(),
|
|
51228
|
+
results = _useState[0],
|
|
51229
|
+
_setResults = _useState[1];
|
|
50928
51230
|
var expanded = selectedRow !== undefined;
|
|
50929
51231
|
var hasDrilldown = drilldown && (drilldown == null ? void 0 : drilldown.length) > 0;
|
|
50930
51232
|
var _useDashboardBehaviou = useDashboardBehaviourContext(),
|
|
@@ -50950,7 +51252,13 @@ var DataTableRow = function DataTableRow(props) {
|
|
|
50950
51252
|
renderTableCell: handleRenderTableCell
|
|
50951
51253
|
}))
|
|
50952
51254
|
}), (props == null ? void 0 : props.drilldownInputProps) && expanded && hasDrilldown && jsx(DrilldownRow, {
|
|
51255
|
+
setResults: function setResults(value) {
|
|
51256
|
+
return _setResults({
|
|
51257
|
+
results: value
|
|
51258
|
+
});
|
|
51259
|
+
},
|
|
50953
51260
|
dataSet: dataSet,
|
|
51261
|
+
result: results == null ? void 0 : results.results[0],
|
|
50954
51262
|
drilldownInputProps: props == null ? void 0 : props.drilldownInputProps,
|
|
50955
51263
|
drilldown: drilldown,
|
|
50956
51264
|
selectedRow: selectedRow,
|
|
@@ -50963,10 +51271,10 @@ var DataTableRow = function DataTableRow(props) {
|
|
|
50963
51271
|
});
|
|
50964
51272
|
};
|
|
50965
51273
|
var DrilldownRow = function DrilldownRow(props) {
|
|
50966
|
-
var _tableRepresentation$;
|
|
50967
|
-
var
|
|
50968
|
-
offset =
|
|
50969
|
-
setOffset =
|
|
51274
|
+
var _props$result, _tableRepresentation$;
|
|
51275
|
+
var _useState2 = useState(0),
|
|
51276
|
+
offset = _useState2[0],
|
|
51277
|
+
setOffset = _useState2[1];
|
|
50970
51278
|
var _props$drilldownInput = props.drilldownInputProps,
|
|
50971
51279
|
component = _props$drilldownInput.component,
|
|
50972
51280
|
runQueriesCallback = _props$drilldownInput.runQueriesCallback;
|
|
@@ -50980,12 +51288,10 @@ var DrilldownRow = function DrilldownRow(props) {
|
|
|
50980
51288
|
variables = _useDashboardBehaviou2.variables,
|
|
50981
51289
|
valueAlias = _useDashboardBehaviou2.valueAlias;
|
|
50982
51290
|
var updatedAttributes = buildDrilldownAttributes(component.attributes, decodeId(props.drilldown[0].subsetDimension, queryEngineConfig), props.dimension, props.selectedRow, offset);
|
|
50983
|
-
|
|
50984
|
-
|
|
50985
|
-
|
|
50986
|
-
|
|
50987
|
-
_useQueryEffect$resul = _useQueryEffect.results,
|
|
50988
|
-
result = _useQueryEffect$resul[0];
|
|
51291
|
+
useQueryEffect(updatedAttributes, runQueriesCallback, props == null ? void 0 : props.setResults, {
|
|
51292
|
+
localFilters: component.localFilters,
|
|
51293
|
+
globalFilters: props.drilldownInputProps.globalFilters
|
|
51294
|
+
}, props.dataSet, undefined, variables);
|
|
50989
51295
|
var nullReplacementWithFieldId = function nullReplacementWithFieldId(fieldId) {
|
|
50990
51296
|
return checkForNullValue(props.dataSet.id, [{
|
|
50991
51297
|
field: fieldId,
|
|
@@ -50995,7 +51301,7 @@ var DrilldownRow = function DrilldownRow(props) {
|
|
|
50995
51301
|
var tableRepresentation = useMemo(function () {
|
|
50996
51302
|
return buildTableRepresentation({
|
|
50997
51303
|
type: updatedAttributes.type,
|
|
50998
|
-
result: result,
|
|
51304
|
+
result: props.result,
|
|
50999
51305
|
exportNames: updatedAttributes.exportNames,
|
|
51000
51306
|
prefixes: updatedAttributes.prefixes,
|
|
51001
51307
|
dateTimeFormat: updatedAttributes.dateTimeFormat,
|
|
@@ -51015,10 +51321,10 @@ var DrilldownRow = function DrilldownRow(props) {
|
|
|
51015
51321
|
hiddenFields: updatedAttributes.hiddenFields,
|
|
51016
51322
|
valueAlias: valueAlias
|
|
51017
51323
|
});
|
|
51018
|
-
}, [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]);
|
|
51324
|
+
}, [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]);
|
|
51019
51325
|
var TableFooter = useMemo(function () {
|
|
51020
51326
|
return jsx(Fragment$1, {
|
|
51021
|
-
children: result && jsx(Pagination, {
|
|
51327
|
+
children: props.result && jsx(Pagination, {
|
|
51022
51328
|
offset: offset,
|
|
51023
51329
|
limit: limit,
|
|
51024
51330
|
onNext: function onNext() {
|
|
@@ -51038,10 +51344,10 @@ var DrilldownRow = function DrilldownRow(props) {
|
|
|
51038
51344
|
textOverride: textOverride
|
|
51039
51345
|
})
|
|
51040
51346
|
});
|
|
51041
|
-
}, [offset, limit, result == null ? void 0 : result.content.length, setOffset, tableRepresentation == null ? void 0 : tableRepresentation.content.length]);
|
|
51347
|
+
}, [offset, limit, (_props$result = props.result) == null ? void 0 : _props$result.content.length, setOffset, tableRepresentation == null ? void 0 : tableRepresentation.content.length]);
|
|
51042
51348
|
var hidePaginations = offset === 0 && ((_tableRepresentation$ = tableRepresentation == null ? void 0 : tableRepresentation.content.length) != null ? _tableRepresentation$ : 0) < (limit != null ? limit : 0);
|
|
51043
51349
|
var columnsNumber = props == null ? void 0 : props.tableRowProps.row.length;
|
|
51044
|
-
if (isLoading(result)) return jsx(Table.TR, {
|
|
51350
|
+
if (isLoading(props.result)) return jsx(Table.TR, {
|
|
51045
51351
|
level: 2,
|
|
51046
51352
|
children: jsx(Table.TH, {
|
|
51047
51353
|
colSpan: columnsNumber,
|
|
@@ -51050,7 +51356,7 @@ var DrilldownRow = function DrilldownRow(props) {
|
|
|
51050
51356
|
})
|
|
51051
51357
|
})
|
|
51052
51358
|
});
|
|
51053
|
-
if (hasFailed(result)) return jsx(FailedToLoadDataNotice, {});
|
|
51359
|
+
if (hasFailed(props.result)) return jsx(FailedToLoadDataNotice, {});
|
|
51054
51360
|
return jsxs(Fragment, {
|
|
51055
51361
|
children: [(tableRepresentation == null ? void 0 : tableRepresentation.content) && jsx(Fragment, {
|
|
51056
51362
|
children: (tableRepresentation == null ? void 0 : tableRepresentation.content.length) > 0 ? jsx(Fragment, {
|
|
@@ -51506,14 +51812,14 @@ var DataTableView$1 = (function (props) {
|
|
|
51506
51812
|
|
|
51507
51813
|
var DataTable$2 = function DataTable(props) {
|
|
51508
51814
|
var _props$component = props.component,
|
|
51815
|
+
results = _props$component.results,
|
|
51509
51816
|
attributes = _props$component.attributes,
|
|
51510
51817
|
localFilters = _props$component.localFilters;
|
|
51511
|
-
var _useQueryEffect = useQueryEffect(attributes, props.runQueriesCallback, {
|
|
51818
|
+
var _useQueryEffect = useQueryEffect(attributes, props.runQueriesCallback, props.setResults, {
|
|
51512
51819
|
localFilters: localFilters,
|
|
51513
51820
|
globalFilters: props.globalFilters
|
|
51514
51821
|
}, props.dataSet, undefined, props.dashboardBehaviour.variables),
|
|
51515
|
-
queriesAreChanging = _useQueryEffect.queriesAreChanging
|
|
51516
|
-
results = _useQueryEffect.results;
|
|
51822
|
+
queriesAreChanging = _useQueryEffect.queriesAreChanging;
|
|
51517
51823
|
var onNext = function onNext() {
|
|
51518
51824
|
var _attributes$limit, _attributes$offset, _results$0$content$le, _results$;
|
|
51519
51825
|
if (!hasNext({
|
|
@@ -51775,13 +52081,14 @@ var FunnelChart$2 = function FunnelChart(props) {
|
|
|
51775
52081
|
var _useState = useState(props.component.attributes),
|
|
51776
52082
|
attributes = _useState[0],
|
|
51777
52083
|
setAttributes = _useState[1];
|
|
51778
|
-
var
|
|
52084
|
+
var _props$component = props.component,
|
|
52085
|
+
localFilters = _props$component.localFilters,
|
|
52086
|
+
results = _props$component.results;
|
|
51779
52087
|
var _useComponentEffect = useComponentEffect(attributes, props.dataSet, props.dashboardBehaviour.queryEngineConfig, {
|
|
51780
52088
|
localFilters: localFilters,
|
|
51781
52089
|
globalFilters: props.globalFilters
|
|
51782
|
-
}, props.updateComponentAttributes, props.runQueriesCallback),
|
|
51783
|
-
queriesAreChanging = _useComponentEffect.queriesAreChanging
|
|
51784
|
-
results = _useComponentEffect.results;
|
|
52090
|
+
}, props.updateComponentAttributes, props.runQueriesCallback, props.setResults),
|
|
52091
|
+
queriesAreChanging = _useComponentEffect.queriesAreChanging;
|
|
51785
52092
|
useEffect(function () {
|
|
51786
52093
|
if (!queriesAreChanging) {
|
|
51787
52094
|
setAttributes(props.component.attributes);
|
|
@@ -51891,14 +52198,14 @@ var View$2 = (function (props) {
|
|
|
51891
52198
|
|
|
51892
52199
|
var MercatorMap$3 = function MercatorMap(props) {
|
|
51893
52200
|
var _props$component = props.component,
|
|
52201
|
+
results = _props$component.results,
|
|
51894
52202
|
attributes = _props$component.attributes,
|
|
51895
52203
|
localFilters = _props$component.localFilters;
|
|
51896
|
-
var _useQueryEffect = useQueryEffect(attributes, props.runQueriesCallback, {
|
|
52204
|
+
var _useQueryEffect = useQueryEffect(attributes, props.runQueriesCallback, props.setResults, {
|
|
51897
52205
|
localFilters: localFilters,
|
|
51898
52206
|
globalFilters: props.globalFilters
|
|
51899
52207
|
}, props.dataSet, undefined, props.dashboardBehaviour.variables),
|
|
51900
|
-
queriesAreChanging = _useQueryEffect.queriesAreChanging
|
|
51901
|
-
results = _useQueryEffect.results;
|
|
52208
|
+
queriesAreChanging = _useQueryEffect.queriesAreChanging;
|
|
51902
52209
|
return jsx(View$2, _extends({}, attributes, {
|
|
51903
52210
|
id: props.id,
|
|
51904
52211
|
result: results && results[0],
|
|
@@ -52157,14 +52464,14 @@ ProgressView$1.defaultProps = defaultProps$9;
|
|
|
52157
52464
|
var Progress$2 = function Progress(props) {
|
|
52158
52465
|
var _props$dashboardBehav;
|
|
52159
52466
|
var _props$component = props.component,
|
|
52467
|
+
results = _props$component.results,
|
|
52160
52468
|
attributes = _props$component.attributes,
|
|
52161
52469
|
localFilters = _props$component.localFilters;
|
|
52162
|
-
var _useQueryEffect = useQueryEffect(attributes, props.runQueriesCallback, {
|
|
52470
|
+
var _useQueryEffect = useQueryEffect(attributes, props.runQueriesCallback, props.setResults, {
|
|
52163
52471
|
localFilters: localFilters,
|
|
52164
52472
|
globalFilters: props.globalFilters
|
|
52165
52473
|
}, props.dataSet, undefined, props.dashboardBehaviour.variables),
|
|
52166
|
-
queriesAreChanging = _useQueryEffect.queriesAreChanging
|
|
52167
|
-
results = _useQueryEffect.results;
|
|
52474
|
+
queriesAreChanging = _useQueryEffect.queriesAreChanging;
|
|
52168
52475
|
return jsx(ProgressView$1, _extends({}, attributes, {
|
|
52169
52476
|
id: props.id,
|
|
52170
52477
|
dataSet: props.dataSet,
|
|
@@ -52371,7 +52678,7 @@ var buildRadarChartRepresentation = function buildRadarChartRepresentation(_ref)
|
|
|
52371
52678
|
}).formattedValue;
|
|
52372
52679
|
};
|
|
52373
52680
|
var xScaleDataType = (xKeyField == null ? void 0 : xKeyField.outputDataType) || 'string';
|
|
52374
|
-
var _formattedResultToSer = formattedResultToSeries
|
|
52681
|
+
var _formattedResultToSer = formattedResultToSeries(formattedResult, pivotConfig, seriesLabelFormatter),
|
|
52375
52682
|
keys = _formattedResultToSer.keys,
|
|
52376
52683
|
yKeys = _formattedResultToSer.yKeys,
|
|
52377
52684
|
xKeys = _formattedResultToSer.xKeys,
|
|
@@ -52653,17 +52960,18 @@ var RadarChart$3 = function RadarChart(_ref) {
|
|
|
52653
52960
|
runQueriesCallback = _ref.runQueriesCallback,
|
|
52654
52961
|
setLocalFilters = _ref.setLocalFilters,
|
|
52655
52962
|
_setPartialAttributes = _ref.setPartialAttributes,
|
|
52963
|
+
setResults = _ref.setResults,
|
|
52656
52964
|
updateComponentAttributes = _ref.updateComponentAttributes;
|
|
52657
|
-
var localFilters = component.localFilters
|
|
52965
|
+
var localFilters = component.localFilters,
|
|
52966
|
+
results = component.results;
|
|
52658
52967
|
var _useState = useState(component.attributes),
|
|
52659
52968
|
attributes = _useState[0],
|
|
52660
52969
|
setAttributes = _useState[1];
|
|
52661
52970
|
var _useComponentEffect = useComponentEffect(component.attributes, dataSet, dashboardBehaviour.queryEngineConfig, {
|
|
52662
52971
|
localFilters: localFilters,
|
|
52663
52972
|
globalFilters: globalFilters
|
|
52664
|
-
}, updateComponentAttributes, runQueriesCallback, dashboardBehaviour.variables),
|
|
52665
|
-
queriesAreChanging = _useComponentEffect.queriesAreChanging
|
|
52666
|
-
results = _useComponentEffect.results;
|
|
52973
|
+
}, updateComponentAttributes, runQueriesCallback, setResults, dashboardBehaviour.variables),
|
|
52974
|
+
queriesAreChanging = _useComponentEffect.queriesAreChanging;
|
|
52667
52975
|
useEffect(function () {
|
|
52668
52976
|
if (!queriesAreChanging) {
|
|
52669
52977
|
setAttributes(component.attributes);
|
|
@@ -52736,14 +53044,14 @@ var RichText$2 = function RichText(_props) {
|
|
|
52736
53044
|
var SingleStat$2 = function SingleStat(props) {
|
|
52737
53045
|
var _props$dashboardBehav;
|
|
52738
53046
|
var _props$component = props.component,
|
|
53047
|
+
results = _props$component.results,
|
|
52739
53048
|
attributes = _props$component.attributes,
|
|
52740
53049
|
localFilters = _props$component.localFilters;
|
|
52741
53050
|
var _useComponentEffect = useComponentEffect(attributes, props.dataSet, props.dashboardBehaviour.queryEngineConfig, {
|
|
52742
53051
|
localFilters: localFilters,
|
|
52743
53052
|
globalFilters: props.globalFilters
|
|
52744
|
-
}, props.updateComponentAttributes, props.runQueriesCallback, props.dashboardBehaviour.variables),
|
|
52745
|
-
queriesAreChanging = _useComponentEffect.queriesAreChanging
|
|
52746
|
-
results = _useComponentEffect.results;
|
|
53053
|
+
}, props.updateComponentAttributes, props.runQueriesCallback, props.setResults, props.dashboardBehaviour.variables),
|
|
53054
|
+
queriesAreChanging = _useComponentEffect.queriesAreChanging;
|
|
52747
53055
|
return jsx(SingleStatView, _extends({}, attributes, {
|
|
52748
53056
|
id: props.id,
|
|
52749
53057
|
dataSet: props.dataSet,
|
|
@@ -52902,10 +53210,8 @@ var SunburstChartView = function SunburstChartView(props) {
|
|
|
52902
53210
|
setTooltipLabel = _useState5[1];
|
|
52903
53211
|
var xScale = scaleLinear$1().domain(xDomain).range(xRange);
|
|
52904
53212
|
var yScale = scaleSqrt().domain(yDomain).range(yRange);
|
|
52905
|
-
var width = props.width * 3 /
|
|
52906
|
-
var height =
|
|
52907
|
-
var minDimension = Math.min(props.width, props.height);
|
|
52908
|
-
var centeredRatio = minDimension / 2.5;
|
|
53213
|
+
var width = props.width * 3 / 5;
|
|
53214
|
+
var height = 500;
|
|
52909
53215
|
var sunburstChartComponent = getComponentInterface(props.attributes.type);
|
|
52910
53216
|
var headerProps = {
|
|
52911
53217
|
displayTitle: props.attributes.displayTitle,
|
|
@@ -52925,8 +53231,8 @@ var SunburstChartView = function SunburstChartView(props) {
|
|
|
52925
53231
|
order: props.attributes.order
|
|
52926
53232
|
};
|
|
52927
53233
|
useEffect(function () {
|
|
52928
|
-
setYRange([yRange[0],
|
|
52929
|
-
}, [
|
|
53234
|
+
setYRange([yRange[0], width / 2]);
|
|
53235
|
+
}, [width]);
|
|
52930
53236
|
var arc$1 = arc().startAngle(function (d) {
|
|
52931
53237
|
return Math.max(0, Math.min(2 * Math.PI, xScale(d.x0)));
|
|
52932
53238
|
}).endAngle(function (d) {
|
|
@@ -52939,7 +53245,7 @@ var SunburstChartView = function SunburstChartView(props) {
|
|
|
52939
53245
|
var handleClick = function handleClick(d) {
|
|
52940
53246
|
setXDomain([d.x0, d.x1]);
|
|
52941
53247
|
setYDomain([d.y0, 1]);
|
|
52942
|
-
setYRange([d.y0 ? 20 : 0,
|
|
53248
|
+
setYRange([d.y0 ? 20 : 0, width / 2]);
|
|
52943
53249
|
};
|
|
52944
53250
|
var handleUpdate = function handleUpdate(t, xd, yd, yr) {
|
|
52945
53251
|
xScale.domain(xd(t));
|
|
@@ -53026,7 +53332,7 @@ var SunburstChartView = function SunburstChartView(props) {
|
|
|
53026
53332
|
height: height,
|
|
53027
53333
|
children: jsx(Partition, {
|
|
53028
53334
|
top: 0,
|
|
53029
|
-
left: centerX
|
|
53335
|
+
left: centerX * 2 / 3,
|
|
53030
53336
|
root: root,
|
|
53031
53337
|
children: jsx(Spring, {
|
|
53032
53338
|
reset: true,
|
|
@@ -53106,12 +53412,13 @@ var SunburstChartView = function SunburstChartView(props) {
|
|
|
53106
53412
|
};
|
|
53107
53413
|
|
|
53108
53414
|
var SunburstChart$2 = function SunburstChart(props) {
|
|
53109
|
-
var
|
|
53110
|
-
|
|
53111
|
-
|
|
53112
|
-
|
|
53113
|
-
|
|
53114
|
-
|
|
53415
|
+
var _props$component = props.component,
|
|
53416
|
+
results = _props$component.results,
|
|
53417
|
+
attributes = _props$component.attributes;
|
|
53418
|
+
useQueryEffect(attributes, props.runQueriesCallback, props.setResults, {
|
|
53419
|
+
localFilters: props.component.localFilters,
|
|
53420
|
+
globalFilters: props.globalFilters
|
|
53421
|
+
}, props.dataSet, undefined, props.dashboardBehaviour.variables);
|
|
53115
53422
|
var params = {
|
|
53116
53423
|
defaultFormats: props.dashboardBehaviour.defaultFormats,
|
|
53117
53424
|
dateTimeFormatOptions: props.dashboardBehaviour.dateTimeFormatOptions,
|
|
@@ -53142,246 +53449,6 @@ var SunburstChart$2 = function SunburstChart(props) {
|
|
|
53142
53449
|
});
|
|
53143
53450
|
};
|
|
53144
53451
|
|
|
53145
|
-
function getNiceInterval$3(interval) {
|
|
53146
|
-
// Round the interval to a "nice" value (1, 2, 5, etc.)
|
|
53147
|
-
var exponent = Math.floor(Math.log10(interval));
|
|
53148
|
-
var fraction = interval / Math.pow(10, exponent);
|
|
53149
|
-
var niceFraction;
|
|
53150
|
-
if (fraction <= 1.5) niceFraction = 1;else if (fraction <= 3) niceFraction = 2;else if (fraction <= 7) niceFraction = 5;else niceFraction = 10;
|
|
53151
|
-
return niceFraction * Math.pow(10, exponent);
|
|
53152
|
-
}
|
|
53153
|
-
|
|
53154
|
-
var getYTicks = function getYTicks(_ref) {
|
|
53155
|
-
var yMinValue = _ref.yMinValue,
|
|
53156
|
-
yMaxValue = _ref.yMaxValue,
|
|
53157
|
-
approxYAxisLabelCount = _ref.approxYAxisLabelCount,
|
|
53158
|
-
formattingFunctionY = _ref.formattingFunctionY;
|
|
53159
|
-
var yTicks = [];
|
|
53160
|
-
var yTickInterval = getNiceInterval$3((yMaxValue - yMinValue) / (approxYAxisLabelCount - 1));
|
|
53161
|
-
for (var i = 0; i < approxYAxisLabelCount; i++) {
|
|
53162
|
-
var value = (yMinValue + i) * yTickInterval;
|
|
53163
|
-
var formattedValue = formattingFunctionY(value);
|
|
53164
|
-
yTicks.push({
|
|
53165
|
-
value: value,
|
|
53166
|
-
formattedValue: formattedValue,
|
|
53167
|
-
scaleValue: value
|
|
53168
|
-
});
|
|
53169
|
-
}
|
|
53170
|
-
return yTicks;
|
|
53171
|
-
};
|
|
53172
|
-
|
|
53173
|
-
var getRepresentationData = function getRepresentationData(_ref) {
|
|
53174
|
-
var content = _ref.content,
|
|
53175
|
-
xKey = _ref.xKey,
|
|
53176
|
-
yKey = _ref.yKey,
|
|
53177
|
-
approxYAxisLabelCount = _ref.approxYAxisLabelCount,
|
|
53178
|
-
showTotalBar = _ref.showTotalBar,
|
|
53179
|
-
formattingFunctionY = _ref.formattingFunctionY;
|
|
53180
|
-
var data = [];
|
|
53181
|
-
var steps = [];
|
|
53182
|
-
var xTicks = [];
|
|
53183
|
-
var yValueSum = 0;
|
|
53184
|
-
var yMinValue = 0;
|
|
53185
|
-
var yMaxValue = 0;
|
|
53186
|
-
content.forEach(function (dataItem, index) {
|
|
53187
|
-
var _dataItem$xValueIndex, _dataItem$xValueIndex2, _dataItem$yValueIndex, _dataItem$yValueIndex2, _data$push;
|
|
53188
|
-
var xValueIndex = 0;
|
|
53189
|
-
var yValueIndex = 1;
|
|
53190
|
-
var xValue = (_dataItem$xValueIndex = dataItem[xValueIndex]) == null ? void 0 : _dataItem$xValueIndex.value;
|
|
53191
|
-
var xFormattedValue = (_dataItem$xValueIndex2 = dataItem[xValueIndex]) == null ? void 0 : _dataItem$xValueIndex2.formattedValue;
|
|
53192
|
-
var yValue = Number((_dataItem$yValueIndex = (_dataItem$yValueIndex2 = dataItem[yValueIndex]) == null ? void 0 : _dataItem$yValueIndex2.value) != null ? _dataItem$yValueIndex : 0);
|
|
53193
|
-
var yValueDiff = yValue;
|
|
53194
|
-
if (index > 0) {
|
|
53195
|
-
var _content$yValueIndex;
|
|
53196
|
-
var prevYValue = Number((_content$yValueIndex = content[index - 1][yValueIndex]) == null ? void 0 : _content$yValueIndex.value);
|
|
53197
|
-
yValueDiff = yValue - prevYValue;
|
|
53198
|
-
}
|
|
53199
|
-
var prevYValueSum = yValueSum;
|
|
53200
|
-
yValueSum += yValueDiff;
|
|
53201
|
-
data.push((_data$push = {}, _data$push[xKey] = {
|
|
53202
|
-
value: xValue,
|
|
53203
|
-
formattedValue: xFormattedValue
|
|
53204
|
-
}, _data$push[yKey] = {
|
|
53205
|
-
value: yValueDiff,
|
|
53206
|
-
formattedValue: formattingFunctionY(yValueDiff)
|
|
53207
|
-
}, _data$push));
|
|
53208
|
-
xTicks.push({
|
|
53209
|
-
value: xValue,
|
|
53210
|
-
formattedValue: xFormattedValue,
|
|
53211
|
-
scaleValue: xValue
|
|
53212
|
-
});
|
|
53213
|
-
steps.push({
|
|
53214
|
-
x: xValue,
|
|
53215
|
-
y: yValue,
|
|
53216
|
-
start: prevYValueSum,
|
|
53217
|
-
end: yValueSum
|
|
53218
|
-
});
|
|
53219
|
-
yMinValue = Math.floor(Math.min(yMinValue, yValue));
|
|
53220
|
-
yMaxValue = Math.ceil(Math.max(yMaxValue, yValue));
|
|
53221
|
-
});
|
|
53222
|
-
if (showTotalBar) {
|
|
53223
|
-
var _data$push2;
|
|
53224
|
-
var totalLabel = 'Total';
|
|
53225
|
-
steps.push({
|
|
53226
|
-
x: totalLabel,
|
|
53227
|
-
y: yValueSum,
|
|
53228
|
-
start: 0,
|
|
53229
|
-
end: yValueSum
|
|
53230
|
-
});
|
|
53231
|
-
data.push((_data$push2 = {}, _data$push2[xKey] = {
|
|
53232
|
-
value: totalLabel,
|
|
53233
|
-
formattedValue: totalLabel
|
|
53234
|
-
}, _data$push2[yKey] = {
|
|
53235
|
-
value: yValueSum,
|
|
53236
|
-
formattedValue: formattingFunctionY(yValueSum)
|
|
53237
|
-
}, _data$push2));
|
|
53238
|
-
xTicks.push({
|
|
53239
|
-
value: totalLabel,
|
|
53240
|
-
formattedValue: totalLabel,
|
|
53241
|
-
scaleValue: totalLabel
|
|
53242
|
-
});
|
|
53243
|
-
}
|
|
53244
|
-
var yTicks = getYTicks({
|
|
53245
|
-
yMinValue: yMinValue,
|
|
53246
|
-
yMaxValue: yMaxValue,
|
|
53247
|
-
approxYAxisLabelCount: approxYAxisLabelCount,
|
|
53248
|
-
formattingFunctionY: formattingFunctionY
|
|
53249
|
-
});
|
|
53250
|
-
return {
|
|
53251
|
-
data: data,
|
|
53252
|
-
steps: steps,
|
|
53253
|
-
xTicks: xTicks,
|
|
53254
|
-
yTicks: yTicks,
|
|
53255
|
-
yMinValue: yMinValue,
|
|
53256
|
-
yMaxValue: yMaxValue
|
|
53257
|
-
};
|
|
53258
|
-
};
|
|
53259
|
-
|
|
53260
|
-
var buildWaterfallChartRepresentation = function buildWaterfallChartRepresentation(_ref) {
|
|
53261
|
-
var _formattedResult$fiel, _formattedResult$fiel2, _axisTitles$x, _axisTitles$y;
|
|
53262
|
-
var approxYAxisLabelCount = _ref.approxYAxisLabelCount,
|
|
53263
|
-
axisTitles = _ref.axisTitles,
|
|
53264
|
-
dateTimeFormatOptions = _ref.dateTimeFormatOptions,
|
|
53265
|
-
defaultFormats = _ref.defaultFormats,
|
|
53266
|
-
nullValue = _ref.nullValue,
|
|
53267
|
-
numberFormatOptions = _ref.numberFormatOptions,
|
|
53268
|
-
pivotConfig = _ref.pivotConfig,
|
|
53269
|
-
result = _ref.result,
|
|
53270
|
-
showTotalBar = _ref.showTotalBar,
|
|
53271
|
-
_valueAlias = _ref.valueAlias,
|
|
53272
|
-
xAxisFormat = _ref.xAxisFormat,
|
|
53273
|
-
xAxisPrefix = _ref.xAxisPrefix,
|
|
53274
|
-
xAxisPostfix = _ref.xAxisPostfix,
|
|
53275
|
-
yAxisFormat = _ref.yAxisFormat,
|
|
53276
|
-
yAxisPrefix = _ref.yAxisPrefix,
|
|
53277
|
-
yAxisPostfix = _ref.yAxisPostfix;
|
|
53278
|
-
var activeDateTimeFormats = {};
|
|
53279
|
-
var _buildFieldFormatMaps = buildFieldFormatMaps(result, pivotConfig, xAxisPrefix, xAxisPostfix, xAxisFormat, yAxisPrefix, yAxisPostfix, yAxisFormat, nullValue, numberFormatOptions),
|
|
53280
|
-
allPrefixes = _buildFieldFormatMaps.allPrefixes,
|
|
53281
|
-
allPostfixes = _buildFieldFormatMaps.allPostfixes,
|
|
53282
|
-
nullValues = _buildFieldFormatMaps.nullValues,
|
|
53283
|
-
activeNumberFormats = _buildFieldFormatMaps.activeNumberFormats;
|
|
53284
|
-
var params = {
|
|
53285
|
-
defaultFormats: defaultFormats,
|
|
53286
|
-
dateTimeFormatOptions: dateTimeFormatOptions,
|
|
53287
|
-
numberFormatOptions: numberFormatOptions,
|
|
53288
|
-
valueAlias: function valueAlias(params) {
|
|
53289
|
-
if (typeof _valueAlias === 'function') {
|
|
53290
|
-
return String(_valueAlias({
|
|
53291
|
-
fieldId: id({
|
|
53292
|
-
field: params.fieldId,
|
|
53293
|
-
"function": params["function"]
|
|
53294
|
-
}),
|
|
53295
|
-
value: params.value
|
|
53296
|
-
}));
|
|
53297
|
-
}
|
|
53298
|
-
return undefined;
|
|
53299
|
-
},
|
|
53300
|
-
nullValue: nullValues,
|
|
53301
|
-
prefixes: allPrefixes,
|
|
53302
|
-
postfixes: allPostfixes,
|
|
53303
|
-
activeNumberFormats: activeNumberFormats,
|
|
53304
|
-
activeDateTimeFormats: activeDateTimeFormats
|
|
53305
|
-
};
|
|
53306
|
-
var formattedResult = formatResult(result, params);
|
|
53307
|
-
var formattingFunctionY = function formattingFunctionY(value) {
|
|
53308
|
-
// Use any y axis field as they are all formatted in the same way (for now...);
|
|
53309
|
-
var nonPivotField = formattedResult.fields.find(function (resultField) {
|
|
53310
|
-
return ![].concat(pivotConfig.x, pivotConfig.y).includes(resultField.id);
|
|
53311
|
-
});
|
|
53312
|
-
if (!nonPivotField) return '';
|
|
53313
|
-
return formattedResult.formatterFunc(value, {
|
|
53314
|
-
fieldId: nonPivotField.fieldId,
|
|
53315
|
-
"function": nonPivotField["function"],
|
|
53316
|
-
outputDataType: nonPivotField.outputDataType
|
|
53317
|
-
}).formattedValue;
|
|
53318
|
-
};
|
|
53319
|
-
var keys = formattedResult.fields.map(function (field) {
|
|
53320
|
-
var _ref2;
|
|
53321
|
-
var key = field.fieldId;
|
|
53322
|
-
var keyFormatted = field.publicName;
|
|
53323
|
-
var dataType = field.dataType;
|
|
53324
|
-
return _ref2 = {}, _ref2[key] = {
|
|
53325
|
-
key: key,
|
|
53326
|
-
keyFormatted: keyFormatted,
|
|
53327
|
-
dataType: dataType
|
|
53328
|
-
}, _ref2;
|
|
53329
|
-
});
|
|
53330
|
-
var xKey = (_formattedResult$fiel = formattedResult.fields[0]) == null ? void 0 : _formattedResult$fiel.fieldId;
|
|
53331
|
-
var yKey = (_formattedResult$fiel2 = formattedResult.fields[1]) == null ? void 0 : _formattedResult$fiel2.fieldId;
|
|
53332
|
-
var content = formattedResult.content;
|
|
53333
|
-
var _getRepresentationDat = getRepresentationData({
|
|
53334
|
-
content: content,
|
|
53335
|
-
xKey: xKey,
|
|
53336
|
-
yKey: yKey,
|
|
53337
|
-
approxYAxisLabelCount: approxYAxisLabelCount,
|
|
53338
|
-
showTotalBar: showTotalBar,
|
|
53339
|
-
formattingFunctionY: formattingFunctionY
|
|
53340
|
-
}),
|
|
53341
|
-
data = _getRepresentationDat.data,
|
|
53342
|
-
steps = _getRepresentationDat.steps,
|
|
53343
|
-
xTicks = _getRepresentationDat.xTicks,
|
|
53344
|
-
yTicks = _getRepresentationDat.yTicks,
|
|
53345
|
-
yMinValue = _getRepresentationDat.yMinValue,
|
|
53346
|
-
yMaxValue = _getRepresentationDat.yMaxValue;
|
|
53347
|
-
var chartRepresentation = {
|
|
53348
|
-
keys: _extends({}, keys[0], keys[1]),
|
|
53349
|
-
x: {
|
|
53350
|
-
title: (_axisTitles$x = axisTitles == null ? void 0 : axisTitles.x) != null ? _axisTitles$x : null,
|
|
53351
|
-
ticks: xTicks,
|
|
53352
|
-
prefix: xAxisPrefix,
|
|
53353
|
-
postfix: xAxisPostfix,
|
|
53354
|
-
key: xKey,
|
|
53355
|
-
scale: {
|
|
53356
|
-
dataType: 'string',
|
|
53357
|
-
key: xKey,
|
|
53358
|
-
ordering: null,
|
|
53359
|
-
min: null,
|
|
53360
|
-
max: null
|
|
53361
|
-
}
|
|
53362
|
-
},
|
|
53363
|
-
y: {
|
|
53364
|
-
title: (_axisTitles$y = axisTitles == null ? void 0 : axisTitles.y) != null ? _axisTitles$y : null,
|
|
53365
|
-
ticks: yTicks,
|
|
53366
|
-
key: yKey,
|
|
53367
|
-
prefix: yAxisPrefix,
|
|
53368
|
-
postfix: yAxisPostfix,
|
|
53369
|
-
scale: {
|
|
53370
|
-
dataType: 'number',
|
|
53371
|
-
key: null,
|
|
53372
|
-
ordering: 'asc',
|
|
53373
|
-
min: yMinValue,
|
|
53374
|
-
max: yMaxValue
|
|
53375
|
-
}
|
|
53376
|
-
},
|
|
53377
|
-
data: data
|
|
53378
|
-
};
|
|
53379
|
-
return {
|
|
53380
|
-
waterfallChartRepresentation: chartRepresentation,
|
|
53381
|
-
waterfallChartSteps: steps
|
|
53382
|
-
};
|
|
53383
|
-
};
|
|
53384
|
-
|
|
53385
53452
|
var ASSUMED_AVERAGE_CHAR_WIDTH$2 = 8.8;
|
|
53386
53453
|
function calculateWordWidth$1(word, avgCharWidth) {
|
|
53387
53454
|
if (avgCharWidth === void 0) {
|
|
@@ -53391,7 +53458,7 @@ function calculateWordWidth$1(word, avgCharWidth) {
|
|
|
53391
53458
|
}
|
|
53392
53459
|
|
|
53393
53460
|
/** Reduce width proportionally to simulate spacing / padding between ticks. */
|
|
53394
|
-
var widthWithSpacing = function widthWithSpacing(width) {
|
|
53461
|
+
var widthWithSpacing$1 = function widthWithSpacing(width) {
|
|
53395
53462
|
var THIRTY_PERCENT = 0.3;
|
|
53396
53463
|
return width - width * THIRTY_PERCENT;
|
|
53397
53464
|
};
|
|
@@ -53405,7 +53472,7 @@ function howManyTicksFitInWidth$1(ticks, maxWidth, avgCharWidth) {
|
|
|
53405
53472
|
var tick = _step.value;
|
|
53406
53473
|
var word = (tick == null ? void 0 : tick.formattedValue) || '';
|
|
53407
53474
|
var wordWidth = calculateWordWidth$1(word, avgCharWidth);
|
|
53408
|
-
if (currentWidth + wordWidth <= widthWithSpacing(maxWidth)) {
|
|
53475
|
+
if (currentWidth + wordWidth <= widthWithSpacing$1(maxWidth)) {
|
|
53409
53476
|
fittedTicks.push(tick);
|
|
53410
53477
|
currentWidth += wordWidth + avgCharWidth; // Add space between words
|
|
53411
53478
|
} else {
|
|
@@ -53483,7 +53550,7 @@ var Tooltip$2 = function Tooltip(_ref) {
|
|
|
53483
53550
|
if (!showTooltip || !tooltipData) return null;
|
|
53484
53551
|
var value = tooltipData[yKey].value;
|
|
53485
53552
|
var isPositiveValue = Number(value) > 0;
|
|
53486
|
-
return
|
|
53553
|
+
return jsx(TooltipWithBounds, {
|
|
53487
53554
|
left: tooltipLeft,
|
|
53488
53555
|
top: tooltipTop,
|
|
53489
53556
|
style: theme,
|
|
@@ -53518,7 +53585,7 @@ var Tooltip$2 = function Tooltip(_ref) {
|
|
|
53518
53585
|
})]
|
|
53519
53586
|
})]
|
|
53520
53587
|
})
|
|
53521
|
-
}, Math.random())
|
|
53588
|
+
}, Math.random());
|
|
53522
53589
|
};
|
|
53523
53590
|
var IconNarrowRight$1 = function IconNarrowRight() {
|
|
53524
53591
|
var style = {
|
|
@@ -53526,7 +53593,7 @@ var IconNarrowRight$1 = function IconNarrowRight() {
|
|
|
53526
53593
|
height: 20,
|
|
53527
53594
|
display: 'block'
|
|
53528
53595
|
};
|
|
53529
|
-
var fill =
|
|
53596
|
+
var fill = "#12B76A";
|
|
53530
53597
|
return jsx("svg", {
|
|
53531
53598
|
fill: "none",
|
|
53532
53599
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -53546,7 +53613,7 @@ var IconTrendingDown$1 = function IconTrendingDown() {
|
|
|
53546
53613
|
height: 20,
|
|
53547
53614
|
display: 'block'
|
|
53548
53615
|
};
|
|
53549
|
-
var fill =
|
|
53616
|
+
var fill = "#F04438";
|
|
53550
53617
|
return jsx("svg", {
|
|
53551
53618
|
fill: "none",
|
|
53552
53619
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -53604,7 +53671,7 @@ var Legend$2 = function Legend(_ref) {
|
|
|
53604
53671
|
});
|
|
53605
53672
|
};
|
|
53606
53673
|
|
|
53607
|
-
var _excluded$
|
|
53674
|
+
var _excluded$h = ["formattedValue"],
|
|
53608
53675
|
_excluded2$4 = ["formattedValue"];
|
|
53609
53676
|
var AXIS_TITLE_STYLES$1 = {
|
|
53610
53677
|
opacity: '0.75',
|
|
@@ -53714,8 +53781,8 @@ var WaterfallChart$2 = function WaterfallChart(_ref) {
|
|
|
53714
53781
|
return Number(tick.value);
|
|
53715
53782
|
});
|
|
53716
53783
|
var xTickValues = formattedChartDataForBarChart.x.ticks.length > 0 ? formattedChartDataForBarChart.x.ticks.map(function (tick) {
|
|
53717
|
-
var
|
|
53718
|
-
return (
|
|
53784
|
+
var _tick$scaleValue;
|
|
53785
|
+
return (_tick$scaleValue = tick.scaleValue) != null ? _tick$scaleValue : 0;
|
|
53719
53786
|
}) : undefined;
|
|
53720
53787
|
var handleMouseMove = useCallback(function (event) {
|
|
53721
53788
|
if (!xKey || !xScaleKey || xScale === null) return;
|
|
@@ -53748,7 +53815,7 @@ var WaterfallChart$2 = function WaterfallChart(_ref) {
|
|
|
53748
53815
|
tick = matchingTickValue || null;
|
|
53749
53816
|
} else {
|
|
53750
53817
|
var _matchingTickValue = formattedChartDataForBarChart.x.ticks.find(function (tickValue) {
|
|
53751
|
-
return
|
|
53818
|
+
return tickValue.scaleValue === value;
|
|
53752
53819
|
});
|
|
53753
53820
|
tick = _matchingTickValue || null;
|
|
53754
53821
|
}
|
|
@@ -53773,10 +53840,10 @@ var WaterfallChart$2 = function WaterfallChart(_ref) {
|
|
|
53773
53840
|
return '';
|
|
53774
53841
|
}, [formattedChartDataForBarChart.y.ticks]);
|
|
53775
53842
|
var getBarGroupPosition = useCallback(function (d) {
|
|
53776
|
-
if (xScaleKey == null || d == null) return
|
|
53843
|
+
if (xScaleKey == null || d == null) return;
|
|
53777
53844
|
var xValue = d[xScaleKey];
|
|
53778
|
-
if (xScaleDataType === 'string') return
|
|
53779
|
-
return
|
|
53845
|
+
if (xScaleDataType === 'string') return xValue;
|
|
53846
|
+
return;
|
|
53780
53847
|
}, [xScaleKey, xScaleDataType]);
|
|
53781
53848
|
if (width === 0 || height === 0 || xScale == null) return null;
|
|
53782
53849
|
return jsxs(Fragment$1, {
|
|
@@ -53814,7 +53881,7 @@ var WaterfallChart$2 = function WaterfallChart(_ref) {
|
|
|
53814
53881
|
tickValues: xTickValues,
|
|
53815
53882
|
tickComponent: function tickComponent(_ref2) {
|
|
53816
53883
|
var formattedValue = _ref2.formattedValue,
|
|
53817
|
-
tickProps = _objectWithoutPropertiesLoose(_ref2, _excluded$
|
|
53884
|
+
tickProps = _objectWithoutPropertiesLoose(_ref2, _excluded$h);
|
|
53818
53885
|
return jsx(Text, _extends({
|
|
53819
53886
|
style: themeCSS.labels
|
|
53820
53887
|
}, tickProps, {
|
|
@@ -53926,6 +53993,245 @@ var Bar$2 = function Bar(_ref4) {
|
|
|
53926
53993
|
});
|
|
53927
53994
|
};
|
|
53928
53995
|
|
|
53996
|
+
function getNiceInterval$3(interval) {
|
|
53997
|
+
// Round the interval to a "nice" value (1, 2, 5, etc.)
|
|
53998
|
+
var exponent = Math.floor(Math.log10(interval));
|
|
53999
|
+
var fraction = interval / Math.pow(10, exponent);
|
|
54000
|
+
var niceFraction;
|
|
54001
|
+
if (fraction <= 1.5) niceFraction = 1;else if (fraction <= 3) niceFraction = 2;else if (fraction <= 7) niceFraction = 5;else niceFraction = 10;
|
|
54002
|
+
return niceFraction * Math.pow(10, exponent);
|
|
54003
|
+
}
|
|
54004
|
+
|
|
54005
|
+
var getYTicks = function getYTicks(_ref) {
|
|
54006
|
+
var yMinValue = _ref.yMinValue,
|
|
54007
|
+
yMaxValue = _ref.yMaxValue,
|
|
54008
|
+
approxYAxisLabelCount = _ref.approxYAxisLabelCount,
|
|
54009
|
+
formattingFunctionY = _ref.formattingFunctionY;
|
|
54010
|
+
var yTicks = [];
|
|
54011
|
+
var yTickInterval = getNiceInterval$3((yMaxValue - yMinValue) / (approxYAxisLabelCount - 1));
|
|
54012
|
+
for (var i = 0; i < approxYAxisLabelCount; i++) {
|
|
54013
|
+
var value = (yMinValue + i) * yTickInterval;
|
|
54014
|
+
var formattedValue = formattingFunctionY(value);
|
|
54015
|
+
yTicks.push({
|
|
54016
|
+
value: value,
|
|
54017
|
+
formattedValue: formattedValue,
|
|
54018
|
+
scaleValue: value
|
|
54019
|
+
});
|
|
54020
|
+
}
|
|
54021
|
+
return yTicks;
|
|
54022
|
+
};
|
|
54023
|
+
|
|
54024
|
+
var getRepresentationData = function getRepresentationData(_ref) {
|
|
54025
|
+
var content = _ref.content,
|
|
54026
|
+
xKey = _ref.xKey,
|
|
54027
|
+
yKey = _ref.yKey,
|
|
54028
|
+
approxYAxisLabelCount = _ref.approxYAxisLabelCount,
|
|
54029
|
+
showTotalBar = _ref.showTotalBar,
|
|
54030
|
+
formattingFunctionY = _ref.formattingFunctionY;
|
|
54031
|
+
var data = [];
|
|
54032
|
+
var steps = [];
|
|
54033
|
+
var xTicks = [];
|
|
54034
|
+
var yValueSum = 0;
|
|
54035
|
+
var yMinValue = 0;
|
|
54036
|
+
var yMaxValue = 0;
|
|
54037
|
+
content.forEach(function (dataItem, index) {
|
|
54038
|
+
var _data$push;
|
|
54039
|
+
var xValueIndex = 0;
|
|
54040
|
+
var yValueIndex = 1;
|
|
54041
|
+
var xValue = dataItem[xValueIndex].value;
|
|
54042
|
+
var xFormattedValue = dataItem[xValueIndex].formattedValue;
|
|
54043
|
+
var yValue = Number(dataItem[yValueIndex].value);
|
|
54044
|
+
var yValueDiff = yValue;
|
|
54045
|
+
if (index > 0) {
|
|
54046
|
+
var prevYValue = Number(content[index - 1][yValueIndex].value);
|
|
54047
|
+
yValueDiff = yValue - prevYValue;
|
|
54048
|
+
}
|
|
54049
|
+
var prevYValueSum = yValueSum;
|
|
54050
|
+
yValueSum += yValueDiff;
|
|
54051
|
+
data.push((_data$push = {}, _data$push[xKey] = {
|
|
54052
|
+
value: xValue,
|
|
54053
|
+
formattedValue: xFormattedValue
|
|
54054
|
+
}, _data$push[yKey] = {
|
|
54055
|
+
value: yValueDiff,
|
|
54056
|
+
formattedValue: formattingFunctionY(yValueDiff)
|
|
54057
|
+
}, _data$push));
|
|
54058
|
+
xTicks.push({
|
|
54059
|
+
value: xValue,
|
|
54060
|
+
formattedValue: xFormattedValue,
|
|
54061
|
+
scaleValue: xValue
|
|
54062
|
+
});
|
|
54063
|
+
steps.push({
|
|
54064
|
+
x: xValue,
|
|
54065
|
+
y: yValue,
|
|
54066
|
+
start: prevYValueSum,
|
|
54067
|
+
end: yValueSum
|
|
54068
|
+
});
|
|
54069
|
+
yMinValue = Math.floor(Math.min(yMinValue, yValue));
|
|
54070
|
+
yMaxValue = Math.ceil(Math.max(yMaxValue, yValue));
|
|
54071
|
+
});
|
|
54072
|
+
if (showTotalBar) {
|
|
54073
|
+
var _data$push2;
|
|
54074
|
+
var totalLabel = 'Total';
|
|
54075
|
+
steps.push({
|
|
54076
|
+
x: totalLabel,
|
|
54077
|
+
y: yValueSum,
|
|
54078
|
+
start: 0,
|
|
54079
|
+
end: yValueSum
|
|
54080
|
+
});
|
|
54081
|
+
data.push((_data$push2 = {}, _data$push2[xKey] = {
|
|
54082
|
+
value: totalLabel,
|
|
54083
|
+
formattedValue: totalLabel
|
|
54084
|
+
}, _data$push2[yKey] = {
|
|
54085
|
+
value: yValueSum,
|
|
54086
|
+
formattedValue: formattingFunctionY(yValueSum)
|
|
54087
|
+
}, _data$push2));
|
|
54088
|
+
xTicks.push({
|
|
54089
|
+
value: totalLabel,
|
|
54090
|
+
formattedValue: totalLabel,
|
|
54091
|
+
scaleValue: totalLabel
|
|
54092
|
+
});
|
|
54093
|
+
}
|
|
54094
|
+
var yTicks = getYTicks({
|
|
54095
|
+
yMinValue: yMinValue,
|
|
54096
|
+
yMaxValue: yMaxValue,
|
|
54097
|
+
approxYAxisLabelCount: approxYAxisLabelCount,
|
|
54098
|
+
formattingFunctionY: formattingFunctionY
|
|
54099
|
+
});
|
|
54100
|
+
return {
|
|
54101
|
+
data: data,
|
|
54102
|
+
steps: steps,
|
|
54103
|
+
xTicks: xTicks,
|
|
54104
|
+
yTicks: yTicks,
|
|
54105
|
+
yMinValue: yMinValue,
|
|
54106
|
+
yMaxValue: yMaxValue
|
|
54107
|
+
};
|
|
54108
|
+
};
|
|
54109
|
+
|
|
54110
|
+
var buildWaterfallChartRepresentation = function buildWaterfallChartRepresentation(_ref) {
|
|
54111
|
+
var _formattedResult$fiel, _formattedResult$fiel2, _axisTitles$x, _axisTitles$y;
|
|
54112
|
+
var approxYAxisLabelCount = _ref.approxYAxisLabelCount,
|
|
54113
|
+
axisTitles = _ref.axisTitles,
|
|
54114
|
+
dateTimeFormatOptions = _ref.dateTimeFormatOptions,
|
|
54115
|
+
defaultFormats = _ref.defaultFormats,
|
|
54116
|
+
nullValue = _ref.nullValue,
|
|
54117
|
+
numberFormatOptions = _ref.numberFormatOptions,
|
|
54118
|
+
pivotConfig = _ref.pivotConfig,
|
|
54119
|
+
result = _ref.result,
|
|
54120
|
+
showTotalBar = _ref.showTotalBar,
|
|
54121
|
+
_valueAlias = _ref.valueAlias,
|
|
54122
|
+
xAxisFormat = _ref.xAxisFormat,
|
|
54123
|
+
xAxisPrefix = _ref.xAxisPrefix,
|
|
54124
|
+
xAxisPostfix = _ref.xAxisPostfix,
|
|
54125
|
+
yAxisFormat = _ref.yAxisFormat,
|
|
54126
|
+
yAxisPrefix = _ref.yAxisPrefix,
|
|
54127
|
+
yAxisPostfix = _ref.yAxisPostfix;
|
|
54128
|
+
var activeDateTimeFormats = {};
|
|
54129
|
+
var _buildFieldFormatMaps = buildFieldFormatMaps(result, pivotConfig, xAxisPrefix, xAxisPostfix, xAxisFormat, yAxisPrefix, yAxisPostfix, yAxisFormat, nullValue, numberFormatOptions),
|
|
54130
|
+
allPrefixes = _buildFieldFormatMaps.allPrefixes,
|
|
54131
|
+
allPostfixes = _buildFieldFormatMaps.allPostfixes,
|
|
54132
|
+
nullValues = _buildFieldFormatMaps.nullValues,
|
|
54133
|
+
activeNumberFormats = _buildFieldFormatMaps.activeNumberFormats;
|
|
54134
|
+
var params = {
|
|
54135
|
+
defaultFormats: defaultFormats,
|
|
54136
|
+
dateTimeFormatOptions: dateTimeFormatOptions,
|
|
54137
|
+
numberFormatOptions: numberFormatOptions,
|
|
54138
|
+
valueAlias: function valueAlias(params) {
|
|
54139
|
+
if (typeof _valueAlias === 'function') {
|
|
54140
|
+
return String(_valueAlias({
|
|
54141
|
+
fieldId: id({
|
|
54142
|
+
field: params.fieldId,
|
|
54143
|
+
"function": params["function"]
|
|
54144
|
+
}),
|
|
54145
|
+
value: params.value
|
|
54146
|
+
}));
|
|
54147
|
+
}
|
|
54148
|
+
return undefined;
|
|
54149
|
+
},
|
|
54150
|
+
nullValue: nullValues,
|
|
54151
|
+
prefixes: allPrefixes,
|
|
54152
|
+
postfixes: allPostfixes,
|
|
54153
|
+
activeNumberFormats: activeNumberFormats,
|
|
54154
|
+
activeDateTimeFormats: activeDateTimeFormats
|
|
54155
|
+
};
|
|
54156
|
+
var formattedResult = formatResult(result, params);
|
|
54157
|
+
var formattingFunctionY = function formattingFunctionY(value) {
|
|
54158
|
+
// Use any y axis field as they are all formatted in the same way (for now...);
|
|
54159
|
+
var nonPivotField = formattedResult.fields.find(function (resultField) {
|
|
54160
|
+
return ![].concat(pivotConfig.x, pivotConfig.y).includes(resultField.id);
|
|
54161
|
+
});
|
|
54162
|
+
if (!nonPivotField) return '';
|
|
54163
|
+
return formattedResult.formatterFunc(value, {
|
|
54164
|
+
fieldId: nonPivotField.fieldId,
|
|
54165
|
+
"function": nonPivotField["function"],
|
|
54166
|
+
outputDataType: nonPivotField.outputDataType
|
|
54167
|
+
}).formattedValue;
|
|
54168
|
+
};
|
|
54169
|
+
var keys = formattedResult.fields.map(function (field) {
|
|
54170
|
+
var _ref2;
|
|
54171
|
+
var key = field.fieldId;
|
|
54172
|
+
var keyFormatted = field.publicName;
|
|
54173
|
+
var dataType = field.dataType;
|
|
54174
|
+
return _ref2 = {}, _ref2[key] = {
|
|
54175
|
+
key: key,
|
|
54176
|
+
keyFormatted: keyFormatted,
|
|
54177
|
+
dataType: dataType
|
|
54178
|
+
}, _ref2;
|
|
54179
|
+
});
|
|
54180
|
+
var xKey = (_formattedResult$fiel = formattedResult.fields[0]) == null ? void 0 : _formattedResult$fiel.fieldId;
|
|
54181
|
+
var yKey = (_formattedResult$fiel2 = formattedResult.fields[1]) == null ? void 0 : _formattedResult$fiel2.fieldId;
|
|
54182
|
+
var content = formattedResult.content;
|
|
54183
|
+
var _getRepresentationDat = getRepresentationData({
|
|
54184
|
+
content: content,
|
|
54185
|
+
xKey: xKey,
|
|
54186
|
+
yKey: yKey,
|
|
54187
|
+
approxYAxisLabelCount: approxYAxisLabelCount,
|
|
54188
|
+
showTotalBar: showTotalBar,
|
|
54189
|
+
formattingFunctionY: formattingFunctionY
|
|
54190
|
+
}),
|
|
54191
|
+
data = _getRepresentationDat.data,
|
|
54192
|
+
steps = _getRepresentationDat.steps,
|
|
54193
|
+
xTicks = _getRepresentationDat.xTicks,
|
|
54194
|
+
yTicks = _getRepresentationDat.yTicks,
|
|
54195
|
+
yMinValue = _getRepresentationDat.yMinValue,
|
|
54196
|
+
yMaxValue = _getRepresentationDat.yMaxValue;
|
|
54197
|
+
var chartRepresentation = {
|
|
54198
|
+
keys: _extends({}, keys[0], keys[1]),
|
|
54199
|
+
x: {
|
|
54200
|
+
title: (_axisTitles$x = axisTitles == null ? void 0 : axisTitles.x) != null ? _axisTitles$x : null,
|
|
54201
|
+
ticks: xTicks,
|
|
54202
|
+
prefix: xAxisPrefix,
|
|
54203
|
+
postfix: xAxisPostfix,
|
|
54204
|
+
key: xKey,
|
|
54205
|
+
scale: {
|
|
54206
|
+
dataType: 'string',
|
|
54207
|
+
key: xKey,
|
|
54208
|
+
ordering: null,
|
|
54209
|
+
min: null,
|
|
54210
|
+
max: null
|
|
54211
|
+
}
|
|
54212
|
+
},
|
|
54213
|
+
y: {
|
|
54214
|
+
title: (_axisTitles$y = axisTitles == null ? void 0 : axisTitles.y) != null ? _axisTitles$y : null,
|
|
54215
|
+
ticks: yTicks,
|
|
54216
|
+
key: yKey,
|
|
54217
|
+
prefix: yAxisPrefix,
|
|
54218
|
+
postfix: yAxisPostfix,
|
|
54219
|
+
scale: {
|
|
54220
|
+
dataType: 'number',
|
|
54221
|
+
key: null,
|
|
54222
|
+
ordering: 'asc',
|
|
54223
|
+
min: yMinValue,
|
|
54224
|
+
max: yMaxValue
|
|
54225
|
+
}
|
|
54226
|
+
},
|
|
54227
|
+
data: data
|
|
54228
|
+
};
|
|
54229
|
+
return {
|
|
54230
|
+
waterfallChartRepresentation: chartRepresentation,
|
|
54231
|
+
waterfallChartSteps: steps
|
|
54232
|
+
};
|
|
54233
|
+
};
|
|
54234
|
+
|
|
53929
54235
|
var WaterfallChartView = function WaterfallChartView(props) {
|
|
53930
54236
|
var approxXAxisLabelCount = props.approxXAxisLabelCount,
|
|
53931
54237
|
approxYAxisLabelCount = props.approxYAxisLabelCount,
|
|
@@ -53993,7 +54299,6 @@ var WaterfallChartView = function WaterfallChartView(props) {
|
|
|
53993
54299
|
title: "Missing parameters"
|
|
53994
54300
|
});
|
|
53995
54301
|
if (isLoading(result)) return jsx(LoadingComponent, {});
|
|
53996
|
-
if (isLoadingResult(result)) return jsx(LoadingComponent, {});
|
|
53997
54302
|
if (hasFailed(result)) return jsx(FailedToLoadDataNotice, {});
|
|
53998
54303
|
if (isEmpty(result)) return jsx(NoResultContentToShowNotice, _extends({}, headerProps));
|
|
53999
54304
|
var showHeadline = headlineAvailable(order, headline, timeDimension);
|
|
@@ -54064,9 +54369,6 @@ var WaterfallChartView = function WaterfallChartView(props) {
|
|
|
54064
54369
|
})
|
|
54065
54370
|
});
|
|
54066
54371
|
};
|
|
54067
|
-
function isLoadingResult(result) {
|
|
54068
|
-
return result != null && result.content[0].length ? (result == null ? void 0 : result.content[0].length) < 2 : false;
|
|
54069
|
-
}
|
|
54070
54372
|
var WaterfallChartView$1 = /*#__PURE__*/memo(WaterfallChartView, shouldUpdate);
|
|
54071
54373
|
|
|
54072
54374
|
var WaterfallChart$3 = function WaterfallChart(_ref) {
|
|
@@ -54079,17 +54381,18 @@ var WaterfallChart$3 = function WaterfallChart(_ref) {
|
|
|
54079
54381
|
runQueriesCallback = _ref.runQueriesCallback,
|
|
54080
54382
|
setLocalFilters = _ref.setLocalFilters,
|
|
54081
54383
|
_setPartialAttributes = _ref.setPartialAttributes,
|
|
54384
|
+
setResults = _ref.setResults,
|
|
54082
54385
|
updateComponentAttributes = _ref.updateComponentAttributes;
|
|
54083
|
-
var localFilters = component.localFilters
|
|
54386
|
+
var localFilters = component.localFilters,
|
|
54387
|
+
results = component.results;
|
|
54084
54388
|
var _useState = useState(component.attributes),
|
|
54085
54389
|
attributes = _useState[0],
|
|
54086
54390
|
setAttributes = _useState[1];
|
|
54087
54391
|
var _useComponentEffect = useComponentEffect(component.attributes, dataSet, dashboardBehaviour.queryEngineConfig, {
|
|
54088
54392
|
localFilters: localFilters,
|
|
54089
54393
|
globalFilters: globalFilters
|
|
54090
|
-
}, updateComponentAttributes, runQueriesCallback, dashboardBehaviour.variables),
|
|
54091
|
-
queriesAreChanging = _useComponentEffect.queriesAreChanging
|
|
54092
|
-
results = _useComponentEffect.results;
|
|
54394
|
+
}, updateComponentAttributes, runQueriesCallback, setResults, dashboardBehaviour.variables),
|
|
54395
|
+
queriesAreChanging = _useComponentEffect.queriesAreChanging;
|
|
54093
54396
|
useEffect(function () {
|
|
54094
54397
|
if (!queriesAreChanging) {
|
|
54095
54398
|
setAttributes(component.attributes);
|
|
@@ -54188,6 +54491,7 @@ var Component = function Component(props) {
|
|
|
54188
54491
|
dataSet: dataSet,
|
|
54189
54492
|
runQueriesCallback: props.runQueriesCallback,
|
|
54190
54493
|
component: props.component,
|
|
54494
|
+
setResults: props.setResults,
|
|
54191
54495
|
globalFilters: dashboard.globalFilters,
|
|
54192
54496
|
dashboardBehaviour: dashboardBehaviour,
|
|
54193
54497
|
sm: smallVersion,
|
|
@@ -54211,6 +54515,7 @@ var Component = function Component(props) {
|
|
|
54211
54515
|
dataSet: dataSet,
|
|
54212
54516
|
runQueriesCallback: props.runQueriesCallback,
|
|
54213
54517
|
component: props.component,
|
|
54518
|
+
setResults: props.setResults,
|
|
54214
54519
|
globalFilters: dashboard.globalFilters,
|
|
54215
54520
|
dashboardBehaviour: dashboardBehaviour,
|
|
54216
54521
|
sm: smallVersion,
|
|
@@ -54237,6 +54542,7 @@ var Component = function Component(props) {
|
|
|
54237
54542
|
},
|
|
54238
54543
|
runQueriesCallback: props.runQueriesCallback,
|
|
54239
54544
|
component: props.component,
|
|
54545
|
+
setResults: props.setResults,
|
|
54240
54546
|
globalFilters: dashboard.globalFilters,
|
|
54241
54547
|
dashboardBehaviour: dashboardBehaviour,
|
|
54242
54548
|
library: props == null ? void 0 : props.library,
|
|
@@ -54262,6 +54568,7 @@ var Component = function Component(props) {
|
|
|
54262
54568
|
return _updateComponentAttributes(newAttributes);
|
|
54263
54569
|
},
|
|
54264
54570
|
component: props.component,
|
|
54571
|
+
setResults: props.setResults,
|
|
54265
54572
|
globalFilters: dashboard.globalFilters,
|
|
54266
54573
|
dashboardBehaviour: dashboardBehaviour,
|
|
54267
54574
|
sm: smallVersion,
|
|
@@ -54287,6 +54594,7 @@ var Component = function Component(props) {
|
|
|
54287
54594
|
dataSet: dataSet,
|
|
54288
54595
|
runQueriesCallback: props.runQueriesCallback,
|
|
54289
54596
|
component: props.component,
|
|
54597
|
+
setResults: props.setResults,
|
|
54290
54598
|
globalFilters: dashboard.globalFilters,
|
|
54291
54599
|
dashboardBehaviour: dashboardBehaviour,
|
|
54292
54600
|
sm: smallVersion,
|
|
@@ -54316,6 +54624,7 @@ var Component = function Component(props) {
|
|
|
54316
54624
|
},
|
|
54317
54625
|
runQueriesCallback: props.runQueriesCallback,
|
|
54318
54626
|
component: props.component,
|
|
54627
|
+
setResults: props.setResults,
|
|
54319
54628
|
globalFilters: dashboard.globalFilters,
|
|
54320
54629
|
dashboardBehaviour: dashboardBehaviour,
|
|
54321
54630
|
sm: smallVersion,
|
|
@@ -54342,6 +54651,7 @@ var Component = function Component(props) {
|
|
|
54342
54651
|
},
|
|
54343
54652
|
runQueriesCallback: props.runQueriesCallback,
|
|
54344
54653
|
component: props.component,
|
|
54654
|
+
setResults: props.setResults,
|
|
54345
54655
|
globalFilters: dashboard.globalFilters,
|
|
54346
54656
|
dashboardBehaviour: dashboardBehaviour,
|
|
54347
54657
|
library: props == null ? void 0 : props.library,
|
|
@@ -54367,6 +54677,7 @@ var Component = function Component(props) {
|
|
|
54367
54677
|
},
|
|
54368
54678
|
runQueriesCallback: props.runQueriesCallback,
|
|
54369
54679
|
component: props.component,
|
|
54680
|
+
setResults: props.setResults,
|
|
54370
54681
|
globalFilters: dashboard.globalFilters,
|
|
54371
54682
|
dashboardBehaviour: dashboardBehaviour,
|
|
54372
54683
|
library: props == null ? void 0 : props.library,
|
|
@@ -54392,6 +54703,7 @@ var Component = function Component(props) {
|
|
|
54392
54703
|
},
|
|
54393
54704
|
runQueriesCallback: props.runQueriesCallback,
|
|
54394
54705
|
component: props.component,
|
|
54706
|
+
setResults: props.setResults,
|
|
54395
54707
|
globalFilters: dashboard.globalFilters,
|
|
54396
54708
|
dashboardBehaviour: dashboardBehaviour,
|
|
54397
54709
|
library: props == null ? void 0 : props.library,
|
|
@@ -54414,6 +54726,7 @@ var Component = function Component(props) {
|
|
|
54414
54726
|
dataSet: dataSet,
|
|
54415
54727
|
runQueriesCallback: props.runQueriesCallback,
|
|
54416
54728
|
component: props.component,
|
|
54729
|
+
setResults: props.setResults,
|
|
54417
54730
|
globalFilters: dashboard.globalFilters,
|
|
54418
54731
|
dashboardBehaviour: dashboardBehaviour,
|
|
54419
54732
|
library: props == null ? void 0 : props.library,
|
|
@@ -54437,6 +54750,7 @@ var Component = function Component(props) {
|
|
|
54437
54750
|
dataSet: dataSet,
|
|
54438
54751
|
runQueriesCallback: props.runQueriesCallback,
|
|
54439
54752
|
component: props.component,
|
|
54753
|
+
setResults: props.setResults,
|
|
54440
54754
|
globalFilters: dashboard.globalFilters,
|
|
54441
54755
|
dashboardBehaviour: dashboardBehaviour,
|
|
54442
54756
|
library: props == null ? void 0 : props.library,
|
|
@@ -54460,6 +54774,7 @@ var Component = function Component(props) {
|
|
|
54460
54774
|
dataSet: dataSet,
|
|
54461
54775
|
runQueriesCallback: props.runQueriesCallback,
|
|
54462
54776
|
component: props.component,
|
|
54777
|
+
setResults: props.setResults,
|
|
54463
54778
|
globalFilters: dashboard.globalFilters,
|
|
54464
54779
|
dashboardBehaviour: dashboardBehaviour,
|
|
54465
54780
|
library: props == null ? void 0 : props.library,
|
|
@@ -54483,6 +54798,7 @@ var Component = function Component(props) {
|
|
|
54483
54798
|
dataSet: dataSet,
|
|
54484
54799
|
runQueriesCallback: props.runQueriesCallback,
|
|
54485
54800
|
component: props.component,
|
|
54801
|
+
setResults: props.setResults,
|
|
54486
54802
|
globalFilters: dashboard.globalFilters,
|
|
54487
54803
|
dashboardBehaviour: dashboardBehaviour,
|
|
54488
54804
|
library: props == null ? void 0 : props.library,
|
|
@@ -54509,6 +54825,7 @@ var Component = function Component(props) {
|
|
|
54509
54825
|
dataSet: dataSet,
|
|
54510
54826
|
runQueriesCallback: props.runQueriesCallback,
|
|
54511
54827
|
component: props.component,
|
|
54828
|
+
setResults: props.setResults,
|
|
54512
54829
|
globalFilters: dashboard.globalFilters,
|
|
54513
54830
|
dashboardBehaviour: dashboardBehaviour,
|
|
54514
54831
|
library: props == null ? void 0 : props.library,
|
|
@@ -54532,6 +54849,7 @@ var Component = function Component(props) {
|
|
|
54532
54849
|
dataSet: dataSet,
|
|
54533
54850
|
runQueriesCallback: props.runQueriesCallback,
|
|
54534
54851
|
component: props.component,
|
|
54852
|
+
setResults: props.setResults,
|
|
54535
54853
|
globalFilters: dashboard.globalFilters,
|
|
54536
54854
|
updateComponentAttributes: function updateComponentAttributes(newAttributes) {
|
|
54537
54855
|
return _updateComponentAttributes(newAttributes);
|
|
@@ -54558,6 +54876,7 @@ var Component = function Component(props) {
|
|
|
54558
54876
|
dataSet: dataSet,
|
|
54559
54877
|
runQueriesCallback: props.runQueriesCallback,
|
|
54560
54878
|
component: props.component,
|
|
54879
|
+
setResults: props.setResults,
|
|
54561
54880
|
globalFilters: dashboard.globalFilters,
|
|
54562
54881
|
dashboardBehaviour: dashboardBehaviour,
|
|
54563
54882
|
sm: smallVersion,
|
|
@@ -54605,6 +54924,7 @@ var Component = function Component(props) {
|
|
|
54605
54924
|
dataSet: dataSet,
|
|
54606
54925
|
runQueriesCallback: props.runQueriesCallback,
|
|
54607
54926
|
component: props.component,
|
|
54927
|
+
setResults: props.setResults,
|
|
54608
54928
|
globalFilters: dashboard.globalFilters,
|
|
54609
54929
|
dashboardBehaviour: dashboardBehaviour
|
|
54610
54930
|
})
|
|
@@ -54627,6 +54947,7 @@ var Component = function Component(props) {
|
|
|
54627
54947
|
return _updateComponentAttributes(newAttributes);
|
|
54628
54948
|
},
|
|
54629
54949
|
component: props.component,
|
|
54950
|
+
setResults: props.setResults,
|
|
54630
54951
|
globalFilters: dashboard.globalFilters,
|
|
54631
54952
|
dashboardBehaviour: dashboardBehaviour,
|
|
54632
54953
|
sm: smallVersion,
|
|
@@ -54653,6 +54974,7 @@ var Component = function Component(props) {
|
|
|
54653
54974
|
dataSet: dataSet,
|
|
54654
54975
|
runQueriesCallback: props.runQueriesCallback,
|
|
54655
54976
|
component: props.component,
|
|
54977
|
+
setResults: props.setResults,
|
|
54656
54978
|
globalFilters: dashboard.globalFilters,
|
|
54657
54979
|
dashboardBehaviour: dashboardBehaviour,
|
|
54658
54980
|
library: props == null ? void 0 : props.library,
|
|
@@ -54680,6 +55002,7 @@ var Component = function Component(props) {
|
|
|
54680
55002
|
return _updateComponentAttributes(newAttributes);
|
|
54681
55003
|
},
|
|
54682
55004
|
component: props.component,
|
|
55005
|
+
setResults: props.setResults,
|
|
54683
55006
|
globalFilters: dashboard.globalFilters,
|
|
54684
55007
|
dashboardBehaviour: dashboardBehaviour,
|
|
54685
55008
|
library: props == null ? void 0 : props.library,
|
|
@@ -54705,6 +55028,7 @@ var Component = function Component(props) {
|
|
|
54705
55028
|
return _updateComponentAttributes(newAttributes);
|
|
54706
55029
|
},
|
|
54707
55030
|
component: props.component,
|
|
55031
|
+
setResults: props.setResults,
|
|
54708
55032
|
globalFilters: dashboard.globalFilters,
|
|
54709
55033
|
dashboardBehaviour: dashboardBehaviour,
|
|
54710
55034
|
library: props == null ? void 0 : props.library,
|
|
@@ -57510,6 +57834,18 @@ var ModalType = /*#__PURE__*/function (ModalType) {
|
|
|
57510
57834
|
----------------------------------------------
|
|
57511
57835
|
*/
|
|
57512
57836
|
|
|
57837
|
+
/*
|
|
57838
|
+
----------------------------------------------
|
|
57839
|
+
----------------------------------------------
|
|
57840
|
+
----------------------------------------------
|
|
57841
|
+
|
|
57842
|
+
Setting results
|
|
57843
|
+
|
|
57844
|
+
----------------------------------------------
|
|
57845
|
+
----------------------------------------------
|
|
57846
|
+
----------------------------------------------
|
|
57847
|
+
*/
|
|
57848
|
+
|
|
57513
57849
|
/*
|
|
57514
57850
|
----------------------------------------------
|
|
57515
57851
|
----------------------------------------------
|
|
@@ -58547,6 +58883,65 @@ var ParametersModalView = function ParametersModalView(props) {
|
|
|
58547
58883
|
});
|
|
58548
58884
|
};
|
|
58549
58885
|
|
|
58886
|
+
var ViewRawResultsModal = function ViewRawResultsModal(props) {
|
|
58887
|
+
var _useDashboardBehaviou = useDashboardBehaviourContext(),
|
|
58888
|
+
textOverride = _useDashboardBehaviou.textOverride;
|
|
58889
|
+
var _useToastContext = useToastContext(),
|
|
58890
|
+
addToast = _useToastContext.addToast;
|
|
58891
|
+
return jsxs(Modal, {
|
|
58892
|
+
width: "4xl",
|
|
58893
|
+
isOpen: props == null ? void 0 : props.show,
|
|
58894
|
+
onClose: function onClose() {
|
|
58895
|
+
return props == null ? void 0 : props.onClose(false);
|
|
58896
|
+
},
|
|
58897
|
+
children: [jsx(Modal.Header, {
|
|
58898
|
+
title: textOverride('json_results', 'Data in raw JSON format'),
|
|
58899
|
+
show: true
|
|
58900
|
+
}), jsx(Modal.Content, {
|
|
58901
|
+
children: jsx(View, {
|
|
58902
|
+
maxHeight: "400px",
|
|
58903
|
+
overflowY: "scroll",
|
|
58904
|
+
children: jsx("pre", {
|
|
58905
|
+
"data-testid": "raw-results-" + props.rowIndex + "-" + props.cellIndex,
|
|
58906
|
+
children: JSON.stringify(props.results, null, 2)
|
|
58907
|
+
})
|
|
58908
|
+
})
|
|
58909
|
+
}), jsx(Modal.Footer, {
|
|
58910
|
+
buttons: "end",
|
|
58911
|
+
children: jsxs(ButtonGroup, {
|
|
58912
|
+
children: [jsx(Button, {
|
|
58913
|
+
secondary: true,
|
|
58914
|
+
testId: "modal-close-btn",
|
|
58915
|
+
onClick: function onClick() {
|
|
58916
|
+
return props == null ? void 0 : props.onClose(false);
|
|
58917
|
+
},
|
|
58918
|
+
children: textOverride('close', 'Close')
|
|
58919
|
+
}), jsx(Button, {
|
|
58920
|
+
primary: true,
|
|
58921
|
+
testId: "modal-copy-json-results-btn",
|
|
58922
|
+
onClick: function onClick() {
|
|
58923
|
+
var copied = copy(JSON.stringify(props.results));
|
|
58924
|
+
if (copied) {
|
|
58925
|
+
addToast(function () {
|
|
58926
|
+
return jsx(ToastSuccess, {
|
|
58927
|
+
message: "Copied results"
|
|
58928
|
+
});
|
|
58929
|
+
});
|
|
58930
|
+
} else {
|
|
58931
|
+
addToast(function () {
|
|
58932
|
+
return jsx(ToastError, {
|
|
58933
|
+
message: "Failed to copy results"
|
|
58934
|
+
});
|
|
58935
|
+
});
|
|
58936
|
+
}
|
|
58937
|
+
},
|
|
58938
|
+
children: textOverride('copy', 'Copy')
|
|
58939
|
+
})]
|
|
58940
|
+
})
|
|
58941
|
+
})]
|
|
58942
|
+
});
|
|
58943
|
+
};
|
|
58944
|
+
|
|
58550
58945
|
var ViewRawAttributesModal = function ViewRawAttributesModal(props) {
|
|
58551
58946
|
var _useDashboardBehaviou = useDashboardBehaviourContext(),
|
|
58552
58947
|
textOverride = _useDashboardBehaviou.textOverride;
|
|
@@ -58928,6 +59323,7 @@ var PopulatedCell = function PopulatedCell(props) {
|
|
|
58928
59323
|
localFiltersModal = _useState2[0],
|
|
58929
59324
|
showLocalFiltersModal = _useState2[1];
|
|
58930
59325
|
var _useState3 = useState(false),
|
|
59326
|
+
viewRawJSONResults = _useState3[0],
|
|
58931
59327
|
showViewRawJSONResults = _useState3[1];
|
|
58932
59328
|
var _useState4 = useState(false),
|
|
58933
59329
|
viewRawAttributes = _useState4[0],
|
|
@@ -59102,6 +59498,7 @@ var PopulatedCell = function PopulatedCell(props) {
|
|
|
59102
59498
|
isBeingSizeAdjusted: props.isBeingSizeAdjusted,
|
|
59103
59499
|
runQueriesCallback: props.runQueriesCallback,
|
|
59104
59500
|
component: props.component,
|
|
59501
|
+
setResults: props.setResults,
|
|
59105
59502
|
updateComponentAttributes: props.updateComponentAttributes,
|
|
59106
59503
|
height: props.height
|
|
59107
59504
|
}), !showComponent && jsx(LoadingComponent, {})]
|
|
@@ -59127,6 +59524,14 @@ var PopulatedCell = function PopulatedCell(props) {
|
|
|
59127
59524
|
onClose: function onClose() {
|
|
59128
59525
|
return showParametersModal(false);
|
|
59129
59526
|
}
|
|
59527
|
+
}), jsx(ViewRawResultsModal, {
|
|
59528
|
+
cellIndex: props.cellIndex,
|
|
59529
|
+
rowIndex: props.rowIndex,
|
|
59530
|
+
show: viewRawJSONResults,
|
|
59531
|
+
results: props.component.results,
|
|
59532
|
+
onClose: function onClose() {
|
|
59533
|
+
return showViewRawJSONResults(false);
|
|
59534
|
+
}
|
|
59130
59535
|
}), jsx(ViewRawAttributesModal, {
|
|
59131
59536
|
cellIndex: props.cellIndex,
|
|
59132
59537
|
rowIndex: props.rowIndex,
|
|
@@ -59156,6 +59561,7 @@ var PopulatedCell = function PopulatedCell(props) {
|
|
|
59156
59561
|
isBeingSizeAdjusted: props.isBeingSizeAdjusted,
|
|
59157
59562
|
runQueriesCallback: props.runQueriesCallback,
|
|
59158
59563
|
component: props.component,
|
|
59564
|
+
setResults: props.setResults,
|
|
59159
59565
|
updateComponentAttributes: props.updateComponentAttributes,
|
|
59160
59566
|
height: props.height
|
|
59161
59567
|
})
|
|
@@ -59821,6 +60227,14 @@ var ResizableRowCell = function ResizableRowCell(props) {
|
|
|
59821
60227
|
});
|
|
59822
60228
|
},
|
|
59823
60229
|
height: props.height,
|
|
60230
|
+
setResults: function setResults(results) {
|
|
60231
|
+
dispatch({
|
|
60232
|
+
type: 'setResultsForComponentInDisplay',
|
|
60233
|
+
rowIndex: rowIndex,
|
|
60234
|
+
cellIndex: cellIndex,
|
|
60235
|
+
results: results
|
|
60236
|
+
});
|
|
60237
|
+
},
|
|
59824
60238
|
onEdit: function onEdit() {
|
|
59825
60239
|
trackEvent('component.startEditing');
|
|
59826
60240
|
dispatch({
|
|
@@ -61125,6 +61539,9 @@ var ComponentInLibrary = function ComponentInLibrary(props) {
|
|
|
61125
61539
|
setLocalFilters: function setLocalFilters() {},
|
|
61126
61540
|
runQueriesCallback: props.runQueriesCallback,
|
|
61127
61541
|
component: component,
|
|
61542
|
+
setResults: function setResults(results) {
|
|
61543
|
+
return props.setResults(results, libraryIndex);
|
|
61544
|
+
},
|
|
61128
61545
|
updateComponentAttributes: props.updateComponentAttributes,
|
|
61129
61546
|
library: true
|
|
61130
61547
|
})]
|
|
@@ -61447,6 +61864,7 @@ var ViewsInLibrary = function ViewsInLibrary(props) {
|
|
|
61447
61864
|
refIndex = _ref.refIndex;
|
|
61448
61865
|
return jsx(ComponentInLibrary, {
|
|
61449
61866
|
updateComponentAttributes: props.updateComponentAttributes,
|
|
61867
|
+
setResults: props.setResults,
|
|
61450
61868
|
component: item.component,
|
|
61451
61869
|
libraryIndex: refIndex,
|
|
61452
61870
|
onSelectComponent: props == null ? void 0 : props.onSelectComponent,
|
|
@@ -61489,6 +61907,20 @@ var Library = function Library() {
|
|
|
61489
61907
|
featureToggles = _useDashboardBehaviou.featureToggles,
|
|
61490
61908
|
textOverride = _useDashboardBehaviou.textOverride;
|
|
61491
61909
|
var canEditComponentLibrary = featureToggles.canEditComponentLibrary;
|
|
61910
|
+
var setResults = function setResults(results, libraryIndex) {
|
|
61911
|
+
dispatch({
|
|
61912
|
+
type: 'setResultsForComponentInLibrary',
|
|
61913
|
+
results: results,
|
|
61914
|
+
libraryIndex: libraryIndex
|
|
61915
|
+
});
|
|
61916
|
+
};
|
|
61917
|
+
var setFocussedComponentResults = function setFocussedComponentResults(results) {
|
|
61918
|
+
dispatch({
|
|
61919
|
+
type: 'setResultsForComponentInLibrary',
|
|
61920
|
+
results: results,
|
|
61921
|
+
libraryIndex: selectedLibraryIndex
|
|
61922
|
+
});
|
|
61923
|
+
};
|
|
61492
61924
|
var selectComponentFromLibrary = function selectComponentFromLibrary() {
|
|
61493
61925
|
dispatch({
|
|
61494
61926
|
type: 'pickComponentFromLibraryForDisplay',
|
|
@@ -61556,8 +61988,10 @@ var Library = function Library() {
|
|
|
61556
61988
|
onClose: clearModal,
|
|
61557
61989
|
onSelect: selectComponentFromLibrary,
|
|
61558
61990
|
updateComponentAttributes: updateComponentAttributes,
|
|
61991
|
+
setFocussedComponentResults: setFocussedComponentResults,
|
|
61559
61992
|
dashboard: dashboard,
|
|
61560
61993
|
selectedLibraryIndex: selectedLibraryIndex,
|
|
61994
|
+
setResults: setResults,
|
|
61561
61995
|
canEditComponentLibrary: canEditComponentLibrary,
|
|
61562
61996
|
onEdit: startEditingSelectedComponent,
|
|
61563
61997
|
onDelete: setShowDeleteConfirmationModal,
|
|
@@ -61600,6 +62034,7 @@ var ViewLibraryDisplay = function ViewLibraryDisplay(props) {
|
|
|
61600
62034
|
"data-component": "library-content",
|
|
61601
62035
|
children: jsx(ViewsInLibrary, {
|
|
61602
62036
|
runQueriesCallback: props == null ? void 0 : props.runQueriesCallback,
|
|
62037
|
+
setResults: props == null ? void 0 : props.setResults,
|
|
61603
62038
|
components: props.dashboard.componentLibrary,
|
|
61604
62039
|
onSelectComponent: function onSelectComponent(index) {
|
|
61605
62040
|
return props == null ? void 0 : props.onSelectComponent(index);
|
|
@@ -64851,12 +65286,14 @@ var handleFeedbackMessage = function handleFeedbackMessage(_ref) {
|
|
|
64851
65286
|
|
|
64852
65287
|
// By using message ids we ensure there will only be 1 message of a type, and it can be easily removed
|
|
64853
65288
|
var chartDimensionMessageId = 'grouping';
|
|
65289
|
+
var limitWarningMessageId = 'limit';
|
|
64854
65290
|
var EditorComponent = function EditorComponent(props) {
|
|
64855
65291
|
var _theme$editor$gap, _theme$editor, _theme$editor2, _props$usingBeta, _theme$editor3;
|
|
64856
65292
|
var theme = useTheme();
|
|
64857
65293
|
var editorFeedback = useEditorFeedback();
|
|
64858
65294
|
var _props$editor = props.editor,
|
|
64859
65295
|
setAttributes = _props$editor.setAttributes,
|
|
65296
|
+
setResults = _props$editor.setResults,
|
|
64860
65297
|
runQueriesCallback = _props$editor.runQueriesCallback,
|
|
64861
65298
|
component = _props$editor.component,
|
|
64862
65299
|
dataSet = _props$editor.dataSet,
|
|
@@ -64877,25 +65314,26 @@ var EditorComponent = function EditorComponent(props) {
|
|
|
64877
65314
|
editorFeedback.removeFeedbackMessage(chartDimensionMessageId);
|
|
64878
65315
|
};
|
|
64879
65316
|
}, [component.attributes]);
|
|
64880
|
-
|
|
64881
|
-
|
|
64882
|
-
|
|
64883
|
-
|
|
64884
|
-
|
|
64885
|
-
|
|
64886
|
-
|
|
64887
|
-
|
|
64888
|
-
|
|
64889
|
-
|
|
64890
|
-
|
|
64891
|
-
|
|
64892
|
-
|
|
64893
|
-
|
|
64894
|
-
|
|
64895
|
-
|
|
64896
|
-
|
|
64897
|
-
|
|
64898
|
-
|
|
65317
|
+
useEffect(function () {
|
|
65318
|
+
handleFeedbackMessage({
|
|
65319
|
+
message: {
|
|
65320
|
+
id: limitWarningMessageId,
|
|
65321
|
+
type: 'info',
|
|
65322
|
+
children: "More data is available for this view. Increase 'Limit' (Advanced Options) to show all data."
|
|
65323
|
+
},
|
|
65324
|
+
showCondition: component.results.some(function (result) {
|
|
65325
|
+
return result == null ? void 0 : result.hasMoreResults;
|
|
65326
|
+
}),
|
|
65327
|
+
hideCondition: !component.results.some(function (result) {
|
|
65328
|
+
return result == null ? void 0 : result.hasMoreResults;
|
|
65329
|
+
}),
|
|
65330
|
+
addFeedbackMessage: editorFeedback.addFeedbackMessage,
|
|
65331
|
+
removeFeedbackMessage: editorFeedback.removeFeedbackMessage
|
|
65332
|
+
});
|
|
65333
|
+
return function () {
|
|
65334
|
+
editorFeedback.removeFeedbackMessage(limitWarningMessageId);
|
|
65335
|
+
};
|
|
65336
|
+
}, [component.results]);
|
|
64899
65337
|
return jsx(RichTextEditorContextProvider, {
|
|
64900
65338
|
setContent: function setContent(content) {
|
|
64901
65339
|
// @ts-ignore
|
|
@@ -64934,6 +65372,7 @@ var EditorComponent = function EditorComponent(props) {
|
|
|
64934
65372
|
isBeingSizeAdjusted: false,
|
|
64935
65373
|
setLocalFilters: props.editor.setLocalFilters,
|
|
64936
65374
|
runQueriesCallback: runQueriesCallback,
|
|
65375
|
+
setResults: setResults,
|
|
64937
65376
|
component: component,
|
|
64938
65377
|
updateComponentAttributes: setAttributes,
|
|
64939
65378
|
editor: true
|
|
@@ -64947,10 +65386,10 @@ var EditorComponent = function EditorComponent(props) {
|
|
|
64947
65386
|
|
|
64948
65387
|
var EditorModal = function EditorModal(props) {
|
|
64949
65388
|
var _theme$modals, _theme$modals2;
|
|
65389
|
+
var editor = useEditor();
|
|
64950
65390
|
var _React$useState = React__default.useState(false),
|
|
64951
65391
|
ai = _React$useState[0],
|
|
64952
65392
|
openAI = _React$useState[1];
|
|
64953
|
-
var editor = useEditor();
|
|
64954
65393
|
var usingBeta = useBetaFeatures();
|
|
64955
65394
|
var _useAIBehaviour = useAIBehaviour(),
|
|
64956
65395
|
fetchSuggestions = _useAIBehaviour.fetchSuggestions;
|
|
@@ -69980,7 +70419,7 @@ var fromToken = function fromToken(token) {
|
|
|
69980
70419
|
});
|
|
69981
70420
|
};
|
|
69982
70421
|
|
|
69983
|
-
var init$
|
|
70422
|
+
var init$d = function init(dashboardSessionToken, dataAccessToken, queryEngineAccessToken, dashboardAdminOverrideToken) {
|
|
69984
70423
|
var dashboardAccessContent = fromToken(dashboardSessionToken);
|
|
69985
70424
|
if (!('scope' in dashboardAccessContent)) {
|
|
69986
70425
|
dashboardAccessContent.scope = 'read_write';
|
|
@@ -70046,7 +70485,7 @@ var fetchIdentityConfig = /*#__PURE__*/function () {
|
|
|
70046
70485
|
throw new FailedToLoadIdentity('Failed to fetch identity config.');
|
|
70047
70486
|
case 6:
|
|
70048
70487
|
dashboardAdminOverride = isClientSide() ? getDashboardAdminOverride(window.location.href) : null;
|
|
70049
|
-
identityConfig = init$
|
|
70488
|
+
identityConfig = init$d(tokens.dashboardAccessToken, tokens.dataAccessToken, tokens.queryEngineAccessToken, dashboardAdminOverride);
|
|
70050
70489
|
return _context.abrupt("return", {
|
|
70051
70490
|
identityConfig: identityConfig,
|
|
70052
70491
|
tokens: tokens
|
|
@@ -70854,6 +71293,7 @@ var buildComponentLibrary = function buildComponentLibrary(cells) {
|
|
|
70854
71293
|
newComponentLibrary.push({
|
|
70855
71294
|
attributes: cell.component.attributes,
|
|
70856
71295
|
localFilters: (_cell$localFilters2 = cell.localFilters) != null ? _cell$localFilters2 : [],
|
|
71296
|
+
results: [],
|
|
70857
71297
|
colSpan: 1,
|
|
70858
71298
|
reports: []
|
|
70859
71299
|
});
|
|
@@ -71221,6 +71661,32 @@ var TimeoutWaitingForVizzlyInstance = /*#__PURE__*/function (_Error) {
|
|
|
71221
71661
|
return TimeoutWaitingForVizzlyInstance;
|
|
71222
71662
|
}( /*#__PURE__*/_wrapNativeSuper(Error));
|
|
71223
71663
|
|
|
71664
|
+
var joiOptions$1 = {
|
|
71665
|
+
convert: false,
|
|
71666
|
+
stripUnknown: false,
|
|
71667
|
+
allowUnknown: true
|
|
71668
|
+
};
|
|
71669
|
+
var validateQuery = function validateQuery(params, queryEngineConfig) {
|
|
71670
|
+
var validationResult = Joi.array().items(schema(queryEngineConfig)).validate(params, joiOptions$1);
|
|
71671
|
+
if (validationResult.error) {
|
|
71672
|
+
throw new ServicesValidationError(validationResult.error.message);
|
|
71673
|
+
}
|
|
71674
|
+
};
|
|
71675
|
+
var filterSchema$1 = function filterSchema(queryEngineConfig) {
|
|
71676
|
+
var _Joi$string;
|
|
71677
|
+
return Joi.array().items(Joi.alternatives()["try"](Joi.object({
|
|
71678
|
+
field: Joi.string().required().description('The ID of the field from the data set to reference.'),
|
|
71679
|
+
op: (_Joi$string = Joi.string()).valid.apply(_Joi$string, Object.keys(queryEngineConfig.supportedOperators)).required(),
|
|
71680
|
+
value: Joi.any().required()
|
|
71681
|
+
}).description('A filter object to apply to the data set.'), Joi.array()));
|
|
71682
|
+
};
|
|
71683
|
+
var schema = function schema(queryEngineConfig) {
|
|
71684
|
+
return Joi.object(_extends({}, querySchema(queryEngineConfig, {}), {
|
|
71685
|
+
filter: filterSchema$1(queryEngineConfig),
|
|
71686
|
+
timeDimension: Joi.alternatives(timeDimensionSchema(queryEngineConfig.supportedTimeTruncFunctions), Joi.valid(null))
|
|
71687
|
+
}));
|
|
71688
|
+
};
|
|
71689
|
+
|
|
71224
71690
|
var validateDashboardJoiOptions = {
|
|
71225
71691
|
convert: false,
|
|
71226
71692
|
stripUnknown: false,
|
|
@@ -71298,7 +71764,7 @@ var toQueries = function toQueries(dataSets, queryAttributes, queryEngineConfig,
|
|
|
71298
71764
|
var queries = queryAttributes.map(function (qA) {
|
|
71299
71765
|
var dataSet = find(dataSets, qA.dataSetId);
|
|
71300
71766
|
if (!dataSet) throw 'Data set not found for query attributes query';
|
|
71301
|
-
return buildFromQueryAttributes(dataSet, qA.measure, qA.
|
|
71767
|
+
return buildFromQueryAttributes(dataSet, qA.measure, qA.order, qA.dimension, qA.timeDimension, qA.limit, qA.offset, queryEngineConfig, params, qA.filter);
|
|
71302
71768
|
});
|
|
71303
71769
|
return {
|
|
71304
71770
|
queries: queries.map(function (q) {
|
|
@@ -71356,7 +71822,7 @@ function getOptionsOrders(dataSetField) {
|
|
|
71356
71822
|
}
|
|
71357
71823
|
|
|
71358
71824
|
var commonToQueries = function commonToQueries(attributes, dataSet, queryEngineConfig, params) {
|
|
71359
|
-
var _Query$build = build$c(dataSet, attributes.measure, attributes.
|
|
71825
|
+
var _Query$build = build$c(dataSet, attributes.measure, attributes.order, attributes.dimension,
|
|
71360
71826
|
// @ts-ignore
|
|
71361
71827
|
attributes.timeDimension || null, attributes.limit, attributes.offset, queryEngineConfig, params),
|
|
71362
71828
|
query = _Query$build.query,
|
|
@@ -71381,8 +71847,8 @@ var toQueries$6 = commonToQueries;
|
|
|
71381
71847
|
var toQueries$7 = commonToQueries;
|
|
71382
71848
|
|
|
71383
71849
|
var buildMainQueries = function buildMainQueries(attributes, dataSet, queryEngineConfig, params) {
|
|
71384
|
-
var line = build$c(dataSet, attributes.lineMeasure, attributes.
|
|
71385
|
-
var bar = build$c(dataSet, attributes.barMeasure, attributes.
|
|
71850
|
+
var line = build$c(dataSet, attributes.lineMeasure, attributes.order, attributes.lineDimension, attributes.timeDimension, attributes.limit, attributes.offset, queryEngineConfig, params);
|
|
71851
|
+
var bar = build$c(dataSet, attributes.barMeasure, attributes.order, attributes.barDimension, attributes.timeDimension, attributes.limit, attributes.offset, queryEngineConfig, params);
|
|
71386
71852
|
return {
|
|
71387
71853
|
bar: bar,
|
|
71388
71854
|
line: line
|
|
@@ -71409,8 +71875,8 @@ var toQueries$b = commonToQueries;
|
|
|
71409
71875
|
var toQueries$c = commonToQueries;
|
|
71410
71876
|
|
|
71411
71877
|
var buildMainQueries$1 = function buildMainQueries(attributes, dataSet, queryEngineConfig, params) {
|
|
71412
|
-
var line = build$c(dataSet, attributes.lineMeasure, attributes.
|
|
71413
|
-
var bar = build$c(dataSet, attributes.barMeasure, attributes.
|
|
71878
|
+
var line = build$c(dataSet, attributes.lineMeasure, attributes.order, attributes.lineDimension, attributes.timeDimension, attributes.limit, attributes.offset, queryEngineConfig, params);
|
|
71879
|
+
var bar = build$c(dataSet, attributes.barMeasure, attributes.order, attributes.barDimension, attributes.timeDimension, attributes.limit, attributes.offset, queryEngineConfig, params);
|
|
71414
71880
|
return {
|
|
71415
71881
|
bar: bar,
|
|
71416
71882
|
line: line
|
|
@@ -71429,7 +71895,7 @@ var toQueries$d = function toQueries(attributes, dataSet, queryEngineConfig, par
|
|
|
71429
71895
|
};
|
|
71430
71896
|
|
|
71431
71897
|
var buildMainQuery = function buildMainQuery(attributes, dataSet, queryEngineConfig, params) {
|
|
71432
|
-
var _Query$build = build$c(dataSet, attributes.measure,
|
|
71898
|
+
var _Query$build = build$c(dataSet, attributes.measure, [], [], null, 1, attributes.offset, queryEngineConfig, params),
|
|
71433
71899
|
query = _Query$build.query,
|
|
71434
71900
|
measureDescription = _Query$build.measureDescription;
|
|
71435
71901
|
|
|
@@ -71457,7 +71923,7 @@ var buildMainQuery = function buildMainQuery(attributes, dataSet, queryEngineCon
|
|
|
71457
71923
|
};
|
|
71458
71924
|
var buildDeltaQuery = function buildDeltaQuery(dataSet, attributes, queryEngineConfig, params) {
|
|
71459
71925
|
if (!attributes.deltaTimeDimension) return null;
|
|
71460
|
-
return build$c(dataSet, attributes.measure,
|
|
71926
|
+
return build$c(dataSet, attributes.measure, [{
|
|
71461
71927
|
field: attributes.deltaTimeDimension.field,
|
|
71462
71928
|
direction: 'asc',
|
|
71463
71929
|
"function": attributes.deltaTimeDimension.truncate
|
|
@@ -71489,7 +71955,7 @@ var toQueries$f = function toQueries(attributes, dataSet, queryEngineConfig, par
|
|
|
71489
71955
|
var measures = [];
|
|
71490
71956
|
attributes.xMeasure && measures.push(attributes.xMeasure);
|
|
71491
71957
|
attributes.yMeasure && measures.push(attributes.yMeasure);
|
|
71492
|
-
var _Query$build = build$c(dataSet, measures, attributes.
|
|
71958
|
+
var _Query$build = build$c(dataSet, measures, attributes.order, attributes.dimension, attributes.timeDimension, attributes.limit, attributes.offset, queryEngineConfig, params),
|
|
71493
71959
|
query = _Query$build.query,
|
|
71494
71960
|
measureDescription = _Query$build.measureDescription;
|
|
71495
71961
|
var resultFields = toResultFields([measureDescription], queryEngineConfig);
|
|
@@ -71503,7 +71969,7 @@ var toQueries$g = function toQueries(attributes, dataSet, queryEngineConfig, par
|
|
|
71503
71969
|
var measures = [];
|
|
71504
71970
|
attributes.xMeasure && measures.push(attributes.xMeasure);
|
|
71505
71971
|
attributes.yMeasure && measures.push(attributes.yMeasure);
|
|
71506
|
-
var _Query$build = build$c(dataSet, measures, attributes.
|
|
71972
|
+
var _Query$build = build$c(dataSet, measures, attributes.order, attributes.dimension, attributes.timeDimension, attributes.limit, attributes.offset, queryEngineConfig, params),
|
|
71507
71973
|
query = _Query$build.query,
|
|
71508
71974
|
measureDescription = _Query$build.measureDescription;
|
|
71509
71975
|
var resultFields = toResultFields([measureDescription], queryEngineConfig);
|
|
@@ -71515,7 +71981,7 @@ var toQueries$g = function toQueries(attributes, dataSet, queryEngineConfig, par
|
|
|
71515
71981
|
|
|
71516
71982
|
var toQueries$h = function toQueries(attributes, dataSet, queryEngineConfig, params) {
|
|
71517
71983
|
var measures = [].concat(attributes.measure || [], attributes.xMeasure || [], attributes.zMeasure || []);
|
|
71518
|
-
var _Query$build = build$c(dataSet, measures, attributes.
|
|
71984
|
+
var _Query$build = build$c(dataSet, measures, attributes.order, attributes.dimension, attributes.timeDimension, attributes.limit, attributes.offset, queryEngineConfig, params),
|
|
71519
71985
|
query = _Query$build.query,
|
|
71520
71986
|
measureDescription = _Query$build.measureDescription;
|
|
71521
71987
|
var resultFields = toResultFields([measureDescription], queryEngineConfig);
|
|
@@ -71627,7 +72093,20 @@ var buildVizzlyQuery = function buildVizzlyQuery(thing, queryEngineConfig, param
|
|
|
71627
72093
|
queriesToSend = [_query];
|
|
71628
72094
|
resultFields = [_rF];
|
|
71629
72095
|
} else if (Array.isArray(thing)) {
|
|
71630
|
-
var
|
|
72096
|
+
var queriesInAttributesFormat = [].concat(thing).map(function (queryAttributes) {
|
|
72097
|
+
var dataSet = find(params.dataSets, queryAttributes.dataSetId);
|
|
72098
|
+
if (!dataSet) throw 'Data set not found for query-attributes query';
|
|
72099
|
+
return _extends({}, queryAttributes, {
|
|
72100
|
+
// TODO; this means that services queries that povide a query, cannot work... GTDEV-6947
|
|
72101
|
+
filter: [],
|
|
72102
|
+
whereClause: filterConfigToWhere(dataSet, queryEngineConfig, _extends({}, params, {
|
|
72103
|
+
filterConfig: _extends({}, params.filterConfig, {
|
|
72104
|
+
advancedFilter: queryAttributes.filter
|
|
72105
|
+
})
|
|
72106
|
+
}))
|
|
72107
|
+
});
|
|
72108
|
+
});
|
|
72109
|
+
var _fromQueryAttributes = toQueries(params.dataSets, queriesInAttributesFormat, queryEngineConfig, params),
|
|
71631
72110
|
q = _fromQueryAttributes.queries,
|
|
71632
72111
|
_rF2 = _fromQueryAttributes.resultFields;
|
|
71633
72112
|
queriesToSend = q;
|
|
@@ -71639,7 +72118,7 @@ var buildVizzlyQuery = function buildVizzlyQuery(thing, queryEngineConfig, param
|
|
|
71639
72118
|
if (!_dataSet) throw 'Data set not found for view attributes query';
|
|
71640
72119
|
var _buildVizzlyViewQueri = buildVizzlyViewQueries(thing, _dataSet, queryEngineConfig, _extends({}, params, {
|
|
71641
72120
|
filterConfig: _extends({}, params.filterConfig, {
|
|
71642
|
-
|
|
72121
|
+
advancedFilter: thing.filter
|
|
71643
72122
|
})
|
|
71644
72123
|
})),
|
|
71645
72124
|
_q = _buildVizzlyViewQueri.queries,
|
|
@@ -71676,7 +72155,7 @@ var set = function set(cacheKey, item, expiryInSeconds) {
|
|
|
71676
72155
|
var key = JSON.stringify(cacheKey);
|
|
71677
72156
|
var expires = new Date();
|
|
71678
72157
|
expires.setSeconds(expires.getSeconds() + expiryInSeconds);
|
|
71679
|
-
logDebug(
|
|
72158
|
+
logDebug("Browser cache new object set.", key);
|
|
71680
72159
|
cache$1[key] = {
|
|
71681
72160
|
item: item,
|
|
71682
72161
|
expires: expires
|
|
@@ -71686,10 +72165,10 @@ var get = function get(cacheKey) {
|
|
|
71686
72165
|
var key = JSON.stringify(cacheKey);
|
|
71687
72166
|
var retrieved = cache$1[key];
|
|
71688
72167
|
if (!retrieved) {
|
|
71689
|
-
logDebug(
|
|
72168
|
+
logDebug("Browser cache miss.", cacheKey);
|
|
71690
72169
|
return null;
|
|
71691
72170
|
}
|
|
71692
|
-
logDebug(
|
|
72171
|
+
logDebug("Browser cache hit.", cacheKey);
|
|
71693
72172
|
var item = retrieved.item,
|
|
71694
72173
|
expires = retrieved.expires;
|
|
71695
72174
|
var now = new Date();
|
|
@@ -71701,7 +72180,7 @@ var get = function get(cacheKey) {
|
|
|
71701
72180
|
return null;
|
|
71702
72181
|
};
|
|
71703
72182
|
var clear$1 = function clear() {
|
|
71704
|
-
logDebug(
|
|
72183
|
+
logDebug("Browser cache cleared.");
|
|
71705
72184
|
cache$1 = {};
|
|
71706
72185
|
};
|
|
71707
72186
|
|
|
@@ -72865,6 +73344,7 @@ var VizzlyServices = /*#__PURE__*/function () {
|
|
|
72865
73344
|
instanceId = params.instanceId;
|
|
72866
73345
|
}
|
|
72867
73346
|
service = VizzlyServices._instanceStore[instanceId];
|
|
73347
|
+
validateQuery(queries, service.queryEngineConfig);
|
|
72868
73348
|
queryEngineEndpoint = function () {
|
|
72869
73349
|
if (params != null && params.queryEngineEndpoint) {
|
|
72870
73350
|
return params.queryEngineEndpoint;
|
|
@@ -72910,14 +73390,14 @@ var VizzlyServices = /*#__PURE__*/function () {
|
|
|
72910
73390
|
return _ref.apply(this, arguments);
|
|
72911
73391
|
};
|
|
72912
73392
|
}();
|
|
72913
|
-
_context11.next =
|
|
73393
|
+
_context11.next = 10;
|
|
72914
73394
|
return fetch();
|
|
72915
|
-
case
|
|
73395
|
+
case 10:
|
|
72916
73396
|
_context11.t0 = _context11.sent;
|
|
72917
73397
|
return _context11.abrupt("return", {
|
|
72918
73398
|
results: _context11.t0
|
|
72919
73399
|
});
|
|
72920
|
-
case
|
|
73400
|
+
case 12:
|
|
72921
73401
|
case "end":
|
|
72922
73402
|
return _context11.stop();
|
|
72923
73403
|
}
|
|
@@ -73143,7 +73623,7 @@ VizzlyServices.HorizontalBarChart = HorizontalBarChart$2;
|
|
|
73143
73623
|
VizzlyServices.MercatorMap = MercatorMap$4;
|
|
73144
73624
|
VizzlyServices.SingleStat = SingleStat$3;
|
|
73145
73625
|
VizzlyServices.Progress = Progress$3;
|
|
73146
|
-
VizzlyServices.WaterfallChart = WaterfallChart$4;
|
|
73626
|
+
VizzlyServices.WaterfallChart = WaterfallChart$4;
|
|
73147
73627
|
// @ts-ignore
|
|
73148
73628
|
if (typeof window !== 'undefined' && !window.Vizzly) {
|
|
73149
73629
|
// @ts-ignore
|
|
@@ -75997,7 +76477,7 @@ var GlobalProviderContents = function GlobalProviderContents(props) {
|
|
|
75997
76477
|
});
|
|
75998
76478
|
};
|
|
75999
76479
|
|
|
76000
|
-
var _excluded$
|
|
76480
|
+
var _excluded$i = ["view"];
|
|
76001
76481
|
var Dashboard$2 = function Dashboard(props) {
|
|
76002
76482
|
var handleOnError = function handleOnError(error, errorInfo) {
|
|
76003
76483
|
return (props == null ? void 0 : props.onError) && (props == null ? void 0 : props.onError(error, errorInfo));
|
|
@@ -76018,7 +76498,7 @@ var Editor$1 = function Editor(props) {
|
|
|
76018
76498
|
var handleOnError = function handleOnError(error, errorInfo) {
|
|
76019
76499
|
return (props == null ? void 0 : props.onError) && (props == null ? void 0 : props.onError(error, errorInfo));
|
|
76020
76500
|
};
|
|
76021
|
-
var resetProps = _objectWithoutPropertiesLoose(props, _excluded$
|
|
76501
|
+
var resetProps = _objectWithoutPropertiesLoose(props, _excluded$i);
|
|
76022
76502
|
return jsxs(ErrorBoundary, {
|
|
76023
76503
|
renderOnError: function renderOnError() {
|
|
76024
76504
|
return jsx("p", {
|