@hisptz/dhis2-analytics 1.0.47 → 1.0.48
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.
|
@@ -27,8 +27,8 @@ class DHIS2Chart {
|
|
|
27
27
|
};
|
|
28
28
|
}
|
|
29
29
|
getOptions() {
|
|
30
|
-
var _this$config$colors, _this$config2, _this$
|
|
31
|
-
|
|
30
|
+
var _this$config$colors, _this$config2, _this$config3;
|
|
31
|
+
const options = {
|
|
32
32
|
yAxis: this.getYAxis(),
|
|
33
33
|
chart: this.getChartConfig(),
|
|
34
34
|
colors: (_this$config$colors = (_this$config2 = this.config) === null || _this$config2 === void 0 ? void 0 : _this$config2.colors) !== null && _this$config$colors !== void 0 ? _this$config$colors : ["#2f7ed8", "#0d233a", "#8bbc21", "#910000", "#1aadce", "#492970", "#f28f43", "#77a1e5", "#c42525", "#a6c96a"],
|
|
@@ -44,8 +44,18 @@ class DHIS2Chart {
|
|
|
44
44
|
},
|
|
45
45
|
credits: {
|
|
46
46
|
enabled: false
|
|
47
|
-
}
|
|
48
|
-
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
let overrides = {};
|
|
50
|
+
if ((_this$config3 = this.config) !== null && _this$config3 !== void 0 && _this$config3.highChartOverrides) {
|
|
51
|
+
var _this$config4, _this$config$highChar, _this$config5, _this$config6;
|
|
52
|
+
overrides = {
|
|
53
|
+
...(typeof ((_this$config4 = this.config) === null || _this$config4 === void 0 ? void 0 : _this$config4.highChartOverrides) === "object" ? (_this$config$highChar = (_this$config5 = this.config) === null || _this$config5 === void 0 ? void 0 : _this$config5.highChartOverrides) !== null && _this$config$highChar !== void 0 ? _this$config$highChar : {} : (_this$config6 = this.config) === null || _this$config6 === void 0 ? void 0 : _this$config6.highChartOverrides(options))
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
return {
|
|
57
|
+
...options,
|
|
58
|
+
...overrides
|
|
49
59
|
};
|
|
50
60
|
}
|
|
51
61
|
getYAxis() {
|
|
@@ -86,8 +96,8 @@ class DHIS2Chart {
|
|
|
86
96
|
}];
|
|
87
97
|
}
|
|
88
98
|
getExporting() {
|
|
89
|
-
var _this$config$name, _this$
|
|
90
|
-
const name = (_this$config$name = (_this$
|
|
99
|
+
var _this$config$name, _this$config7;
|
|
100
|
+
const name = (_this$config$name = (_this$config7 = this.config) === null || _this$config7 === void 0 ? void 0 : _this$config7.name) !== null && _this$config$name !== void 0 ? _this$config$name : "chart";
|
|
91
101
|
return {
|
|
92
102
|
filename: `${name}`,
|
|
93
103
|
sourceWidth: 1200,
|
|
@@ -21,8 +21,8 @@ export class DHIS2Chart {
|
|
|
21
21
|
};
|
|
22
22
|
}
|
|
23
23
|
getOptions() {
|
|
24
|
-
var _this$config$colors, _this$config2, _this$
|
|
25
|
-
|
|
24
|
+
var _this$config$colors, _this$config2, _this$config3;
|
|
25
|
+
const options = {
|
|
26
26
|
yAxis: this.getYAxis(),
|
|
27
27
|
chart: this.getChartConfig(),
|
|
28
28
|
colors: (_this$config$colors = (_this$config2 = this.config) === null || _this$config2 === void 0 ? void 0 : _this$config2.colors) !== null && _this$config$colors !== void 0 ? _this$config$colors : ["#2f7ed8", "#0d233a", "#8bbc21", "#910000", "#1aadce", "#492970", "#f28f43", "#77a1e5", "#c42525", "#a6c96a"],
|
|
@@ -38,8 +38,18 @@ export class DHIS2Chart {
|
|
|
38
38
|
},
|
|
39
39
|
credits: {
|
|
40
40
|
enabled: false
|
|
41
|
-
}
|
|
42
|
-
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
let overrides = {};
|
|
44
|
+
if ((_this$config3 = this.config) !== null && _this$config3 !== void 0 && _this$config3.highChartOverrides) {
|
|
45
|
+
var _this$config4, _this$config$highChar, _this$config5, _this$config6;
|
|
46
|
+
overrides = {
|
|
47
|
+
...(typeof ((_this$config4 = this.config) === null || _this$config4 === void 0 ? void 0 : _this$config4.highChartOverrides) === "object" ? (_this$config$highChar = (_this$config5 = this.config) === null || _this$config5 === void 0 ? void 0 : _this$config5.highChartOverrides) !== null && _this$config$highChar !== void 0 ? _this$config$highChar : {} : (_this$config6 = this.config) === null || _this$config6 === void 0 ? void 0 : _this$config6.highChartOverrides(options))
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
return {
|
|
51
|
+
...options,
|
|
52
|
+
...overrides
|
|
43
53
|
};
|
|
44
54
|
}
|
|
45
55
|
getYAxis() {
|
|
@@ -80,8 +90,8 @@ export class DHIS2Chart {
|
|
|
80
90
|
}];
|
|
81
91
|
}
|
|
82
92
|
getExporting() {
|
|
83
|
-
var _this$config$name, _this$
|
|
84
|
-
const name = (_this$config$name = (_this$
|
|
93
|
+
var _this$config$name, _this$config7;
|
|
94
|
+
const name = (_this$config$name = (_this$config7 = this.config) === null || _this$config7 === void 0 ? void 0 : _this$config7.name) !== null && _this$config$name !== void 0 ? _this$config$name : "chart";
|
|
85
95
|
return {
|
|
86
96
|
filename: `${name}`,
|
|
87
97
|
sourceWidth: 1200,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Analytics } from "@hisptz/dhis2-utils";
|
|
2
|
-
import { DashStyleValue, YAxisOptions, YAxisPlotLinesLabelOptions } from "highcharts";
|
|
2
|
+
import HighCharts, { DashStyleValue, YAxisOptions, YAxisPlotLinesLabelOptions } from "highcharts";
|
|
3
3
|
export type ChartType = "column" | "pie" | "stacked-column" | "line" | "multi-series";
|
|
4
4
|
export interface MultiSeriesConfig {
|
|
5
5
|
series?: Array<{
|
|
@@ -33,7 +33,7 @@ export type ChartConfig = {
|
|
|
33
33
|
colors?: Array<string>;
|
|
34
34
|
name?: string;
|
|
35
35
|
allowChartTypeChange?: boolean;
|
|
36
|
-
highChartOverrides?:
|
|
36
|
+
highChartOverrides?: Partial<HighCharts.Options> | ((config: HighCharts.Options) => Partial<HighCharts.Options>);
|
|
37
37
|
multiSeries?: MultiSeriesConfig;
|
|
38
38
|
};
|
|
39
39
|
export type ChartAnalyticsProps = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hisptz/dhis2-analytics",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.48",
|
|
4
4
|
"description": "A collection of reusable react components for visualizing analytics data from DHIS2",
|
|
5
5
|
"license": "BSD-3-Clause",
|
|
6
6
|
"scripts": {
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@dhis2/app-runtime": "^3.7.0",
|
|
34
|
-
"@hisptz/dhis2-ui": "^1.0.
|
|
34
|
+
"@hisptz/dhis2-ui": "^1.0.48",
|
|
35
35
|
"@hisptz/dhis2-utils": "*",
|
|
36
36
|
"@react-leaflet/core": "^2.1.0",
|
|
37
37
|
"async-es": "^3.2.4",
|
|
@@ -87,5 +87,5 @@
|
|
|
87
87
|
"react-hook-form": "^7.43",
|
|
88
88
|
"recoil": "*"
|
|
89
89
|
},
|
|
90
|
-
"gitHead": "
|
|
90
|
+
"gitHead": "5dddaf337ef5f206f9bf156b587f8357b80b2196"
|
|
91
91
|
}
|