@dhis2/analytics 26.0.19 → 26.0.21
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/build/cjs/components/FileMenu/utils.js +13 -2
- package/build/cjs/index.js +8 -0
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/chart.js +1 -1
- package/build/cjs/visualizations/config/generators/highcharts/index.js +5 -4
- package/build/es/components/FileMenu/utils.js +10 -0
- package/build/es/index.js +1 -0
- package/build/es/visualizations/config/adapters/dhis_highcharts/chart.js +1 -1
- package/build/es/visualizations/config/generators/highcharts/index.js +5 -4
- package/package.json +1 -1
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.supportedFileTypes = exports.labelForFileType = exports.endpointFromFileType = exports.appPathFor = exports.FILE_TYPE_VISUALIZATION = exports.FILE_TYPE_MAP = exports.FILE_TYPE_EVENT_VISUALIZATION = exports.FILE_TYPE_EVENT_REPORT = void 0;
|
|
6
|
+
exports.supportedFileTypes = exports.preparePayloadForSaveAs = exports.labelForFileType = exports.endpointFromFileType = exports.appPathFor = exports.FILE_TYPE_VISUALIZATION = exports.FILE_TYPE_MAP = exports.FILE_TYPE_EVENT_VISUALIZATION = exports.FILE_TYPE_EVENT_REPORT = void 0;
|
|
7
7
|
var _d2I18n = _interopRequireDefault(require("@dhis2/d2-i18n"));
|
|
8
8
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
9
9
|
const FILE_TYPE_EVENT_REPORT = 'eventReport';
|
|
@@ -43,4 +43,15 @@ const appPathFor = (fileType, id) => {
|
|
|
43
43
|
return `${window.location.search}${window.location.hash}`;
|
|
44
44
|
}
|
|
45
45
|
};
|
|
46
|
-
exports.appPathFor = appPathFor;
|
|
46
|
+
exports.appPathFor = appPathFor;
|
|
47
|
+
const preparePayloadForSaveAs = _ref => {
|
|
48
|
+
let {
|
|
49
|
+
...visualization
|
|
50
|
+
} = _ref;
|
|
51
|
+
delete visualization.id;
|
|
52
|
+
delete visualization.created;
|
|
53
|
+
delete visualization.createdBy;
|
|
54
|
+
delete visualization.user;
|
|
55
|
+
return visualization;
|
|
56
|
+
};
|
|
57
|
+
exports.preparePayloadForSaveAs = preparePayloadForSaveAs;
|
package/build/cjs/index.js
CHANGED
|
@@ -16,6 +16,7 @@ var _exportNames = {
|
|
|
16
16
|
DimensionMenu: true,
|
|
17
17
|
PivotTable: true,
|
|
18
18
|
FileMenu: true,
|
|
19
|
+
preparePayloadForSaveAs: true,
|
|
19
20
|
VisTypeIcon: true,
|
|
20
21
|
LegendKey: true,
|
|
21
22
|
AboutAOUnit: true,
|
|
@@ -1681,6 +1682,12 @@ Object.defineProperty(exports, "ouIdHelper", {
|
|
|
1681
1682
|
return _index4.ouIdHelper;
|
|
1682
1683
|
}
|
|
1683
1684
|
});
|
|
1685
|
+
Object.defineProperty(exports, "preparePayloadForSaveAs", {
|
|
1686
|
+
enumerable: true,
|
|
1687
|
+
get: function () {
|
|
1688
|
+
return _utils.preparePayloadForSaveAs;
|
|
1689
|
+
}
|
|
1690
|
+
});
|
|
1684
1691
|
Object.defineProperty(exports, "useCachedDataQuery", {
|
|
1685
1692
|
enumerable: true,
|
|
1686
1693
|
get: function () {
|
|
@@ -1711,6 +1718,7 @@ var _Filter = _interopRequireDefault(require("./components/Filter/Filter.js"));
|
|
|
1711
1718
|
var _DimensionMenu = _interopRequireDefault(require("./components/DimensionMenu.js"));
|
|
1712
1719
|
var _PivotTable = _interopRequireDefault(require("./components/PivotTable/PivotTable.js"));
|
|
1713
1720
|
var _FileMenu = _interopRequireDefault(require("./components/FileMenu/FileMenu.js"));
|
|
1721
|
+
var _utils = require("./components/FileMenu/utils.js");
|
|
1714
1722
|
var _VisTypeIcon = _interopRequireDefault(require("./components/VisTypeIcon.js"));
|
|
1715
1723
|
var _LegendKey = _interopRequireDefault(require("./components/LegendKey/LegendKey.js"));
|
|
1716
1724
|
var _AboutAOUnit = _interopRequireDefault(require("./components/AboutAOUnit/AboutAOUnit.js"));
|
|
@@ -25,7 +25,7 @@ const getEvents = () => ({
|
|
|
25
25
|
this.legend.allItems.forEach(item => {
|
|
26
26
|
if (item.legendSymbol) {
|
|
27
27
|
item.legendSymbol.attr({
|
|
28
|
-
translateY: -(item.legendItem.getBBox().height * 0.75 / 4) + item.legendSymbol.r / 2
|
|
28
|
+
translateY: -(item.legendItem.label.getBBox().height * 0.75 / 4) + item.legendSymbol.r / 2
|
|
29
29
|
});
|
|
30
30
|
}
|
|
31
31
|
});
|
|
@@ -23,6 +23,7 @@ function drawLegendSymbolWrap() {
|
|
|
23
23
|
const pick = _highcharts.default.pick;
|
|
24
24
|
_highcharts.default.wrap(_highcharts.default.seriesTypes.column.prototype, 'drawLegendSymbol', function (proceed, legend, item) {
|
|
25
25
|
var _this$options$legendS, _this$options$legendS2;
|
|
26
|
+
const legendItem = item.legendItem;
|
|
26
27
|
if ((_this$options$legendS = this.options.legendSet) !== null && _this$options$legendS !== void 0 && (_this$options$legendS2 = _this$options$legendS.legends) !== null && _this$options$legendS2 !== void 0 && _this$options$legendS2.length) {
|
|
27
28
|
const ys = legend.baseline - legend.symbolHeight + 1,
|
|
28
29
|
// y start
|
|
@@ -32,18 +33,18 @@ function drawLegendSymbolWrap() {
|
|
|
32
33
|
const legends = this.options.legendSet.legends.sort((a, b) => a.startValue - b.startValue);
|
|
33
34
|
this.chart.renderer.path(['M', x, ys, 'A', 1, 1, 0, 0, 0, x, ye, 'V', ys]).attr({
|
|
34
35
|
fill: legends[legends.length >= 5 ? 1 : 0].color
|
|
35
|
-
}).add(
|
|
36
|
+
}).add(legendItem.group);
|
|
36
37
|
this.chart.renderer.path(['M', x, ye, 'A', 1, 1, 0, 0, 0, x, ys, 'V', ye]).attr({
|
|
37
38
|
fill: legends[legends.length >= 5 ? legends.length - 2 : legends.length - 1].color
|
|
38
|
-
}).add(
|
|
39
|
+
}).add(legendItem.group);
|
|
39
40
|
} else {
|
|
40
41
|
var options = legend.options,
|
|
41
42
|
symbolHeight = legend.symbolHeight,
|
|
42
43
|
square = options.squareSymbol,
|
|
43
44
|
symbolWidth = square ? symbolHeight : legend.symbolWidth;
|
|
44
|
-
|
|
45
|
+
legendItem.symbol = this.chart.renderer.rect(square ? (legend.symbolWidth - symbolHeight) / 2 : 0, legend.baseline - symbolHeight + 1, symbolWidth, symbolHeight, pick(legend.options.symbolRadius, symbolHeight / 2)).addClass('highcharts-point').attr({
|
|
45
46
|
zIndex: 3
|
|
46
|
-
}).add(
|
|
47
|
+
}).add(legendItem.group);
|
|
47
48
|
}
|
|
48
49
|
});
|
|
49
50
|
}
|
|
@@ -28,4 +28,14 @@ export const appPathFor = (fileType, id) => {
|
|
|
28
28
|
default:
|
|
29
29
|
return `${window.location.search}${window.location.hash}`;
|
|
30
30
|
}
|
|
31
|
+
};
|
|
32
|
+
export const preparePayloadForSaveAs = _ref => {
|
|
33
|
+
let {
|
|
34
|
+
...visualization
|
|
35
|
+
} = _ref;
|
|
36
|
+
delete visualization.id;
|
|
37
|
+
delete visualization.created;
|
|
38
|
+
delete visualization.createdBy;
|
|
39
|
+
delete visualization.user;
|
|
40
|
+
return visualization;
|
|
31
41
|
};
|
package/build/es/index.js
CHANGED
|
@@ -12,6 +12,7 @@ export { default as DimensionFilter } from './components/Filter/Filter.js';
|
|
|
12
12
|
export { default as DimensionMenu } from './components/DimensionMenu.js';
|
|
13
13
|
export { default as PivotTable } from './components/PivotTable/PivotTable.js';
|
|
14
14
|
export { default as FileMenu } from './components/FileMenu/FileMenu.js';
|
|
15
|
+
export { preparePayloadForSaveAs } from './components/FileMenu/utils.js';
|
|
15
16
|
export { default as VisTypeIcon } from './components/VisTypeIcon.js';
|
|
16
17
|
export { default as LegendKey } from './components/LegendKey/LegendKey.js';
|
|
17
18
|
export { default as AboutAOUnit } from './components/AboutAOUnit/AboutAOUnit.js';
|
|
@@ -18,7 +18,7 @@ const getEvents = () => ({
|
|
|
18
18
|
this.legend.allItems.forEach(item => {
|
|
19
19
|
if (item.legendSymbol) {
|
|
20
20
|
item.legendSymbol.attr({
|
|
21
|
-
translateY: -(item.legendItem.getBBox().height * 0.75 / 4) + item.legendSymbol.r / 2
|
|
21
|
+
translateY: -(item.legendItem.label.getBBox().height * 0.75 / 4) + item.legendSymbol.r / 2
|
|
22
22
|
});
|
|
23
23
|
}
|
|
24
24
|
});
|
|
@@ -17,6 +17,7 @@ function drawLegendSymbolWrap() {
|
|
|
17
17
|
const pick = H.pick;
|
|
18
18
|
H.wrap(H.seriesTypes.column.prototype, 'drawLegendSymbol', function (proceed, legend, item) {
|
|
19
19
|
var _this$options$legendS, _this$options$legendS2;
|
|
20
|
+
const legendItem = item.legendItem;
|
|
20
21
|
if ((_this$options$legendS = this.options.legendSet) !== null && _this$options$legendS !== void 0 && (_this$options$legendS2 = _this$options$legendS.legends) !== null && _this$options$legendS2 !== void 0 && _this$options$legendS2.length) {
|
|
21
22
|
const ys = legend.baseline - legend.symbolHeight + 1,
|
|
22
23
|
// y start
|
|
@@ -26,18 +27,18 @@ function drawLegendSymbolWrap() {
|
|
|
26
27
|
const legends = this.options.legendSet.legends.sort((a, b) => a.startValue - b.startValue);
|
|
27
28
|
this.chart.renderer.path(['M', x, ys, 'A', 1, 1, 0, 0, 0, x, ye, 'V', ys]).attr({
|
|
28
29
|
fill: legends[legends.length >= 5 ? 1 : 0].color
|
|
29
|
-
}).add(
|
|
30
|
+
}).add(legendItem.group);
|
|
30
31
|
this.chart.renderer.path(['M', x, ye, 'A', 1, 1, 0, 0, 0, x, ys, 'V', ye]).attr({
|
|
31
32
|
fill: legends[legends.length >= 5 ? legends.length - 2 : legends.length - 1].color
|
|
32
|
-
}).add(
|
|
33
|
+
}).add(legendItem.group);
|
|
33
34
|
} else {
|
|
34
35
|
var options = legend.options,
|
|
35
36
|
symbolHeight = legend.symbolHeight,
|
|
36
37
|
square = options.squareSymbol,
|
|
37
38
|
symbolWidth = square ? symbolHeight : legend.symbolWidth;
|
|
38
|
-
|
|
39
|
+
legendItem.symbol = this.chart.renderer.rect(square ? (legend.symbolWidth - symbolHeight) / 2 : 0, legend.baseline - symbolHeight + 1, symbolWidth, symbolHeight, pick(legend.options.symbolRadius, symbolHeight / 2)).addClass('highcharts-point').attr({
|
|
39
40
|
zIndex: 3
|
|
40
|
-
}).add(
|
|
41
|
+
}).add(legendItem.group);
|
|
41
42
|
}
|
|
42
43
|
});
|
|
43
44
|
}
|