@guardian/interactive-component-library 0.1.0-alpha.18 → 0.1.0-alpha.19

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.
@@ -3,11 +3,13 @@
3
3
  })(this, function(exports2, jsxRuntime, hooks, preact, compat, d3Scale, d3Geo) {
4
4
  "use strict";
5
5
  const main = "";
6
- const group = "_group_nq9z3_1";
7
- const rotated = "_rotated_nq9z3_6";
8
- const path$4 = "_path_nq9z3_10";
9
- const active = "_active_nq9z3_14";
10
- const defaultStyles$s = {
6
+ const svg$9 = "_svg_b5io0_1";
7
+ const group = "_group_b5io0_5";
8
+ const rotated = "_rotated_b5io0_10";
9
+ const path$4 = "_path_b5io0_14";
10
+ const active = "_active_b5io0_18";
11
+ const defaultStyles$t = {
12
+ svg: svg$9,
11
13
  group,
12
14
  rotated,
13
15
  path: path$4,
@@ -46,19 +48,20 @@
46
48
  styles: styles2
47
49
  }) {
48
50
  const defaultStylesCopy = {
49
- ...defaultStyles$s
51
+ ...defaultStyles$t
50
52
  };
51
53
  if (active2) {
52
- defaultStylesCopy.path = mergeStyles(defaultStyles$s.path, defaultStyles$s.active);
54
+ defaultStylesCopy.path = mergeStyles(defaultStyles$t.path, defaultStyles$t.active);
53
55
  }
54
56
  if (direction === DIRECTION.up) {
55
- defaultStylesCopy.group = mergeStyles(defaultStyles$s.group, defaultStyles$s.rotated);
57
+ defaultStylesCopy.group = mergeStyles(defaultStyles$t.group, defaultStyles$t.rotated);
56
58
  }
57
59
  styles2 = mergeStyles(defaultStylesCopy, styles2);
58
60
  return jsxRuntime.jsx("svg", {
59
61
  width: "16",
60
62
  height: "24",
61
63
  viewBox: "0 0 16 24",
64
+ className: styles2.svg,
62
65
  fill: "none",
63
66
  xmlns: "http://www.w3.org/2000/svg",
64
67
  children: jsxRuntime.jsx("g", {
@@ -73,12 +76,12 @@
73
76
  })
74
77
  });
75
78
  }
76
- const container$4 = "_container_jzalm_1";
79
+ const container$5 = "_container_jzalm_1";
77
80
  const dot = "_dot_jzalm_6";
78
81
  const circle$2 = "_circle_jzalm_13";
79
82
  const text$4 = "_text_jzalm_17";
80
- const defaultStyles$r = {
81
- container: container$4,
83
+ const defaultStyles$s = {
84
+ container: container$5,
82
85
  dot,
83
86
  circle: circle$2,
84
87
  text: text$4
@@ -94,10 +97,10 @@
94
97
  abbreviation
95
98
  }) => {
96
99
  const defaultStylesCopy = {
97
- ...defaultStyles$r
100
+ ...defaultStyles$s
98
101
  };
99
102
  if (dotType === DOT_TYPE.round) {
100
- defaultStylesCopy.dot = mergeStyles(defaultStyles$r.dot, defaultStyles$r.circle);
103
+ defaultStylesCopy.dot = mergeStyles(defaultStyles$s.dot, defaultStyles$s.circle);
101
104
  }
102
105
  styles2 = mergeStyles(defaultStylesCopy, styles2);
103
106
  return jsxRuntime.jsxs("div", {
@@ -110,19 +113,60 @@
110
113
  })]
111
114
  });
112
115
  };
