@hisptz/dhis2-analytics 1.0.30 → 1.0.32

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.
Files changed (93) hide show
  1. package/build/cjs/components/ChartAnalytics/ChartAnalytics.test.js +5 -5
  2. package/build/cjs/components/Map/components/MapLayer/components/GoogleEngineLayer/components/EarthEngineLegend.js +0 -2
  3. package/build/cjs/components/Map/components/MapLayer/components/GoogleEngineLayer/services/engine.js +12 -3
  4. package/build/cjs/components/Map/components/MapLayer/components/LegendArea/index.js +0 -1
  5. package/build/es/components/ChartAnalytics/ChartAnalytics.test.js +2 -2
  6. package/build/es/components/Map/components/MapLayer/components/GoogleEngineLayer/components/EarthEngineLegend.js +0 -2
  7. package/build/es/components/Map/components/MapLayer/components/GoogleEngineLayer/services/engine.js +9 -10
  8. package/build/es/components/Map/components/MapLayer/components/LegendArea/index.js +0 -1
  9. package/package.json +6 -7
  10. package/build/types/src/dataProviders/map.d.ts +0 -4
  11. /package/build/types/{src/components → components}/ChartAnalytics/components/DownloadMenu/components/Menu.d.ts +0 -0
  12. /package/build/types/{src/components → components}/ChartAnalytics/components/DownloadMenu/constants/menu.d.ts +0 -0
  13. /package/build/types/{src/components → components}/ChartAnalytics/components/DownloadMenu/index.d.ts +0 -0
  14. /package/build/types/{src/components → components}/ChartAnalytics/components/DownloadMenu/interfaces/menu.d.ts +0 -0
  15. /package/build/types/{src/components → components}/ChartAnalytics/hooks/useChart.d.ts +0 -0
  16. /package/build/types/{src/components → components}/ChartAnalytics/index.d.ts +0 -0
  17. /package/build/types/{src/components → components}/ChartAnalytics/models/column.d.ts +0 -0
  18. /package/build/types/{src/components → components}/ChartAnalytics/models/index.d.ts +0 -0
  19. /package/build/types/{src/components → components}/ChartAnalytics/models/line.d.ts +0 -0
  20. /package/build/types/{src/components → components}/ChartAnalytics/models/multi-series.d.ts +0 -0
  21. /package/build/types/{src/components → components}/ChartAnalytics/models/pie.d.ts +0 -0
  22. /package/build/types/{src/components → components}/ChartAnalytics/services/export.d.ts +0 -0
  23. /package/build/types/{src/components → components}/ChartAnalytics/types/props.d.ts +0 -0
  24. /package/build/types/{src/components → components}/ChartAnalytics/utils/chart.d.ts +0 -0
  25. /package/build/types/{src/components → components}/CircularProgressDashboard/index.d.ts +0 -0
  26. /package/build/types/{src/components → components}/CircularProgressDashboard/types/props.d.ts +0 -0
  27. /package/build/types/{src/components → components}/CustomPivotTable/components/Table/index.d.ts +0 -0
  28. /package/build/types/{src/components → components}/CustomPivotTable/components/TableBody/index.d.ts +0 -0
  29. /package/build/types/{src/components → components}/CustomPivotTable/components/TableHeaders/index.d.ts +0 -0
  30. /package/build/types/{src/components → components}/CustomPivotTable/index.d.ts +0 -0
  31. /package/build/types/{src/components → components}/CustomPivotTable/interfaces/index.d.ts +0 -0
  32. /package/build/types/{src/components → components}/CustomPivotTable/services/engine.d.ts +0 -0
  33. /package/build/types/{src/components → components}/CustomPivotTable/state/engine.d.ts +0 -0
  34. /package/build/types/{src/components → components}/Map/components/EarthEngineLayerConfiguration/index.d.ts +0 -0
  35. /package/build/types/{src/components → components}/Map/components/MapArea/index.d.ts +0 -0
  36. /package/build/types/{src/components → components}/Map/components/MapArea/interfaces/index.d.ts +0 -0
  37. /package/build/types/{src/components → components}/Map/components/MapControls/components/CustomControl/index.d.ts +0 -0
  38. /package/build/types/{src/components → components}/Map/components/MapControls/components/DownloadControl/index.d.ts +0 -0
  39. /package/build/types/{src/components → components}/Map/components/MapControls/components/FullscreenControl/index.d.ts +0 -0
  40. /package/build/types/{src/components → components}/Map/components/MapControls/index.d.ts +0 -0
  41. /package/build/types/{src/components → components}/Map/components/MapLayer/components/BoundaryLayer/hooks/useBoundaryData.d.ts +0 -0
  42. /package/build/types/{src/components → components}/Map/components/MapLayer/components/BoundaryLayer/index.d.ts +0 -0
  43. /package/build/types/{src/components → components}/Map/components/MapLayer/components/GoogleEngineLayer/components/EarthEngineLegend.d.ts +0 -0
  44. /package/build/types/{src/components → components}/Map/components/MapLayer/components/GoogleEngineLayer/constants/index.d.ts +0 -0
  45. /package/build/types/{src/components → components}/Map/components/MapLayer/components/GoogleEngineLayer/hooks/index.d.ts +0 -0
  46. /package/build/types/{src/components → components}/Map/components/MapLayer/components/GoogleEngineLayer/index.d.ts +0 -0
  47. /package/build/types/{src/components → components}/Map/components/MapLayer/components/GoogleEngineLayer/interfaces/index.d.ts +0 -0
  48. /package/build/types/{src/components → components}/Map/components/MapLayer/components/GoogleEngineLayer/services/api.d.ts +0 -0
  49. /package/build/types/{src/components → components}/Map/components/MapLayer/components/GoogleEngineLayer/services/engine.d.ts +0 -0
  50. /package/build/types/{src/components → components}/Map/components/MapLayer/components/GoogleEngineLayer/utils/index.d.ts +0 -0
  51. /package/build/types/{src/components → components}/Map/components/MapLayer/components/LegendArea/components/LegendCardHeader/index.d.ts +0 -0
  52. /package/build/types/{src/components → components}/Map/components/MapLayer/components/LegendArea/index.d.ts +0 -0
  53. /package/build/types/{src/components → components}/Map/components/MapLayer/components/PointLayer/components/PointLegend/index.d.ts +0 -0
  54. /package/build/types/{src/components → components}/Map/components/MapLayer/components/PointLayer/hooks/index.d.ts +0 -0
  55. /package/build/types/{src/components → components}/Map/components/MapLayer/components/PointLayer/index.d.ts +0 -0
  56. /package/build/types/{src/components → components}/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/components/Bubble.d.ts +0 -0
  57. /package/build/types/{src/components → components}/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/components/Bubbles.d.ts +0 -0
  58. /package/build/types/{src/components → components}/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/index.d.ts +0 -0
  59. /package/build/types/{src/components → components}/Map/components/MapLayer/components/ThematicLayer/components/Bubble/index.d.ts +0 -0
  60. /package/build/types/{src/components → components}/Map/components/MapLayer/components/ThematicLayer/components/Choropleth/components/ChoroplethLegend.d.ts +0 -0
  61. /package/build/types/{src/components → components}/Map/components/MapLayer/components/ThematicLayer/components/Choropleth/index.d.ts +0 -0
  62. /package/build/types/{src/components → components}/Map/components/MapLayer/components/ThematicLayer/components/CustomTooltip/index.d.ts +0 -0
  63. /package/build/types/{src/components → components}/Map/components/MapLayer/components/ThematicLayer/hooks/config.d.ts +0 -0
  64. /package/build/types/{src/components → components}/Map/components/MapLayer/components/ThematicLayer/index.d.ts +0 -0
  65. /package/build/types/{src/components → components}/Map/components/MapLayer/index.d.ts +0 -0
  66. /package/build/types/{src/components → components}/Map/components/MapLayer/interfaces/index.d.ts +0 -0
  67. /package/build/types/{src/components → components}/Map/components/MapProvider/components/MapLayerProvider/hooks/index.d.ts +0 -0
  68. /package/build/types/{src/components → components}/Map/components/MapProvider/components/MapLayerProvider/index.d.ts +0 -0
  69. /package/build/types/{src/components → components}/Map/components/MapProvider/hooks/index.d.ts +0 -0
  70. /package/build/types/{src/components → components}/Map/components/MapProvider/index.d.ts +0 -0
  71. /package/build/types/{src/components → components}/Map/components/MapUpdater/index.d.ts +0 -0
  72. /package/build/types/{src/components → components}/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/components/ColorScale/index.d.ts +0 -0
  73. /package/build/types/{src/components → components}/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/constants/colors.d.ts +0 -0
  74. /package/build/types/{src/components → components}/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/index.d.ts +0 -0
  75. /package/build/types/{src/components → components}/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/utils/colors.d.ts +0 -0
  76. /package/build/types/{src/components → components}/Map/components/ThematicLayerConfiguration/components/CustomLegend/index.d.ts +0 -0
  77. /package/build/types/{src/components → components}/Map/components/ThematicLayerConfiguration/components/IndicatorSelectorModal/index.d.ts +0 -0
  78. /package/build/types/{src/components → components}/Map/components/ThematicLayerConfiguration/components/LegendSetSelector/index.d.ts +0 -0
  79. /package/build/types/{src/components → components}/Map/components/ThematicLayerConfiguration/index.d.ts +0 -0
  80. /package/build/types/{src/components → components}/Map/constants/colors.d.ts +0 -0
  81. /package/build/types/{src/components → components}/Map/constants/legendSet.d.ts +0 -0
  82. /package/build/types/{src/components → components}/Map/hooks/map.d.ts +0 -0
  83. /package/build/types/{src/components → components}/Map/index.d.ts +0 -0
  84. /package/build/types/{src/components → components}/Map/interfaces/index.d.ts +0 -0
  85. /package/build/types/{src/components → components}/Map/state/index.d.ts +0 -0
  86. /package/build/types/{src/components → components}/Map/utils/colors.d.ts +0 -0
  87. /package/build/types/{src/components → components}/Map/utils/helpers.d.ts +0 -0
  88. /package/build/types/{src/components → components}/Map/utils/map.d.ts +0 -0
  89. /package/build/types/{src/components → components}/SingleValueContainer/components/SingleValueItem/SingleValueItem.d.ts +0 -0
  90. /package/build/types/{src/components → components}/SingleValueContainer/components/SingleValueItem/SingleValuePercentage.d.ts +0 -0
  91. /package/build/types/{src/components → components}/SingleValueContainer/index.d.ts +0 -0
  92. /package/build/types/{src/components → components}/SingleValueContainer/types/props.d.ts +0 -0
  93. /package/build/types/{src/index.d.ts → index.d.ts} +0 -0
