@hisptz/dhis2-analytics 1.0.10 → 1.0.11
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/ChartAnalytics/ChartAnalytics.stories.js +1 -1
- package/build/cjs/components/CircularProgressDashboard/CircularProgressIndicator.stories.js +1 -1
- package/build/cjs/components/Map/Map.stories.js +1 -1
- package/build/cjs/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfigModal.stories.js +1 -1
- package/build/cjs/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfiguration.stories.js +1 -1
- package/build/cjs/components/Map/components/MapProvider/components/MapLayerProvider/hooks/index.js +8 -1
- package/build/cjs/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfigModal.stories.js +1 -1
- package/build/cjs/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfiguration.stories.js +1 -1
- package/build/cjs/components/PivotTable/PivotTable.stories.js +277 -0
- package/build/cjs/components/PivotTable/components/AssignedCategoriesIcon/index.js +32 -0
- package/build/cjs/components/PivotTable/components/PivotTable.js +60 -0
- package/build/cjs/components/PivotTable/components/PivotTableBody.js +41 -0
- package/build/cjs/components/PivotTable/components/PivotTableCell.js +40 -0
- package/build/cjs/components/PivotTable/components/PivotTableClippedAxis.js +26 -0
- package/build/cjs/components/PivotTable/components/PivotTableColumnHeaderCell.js +71 -0
- package/build/cjs/components/PivotTable/components/PivotTableColumnHeaders.js +60 -0
- package/build/cjs/components/PivotTable/components/PivotTableContainer.js +33 -0
- package/build/cjs/components/PivotTable/components/PivotTableDimensionLabelCell.js +77 -0
- package/build/cjs/components/PivotTable/components/PivotTableEmptyCell.js +22 -0
- package/build/cjs/components/PivotTable/components/PivotTableEmptyRow.js +33 -0
- package/build/cjs/components/PivotTable/components/PivotTableEngineContext.js +25 -0
- package/build/cjs/components/PivotTable/components/PivotTableHead.js +35 -0
- package/build/cjs/components/PivotTable/components/PivotTableHeaderCell.js +37 -0
- package/build/cjs/components/PivotTable/components/PivotTableRow.js +65 -0
- package/build/cjs/components/PivotTable/components/PivotTableRowHeaderCell.js +49 -0
- package/build/cjs/components/PivotTable/components/PivotTableTitleRow.js +52 -0
- package/build/cjs/components/PivotTable/components/PivotTableTitleRows.js +46 -0
- package/build/cjs/components/PivotTable/components/PivotTableValueCell.js +69 -0
- package/build/cjs/components/PivotTable/constants/dataTypes.js +129 -0
- package/build/cjs/components/PivotTable/constants/pivotTable.js +64 -0
- package/build/cjs/components/PivotTable/constants/predefinedDimensions.js +62 -0
- package/build/cjs/components/PivotTable/constants/valueTypes.js +55 -0
- package/build/cjs/components/PivotTable/data/column-data.json +210 -0
- package/build/cjs/components/PivotTable/hooks/useParentSize.js +41 -0
- package/build/cjs/components/PivotTable/hooks/useScrollPosition.js +38 -0
- package/build/cjs/components/PivotTable/hooks/useSortableColumns.js +34 -0
- package/build/cjs/components/PivotTable/hooks/useTableClipping.js +53 -0
- package/build/cjs/components/PivotTable/index.js +47 -0
- package/build/cjs/components/PivotTable/interfaces/index.js +1 -0
- package/build/cjs/components/PivotTable/services/adaptiveClippingController.js +197 -0
- package/build/cjs/components/PivotTable/services/engine.js +901 -0
- package/build/cjs/components/PivotTable/utils/getOuLevelAndGroupText.js +71 -0
- package/build/cjs/components/PivotTable/utils/index.js +322 -0
- package/build/cjs/components/PivotTable/utils/isColorBright.js +29 -0
- package/build/cjs/components/PivotTable/utils/layout/dimension.js +61 -0
- package/build/cjs/components/PivotTable/utils/layout/dimensionGetId.js +12 -0
- package/build/cjs/components/PivotTable/utils/layout/dimensionGetItems.js +12 -0
- package/build/cjs/components/PivotTable/utils/layout/dimensionIs.js +9 -0
- package/build/cjs/components/PivotTable/utils/layout/dimensionIsEmpty.js +9 -0
- package/build/cjs/components/PivotTable/utils/layout/dimensionIsValid.js +25 -0
- package/build/cjs/components/PivotTable/utils/legend.js +40 -0
- package/build/cjs/components/PivotTable/utils/ouIdHelper/index.js +27 -0
- package/build/cjs/components/SingleValueContainer/SingleValueContainer.stories.js +1 -1
- package/build/cjs/index.js +11 -0
- package/build/cjs/locales/en/translations.json +33 -0
- package/build/es/components/ChartAnalytics/ChartAnalytics.stories.js +1 -1
- package/build/es/components/CircularProgressDashboard/CircularProgressIndicator.stories.js +1 -1
- package/build/es/components/Map/Map.stories.js +1 -1
- package/build/es/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfigModal.stories.js +1 -1
- package/build/es/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfiguration.stories.js +1 -1
- package/build/es/components/Map/components/MapProvider/components/MapLayerProvider/hooks/index.js +8 -1
- package/build/es/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfigModal.stories.js +1 -1
- package/build/es/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfiguration.stories.js +1 -1
- package/build/es/components/PivotTable/PivotTable.stories.js +268 -0
- package/build/es/components/PivotTable/components/AssignedCategoriesIcon/index.js +24 -0
- package/build/es/components/PivotTable/components/PivotTable.js +51 -0
- package/build/es/components/PivotTable/components/PivotTableBody.js +33 -0
- package/build/es/components/PivotTable/components/PivotTableCell.js +32 -0
- package/build/es/components/PivotTable/components/PivotTableClippedAxis.js +18 -0
- package/build/es/components/PivotTable/components/PivotTableColumnHeaderCell.js +62 -0
- package/build/es/components/PivotTable/components/PivotTableColumnHeaders.js +52 -0
- package/build/es/components/PivotTable/components/PivotTableContainer.js +25 -0
- package/build/es/components/PivotTable/components/PivotTableDimensionLabelCell.js +68 -0
- package/build/es/components/PivotTable/components/PivotTableEmptyCell.js +14 -0
- package/build/es/components/PivotTable/components/PivotTableEmptyRow.js +25 -0
- package/build/es/components/PivotTable/components/PivotTableEngineContext.js +14 -0
- package/build/es/components/PivotTable/components/PivotTableHead.js +27 -0
- package/build/es/components/PivotTable/components/PivotTableHeaderCell.js +29 -0
- package/build/es/components/PivotTable/components/PivotTableRow.js +57 -0
- package/build/es/components/PivotTable/components/PivotTableRowHeaderCell.js +41 -0
- package/build/es/components/PivotTable/components/PivotTableTitleRow.js +42 -0
- package/build/es/components/PivotTable/components/PivotTableTitleRows.js +37 -0
- package/build/es/components/PivotTable/components/PivotTableValueCell.js +60 -0
- package/build/es/components/PivotTable/constants/dataTypes.js +98 -0
- package/build/es/components/PivotTable/constants/pivotTable.js +29 -0
- package/build/es/components/PivotTable/constants/predefinedDimensions.js +44 -0
- package/build/es/components/PivotTable/constants/valueTypes.js +27 -0
- package/build/es/components/PivotTable/data/column-data.json +210 -0
- package/build/es/components/PivotTable/hooks/useParentSize.js +33 -0
- package/build/es/components/PivotTable/hooks/useScrollPosition.js +30 -0
- package/build/es/components/PivotTable/hooks/useSortableColumns.js +27 -0
- package/build/es/components/PivotTable/hooks/useTableClipping.js +46 -0
- package/build/es/components/PivotTable/index.js +26 -0
- package/build/es/components/PivotTable/interfaces/index.js +1 -0
- package/build/es/components/PivotTable/services/adaptiveClippingController.js +191 -0
- package/build/es/components/PivotTable/services/engine.js +894 -0
- package/build/es/components/PivotTable/utils/getOuLevelAndGroupText.js +63 -0
- package/build/es/components/PivotTable/utils/index.js +309 -0
- package/build/es/components/PivotTable/utils/isColorBright.js +22 -0
- package/build/es/components/PivotTable/utils/layout/dimension.js +48 -0
- package/build/es/components/PivotTable/utils/layout/dimensionGetId.js +5 -0
- package/build/es/components/PivotTable/utils/layout/dimensionGetItems.js +5 -0
- package/build/es/components/PivotTable/utils/layout/dimensionIs.js +2 -0
- package/build/es/components/PivotTable/utils/layout/dimensionIsEmpty.js +2 -0
- package/build/es/components/PivotTable/utils/layout/dimensionIsValid.js +18 -0
- package/build/es/components/PivotTable/utils/legend.js +27 -0
- package/build/es/components/PivotTable/utils/ouIdHelper/index.js +17 -0
- package/build/es/components/SingleValueContainer/SingleValueContainer.stories.js +1 -1
- package/build/es/index.js +1 -0
- package/build/es/locales/en/translations.json +33 -0
- package/build/types/components/PivotTable/components/AssignedCategoriesIcon/index.d.ts +3 -0
- package/build/types/components/PivotTable/components/PivotTable.d.ts +12 -0
- package/build/types/components/PivotTable/components/PivotTableBody.d.ts +7 -0
- package/build/types/components/PivotTable/components/PivotTableCell.d.ts +17 -0
- package/build/types/components/PivotTable/components/PivotTableClippedAxis.d.ts +7 -0
- package/build/types/components/PivotTable/components/PivotTableColumnHeaderCell.d.ts +13 -0
- package/build/types/components/PivotTable/components/PivotTableColumnHeaders.d.ts +11 -0
- package/build/types/components/PivotTable/components/PivotTableContainer.d.ts +8 -0
- package/build/types/components/PivotTable/components/PivotTableDimensionLabelCell.d.ts +13 -0
- package/build/types/components/PivotTable/components/PivotTableEmptyCell.d.ts +7 -0
- package/build/types/components/PivotTable/components/PivotTableEmptyRow.d.ts +5 -0
- package/build/types/components/PivotTable/components/PivotTableEngineContext.d.ts +8 -0
- package/build/types/components/PivotTable/components/PivotTableHead.d.ts +21 -0
- package/build/types/components/PivotTable/components/PivotTableHeaderCell.d.ts +22 -0
- package/build/types/components/PivotTable/components/PivotTableRow.d.ts +19 -0
- package/build/types/components/PivotTable/components/PivotTableRowHeaderCell.d.ts +8 -0
- package/build/types/components/PivotTable/components/PivotTableTitleRow.d.ts +21 -0
- package/build/types/components/PivotTable/components/PivotTableTitleRows.d.ts +12 -0
- package/build/types/components/PivotTable/components/PivotTableValueCell.d.ts +8 -0
- package/build/types/components/PivotTable/constants/dataTypes.d.ts +90 -0
- package/build/types/components/PivotTable/constants/pivotTable.d.ts +29 -0
- package/build/types/components/PivotTable/constants/predefinedDimensions.d.ts +80 -0
- package/build/types/components/PivotTable/constants/valueTypes.d.ts +22 -0
- package/build/types/components/PivotTable/hooks/useParentSize.d.ts +8 -0
- package/build/types/components/PivotTable/hooks/useScrollPosition.d.ts +5 -0
- package/build/types/components/PivotTable/hooks/useSortableColumns.d.ts +8 -0
- package/build/types/components/PivotTable/hooks/useTableClipping.d.ts +24 -0
- package/build/types/components/PivotTable/index.d.ts +26 -0
- package/build/types/components/PivotTable/interfaces/index.d.ts +72 -0
- package/build/types/components/PivotTable/services/adaptiveClippingController.d.ts +44 -0
- package/build/types/components/PivotTable/services/engine.d.ts +252 -0
- package/build/types/components/PivotTable/utils/getOuLevelAndGroupText.d.ts +1 -0
- package/build/types/components/PivotTable/utils/index.d.ts +38 -0
- package/build/types/components/PivotTable/utils/isColorBright.d.ts +1 -0
- package/build/types/components/PivotTable/utils/layout/dimension.d.ts +35 -0
- package/build/types/components/PivotTable/utils/layout/dimensionGetId.d.ts +3 -0
- package/build/types/components/PivotTable/utils/layout/dimensionGetItems.d.ts +3 -0
- package/build/types/components/PivotTable/utils/layout/dimensionIs.d.ts +1 -0
- package/build/types/components/PivotTable/utils/layout/dimensionIsEmpty.d.ts +3 -0
- package/build/types/components/PivotTable/utils/layout/dimensionIsValid.d.ts +5 -0
- package/build/types/components/PivotTable/utils/legend.d.ts +11 -0
- package/build/types/components/PivotTable/utils/ouIdHelper/index.d.ts +10 -0
- package/build/types/index.d.ts +1 -0
- package/package.json +6 -3
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
import { AdaptiveClippingController } from './adaptiveClippingController';
|
|
2
|
+
import { DimensionLookup, PivotTableVisualization } from "../interfaces";
|
|
3
|
+
import { Analytics, AnalyticsItem, LegendSet } from "@hisptz/dhis2-utils";
|
|
4
|
+
export declare class PivotTableEngine {
|
|
5
|
+
visualization: PivotTableVisualization;
|
|
6
|
+
rawData: Analytics;
|
|
7
|
+
options: {
|
|
8
|
+
showColumnTotals: number | undefined;
|
|
9
|
+
showRowTotals: number | undefined;
|
|
10
|
+
showColumnSubtotals: number | undefined;
|
|
11
|
+
showRowSubtotals: number | undefined;
|
|
12
|
+
hideEmptyColumns: boolean | undefined;
|
|
13
|
+
hideEmptyRows: boolean | undefined;
|
|
14
|
+
title: string | undefined;
|
|
15
|
+
subtitle: string | undefined;
|
|
16
|
+
fixColumnHeaders: boolean | undefined;
|
|
17
|
+
fixRowHeaders: boolean | undefined;
|
|
18
|
+
};
|
|
19
|
+
legendSets: Record<string, LegendSet>;
|
|
20
|
+
dimensionLookup?: DimensionLookup;
|
|
21
|
+
adaptiveClippingController: AdaptiveClippingController;
|
|
22
|
+
columnDepth: number;
|
|
23
|
+
rowDepth: number;
|
|
24
|
+
height: number;
|
|
25
|
+
width: number;
|
|
26
|
+
data: never[];
|
|
27
|
+
rowMap: never[];
|
|
28
|
+
columnMap: never[];
|
|
29
|
+
doRowTotals: boolean;
|
|
30
|
+
doColumnTotals: boolean;
|
|
31
|
+
doRowSubtotals: boolean;
|
|
32
|
+
doColumnSubtotals: boolean;
|
|
33
|
+
dataWidth: number;
|
|
34
|
+
dataHeight: number;
|
|
35
|
+
rawDataHeight: number;
|
|
36
|
+
constructor(visualization: PivotTableVisualization, data: Analytics, legendSets?: LegendSet[]);
|
|
37
|
+
get cellPadding(): 5 | 4 | 7;
|
|
38
|
+
get fontSize(): 10 | 11 | 13;
|
|
39
|
+
get scrollIconBuffer(): 15 | 11 | 13;
|
|
40
|
+
getRaw({ row, column }: {
|
|
41
|
+
row: any;
|
|
42
|
+
column: any;
|
|
43
|
+
}): {
|
|
44
|
+
cellType: string;
|
|
45
|
+
empty: boolean;
|
|
46
|
+
ouId: any;
|
|
47
|
+
peId: any;
|
|
48
|
+
valueType?: undefined;
|
|
49
|
+
rawValue?: undefined;
|
|
50
|
+
renderedValue?: undefined;
|
|
51
|
+
dxDimension?: undefined;
|
|
52
|
+
} | {
|
|
53
|
+
cellType: string;
|
|
54
|
+
empty: boolean;
|
|
55
|
+
valueType: any;
|
|
56
|
+
rawValue: any;
|
|
57
|
+
renderedValue: any;
|
|
58
|
+
dxDimension: {
|
|
59
|
+
valueType: any;
|
|
60
|
+
totalAggregationType: any;
|
|
61
|
+
legendSet: undefined;
|
|
62
|
+
} | {
|
|
63
|
+
valueType: {
|
|
64
|
+
[key: string]: any;
|
|
65
|
+
name: string;
|
|
66
|
+
};
|
|
67
|
+
totalAggregationType: {
|
|
68
|
+
[key: string]: any;
|
|
69
|
+
name: string;
|
|
70
|
+
};
|
|
71
|
+
legendSet: {
|
|
72
|
+
[key: string]: any;
|
|
73
|
+
name: string;
|
|
74
|
+
};
|
|
75
|
+
} | {
|
|
76
|
+
valueType: string;
|
|
77
|
+
totalAggregationType: string;
|
|
78
|
+
legendSet?: undefined;
|
|
79
|
+
} | undefined;
|
|
80
|
+
ouId: any;
|
|
81
|
+
peId: any;
|
|
82
|
+
};
|
|
83
|
+
get({ row, column }: {
|
|
84
|
+
row: any;
|
|
85
|
+
column: any;
|
|
86
|
+
}): {
|
|
87
|
+
cellType: string;
|
|
88
|
+
empty: boolean;
|
|
89
|
+
ouId: any;
|
|
90
|
+
peId: any;
|
|
91
|
+
valueType?: undefined;
|
|
92
|
+
rawValue?: undefined;
|
|
93
|
+
renderedValue?: undefined;
|
|
94
|
+
dxDimension?: undefined;
|
|
95
|
+
} | {
|
|
96
|
+
cellType: string;
|
|
97
|
+
empty: boolean;
|
|
98
|
+
valueType: any;
|
|
99
|
+
rawValue: any;
|
|
100
|
+
renderedValue: any;
|
|
101
|
+
dxDimension: {
|
|
102
|
+
valueType: any;
|
|
103
|
+
totalAggregationType: any;
|
|
104
|
+
legendSet: undefined;
|
|
105
|
+
} | {
|
|
106
|
+
valueType: {
|
|
107
|
+
[key: string]: any;
|
|
108
|
+
name: string;
|
|
109
|
+
};
|
|
110
|
+
totalAggregationType: {
|
|
111
|
+
[key: string]: any;
|
|
112
|
+
name: string;
|
|
113
|
+
};
|
|
114
|
+
legendSet: {
|
|
115
|
+
[key: string]: any;
|
|
116
|
+
name: string;
|
|
117
|
+
};
|
|
118
|
+
} | {
|
|
119
|
+
valueType: string;
|
|
120
|
+
totalAggregationType: string;
|
|
121
|
+
legendSet?: undefined;
|
|
122
|
+
} | undefined;
|
|
123
|
+
ouId: any;
|
|
124
|
+
peId: any;
|
|
125
|
+
} | undefined;
|
|
126
|
+
getRawCellType({ row, column }: {
|
|
127
|
+
row: any;
|
|
128
|
+
column: any;
|
|
129
|
+
}): "value" | "subtotal" | "total";
|
|
130
|
+
getCellType({ row, column }: {
|
|
131
|
+
row: any;
|
|
132
|
+
column: any;
|
|
133
|
+
}): "value" | "subtotal" | "total";
|
|
134
|
+
getDimensionLabel(rowLevel: any, columnLevel: any): string | {
|
|
135
|
+
[key: string]: any;
|
|
136
|
+
name: string;
|
|
137
|
+
} | null | undefined;
|
|
138
|
+
getCellDxDimension({ row, column }: {
|
|
139
|
+
row: any;
|
|
140
|
+
column: any;
|
|
141
|
+
}): {
|
|
142
|
+
valueType: any;
|
|
143
|
+
totalAggregationType: any;
|
|
144
|
+
legendSet: undefined;
|
|
145
|
+
} | {
|
|
146
|
+
valueType: {
|
|
147
|
+
[key: string]: any;
|
|
148
|
+
name: string;
|
|
149
|
+
};
|
|
150
|
+
totalAggregationType: {
|
|
151
|
+
[key: string]: any;
|
|
152
|
+
name: string;
|
|
153
|
+
};
|
|
154
|
+
legendSet: {
|
|
155
|
+
[key: string]: any;
|
|
156
|
+
name: string;
|
|
157
|
+
};
|
|
158
|
+
} | {
|
|
159
|
+
valueType: string;
|
|
160
|
+
totalAggregationType: string;
|
|
161
|
+
legendSet?: undefined;
|
|
162
|
+
} | undefined;
|
|
163
|
+
getRawCellDxDimension({ row, column }: {
|
|
164
|
+
row: any;
|
|
165
|
+
column: any;
|
|
166
|
+
}): {
|
|
167
|
+
valueType: any;
|
|
168
|
+
totalAggregationType: any;
|
|
169
|
+
legendSet: undefined;
|
|
170
|
+
} | {
|
|
171
|
+
valueType: {
|
|
172
|
+
[key: string]: any;
|
|
173
|
+
name: string;
|
|
174
|
+
};
|
|
175
|
+
totalAggregationType: {
|
|
176
|
+
[key: string]: any;
|
|
177
|
+
name: string;
|
|
178
|
+
};
|
|
179
|
+
legendSet: {
|
|
180
|
+
[key: string]: any;
|
|
181
|
+
name: string;
|
|
182
|
+
};
|
|
183
|
+
} | {
|
|
184
|
+
valueType: string;
|
|
185
|
+
totalAggregationType: string;
|
|
186
|
+
legendSet?: undefined;
|
|
187
|
+
} | undefined;
|
|
188
|
+
rowIsEmpty(row: string | number): boolean;
|
|
189
|
+
columnIsEmpty(column: number): boolean;
|
|
190
|
+
getRawColumnHeader(column: number): undefined[] | AnalyticsItem[] | undefined;
|
|
191
|
+
getColumnHeader(column: string): undefined[] | AnalyticsItem[] | undefined;
|
|
192
|
+
getRawRowHeader(row: number): undefined[] | AnalyticsItem[];
|
|
193
|
+
getRowHeader(row: string): undefined[] | AnalyticsItem[];
|
|
194
|
+
getDependantTotalCells({ row, column }: {
|
|
195
|
+
row: any;
|
|
196
|
+
column: any;
|
|
197
|
+
}): {
|
|
198
|
+
rowSubtotal: false | 0 | {
|
|
199
|
+
row: any;
|
|
200
|
+
column: number;
|
|
201
|
+
size: number;
|
|
202
|
+
};
|
|
203
|
+
rowSubtotalColumnTotal: false | {
|
|
204
|
+
row: number;
|
|
205
|
+
column: any;
|
|
206
|
+
size: number;
|
|
207
|
+
};
|
|
208
|
+
columnSubtotal: false | 0 | {
|
|
209
|
+
row: number;
|
|
210
|
+
column: any;
|
|
211
|
+
size: number;
|
|
212
|
+
};
|
|
213
|
+
columnSubtotalRowTotal: false | {
|
|
214
|
+
row: any;
|
|
215
|
+
column: number;
|
|
216
|
+
size: any;
|
|
217
|
+
};
|
|
218
|
+
rowTotal: false | {
|
|
219
|
+
row: any;
|
|
220
|
+
column: number;
|
|
221
|
+
size: any;
|
|
222
|
+
};
|
|
223
|
+
columnTotal: false | {
|
|
224
|
+
row: number;
|
|
225
|
+
column: any;
|
|
226
|
+
size: number;
|
|
227
|
+
};
|
|
228
|
+
combinedSubtotal: false | 0 | {
|
|
229
|
+
row: any;
|
|
230
|
+
column: any;
|
|
231
|
+
size: number;
|
|
232
|
+
};
|
|
233
|
+
combinedTotal: false | {
|
|
234
|
+
row: number;
|
|
235
|
+
column: number;
|
|
236
|
+
size: number;
|
|
237
|
+
};
|
|
238
|
+
};
|
|
239
|
+
addCellValueToTotals(pos: any, dataRow: any): void;
|
|
240
|
+
finalizeTotal({ row, column }: {
|
|
241
|
+
row: any;
|
|
242
|
+
column: any;
|
|
243
|
+
}): void;
|
|
244
|
+
finalizeTotals(): void;
|
|
245
|
+
resetRowMap(): void;
|
|
246
|
+
resetColumnMap(): void;
|
|
247
|
+
buildMatrix(): void;
|
|
248
|
+
getColumnType(column: number): "value" | "subtotal" | "total" | undefined;
|
|
249
|
+
isSortable(column: number): boolean;
|
|
250
|
+
sort(column: number, order: number): void;
|
|
251
|
+
clearSort(): void;
|
|
252
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getOuLevelAndGroupText: (filter: any, metaData: any) => string;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export declare const parseValue: (valueString: string) => string | number;
|
|
2
|
+
export declare const measureTextWithWrapping: (text: string, { fontSize, maxWidth, justifyBuffer, lineHeight, }: any) => {
|
|
3
|
+
width: number;
|
|
4
|
+
height: number;
|
|
5
|
+
normalizedText?: undefined;
|
|
6
|
+
} | {
|
|
7
|
+
normalizedText: string;
|
|
8
|
+
width: number;
|
|
9
|
+
height: number;
|
|
10
|
+
};
|
|
11
|
+
export declare const renderValue: (value: any, valueType: any, visualization: any) => string;
|
|
12
|
+
export declare const applyLegendSet: (value: any, dxDimension: any, engine: any) => {};
|
|
13
|
+
export declare function getFilterText(filters: any, metaData: any): string;
|
|
14
|
+
export declare const getHeaderForDisplay: ({ start, count, index, dimensionLevel, getHeader, showHierarchy, }: {
|
|
15
|
+
start: any;
|
|
16
|
+
count: any;
|
|
17
|
+
index: any;
|
|
18
|
+
dimensionLevel: any;
|
|
19
|
+
getHeader: any;
|
|
20
|
+
showHierarchy: any;
|
|
21
|
+
}) => {
|
|
22
|
+
span: number;
|
|
23
|
+
label: any;
|
|
24
|
+
includesHierarchy: any;
|
|
25
|
+
} | null;
|
|
26
|
+
export declare const clipPartitionedAxis: ({ partitionSize, partitions, axisMap, widthMap, viewportWidth, viewportPosition, totalWidth, }: {
|
|
27
|
+
partitionSize: any;
|
|
28
|
+
partitions: any;
|
|
29
|
+
axisMap: any;
|
|
30
|
+
widthMap: any;
|
|
31
|
+
viewportWidth: any;
|
|
32
|
+
viewportPosition: any;
|
|
33
|
+
totalWidth: any;
|
|
34
|
+
}) => {
|
|
35
|
+
indices: number[];
|
|
36
|
+
pre: any;
|
|
37
|
+
post: number;
|
|
38
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const isColorBright: (color: string | string[] | number[] | null) => boolean;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export declare const DIMENSION: {
|
|
2
|
+
isValid: (dimension: any) => boolean;
|
|
3
|
+
};
|
|
4
|
+
export declare const DIMENSION_PROP_ID: Record<string, any>;
|
|
5
|
+
export declare const DIMENSION_PROP_ITEMS: {
|
|
6
|
+
name: string;
|
|
7
|
+
defaultValue: never[];
|
|
8
|
+
required: boolean;
|
|
9
|
+
isValid: (prop: any) => boolean;
|
|
10
|
+
};
|
|
11
|
+
export declare const DIMENSION_PROP_FILTER: {
|
|
12
|
+
name: string;
|
|
13
|
+
defaultValue: never[];
|
|
14
|
+
required: boolean;
|
|
15
|
+
isValid: (prop: any) => boolean;
|
|
16
|
+
};
|
|
17
|
+
export declare const DIMENSION_PROP_LEGEND_SET: {
|
|
18
|
+
name: string;
|
|
19
|
+
defaultValue: never[];
|
|
20
|
+
required: boolean;
|
|
21
|
+
isValid: (prop: any) => boolean;
|
|
22
|
+
};
|
|
23
|
+
export declare const DIMENSION_PROP_PROGRAM_STAGE: {
|
|
24
|
+
name: string;
|
|
25
|
+
defaultValue: {};
|
|
26
|
+
required: boolean;
|
|
27
|
+
isValid: (prop: any) => boolean;
|
|
28
|
+
};
|
|
29
|
+
export declare const DIMENSION_PROP_REPETITION: {
|
|
30
|
+
name: string;
|
|
31
|
+
defaultValue: never[];
|
|
32
|
+
required: boolean;
|
|
33
|
+
isValid: (prop: any) => boolean;
|
|
34
|
+
};
|
|
35
|
+
export declare const DIMENSION_PROPS: any;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const dimensionIs: (dimension: string, dimensionId?: string | undefined) => boolean;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const LEGEND_DISPLAY_STRATEGY_BY_DATA_ITEM = "BY_DATA_ITEM";
|
|
2
|
+
export declare const LEGEND_DISPLAY_STRATEGY_FIXED = "FIXED";
|
|
3
|
+
export declare const LEGEND_DISPLAY_STYLE_FILL = "FILL";
|
|
4
|
+
export declare const LEGEND_DISPLAY_STYLE_TEXT = "TEXT";
|
|
5
|
+
export declare const getLegendByValueFromLegendSet: (legendSet: {
|
|
6
|
+
legends: any[];
|
|
7
|
+
}, value: string) => any;
|
|
8
|
+
export declare const getColorByValueFromLegendSet: (legendSet: {
|
|
9
|
+
legends: any[];
|
|
10
|
+
}, value: string) => any;
|
|
11
|
+
export declare const getLegendSetByDisplayStrategy: ({ displayStrategy, legendSets, legendSetId, }: any) => any;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const USER_ORG_UNIT = "USER_ORGUNIT";
|
|
2
|
+
export declare const USER_ORG_UNIT_CHILDREN = "USER_ORGUNIT_CHILDREN";
|
|
3
|
+
export declare const USER_ORG_UNIT_GRANDCHILDREN = "USER_ORGUNIT_GRANDCHILDREN";
|
|
4
|
+
export declare const ouIdHelper: Readonly<{
|
|
5
|
+
addLevelPrefix: (id: string) => string;
|
|
6
|
+
addGroupPrefix: (id: string) => string;
|
|
7
|
+
removePrefix: (id: string) => string;
|
|
8
|
+
hasGroupPrefix: (id: string) => boolean;
|
|
9
|
+
hasLevelPrefix: (id: string) => boolean;
|
|
10
|
+
}>;
|
package/build/types/index.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hisptz/dhis2-analytics",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.11",
|
|
4
4
|
"description": "A collection of reusable react components for visualizing analytics data from DHIS2",
|
|
5
5
|
"license": "BSD-3-Clause",
|
|
6
6
|
"scripts": {
|
|
@@ -29,8 +29,10 @@
|
|
|
29
29
|
"typescript": "^4.9.5"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
+
"@dhis2/analytics": "^24.4.2",
|
|
32
33
|
"@dhis2/app-runtime": "^3.7.0",
|
|
33
|
-
"@hisptz/dhis2-ui": "^1.0.
|
|
34
|
+
"@hisptz/dhis2-ui": "^1.0.11",
|
|
35
|
+
"@hisptz/dhis2-utils": "^1.0.11",
|
|
34
36
|
"async-es": "^3.2.4",
|
|
35
37
|
"d3-color": "^3.1.0",
|
|
36
38
|
"d3-scale": "^4.0.2",
|
|
@@ -45,6 +47,7 @@
|
|
|
45
47
|
"react-leaflet-custom-control": "^1.3.1",
|
|
46
48
|
"react-spring": "^9.6.1",
|
|
47
49
|
"screenfull": "^6.0.2",
|
|
50
|
+
"styled-jsx": "^5.1.2",
|
|
48
51
|
"usehooks-ts": "^2.9.1"
|
|
49
52
|
},
|
|
50
53
|
"main": "./build/cjs/index.js",
|
|
@@ -75,5 +78,5 @@
|
|
|
75
78
|
"lodash": "^4",
|
|
76
79
|
"react-hook-form": "^7"
|
|
77
80
|
},
|
|
78
|
-
"gitHead": "
|
|
81
|
+
"gitHead": "bf9cb98bd8df9a8d8b5d743044e0120f99fb3e46"
|
|
79
82
|
}
|