113
- const bar$2 = "_bar_wmb0k_1";
114
- const label$1 = "_label_wmb0k_5";
115
- const backgroundRect = "_backgroundRect_wmb0k_11";
116
- const defaultStyles$q = {
116
+ const bar$2 = "_bar_bf839_1";
117
+ const label$1 = "_label_bf839_5";
118
+ const backgroundRect = "_backgroundRect_bf839_11";
119
+ const defaultStyles$r = {
117
120
  bar: bar$2,
118
121
  label: label$1,
119
122
  backgroundRect
120
123
  };
124
+ function preventOverlap(labelPositions, iteration = 0, labelSize = 12, coordinate = "y") {
125
+ const maxIterations = 10;
126
+ let totalOverlap = 0;
127
+ for (let index2 = 1; index2 < labelPositions.length; index2++) {
128
+ const previousElement = labelPositions[index2 - 1];
129
+ const element = labelPositions[index2];
130
+ const overlap = previousElement[coordinate] - (element[coordinate] - labelSize);
131
+ if (overlap < 0) {
132
+ continue;
133
+ }
134
+ previousElement[coordinate] -= overlap / 2;
135
+ element[coordinate] += overlap / 2;
136
+ totalOverlap += overlap;
137
+ }
138
+ if (totalOverlap > 0 && iteration < maxIterations) {
139
+ return preventOverlap(labelPositions, iteration + 1);
140
+ }
141
+ return labelPositions;
142
+ }
143
+ function uniqueBy(array, key) {
144
+ return [...array.reduce((map, d2) => map.set(d2[key], d2), /* @__PURE__ */ new Map()).values()];
145
+ }
146
+ function positionLabels(labels, coordinate = "y") {
147
+ labels = uniqueBy(labels, "value");
148
+ labels.sort((a, b) => a[coordinate] - b[coordinate]);
149
+ return preventOverlap(labels);
150
+ }
151
+ function scaleLinear(domain, range) {
152
+ const [domainMin, domainMax] = domain;
153
+ const [rangeMin, rangeMax] = range;
154
+ const slope = (rangeMax - rangeMin) / (domainMax - domainMin);
155
+ const intercept = rangeMin - slope * domainMin;
156
+ return function(x) {
157
+ return slope * x + intercept;
158
+ };
159
+ }
160
+ const LabelType = {
161
+ hanging: "hanging",
162
+ inline: "inline"
163
+ };
121
164
  function StackedBar({
122
165
  stack,
123
166
  width,
124
167
  height,
125
- hideLabels = true,
168
+ hideLabels = false,
169
+ labelType = LabelType.hanging,
126
170
  showBackgroundRect = false,
127
171
  createSVG = true,
128
172
  styles: styles2
@@ -130,11 +174,32 @@
130
174
  const rectElements = hooks.useRef([]);
131
175
  const textElements = hooks.useRef([]);
132
176
  styles2 = mergeStyles({
133
- ...defaultStyles$q
177
+ ...defaultStyles$r
134
178
  }, styles2);
179
+ const svgHeight = labelType === LabelType.hanging ? height + 20 : height;
180
+ const renderLabel = (config, i) => jsxRuntime.jsx("text", {
181
+ ref: (element) => textElements.current[i] = element,
182
+ "text-rendering": "optimizeLegibility",
183
+ className: styles2.label,
184
+ style: {
185
+ display: "visible"
186
+ },
187
+ x: config.x,
188
+ y: config.y,
189
+ textAnchor: config.textAnchor,
190
+ alignmentBaseline: config.alignmentBaseline,
191
+ children: config.value
192
+ }, `label-${i}`);
135
193
  let totalWidth = 0;
136
194
  const content2 = stack.map((d2, index2) => {
137
195
  const itemWidth = d2.fraction * width;
196
+ const labelConfig = {
197
+ value: d2.label,
198
+ x: itemWidth - 4,
199
+ y: height / 2,
200
+ textAnchor: "end",
201
+ alignmentBaseline: "central"
202
+ };
138
203
  const value = jsxRuntime.jsxs("g", {
139
204
  transform: `translate(${totalWidth}, 0)`,
140
205
  children: [jsxRuntime.jsx("rect", {
@@ -146,23 +211,28 @@
146
211
  fill: d2.fill
147
212
  },
148
213
  "shape-rendering": "crispEdges"
149
- }), !hideLabels && jsxRuntime.jsx("text", {
150
- ref: (element) => textElements.current[index2] = element,
151
- x: itemWidth - 4,
152
- y: height / 2,
153
- "text-anchor": "end",
154
- "alignment-baseline": "central",
155
- "text-rendering": "optimizeLegibility",
156
- className: styles2.label,
157
- style: {
158
- display: hideLabels ? "hidden" : "visible"
159
- },
160
- children: d2.label
161
- })]
214
+ }), labelType === LabelType.inline && !hideLabels && renderLabel(labelConfig, index2)]
162
215
  }, index2);
163
216
  totalWidth += itemWidth;
164
217
  return value;
165
218
  });