@@ -3,10 +3,10 @@
3
3
  var _react = require("@cypress/react");
4
4
  var _highcharts = _interopRequireDefault(require("highcharts"));
5
5
  var _react2 = _interopRequireWildcard(require("react"));
6
- var _DownloadMenu = _interopRequireDefault(require("./components/DownloadMenu"));
6
+ var _DownloadMenu = require("./components/DownloadMenu");
7
7
  var _columnData = _interopRequireDefault(require("./data/column-data.json"));
8
8
  var _export = require("./services/export");
9
- var _ = _interopRequireDefault(require("."));
9
+ var _ = require(".");
10
10
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
11
11
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
12
12
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -25,7 +25,7 @@ const props = {
25
25
  }
26
26
  };
27
27
  function TestComponent() {
28
- return /*#__PURE__*/_react2.default.createElement(_.default, props);
28
+ return /*#__PURE__*/_react2.default.createElement(_.ChartAnalytics, props);
29
29
  }
30
30
  function ExportTestComponent() {
31
31
  const [chartRef, setChartRef] = (0, _react2.useState)(null);
@@ -34,9 +34,9 @@ function ExportTestComponent() {
34
34
  display: "flex",
35
35
  flexDirection: "column"
36
36
  }
37
- }, /*#__PURE__*/_react2.default.createElement("div", null, /*#__PURE__*/_react2.default.createElement(_DownloadMenu.default, {
37
+ }, /*#__PURE__*/_react2.default.createElement("div", null, /*#__PURE__*/_react2.default.createElement(_DownloadMenu.ChartDownloadMenu, {
38
38
  chartRef: chartRef
39
- })), /*#__PURE__*/_react2.default.createElement(_.default, _extends({}, props, {
39
+ })), /*#__PURE__*/_react2.default.createElement(_.ChartAnalytics, _extends({}, props, {
40
40
  ref: setChartRef
41
41
  })));
42
42
  }
