impaktapps-design 0.2.992 → 0.2.993-alpha.10

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.
@@ -123,7 +123,7 @@ var classnames = { exports: {} };
123
123
  })();
124
124
  })(classnames);
125
125
  var cx = classnames.exports;
126
- var _excluded$S = ["top", "left", "transform", "className", "children", "innerRef"];
126
+ var _excluded$T = ["top", "left", "transform", "className", "children", "innerRef"];
127
127
  function _extends$J() {
128
128
  _extends$J = Object.assign ? Object.assign.bind() : function(target) {
129
129
  for (var i = 1; i < arguments.length; i++) {
@@ -138,7 +138,7 @@ function _extends$J() {
138
138
  };
139
139
  return _extends$J.apply(this, arguments);
140
140
  }
141
- function _objectWithoutPropertiesLoose$w(source, excluded) {
141
+ function _objectWithoutPropertiesLoose$x(source, excluded) {
142
142
  if (source == null)
143
143
  return {};
144
144
  var target = {};
@@ -153,7 +153,7 @@ function _objectWithoutPropertiesLoose$w(source, excluded) {
153
153
  return target;
154
154
  }
155
155
  function Group(_ref) {
156
- var _ref$top = _ref.top, top2 = _ref$top === void 0 ? 0 : _ref$top, _ref$left = _ref.left, left2 = _ref$left === void 0 ? 0 : _ref$left, transform2 = _ref.transform, className = _ref.className, children2 = _ref.children, innerRef = _ref.innerRef, restProps = _objectWithoutPropertiesLoose$w(_ref, _excluded$S);
156
+ var _ref$top = _ref.top, top2 = _ref$top === void 0 ? 0 : _ref$top, _ref$left = _ref.left, left2 = _ref$left === void 0 ? 0 : _ref$left, transform2 = _ref.transform, className = _ref.className, children2 = _ref.children, innerRef = _ref.innerRef, restProps = _objectWithoutPropertiesLoose$x(_ref, _excluded$T);
157
157
  return /* @__PURE__ */ React__default.createElement("g", _extends$J({
158
158
  ref: innerRef,
159
159
  className: cx("visx-group", className),
@@ -1947,7 +1947,7 @@ function pie$2(_temp4) {
1947
1947
  setNumberOrNumberAccessor$2(path2.endAngle, endAngle);
1948
1948
  return path2;
1949
1949
  }
1950
- var _excluded$R = ["className", "top", "left", "data", "centroid", "innerRadius", "outerRadius", "cornerRadius", "startAngle", "endAngle", "padAngle", "padRadius", "pieSort", "pieSortValues", "pieValue", "children", "fill"];
1950
+ var _excluded$S = ["className", "top", "left", "data", "centroid", "innerRadius", "outerRadius", "cornerRadius", "startAngle", "endAngle", "padAngle", "padRadius", "pieSort", "pieSortValues", "pieValue", "children", "fill"];
1951
1951
  function _extends$I() {
1952
1952
  _extends$I = Object.assign ? Object.assign.bind() : function(target) {
1953
1953
  for (var i = 1; i < arguments.length; i++) {
@@ -1962,7 +1962,7 @@ function _extends$I() {
1962
1962
  };
1963
1963
  return _extends$I.apply(this, arguments);
1964
1964
  }
1965
- function _objectWithoutPropertiesLoose$v(source, excluded) {
1965
+ function _objectWithoutPropertiesLoose$w(source, excluded) {
1966
1966
  if (source == null)
1967
1967
  return {};
1968
1968
  var target = {};
@@ -1977,7 +1977,7 @@ function _objectWithoutPropertiesLoose$v(source, excluded) {
1977
1977
  return target;
1978
1978
  }
1979
1979
  function Pie(_ref) {
1980
- var className = _ref.className, top2 = _ref.top, left2 = _ref.left, _ref$data = _ref.data, data = _ref$data === void 0 ? [] : _ref$data, centroid2 = _ref.centroid, _ref$innerRadius = _ref.innerRadius, innerRadius = _ref$innerRadius === void 0 ? 0 : _ref$innerRadius, outerRadius = _ref.outerRadius, cornerRadius = _ref.cornerRadius, startAngle = _ref.startAngle, endAngle = _ref.endAngle, padAngle = _ref.padAngle, padRadius = _ref.padRadius, pieSort = _ref.pieSort, pieSortValues = _ref.pieSortValues, pieValue = _ref.pieValue, children2 = _ref.children, _ref$fill = _ref.fill, fill = _ref$fill === void 0 ? "" : _ref$fill, restProps = _objectWithoutPropertiesLoose$v(_ref, _excluded$R);
1980
+ var className = _ref.className, top2 = _ref.top, left2 = _ref.left, _ref$data = _ref.data, data = _ref$data === void 0 ? [] : _ref$data, centroid2 = _ref.centroid, _ref$innerRadius = _ref.innerRadius, innerRadius = _ref$innerRadius === void 0 ? 0 : _ref$innerRadius, outerRadius = _ref.outerRadius, cornerRadius = _ref.cornerRadius, startAngle = _ref.startAngle, endAngle = _ref.endAngle, padAngle = _ref.padAngle, padRadius = _ref.padRadius, pieSort = _ref.pieSort, pieSortValues = _ref.pieSortValues, pieValue = _ref.pieValue, children2 = _ref.children, _ref$fill = _ref.fill, fill = _ref$fill === void 0 ? "" : _ref$fill, restProps = _objectWithoutPropertiesLoose$w(_ref, _excluded$S);
1981
1981
  var path2 = arc$2({
1982
1982
  innerRadius,
1983
1983
  outerRadius,
@@ -2013,7 +2013,7 @@ function Pie(_ref) {
2013
2013
  }, restProps)), centroid2 == null ? void 0 : centroid2(path2.centroid(arc2), arc2));
2014
2014
  }));
2015
2015
  }
2016
- var _excluded$Q = ["from", "to", "fill", "className", "innerRef"];
2016
+ var _excluded$R = ["from", "to", "fill", "className", "innerRef"];
2017
2017
  function _extends$H() {
2018
2018
  _extends$H = Object.assign ? Object.assign.bind() : function(target) {
2019
2019
  for (var i = 1; i < arguments.length; i++) {
@@ -2028,7 +2028,7 @@ function _extends$H() {
2028
2028
  };
2029
2029
  return _extends$H.apply(this, arguments);
2030
2030
  }
2031
- function _objectWithoutPropertiesLoose$u(source, excluded) {
2031
+ function _objectWithoutPropertiesLoose$v(source, excluded) {
2032
2032
  if (source == null)
2033
2033
  return {};
2034
2034
  var target = {};
@@ -2049,7 +2049,7 @@ function Line$2(_ref) {
2049
2049
  } : _ref$from, _ref$to = _ref.to, to = _ref$to === void 0 ? {
2050
2050
  x: 1,
2051
2051
  y: 1
2052
- } : _ref$to, _ref$fill = _ref.fill, fill = _ref$fill === void 0 ? "transparent" : _ref$fill, className = _ref.className, innerRef = _ref.innerRef, restProps = _objectWithoutPropertiesLoose$u(_ref, _excluded$Q);
2052
+ } : _ref$to, _ref$fill = _ref.fill, fill = _ref$fill === void 0 ? "transparent" : _ref$fill, className = _ref.className, innerRef = _ref.innerRef, restProps = _objectWithoutPropertiesLoose$v(_ref, _excluded$R);
2053
2053
  var isRectilinear = from2.x === to.x || from2.y === to.y;
2054
2054
  return /* @__PURE__ */ React__default.createElement("line", _extends$H({
2055
2055
  ref: innerRef,
@@ -2062,7 +2062,7 @@ function Line$2(_ref) {
2062
2062
  shapeRendering: isRectilinear ? "crispEdges" : "auto"
2063
2063
  }, restProps));
2064
2064
  }
2065
- var _excluded$P = ["className", "innerRef"];
2065
+ var _excluded$Q = ["className", "innerRef"];
2066
2066
  function _extends$G() {
2067
2067
  _extends$G = Object.assign ? Object.assign.bind() : function(target) {
2068
2068
  for (var i = 1; i < arguments.length; i++) {
@@ -2077,7 +2077,7 @@ function _extends$G() {
2077
2077
  };
2078
2078
  return _extends$G.apply(this, arguments);
2079
2079
  }
2080
- function _objectWithoutPropertiesLoose$t(source, excluded) {
2080
+ function _objectWithoutPropertiesLoose$u(source, excluded) {
2081
2081
  if (source == null)
2082
2082
  return {};
2083
2083
  var target = {};
@@ -2092,7 +2092,7 @@ function _objectWithoutPropertiesLoose$t(source, excluded) {
2092
2092
  return target;
2093
2093
  }
2094
2094
  function Bar(_ref) {
2095
- var className = _ref.className, innerRef = _ref.innerRef, restProps = _objectWithoutPropertiesLoose$t(_ref, _excluded$P);
2095
+ var className = _ref.className, innerRef = _ref.innerRef, restProps = _objectWithoutPropertiesLoose$u(_ref, _excluded$Q);
2096
2096
  return /* @__PURE__ */ React__default.createElement("rect", _extends$G({
2097
2097
  ref: innerRef,
2098
2098
  className: cx("visx-bar", className)
@@ -2106,7 +2106,7 @@ function getBandwidth(scale) {
2106
2106
  var domain2 = scale.domain();
2107
2107
  return Math.abs(range2[range2.length - 1] - range2[0]) / domain2.length;
2108
2108
  }
2109
- var _excluded$O = ["data", "className", "top", "left", "x0", "x0Scale", "x1Scale", "yScale", "color", "keys", "height", "children"];
2109
+ var _excluded$P = ["data", "className", "top", "left", "x0", "x0Scale", "x1Scale", "yScale", "color", "keys", "height", "children"];
2110
2110
  function _extends$F() {
2111
2111
  _extends$F = Object.assign ? Object.assign.bind() : function(target) {
2112
2112
  for (var i = 1; i < arguments.length; i++) {
@@ -2121,7 +2121,7 @@ function _extends$F() {
2121
2121
  };
2122
2122
  return _extends$F.apply(this, arguments);
2123
2123
  }
2124
- function _objectWithoutPropertiesLoose$s(source, excluded) {
2124
+ function _objectWithoutPropertiesLoose$t(source, excluded) {
2125
2125
  if (source == null)
2126
2126
  return {};
2127
2127
  var target = {};
@@ -2136,7 +2136,7 @@ function _objectWithoutPropertiesLoose$s(source, excluded) {
2136
2136
  return target;
2137
2137
  }
2138
2138
  function BarGroup(_ref) {
2139
- var data = _ref.data, className = _ref.className, top2 = _ref.top, left2 = _ref.left, x02 = _ref.x0, x0Scale = _ref.x0Scale, x1Scale = _ref.x1Scale, yScale = _ref.yScale, color2 = _ref.color, keys2 = _ref.keys, height2 = _ref.height, children2 = _ref.children, restProps = _objectWithoutPropertiesLoose$s(_ref, _excluded$O);
2139
+ var data = _ref.data, className = _ref.className, top2 = _ref.top, left2 = _ref.left, x02 = _ref.x0, x0Scale = _ref.x0Scale, x1Scale = _ref.x1Scale, yScale = _ref.yScale, color2 = _ref.color, keys2 = _ref.keys, height2 = _ref.height, children2 = _ref.children, restProps = _objectWithoutPropertiesLoose$t(_ref, _excluded$P);
2140
2140
  var barWidth = getBandwidth(x1Scale);
2141
2141
  var barGroups = data.map(function(group2, i) {
2142
2142
  return {
@@ -2179,6 +2179,83 @@ function BarGroup(_ref) {
2179
2179
  }));
2180
2180
  }));
2181
2181
  }
2182
+ var _excluded$O = ["data", "className", "top", "left", "x", "y0", "y0Scale", "y1Scale", "xScale", "color", "keys", "width", "children"];
2183
+ function _extends$E() {
2184
+ _extends$E = Object.assign ? Object.assign.bind() : function(target) {
2185
+ for (var i = 1; i < arguments.length; i++) {
2186
+ var source = arguments[i];
2187
+ for (var key in source) {
2188
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
2189
+ target[key] = source[key];
2190
+ }
2191
+ }
2192
+ }
2193
+ return target;
2194
+ };
2195
+ return _extends$E.apply(this, arguments);
2196
+ }
2197
+ function _objectWithoutPropertiesLoose$s(source, excluded) {
2198
+ if (source == null)
2199
+ return {};
2200
+ var target = {};
2201
+ var sourceKeys = Object.keys(source);
2202
+ var key, i;
2203
+ for (i = 0; i < sourceKeys.length; i++) {
2204
+ key = sourceKeys[i];
2205
+ if (excluded.indexOf(key) >= 0)
2206
+ continue;
2207
+ target[key] = source[key];
2208
+ }
2209
+ return target;
2210
+ }
2211
+ function BarGroupHorizontal(_ref) {
2212
+ var data = _ref.data, className = _ref.className, top2 = _ref.top, left2 = _ref.left, _ref$x = _ref.x, x2 = _ref$x === void 0 ? function() {
2213
+ return 0;
2214
+ } : _ref$x, y02 = _ref.y0, y0Scale = _ref.y0Scale, y1Scale = _ref.y1Scale, xScale = _ref.xScale, color2 = _ref.color, keys2 = _ref.keys;
2215
+ _ref.width;
2216
+ var children2 = _ref.children, restProps = _objectWithoutPropertiesLoose$s(_ref, _excluded$O);
2217
+ var barHeight = getBandwidth(y1Scale);
2218
+ var barGroups = data.map(function(group2, i) {
2219
+ return {
2220
+ index: i,
2221
+ y0: y0Scale(y02(group2)) || 0,
2222
+ bars: keys2.map(function(key, j) {
2223
+ var value = group2[key];
2224
+ return {
2225
+ index: j,
2226
+ key,
2227
+ value,
2228
+ height: barHeight,
2229
+ x: x2(value) || 0,
2230
+ y: y1Scale(key) || 0,
2231
+ color: color2(key, j),
2232
+ width: xScale(value) || 0
2233
+ };
2234
+ })
2235
+ };
2236
+ });
2237
+ if (children2)
2238
+ return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, children2(barGroups));
2239
+ return /* @__PURE__ */ React__default.createElement(Group, {
2240
+ className: cx("visx-bar-group-horizontal", className),
2241
+ top: top2,
2242
+ left: left2
2243
+ }, barGroups.map(function(barGroup) {
2244
+ return /* @__PURE__ */ React__default.createElement(Group, {
2245
+ key: "bar-group-" + barGroup.index + "-" + barGroup.y0,
2246
+ top: barGroup.y0
2247
+ }, barGroup.bars.map(function(bar) {
2248
+ return /* @__PURE__ */ React__default.createElement(Bar, _extends$E({
2249
+ key: "bar-group-bar-" + barGroup.index + "-" + bar.index + "-" + bar.value + "-" + bar.key,
2250
+ x: bar.x,
2251
+ y: bar.y,
2252
+ width: bar.width,
2253
+ height: bar.height,
2254
+ fill: bar.color
2255
+ }, restProps));
2256
+ }));
2257
+ }));
2258
+ }
2182
2259
  function getFirstItem(d2) {
2183
2260
  return d2 == null ? void 0 : d2[0];
2184
2261
  }
@@ -2186,8 +2263,8 @@ function getSecondItem(d2) {
2186
2263
  return d2 == null ? void 0 : d2[1];
2187
2264
  }
2188
2265
  var _excluded$N = ["data", "className", "top", "left", "x", "y0", "y1", "xScale", "yScale", "color", "keys", "value", "order", "offset", "children"];
2189
- function _extends$E() {
2190
- _extends$E = Object.assign ? Object.assign.bind() : function(target) {
2266
+ function _extends$D() {
2267
+ _extends$D = Object.assign ? Object.assign.bind() : function(target) {
2191
2268
  for (var i = 1; i < arguments.length; i++) {
2192
2269
  var source = arguments[i];
2193
2270
  for (var key in source) {
@@ -2198,7 +2275,7 @@ function _extends$E() {
2198
2275
  }
2199
2276
  return target;
2200
2277
  };
2201
- return _extends$E.apply(this, arguments);
2278
+ return _extends$D.apply(this, arguments);
2202
2279
  }
2203
2280
  function _objectWithoutPropertiesLoose$r(source, excluded) {
2204
2281
  if (source == null)
@@ -2257,7 +2334,7 @@ function BarStack(_ref) {
2257
2334
  left: left2
2258
2335
  }, barStacks.map(function(barStack) {
2259
2336
  return barStack.bars.map(function(bar) {
2260
- return /* @__PURE__ */ React__default.createElement(Bar, _extends$E({
2337
+ return /* @__PURE__ */ React__default.createElement(Bar, _extends$D({
2261
2338
  key: "bar-stack-" + barStack.index + "-" + bar.index,
2262
2339
  x: bar.x,
2263
2340
  y: bar.y,
@@ -2269,8 +2346,8 @@ function BarStack(_ref) {
2269
2346
  }));
2270
2347
  }
2271
2348
  var _excluded$M = ["data", "className", "top", "left", "y", "x0", "x1", "xScale", "yScale", "color", "keys", "value", "order", "offset", "children"];
2272
- function _extends$D() {
2273
- _extends$D = Object.assign ? Object.assign.bind() : function(target) {
2349
+ function _extends$C() {
2350
+ _extends$C = Object.assign ? Object.assign.bind() : function(target) {
2274
2351
  for (var i = 1; i < arguments.length; i++) {
2275
2352
  var source = arguments[i];
2276
2353
  for (var key in source) {
@@ -2281,7 +2358,7 @@ function _extends$D() {
2281
2358
  }
2282
2359
  return target;
2283
2360
  };
2284
- return _extends$D.apply(this, arguments);
2361
+ return _extends$C.apply(this, arguments);
2285
2362
  }
2286
2363
  function _objectWithoutPropertiesLoose$q(source, excluded) {
2287
2364
  if (source == null)
@@ -2340,7 +2417,7 @@ function BarStackHorizontal(_ref) {
2340
2417
  left: left2
2341
2418
  }, barStacks.map(function(barStack) {
2342
2419
  return barStack.bars.map(function(bar) {
2343
- return /* @__PURE__ */ React__default.createElement(Bar, _extends$D({
2420
+ return /* @__PURE__ */ React__default.createElement(Bar, _extends$C({
2344
2421
  key: "bar-stack-" + barStack.index + "-" + bar.index,
2345
2422
  x: bar.x,
2346
2423
  y: bar.y,
@@ -7572,8 +7649,8 @@ function useText(props) {
7572
7649
  };
7573
7650
  }
7574
7651
  var _excluded$K = ["dx", "dy", "textAnchor", "innerRef", "innerTextRef", "verticalAnchor", "angle", "lineHeight", "scaleToFit", "capHeight", "width"];
7575
- function _extends$C() {
7576
- _extends$C = Object.assign ? Object.assign.bind() : function(target) {
7652
+ function _extends$B() {
7653
+ _extends$B = Object.assign ? Object.assign.bind() : function(target) {
7577
7654
  for (var i = 1; i < arguments.length; i++) {
7578
7655
  var source = arguments[i];
7579
7656
  for (var key in source) {
@@ -7584,7 +7661,7 @@ function _extends$C() {
7584
7661
  }
7585
7662
  return target;
7586
7663
  };
7587
- return _extends$C.apply(this, arguments);
7664
+ return _extends$B.apply(this, arguments);
7588
7665
  }
7589
7666
  function _objectWithoutPropertiesLoose$o(source, excluded) {
7590
7667
  if (source == null)
@@ -7620,7 +7697,7 @@ function Text(props) {
7620
7697
  y: dy,
7621
7698
  fontSize,
7622
7699
  style: SVG_STYLE
7623
- }, wordsByLines.length > 0 ? /* @__PURE__ */ React__default.createElement("text", _extends$C({
7700
+ }, wordsByLines.length > 0 ? /* @__PURE__ */ React__default.createElement("text", _extends$B({
7624
7701
  ref: innerTextRef,
7625
7702
  transform: transform2
7626
7703
  }, textProps, {
@@ -7661,8 +7738,8 @@ function getLabelTransform(_ref) {
7661
7738
  transform: transform2
7662
7739
  };
7663
7740
  }
7664
- function _extends$B() {
7665
- _extends$B = Object.assign ? Object.assign.bind() : function(target) {
7741
+ function _extends$A() {
7742
+ _extends$A = Object.assign ? Object.assign.bind() : function(target) {
7666
7743
  for (var i = 1; i < arguments.length; i++) {
7667
7744
  var source = arguments[i];
7668
7745
  for (var key in source) {
@@ -7673,7 +7750,7 @@ function _extends$B() {
7673
7750
  }
7674
7751
  return target;
7675
7752
  };
7676
- return _extends$B.apply(this, arguments);
7753
+ return _extends$A.apply(this, arguments);
7677
7754
  }
7678
7755
  function Ticks(_ref) {
7679
7756
  var hideTicks = _ref.hideTicks, horizontal = _ref.horizontal, orientation = _ref.orientation, tickClassName = _ref.tickClassName, tickComponent = _ref.tickComponent, allTickLabelProps = _ref.tickLabelProps, _ref$tickStroke = _ref.tickStroke, tickStroke = _ref$tickStroke === void 0 ? "#222" : _ref$tickStroke, tickTransform = _ref.tickTransform, ticks2 = _ref.ticks, strokeWidth = _ref.strokeWidth, tickLineProps = _ref.tickLineProps;
@@ -7687,24 +7764,24 @@ function Ticks(_ref) {
7687
7764
  key: "visx-tick-" + value + "-" + index2,
7688
7765
  className: cx("visx-axis-tick", tickClassName),
7689
7766
  transform: tickTransform
7690
- }, !hideTicks && /* @__PURE__ */ React__default.createElement(Line$2, _extends$B({
7767
+ }, !hideTicks && /* @__PURE__ */ React__default.createElement(Line$2, _extends$A({
7691
7768
  from: from2,
7692
7769
  to,
7693
7770
  stroke: tickStroke,
7694
7771
  strokeWidth,
7695
7772
  strokeLinecap: "square"
7696
- }, tickLineProps)), tickComponent ? tickComponent(_extends$B({}, tickLabelProps, {
7773
+ }, tickLineProps)), tickComponent ? tickComponent(_extends$A({}, tickLabelProps, {
7697
7774
  x: to.x,
7698
7775
  y: tickYCoord,
7699
7776
  formattedValue
7700
- })) : /* @__PURE__ */ React__default.createElement(Text, _extends$B({
7777
+ })) : /* @__PURE__ */ React__default.createElement(Text, _extends$A({
7701
7778
  x: to.x,
7702
7779
  y: tickYCoord
7703
7780
  }, tickLabelProps), formattedValue));
7704
7781
  });
7705
7782
  }
7706
- function _extends$A() {
7707
- _extends$A = Object.assign ? Object.assign.bind() : function(target) {
7783
+ function _extends$z() {
7784
+ _extends$z = Object.assign ? Object.assign.bind() : function(target) {
7708
7785
  for (var i = 1; i < arguments.length; i++) {
7709
7786
  var source = arguments[i];
7710
7787
  for (var key in source) {
@@ -7715,7 +7792,7 @@ function _extends$A() {
7715
7792
  }
7716
7793
  return target;
7717
7794
  };
7718
- return _extends$A.apply(this, arguments);
7795
+ return _extends$z.apply(this, arguments);
7719
7796
  }
7720
7797
  var defaultTextProps = {
7721
7798
  textAnchor: "middle",
@@ -7725,7 +7802,7 @@ var defaultTextProps = {
7725
7802
  };
7726
7803
  function AxisRenderer(_ref) {
7727
7804
  var axisFromPoint = _ref.axisFromPoint, axisLineClassName = _ref.axisLineClassName, axisToPoint = _ref.axisToPoint, hideAxisLine = _ref.hideAxisLine, hideTicks = _ref.hideTicks, horizontal = _ref.horizontal, _ref$label = _ref.label, label = _ref$label === void 0 ? "" : _ref$label, labelClassName = _ref.labelClassName, _ref$labelOffset = _ref.labelOffset, labelOffset = _ref$labelOffset === void 0 ? 14 : _ref$labelOffset, _ref$labelProps = _ref.labelProps, labelProps = _ref$labelProps === void 0 ? defaultTextProps : _ref$labelProps, _ref$orientation = _ref.orientation, orientation = _ref$orientation === void 0 ? Orientation$1.bottom : _ref$orientation, scale = _ref.scale, _ref$stroke = _ref.stroke, stroke = _ref$stroke === void 0 ? "#222" : _ref$stroke, strokeDasharray = _ref.strokeDasharray, _ref$strokeWidth = _ref.strokeWidth, strokeWidth = _ref$strokeWidth === void 0 ? 1 : _ref$strokeWidth, tickClassName = _ref.tickClassName, tickComponent = _ref.tickComponent, tickLineProps = _ref.tickLineProps, tickLabelProps = _ref.tickLabelProps, _ref$tickLength = _ref.tickLength, tickLength = _ref$tickLength === void 0 ? 8 : _ref$tickLength, _ref$tickStroke = _ref.tickStroke, tickStroke = _ref$tickStroke === void 0 ? "#222" : _ref$tickStroke, tickTransform = _ref.tickTransform, ticks2 = _ref.ticks, _ref$ticksComponent = _ref.ticksComponent, ticksComponent = _ref$ticksComponent === void 0 ? Ticks : _ref$ticksComponent;
7728
- var tickLabelPropsDefault = _extends$A({}, defaultTextProps, typeof tickLabelProps === "object" ? tickLabelProps : null);
7805
+ var tickLabelPropsDefault = _extends$z({}, defaultTextProps, typeof tickLabelProps === "object" ? tickLabelProps : null);
7729
7806
  var allTickLabelProps = ticks2.map(function(_ref2) {
7730
7807
  var value = _ref2.value, index2 = _ref2.index;
7731
7808
  return typeof tickLabelProps === "function" ? tickLabelProps(value, index2, ticks2) : tickLabelPropsDefault;
@@ -7753,7 +7830,7 @@ function AxisRenderer(_ref) {
7753
7830
  stroke,
7754
7831
  strokeWidth,
7755
7832
  strokeDasharray
7756
- }), label && /* @__PURE__ */ React__default.createElement(Text, _extends$A({
7833
+ }), label && /* @__PURE__ */ React__default.createElement(Text, _extends$z({
7757
7834
  className: cx("visx-axis-label", labelClassName)
7758
7835
  }, getLabelTransform({
7759
7836
  labelOffset,
@@ -7837,8 +7914,8 @@ function createPoint(_ref, horizontal) {
7837
7914
  y: x2
7838
7915
  });
7839
7916
  }
7840
- function _extends$z() {
7841
- _extends$z = Object.assign ? Object.assign.bind() : function(target) {
7917
+ function _extends$y() {
7918
+ _extends$y = Object.assign ? Object.assign.bind() : function(target) {
7842
7919
  for (var i = 1; i < arguments.length; i++) {
7843
7920
  var source = arguments[i];
7844
7921
  for (var key in source) {
@@ -7849,7 +7926,7 @@ function _extends$z() {
7849
7926
  }
7850
7927
  return target;
7851
7928
  };
7852
- return _extends$z.apply(this, arguments);
7929
+ return _extends$y.apply(this, arguments);
7853
7930
  }
7854
7931
  var defaultAxisRangePadding = 0;
7855
7932
  function getAxisRangePaddingConfig(originalRangePadding) {
@@ -7859,14 +7936,14 @@ function getAxisRangePaddingConfig(originalRangePadding) {
7859
7936
  return typeof originalRangePadding === "number" ? {
7860
7937
  start: originalRangePadding,
7861
7938
  end: originalRangePadding
7862
- } : _extends$z({
7939
+ } : _extends$y({
7863
7940
  start: defaultAxisRangePadding,
7864
7941
  end: defaultAxisRangePadding
7865
7942
  }, originalRangePadding);
7866
7943
  }
7867
7944
  var _excluded$J = ["children", "axisClassName", "hideAxisLine", "hideTicks", "hideZero", "left", "numTicks", "orientation", "rangePadding", "scale", "tickFormat", "tickLength", "tickValues", "top"];
7868
- function _extends$y() {
7869
- _extends$y = Object.assign ? Object.assign.bind() : function(target) {
7945
+ function _extends$x() {
7946
+ _extends$x = Object.assign ? Object.assign.bind() : function(target) {
7870
7947
  for (var i = 1; i < arguments.length; i++) {
7871
7948
  var source = arguments[i];
7872
7949
  for (var key in source) {
@@ -7877,7 +7954,7 @@ function _extends$y() {
7877
7954
  }
7878
7955
  return target;
7879
7956
  };
7880
- return _extends$y.apply(this, arguments);
7957
+ return _extends$x.apply(this, arguments);
7881
7958
  }
7882
7959
  function _objectWithoutPropertiesLoose$n(source, excluded) {
7883
7960
  if (source == null)
@@ -7940,7 +8017,7 @@ function Axis$1(_ref) {
7940
8017
  className: cx("visx-axis", axisClassName),
7941
8018
  top: top2,
7942
8019
  left: left2
7943
- }, children2(_extends$y({}, restProps, {
8020
+ }, children2(_extends$x({}, restProps, {
7944
8021
  axisFromPoint,
7945
8022
  axisToPoint,
7946
8023
  hideAxisLine,
@@ -7959,8 +8036,8 @@ function Axis$1(_ref) {
7959
8036
  })));
7960
8037
  }
7961
8038
  var _excluded$I = ["axisClassName", "labelOffset", "tickLength", "tickLabelProps"];
7962
- function _extends$x() {
7963
- _extends$x = Object.assign ? Object.assign.bind() : function(target) {
8039
+ function _extends$w() {
8040
+ _extends$w = Object.assign ? Object.assign.bind() : function(target) {
7964
8041
  for (var i = 1; i < arguments.length; i++) {
7965
8042
  var source = arguments[i];
7966
8043
  for (var key in source) {
@@ -7971,7 +8048,7 @@ function _extends$x() {
7971
8048
  }
7972
8049
  return target;
7973
8050
  };
7974
- return _extends$x.apply(this, arguments);
8051
+ return _extends$w.apply(this, arguments);
7975
8052
  }
7976
8053
  function _objectWithoutPropertiesLoose$m(source, excluded) {
7977
8054
  if (source == null)
@@ -7997,8 +8074,8 @@ var leftTickLabelProps = {
7997
8074
  };
7998
8075
  function AxisLeft(_ref) {
7999
8076
  var axisClassName = _ref.axisClassName, _ref$labelOffset = _ref.labelOffset, labelOffset = _ref$labelOffset === void 0 ? 36 : _ref$labelOffset, _ref$tickLength = _ref.tickLength, tickLength = _ref$tickLength === void 0 ? 8 : _ref$tickLength, tickLabelProps = _ref.tickLabelProps, restProps = _objectWithoutPropertiesLoose$m(_ref, _excluded$I);
8000
- var tickLabelPropsFinal = typeof tickLabelProps === "function" ? tickLabelProps : _extends$x({}, leftTickLabelProps, tickLabelProps);
8001
- return /* @__PURE__ */ React__default.createElement(Axis$1, _extends$x({
8077
+ var tickLabelPropsFinal = typeof tickLabelProps === "function" ? tickLabelProps : _extends$w({}, leftTickLabelProps, tickLabelProps);
8078
+ return /* @__PURE__ */ React__default.createElement(Axis$1, _extends$w({
8002
8079
  axisClassName: cx("visx-axis-left", axisClassName),
8003
8080
  labelOffset,
8004
8081
  orientation: Orientation$1.left,
@@ -8007,8 +8084,8 @@ function AxisLeft(_ref) {
8007
8084
  }, restProps));
8008
8085
  }
8009
8086
  var _excluded$H = ["axisClassName", "labelOffset", "tickLength", "tickLabelProps"];
8010
- function _extends$w() {
8011
- _extends$w = Object.assign ? Object.assign.bind() : function(target) {
8087
+ function _extends$v() {
8088
+ _extends$v = Object.assign ? Object.assign.bind() : function(target) {
8012
8089
  for (var i = 1; i < arguments.length; i++) {
8013
8090
  var source = arguments[i];
8014
8091
  for (var key in source) {
@@ -8019,7 +8096,7 @@ function _extends$w() {
8019
8096
  }
8020
8097
  return target;
8021
8098
  };
8022
- return _extends$w.apply(this, arguments);
8099
+ return _extends$v.apply(this, arguments);
8023
8100
  }
8024
8101
  function _objectWithoutPropertiesLoose$l(source, excluded) {
8025
8102
  if (source == null)
@@ -8044,8 +8121,8 @@ var bottomTickLabelProps = {
8044
8121
  };
8045
8122
  function AxisBottom(_ref) {
8046
8123
  var axisClassName = _ref.axisClassName, _ref$labelOffset = _ref.labelOffset, labelOffset = _ref$labelOffset === void 0 ? 8 : _ref$labelOffset, _ref$tickLength = _ref.tickLength, tickLength = _ref$tickLength === void 0 ? 8 : _ref$tickLength, tickLabelProps = _ref.tickLabelProps, restProps = _objectWithoutPropertiesLoose$l(_ref, _excluded$H);
8047
- var tickLabelPropsFinal = typeof tickLabelProps === "function" ? tickLabelProps : _extends$w({}, bottomTickLabelProps, tickLabelProps);
8048
- return /* @__PURE__ */ React__default.createElement(Axis$1, _extends$w({
8124
+ var tickLabelPropsFinal = typeof tickLabelProps === "function" ? tickLabelProps : _extends$v({}, bottomTickLabelProps, tickLabelProps);
8125
+ return /* @__PURE__ */ React__default.createElement(Axis$1, _extends$v({
8049
8126
  axisClassName: cx("visx-axis-bottom", axisClassName),
8050
8127
  labelOffset,
8051
8128
  orientation: Orientation$1.bottom,
@@ -8086,6 +8163,37 @@ const LeftAxis = ({
8086
8163
  }
8087
8164
  });
8088
8165
  };
8166
+ const BottomAxis = ({
8167
+ data,
8168
+ yMax,
8169
+ value,
8170
+ xScale,
8171
+ parentWidth,
8172
+ left: left2
8173
+ }) => {
8174
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
8175
+ return /* @__PURE__ */ jsx(AxisBottom, {
8176
+ numTicks: data == null ? void 0 : data.length,
8177
+ top: yMax,
8178
+ left: left2,
8179
+ hideTicks: (_a = value.main) == null ? void 0 : _a.hideTicks,
8180
+ hideAxisLine: ((_b = value.main) == null ? void 0 : _b.hideBottomAxisLine) !== void 0 ? (_c = value.main) == null ? void 0 : _c.hideBottomAxisLine : true,
8181
+ strokeWidth: (_e = (_d = value.style) == null ? void 0 : _d.labelStyle) == null ? void 0 : _e.bottomAxisWidth,
8182
+ scale: xScale,
8183
+ stroke: (_g = (_f = value.style) == null ? void 0 : _f.labelStyle) == null ? void 0 : _g.tickColor,
8184
+ labelOffset: (_i = (_h = value.style) == null ? void 0 : _h.labelStyle) == null ? void 0 : _i.bottomLabelOffset,
8185
+ label: (_j = value.main) == null ? void 0 : _j.bottomLabel,
8186
+ tickStroke: (_l = (_k = value.style) == null ? void 0 : _k.labelStyle) == null ? void 0 : _l.tickColor,
8187
+ tickLabelProps: () => {
8188
+ var _a2, _b2, _c2, _d2;
8189
+ return {
8190
+ fill: (_b2 = (_a2 = value.style) == null ? void 0 : _a2.labelStyle) == null ? void 0 : _b2.tickLabelColor,
8191
+ fontSize: ((_d2 = (_c2 = value.style) == null ? void 0 : _c2.labelStyle) == null ? void 0 : _d2.tickFontSize) || 18,
8192
+ textAnchor: "middle"
8193
+ };
8194
+ }
8195
+ });
8196
+ };
8089
8197
  var _excluded$G = ["tooltipOpen"];
8090
8198
  function _objectWithoutPropertiesLoose$k(source, excluded) {
8091
8199
  if (source == null)
@@ -8101,8 +8209,8 @@ function _objectWithoutPropertiesLoose$k(source, excluded) {
8101
8209
  }
8102
8210
  return target;
8103
8211
  }
8104
- function _extends$v() {
8105
- _extends$v = Object.assign ? Object.assign.bind() : function(target) {
8212
+ function _extends$u() {
8213
+ _extends$u = Object.assign ? Object.assign.bind() : function(target) {
8106
8214
  for (var i = 1; i < arguments.length; i++) {
8107
8215
  var source = arguments[i];
8108
8216
  for (var key in source) {
@@ -8113,17 +8221,17 @@ function _extends$v() {
8113
8221
  }
8114
8222
  return target;
8115
8223
  };
8116
- return _extends$v.apply(this, arguments);
8224
+ return _extends$u.apply(this, arguments);
8117
8225
  }
8118
8226
  function useTooltip(initialTooltipState) {
8119
- var _useState = useState(_extends$v({
8227
+ var _useState = useState(_extends$u({
8120
8228
  tooltipOpen: false
8121
8229
  }, initialTooltipState)), tooltipState = _useState[0], setTooltipState = _useState[1];
8122
8230
  var showTooltip = useCallback(function(showArgs) {
8123
8231
  return setTooltipState(typeof showArgs === "function" ? function(_ref) {
8124
8232
  _ref.tooltipOpen;
8125
8233
  var show = _objectWithoutPropertiesLoose$k(_ref, _excluded$G);
8126
- return _extends$v({}, showArgs(show), {
8234
+ return _extends$u({}, showArgs(show), {
8127
8235
  tooltipOpen: true
8128
8236
  });
8129
8237
  } : {
@@ -8151,41 +8259,6 @@ function useTooltip(initialTooltipState) {
8151
8259
  hideTooltip
8152
8260
  };
8153
8261
  }
8154
- function _extends$u() {
8155
- _extends$u = Object.assign ? Object.assign.bind() : function(target) {
8156
- for (var i = 1; i < arguments.length; i++) {
8157
- var source = arguments[i];
8158
- for (var key in source) {
8159
- if (Object.prototype.hasOwnProperty.call(source, key)) {
8160
- target[key] = source[key];
8161
- }
8162
- }
8163
- }
8164
- return target;
8165
- };
8166
- return _extends$u.apply(this, arguments);
8167
- }
8168
- function withTooltip(BaseComponent, containerProps, renderContainer) {
8169
- if (containerProps === void 0) {
8170
- containerProps = {
8171
- style: {
8172
- position: "relative",
8173
- width: "inherit",
8174
- height: "inherit"
8175
- }
8176
- };
8177
- }
8178
- if (renderContainer === void 0) {
8179
- renderContainer = function renderContainer2(children2, props) {
8180
- return /* @__PURE__ */ React__default.createElement("div", props, children2);
8181
- };
8182
- }
8183
- var WrappedComponent = function WrappedComponent2(props) {
8184
- var tooltipProps = useTooltip();
8185
- return renderContainer(/* @__PURE__ */ React__default.createElement(BaseComponent, _extends$u({}, tooltipProps, props)), containerProps);
8186
- };
8187
- return WrappedComponent;
8188
- }
8189
8262
  function debounce$3(func, wait, immediate) {
8190
8263
  var timeout2, args, context, timestamp, result;
8191
8264
  if (null == wait)
@@ -8702,44 +8775,16 @@ function useTooltipInPortal(_temp) {
8702
8775
  TooltipInPortal
8703
8776
  };
8704
8777
  }
8705
- const BottomAxis = ({
8706
- data,
8707
- yMax,
8708
- value,
8709
- xScale,
8710
- parentWidth,
8711
- left: left2
8712
- }) => {
8713
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
8714
- return /* @__PURE__ */ jsx(AxisBottom, {
8715
- numTicks: data == null ? void 0 : data.length,
8716
- top: yMax,
8717
- left: left2,
8718
- hideTicks: (_a = value.main) == null ? void 0 : _a.hideTicks,
8719
- hideAxisLine: ((_b = value.main) == null ? void 0 : _b.hideBottomAxisLine) !== void 0 ? (_c = value.main) == null ? void 0 : _c.hideBottomAxisLine : true,
8720
- strokeWidth: (_e = (_d = value.style) == null ? void 0 : _d.labelStyle) == null ? void 0 : _e.bottomAxisWidth,
8721
- scale: xScale,
8722
- stroke: (_g = (_f = value.style) == null ? void 0 : _f.labelStyle) == null ? void 0 : _g.tickColor,
8723
- labelOffset: (_i = (_h = value.style) == null ? void 0 : _h.labelStyle) == null ? void 0 : _i.bottomLabelOffset,
8724
- label: (_j = value.main) == null ? void 0 : _j.bottomLabel,
8725
- tickStroke: (_l = (_k = value.style) == null ? void 0 : _k.labelStyle) == null ? void 0 : _l.tickColor,
8726
- tickLabelProps: () => {
8727
- var _a2, _b2, _c2, _d2;
8728
- return {
8729
- fill: (_b2 = (_a2 = value.style) == null ? void 0 : _a2.labelStyle) == null ? void 0 : _b2.tickLabelColor,
8730
- fontSize: ((_d2 = (_c2 = value.style) == null ? void 0 : _c2.labelStyle) == null ? void 0 : _d2.tickFontSize) || 18,
8731
- textAnchor: "middle"
8732
- };
8733
- }
8734
- });
8735
- };
8736
8778
  const ToolTip = ({
8737
- style: style2,
8779
+ value,
8780
+ theme,
8738
8781
  top: top2,
8739
8782
  left: left2,
8740
8783
  tooltipData,
8741
8784
  colorScale
8742
8785
  }) => {
8786
+ const barGroup = tooltipData == null ? void 0 : tooltipData.groupData;
8787
+ const highlightedBar = tooltipData == null ? void 0 : tooltipData.highlightedBar;
8743
8788
  const {
8744
8789
  TooltipInPortal
8745
8790
  } = useTooltipInPortal({
@@ -8747,23 +8792,43 @@ const ToolTip = ({
8747
8792
  scroll: true
8748
8793
  });
8749
8794
  return /* @__PURE__ */ jsx(TooltipInPortal, {
8795
+ style: {
8796
+ ...defaultStyles,
8797
+ backgroundColor: theme.myTheme.palette.secondary.main
8798
+ },
8750
8799
  top: top2,
8751
8800
  left: left2,
8752
- children: Object.keys(tooltipData).map((bar) => bar === "label" ? null : /* @__PURE__ */ jsxs("div", {
8801
+ children: Object.keys(barGroup).map((bar) => bar === value.main.xAxisValue ? null : /* @__PURE__ */ jsxs("div", {
8753
8802
  style: {
8754
8803
  display: "flex",
8755
8804
  marginBottom: "2.5px",
8756
8805
  marginTop: "2.5px"
8757
8806
  },
8758
8807
  children: [/* @__PURE__ */ jsx("span", {
8808
+ style: {
8809
+ backgroundColor: colorScale(bar),
8810
+ width: "15px",
8811
+ height: "15px",
8812
+ marginRight: "5px",
8813
+ border: (highlightedBar == null ? void 0 : highlightedBar.key) === bar ? "1px solid black" : "1px solid transparent"
8814
+ }
8815
+ }), /* @__PURE__ */ jsx("span", {
8759
8816
  style: {
8760
8817
  marginRight: "5px"
8761
8818
  },
8762
- children: /* @__PURE__ */ jsxs("strong", {
8819
+ children: /* @__PURE__ */ jsxs("span", {
8820
+ style: {
8821
+ fontWeight: (highlightedBar == null ? void 0 : highlightedBar.key) === bar ? "bold" : "normal",
8822
+ color: "black"
8823
+ },
8763
8824
  children: [bar, ": "]
8764
8825
  })
8765
8826
  }), /* @__PURE__ */ jsx("span", {
8766
- children: tooltipData[bar]
8827
+ style: {
8828
+ fontWeight: (highlightedBar == null ? void 0 : highlightedBar.key) === bar ? "bold" : "normal",
8829
+ color: "black"
8830
+ },
8831
+ children: barGroup[bar]
8767
8832
  })]
8768
8833
  }))
8769
8834
  }, Math.random());
@@ -9629,12 +9694,6 @@ function stack$1(_ref6) {
9629
9694
  path2.offset((0, _stackOffset.default)(offset2));
9630
9695
  return path2;
9631
9696
  }
9632
- const tooltipStyles = {
9633
- ...defaultStyles,
9634
- minWidth: 60,
9635
- backgroundColor: "rgba(0,0,0,0.9)",
9636
- color: "white"
9637
- };
9638
9697
  const defaultMargin$1 = {
9639
9698
  top: 40,
9640
9699
  right: 0,
@@ -9642,17 +9701,21 @@ const defaultMargin$1 = {
9642
9701
  left: 0
9643
9702
  };
9644
9703
  function DrawBarGraph({
9704
+ theme,
9645
9705
  width: width2,
9646
9706
  height: height2,
9647
9707
  events = false,
9648
9708
  margin: margin2 = defaultMargin$1,
9649
9709
  value
9650
9710
  }) {
9651
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t5, _u, _v, _w;
9711
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
9652
9712
  const data = (_a = value.main) == null ? void 0 : _a.data;
9653
- const keys2 = Object.keys(data[0]).filter((d2) => d2 !== "label");
9654
- const [hovInd, setHovInd] = useState(null);
9655
- const getDate = (d2) => d2.label;
9713
+ const keys2 = Object.keys(data[0]).filter((d2) => d2 !== value.main.xAxisValue);
9714
+ const [hoveredBar, setHoveredBar] = useState({
9715
+ date: null,
9716
+ city: null
9717
+ });
9718
+ const getDate = (d2) => d2[value.main.xAxisValue];
9656
9719
  const temperatureTotals = data.reduce((allTotals, currentDate) => {
9657
9720
  const totalTemperature = keys2.reduce((dailyTotal, k2) => {
9658
9721
  dailyTotal += Number(currentDate[k2]);
@@ -9674,7 +9737,7 @@ function DrawBarGraph({
9674
9737
  });
9675
9738
  const colorScale = createOrdinalScale$1({
9676
9739
  domain: keys2,
9677
- range: [((_e = (_d = (_c = value.style) == null ? void 0 : _c.barStyle) == null ? void 0 : _d.color) == null ? void 0 : _e.firstBarColor) || "#aeeef8", ((_h = (_g = (_f = value.style) == null ? void 0 : _f.barStyle) == null ? void 0 : _g.color) == null ? void 0 : _h.secondBarColor) || "#e5fd3d", ((_k = (_j = (_i = value.style) == null ? void 0 : _i.barStyle) == null ? void 0 : _j.color) == null ? void 0 : _k.thirdBarColor) || "#9caff6"]
9740
+ range: value.style.barStyle.colorRange
9678
9741
  });
9679
9742
  const xMax = width2 - margin2.left - margin2.right;
9680
9743
  const yMax = height2 - margin2.top - margin2.bottom;
@@ -9690,34 +9753,45 @@ function DrawBarGraph({
9690
9753
  hideTooltip
9691
9754
  } = useTooltip();
9692
9755
  const handleMouse = (event, bar, barGroup) => {
9693
- setHovInd(bar.index);
9756
+ setHoveredBar({
9757
+ date: barGroup,
9758
+ city: bar.index
9759
+ });
9694
9760
  showTooltip({
9695
9761
  tooltipLeft: event.clientX,
9696
9762
  tooltipTop: event.clientY,
9697
- tooltipData: data[barGroup.index]
9763
+ tooltipData: {
9764
+ groupData: data[barGroup.index],
9765
+ highlightedBar: bar
9766
+ }
9698
9767
  });
9699
9768
  };
9700
9769
  const handleMouseOut = (event) => {
9701
- setHovInd(null);
9770
+ setHoveredBar({
9771
+ date: null,
9772
+ city: null
9773
+ });
9702
9774
  hideTooltip();
9703
9775
  };
9704
- const {
9705
- TooltipInPortal,
9706
- containerRef
9707
- } = useTooltipInPortal({
9708
- detectBounds: true,
9709
- scroll: true
9710
- });
9711
- const stackhHandleMouse = (event, datum2, barGroup) => {
9776
+ const stackhHandleMouse = (event, bar, barGroup) => {
9777
+ setHoveredBar({
9778
+ date: barGroup,
9779
+ city: bar.index
9780
+ });
9712
9781
  showTooltip({
9713
- tooltipLeft: barGroup.x + barGroup.width / 2,
9714
- tooltipTop: barGroup.y + barGroup.height / 2,
9715
- tooltipData: data[barGroup.index]
9782
+ tooltipLeft: event.clientX,
9783
+ tooltipTop: event.clientY,
9784
+ tooltipData: {
9785
+ groupData: data[bar.index],
9786
+ highlightedBar: bar
9787
+ }
9716
9788
  });
9717
9789
  };
9790
+ function calcWidthofBar(date2) {
9791
+ return date2 == null ? void 0 : date2.bars.reduce((totalWidth, bar) => totalWidth + Math.min(bar.width, 15), 0);
9792
+ }
9718
9793
  return width2 < 10 ? null : /* @__PURE__ */ jsxs("div", {
9719
9794
  children: [/* @__PURE__ */ jsxs("svg", {
9720
- ref: containerRef,
9721
9795
  width: width2,
9722
9796
  height: height2,
9723
9797
  children: [/* @__PURE__ */ jsx("rect", {
@@ -9734,12 +9808,23 @@ function DrawBarGraph({
9734
9808
  width: width2 - margin2.left - margin2.right,
9735
9809
  height: yMax,
9736
9810
  stroke: "black",
9737
- strokeOpacity: 0.1,
9738
- xOffset: dateScale.bandwidth() / 50
9811
+ xOffset: dateScale.bandwidth() / 50,
9812
+ strokeDasharray: "8 3",
9813
+ strokeOpacity: 0.2,
9814
+ strokeWidth: 0.3
9739
9815
  }), /* @__PURE__ */ jsxs(Group, {
9740
9816
  top: margin2.top,
9741
9817
  left: margin2.left,
9742
- children: [/* @__PURE__ */ jsx(LeftAxis, {
9818
+ children: [hoveredBar && /* @__PURE__ */ jsx("rect", {
9819
+ style: {
9820
+ display: hoveredBar.date ? "block" : "none"
9821
+ },
9822
+ x: value.main.type === "StackBarGraph" ? ((_c = hoveredBar == null ? void 0 : hoveredBar.date) == null ? void 0 : _c.bars[hoveredBar.city].x) - (Math.min((_d = hoveredBar == null ? void 0 : hoveredBar.date) == null ? void 0 : _d.bars[0].width, 15) - ((_e = hoveredBar == null ? void 0 : hoveredBar.date) == null ? void 0 : _e.bars[0].width)) / 2 : ((_f = hoveredBar.date) == null ? void 0 : _f.x0) - (Math.min((_g = hoveredBar == null ? void 0 : hoveredBar.date) == null ? void 0 : _g.bars[0].width, 15) - ((_h = hoveredBar == null ? void 0 : hoveredBar.date) == null ? void 0 : _h.bars[0].width)) || 0,
9823
+ width: value.main.type !== "StackBarGraph" ? calcWidthofBar(hoveredBar == null ? void 0 : hoveredBar.date) : Math.min((_i = hoveredBar == null ? void 0 : hoveredBar.date) == null ? void 0 : _i.bars[0].width, 15),
9824
+ height: yMax,
9825
+ fill: (_k = (_j = value.style) == null ? void 0 : _j.barStyle) == null ? void 0 : _k.hoverBackgroundColor,
9826
+ opacity: 1
9827
+ }), /* @__PURE__ */ jsx(LeftAxis, {
9743
9828
  value,
9744
9829
  yScale: tempScale,
9745
9830
  parentWidth: width2
@@ -9751,17 +9836,14 @@ function DrawBarGraph({
9751
9836
  yScale: tempScale,
9752
9837
  color: colorScale,
9753
9838
  children: (barStacks) => barStacks.map((barStack) => barStack.bars.map((bar) => /* @__PURE__ */ jsx("rect", {
9754
- x: bar.x,
9839
+ x: bar.x - (Math.min(bar.width, 15) - bar.width) / 2,
9755
9840
  y: bar.y,
9756
9841
  height: bar.height,
9757
- width: bar.width,
9842
+ width: Math.min(bar.width, 15),
9758
9843
  fill: bar.color,
9759
- onClick: () => {
9760
- if (events)
9761
- alert(`clicked: ${JSON.stringify(bar)}`);
9762
- },
9763
- onMouseOver: (e3) => stackhHandleMouse(e3, barStack, bar),
9764
- onMouseOut: hideTooltip
9844
+ onMouseOver: (e3) => stackhHandleMouse(e3, bar, barStack),
9845
+ onMouseOut: (e3) => handleMouseOut(),
9846
+ stroke: hoveredBar.city === bar.index ? "black" : "transparent"
9765
9847
  }, `bar-stack-${barStack.index}-${bar.index}`)))
9766
9848
  }) : /* @__PURE__ */ jsx(BarGroup, {
9767
9849
  data,
@@ -9774,31 +9856,24 @@ function DrawBarGraph({
9774
9856
  color: (key, index2) => {
9775
9857
  const color2 = colorScale(key);
9776
9858
  const opColor = `${colorScale(key)}50`;
9777
- return hovInd !== null ? index2 === hovInd ? color2 : opColor : color2;
9859
+ return (hoveredBar == null ? void 0 : hoveredBar.city) !== null ? index2 === (hoveredBar == null ? void 0 : hoveredBar.city) ? color2 : opColor : color2;
9778
9860
  },
9779
9861
  children: (barGroups) => barGroups.map((barGroup) => /* @__PURE__ */ jsx(Group, {
9780
9862
  left: barGroup.x0,
9781
- children: barGroup.bars.map((bar) => /* @__PURE__ */ jsx("rect", {
9782
- x: bar.x,
9783
- y: bar.y,
9784
- width: bar.width,
9785
- height: bar.height,
9786
- fill: bar.color,
9787
- onMouseOver: (e3) => handleMouse(e3, bar, barGroup),
9788
- onMouseOut: (e3) => handleMouseOut(),
9789
- onClick: () => {
9790
- if (!events)
9791
- return;
9792
- const {
9793
- key,
9794
- value: value2
9795
- } = bar;
9796
- alert(JSON.stringify({
9797
- key,
9798
- value: value2
9799
- }));
9800
- }
9801
- }, `bar-group-bar-${barGroup.index}-${bar.index}-${bar.value}-${bar.key}`))
9863
+ children: barGroup.bars.map((bar) => {
9864
+ const barWidth = Math.min(bar.width, 15);
9865
+ const barX = bar.index === 0 ? bar.x - (barWidth - bar.width) : bar.x;
9866
+ return /* @__PURE__ */ jsx("rect", {
9867
+ x: barX,
9868
+ y: bar.y,
9869
+ width: barWidth,
9870
+ height: bar.height,
9871
+ fill: bar.color,
9872
+ onMouseOver: (e3) => handleMouse(e3, bar, barGroup),
9873
+ onMouseOut: (e3) => handleMouseOut(),
9874
+ stroke: hoveredBar.city === bar.index ? "black" : "transparent"
9875
+ }, `bar-group-bar-${barGroup.index}-${bar.index}-${bar.value}-${bar.key}`);
9876
+ })
9802
9877
  }, `bar-group-${barGroup.index}-${barGroup.x0}`))
9803
9878
  })]
9804
9879
  }), /* @__PURE__ */ jsx(BottomAxis, {
@@ -9810,40 +9885,11 @@ function DrawBarGraph({
9810
9885
  })]
9811
9886
  }), ((_m = value == null ? void 0 : value.main) == null ? void 0 : _m.legendAvailable) && keys2.length > 1 && /* @__PURE__ */ jsx(Legend, {
9812
9887
  dataKeyArray: keys2,
9813
- colorRange: [((_p = (_o = (_n = value.style) == null ? void 0 : _n.barStyle) == null ? void 0 : _o.color) == null ? void 0 : _p.firstBarColor) || "#aeeef8", ((_s = (_r = (_q = value.style) == null ? void 0 : _q.barStyle) == null ? void 0 : _r.color) == null ? void 0 : _s.secondBarColor) || "#e5fd3d", ((_v = (_u = (_t5 = value.style) == null ? void 0 : _t5.barStyle) == null ? void 0 : _u.color) == null ? void 0 : _v.thirdBarColor) || "#9caff6"],
9888
+ colorRange: value.style.barStyle.colorRange,
9814
9889
  value
9815
- }), ((_w = value == null ? void 0 : value.main) == null ? void 0 : _w.type) === "StackBarGraph" ? tooltipOpen && tooltipData && /* @__PURE__ */ jsx(TooltipInPortal, {
9816
- top: tooltipTop,
9817
- left: tooltipLeft,
9818
- style: tooltipStyles,
9819
- children: Object.keys(tooltipData).map((bar) => bar === "label" ? null : /* @__PURE__ */ jsxs("div", {
9820
- style: {
9821
- display: "flex",
9822
- marginBottom: "2.5px",
9823
- marginTop: "2.5px"
9824
- },
9825
- children: [/* @__PURE__ */ jsx("span", {
9826
- style: {
9827
- backgroundColor: colorScale(bar),
9828
- width: "20px",
9829
- height: "20px",
9830
- marginRight: "5px"
9831
- }
9832
- }), /* @__PURE__ */ jsx("span", {
9833
- style: {
9834
- marginRight: "5px"
9835
- },
9836
- children: /* @__PURE__ */ jsxs("strong", {
9837
- children: [bar, ": "]
9838
- })
9839
- }), /* @__PURE__ */ jsx("span", {
9840
- children: tooltipData[bar]
9841
- })]
9842
- }))
9843
- }) : tooltipOpen && /* @__PURE__ */ jsx(ToolTip, {
9844
- style: {
9845
- ...value == null ? void 0 : value.style
9846
- },
9890
+ }), tooltipOpen && /* @__PURE__ */ jsx(ToolTip, {
9891
+ value,
9892
+ theme,
9847
9893
  top: tooltipTop,
9848
9894
  left: tooltipLeft,
9849
9895
  tooltipData,
@@ -10095,45 +10141,23 @@ ParentSize$1.propTypes = {
10095
10141
  children: PropTypes.func.isRequired
10096
10142
  };
10097
10143
  const Product1 = [
10098
- {
10099
- "key": "key1",
10100
- "value": [
10101
- { "x": "01:00", "y": 123 },
10102
- { "x": "02:00", "y": 118 },
10103
- { "x": "03:00", "y": 141 },
10104
- { "x": "04:00", "y": 114 },
10105
- { "x": "05:00", "y": 108 },
10106
- { "x": "06:00", "y": 123 },
10107
- { "x": "07:00", "y": 128 },
10108
- { "x": "08:00", "y": 134 },
10109
- { "x": "09:00", "y": 131 },
10110
- { "x": "10:00", "y": 134 },
10111
- { "x": "11:00", "y": 118 },
10112
- { "x": "11:00", "y": 10 },
10113
- { "x": "12:00", "y": 130 },
10114
- { "x": "13:00", "y": 133 },
10115
- { "x": "14:00", "y": 132 },
10116
- { "x": "15:00", "y": 1 },
10117
- { "x": "15:00", "y": 137 },
10118
- { "x": "16:00", "y": 120 }
10119
- ]
10120
- }
10144
+ { label: "B1", Budget: 5, Payout: 1 },
10145
+ { label: "B2", Budget: 5, Payout: 2 },
10146
+ { label: "B3", Budget: 8, Payout: 3 },
10147
+ { label: "B4", Budget: 6, Payout: 4 },
10148
+ { label: "B5", Budget: 7, Payout: 2 },
10149
+ { label: "B6", Budget: 10, Payout: 5 }
10121
10150
  ];
10122
10151
  const finalDataProvider = (type2, value, theme) => {
10123
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t5, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M;
10152
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t5, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F;
10124
10153
  switch (type2) {
10125
10154
  case "BarGraph":
10126
10155
  case "StackBarGraph":
10156
+ case "HorizontalBarGraph":
10157
+ case "HorizontalStackBarGraph":
10127
10158
  return {
10128
10159
  main: {
10129
- data: ((_a = value == null ? void 0 : value.main) == null ? void 0 : _a.data) || [
10130
- { "label": "B1", "Budget": 5, "Payout": 1 },
10131
- { "label": "B2", "Budget": 5, "Payout": 2 },
10132
- { "label": "B3", "Budget": 8, "Payout": 3 },
10133
- { "label": "B4", "Budget": 6, "Payout": 4 },
10134
- { "label": "B5", "Budget": 7, "Payout": 2 },
10135
- { "label": "B6", "Budget": 10, "Payout": 5 }
10136
- ],
10160
+ data: ((_a = value == null ? void 0 : value.main) == null ? void 0 : _a.data) || Product1,
10137
10161
  header: "Bar Graph",
10138
10162
  bottomLabel: "Name of Employe",
10139
10163
  numTicks: 6,
@@ -10145,6 +10169,7 @@ const finalDataProvider = (type2, value, theme) => {
10145
10169
  hideLeftAxisLine: false,
10146
10170
  hideBottomAxisLine: false,
10147
10171
  bottomAxisWidth: "10px",
10172
+ xAxisValue: "label",
10148
10173
  ...value.main,
10149
10174
  legend: {
10150
10175
  legendTitle: "",
@@ -10187,25 +10212,31 @@ const finalDataProvider = (type2, value, theme) => {
10187
10212
  tickLabelColor: theme.myTheme.palette.text.primary,
10188
10213
  tickFontSize: "14px",
10189
10214
  rightAxisWidth: "0.3px",
10190
- fontSize: "10px",
10215
+ fontSize: "12px",
10191
10216
  ...(_f = value == null ? void 0 : value.style) == null ? void 0 : _f.labelStyle
10192
10217
  },
10193
10218
  barStyle: {
10194
- color: {
10195
- firstBarColor: theme.myTheme.palette.primary.main,
10196
- secondBarColor: theme.myTheme.palette.primary.dark
10197
- },
10219
+ colorRange: ((_g = theme == null ? void 0 : theme.chartColours) == null ? void 0 : _g.barChartColours) || [
10220
+ "#3f51b5",
10221
+ "rgba(200,0,31,0.9)",
10222
+ "rgba(25,200,205,0.6)"
10223
+ ],
10198
10224
  mediumValueColor: "rgba(63, 81, 181, 0.85)",
10199
10225
  highValueColor: "rgba(63, 81, 181, 0.85)",
10200
10226
  lowValueColor: "rgba(63, 81, 181, 0.85)",
10201
- ...(_g = value == null ? void 0 : value.style) == null ? void 0 : _g.barStyle
10227
+ hoverBackgroundColor: `${theme.myTheme.palette.secondary.main}`,
10228
+ ...(_h = value == null ? void 0 : value.style) == null ? void 0 : _h.barStyle
10202
10229
  }
10203
10230
  }
10204
10231
  };
10205
10232
  case "PieGraph":
10206
10233
  return {
10207
10234
  main: {
10208
- data: ((_h = value == null ? void 0 : value.main) == null ? void 0 : _h.data) && value.main.data.length > 0 ? (_i = value == null ? void 0 : value.main) == null ? void 0 : _i.data : [{ label: "Kotak", value: 500 }, { label: "SBI", value: 700 }, { label: "HDFC", value: 900 }],
10235
+ data: ((_i = value == null ? void 0 : value.main) == null ? void 0 : _i.data) && value.main.data.length > 0 ? (_j = value == null ? void 0 : value.main) == null ? void 0 : _j.data : [
10236
+ { label: "Kotak", value: 500 },
10237
+ { label: "SBI", value: 700 },
10238
+ { label: "HDFC", value: 900 }
10239
+ ],
10209
10240
  header: "Pie Graph",
10210
10241
  bottomLabel: "Name of Employe",
10211
10242
  leftLabel: "Value",
@@ -10213,12 +10244,13 @@ const finalDataProvider = (type2, value, theme) => {
10213
10244
  axisLeft: true,
10214
10245
  axisBottom: true,
10215
10246
  legendAvailable: true,
10247
+ xAxisValue: "label",
10216
10248
  ...value == null ? void 0 : value.main,
10217
10249
  legend: {
10218
10250
  labelColor: theme.myTheme.palette.text.primary,
10219
10251
  direction: "column",
10220
10252
  align: "left",
10221
- ...(_j = value == null ? void 0 : value.main) == null ? void 0 : _j.legend
10253
+ ...(_k = value == null ? void 0 : value.main) == null ? void 0 : _k.legend
10222
10254
  }
10223
10255
  },
10224
10256
  style: {
@@ -10228,7 +10260,7 @@ const finalDataProvider = (type2, value, theme) => {
10228
10260
  height: "310",
10229
10261
  borderRadius: "20px",
10230
10262
  padding: "10px 0 2px 0",
10231
- ...(_k = value == null ? void 0 : value.style) == null ? void 0 : _k.containerStyle
10263
+ ...(_l = value == null ? void 0 : value.style) == null ? void 0 : _l.containerStyle
10232
10264
  },
10233
10265
  headerStyle: {
10234
10266
  fontWeight: 500,
@@ -10239,7 +10271,7 @@ const finalDataProvider = (type2, value, theme) => {
10239
10271
  width: "100%",
10240
10272
  fontSize: "18px",
10241
10273
  color: theme.myTheme.palette.text.primary,
10242
- ...(_l = value == null ? void 0 : value.style) == null ? void 0 : _l.headerStyle
10274
+ ...(_m = value == null ? void 0 : value.style) == null ? void 0 : _m.headerStyle
10243
10275
  },
10244
10276
  tooltipStyle: {
10245
10277
  width: "100%",
@@ -10247,14 +10279,14 @@ const finalDataProvider = (type2, value, theme) => {
10247
10279
  height: 20,
10248
10280
  backgroundColor: "lightgrey",
10249
10281
  color: "black",
10250
- ...(_m = value == null ? void 0 : value.style) == null ? void 0 : _m.tooltipStyle
10282
+ ...(_n = value == null ? void 0 : value.style) == null ? void 0 : _n.tooltipStyle
10251
10283
  },
10252
10284
  labelStyle: {
10253
10285
  labelColor: theme.myTheme.palette.text.primary,
10254
10286
  labelOffset: 45,
10255
10287
  leftLabelMargin: "70",
10256
10288
  topLabelMargin: "-40",
10257
- ...(_n = value == null ? void 0 : value.style) == null ? void 0 : _n.labelStyle
10289
+ ...(_o = value == null ? void 0 : value.style) == null ? void 0 : _o.labelStyle
10258
10290
  },
10259
10291
  legendStyle: {
10260
10292
  legend: {
@@ -10267,36 +10299,41 @@ const finalDataProvider = (type2, value, theme) => {
10267
10299
  border: "1px solid rgba(255, 255, 255, 0.3)",
10268
10300
  borderRadius: " 8px",
10269
10301
  margin: "5px 5px",
10270
- ...(_p = (_o = value == null ? void 0 : value.style) == null ? void 0 : _o.legendStyle) == null ? void 0 : _p.legend
10302
+ ...(_q = (_p = value == null ? void 0 : value.style) == null ? void 0 : _p.legendStyle) == null ? void 0 : _q.legend
10271
10303
  },
10272
10304
  legendVertical: {
10273
10305
  paddingBottom: "8px",
10274
10306
  flexDirection: "row",
10275
10307
  display: "flex",
10276
- alignItems: "center"
10308
+ alignItems: "center",
10309
+ ...(_s = (_r = value == null ? void 0 : value.style) == null ? void 0 : _r.legendStyle) == null ? void 0 : _s.legendVertical
10277
10310
  },
10278
10311
  legendTitle: {
10279
10312
  fontWeight: 500,
10280
10313
  marginBottom: "5px",
10281
10314
  fontFamily: "roboto",
10282
10315
  fontSize: "10px",
10283
- ...(_r = (_q = value == null ? void 0 : value.style) == null ? void 0 : _q.legendStyle) == null ? void 0 : _r.legendTitle
10316
+ ...(_u = (_t5 = value == null ? void 0 : value.style) == null ? void 0 : _t5.legendStyle) == null ? void 0 : _u.legendTitle
10284
10317
  }
10285
10318
  },
10286
10319
  pieStyle: {
10287
- colorRange: ((_s = theme == null ? void 0 : theme.chartColours) == null ? void 0 : _s.pieChartColours) || ["#3f51b5", "rgba(200,0,31,0.9)", "rgba(25,200,205,0.6)"],
10320
+ colorRange: ((_v = theme == null ? void 0 : theme.chartColours) == null ? void 0 : _v.pieChartColours) || [
10321
+ "#3f51b5",
10322
+ "rgba(200,0,31,0.9)",
10323
+ "rgba(25,200,205,0.6)"
10324
+ ],
10288
10325
  outerRadius: 120,
10289
10326
  innerRadius: 63,
10290
10327
  cornerRadius: 2,
10291
10328
  padAngle: 6e-3,
10292
- ...(_t5 = value == null ? void 0 : value.style) == null ? void 0 : _t5.pieStyle
10329
+ ...(_w = value == null ? void 0 : value.style) == null ? void 0 : _w.pieStyle
10293
10330
  }
10294
10331
  }
10295
10332
  };
10296
10333
  case "LineGraph":
10297
10334
  return {
10298
10335
  main: {
10299
- data: ((_v = (_u = value == null ? void 0 : value.main) == null ? void 0 : _u.data) == null ? void 0 : _v.length) > 0 ? (_w = value == null ? void 0 : value.main) == null ? void 0 : _w.data : Product1,
10336
+ data: ((_y = (_x = value == null ? void 0 : value.main) == null ? void 0 : _x.data) == null ? void 0 : _y.length) > 0 ? (_z = value == null ? void 0 : value.main) == null ? void 0 : _z.data : Product1,
10300
10337
  header: "Line Graph Dynamic",
10301
10338
  bottomLabel: "Name of Employe",
10302
10339
  leftLabel: "Value",
@@ -10308,13 +10345,14 @@ const finalDataProvider = (type2, value, theme) => {
10308
10345
  axisBottom: true,
10309
10346
  hideLeftAxisLine: false,
10310
10347
  hideBottomAxisLine: false,
10348
+ xAxisValue: "label",
10311
10349
  ...value == null ? void 0 : value.main,
10312
10350
  legend: {
10313
10351
  labelColor: theme.myTheme.palette.text.primary,
10314
10352
  direction: "row",
10315
10353
  align: "right",
10316
10354
  colorRectWidth: 20,
10317
- ...(_x = value == null ? void 0 : value.main) == null ? void 0 : _x.legend
10355
+ ...(_A = value == null ? void 0 : value.main) == null ? void 0 : _A.legend
10318
10356
  }
10319
10357
  },
10320
10358
  style: {
@@ -10324,7 +10362,7 @@ const finalDataProvider = (type2, value, theme) => {
10324
10362
  height: "300",
10325
10363
  borderRadius: "20px",
10326
10364
  padding: "10px 0 2px 0",
10327
- ...(_y = value == null ? void 0 : value.style) == null ? void 0 : _y.containerStyle
10365
+ ...(_B = value == null ? void 0 : value.style) == null ? void 0 : _B.containerStyle
10328
10366
  },
10329
10367
  headerStyle: {
10330
10368
  fontWeight: 500,
@@ -10335,78 +10373,24 @@ const finalDataProvider = (type2, value, theme) => {
10335
10373
  width: "100%",
10336
10374
  fontSize: "18px",
10337
10375
  color: theme.myTheme.palette.text.primary,
10338
- ...(_z = value == null ? void 0 : value.style) == null ? void 0 : _z.headerStyle
10376
+ ...(_C = value == null ? void 0 : value.style) == null ? void 0 : _C.headerStyle
10339
10377
  },
10340
10378
  labelStyle: {
10341
10379
  labelColor: theme.myTheme.palette.text.primary,
10380
+ fontSize: "12px",
10342
10381
  bottomLabelOffset: 25,
10343
10382
  leftLabelOffset: 25,
10344
- ...(_A = value == null ? void 0 : value.style) == null ? void 0 : _A.labelStyle
10383
+ ...(_D = value == null ? void 0 : value.style) == null ? void 0 : _D.labelStyle
10345
10384
  },
10346
10385
  lineStyle: {
10347
- colorRange: ((_B = theme == null ? void 0 : theme.chartColours) == null ? void 0 : _B.lineChartColours) || ["#3f51b5", "rgba(200,0,31,0.9)", "rgba(25,200,205,0.6)"],
10386
+ colorRange: ((_E = theme == null ? void 0 : theme.chartColours) == null ? void 0 : _E.lineChartColours) || [
10387
+ "#3f51b5",
10388
+ "rgba(200,0,31,0.9)",
10389
+ "rgba(25,200,205,0.6)"
10390
+ ],
10348
10391
  lineAreaColor: "none",
10349
10392
  lineAreaOpacity: 0.2,
10350
- ...(_C = value == null ? void 0 : value.style) == null ? void 0 : _C.lineStyle
10351
- }
10352
- }
10353
- };
10354
- case "HorizontalBarGraph":
10355
- return {
10356
- main: {
10357
- data: ((_D = value == null ? void 0 : value.main) == null ? void 0 : _D.data) || [{ y: "Anant Sharma", x: 60 }, { y: "Pankaj Chauhan", x: 60 }, { y: "satendra Raghav", x: 150 }, { y: "Vivek Pahadi", x: 80 }, { y: "Siddarth verma", x: 100 }],
10358
- header: " ",
10359
- bottomLabel: "Name of Employee",
10360
- numTicks: 6,
10361
- leftLabel: "Value",
10362
- axisLeft: true,
10363
- axisBottom: true,
10364
- hideBottomTicks: false,
10365
- hideLeftTicks: ((_E = value == null ? void 0 : value.main) == null ? void 0 : _E.data) ? ((_F = value.main) == null ? void 0 : _F.hideLeftTicks) !== void 0 ? (_G = value.main) == null ? void 0 : _G.hideLeftTicks : true : false,
10366
- hideLeftAxisLine: ((_H = value == null ? void 0 : value.main) == null ? void 0 : _H.data) ? true : false,
10367
- hideBottomAxisLine: false,
10368
- bottomAxisWidth: "10px",
10369
- ...value.main
10370
- },
10371
- style: {
10372
- containerStyle: {
10373
- background: theme.myTheme.palette.background.default,
10374
- width: "90%",
10375
- height: "300",
10376
- borderRadius: "20px",
10377
- padding: "10px 0 2px 0",
10378
- ...(_I = value == null ? void 0 : value.style) == null ? void 0 : _I.containerStyle
10379
- },
10380
- headerStyle: {
10381
- fontWeight: 500,
10382
- textAlign: "left",
10383
- fontFamily: "inherit",
10384
- marginBottom: "20px",
10385
- padding: "15px 0 1px 20px",
10386
- width: "100%",
10387
- fontSize: "18px",
10388
- color: theme.myTheme.palette.text.primary,
10389
- ...(_J = value == null ? void 0 : value.style) == null ? void 0 : _J.headerStyle
10390
- },
10391
- tooltipStyle: {
10392
- padding: "6px",
10393
- borderRadius: "2px",
10394
- ...(_K = value == null ? void 0 : value.style) == null ? void 0 : _K.tooltipStyle
10395
- },
10396
- labelStyle: {
10397
- margin: { top: 10, left: 180, right: 40, bottom: 40 },
10398
- tickLabelColor: theme.myTheme.palette.text.primary,
10399
- leftLabelOffset: 140,
10400
- bottomLabelOffset: 5,
10401
- tickFontSize: "10px",
10402
- tickColor: theme.myTheme.palette.text.primary,
10403
- rightAxisWidth: "0.3px",
10404
- fontSize: "10px",
10405
- ...(_L = value == null ? void 0 : value.style) == null ? void 0 : _L.labelStyle
10406
- },
10407
- barStyle: {
10408
- color: theme.myTheme.palette.primary.main,
10409
- ...(_M = value == null ? void 0 : value.style) == null ? void 0 : _M.barStyle
10393
+ ...(_F = value == null ? void 0 : value.style) == null ? void 0 : _F.lineStyle
10410
10394
  }
10411
10395
  }
10412
10396
  };
@@ -10417,12 +10401,12 @@ const BarGraph = ({
10417
10401
  theme
10418
10402
  }) => {
10419
10403
  var _a, _b, _c, _d, _e;
10420
- console.log("data of bar is ", value);
10421
10404
  const barData = finalDataProvider((_a = value == null ? void 0 : value.main) == null ? void 0 : _a.type, value, theme);
10422
10405
  let GraphRender = /* @__PURE__ */ jsx(ParentSize$1, {
10423
10406
  children: (parent) => {
10424
10407
  var _a2, _b2, _c2, _d2, _e2, _f, _g, _h, _i, _j, _k, _l, _m, _n;
10425
10408
  return /* @__PURE__ */ jsx(DrawBarGraph, {
10409
+ theme,
10426
10410
  width: parent.width || 800,
10427
10411
  height: ((_b2 = (_a2 = barData == null ? void 0 : barData.style) == null ? void 0 : _a2.containerStyle) == null ? void 0 : _b2.height) || "450",
10428
10412
  margin: {
@@ -10447,23 +10431,33 @@ const BarGraph = ({
10447
10431
  });
10448
10432
  };
10449
10433
  const DrawPieGraph = ({
10434
+ theme,
10450
10435
  value,
10451
10436
  parentWidth,
10452
10437
  parentHeight
10453
10438
  }) => {
10454
10439
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p;
10440
+ const {
10441
+ TooltipInPortal
10442
+ } = useTooltipInPortal({
10443
+ detectBounds: true,
10444
+ scroll: true
10445
+ });
10455
10446
  const [active2, setActive] = useState(null);
10456
10447
  const letters = (_a = value == null ? void 0 : value.main) == null ? void 0 : _a.data;
10457
10448
  const keys2 = Object.keys(letters[0]);
10458
10449
  const arr = ((_b = value == null ? void 0 : value.main) == null ? void 0 : _b.xAxisValue) && ((_c = value == null ? void 0 : value.main) == null ? void 0 : _c.yAxisValue) ? [(_d = value == null ? void 0 : value.main) == null ? void 0 : _d.xAxisValue, (_e = value == null ? void 0 : value.main) == null ? void 0 : _e.yAxisValue] : keys2;
10459
- const labelKeyIndex = keys2.indexOf("label");
10450
+ const labelKeyIndex = keys2.indexOf(value.main.xAxisValue);
10460
10451
  const valueKeyIndex = labelKeyIndex === 0 ? 1 : 0;
10461
10452
  const frequency = (d2) => d2[arr[valueKeyIndex]];
10462
10453
  const getLetterFrequencyColor = createOrdinalScale$1({
10463
10454
  domain: letters.map((l2) => l2[arr[labelKeyIndex]]),
10464
10455
  range: (_g = (_f = value == null ? void 0 : value.style) == null ? void 0 : _f.pieStyle) == null ? void 0 : _g.colorRange
10465
10456
  });
10466
- const dataKeyArray = letters.map((data) => data.label);
10457
+ const getColor = (letter) => {
10458
+ return getLetterFrequencyColor(letter);
10459
+ };
10460
+ const dataKeyArray = letters.map((data) => data[value.main.xAxisValue]);
10467
10461
  const {
10468
10462
  tooltipData,
10469
10463
  tooltipLeft,
@@ -10484,21 +10478,21 @@ const DrawPieGraph = ({
10484
10478
  }
10485
10479
  });
10486
10480
  };
10487
- const innerWidth = parentWidth - 40;
10488
- const innerHeight = parentHeight - 40;
10481
+ const innerWidth = parentWidth - 60;
10482
+ const innerHeight = parentHeight - 60;
10489
10483
  const centerX = innerWidth / 2;
10490
10484
  const centerY = innerHeight / 2;
10491
- const left2 = centerX + 20;
10492
- const top2 = centerY + 20;
10485
+ const left2 = centerX;
10486
+ const top2 = centerY;
10493
10487
  const pieSortValues = (a2, b10) => a2 - b10;
10494
10488
  return /* @__PURE__ */ jsx(Fragment, {
10495
10489
  children: /* @__PURE__ */ jsxs("div", {
10496
10490
  style: {
10497
10491
  display: "flex",
10498
- justifyContent: "space-between"
10492
+ justifyContent: "space-evenly"
10499
10493
  },
10500
10494
  children: [/* @__PURE__ */ jsx("svg", {
10501
- width: parentWidth,
10495
+ width: 0.7 * parentWidth,
10502
10496
  height: parentHeight,
10503
10497
  className: "pieGraphContainer",
10504
10498
  children: /* @__PURE__ */ jsxs(Group, {
@@ -10532,7 +10526,7 @@ const DrawPieGraph = ({
10532
10526
  data
10533
10527
  }) => {
10534
10528
  var _a2, _b2, _c2, _d2;
10535
- const size = active2 && active2.label == data.label ? (_b2 = (_a2 = value == null ? void 0 : value.style) == null ? void 0 : _a2.pieStyle) == null ? void 0 : _b2.outerRadius : ((_d2 = (_c2 = value == null ? void 0 : value.style) == null ? void 0 : _c2.pieStyle) == null ? void 0 : _d2.outerRadius) - 3;
10529
+ const size = active2 && active2[value.main.xAxisValue] == data[value.main.xAxisValue] ? (_b2 = (_a2 = value == null ? void 0 : value.style) == null ? void 0 : _a2.pieStyle) == null ? void 0 : _b2.outerRadius : ((_d2 = (_c2 = value == null ? void 0 : value.style) == null ? void 0 : _c2.pieStyle) == null ? void 0 : _d2.outerRadius) - 3;
10536
10530
  return size;
10537
10531
  },
10538
10532
  innerRadius: (_m = (_l = value == null ? void 0 : value.style) == null ? void 0 : _l.pieStyle) == null ? void 0 : _m.innerRadius,
@@ -10557,17 +10551,46 @@ const DrawPieGraph = ({
10557
10551
  }
10558
10552
  })]
10559
10553
  })
10560
- }), tooltipOpen && /* @__PURE__ */ jsx(ToolTip, {
10561
- style: value == null ? void 0 : value.style,
10554
+ }), tooltipOpen && /* @__PURE__ */ jsx(TooltipInPortal, {
10555
+ style: {
10556
+ ...defaultStyles,
10557
+ backgroundColor: theme.myTheme.palette.secondary.main
10558
+ },
10562
10559
  top: tooltipTop,
10563
10560
  left: tooltipLeft,
10564
- tooltipData
10565
- }), /* @__PURE__ */ jsx("div", {
10561
+ children: Object.keys(tooltipData).map((bar) => /* @__PURE__ */ jsxs("div", {
10562
+ style: {
10563
+ display: "flex",
10564
+ marginBottom: "2.5px",
10565
+ marginTop: "2.5px"
10566
+ },
10567
+ children: [/* @__PURE__ */ jsx("span", {
10568
+ style: {
10569
+ backgroundColor: getColor(bar),
10570
+ width: "15px",
10571
+ height: "15px",
10572
+ marginRight: "5px"
10573
+ }
10574
+ }), /* @__PURE__ */ jsx("span", {
10575
+ style: {
10576
+ marginRight: "5px"
10577
+ },
10578
+ children: /* @__PURE__ */ jsxs("strong", {
10579
+ style: {
10580
+ color: "black"
10581
+ },
10582
+ children: [bar, ": "]
10583
+ })
10584
+ }), /* @__PURE__ */ jsx("span", {
10585
+ style: {
10586
+ color: "black"
10587
+ },
10588
+ children: tooltipData[bar]
10589
+ })]
10590
+ }))
10591
+ }, Math.random()), /* @__PURE__ */ jsx("div", {
10566
10592
  style: {
10567
- width: "100px",
10568
- display: "flex",
10569
- marginTop: "20px",
10570
- marginRight: "130px"
10593
+ display: "flex"
10571
10594
  },
10572
10595
  children: ((_p = value == null ? void 0 : value.main) == null ? void 0 : _p.legendAvailable) && /* @__PURE__ */ jsx(Legend, {
10573
10596
  value,
@@ -10585,6 +10608,7 @@ const PieGraph = ({
10585
10608
  const pieData = finalDataProvider("PieGraph", value, theme);
10586
10609
  let PieRender = /* @__PURE__ */ jsx(ParentSize$1, {
10587
10610
  children: (parent) => /* @__PURE__ */ jsx(DrawPieGraph, {
10611
+ theme,
10588
10612
  parentWidth: parent.width,
10589
10613
  parentHeight: parseInt(pieData.style.containerStyle.height),
10590
10614
  parentRef: parent.ref,
@@ -12962,43 +12986,51 @@ const defaultMargin = {
12962
12986
  left: 0
12963
12987
  };
12964
12988
  const DrawGraph = ({
12989
+ theme,
12965
12990
  width: width2,
12966
12991
  height: height2,
12967
12992
  events = false,
12968
- margin: margin2 = defaultMargin,
12969
12993
  value
12970
12994
  }) => {
12971
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p;
12972
- (_a = value == null ? void 0 : value.main) == null ? void 0 : _a.data;
12995
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
12996
+ const margin2 = defaultMargin;
12973
12997
  useTooltip();
12974
- const data = (_b = value == null ? void 0 : value.main) == null ? void 0 : _b.data;
12975
- const arr = value.main.xAxisValue && value.main.yAxisValue ? [value.main.xAxisValue, value.main.yAxisValue] : Object.keys(data[0].value[0]);
12976
- const accessors = {
12977
- xAccessor: (d2) => d2[arr[0]],
12978
- yAccessor: (d2) => d2[arr[1]]
12979
- };
12980
- const dataKeyArray = data.map((ele) => ele.key);
12998
+ const data = (_a = value == null ? void 0 : value.main) == null ? void 0 : _a.data;
12999
+ const arr = Object.keys(data[0]).filter((d2) => d2 !== value.main.xAxisValue);
13000
+ const xValues = data.map((d2) => d2[value.main.xAxisValue]);
13001
+ const xScale = createBandScale({
13002
+ domain: xValues
13003
+ });
13004
+ const yScale = createLinearScale({
13005
+ domain: [0, Math.max(...data.flatMap((d2) => arr.map((key) => d2[key])))]
13006
+ });
13007
+ const xMax = width2 - margin2.left - margin2.right;
13008
+ const yMax = height2 - margin2.top - margin2.bottom;
13009
+ xScale.rangeRound([50, xMax - 50]);
13010
+ yScale.range([yMax - 10, 50]);
12981
13011
  return /* @__PURE__ */ jsxs(Fragment, {
12982
13012
  children: [value.main.legendAvailable && /* @__PURE__ */ jsx(Legend, {
12983
13013
  value,
12984
- dataKeyArray
13014
+ dataKeyArray: arr
12985
13015
  }), /* @__PURE__ */ jsxs(XYChart, {
12986
13016
  width: width2,
12987
13017
  height: height2,
12988
13018
  xScale: {
12989
- type: "band"
13019
+ type: "band",
13020
+ scale: xScale
12990
13021
  },
12991
13022
  yScale: {
12992
- type: "linear"
13023
+ type: "linear",
13024
+ scale: yScale
12993
13025
  },
12994
13026
  children: [/* @__PURE__ */ jsx(Axis, {
12995
13027
  orientation: "left",
12996
13028
  hideAxisLine: value.main.hideLeftAxisLine,
12997
13029
  label: value.main.leftLabel,
12998
- labelOffset: ((_d = (_c = value.style) == null ? void 0 : _c.labelStyle) == null ? void 0 : _d.leftLabelOffset) || 25,
13030
+ labelOffset: ((_c = (_b = value.style) == null ? void 0 : _b.labelStyle) == null ? void 0 : _c.leftLabelOffset) || 25,
12999
13031
  labelProps: {
13000
- fill: ((_f = (_e = value.style) == null ? void 0 : _e.labelStyle) == null ? void 0 : _f.labelColor) || "black",
13001
- fontSize: ((_h = (_g = value.style) == null ? void 0 : _g.labelStyle) == null ? void 0 : _h.fontSize) || "14px",
13032
+ fill: ((_e = (_d = value.style) == null ? void 0 : _d.labelStyle) == null ? void 0 : _e.labelColor) || "black",
13033
+ fontSize: ((_g = (_f = value.style) == null ? void 0 : _f.labelStyle) == null ? void 0 : _g.fontSize) || "12px",
13002
13034
  fontWeight: "normal"
13003
13035
  },
13004
13036
  tickLabelProps: (e3) => {
@@ -13015,8 +13047,8 @@ const DrawGraph = ({
13015
13047
  hideAxisLine: value.main.hideBottomAxisLine,
13016
13048
  label: value.main.bottomLabel,
13017
13049
  labelProps: {
13018
- fill: ((_j = (_i = value.style) == null ? void 0 : _i.labelStyle) == null ? void 0 : _j.labelColor) || "black",
13019
- fontSize: ((_l = (_k = value.style) == null ? void 0 : _k.labelStyle) == null ? void 0 : _l.fontSize) || "14px",
13050
+ fill: ((_i = (_h = value.style) == null ? void 0 : _h.labelStyle) == null ? void 0 : _i.labelColor) || "black",
13051
+ fontSize: ((_k = (_j = value.style) == null ? void 0 : _j.labelStyle) == null ? void 0 : _k.fontSize) || "12px",
13020
13052
  fontWeight: "normal"
13021
13053
  },
13022
13054
  tickLabelProps: (e3) => {
@@ -13028,52 +13060,82 @@ const DrawGraph = ({
13028
13060
  };
13029
13061
  },
13030
13062
  tickStroke: "black",
13031
- labelOffset: ((_n = (_m = value.style) == null ? void 0 : _m.labelStyle) == null ? void 0 : _n.bottomLabelOffset) || 25
13063
+ labelOffset: ((_m = (_l = value.style) == null ? void 0 : _l.labelStyle) == null ? void 0 : _m.bottomLabelOffset) || 25
13032
13064
  }), /* @__PURE__ */ jsx(Grid, {
13033
- strokeDasharray: "-",
13034
13065
  stroke: "black",
13035
13066
  lineStyle: {
13036
- opacity: 0.1
13037
- }
13038
- }), (_p = (_o = value.main) == null ? void 0 : _o.data) == null ? void 0 : _p.map((elem, i) => {
13067
+ opacity: 0.2
13068
+ },
13069
+ strokeDasharray: "8 3",
13070
+ strokeWidth: 0.3
13071
+ }), arr == null ? void 0 : arr.map((elem, i) => {
13039
13072
  var _a2, _b2, _c2, _d2, _e2, _f2;
13040
- return /* @__PURE__ */ jsx(LineSeries, {
13041
- dataKey: elem.key,
13042
- data: elem.value,
13043
- fill: (_b2 = (_a2 = value.style) == null ? void 0 : _a2.lineStyle) == null ? void 0 : _b2.lineAreaColor,
13044
- fillOpacity: (_d2 = (_c2 = value.style) == null ? void 0 : _c2.lineStyle) == null ? void 0 : _d2.lineAreaOpacity,
13045
- floodColor: "green",
13046
- floodOpacity: 1,
13047
- stroke: (_f2 = (_e2 = value.style) == null ? void 0 : _e2.lineStyle) == null ? void 0 : _f2.colorRange[i],
13048
- ...accessors
13073
+ return /* @__PURE__ */ jsxs(Fragment, {
13074
+ children: [/* @__PURE__ */ jsx(LineSeries, {
13075
+ dataKey: elem,
13076
+ data,
13077
+ fill: (_b2 = (_a2 = value.style) == null ? void 0 : _a2.lineStyle) == null ? void 0 : _b2.lineAreaColor,
13078
+ fillOpacity: (_d2 = (_c2 = value.style) == null ? void 0 : _c2.lineStyle) == null ? void 0 : _d2.lineAreaOpacity,
13079
+ floodColor: "green",
13080
+ floodOpacity: 1,
13081
+ stroke: (_f2 = (_e2 = value.style) == null ? void 0 : _e2.lineStyle) == null ? void 0 : _f2.colorRange[i],
13082
+ xAccessor: (d2) => d2[value.main.xAxisValue],
13083
+ yAccessor: (d2) => d2[elem]
13084
+ }), data.map((datum2, index2) => /* @__PURE__ */ jsx("circle", {
13085
+ cx: xScale(datum2[value.main.xAxisValue]) + xScale.bandwidth() / 2,
13086
+ cy: yScale(datum2[elem]),
13087
+ r: 3,
13088
+ fill: "white",
13089
+ stroke: "black",
13090
+ strokeWidth: 1
13091
+ }, index2))]
13049
13092
  });
13050
13093
  }), /* @__PURE__ */ jsx(Tooltip$2, {
13094
+ style: {
13095
+ ...defaultStyles,
13096
+ backgroundColor: theme.myTheme.palette.secondary.main
13097
+ },
13051
13098
  snapTooltipToDatumX: true,
13052
13099
  snapTooltipToDatumY: true,
13053
13100
  showVerticalCrosshair: true,
13054
13101
  showSeriesGlyphs: true,
13055
13102
  renderTooltip: ({
13056
- tooltipData: tooltipData2,
13057
- colorScale
13103
+ tooltipData: tooltipData2
13058
13104
  }) => {
13059
- var _a2, _b2;
13060
- console.log(tooltipData2);
13061
- return /* @__PURE__ */ jsxs("div", {
13062
- style: {
13063
- display: "flex",
13064
- marginBottom: "2.5px",
13065
- marginTop: "2.5px"
13066
- },
13067
- children: [/* @__PURE__ */ jsx("span", {
13105
+ return Object.keys(tooltipData2.datumByKey).map((d2, i) => {
13106
+ var _a2, _b2;
13107
+ return /* @__PURE__ */ jsxs("div", {
13068
13108
  style: {
13069
- marginRight: "5px"
13109
+ display: "flex",
13110
+ marginBottom: "2.5px",
13111
+ marginTop: "2.5px"
13070
13112
  },
13071
- children: /* @__PURE__ */ jsxs("strong", {
13072
- children: [(_a2 = tooltipData2 == null ? void 0 : tooltipData2.nearestDatum) == null ? void 0 : _a2.datum.x, ": "]
13073
- })
13074
- }), /* @__PURE__ */ jsx("span", {
13075
- children: (_b2 = tooltipData2 == null ? void 0 : tooltipData2.nearestDatum) == null ? void 0 : _b2.datum.y
13076
- })]
13113
+ children: [/* @__PURE__ */ jsx("span", {
13114
+ style: {
13115
+ backgroundColor: (_b2 = (_a2 = value.style) == null ? void 0 : _a2.lineStyle) == null ? void 0 : _b2.colorRange[i],
13116
+ width: "15px",
13117
+ height: "15px",
13118
+ marginRight: "5px"
13119
+ }
13120
+ }), /* @__PURE__ */ jsx("span", {
13121
+ style: {
13122
+ marginRight: "5px"
13123
+ },
13124
+ children: /* @__PURE__ */ jsxs("span", {
13125
+ style: {
13126
+ fontWeight: "normal",
13127
+ color: "black"
13128
+ },
13129
+ children: [d2, ": "]
13130
+ })
13131
+ }), /* @__PURE__ */ jsx("span", {
13132
+ style: {
13133
+ fontWeight: "normal",
13134
+ color: "black"
13135
+ },
13136
+ children: tooltipData2.datumByKey[d2].datum[d2]
13137
+ })]
13138
+ });
13077
13139
  });
13078
13140
  }
13079
13141
  })]
@@ -13093,47 +13155,34 @@ const LineGraph = ({
13093
13155
  children: (_d = lineData == null ? void 0 : lineData.main) == null ? void 0 : _d.header
13094
13156
  }), /* @__PURE__ */ jsx(ParentSize$1, {
13095
13157
  children: (parent) => {
13096
- var _a2, _b2, _c2, _d2, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
13158
+ var _a2, _b2;
13097
13159
  return /* @__PURE__ */ jsx(DrawGraph, {
13160
+ theme,
13098
13161
  width: parent.width || 800,
13099
13162
  height: ((_b2 = (_a2 = lineData == null ? void 0 : lineData.style) == null ? void 0 : _a2.containerStyle) == null ? void 0 : _b2.height) || "450",
13100
- margin: {
13101
- top: ((_e = (_d2 = (_c2 = lineData == null ? void 0 : lineData.style) == null ? void 0 : _c2.labelStyle) == null ? void 0 : _d2.margin) == null ? void 0 : _e.top) || 10,
13102
- right: ((_h = (_g = (_f = lineData == null ? void 0 : lineData.style) == null ? void 0 : _f.labelStyle) == null ? void 0 : _g.margin) == null ? void 0 : _h.right) || 10,
13103
- bottom: ((_k = (_j = (_i = lineData == null ? void 0 : lineData.style) == null ? void 0 : _i.labelStyle) == null ? void 0 : _j.margin) == null ? void 0 : _k.bottom) || 20,
13104
- left: ((_n = (_m = (_l = lineData == null ? void 0 : lineData.style) == null ? void 0 : _l.labelStyle) == null ? void 0 : _m.margin) == null ? void 0 : _n.left) || 60
13105
- },
13106
13163
  value: lineData
13107
13164
  });
13108
13165
  }
13109
13166
  })]
13110
13167
  });
13111
13168
  };
13112
- var DrawHorizontalBarGraph = withTooltip(({
13169
+ var DrawHorizontalBarGraph = ({
13170
+ theme,
13113
13171
  width: width2 = 600,
13114
13172
  height: height2 = 400,
13115
13173
  events = false,
13116
13174
  margin: margin2,
13117
- tooltipOpen,
13118
- tooltipLeft,
13119
- tooltipTop,
13120
- tooltipData,
13121
- hideTooltip,
13122
- showTooltip,
13123
13175
  barValue
13124
13176
  }) => {
13125
- var _a, _b, _c;
13177
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
13178
+ const [hoveredBar, setHoveredBar] = useState({
13179
+ date: null,
13180
+ city: null
13181
+ });
13126
13182
  const xMax = width2 - margin2.left - margin2.right;
13127
13183
  const yMax = height2 - margin2.top - margin2.bottom;
13128
- const tooltipStyles2 = {
13129
- ...defaultStyles,
13130
- padding: "12px",
13131
- minWidth: 60,
13132
- backgroundColor: "yellow",
13133
- color: "black"
13134
- };
13135
13184
  const data = (_a = barValue == null ? void 0 : barValue.main) == null ? void 0 : _a.data;
13136
- const keys2 = Object.keys(data[0]).filter((y2) => y2 !== "y");
13185
+ const keys2 = Object.keys(data[0]).filter((d2) => d2 !== barValue.main.xAxisValue);
13137
13186
  const temperatureTotals = data.reduce((allTotals, currentDate) => {
13138
13187
  const totalTemperature = keys2.reduce((dailyTotal, k2) => {
13139
13188
  dailyTotal += Number(currentDate[k2]);
@@ -13142,31 +13191,81 @@ var DrawHorizontalBarGraph = withTooltip(({
13142
13191
  allTotals.push(totalTemperature);
13143
13192
  return allTotals;
13144
13193
  }, []);
13145
- const getDate = (d2) => d2.y;
13194
+ const getDate = (d2) => d2[barValue.main.xAxisValue];
13146
13195
  const temperatureScale = createLinearScale({
13147
- domain: [0, Math.max(...temperatureTotals)],
13196
+ domain: ((_b = barValue == null ? void 0 : barValue.main) == null ? void 0 : _b.type) === "HorizontalStackBarGraph" ? [0, Math.max(...temperatureTotals)] : [0, Math.max(...data.map((d2) => Math.max(...keys2.map((key) => Number(d2[key])))))],
13148
13197
  nice: true
13149
13198
  });
13150
13199
  const dateScale = createBandScale({
13151
13200
  domain: data.map(getDate),
13152
- padding: 0.2
13201
+ padding: 0.4
13202
+ });
13203
+ const cityScale = createBandScale({
13204
+ domain: keys2
13153
13205
  });
13154
13206
  const colorScale = createOrdinalScale$1({
13155
13207
  domain: keys2,
13156
- range: [barValue.style.barStyle.color]
13208
+ range: barValue.style.barStyle.colorRange
13157
13209
  });
13158
- let tooltipTimeout;
13159
13210
  temperatureScale.rangeRound([0, xMax]);
13160
13211
  dateScale.rangeRound([yMax, 0]);
13212
+ cityScale.rangeRound([0, dateScale.bandwidth()]);
13213
+ const {
13214
+ tooltipData,
13215
+ tooltipLeft,
13216
+ tooltipTop,
13217
+ tooltipOpen,
13218
+ showTooltip,
13219
+ hideTooltip
13220
+ } = useTooltip();
13221
+ const handleMouse = (event, bar, barGroup) => {
13222
+ setHoveredBar({
13223
+ date: barGroup,
13224
+ city: bar.index
13225
+ });
13226
+ showTooltip({
13227
+ tooltipLeft: event.clientX,
13228
+ tooltipTop: event.clientY,
13229
+ tooltipData: {
13230
+ groupData: data[barGroup.index],
13231
+ highlightedBar: bar
13232
+ }
13233
+ });
13234
+ };
13235
+ const handleMouseOut = (event) => {
13236
+ setHoveredBar({
13237
+ date: null,
13238
+ city: null
13239
+ });
13240
+ hideTooltip();
13241
+ };
13242
+ const stackhHandleMouse = (event, bar, barGroup) => {
13243
+ setHoveredBar({
13244
+ date: barGroup,
13245
+ city: bar.index
13246
+ });
13247
+ showTooltip({
13248
+ tooltipLeft: event.clientX,
13249
+ tooltipTop: event.clientY,
13250
+ tooltipData: {
13251
+ groupData: data[bar.index],
13252
+ highlightedBar: bar
13253
+ }
13254
+ });
13255
+ };
13256
+ function calcWidthofBar(date2) {
13257
+ return date2 == null ? void 0 : date2.bars.reduce((totalWidth, bar) => totalWidth + Math.min(bar.height, 15), 0);
13258
+ }
13161
13259
  return width2 < 10 ? null : /* @__PURE__ */ jsxs("div", {
13162
13260
  children: [/* @__PURE__ */ jsxs("svg", {
13163
13261
  width: width2,
13164
13262
  height: height2,
13165
13263
  children: [/* @__PURE__ */ jsx("rect", {
13264
+ x: 0,
13265
+ y: 0,
13166
13266
  width: width2,
13167
13267
  height: height2,
13168
- fill: ((_c = (_b = barValue == null ? void 0 : barValue.style) == null ? void 0 : _b.containerStyle) == null ? void 0 : _c.background) || "#eaedff",
13169
- rx: 14
13268
+ fill: barValue.style.containerStyle.background || "#612efb"
13170
13269
  }), /* @__PURE__ */ jsx(Grid$1, {
13171
13270
  top: margin2.top,
13172
13271
  left: margin2.left,
@@ -13175,11 +13274,23 @@ var DrawHorizontalBarGraph = withTooltip(({
13175
13274
  width: xMax,
13176
13275
  height: yMax,
13177
13276
  stroke: "black",
13178
- strokeOpacity: 0.1
13277
+ xOffset: dateScale.bandwidth() / 50,
13278
+ strokeDasharray: "8 3",
13279
+ strokeOpacity: 0.2,
13280
+ strokeWidth: 0.3
13179
13281
  }), /* @__PURE__ */ jsxs(Group, {
13180
13282
  top: margin2.top,
13181
13283
  left: margin2.left,
13182
- children: [/* @__PURE__ */ jsx(BarStackHorizontal, {
13284
+ children: [hoveredBar && /* @__PURE__ */ jsx("rect", {
13285
+ style: {
13286
+ display: hoveredBar.date ? "block" : "none"
13287
+ },
13288
+ y: barValue.main.type === "HorizontalStackBarGraph" ? ((_c = hoveredBar == null ? void 0 : hoveredBar.date) == null ? void 0 : _c.bars[hoveredBar.city].y) - (Math.min((_d = hoveredBar == null ? void 0 : hoveredBar.date) == null ? void 0 : _d.bars[0].height, 15) - ((_e = hoveredBar == null ? void 0 : hoveredBar.date) == null ? void 0 : _e.bars[0].height)) / 2 : ((_f = hoveredBar.date) == null ? void 0 : _f.y0) - (Math.min((_g = hoveredBar == null ? void 0 : hoveredBar.date) == null ? void 0 : _g.bars[0].height, 15) - ((_h = hoveredBar == null ? void 0 : hoveredBar.date) == null ? void 0 : _h.bars[0].height)) || 0,
13289
+ width: xMax,
13290
+ height: barValue.main.type !== "HorizontalStackBarGraph" ? calcWidthofBar(hoveredBar == null ? void 0 : hoveredBar.date) : Math.min((_i = hoveredBar == null ? void 0 : hoveredBar.date) == null ? void 0 : _i.bars[0].height, 15),
13291
+ fill: (_k = (_j = barValue.style) == null ? void 0 : _j.barStyle) == null ? void 0 : _k.hoverBackgroundColor,
13292
+ opacity: 1
13293
+ }), barValue.main.type === "HorizontalStackBarGraph" ? /* @__PURE__ */ jsx(BarStackHorizontal, {
13183
13294
  data,
13184
13295
  keys: keys2,
13185
13296
  height: yMax,
@@ -13189,62 +13300,70 @@ var DrawHorizontalBarGraph = withTooltip(({
13189
13300
  color: colorScale,
13190
13301
  children: (barStacks) => barStacks.map((barStack) => barStack.bars.map((bar) => /* @__PURE__ */ jsx("rect", {
13191
13302
  x: bar.x,
13192
- y: bar.y,
13303
+ y: bar.y - (Math.min(bar.height, 15) - bar.height) / 2,
13193
13304
  width: bar.width,
13194
- height: bar.height,
13305
+ height: Math.min(bar.height, 15),
13195
13306
  fill: bar.color,
13196
- onClick: () => {
13197
- if (events)
13198
- alert(`clicked: ${JSON.stringify(bar)}`);
13199
- },
13200
- onMouseLeave: () => {
13201
- tooltipTimeout = window.setTimeout(() => {
13202
- hideTooltip();
13203
- }, 300);
13204
- },
13205
- onMouseMove: () => {
13206
- if (tooltipTimeout)
13207
- clearTimeout(tooltipTimeout);
13208
- const top2 = bar.y + margin2.top;
13209
- const left2 = bar.x + bar.width + margin2.left;
13210
- showTooltip({
13211
- tooltipData: bar,
13212
- tooltipTop: top2,
13213
- tooltipLeft: left2
13214
- });
13215
- }
13307
+ onMouseOver: (e3) => stackhHandleMouse(e3, bar, barStack),
13308
+ onMouseOut: (e3) => handleMouseOut(),
13309
+ stroke: hoveredBar.city === bar.index ? "black" : "transparent"
13216
13310
  }, `barstack-horizontal-${barStack.index}-${bar.index}`)))
13311
+ }) : /* @__PURE__ */ jsx(BarGroupHorizontal, {
13312
+ data,
13313
+ keys: keys2,
13314
+ width: xMax,
13315
+ height: yMax,
13316
+ y0: getDate,
13317
+ y0Scale: dateScale,
13318
+ y1Scale: cityScale,
13319
+ xScale: temperatureScale,
13320
+ color: (key, index2) => {
13321
+ const color2 = colorScale(key);
13322
+ const opColor = `${colorScale(key)}50`;
13323
+ return (hoveredBar == null ? void 0 : hoveredBar.city) !== null ? index2 === (hoveredBar == null ? void 0 : hoveredBar.city) ? color2 : opColor : color2;
13324
+ },
13325
+ children: (barGroups) => barGroups.map((barGroup) => /* @__PURE__ */ jsx(Group, {
13326
+ top: barGroup.y0,
13327
+ children: barGroup.bars.map((bar) => {
13328
+ const barHeight = Math.min(bar.height, 15);
13329
+ const barY = bar.index === 0 ? bar.y - (barHeight - bar.height) : bar.y;
13330
+ return /* @__PURE__ */ jsx("rect", {
13331
+ y: barY,
13332
+ x: bar.x,
13333
+ width: bar.width,
13334
+ height: barHeight,
13335
+ fill: bar.color,
13336
+ onMouseOver: (e3) => handleMouse(e3, bar, barGroup),
13337
+ onMouseOut: (e3) => handleMouseOut(),
13338
+ stroke: hoveredBar.city === bar.index ? "black" : "transparent"
13339
+ }, `bar-group-bar-${barGroup.index}-${bar.index}-${bar.value}-${bar.key}`);
13340
+ })
13341
+ }, `bar-group-${barGroup.index}-${barGroup.y0}`))
13217
13342
  }), /* @__PURE__ */ jsx(LeftAxis, {
13218
13343
  value: barValue,
13219
13344
  yScale: dateScale,
13220
- parentWidth: 500
13345
+ parentWidth: width2
13221
13346
  }), /* @__PURE__ */ jsx(BottomAxis, {
13222
- data,
13223
13347
  value: barValue,
13224
13348
  yMax,
13225
13349
  xScale: temperatureScale,
13226
- parentWidth: 500
13350
+ parentWidth: width2
13227
13351
  })]
13228
13352
  })]
13229
- }), tooltipOpen && tooltipData && /* @__PURE__ */ jsx(Tooltip$3, {
13353
+ }), ((_l = barValue == null ? void 0 : barValue.main) == null ? void 0 : _l.legendAvailable) && keys2.length > 1 && /* @__PURE__ */ jsx(Legend, {
13354
+ dataKeyArray: keys2,
13355
+ colorRange: barValue.style.barStyle.colorRange,
13356
+ value: barValue
13357
+ }), tooltipOpen && tooltipData && /* @__PURE__ */ jsx(ToolTip, {
13358
+ value: barValue,
13359
+ theme,
13230
13360
  top: tooltipTop,
13231
13361
  left: tooltipLeft,
13232
- style: tooltipStyles2,
13233
- children: /* @__PURE__ */ jsxs("div", {
13234
- children: [/* @__PURE__ */ jsx("span", {
13235
- children: /* @__PURE__ */ jsxs("strong", {
13236
- children: [getDate(tooltipData.bar.data), ":"]
13237
- })
13238
- }), /* @__PURE__ */ jsx("span", {
13239
- style: {
13240
- marginLeft: "5px"
13241
- },
13242
- children: tooltipData.bar.data[tooltipData.key]
13243
- })]
13244
- })
13362
+ tooltipData,
13363
+ colorScale
13245
13364
  })]
13246
13365
  });
13247
- });
13366
+ };
13248
13367
  const HorizontalBarGraph = ({
13249
13368
  value,
13250
13369
  theme
@@ -13255,6 +13374,7 @@ const HorizontalBarGraph = ({
13255
13374
  children: (parent) => {
13256
13375
  var _a2, _b2, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
13257
13376
  return /* @__PURE__ */ jsx(DrawHorizontalBarGraph, {
13377
+ theme,
13258
13378
  width: parent.width,
13259
13379
  height: parseInt(((_b2 = (_a2 = barData == null ? void 0 : barData.style) == null ? void 0 : _a2.containerStyle) == null ? void 0 : _b2.height) || 400),
13260
13380
  margin: {
@@ -20925,14 +21045,14 @@ const ProgressBar = ({
20925
21045
  value,
20926
21046
  theme
20927
21047
  }) => {
20928
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t5, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N;
21048
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t5, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P, _Q, _R, _S, _T, _U, _V, _W, _X, _Y, _Z, __;
20929
21049
  const [progress, setProgress] = useState(((_b = (_a = value == null ? void 0 : value.main) == null ? void 0 : _a.data) == null ? void 0 : _b.achieved) / ((_d = (_c = value == null ? void 0 : value.main) == null ? void 0 : _c.data) == null ? void 0 : _d.total) * 100);
20930
21050
  useEffect(() => {
20931
21051
  var _a2, _b2, _c2, _d2;
20932
21052
  setProgress(((_b2 = (_a2 = value == null ? void 0 : value.main) == null ? void 0 : _a2.data) == null ? void 0 : _b2.achieved) / ((_d2 = (_c2 = value == null ? void 0 : value.main) == null ? void 0 : _c2.data) == null ? void 0 : _d2.total) * 100);
20933
21053
  }, [value.main.data]);
20934
21054
  const getColor = () => {
20935
- return [`${theme.palette.grey[300]}`, `${theme.palette.primary.dark}`];
21055
+ return [`${theme.myTheme.palette.grey[300]}`, `${theme.myTheme.palette.primary.dark}`];
20936
21056
  };
20937
21057
  const StyledTooltip = styled$1(({
20938
21058
  className,
@@ -20942,60 +21062,62 @@ const ProgressBar = ({
20942
21062
  classes: {
20943
21063
  popper: className
20944
21064
  }
20945
- }))(({
20946
- theme: theme2
20947
- }) => ({
21065
+ }))(({}) => ({
20948
21066
  [`& .${tooltipClasses$1.tooltip}`]: {
20949
- backgroundColor: theme2.palette.grey[300],
20950
- color: theme2.palette.text.primary,
20951
- boxShadow: theme2.shadows[0],
20952
- fontSize: 11
21067
+ "& .MuiTooltip-arrow": {
21068
+ color: theme.myTheme.palette.secondary.main
21069
+ },
21070
+ backgroundColor: theme.myTheme.palette.secondary.main,
21071
+ color: theme.myTheme.palette.text.primary,
21072
+ fontSize: 11,
21073
+ boxShadow: `1px 2px ${theme.myTheme.palette.secondary.dark}`
20953
21074
  }
20954
21075
  }));
20955
21076
  if ((_e = value == null ? void 0 : value.main) == null ? void 0 : _e.developOnlyProgresBar) {
20956
- return /* @__PURE__ */ jsx("div", {
20957
- style: {
20958
- width: "100%",
20959
- height: "6px",
20960
- margin: "auto",
20961
- borderRadius: "10px",
20962
- marginBottom: "15px",
20963
- position: "relative"
20964
- },
20965
- children: /* @__PURE__ */ jsx("div", {
20966
- style: {
20967
- width: "-webkit-fill-available",
20968
- height: "12px",
20969
- margin: "auto",
21077
+ return /* @__PURE__ */ jsx(StyledTooltip, {
21078
+ arrow: true,
21079
+ title: /* @__PURE__ */ jsxs(Fragment, {
21080
+ children: [/* @__PURE__ */ jsxs("div", {
21081
+ style: {
21082
+ fontWeight: "normal",
21083
+ textAlign: "center"
21084
+ },
21085
+ children: [" ", "Target Achieved", " "]
21086
+ }), /* @__PURE__ */ jsxs("div", {
21087
+ style: {
21088
+ fontWeight: "bold",
21089
+ textAlign: "center"
21090
+ },
21091
+ children: [" ", (_g = (_f = value == null ? void 0 : value.main) == null ? void 0 : _f.data) == null ? void 0 : _g.achieved]
21092
+ })]
21093
+ }),
21094
+ placement: "top-end",
21095
+ theme,
21096
+ children: /* @__PURE__ */ jsx(Box$1, {
21097
+ className: "progress-bar-fill",
21098
+ sx: {
21099
+ width: progress > 100 ? "100%" : `${progress}%`,
21100
+ backgroundColor: getColor()[1],
21101
+ height: "100%",
20970
21102
  borderRadius: "10px",
20971
- backgroundColor: getColor()[0],
20972
21103
  marginBottom: "0px",
20973
- position: "absolute",
20974
- top: "10px",
20975
- left: "12.5px"
21104
+ transition: "width 0.5 ease-out",
21105
+ position: "relative",
21106
+ border: "1px solid transparent",
21107
+ "&:hover": {
21108
+ border: "1px solid black"
21109
+ }
20976
21110
  },
20977
21111
  children: /* @__PURE__ */ jsx("div", {
20978
- className: "progress-bar-fill",
20979
21112
  style: {
20980
- width: progress > 100 ? "100%" : `${progress}%`,
20981
- backgroundColor: getColor()[1],
20982
- height: "100%",
20983
- borderRadius: "10px",
20984
- marginBottom: "0px",
20985
- transition: "width 0.5 ease-out",
20986
- position: "relative"
20987
- },
20988
- children: /* @__PURE__ */ jsx("div", {
20989
- style: {
20990
- borderRadius: "50%",
20991
- width: "7px",
20992
- height: "7px",
20993
- backgroundColor: `${theme.palette.common.white}`,
20994
- position: "absolute",
20995
- top: "2.5px",
20996
- right: `2px`
20997
- }
20998
- })
21113
+ borderRadius: "50%",
21114
+ width: "7px",
21115
+ height: "7px",
21116
+ backgroundColor: `${theme.myTheme.palette.common.white}`,
21117
+ position: "absolute",
21118
+ top: "2px",
21119
+ right: `2px`
21120
+ }
20999
21121
  })
21000
21122
  })
21001
21123
  });
@@ -21003,8 +21125,8 @@ const ProgressBar = ({
21003
21125
  return /* @__PURE__ */ jsxs("div", {
21004
21126
  className: "container",
21005
21127
  style: {
21006
- backgroundColor: (_f = theme == null ? void 0 : theme.palette) == null ? void 0 : _f.background.main,
21007
- color: (_h = (_g = theme == null ? void 0 : theme.palette) == null ? void 0 : _g.text) == null ? void 0 : _h.primary,
21128
+ backgroundColor: (_i = (_h = theme.myTheme) == null ? void 0 : _h.palette) == null ? void 0 : _i.background.main,
21129
+ color: (_l = (_k = (_j = theme.myTheme) == null ? void 0 : _j.palette) == null ? void 0 : _k.text) == null ? void 0 : _l.primary,
21008
21130
  width: "auto",
21009
21131
  height: "auto",
21010
21132
  margin: "auto"
@@ -21018,14 +21140,14 @@ const ProgressBar = ({
21018
21140
  },
21019
21141
  children: [/* @__PURE__ */ jsx("div", {
21020
21142
  style: {
21021
- padding: "25px 0px 0px 55px",
21143
+ padding: "23px 0px 0px 60px",
21022
21144
  marginBottom: "-13px",
21023
21145
  textAlign: "left",
21024
21146
  fontFamily: "inherit",
21025
21147
  fontSize: "16px",
21026
- color: ((_j = (_i = theme == null ? void 0 : theme.palette) == null ? void 0 : _i.text) == null ? void 0 : _j.secondary) || "#121926"
21148
+ color: ((_o = (_n = (_m = theme.myTheme) == null ? void 0 : _m.palette) == null ? void 0 : _n.text) == null ? void 0 : _o.secondary) || "#121926"
21027
21149
  },
21028
- children: (_k = value == null ? void 0 : value.main) == null ? void 0 : _k.heading
21150
+ children: (_p = value == null ? void 0 : value.main) == null ? void 0 : _p.heading
21029
21151
  }), /* @__PURE__ */ jsxs("div", {
21030
21152
  style: {
21031
21153
  padding: "25px 0px 0px 55px",
@@ -21033,7 +21155,7 @@ const ProgressBar = ({
21033
21155
  textAlign: "left",
21034
21156
  fontFamily: "inherit",
21035
21157
  fontSize: "16px",
21036
- color: ((_m = (_l = theme == null ? void 0 : theme.palette) == null ? void 0 : _l.text) == null ? void 0 : _m.primary) || "black"
21158
+ color: ((_s = (_r = (_q = theme.myTheme) == null ? void 0 : _q.palette) == null ? void 0 : _r.text) == null ? void 0 : _s.primary) || "black"
21037
21159
  },
21038
21160
  children: [progress.toFixed(2), "%"]
21039
21161
  })]
@@ -21064,18 +21186,24 @@ const ProgressBar = ({
21064
21186
  left: "12.5px"
21065
21187
  },
21066
21188
  children: /* @__PURE__ */ jsx(StyledTooltip, {
21189
+ arrow: true,
21067
21190
  title: /* @__PURE__ */ jsxs(Fragment, {
21068
- children: [/* @__PURE__ */ jsx("div", {
21069
- children: " Target Achieved "
21191
+ children: [/* @__PURE__ */ jsxs("div", {
21192
+ style: {
21193
+ fontWeight: "normal",
21194
+ textAlign: "center"
21195
+ },
21196
+ children: [" ", "Target Achieved", " "]
21070
21197
  }), /* @__PURE__ */ jsxs("div", {
21071
21198
  style: {
21072
21199
  fontWeight: "bold",
21073
21200
  textAlign: "center"
21074
21201
  },
21075
- children: [" ", (_o = (_n = value == null ? void 0 : value.main) == null ? void 0 : _n.data) == null ? void 0 : _o.achieved]
21202
+ children: [" ", (_u = (_t5 = value == null ? void 0 : value.main) == null ? void 0 : _t5.data) == null ? void 0 : _u.achieved]
21076
21203
  })]
21077
21204
  }),
21078
21205
  placement: "top-end",
21206
+ theme,
21079
21207
  children: /* @__PURE__ */ jsx(Box$1, {
21080
21208
  className: "progress-bar-fill",
21081
21209
  sx: {
@@ -21096,9 +21224,9 @@ const ProgressBar = ({
21096
21224
  borderRadius: "50%",
21097
21225
  width: "7px",
21098
21226
  height: "7px",
21099
- backgroundColor: `${theme.palette.common.white}`,
21227
+ backgroundColor: `${theme.myTheme.palette.common.white}`,
21100
21228
  position: "absolute",
21101
- top: "2.5px",
21229
+ top: "2px",
21102
21230
  right: `2px`
21103
21231
  }
21104
21232
  })
@@ -21109,7 +21237,7 @@ const ProgressBar = ({
21109
21237
  borderRadius: "50%",
21110
21238
  width: "30px",
21111
21239
  height: "30px",
21112
- backgroundColor: `${theme.palette.grey[300]}`,
21240
+ backgroundColor: `${theme.myTheme.palette.grey[300]}`,
21113
21241
  position: "absolute",
21114
21242
  top: "0px"
21115
21243
  }
@@ -21117,7 +21245,7 @@ const ProgressBar = ({
21117
21245
  }), /* @__PURE__ */ jsxs("div", {
21118
21246
  style: {
21119
21247
  display: "flex",
21120
- color: (_q = (_p = theme == null ? void 0 : theme.palette) == null ? void 0 : _p.text) == null ? void 0 : _q.primary,
21248
+ color: (_x = (_w = (_v = theme.myTheme) == null ? void 0 : _v.palette) == null ? void 0 : _w.text) == null ? void 0 : _x.primary,
21121
21249
  paddingLeft: "25px",
21122
21250
  width: "98%",
21123
21251
  margin: "auto"
@@ -21130,15 +21258,15 @@ const ProgressBar = ({
21130
21258
  style: {
21131
21259
  textAlign: "left",
21132
21260
  fontSize: "14px",
21133
- color: (_r = theme == null ? void 0 : theme.palette) == null ? void 0 : _r.grey[600]
21261
+ color: (_z = (_y = theme.myTheme) == null ? void 0 : _y.palette) == null ? void 0 : _z.grey[600]
21134
21262
  },
21135
- children: ((_s = value == null ? void 0 : value.main) == null ? void 0 : _s.bottomLabel_1) || "Target"
21263
+ children: ((_A = value == null ? void 0 : value.main) == null ? void 0 : _A.bottomLabel_1) || "Target"
21136
21264
  }), /* @__PURE__ */ jsx("div", {
21137
21265
  style: {
21138
- color: (_t5 = theme == null ? void 0 : theme.palette) == null ? void 0 : _t5.grey[600],
21266
+ color: (_C = (_B = theme.myTheme) == null ? void 0 : _B.palette) == null ? void 0 : _C.grey[600],
21139
21267
  textAlign: "left"
21140
21268
  },
21141
- children: ((_v = (_u = value == null ? void 0 : value.main) == null ? void 0 : _u.data) == null ? void 0 : _v.total) || ((_x = (_w = value == null ? void 0 : value.main) == null ? void 0 : _w.data) == null ? void 0 : _x.bottomLabel_1_value)
21269
+ children: ((_E = (_D = value == null ? void 0 : value.main) == null ? void 0 : _D.data) == null ? void 0 : _E.total) || ((_G = (_F = value == null ? void 0 : value.main) == null ? void 0 : _F.data) == null ? void 0 : _G.bottomLabel_1_value)
21142
21270
  })]
21143
21271
  }), /* @__PURE__ */ jsxs("div", {
21144
21272
  style: {
@@ -21148,15 +21276,15 @@ const ProgressBar = ({
21148
21276
  style: {
21149
21277
  textAlign: "center",
21150
21278
  fontSize: "14px",
21151
- color: (_y = theme == null ? void 0 : theme.palette) == null ? void 0 : _y.grey[600]
21279
+ color: (_I = (_H = theme.myTheme) == null ? void 0 : _H.palette) == null ? void 0 : _I.grey[600]
21152
21280
  },
21153
- children: ((_z = value == null ? void 0 : value.main) == null ? void 0 : _z.bottomLabel_2) || "Achieved"
21281
+ children: ((_J = value == null ? void 0 : value.main) == null ? void 0 : _J.bottomLabel_2) || "Achieved"
21154
21282
  }), /* @__PURE__ */ jsx("div", {
21155
21283
  style: {
21156
21284
  textAlign: "center",
21157
- color: (_A = theme == null ? void 0 : theme.palette) == null ? void 0 : _A.grey[600]
21285
+ color: (_L = (_K = theme.myTheme) == null ? void 0 : _K.palette) == null ? void 0 : _L.grey[600]
21158
21286
  },
21159
- children: ((_C = (_B = value == null ? void 0 : value.main) == null ? void 0 : _B.data) == null ? void 0 : _C.achieved) || ((_E = (_D = value == null ? void 0 : value.main) == null ? void 0 : _D.data) == null ? void 0 : _E.bottomLabel_2_value)
21287
+ children: ((_N = (_M = value == null ? void 0 : value.main) == null ? void 0 : _M.data) == null ? void 0 : _N.achieved) || ((_P = (_O = value == null ? void 0 : value.main) == null ? void 0 : _O.data) == null ? void 0 : _P.bottomLabel_2_value)
21160
21288
  })]
21161
21289
  }), /* @__PURE__ */ jsxs("div", {
21162
21290
  style: {
@@ -21166,15 +21294,15 @@ const ProgressBar = ({
21166
21294
  style: {
21167
21295
  textAlign: "right",
21168
21296
  fontSize: "14px",
21169
- color: (_F = theme == null ? void 0 : theme.palette) == null ? void 0 : _F.grey[600]
21297
+ color: (_R = (_Q = theme.myTheme) == null ? void 0 : _Q.palette) == null ? void 0 : _R.grey[600]
21170
21298
  },
21171
- children: ((_G = value == null ? void 0 : value.main) == null ? void 0 : _G.bottomLabel_3) || "Average"
21299
+ children: ((_S = value == null ? void 0 : value.main) == null ? void 0 : _S.bottomLabel_3) || "Remaining"
21172
21300
  }), /* @__PURE__ */ jsx("div", {
21173
21301
  style: {
21174
21302
  textAlign: "right",
21175
- color: (_H = theme == null ? void 0 : theme.palette) == null ? void 0 : _H.grey[600]
21303
+ color: (_U = (_T = theme.myTheme) == null ? void 0 : _T.palette) == null ? void 0 : _U.grey[600]
21176
21304
  },
21177
- children: Math.max(0, ((_J = (_I = value == null ? void 0 : value.main) == null ? void 0 : _I.data) == null ? void 0 : _J.remaining) || ((_L = (_K = value == null ? void 0 : value.main) == null ? void 0 : _K.data) == null ? void 0 : _L.total) - ((_N = (_M = value == null ? void 0 : value.main) == null ? void 0 : _M.data) == null ? void 0 : _N.achieved))
21305
+ children: Math.max(0, ((_W = (_V = value == null ? void 0 : value.main) == null ? void 0 : _V.data) == null ? void 0 : _W.remaining) || ((_Y = (_X = value == null ? void 0 : value.main) == null ? void 0 : _X.data) == null ? void 0 : _Y.total) - ((__ = (_Z = value == null ? void 0 : value.main) == null ? void 0 : _Z.data) == null ? void 0 : __.achieved))
21178
21306
  })]
21179
21307
  })]
21180
21308
  })]
@@ -39894,14 +40022,67 @@ function ImpaktAppsCard({
39894
40022
  })
39895
40023
  });
39896
40024
  }
40025
+ const CircleArcRing = ({
40026
+ strokeWidth = 10,
40027
+ startAngle = 0,
40028
+ endAngle = 180,
40029
+ style: style2 = {},
40030
+ theme
40031
+ }) => {
40032
+ const size = 100;
40033
+ const radius = (size - strokeWidth) / 2;
40034
+ const arcPath = describeArc(size / 2, size / 2, radius, startAngle, endAngle);
40035
+ return /* @__PURE__ */ jsx("div", {
40036
+ style: {
40037
+ ...style2,
40038
+ position: "relative"
40039
+ },
40040
+ children: /* @__PURE__ */ jsxs("svg", {
40041
+ viewBox: `0 0 ${size} ${size}`,
40042
+ xmlns: "http://www.w3.org/2000/svg",
40043
+ style: {
40044
+ width: "100%",
40045
+ height: "100%"
40046
+ },
40047
+ children: [/* @__PURE__ */ jsx("circle", {
40048
+ cx: size / 2,
40049
+ cy: size / 2,
40050
+ r: radius,
40051
+ fill: "none",
40052
+ stroke: theme.palette.grey[300],
40053
+ strokeWidth
40054
+ }), /* @__PURE__ */ jsx("path", {
40055
+ d: arcPath,
40056
+ fill: "none",
40057
+ stroke: theme.palette.primary.main,
40058
+ strokeWidth
40059
+ })]
40060
+ })
40061
+ });
40062
+ };
40063
+ const describeArc = (x2, y2, radius, startAngle, endAngle) => {
40064
+ const start2 = polarToCartesian(x2, y2, radius, endAngle);
40065
+ const end2 = polarToCartesian(x2, y2, radius, startAngle);
40066
+ const largeArcFlag = endAngle - startAngle <= 180 ? "0" : "1";
40067
+ return ["M", start2.x, start2.y, "A", radius, radius, 0, largeArcFlag, 0, end2.x, end2.y].join(" ");
40068
+ };
40069
+ const polarToCartesian = (centerX, centerY, radius, angleInDegrees) => {
40070
+ const angleInRadians = (angleInDegrees - 90) * Math.PI / 180;
40071
+ return {
40072
+ x: centerX + radius * Math.cos(angleInRadians),
40073
+ y: centerY + radius * Math.sin(angleInRadians)
40074
+ };
40075
+ };
39897
40076
  const CustomTimer = ({
39898
- value
40077
+ value,
40078
+ theme
39899
40079
  }) => {
39900
40080
  var _a;
39901
40081
  let {
39902
40082
  uischema,
39903
40083
  data
39904
40084
  } = value;
40085
+ const Total_Days = Math.floor((new Date(data.endDate).getTime() - new Date(data.startDate).getTime()) / (1e3 * 3600 * 24));
39905
40086
  const uischemaStyle = (_a = uischema == null ? void 0 : uischema.config) == null ? void 0 : _a.style;
39906
40087
  const [days2, setDays] = useState(0);
39907
40088
  const [min2, setMin] = useState(0);
@@ -39933,47 +40114,44 @@ const CustomTimer = ({
39933
40114
  const containerStyle = {
39934
40115
  display: "flex",
39935
40116
  flexDirection: "column",
39936
- backgroundColor: "rgb(15,15,15)",
40117
+ backgroundColor: "transport",
39937
40118
  justifyContent: "center",
39938
40119
  alignItems: "center",
39939
- height: "40vh",
39940
40120
  gap: "10px",
39941
40121
  ...uischemaStyle == null ? void 0 : uischemaStyle.container
39942
40122
  };
39943
- const boxStyle = {
39944
- backgroundColor: "rgb(51,51,51)",
39945
- width: "22%",
39946
- minWidth: "40px",
39947
- height: "100px",
39948
- padding: "10px",
39949
- display: "flex",
39950
- flexDirection: "column",
39951
- justifyContent: "center",
39952
- alignItems: "center",
39953
- ...uischemaStyle == null ? void 0 : uischemaStyle.digitContainer
39954
- };
39955
40123
  const digitStyle = {
39956
- color: "rgb(0,253,199)",
39957
- fontSize: "19px",
39958
- fontWeight: "700",
39959
- padding: "6px",
40124
+ position: "absolute",
40125
+ textAlign: "center",
40126
+ color: theme.palette.grey[600],
40127
+ fontWeight: "bold",
40128
+ fontSize: "clamp(1rem, 5cqw, 2rem)",
40129
+ left: "50%",
40130
+ top: "50%",
40131
+ transform: "translate(-50%, -50%)",
40132
+ lineHeight: 1,
39960
40133
  ...uischemaStyle == null ? void 0 : uischemaStyle.digit
39961
40134
  };
39962
40135
  const digitLabelStyle = {
39963
- color: "white",
39964
- fontSize: "19px",
39965
- fontWeight: "700",
40136
+ fontSize: "0.8rem",
40137
+ textAlign: "center",
40138
+ fontWeight: "bold",
40139
+ color: theme.palette.grey[600],
40140
+ textTransform: "uppercase",
39966
40141
  ...uischemaStyle == null ? void 0 : uischemaStyle.digitLabel
39967
40142
  };
39968
40143
  const containerLabelColor = {
39969
- color: "white",
39970
- ...uischemaStyle.containerLabelColor
40144
+ ...uischemaStyle == null ? void 0 : uischemaStyle.containerLabelColor
39971
40145
  };
39972
40146
  return /* @__PURE__ */ jsx(Fragment, {
39973
40147
  children: /* @__PURE__ */ jsxs(Box$1, {
39974
40148
  component: "div",
39975
40149
  sx: containerStyle,
39976
40150
  children: [/* @__PURE__ */ jsx(Box$1, {
40151
+ sx: {
40152
+ height: "50px"
40153
+ }
40154
+ }), /* @__PURE__ */ jsx(Box$1, {
39977
40155
  component: "h1",
39978
40156
  style: containerLabelColor,
39979
40157
  children: new Date().getTime() >= new Date(data == null ? void 0 : data.startDate).getTime() && new Date().getTime() <= new Date(data.endDate).getTime() ? "Contest ends in..." : new Date().getTime() < new Date(data.startDate).getTime() ? "Program Not Started Yet" : "Program Over"
@@ -39984,43 +40162,120 @@ const CustomTimer = ({
39984
40162
  width: "80%",
39985
40163
  maxWidth: "650px",
39986
40164
  marginLeft: "auto",
39987
- marginRight: "auto"
40165
+ marginRight: "auto",
40166
+ justifyContent: "center"
39988
40167
  },
39989
40168
  children: [/* @__PURE__ */ jsxs(Box$1, {
39990
- style: boxStyle,
40169
+ sx: {
40170
+ width: "20%",
40171
+ height: "auto"
40172
+ },
39991
40173
  children: [/* @__PURE__ */ jsxs(Box$1, {
39992
- style: digitStyle,
39993
- children: [days2 === 0 ? 0 : days2 < 10 ? 0 : Math.floor(days2 / 10), days2 === 0 ? 0 : days2 % 10]
40174
+ sx: {
40175
+ width: "100%",
40176
+ height: "auto",
40177
+ position: "relative"
40178
+ },
40179
+ children: [/* @__PURE__ */ jsx(CircleArcRing, {
40180
+ strokeWidth: 10,
40181
+ startAngle: 0,
40182
+ endAngle: days2 / Total_Days * 360,
40183
+ style: {
40184
+ width: "100%",
40185
+ height: "auto"
40186
+ },
40187
+ theme
40188
+ }), /* @__PURE__ */ jsxs(Box$1, {
40189
+ sx: digitStyle,
40190
+ children: [days2 === 0 ? 0 : days2 < 10 ? 0 : Math.floor(days2 / 10), days2 === 0 ? 0 : days2 % 10]
40191
+ })]
39994
40192
  }), /* @__PURE__ */ jsx(Box$1, {
39995
- style: digitLabelStyle,
40193
+ sx: digitLabelStyle,
39996
40194
  children: "Days"
39997
40195
  })]
39998
40196
  }), /* @__PURE__ */ jsxs(Box$1, {
39999
- style: boxStyle,
40197
+ sx: {
40198
+ width: "20%",
40199
+ height: "auto"
40200
+ },
40000
40201
  children: [/* @__PURE__ */ jsxs(Box$1, {
40001
- style: digitStyle,
40002
- children: [hour2 === 0 ? 0 : 24 - hour2 < 10 ? 0 : Math.floor((24 - hour2) / 10), hour2 === 0 ? 0 : (24 - hour2) % 10]
40202
+ sx: {
40203
+ width: "100%",
40204
+ height: "auto",
40205
+ position: "relative"
40206
+ },
40207
+ children: [/* @__PURE__ */ jsx(CircleArcRing, {
40208
+ strokeWidth: 10,
40209
+ startAngle: 0,
40210
+ endAngle: (24 - hour2) * 15,
40211
+ style: {
40212
+ width: "100%",
40213
+ height: "auto"
40214
+ },
40215
+ theme
40216
+ }), /* @__PURE__ */ jsxs(Box$1, {
40217
+ sx: digitStyle,
40218
+ children: [hour2 === 0 ? 0 : 24 - hour2 < 10 ? 0 : Math.floor((24 - hour2) / 10), hour2 === 0 ? 0 : (24 - hour2) % 10]
40219
+ })]
40003
40220
  }), /* @__PURE__ */ jsx(Box$1, {
40004
- style: digitLabelStyle,
40221
+ sx: digitLabelStyle,
40005
40222
  children: "Hours"
40006
40223
  })]
40007
40224
  }), /* @__PURE__ */ jsxs(Box$1, {
40008
- style: boxStyle,
40225
+ sx: {
40226
+ width: "20%",
40227
+ height: "auto"
40228
+ },
40009
40229
  children: [/* @__PURE__ */ jsxs(Box$1, {
40010
- style: digitStyle,
40011
- children: [min2 === 0 ? 0 : 60 - min2 < 10 ? 0 : Math.floor((60 - min2) / 10), min2 === 0 ? 0 : (60 - min2) % 10]
40230
+ sx: {
40231
+ width: "100%",
40232
+ height: "auto",
40233
+ position: "relative"
40234
+ },
40235
+ children: [/* @__PURE__ */ jsx(CircleArcRing, {
40236
+ strokeWidth: 10,
40237
+ startAngle: 0,
40238
+ endAngle: (60 - min2) * 6,
40239
+ style: {
40240
+ width: "100%",
40241
+ height: "auto"
40242
+ },
40243
+ theme
40244
+ }), /* @__PURE__ */ jsxs(Box$1, {
40245
+ sx: digitStyle,
40246
+ children: [min2 === 0 ? 0 : 60 - min2 < 10 ? 0 : Math.floor((60 - min2) / 10), min2 === 0 ? 0 : (60 - min2) % 10]
40247
+ })]
40012
40248
  }), /* @__PURE__ */ jsx(Box$1, {
40013
- style: digitLabelStyle,
40014
- children: "Mins"
40249
+ sx: digitLabelStyle,
40250
+ children: "Minutes"
40015
40251
  })]
40016
40252
  }), /* @__PURE__ */ jsxs(Box$1, {
40017
- style: boxStyle,
40253
+ sx: {
40254
+ width: "20%",
40255
+ height: "auto"
40256
+ },
40018
40257
  children: [/* @__PURE__ */ jsxs(Box$1, {
40019
- style: digitStyle,
40020
- children: [sec === 0 ? 0 : 60 - sec < 10 ? 0 : Math.floor((60 - sec) / 10), sec === 0 ? 0 : (60 - sec) % 10]
40258
+ sx: {
40259
+ width: "100%",
40260
+ height: "auto",
40261
+ position: "relative"
40262
+ },
40263
+ children: [/* @__PURE__ */ jsx(CircleArcRing, {
40264
+ strokeWidth: 10,
40265
+ startAngle: 0,
40266
+ endAngle: (60 - sec) * 6,
40267
+ style: {
40268
+ width: "100%",
40269
+ height: "auto"
40270
+ },
40271
+ theme
40272
+ }), /* @__PURE__ */ jsxs(Box$1, {
40273
+ sx: digitStyle,
40274
+ children: [sec === 0 ? 0 : 60 - sec < 10 ? 0 : Math.floor((60 - sec) / 10), sec === 0 ? 0 : (60 - sec) % 10]
40275
+ })]
40021
40276
  }), /* @__PURE__ */ jsx(Box$1, {
40022
- style: digitLabelStyle,
40023
- children: "Secs"
40277
+ sx: digitLabelStyle,
40278
+ children: "Seconds"
40024
40279
  })]
40025
40280
  })]
40026
40281
  })]