219
+ const hangingLabelConfig = hooks.useMemo(() => {
220
+ let totalW = 0;
221
+ let labels = stack.map((d2) => {
222
+ const itemWidth = d2.fraction * width;
223
+ const labelConfig = {
224
+ x: itemWidth + totalW,
225
+ y: height + 4,
226
+ value: d2.label,
227
+ textAnchor: "end",
228
+ alignmentBaseline: "hanging"
229
+ };
230
+ console.log(labelConfig);
231
+ totalW += itemWidth;
232
+ return labelConfig;
233
+ });
234
+ return preventOverlap(labels, 0, 20, "x");
235
+ }, [stack, height, width]);
166
236
  const backgroundRect2 = jsxRuntime.jsx("g", {
167
237
  children: jsxRuntime.jsx("rect", {
168
238
  x: "0",
@@ -176,14 +246,16 @@
176
246
  return jsxRuntime.jsxs("svg", {
177
247
  overflow: "hidden",
178
248
  width,
179
- height,
180
- viewBox: `0 0 ${width} ${height}`,
249
+ height: svgHeight,
250
+ viewBox: `0 0 ${width} ${svgHeight}`,
181
251
  xmlns: "http://www.w3.org/2000/svg",
182
- children: [showBackgroundRect && backgroundRect2, content2]
252
+ children: [showBackgroundRect && backgroundRect2, jsxRuntime.jsxs("g", {
253
+ children: [content2, labelType === LabelType.hanging && !hideLabels && hangingLabelConfig.map((config, i) => renderLabel(config, i))]
254
+ })]
183
255
  });
184
256
  }
185
- return jsxRuntime.jsx(jsxRuntime.Fragment, {
186
- children: content2
257
+ return jsxRuntime.jsxs("g", {
258
+ children: [content2, labelType === LabelType.hanging && !hideLabels && hangingLabelConfig.map((config, i) => renderLabel(config, i))]
187
259
  });
188
260
  }
189
261
  function shouldUpdate(oldState, newState) {
@@ -243,7 +315,7 @@
243
315
  const svg$8 = "_svg_1cajk_6";
244
316
  const previous = "_previous_1cajk_12";
245
317
  const next = "_next_1cajk_16";
246
- const defaultStyles$p = {
318
+ const defaultStyles$q = {
247
319
  svg: svg$8,
248
320
  previous,
249
321
  next
@@ -254,7 +326,7 @@
254
326
  next: next2,
255
327
  styles: styles2
256
328
  } = props;
257
- styles2 = mergeStyles(defaultStyles$p, styles2);
329
+ styles2 = mergeStyles(defaultStyles$q, styles2);
258
330
  const gradientId = `gv-gradient-def-${previous2}-${next2}`;
259
331
  const gradients = useGradients();
260
332
  hooks.useEffect(() => {
@@ -321,9 +393,9 @@
321
393
  })
322
394
  });
323
395
  }
324
- const button$4 = "_button_kpmyt_1";
325
- const svg$7 = "_svg_kpmyt_14";
326
- const defaultStyles$o = {
396
+ const button$4 = "_button_oqopj_1";
397
+ const svg$7 = "_svg_oqopj_15";
398
+ const defaultStyles$p = {
327
399
  button: button$4,
328
400
  svg: svg$7
329
401
  };
@@ -332,7 +404,7 @@
332
404
  styles: styles2
333
405
  }) => {
334
406
  styles2 = mergeStyles({
335
- ...defaultStyles$o
407
+ ...defaultStyles$p
336
408
  }, styles2);
337
409
  return jsxRuntime.jsx("button", {
338
410
  class: styles2.button,
@@ -350,7 +422,7 @@
350
422
  const svg$6 = "_svg_1v49v_1";
351
423
  const circle$1 = "_circle_1v49v_5";
352
424
  const pulse = "_pulse_1v49v_9";
353
- const defaultStyles$n = {
425
+ const defaultStyles$o = {
354
426
  svg: svg$6,
355
427
  circle: circle$1,
356
428
  pulse
@@ -360,7 +432,7 @@
360
432
  pulse: pulse2 = false,
361
433
  styles: styles2
362
434
  }) => {
363
- styles2 = mergeStyles(defaultStyles$n, styles2);
435
+ styles2 = mergeStyles(defaultStyles$o, styles2);
364
436
  return jsxRuntime.jsx("svg", {
365
437
  style: styles2.svg,
366
438
  fill: "none",
@@ -380,7 +452,7 @@
380
452
  });
381
453
  };
382
454
  const text$3 = "_text_1okyv_1";
383
- const defaultStyles$m = {
455
+ const defaultStyles$n = {
384
456
  text: text$3
385
457
  };
386
458
  var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
@@ -730,7 +802,7 @@
730
802
  styles: styles2
731
803
  }) => {
732
804
  styles2 = mergeStyles({
733
- ...defaultStyles$m
805
+ ...defaultStyles$n
734
806
  }, styles2);
735
807
  let timeSince = dayjs(timeStamp).fromNow();
736
808
  return jsxRuntime.jsx("span", {
@@ -740,7 +812,7 @@
740
812
  };
741
813
  const pageContainer = "_pageContainer_1s0yq_9";
742
814
  const sideBorders = "_sideBorders_1s0yq_42";
743
- const defaultStyles$l = {
815
+ const defaultStyles$m = {
744
816
  pageContainer,
745
817
  sideBorders
746
818
  };
@@ -752,15 +824,19 @@
752
824
  const {
753
825
  pageContainer: pageContainer2,
754
826
  sideBorders: sideBordersStyle
755
- } = mergeStyles(defaultStyles$l, styles2);
827
+ } = mergeStyles(defaultStyles$m, styles2);
756
828
  return jsxRuntime.jsx("div", {
757
829
  className: [pageContainer2, sideBorders2 && sideBordersStyle].join(" "),
758
830
  children
759
831
  });
760
832
  }
761
- const bar$1 = "_bar_17pyf_9";
762
- const defaultStyles$k = {
763
- bar: bar$1
833
+ const wrapper = "_wrapper_5oj1x_9";
834
+ const bar$1 = "_bar_5oj1x_14";
835
+ const zero = "_zero_5oj1x_19";
836
+ const defaultStyles$l = {
837
+ wrapper,
838
+ bar: bar$1,
839
+ zero
764
840
  };
765
841
  function ChangeBar({
766
842
  fraction,
@@ -776,23 +852,27 @@
776
852
  let posleft = `${centre}px`;
777
853
  let thisStyles = ` height: ${height}; width: ${barwidth}px; ${positive ? `left: ${posleft}` : `left: ${negleft}`}`;
778
854
  let thisColor = ` bg-color--${party}`;
855
+ let zeroStyles = ` height: ${height};`;
779
856
  styles2 = mergeStyles({
780
- ...defaultStyles$k
857
+ ...defaultStyles$l
781
858
  }, styles2);
782
- return jsxRuntime.jsx("div", {
859
+ return jsxRuntime.jsxs("div", {
783
860
  className: styles2.wrapper,
784
861
  style: `width: ${width}px`,
785
- children: jsxRuntime.jsx("div", {
862
+ children: [jsxRuntime.jsx("div", {
786
863
  className: styles2.bar.concat(thisColor),
787
864
  style: thisStyles
788
- })
865
+ }), jsxRuntime.jsx("div", {
866
+ className: styles2.zero,
867
+ style: zeroStyles
868
+ })]
789
869
  });
790
870
  }
791
871
  const svg$5 = "_svg_886i1_9";
792
872
  const dividingLineColor = "_dividingLineColor_886i1_16";
793
873
  const square = "_square_886i1_20";
794
874
  const corner = "_corner_886i1_24";
795
- const defaultStyles$j = {
875
+ const defaultStyles$k = {
796
876
  svg: svg$5,
797
877
  dividingLineColor,
798
878
  square,
@@ -805,7 +885,7 @@
805
885
  styles: styles2
806
886
  }) => {
807
887
  styles2 = mergeStyles({
808
- ...defaultStyles$j
888
+ ...defaultStyles$k
809
889
  }, styles2);
810
890
  let cornerSize = squareSize * 0.625;
811
891
  let cornerMargin = squareSize < 100 ? squareSize / 6 : 10;
@@ -838,12 +918,12 @@
838
918
  })
839
919
  });
840
920
  };
841
- const stackedGridContainer = "_stackedGridContainer_1e05o_1";
842
- const stackedGridRotateItems0 = "_stackedGridRotateItems0_1e05o_13";
843
- const stackedGridRotateItems90 = "_stackedGridRotateItems90_1e05o_19";
844
- const stackedGridRotateItems180 = "_stackedGridRotateItems180_1e05o_25";
845
- const stackedGridRotateItems270 = "_stackedGridRotateItems270_1e05o_31";
846
- const defaultStyles$i = {
921
+ const stackedGridContainer = "_stackedGridContainer_6whof_1";
922
+ const stackedGridRotateItems0 = "_stackedGridRotateItems0_6whof_11";
923
+ const stackedGridRotateItems90 = "_stackedGridRotateItems90_6whof_17";
924
+ const stackedGridRotateItems180 = "_stackedGridRotateItems180_6whof_23";
925
+ const stackedGridRotateItems270 = "_stackedGridRotateItems270_6whof_29";
926
+ const defaultStyles$j = {
847
927
  stackedGridContainer,
848
928
  stackedGridRotateItems0,
849
929
  stackedGridRotateItems90,
@@ -869,29 +949,23 @@
869
949
  const StackedGrid = ({
870
950
  fromLeft,
871
951
  fromBottom,
872
- containerWidth,
873
952
  children,
874
953
  styles: styles2
875
954
  }) => {
876
955
  let containerFlip = getContainerFlip(fromBottom, fromLeft);
877
956
  let itemRotateClass = getItemRotate(fromBottom, fromLeft);
878
- let flexStyles = {
879
- display: "flex",
880
- flexDirection: "row",
881
- flexWrap: "wrap",
882
- width: containerWidth,
883
- transform: containerFlip
884
- };
885
- styles2 = mergeStyles(defaultStyles$i, styles2);
957
+ styles2 = mergeStyles(defaultStyles$j, styles2);
886
958
  return jsxRuntime.jsx("div", {
887
- style: flexStyles,
959
+ style: {
960
+ transform: containerFlip
961
+ },
888
962
  className: `${styles2.stackedGridContainer} ${styles2[itemRotateClass]}`,
889
963
  children
890
964
  });
891
965
  };
892
966
  const svg$4 = "_svg_l2fsl_9";
893
967
  const squareFill = "_squareFill_l2fsl_16";
894
- const defaultStyles$h = {
968
+ const defaultStyles$i = {
895
969
  svg: svg$4,
896
970
  squareFill
897
971
  };
@@ -901,7 +975,7 @@
901
975
  styles: styles2
902
976
  }) => {
903
977
  styles2 = mergeStyles({
904
- ...defaultStyles$h
978
+ ...defaultStyles$i
905
979
  }, styles2);
906
980
  return jsxRuntime.jsx("svg", {
907
981
  width: size,
@@ -919,7 +993,7 @@
919
993
  };
920
994
  const button$3 = "_button_1fees_1";
921
995
  const icon = "_icon_1fees_6";
922
- const defaultStyles$g = {
996
+ const defaultStyles$h = {
923
997
  button: button$3,
924
998
  icon
925
999
  };
@@ -929,7 +1003,7 @@
929
1003
  styles: styles2,
930
1004
  onClick
931
1005
  }) {
932
- styles2 = mergeStyles(defaultStyles$g, styles2);
1006
+ styles2 = mergeStyles(defaultStyles$h, styles2);
933
1007
  return jsxRuntime.jsx("button", {
934
1008
  className: styles2.button,
935
1009
  disabled,
@@ -953,9 +1027,9 @@
953
1027
  })
954
1028
  });
955
1029
  }
956
- const button$2 = "_button_19t7j_1";
957
- const buttonInner$1 = "_buttonInner_19t7j_6";
958
- const defaultStyles$f = {
1030
+ const button$2 = "_button_3521c_1";
1031
+ const buttonInner$1 = "_buttonInner_3521c_6";
1032
+ const defaultStyles$g = {
959
1033
  button: button$2,
960
1034
  buttonInner: buttonInner$1
961
1035
  };
@@ -965,7 +1039,7 @@
965
1039
  styles: styles2,
966
1040
  children
967
1041
  }) {
968
- styles2 = mergeStyles(defaultStyles$f, styles2);
1042
+ styles2 = mergeStyles(defaultStyles$g, styles2);
969
1043
  return jsxRuntime.jsx("button", {
970
1044
  className: styles2.button,
971
1045
  "data-type": type,
@@ -976,11 +1050,11 @@
976
1050
  })
977
1051
  });
978
1052
  }
979
- const button$1 = "_button_6w12u_1";
980
- const buttonBorder = "_buttonBorder_6w12u_10";
981
- const svg$3 = "_svg_6w12u_18";
982
- const path$3 = "_path_6w12u_24";
983
- const defaultStyles$e = {
1053
+ const button$1 = "_button_125im_1";
1054
+ const buttonBorder = "_buttonBorder_125im_11";
1055
+ const svg$3 = "_svg_125im_19";
1056
+ const path$3 = "_path_125im_25";
1057
+ const defaultStyles$f = {
984
1058
  button: button$1,
985
1059
  buttonBorder,
986
1060
  svg: svg$3,
@@ -991,7 +1065,7 @@
991
1065
  onClick,
992
1066
  styles: styles2
993
1067
  }) {
994
- styles2 = mergeStyles(defaultStyles$e, styles2);
1068
+ styles2 = mergeStyles(defaultStyles$f, styles2);
995
1069
  return jsxRuntime.jsx("button", {
996
1070
  className: [styles2.button, border && styles2.buttonBorder].join(" "),
997
1071
  onClick,
@@ -1009,6 +1083,39 @@
1009
1083
  })
1010
1084
  });
1011
1085
  }
