@devgateway/dvz-ui-react 1.6.20 → 1.7.1

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 (156) hide show
  1. package/dist/cjs/_virtual/_commonjsHelpers.js +1 -0
  2. package/dist/cjs/_virtual/debounce.js +1 -0
  3. package/dist/cjs/embeddable/big-filter/BigNumberGroup.js +1 -0
  4. package/dist/cjs/embeddable/big-filter/BigNumberItem.js +1 -0
  5. package/dist/cjs/embeddable/big-filter/DataProvider.js +1 -0
  6. package/dist/cjs/embeddable/big-filter/index.js +1 -0
  7. package/dist/cjs/embeddable/big-number/index.js +1 -1
  8. package/dist/cjs/embeddable/big-number-trend/Alternative.js +1 -0
  9. package/dist/cjs/embeddable/big-number-trend/Classic.js +1 -0
  10. package/dist/cjs/embeddable/big-number-trend/index.js +1 -1
  11. package/dist/cjs/embeddable/chart/Bar.js +1 -1
  12. package/dist/cjs/embeddable/chart/Line.js +1 -1
  13. package/dist/cjs/embeddable/chart/data/Bar.js +1 -1
  14. package/dist/cjs/embeddable/chart/data/Line.js +1 -1
  15. package/dist/cjs/embeddable/chart/data/Utils.js +1 -1
  16. package/dist/cjs/embeddable/chart/index.js +1 -1
  17. package/dist/cjs/embeddable/d3Map/BaseLayer.js +1 -1
  18. package/dist/cjs/embeddable/d3Map/BreaksStyles.js +1 -1
  19. package/dist/cjs/embeddable/d3Map/DataLayer.js +1 -1
  20. package/dist/cjs/embeddable/d3Map/FlowLayer.js +1 -1
  21. package/dist/cjs/embeddable/d3Map/GradientColors.js +1 -1
  22. package/dist/cjs/embeddable/d3Map/LatLongLayer.js +1 -1
  23. package/dist/cjs/embeddable/d3Map/Layer.js +1 -1
  24. package/dist/cjs/embeddable/d3Map/Legends.js +1 -1
  25. package/dist/cjs/embeddable/d3Map/ProjectedContainer.js +1 -1
  26. package/dist/cjs/embeddable/d3Map/Utils.js +1 -1
  27. package/dist/cjs/embeddable/d3Map/ZoomControl.js +1 -1
  28. package/dist/cjs/embeddable/d3Map/index.js +1 -1
  29. package/dist/cjs/embeddable/data/CategoriesProvider.js +1 -1
  30. package/dist/cjs/embeddable/data/D3MapDataConsumer.js +1 -0
  31. package/dist/cjs/embeddable/data/D3MapDataProvider.js +1 -0
  32. package/dist/cjs/embeddable/data/DataContext.js +1 -1
  33. package/dist/cjs/embeddable/data/DataProvider.js +1 -1
  34. package/dist/cjs/embeddable/data-paragraph/index.js +1 -0
  35. package/dist/cjs/embeddable/download/dom-to-image.js +2 -2
  36. package/dist/cjs/embeddable/download/index.js +5 -5
  37. package/dist/cjs/embeddable/filter/index.js +1 -1
  38. package/dist/cjs/embeddable/grouped-bars/GroupedBars.js +1 -0
  39. package/dist/cjs/embeddable/grouped-bars/index.js +1 -0
  40. package/dist/cjs/embeddable/index.js +1 -1
  41. package/dist/cjs/embeddable/posts-filter/CategoricalFilter.js +1 -1
  42. package/dist/cjs/embeddable/reducers/data-api.js +1 -1
  43. package/dist/cjs/embeddable/reducers/data.js +1 -1
  44. package/dist/cjs/embeddable/utils/common.js +1 -1
  45. package/dist/cjs/index.js +1 -1
  46. package/dist/cjs/layout/Customizer.js +1 -1
  47. package/dist/cjs/layout/SearchControl.js +1 -1
  48. package/dist/cjs/layout/containers/SlugPostContainer.js +1 -1
  49. package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_Symbol.js +1 -0
  50. package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseGetTag.js +1 -0
  51. package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseTrim.js +1 -0
  52. package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_freeGlobal.js +1 -0
  53. package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_getRawTag.js +1 -0
  54. package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_objectToString.js +1 -0
  55. package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_root.js +1 -0
  56. package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_trimmedEndIndex.js +1 -0
  57. package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/debounce.js +1 -0
  58. package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isObject.js +1 -0
  59. package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isObjectLike.js +1 -0
  60. package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isSymbol.js +1 -0
  61. package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/now.js +1 -0
  62. package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/toNumber.js +1 -0
  63. package/dist/cjs/styles.css +1 -1
  64. package/dist/esm/_virtual/_commonjsHelpers.js +8 -0
  65. package/dist/esm/_virtual/debounce.js +7 -0
  66. package/dist/esm/embeddable/big-filter/BigNumberGroup.js +129 -0
  67. package/dist/esm/embeddable/big-filter/BigNumberItem.js +107 -0
  68. package/dist/esm/embeddable/big-filter/DataProvider.js +53 -0
  69. package/dist/esm/embeddable/big-filter/index.js +130 -0
  70. package/dist/esm/embeddable/big-number/index.js +154 -102
  71. package/dist/esm/embeddable/big-number-trend/Alternative.js +227 -0
  72. package/dist/esm/embeddable/big-number-trend/Classic.js +190 -0
  73. package/dist/esm/embeddable/big-number-trend/index.js +12 -147
  74. package/dist/esm/embeddable/chart/Bar.js +450 -395
  75. package/dist/esm/embeddable/chart/Line.js +216 -184
  76. package/dist/esm/embeddable/chart/data/Bar.js +16 -18
  77. package/dist/esm/embeddable/chart/data/Line.js +27 -24
  78. package/dist/esm/embeddable/chart/data/Utils.js +3 -1
  79. package/dist/esm/embeddable/chart/index.js +168 -162
  80. package/dist/esm/embeddable/d3Map/BaseLayer.js +25 -28
  81. package/dist/esm/embeddable/d3Map/BreaksStyles.js +17 -10
  82. package/dist/esm/embeddable/d3Map/DataLayer.js +290 -289
  83. package/dist/esm/embeddable/d3Map/FlowLayer.js +122 -136
  84. package/dist/esm/embeddable/d3Map/GradientColors.js +27 -20
  85. package/dist/esm/embeddable/d3Map/LatLongLayer.js +62 -62
  86. package/dist/esm/embeddable/d3Map/Layer.js +31 -27
  87. package/dist/esm/embeddable/d3Map/Legends.js +204 -190
  88. package/dist/esm/embeddable/d3Map/ProjectedContainer.js +1 -3
  89. package/dist/esm/embeddable/d3Map/Utils.js +12 -8
  90. package/dist/esm/embeddable/d3Map/ZoomControl.js +41 -41
  91. package/dist/esm/embeddable/d3Map/index.js +135 -117
  92. package/dist/esm/embeddable/data/CategoriesProvider.js +39 -26
  93. package/dist/esm/embeddable/data/D3MapDataConsumer.js +7 -0
  94. package/dist/esm/embeddable/data/D3MapDataProvider.js +83 -0
  95. package/dist/esm/embeddable/data/DataContext.js +2 -2
  96. package/dist/esm/embeddable/data/DataProvider.js +124 -55
  97. package/dist/esm/embeddable/data-paragraph/index.js +168 -0
  98. package/dist/esm/embeddable/download/dom-to-image.js +163 -148
  99. package/dist/esm/embeddable/download/index.js +102 -76
  100. package/dist/esm/embeddable/filter/index.js +335 -298
  101. package/dist/esm/embeddable/grouped-bars/GroupedBars.js +549 -0
  102. package/dist/esm/embeddable/grouped-bars/index.js +16 -0
  103. package/dist/esm/embeddable/index.js +33 -30
  104. package/dist/esm/embeddable/posts-filter/CategoricalFilter.js +18 -18
  105. package/dist/esm/embeddable/reducers/data-api.js +39 -35
  106. package/dist/esm/embeddable/reducers/data.js +141 -182
  107. package/dist/esm/embeddable/utils/common.js +3 -3
  108. package/dist/esm/index.js +111 -94
  109. package/dist/esm/layout/Customizer.js +10 -9
  110. package/dist/esm/layout/SearchControl.js +103 -113
  111. package/dist/esm/layout/containers/SlugPostContainer.js +1 -1
  112. package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_Symbol.js +11 -0
  113. package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseGetTag.js +16 -0
  114. package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseTrim.js +14 -0
  115. package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_freeGlobal.js +11 -0
  116. package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_getRawTag.js +21 -0
  117. package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_objectToString.js +13 -0
  118. package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_root.js +11 -0
  119. package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_trimmedEndIndex.js +15 -0
  120. package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/debounce.js +60 -0
  121. package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isObject.js +13 -0
  122. package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isObjectLike.js +12 -0
  123. package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isSymbol.js +15 -0
  124. package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/now.js +13 -0
  125. package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/toNumber.js +28 -0
  126. package/dist/esm/styles.css +1 -1
  127. package/dist/types/embeddable/big-filter/BigNumberGroup.d.ts +3 -0
  128. package/dist/types/embeddable/big-filter/BigNumberItem.d.ts +2 -0
  129. package/dist/types/embeddable/big-filter/DataProvider.d.ts +7 -0
  130. package/dist/types/embeddable/big-filter/index.d.ts +5 -0
  131. package/dist/types/embeddable/big-number-trend/Alternative.d.ts +5 -0
  132. package/dist/types/embeddable/big-number-trend/Classic.d.ts +5 -0
  133. package/dist/types/embeddable/big-number-trend/index.d.ts +2 -4
  134. package/dist/types/embeddable/chart/Bar.d.ts +3 -0
  135. package/dist/types/embeddable/chart/Line.d.ts +6 -0
  136. package/dist/types/embeddable/d3Map/GradientColors.d.ts +6 -2
  137. package/dist/types/embeddable/d3Map/Layer.d.ts +1 -1
  138. package/dist/types/embeddable/d3Map/Utils.d.ts +1 -1
  139. package/dist/types/embeddable/data/D3MapDataProvider.d.ts +7 -0
  140. package/dist/types/embeddable/data/index.d.ts +6 -0
  141. package/dist/types/embeddable/data-paragraph/index.d.ts +5 -0
  142. package/dist/types/embeddable/filter/index.d.ts +13 -1
  143. package/dist/types/embeddable/grouped-bars/GroupedBars.d.ts +5 -0
  144. package/dist/types/embeddable/grouped-bars/index.d.ts +3 -0
  145. package/dist/types/embeddable/reducers/data-api.d.ts +5 -0
  146. package/dist/types/embeddable/reducers/data.d.ts +16 -9
  147. package/dist/types/embeddable/utils/index.d.ts +1 -0
  148. package/dist/types/embeddable/utils/parseUtils.d.ts +0 -6
  149. package/dist/types/index.d.ts +6 -0
  150. package/dist/types/layout/Customizer.d.ts +1 -0
  151. package/dist/types/layout/containers/PageContainer.d.ts +8 -0
  152. package/dist/types/layout/containers/PostContainer.d.ts +0 -0
  153. package/dist/types/layout/index.d.ts +1 -0
  154. package/dist/types/utils/Logger.d.ts +1 -0
  155. package/package.json +3 -2
  156. /package/dist/types/embeddable/data/{DataConsumerMap.d.ts → D3MapDataConsumer.d.ts} +0 -0