@@ -37,13 +37,11 @@ function getLegendsFromParams(params) {
37
37
  min,
38
38
  max
39
39
  } = params;
40
- console.log(params);
41
40
  const sanitizedPalette = Array.isArray(palette) ? palette : palette.split(",");
42
41
  const classes = sanitizedPalette.length;
43
42
  const difference = max - min;
44
43
  const interval = Math.round(difference / classes);
45
44
  const legends = [];
46
- console.log(10 / 9);
47
45
  for (let i = 0; i < classes; i++) {
48
46
  const min = i * interval;
49
47
  const max = min + interval;
@@ -6,13 +6,22 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.EarthEngine = void 0;
7
7
  var _utils = require("../utils");
8
8
  var _lodash = require("lodash");
9
- var _api = _interopRequireDefault(require("./api"));
10
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
9
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
12
10
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
13
11
  function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
12
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
13
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
14
+ async function importEEModule() {
15
+ // @ts-ignore
16
+ if (import.meta.env.STORYBOOK_BUILD === "true") {
17
+ return await Promise.resolve().then(() => _interopRequireWildcard(require("@google/earthengine")));
18
+ }
19
+ return await Promise.resolve().then(() => _interopRequireWildcard(require("./api")));
20
+ }
21
+ const EE = await importEEModule();
22
+ // import EE from "./api"
14
23
  // @ts-ignore
15
- const ee = _api.default;
24
+ const ee = EE;
16
25
  // @ts-ignore
17
26
  window.ee = ee;
18
27
  const FEATURE_STYLE = {
@@ -149,7 +149,6 @@ function Legend(_ref3) {
149
149
  };
150
150
  const name = (_head3 = (0, _lodash.head)(_react.default.Children.toArray(children))) === null || _head3 === void 0 ? void 0 : _head3.props.name;
151
151
  const shouldCollapse = collapsed && !inPrintMode;
152
- console.log(inPrintMode);
153
152
  return /*#__PURE__*/_react.default.createElement("div", {
154
153
  className: "w-100"
155
154
  }, shouldCollapse ? /*#__PURE__*/_react.default.createElement(CollapsedLegendIcon, {
@@ -2,10 +2,10 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
2
2
  import { mount } from "@cypress/react";
3
3
  import HighCharts from "highcharts";
4
4
  import React, { useState } from "react";
5
- import ChartDownloadMenu from "./components/DownloadMenu";
5
+ import { ChartDownloadMenu } from "./components/DownloadMenu";
6
6
  import columnData from "./data/column-data.json";
7
7
  import { setupHighchartsModules } from "./services/export";
8
- import ChartAnalytics from ".";
8
+ import { ChartAnalytics } from ".";
9
9
  const props = {
10
10
  analytics: columnData,
11
11
  config: {
@@ -27,13 +27,11 @@ function getLegendsFromParams(params) {
27
27
  min,
28
28
  max
29
29
  } = params;
30
- console.log(params);
31
30
  const sanitizedPalette = Array.isArray(palette) ? palette : palette.split(",");
32
31
  const classes = sanitizedPalette.length;
33
32
  const difference = max - min;
34
33
  const interval = Math.round(difference / classes);
35
34
  const legends = [];
36
- console.log(10 / 9);
37
35
  for (let i = 0; i < classes; i++) {
38
36
  const min = i * interval;
39
37
  const max = min + interval;
@@ -3,16 +3,15 @@ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typ
3
3
  function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
4
4
  import { combineReducers, getFeatureCollectionProperties, getHistogramStatistics, getInfo, getScale, hasClasses } from "../utils";
5
5
  import { find, head, isEmpty } from "lodash";
6
-
7
- // async function importEEModule(): Promise<any> {
8
- // // @ts-ignore
9
- // if (import.meta.env.STORYBOOK_BUILD === "true") {
10
- // return await import("@google/earthengine")
11
- // }
12
- // return await import("./api")
13
- // }
14
- // const EE = await importEEModule();
15
- import EE from "./api";
6
+ async function importEEModule() {
7
+ // @ts-ignore
8
+ if (import.meta.env.STORYBOOK_BUILD === "true") {
9
+ return await import("@google/earthengine");
10
+ }
11
+ return await import("./api");
12
+ }
13
+ const EE = await importEEModule();
14
+ // import EE from "./api"
16
15
  // @ts-ignore
17
16
  const ee = EE;
18
17
  // @ts-ignore
@@ -140,7 +140,6 @@ function Legend(_ref3) {
140
140
  };
141
141
  const name = (_head3 = head(React.Children.toArray(children))) === null || _head3 === void 0 ? void 0 : _head3.props.name;
142
142
  const shouldCollapse = collapsed && !inPrintMode;
143
- console.log(inPrintMode);
144
143
  return /*#__PURE__*/React.createElement("div", {
145
144
  className: "w-100"
146
145
  }, shouldCollapse ? /*#__PURE__*/React.createElement(CollapsedLegendIcon, {
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@hisptz/dhis2-analytics",
3
- "version": "1.0.30",
3
+ "version": "1.0.32",
4
4
  "description": "A collection of reusable react components for visualizing analytics data from DHIS2",
5
5
  "license": "BSD-3-Clause",
6
6
  "scripts": {
7
- "build": "d2-app-scripts build --no-verify",
7
+ "build": "d2-app-scripts build --no-verify --mode production",
8
8
  "build:types": "tsc --project tsconfig.build.json",
9
9
  "postbuild": "yarn build:types",
10
10
  "start": "d2-app-scripts start",
@@ -31,8 +31,8 @@
31
31
  "dependencies": {
32
32
  "@dhis2/analytics": "^24.4.2",
33
33
  "@dhis2/app-runtime": "^3.7.0",
34
- "@hisptz/dhis2-ui": "^1.0.30",
35
- "@hisptz/dhis2-utils": "^1.0.28",
34
+ "@hisptz/dhis2-ui": "^1.0.32",
35
+ "@hisptz/dhis2-utils": "^1.0.32",
36
36
  "async-es": "^3.2.4",
37
37
  "d3-color": "^3.1.0",
38
38
  "d3-scale": "^4.0.2",
@@ -75,8 +75,7 @@
75
75
  "url": "https://github.com/hisptz/dhis2-utils/issues"
76
76
  },
77
77
  "peerDependencies": {
78
- "lodash": "^4",
79
- "react-hook-form": "^7"
78
+ "lodash": "^4"
80
79
  },
81
- "gitHead": "895b0edd1d9577a35d73c3b4dd5e8cfb7781ebcf"
80
+ "gitHead": "d2f7eb0193c2733efbfda7855aa4c7257a832529"
82
81
  }
@@ -1,4 +0,0 @@
1
- import React from "react";
2
- export default function MapDataProvider({ children }: {
3
- children: React.ReactNode;
4
- }): React.ReactElement;
File without changes