1086
+ const container$4 = "_container_tq3ke_1";
1087
+ const slot = "_slot_tq3ke_5";
1088
+ const defaultStyles$e = {
1089
+ container: container$4,
1090
+ slot
1091
+ };
1092
+ function AdSlot({
1093
+ name: name2,
1094
+ sizeMapping,
1095
+ styles: styles2
1096
+ }) {
1097
+ var _a, _b, _c;
1098
+ const slotId = `dfp-ad--${name2}`;
1099
+ styles2 = mergeStyles(defaultStyles$e, styles2);
1100
+ const mobileSizes = (_a = sizeMapping.mobile) == null ? void 0 : _a.map((size) => size.join(",")).join("|");
1101
+ const tabletSizes = (_b = sizeMapping.tablet) == null ? void 0 : _b.map((size) => size.join(",")).join("|");
1102
+ const desktopSizes = (_c = sizeMapping.desktop) == null ? void 0 : _c.map((size) => size.join(",")).join("|");
1103
+ return jsxRuntime.jsx("div", {
1104
+ className: ["ad-slot-container", styles2.container].join(" "),
1105
+ children: jsxRuntime.jsx("div", {
1106
+ id: slotId,
1107
+ className: ["js-ad-slot", "ad-slot", "interactive-ad-slot", styles2.slot].join(" "),
1108
+ "data-link-name": `ad slot ${name2}`,
1109
+ "data-name": `${name2}`,
1110
+ "data-label-show": "true",
1111
+ "ad-label-text": "Advertisement",
1112
+ "aria-hidden": "true",
1113
+ "data-mobile": mobileSizes,
1114
+ "data-tablet": tabletSizes,
1115
+ "data-desktop": desktopSizes
1116
+ })
1117
+ });
1118
+ }
1012
1119
  const sortAscending = (accessor) => {
1013
1120
  return (a, b) => {
1014
1121
  const valueA = a[accessor];
@@ -1127,13 +1234,13 @@
1127
1234
  return this.row[this.column.accessor].toString();
1128
1235
  }
1129
1236
  }