@@ -25,13 +25,11 @@ class f extends n.Component {
25
25
  "div",
26
26
  {
27
27
  className: "projected",
28
- width: i,
29
- height: e,
30
28
  style: {
31
29
  margin: "auto",
32
30
  backgroundColor: o,
33
31
  height: `${e}px`,
34
- width: `${i}px`
32
+ width: "100%"
35
33
  },
36
34
  children: h.map(d, (j) => n.cloneElement(j, {
37
35
  ...this.state,
@@ -1,11 +1,15 @@
1
- import * as i from "d3";
2
- const e = (r) => new Promise((t, c) => {
3
- i.json(r).then(function(o, n) {
4
- n && console.log("Error loading JSON: " + n), t(o);
5
- }).catch(function(o) {
6
- console.error("Error loading JSON:", o), c(o);
1
+ import * as a from "d3";
2
+ const n = {}, o = {}, u = 3 * 60 * 1e3, r = (t) => JSON.parse(JSON.stringify(t)), l = (t) => {
3
+ const i = Date.now(), e = t;
4
+ if (n[e])
5
+ return n[e].then(r);
6
+ if (o[e] && i - o[e].timestamp < u)
7
+ return Promise.resolve(r(o[e].data));
8
+ const s = a.json(t).then((c) => (o[e] = { data: c, timestamp: Date.now() }, c)).finally(() => {
9
+ delete n[e];
7
10
  });
8
- });
11
+ return n[e] = s, s.then(r);
12
+ }, m = (t) => l(t);
9
13
  export {
10
- e as loadJSON
14
+ m as loadJSON
11
15
  };
@@ -1,47 +1,47 @@
1
- import { jsx as n, jsxs as I } from "react/jsx-runtime";
1
+ import { jsx as r, jsxs as I } from "react/jsx-runtime";
2
2
  import y from "react";
3
- import * as f from "d3";
3
+ import * as u from "d3";
4
4
  import { Icon as b, Popup as k } from "semantic-ui-react";
5
- import { FormattedMessage as N } from "react-intl";
6
- class T extends y.Component {
5
+ import { FormattedMessage as E } from "react-intl";
6
+ class O extends y.Component {
7
7
  constructor(t) {
8
- super(t), this.zoomRef = y.createRef(), this.lastInternalZoom = null, this.lastUserTransform = null, this.zoomed = this.zoomed.bind(this), this.zoomEnd = this.zoomEnd.bind(this), this.zoomIn = this.zoomIn.bind(this), this.zoomOut = this.zoomOut.bind(this), this.reset = this.reset.bind(this), this.fullView = this.fullView.bind(this), this.transition2fullView = this.transition2fullView.bind(this), this._fullView = this._fullView.bind(this), this.initialized = !1, this.zoom = f.zoom().scaleExtent([0.1, 300]).on("zoom", this.zoomed).on("end", this.zoomEnd);
8
+ super(t), this.zoomRef = y.createRef(), this.lastInternalZoom = null, this.lastUserTransform = null, this.zoomed = this.zoomed.bind(this), this.zoomEnd = this.zoomEnd.bind(this), this.zoomIn = this.zoomIn.bind(this), this.zoomOut = this.zoomOut.bind(this), this.reset = this.reset.bind(this), this.fullView = this.fullView.bind(this), this.transition2fullView = this.transition2fullView.bind(this), this._fullView = this._fullView.bind(this), this.initialized = !1, this.zoom = u.zoom().scaleExtent([0.1, 300]).on("zoom", this.zoomed).on("end", this.zoomEnd);
9
9
  }
10
10
  componentDidMount() {
11
11
  const { zoomEnabled: t = !0 } = this.props, i = this.getSelection();
12
- this._fullView(!1), t && (this.props.editing || (i.on("dblclick.zoom", null), i.on("dblclick", (o) => {
12
+ this._fullView(!1), t && (i.on("dblclick.zoom", null), i.on("dblclick", (o) => {
13
13
  o.preventDefault(), i.transition().duration(250).call(this.zoom.scaleBy, 1.5);
14
14
  }), i.on("wheel.zoom", null), i.on("wheel", (o) => {
15
15
  o.preventDefault();
16
16
  const s = o.deltaY > 0 ? 1 / 1.5 : 1.5;
17
17
  i.transition().duration(250).call(this.zoom.scaleBy, s);
18
- }), i.call(this.zoom))), this.fullView();
18
+ }), i.call(this.zoom)), this.fullView();
19
19
  }
20
20
  componentDidUpdate(t) {
21
21
  const i = this.getSelection(), {
22
22
  zoomEnabled: o,
23
23
  initialPosition: s,
24
- readyState: c,
25
- height: d,
24
+ readyState: d,
25
+ height: f,
26
26
  width: h,
27
27
  selectedPoint: e,
28
- projection: m,
29
- editing: a
28
+ projection: a,
29
+ editing: l
30
30
  } = this.props;
31
31
  !this.initialized && this.props.readyToZoom && (this.fullView(), this.initialized = !0);
32
- const l = JSON.stringify(t.initialPosition) !== JSON.stringify(s);
33
- if (t.zoomEnabled !== o || l)
34
- if (o && i || a) {
32
+ const m = JSON.stringify(t.initialPosition) !== JSON.stringify(s);
33
+ if (console.log("zoomChanged", m), t.zoomEnabled !== o || m && !l)
34
+ if (o && i || l) {
35
35
  if (s && this.lastInternalZoom) {
36
- const r = (S, x = 3) => Number(S.toFixed(x)), { x: p, y: u, k: z } = s, { x: g, y: w, k: V } = this.lastInternalZoom;
37
- if (Math.abs(r(p) - r(g)) < 1 && Math.abs(r(u) - r(w)) < 1 && Math.abs(r(z) - r(V)) < 1e-3) {
36
+ const n = (x, S = 3) => Number(x.toFixed(S)), { x: c, y: z, k: p } = s, { x: g, y: w, k: V } = this.lastInternalZoom;
37
+ if (Math.abs(n(c) - n(g)) < 1 && Math.abs(n(z) - n(w)) < 1 && Math.abs(n(p) - n(V)) < 1e-3) {
38
38
  this.lastInternalZoom = null;
39
39
  return;
40
40
  }
41
41
  }
42
42
  i.call(this.zoom).on(".zoom", this.zoom), this.transition2fullView();
43
43
  } else i && i.on(".zoom", null);
44
- !t.readyState && c && this.fullView(), (t.height !== d || t.width !== h) && this.fullView(), e != t.selectedPoint && e && this.zoomTo(m([e.y, e.x]));
44
+ !t.readyState && d && this.fullView(), (t.height !== f || t.width !== h) && this.fullView(), e != t.selectedPoint && e && this.zoomTo(a([e.y, e.x]));
45
45
  }
46
46
  zoomed(t) {
47
47
  var o, s;
@@ -49,20 +49,20 @@ class T extends y.Component {
49
49
  i && (i.selectAll("g.zoomable").attr("transform", t.transform), (s = (o = this.props).onZoomed) == null || s.call(o, t.transform), this.props.editing && t.sourceEvent && (this.lastUserTransform = t.transform));
50
50
  }
51
51
  zoomEnd(t) {
52
- var e, m;
53
- const { identifier: i, editing: o, width: s, height: c, postMessageOrigin: d = "*" } = this.props, h = this.lastUserTransform || t.transform;
54
- if (this.lastUserTransform = null, (m = (e = this.props).onZoomed) == null || m.call(e, h), o) {
55
- const a = (g, w = 3) => Number(g.toFixed(w)), { x: l, y: r, k: p } = h, u = { x: a(l), y: a(r), k: a(p) };
56
- this.lastInternalZoom = u;
57
- const z = {
52
+ var e, a;
53
+ const { identifier: i, editing: o, width: s, height: d, postMessageOrigin: f = "*" } = this.props, h = this.lastUserTransform || t.transform;
54
+ if (this.lastUserTransform = null, (a = (e = this.props).onZoomed) == null || a.call(e, h), o) {
55
+ const l = (g, w = 3) => Number(g.toFixed(w)), { x: m, y: n, k: c } = h, z = { x: l(m), y: l(n), k: l(c) };
56
+ this.lastInternalZoom = z;
57
+ const p = {
58
58
  type: `d3_map_${i}`,
59
59
  value: {
60
- ...u,
60
+ ...z,
61
61
  width: s,
62
- height: c
62
+ height: d
63
63
  }
64
64
  };
65
- window.parent.postMessage(z, d);
65
+ window.parent.postMessage(p, f);
66
66
  }
67
67
  }
68
68
  zoomIn() {
@@ -73,7 +73,7 @@ class T extends y.Component {
73
73
  }
74
74
  }
75
75
  zoomTo(t) {
76
- const i = f.zoomIdentity.translate(this.props.width / 2, this.props.height / 2).scale(200).translate(-t[0], -t[1]), o = this.getSelection();
76
+ const i = u.zoomIdentity.translate(this.props.width / 2, this.props.height / 2).scale(200).translate(-t[0], -t[1]), o = this.getSelection();
77
77
  this.props.editing || this.props.transitionDuration, o.transition().duration(750).call(this.zoom.transform, i);
78
78
  }
79
79
  zoomOut() {
@@ -85,18 +85,18 @@ class T extends y.Component {
85
85
  }
86
86
  reset() {
87
87
  const t = this.getSelection();
88
- t && (this.props.editing ? t.call(this.zoom.transform, f.zoomIdentity.translate(0, 0).scale(1)) : this.transition2fullView());
88
+ t && (this.props.editing ? t.call(this.zoom.transform, u.zoomIdentity.translate(0, 0).scale(1)) : this.transition2fullView());
89
89
  }
90
90
  getSelection() {
91
- return f.select(this.zoomRef.current.parentNode.querySelector("svg"));
91
+ return u.select(this.zoomRef.current.parentNode.querySelector("svg"));
92
92
  }
93
93
  _fullView(t = !0) {
94
- const { initialPosition: i, width: o, height: s, transform: c } = this.props;
94
+ const { initialPosition: i, width: o, height: s, transform: d } = this.props;
95
95
  if (!i) return;
96
- const { x: d = 100, y: h = 23, k: e = 1, width: m, height: a } = i;
97
- if (!m || !a || !e) return;
98
- const l = this.getSelection();
99
- l && (console.log("SVG parent client sizes:", l.node().parentNode.clientWidth, l.node().parentNode.clientHeight), l.transition().duration(t ? 750 : 0).attr("transform", c).call(this.zoom.transform, f.zoomIdentity.translate(d, h).scale(e)));
96
+ const { x: f = 100, y: h = 23, k: e = 1, width: a, height: l } = i;
97
+ if (!a || !l || !e) return;
98
+ const m = f + (o - a) / 2 * (1 - e), n = h + (s - l) / 2 * (1 - e), c = this.getSelection();
99
+ c && c.transition().duration(t ? 750 : 0).attr("transform", d).call(this.zoom.transform, u.zoomIdentity.translate(m, n).scale(e));
100
100
  }
101
101
  transition2fullView() {
102
102
  this._fullView(!0);
@@ -106,19 +106,19 @@ class T extends y.Component {
106
106
  }
107
107
  render() {
108
108
  const { editing: t, zoomEnabled: i = !0 } = this.props;
109
- return /* @__PURE__ */ n("div", { ref: this.zoomRef, className: `zoom ${i ? "" : "disabled"}`, children: (t || i) && /* @__PURE__ */ I("div", { children: [
110
- /* @__PURE__ */ n("div", { className: "button plus", onClick: this.zoomIn, children: /* @__PURE__ */ n(b, { name: "plus", size: "small" }) }),
111
- /* @__PURE__ */ n("div", { className: "button minus", onClick: this.zoomOut, children: /* @__PURE__ */ n(b, { name: "minus", size: "small" }) }),
112
- /* @__PURE__ */ n(
109
+ return /* @__PURE__ */ r("div", { ref: this.zoomRef, className: `zoom ignore ${i ? "" : "disabled"}`, children: (t || i) && /* @__PURE__ */ I("div", { children: [
110
+ /* @__PURE__ */ r("div", { className: "button plus", onClick: this.zoomIn, children: /* @__PURE__ */ r(b, { name: "plus", size: "small" }) }),
111
+ /* @__PURE__ */ r("div", { className: "button minus", onClick: this.zoomOut, children: /* @__PURE__ */ r(b, { name: "minus", size: "small" }) }),
112
+ /* @__PURE__ */ r(
113
113
  k,
114
114
  {
115
- content: /* @__PURE__ */ n(N, { id: "map.reset.tooltip", defaultMessage: "Reset zoom" }),
116
- trigger: /* @__PURE__ */ n("div", { className: "button reset", onClick: this.reset, children: /* @__PURE__ */ n(b, { name: "repeat", size: "small" }) })
115
+ content: /* @__PURE__ */ r(E, { id: "map.reset.tooltip", defaultMessage: "Reset zoom" }),
116
+ trigger: /* @__PURE__ */ r("div", { className: "button reset", onClick: this.reset, children: /* @__PURE__ */ r(b, { name: "repeat", size: "small" }) })
117
117
  }
118
118
  )
119
119
  ] }) });
120
120
  }
121
121
  }
122
122
  export {
123
- T as default
123
+ O as default
124
124
  };
@@ -1,167 +1,185 @@
1
- import { jsx as n, jsxs as H } from "react/jsx-runtime";
2
- import { useState as l, useRef as h, useEffect as R } from "react";
3
- import { connect as K } from "react-redux";
4
- import { parse as i, compareJsonProps as E, decode as O } from "../utils/parseUtils.js";
5
- import Q from "./Map.js";
6
- import U from "./BaseLayer.js";
7
- import X from "./DataLayer.js";
8
- import Y from "./LatLongLayer.js";
9
- import _ from "./ZoomControl.js";
10
- import $ from "./ProjectedContainer.js";
11
- import oo from "./Legends.js";
12
- import eo from "./FlowLayer.js";
13
- const to = (L) => {
1
+ import { jsx as i, jsxs as Q } from "react/jsx-runtime";
2
+ import { useState as l, useRef as F, useEffect as C } from "react";
3
+ import { connect as U } from "react-redux";
4
+ import { parse as c, compareJsonProps as j, decode as X } from "../utils/parseUtils.js";
5
+ import Y from "./Map.js";
6
+ import _ from "./BaseLayer.js";
7
+ import tt from "./DataLayer.js";
8
+ import et from "./LatLongLayer.js";
9
+ import ot from "./ZoomControl.js";
10
+ import it from "./ProjectedContainer.js";
11
+ import nt from "./Legends.js";
12
+ import rt from "./FlowLayer.js";
13
+ const at = (g) => {
14
14
  const {
15
15
  unique: d,
16
- editing: a,
17
- "data-identifier": M,
18
- "data-group": m,
19
- "data-layers": g = "[]",
16
+ editing: n,
17
+ "data-identifier": x,
18
+ "data-group": f,
19
+ "data-layers": h = "[]",
20
20
  "data-height": V = 400,
21
- "data-width": C = 1e3,
22
- "data-back-ground-color": T = "#88e8dc",
23
- "data-map-position": P = "{}",
24
- "data-projection": j = "geoMercator",
25
- "data-zoom-enabled": k = !0,
21
+ "data-width": ct = 1e3,
22
+ "data-back-ground-color": k = "#88e8dc",
23
+ "data-map-position": w = "{}",
24
+ "data-projection": A = "geoMercator",
25
+ "data-zoom-enabled": I = !0,
26
26
  "data-rotation-enabled": z = !1,
27
- "data-wait-for-filters": s = "false",
27
+ "data-wait-for-filters": m = "false",
28
28
  intl: p
29
- } = L, [w, x] = l(i(P, a), []), [r, u] = l(i(g), []), S = h(null), c = h(null), [b, v] = l(null), [F, I] = l(null), [D, N] = l(null);
30
- R(() => {
31
- const o = i(P, a);
32
- E(w, o) || x(o);
33
- }, [P]), R(() => {
34
- const o = i(g);
35
- E(r, o) || u(o);
36
- }, [g]);
37
- const q = (o) => {
38
- const t = r.slice(), e = t.find((f) => f.id == o);
39
- e && (e.visible = !e.visible), u(t);
40
- }, A = (o) => {
41
- const t = r.slice(), e = t.find((f) => f.id == o);
42
- e && (e.patternsVisible = e.patternsVisible == null ? !1 : !e.patternsVisible), u(t);
43
- }, B = (o) => {
44
- N(o);
45
- }, J = (o) => {
46
- const t = r.slice(), e = t.find((f) => f.id == o);
47
- e && (e.colorLayerVisible = e.colorLayerVisible == null ? !1 : !e.colorLayerVisible), u(t);
48
- }, [W, G] = l(!1), Z = h(0);
29
+ } = g, [R, Z] = l(null), v = R, E = Number(V), [P, N] = l(c(w, n), []), [r, b] = l(c(h), []), s = F(null);
30
+ C(() => {
31
+ if (!s.current) return;
32
+ const t = s.current.clientWidth;
33
+ t > 0 && Z(t);
34
+ let o = null;
35
+ const e = () => {
36
+ o && cancelAnimationFrame(o), o = requestAnimationFrame(() => {
37
+ if (!s.current) return;
38
+ const W = s.current.clientWidth;
39
+ W > 0 && Z(W);
40
+ });
41
+ }, a = new ResizeObserver(e);
42
+ return a.observe(s.current), () => {
43
+ a.disconnect(), o && cancelAnimationFrame(o);
44
+ };
45
+ }, []);
46
+ const u = F(null), [L, S] = l(null), [M, q] = l(null), [D, B] = l(null);
47
+ C(() => {
48
+ const t = c(w, n);
49
+ j(P, t) || N(t);
50
+ }, [w]), C(() => {
51
+ const t = c(h);
52
+ j(r, t) || b(t);
53
+ }, [h]);
54
+ const H = (t) => {
55
+ const o = r.slice(), e = o.find((a) => a.id == t);
56
+ e && (e.visible = !e.visible), b(o);
57
+ }, J = (t) => {
58
+ const o = r.slice(), e = o.find((a) => a.id == t);
59
+ e && (e.patternsVisible = e.patternsVisible == null ? !1 : !e.patternsVisible), b(o);
60
+ }, O = (t) => {
61
+ B(t);
62
+ }, $ = (t) => {
63
+ const o = r.slice(), e = o.find((a) => a.id == t);
64
+ e && (e.colorLayerVisible = e.colorLayerVisible == null ? !1 : !e.colorLayerVisible), b(o);
65
+ }, [G, K] = l(!1), T = F(0);
49
66
  r.length;
50
67
  const y = () => {
51
- Z.current += 1, Z.current === r.length && G(!0);
68
+ T.current += 1, T.current >= r.length && K(!0);
52
69
  };
53
- return /* @__PURE__ */ n("div", { ref: S, className: "d3map-container", children: /* @__PURE__ */ H(
54
- $,
70
+ return R ? /* @__PURE__ */ i("div", { ref: s, className: "d3map-container", style: { width: "100%" }, children: /* @__PURE__ */ Q(
71
+ it,
55
72
  {
56
- backgroundColor: O(T),
57
- height: V,
58
- width: C,
59
- projectionName: j,
60
- editing: a,
61
- initialPosition: w,
73
+ backgroundColor: X(k),
74
+ height: E,
75
+ width: v,
76
+ projectionName: A,
77
+ editing: n,
78
+ initialPosition: P,
62
79
  children: [
63
- /* @__PURE__ */ n(Q, { rotationEnabled: i(z, a), children: r.map((o, t) => {
64
- if (o.type === "base")
65
- return /* @__PURE__ */ n(
66
- U,
80
+ /* @__PURE__ */ i(Y, { rotationEnabled: c(z, n), children: r.map((t, o) => {
81
+ if (t.type === "base")
82
+ return /* @__PURE__ */ i(
83
+ _,
67
84
  {
68
- minLabelZoomVisible: o.minLabelZoomVisible,
85
+ minLabelZoomVisible: t.minLabelZoomVisible,
69
86
  onReady: y,
70
- transform: b,
87
+ transform: L,
71
88
  intl: p,
72
- zoom: c,
89
+ zoom: u,
73
90
  unique: d,
74
- ...o
91
+ ...t
75
92
  },
76
- t
93
+ t.id
77
94
  );
78
- if (o.type === "data")
79
- return /* @__PURE__ */ n(
80
- X,
95
+ if (t.type === "data")
96
+ return /* @__PURE__ */ i(
97
+ tt,
81
98
  {
82
- minLabelZoomVisible: o.minLabelZoomVisible,
83
- editing: a,
99
+ minLabelZoomVisible: t.minLabelZoomVisible,
100
+ editing: n,
84
101
  onLayerCreated: (e) => {
85
102
  },
86
103
  onReady: y,
87
- transform: b,
104
+ transform: L,
88
105
  intl: p,
89
- group: m,
90
- zoom: c,
106
+ group: f,
107
+ zoom: u,
91
108
  unique: d,
92
- ...o,
93
- settings: L.wordress,
94
- togglePatterns: A,
95
- initialPosition: w,
96
- waitForFilters: s == "true" || s == !0
109
+ ...t,
110
+ settings: g.wordress,
111
+ togglePatterns: J,
112
+ initialPosition: P,
113
+ waitForFilters: m == "true" || m == !0
97
114
  },
98
- t
115
+ t.id
99
116
  );
100
- if (o.type === "flow")
101
- return /* @__PURE__ */ n(
102
- eo,
117
+ if (t.type === "flow")
118
+ return /* @__PURE__ */ i(
119
+ rt,
103
120
  {
104
121
  onReady: y,
105
- transform: b,
122
+ transform: L,
106
123
  intl: p,
107
- group: m,
108
- zoom: c,
124
+ group: f,
125
+ zoom: u,
109
126
  unique: d,
110
- ...o,
111
- waitForFilters: s == "true" || s == !0
127
+ ...t,
128
+ waitForFilters: m == "true" || m == !0
112
129
  },
113
- t
130
+ t.id
114
131
  );
115
- if (o.type === "dataPoints")
116
- return /* @__PURE__ */ n(
117
- Y,
132
+ if (t.type === "dataPoints")
133
+ return /* @__PURE__ */ i(
134
+ et,
118
135
  {
119
136
  onReady: y,
120
- onZoomToPoint: B,
121
- selectedItem: F,
122
- transform: b,
137
+ onZoomToPoint: O,
138
+ selectedItem: M,
139
+ transform: L,
123
140
  intl: p,
124
- group: m,
125
- zoom: c,
141
+ group: f,
142
+ zoom: u,
126
143
  unique: d,
127
- ...o,
128
- waitForFilters: s == "true" || s == !0
144
+ ...t,
145
+ waitForFilters: m == "true" || m == !0
129
146
  },
130
- t
147
+ t.id
131
148
  );
132
149
  }) }),
133
- /* @__PURE__ */ n(
134
- oo,
150
+ /* @__PURE__ */ i(
151
+ nt,
135
152
  {
136
- selectedItem: F,
137
- d2Click: (o) => I(o),
153
+ selectedItem: M,
154
+ unique: d,
155
+ d2Click: (t) => q(t),
138
156
  patternsData: null,
139
157
  layers: r,
140
- group: m,
141
- onItemClick: q,
142
- toggleColorLayer: J
158
+ group: f,
159
+ onItemClick: H,
160
+ toggleColorLayer: $
143
161
  }
144
162
  ),
145
- /* @__PURE__ */ n(
146
- _,
163
+ /* @__PURE__ */ i(
164
+ ot,
147
165
  {
148
- readyToZoom: W,
166
+ readyToZoom: G,
149
167
  selectedPoint: D,
150
- rootationEmabled: i(z, a),
151
- zoomEnabled: i(k, a),
152
- onZoomed: v,
153
- width: C,
154
- height: V,
155
- ref: c,
156
- group: m,
157
- identifier: M,
158
- editing: a
168
+ rootationEmabled: c(z, n),
169
+ zoomEnabled: c(I, n),
170
+ onZoomed: S,
171
+ width: v,
172
+ height: E,
173
+ ref: u,
174
+ group: f,
175
+ identifier: x,
176
+ editing: n
159
177
  }
160
178
  )
161
179
  ]
162
180
  }
163
- ) });
164
- }, ao = (L, d) => ({}), ro = {}, go = K(ao, ro)(to);
181
+ ) }) : /* @__PURE__ */ i("div", { ref: s, className: "d3map-container", style: { width: "100%", height: `${V}px` } });
182
+ }, st = (g, d) => ({}), lt = {}, Ft = U(st, lt)(at);
165
183
  export {
166
- go as default
184
+ Ft as default
167
185
  };
@@ -1,40 +1,53 @@
1
- import { jsx as r, jsxs as c } from "react/jsx-runtime";
2
- import u from "react";
3
- import { connect as S } from "react-redux";
4
- import { injectIntl as C } from "react-intl";
5
- import { CategoriesContext as D } from "./DataContext.js";
6
- import { getCategories as v } from "../reducers/data.js";
7
- import { Container as h, Segment as l } from "semantic-ui-react";
8
- class x extends u.Component {
1
+ import { jsx as r, jsxs as C } from "react/jsx-runtime";
2
+ import x from "react";
3
+ import { connect as L } from "react-redux";
4
+ import { injectIntl as J } from "react-intl";
5
+ import { CategoriesContext as M } from "./DataContext.js";
6
+ import { loadFilterItems as N, getCategories as T } from "../reducers/data.js";
7
+ import { Container as D, Segment as v } from "semantic-ui-react";
8
+ const j = ({ data: t, children: e }) => {
9
+ const o = x.useMemo(() => t ? t.toJS() : null, [t]);
10
+ return /* @__PURE__ */ r(M.Provider, { value: o, children: e });
11
+ };
12
+ class k extends x.Component {
9
13
  componentDidMount() {
10
- const { categories: t } = this.props;
11
- !t && !this.props.loading && this.props.onLoadData(this.props);
14
+ const { categories: e } = this.props;
15
+ !e && !this.props.loading && this.props.onLoadData(this.props);
12
16
  }
13
- componentDidUpdate(t, s, n) {
14
- const { app: e, filters: a, source: o, store: m, params: p, csv: d, group: g, editing: f } = this.props;
15
- (a != t.filters || JSON.stringify(p) != JSON.stringify(t.params) || e != t.app || t.source != o || d != t.csv) && (e === "csv" ? this.props.onSetData({ app: e, csv: d, store: m, params: p, group: g }) : (f && (p.v = (Math.random() + 1).toString(36).substring(7)), this.setState({ showLoading: !1 }), this.props.onLoadData(this.props), setTimeout(this.checkLoadingTime, 100)));
17
+ componentDidUpdate(e, o, n) {
18
+ const { app: a, parentSelectedItems: p, filters: c, source: m, store: u, params: i, csv: l, group: s, editing: d } = this.props;
19
+ e.parentSelectedItems && p && p.length != e.parentSelectedItems.length && this.props.onReLoadItems(this.props), (c != e.filters || JSON.stringify(i) != JSON.stringify(e.params) || a != e.app || e.source != m || l != e.csv) && (a === "csv" ? this.props.onSetData({ app: a, csv: l, store: u, params: i, group: s }) : (d && (i.v = (Math.random() + 1).toString(36).substring(7)), this.setState({ showLoading: !1 }), this.props.onLoadData(this.props), setTimeout(this.checkLoadingTime, 100)));
16
20
  }
17
21
  render() {
18
- const { data: t, loading: s, error: n } = this.props;
19
- return s ? /* @__PURE__ */ r(h, {}) : t ? /* @__PURE__ */ r(D.Provider, { value: t.toJS(), children: this.props.children }) : n ? /* @__PURE__ */ c(l, { color: "red", children: [
22
+ const { data: e, loading: o, error: n } = this.props;
23
+ return o ? /* @__PURE__ */ r(D, { children: /* @__PURE__ */ r("div", { className: "filter-skeleton-placeholder", children: /* @__PURE__ */ r("div", { className: "filter-skeleton-shimmer" }) }) }) : e ? /* @__PURE__ */ r(j, { data: e, children: this.props.children }) : n ? /* @__PURE__ */ C(v, { color: "red", children: [
20
24
  /* @__PURE__ */ r("h1", { children: "500" }),
21
25
  /* @__PURE__ */ r("p", { children: "Wasn't able to load data" })
22
- ] }) : /* @__PURE__ */ r(h, { children: /* @__PURE__ */ c(l, { color: "red", children: [
26
+ ] }) : /* @__PURE__ */ r(D, { children: /* @__PURE__ */ C(v, { color: "red", children: [
23
27
  /* @__PURE__ */ r("h1", { children: "404" }),
24
28
  /* @__PURE__ */ r("p", { children: "Can't find this page" })
25
29
  ] }) });
26
30
  }
27
31
  }
28
- const I = (i, t) => {
29
- const { app: s, params: n, dvzProxyDatasetId: e, uniqueStorage: a } = t, o = ["data", "categories", s];
30
- return e && o.push(e), a && o.push(a), {
31
- data: i.getIn([...o, "items"]),
32
- error: i.getIn([...o, "error"]),
33
- loading: i.getIn([...o, "loading"])
32
+ const R = (t, e) => {
33
+ const { app: o, group: n, type: a, parentType: p, param: c, parentParam: m, params: u, dvzProxyDatasetId: i, uniqueStorage: l } = e, s = ["data", "categories", o];
34
+ i && s.push(i), l && s.push(l);
35
+ const d = t.getIn([...s, "items"]), h = d ? d.toJS() : [], y = t.getIn(["data", "filters", o, n, c]), g = h.filter((f) => f.type == a);
36
+ g && g.length > 0 && g[0].items;
37
+ let I = [], S = [];
38
+ return p && (I = h.filter((f) => f.type == p), S = t.getIn(["data", "filters", o, n, m])), {
39
+ parentSelectedItems: S,
40
+ selectedItems: y,
41
+ items: h,
42
+ parentItems: I,
43
+ data: t.getIn([...s, "items"]),
44
+ error: t.getIn([...s, "error"]),
45
+ loading: t.getIn([...s, "loading"])
34
46
  };
35
- }, L = {
36
- onLoadData: v
37
- }, O = S(I, L)(C(x));
47
+ }, b = {
48
+ onLoadData: T,
49
+ onReLoadItems: N
50
+ }, U = L(R, b)(J(k));
38
51
  export {
39
- O as default
52
+ U as default
40
53
  };
@@ -0,0 +1,7 @@
1
+ import { jsx as e } from "react/jsx-runtime";
2
+ import r from "react";
3
+ import { DataContext as m } from "./DataContext.js";
4
+ const c = (t) => /* @__PURE__ */ e(m.Consumer, { children: (n) => /* @__PURE__ */ e(r.Fragment, { children: r.Children.map(t.children, (o) => r.cloneElement(o, { data: n })) }) });
5
+ export {
6
+ c as default
7
+ };