1130
- const table = "_table_1b75c_9";
1131
- const hideHeader = "_hideHeader_1b75c_18";
1132
- const hideHeaderNoBorder = "_hideHeaderNoBorder_1b75c_27";
1133
- const headerCell = "_headerCell_1b75c_31";
1134
- const headerCellButton = "_headerCellButton_1b75c_39";
1135
- const bodyRow = "_bodyRow_1b75c_48";
1136
- const bodyCell = "_bodyCell_1b75c_53";
1237
+ const table = "_table_1dg64_9";
1238
+ const hideHeader = "_hideHeader_1dg64_19";
1239
+ const hideHeaderNoBorder = "_hideHeaderNoBorder_1dg64_28";
1240
+ const headerCell = "_headerCell_1dg64_32";
1241
+ const headerCellButton = "_headerCellButton_1dg64_40";
1242
+ const bodyRow = "_bodyRow_1dg64_49";
1243
+ const bodyCell = "_bodyCell_1dg64_54";
1137
1244
  const defaultStyles$d = {
1138
1245
  table,
1139
1246
  hideHeader,
@@ -1178,6 +1285,8 @@
1178
1285
  styles2 = mergeStyles(defaultStyles$d, styles2);
1179
1286
  return jsxRuntime.jsxs("table", {
1180
1287
  className: styles2.table,
1288
+ cellSpacing: 0,
1289
+ cellPadding: 0,
1181
1290
  children: [jsxRuntime.jsx("thead", {
1182
1291
  className: hideHeader2 && styles2.hideHeader,
1183
1292
  children: jsxRuntime.jsx("tr", {
@@ -1235,42 +1344,6 @@
1235
1344
  })]
1236
1345
  });
1237
1346
  }
1238
- function preventOverlap(labelPositions, iteration = 0, labelHeight = 12) {
1239
- const maxIterations = 10;
1240
- let totalOverlap = 0;
1241
- for (let index2 = 1; index2 < labelPositions.length; index2++) {
1242
- const previousElement = labelPositions[index2 - 1];
1243
- const element = labelPositions[index2];
1244
- const overlap = previousElement.y - (element.y - labelHeight);
1245
- if (overlap < 0) {
1246
- continue;
1247
- }
1248
- previousElement.y -= overlap / 2;
1249
- element.y += overlap / 2;
1250
- totalOverlap += overlap;
1251
- }
1252
- if (totalOverlap > 0 && iteration < maxIterations) {
1253
- return preventOverlap(labelPositions, iteration + 1);
1254
- }
1255
- return labelPositions;
1256
- }
1257
- function uniqueBy(array, key) {
1258
- return [...array.reduce((map, d2) => map.set(d2[key], d2), /* @__PURE__ */ new Map()).values()];
1259
- }
1260
- function positionLabels(labels) {
1261
- labels = uniqueBy(labels, "value");
1262
- labels.sort((a, b) => a.y - b.y);
1263
- return preventOverlap(labels);
1264
- }
1265
- function scaleLinear(domain, range) {
1266
- const [domainMin, domainMax] = domain;
1267
- const [rangeMin, rangeMax] = range;
1268
- const slope = (rangeMax - rangeMin) / (domainMax - domainMin);
1269
- const intercept = rangeMin - slope * domainMin;
1270
- return function(x) {
1271
- return slope * x + intercept;
1272
- };
1273
- }
1274
1347
  function useWindowSize() {
1275
1348
  const [windowSize, setWindowSize] = hooks.useState(() => {
1276
1349
  if (typeof window === "undefined")
@@ -1743,16 +1816,17 @@
1743
1816
  })
1744
1817
  });
1745
1818
  };
1746
- const toplineResult = "_toplineResult_w8o28_9";
1747
- const primaryname = "_primaryname_w8o28_12";
1748
- const secondaryname = "_secondaryname_w8o28_26";
1749
- const name = "_name_w8o28_32";
1750
- const displayNumbers = "_displayNumbers_w8o28_45";
1751
- const mainNumber = "_mainNumber_w8o28_54";
1752
- const secondaryNumber = "_secondaryNumber_w8o28_58";
1753
- const displayRow = "_displayRow_w8o28_65";
1754
- const displayColumn = "_displayColumn_w8o28_71";
1755
- const topRow = "_topRow_w8o28_75";
1819
+ const toplineResult = "_toplineResult_49z3u_9";
1820
+ const primaryname = "_primaryname_49z3u_14";
1821
+ const secondaryname = "_secondaryname_49z3u_29";
1822
+ const name = "_name_49z3u_36";
1823
+ const displayNumbers = "_displayNumbers_49z3u_50";
1824
+ const mainNumber = "_mainNumber_49z3u_61";
1825
+ const mainNumberSuffix = "_mainNumberSuffix_49z3u_66";
1826
+ const secondaryNumber = "_secondaryNumber_49z3u_69";
1827
+ const displayRow = "_displayRow_49z3u_76";
1828
+ const displayColumn = "_displayColumn_49z3u_82";
1829
+ const topRow = "_topRow_49z3u_86";
1756
1830
  const defaultStyles$9 = {
1757
1831
  toplineResult,
1758
1832
  primaryname,
@@ -1760,6 +1834,7 @@
1760
1834
  name,
1761
1835
  displayNumbers,
1762
1836
  mainNumber,
1837
+ mainNumberSuffix,
1763
1838
  secondaryNumber,
1764
1839
  displayRow,
1765
1840
  displayColumn,
@@ -1769,6 +1844,7 @@
1769
1844
  name: name2,
1770
1845
  secondaryName,
1771
1846
  mainNumber: mainNumber2,
1847
+ mainNumberSuffix: mainNumberSuffix2,
1772
1848
  secondaryNumber: secondaryNumber2,
1773
1849
  styles: styles2,
1774
1850
  displayRow: displayRow2 = false,
@@ -1781,64 +1857,66 @@
1781
1857
  ...defaultStyles$9
1782
1858
  }, styles2);
1783
1859
  const displayStyle = displayRow2 ? styles2.displayRow : styles2.displayColumn;
1784
- return !secondaryName ? jsxRuntime.jsxs(jsxRuntime.Fragment, {
1785
- children: [" ", jsxRuntime.jsxs("div", {
1786
- class: styles2.toplineResult,
1787
- onMouseOver,
1860
+ return !secondaryName ? jsxRuntime.jsxs("div", {
1861
+ class: styles2.toplineResult,
1862
+ onMouseOver,
1863
+ children: [jsxRuntime.jsxs("div", {
1864
+ class: styles2.topRow,
1865
+ children: [jsxRuntime.jsx("span", {
1866
+ class: `${styles2.name} before-color--${abbreviation}`,
1867
+ children: name2
1868
+ }), " ", showInfoButton && jsxRuntime.jsx("span", {
1869
+ class: styles2.infoButton,
1870
+ children: jsxRuntime.jsx(InfoButton, {
1871
+ onClick: onInfoPress
1872
+ })
1873
+ })]
1874
+ }), jsxRuntime.jsxs("div", {
1875
+ class: `${styles2.displayNumbers} ${displayStyle}`,
1788
1876
  children: [jsxRuntime.jsxs("div", {
1789
- class: styles2.topRow,
1790
- children: [jsxRuntime.jsx("span", {
1791
- class: `${styles2.name} before-color--${abbreviation}`,
1792
- children: name2
1793
- }), " ", showInfoButton && jsxRuntime.jsx("span", {
1794
- class: styles2.infoButton,
1795
- children: jsxRuntime.jsx(InfoButton, {
1796
- onClick: onInfoPress
1797
- })
1798
- })]
1799
- }), jsxRuntime.jsxs("div", {
1800
- class: `${styles2.displayNumbers} ${displayStyle}`,
1801
- children: [jsxRuntime.jsx("div", {
1802
- class: styles2.mainNumber,
1803
- children: mainNumber2
1804
- }), jsxRuntime.jsx("div", {
1805
- class: styles2.secondaryNumber,
1806
- children: secondaryNumber2
1877
+ class: styles2.mainNumber,
1878
+ children: [mainNumber2, mainNumberSuffix2 && jsxRuntime.jsx("span", {
1879
+ className: styles2.mainNumberSuffix,
1880
+ children: mainNumberSuffix2
1807
1881
  })]
1882
+ }), jsxRuntime.jsx("div", {
1883
+ class: styles2.secondaryNumber,
1884
+ children: secondaryNumber2
1808
1885
  })]
1809
1886
  })]
1810
- }) : jsxRuntime.jsx(jsxRuntime.Fragment, {
1811
- children: jsxRuntime.jsxs("div", {
1812
- class: styles2.toplineResult,
1813
- onMouseOver,
1887
+ }) : jsxRuntime.jsxs("div", {
1888
+ class: styles2.toplineResult,
1889
+ onMouseOver,
1890
+ children: [jsxRuntime.jsxs("div", {
1891
+ class: styles2.topRow,
1892
+ children: [jsxRuntime.jsx("span", {
1893
+ class: `${styles2.primaryname} before-color--${abbreviation}`,
1894
+ children: name2
1895
+ }), " ", showInfoButton && jsxRuntime.jsx("span", {
1896
+ class: styles2.infoButton,
1897
+ children: jsxRuntime.jsx(InfoButton, {
1898
+ onClick: onInfoPress
1899
+ })
1900
+ })]
1901
+ }), jsxRuntime.jsxs("div", {
1902
+ class: styles2.subhead,
1903
+ children: [jsxRuntime.jsx("span", {
1904
+ class: styles2.secondaryname,
1905
+ children: secondaryName
1906
+ }), " "]
1907
+ }), jsxRuntime.jsxs("div", {
1908
+ class: `${styles2.displayNumbers} ${displayStyle}`,
1814
1909
  children: [jsxRuntime.jsxs("div", {
1815
- class: styles2.topRow,
1816
- children: [jsxRuntime.jsx("span", {
1817
- class: `${styles2.primaryname} before-color--${abbreviation}`,
1818
- children: name2
1819
- }), " ", showInfoButton && jsxRuntime.jsx("span", {
1820
- class: styles2.infoButton,
1821
- children: jsxRuntime.jsx(InfoButton, {
1822
- onClick: onInfoPress
1823
- })
1824
- })]
1825
- }), jsxRuntime.jsxs("div", {
1826
- class: styles2.subhead,
1827
- children: [jsxRuntime.jsx("span", {
1828
- class: styles2.secondaryname,
1829
- children: secondaryName
1830
- }), " "]
1831
- }), jsxRuntime.jsxs("div", {
1832
- class: `${styles2.displayNumbers} ${displayStyle}`,
1833
- children: [jsxRuntime.jsx("div", {
1834
- class: styles2.mainNumber,
1835
- children: mainNumber2
1836
- }), jsxRuntime.jsx("div", {
1837
- class: styles2.secondaryNumber,
1838
- children: secondaryNumber2
1910
+ class: styles2.mainNumber,
1911
+ children: [mainNumber2, mainNumberSuffix2 && jsxRuntime.jsx("span", {
1912
+ className: styles2.mainNumberSuffix,
1913
+ children: mainNumberSuffix2
1839
1914
  })]
1915
+ }), jsxRuntime.jsx("div", {
1916
+ class: styles2.secondaryNumber,
1917
+ children: secondaryNumber2
1840
1918
  })]
1841
- })
1919
+ })]
1842
1920
  });
1843
1921
  };
1844
1922
  const section = "_section_12aiu_9";
@@ -2712,14 +2790,14 @@
2712
2790
  })
2713
2791
  });
2714
2792
  }
2715
- const searchContainer = "_searchContainer_g5w44_1";
2716
- const input = "_input_g5w44_5";
2717
- const searchIcon = "_searchIcon_g5w44_21";
2718
- const clearButton = "_clearButton_g5w44_30";
2719
- const suggestions = "_suggestions_g5w44_36";
2720
- const suggestion = "_suggestion_g5w44_36";
2721
- const selected = "_selected_g5w44_59";
2722
- const highlighted = "_highlighted_g5w44_63";
2793
+ const searchContainer = "_searchContainer_1883t_1";
2794
+ const input = "_input_1883t_5";
2795
+ const searchIcon = "_searchIcon_1883t_23";
2796
+ const clearButton = "_clearButton_1883t_32";
2797
+ const suggestions = "_suggestions_1883t_38";
2798
+ const suggestion = "_suggestion_1883t_38";
2799
+ const selected = "_selected_1883t_61";
2800
+ const highlighted = "_highlighted_1883t_65";
2723
2801
  const defaultStyles$3 = {
2724
2802
  searchContainer,
2725
2803
  input,
@@ -3120,15 +3198,15 @@
3120
3198
  })]
3121
3199
  });
3122
3200
  }
3123
- const ticker = "_ticker_2eemh_9";
3124
- const tickerItems = "_tickerItems_2eemh_19";
3125
- const tickerScroll = "_tickerScroll_2eemh_24";
3126
- const tickerItem = "_tickerItem_2eemh_19";
3127
- const controls = "_controls_2eemh_46";
3128
- const gradient = "_gradient_2eemh_61";
3129
- const buttons = "_buttons_2eemh_75";
3130
- const button = "_button_2eemh_75";
3131
- const buttonInner = "_buttonInner_2eemh_101";
3201
+ const ticker = "_ticker_1as05_9";
3202
+ const tickerItems = "_tickerItems_1as05_21";
3203
+ const tickerScroll = "_tickerScroll_1as05_26";
3204
+ const tickerItem = "_tickerItem_1as05_21";
3205
+ const controls = "_controls_1as05_48";
3206
+ const gradient = "_gradient_1as05_63";
3207
+ const buttons = "_buttons_1as05_75";
3208
+ const button = "_button_1as05_75";
3209
+ const buttonInner = "_buttonInner_1as05_100";
3132
3210
  const styles = {
3133
3211
  ticker,
3134
3212
  tickerItems,
@@ -3219,7 +3297,7 @@
3219
3297
  }), jsxRuntime.jsx("div", {
3220
3298
  className: styles.button,
3221
3299
  children: jsxRuntime.jsx(Button, {
3222
- type: "small",
3300
+ type: "regular",
3223
3301
  styles: {
3224
3302
  buttonInner: styles.buttonInner
3225
3303
  },
@@ -3230,6 +3308,7 @@
3230
3308
  })]
3231
3309
  });
3232
3310
  }
3311
+ exports2.AdSlot = AdSlot;
3233
3312
  exports2.ArrowButton = ArrowButton;
3234
3313
  exports2.Button = Button;
3235
3314
  exports2.ChangeBar = ChangeBar;
@@ -3243,6 +3322,7 @@
3243
3322
  exports2.GradientIcon = GradientIcon;
3244
3323
  exports2.GridType = GridType;
3245
3324
  exports2.InfoButton = InfoButton;
3325
+ exports2.LabelType = LabelType;
3246
3326
  exports2.LegendItem = LegendItem;
3247
3327
  exports2.Map = Map$1;
3248
3328
  exports2.MapConfiguration = MapConfiguration;