@adecore/charts 0.41.1 → 0.43.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/series.js CHANGED
@@ -3,7 +3,7 @@ import { useContext, useEffect, useId, useRef, useState } from 'react';
3
3
  import clsx from 'clsx';
4
4
  import { area, curveLinear, curveMonotoneX, curveStepAfter, line } from 'd3-shape';
5
5
  import { numberOf, readValue, warnOnce } from './access.js';
6
- import { columnsIn, endRoundedColumn, guessLabelWidth, LABEL_LIFT, placeValueLabels, segmentOf } from './band.js';
6
+ import { columnsIn, endRoundedBar, endRoundedColumn, guessLabelWidth, LABEL_INSET, LABEL_LIFT, placeValueLabels, segmentOf } from './band.js';
7
7
  import { colorOf, seriesColor } from './color.js';
8
8
  import { BarsContext, useChartContext } from './context.js';
9
9
  import { useBeforePaint, useKeyCheck, useRegistration } from './register.js';
@@ -219,6 +219,9 @@ export function ChartLine(t0) {
219
219
  t7 = $[9];
220
220
  }
221
221
  useRegistration(chart.store, "series", id, t7);
222
+ if (chart.horizontal) {
223
+ return null;
224
+ }
222
225
  if (chart.points) {
223
226
  let t8;
224
227
  if ($[10] !== className) {
@@ -380,6 +383,9 @@ export function ChartPoint(t0) {
380
383
  valueLabels: false
381
384
  });
382
385
  const fallback = chart.colors.get(id) ?? seriesColor(0);
386
+ if (chart.horizontal) {
387
+ return null;
388
+ }
383
389
  let t1;
384
390
  if ($[0] !== className) {
385
391
  t1 = clsx("pointer-events-none", className);
@@ -511,6 +517,9 @@ export function ChartArea(t0) {
511
517
  t12 = $[11];
512
518
  }
513
519
  useRegistration(t8, "series", id, t12);
520
+ if (chart.horizontal) {
521
+ return null;
522
+ }
514
523
  let t13;
515
524
  let tops;
516
525
  if ($[12] !== chart || $[13] !== curve || $[14] !== id || $[15] !== values) {
@@ -689,9 +698,9 @@ export function ChartBars(t0) {
689
698
  }
690
699
  return t4;
691
700
  }
692
- /* Columns, one per bucket: on a `band` scale, or on a `time` scale whose buckets last one step. */
701
+ /* Columns, one per bucket: on a `band` scale, or on a `time` scale whose buckets last one step. Bars per row in a horizontal chart. */
693
702
  export function ChartBar(t0) {
694
- const $ = _c(47);
703
+ const $ = _c(64);
695
704
  const {
696
705
  value,
697
706
  label,
@@ -705,8 +714,8 @@ export function ChartBar(t0) {
705
714
  minHeight: t4,
706
715
  rounded: t5,
707
716
  valueLabels,
708
- valueLabelSize: t6,
709
- animate: t7,
717
+ valueLabelSize: labelSize,
718
+ animate: t6,
710
719
  className,
711
720
  ref
712
721
  } = t0;
@@ -715,82 +724,137 @@ export function ChartBar(t0) {
715
724
  const radius = t3 === undefined ? 2 : t3;
716
725
  const minHeight = t4 === undefined ? 0 : t4;
717
726
  const rounded = t5 === undefined ? "all" : t5;
718
- const valueLabelSize = t6 === undefined ? "2xs" : t6;
719
- const animate = t7 === undefined ? false : t7;
727
+ const animate = t6 === undefined ? false : t6;
720
728
  const [chart, id, values] = useSeriesValues("Chart.Bar", value);
721
729
  const bars = useContext(BarsContext);
722
730
  const labels = useRef(null);
723
731
  const [widths, setWidths] = useState(_temp6);
724
732
  const rows = chart.data;
725
- let t8;
733
+ let t7;
726
734
  if ($[0] !== chart || $[1] !== tone) {
727
- t8 = tonesOf(chart, tone);
735
+ t7 = tonesOf(chart, tone);
728
736
  $[0] = chart;
729
737
  $[1] = tone;
730
- $[2] = t8;
738
+ $[2] = t7;
731
739
  } else {
732
- t8 = $[2];
740
+ t7 = $[2];
733
741
  }
734
- const [color, rowColors] = t8;
742
+ const [color, rowColors] = t7;
735
743
  const labeled = valueLabels !== undefined && valueLabels !== false;
736
- const t9 = bars?.stack === true ? bars.id : null;
737
- const t10 = bars?.id ?? null;
738
- const t11 = icon ?? null;
739
- let t12;
740
- if ($[3] !== color || $[4] !== dimOpacity || $[5] !== label || $[6] !== labeled || $[7] !== rowColors || $[8] !== t10 || $[9] !== t11 || $[10] !== t9 || $[11] !== values) {
741
- t12 = {
744
+ const {
745
+ horizontal
746
+ } = chart;
747
+ const valueLabelSize = labelSize ?? (horizontal ? "xs" : "2xs");
748
+ const stack = bars?.stack === true ? bars.id : null;
749
+ let t8;
750
+ if ($[3] !== chart || $[4] !== valueLabels) {
751
+ t8 = typeof valueLabels === "function" ? valueLabels : amount => chart.formatY(amount);
752
+ $[3] = chart;
753
+ $[4] = valueLabels;
754
+ $[5] = t8;
755
+ } else {
756
+ t8 = $[5];
757
+ }
758
+ const writeValue = t8;
759
+ const totals = horizontal && stack !== null;
760
+ let t9;
761
+ if ($[6] !== chart.series || $[7] !== id || $[8] !== labeled || $[9] !== stack || $[10] !== totals) {
762
+ t9 = labeled && (!totals || [...chart.series].findLast(t10 => {
763
+ const [, entry] = t10;
764
+ return entry.stack === stack && entry.valueLabels;
765
+ })?.[0] === id);
766
+ $[6] = chart.series;
767
+ $[7] = id;
768
+ $[8] = labeled;
769
+ $[9] = stack;
770
+ $[10] = totals;
771
+ $[11] = t9;
772
+ } else {
773
+ t9 = $[11];
774
+ }
775
+ const writesLabels = t9;
776
+ const others = totals ? [...chart.series].flatMap(t10 => {
777
+ const [seriesId, entry_0] = t10;
778
+ return entry_0.stack === stack && seriesId !== id ? [entry_0] : [];
779
+ }) : [];
780
+ const labelValueAt = index => {
781
+ const parts = [values[index], ...others.map(entry_1 => entry_1.values[index])].filter(_temp7);
782
+ return parts.length === 0 ? null : parts.reduce(_temp8, 0);
783
+ };
784
+ const rowTexts = values.map((_, index_0) => {
785
+ const amount_0 = labelValueAt(index_0);
786
+ return horizontal && writesLabels && amount_0 !== null ? writeValue(amount_0, rows[index_0], index_0) : "";
787
+ });
788
+ let t11;
789
+ if ($[12] !== valueLabelSize || $[13] !== widths) {
790
+ t11 = text => widths.get(text) ?? guessLabelWidth(text, valueLabelSize);
791
+ $[12] = valueLabelSize;
792
+ $[13] = widths;
793
+ $[14] = t11;
794
+ } else {
795
+ t11 = $[14];
796
+ }
797
+ const widthOf = t11;
798
+ const endRoom = horizontal && writesLabels ? Math.max(0, ...rowTexts.map(widthOf)) + LABEL_INSET + 2 : 0;
799
+ const t12 = bars?.id ?? null;
800
+ const t13 = icon ?? null;
801
+ let t14;
802
+ if ($[15] !== color || $[16] !== dimOpacity || $[17] !== endRoom || $[18] !== label || $[19] !== labeled || $[20] !== rowColors || $[21] !== stack || $[22] !== t12 || $[23] !== t13 || $[24] !== values) {
803
+ t14 = {
742
804
  kind: "bar",
743
805
  label,
744
806
  color,
745
807
  rowColors,
746
808
  values,
747
- stack: t9,
748
- bars: t10,
809
+ stack,
810
+ bars: t12,
749
811
  curve: "linear",
750
- icon: t11,
812
+ icon: t13,
751
813
  valueLabels: labeled,
752
- dimOpacity
814
+ dimOpacity,
815
+ endRoom
753
816
  };
754
- $[3] = color;
755
- $[4] = dimOpacity;
756
- $[5] = label;
757
- $[6] = labeled;
758
- $[7] = rowColors;
759
- $[8] = t10;
760
- $[9] = t11;
761
- $[10] = t9;
762
- $[11] = values;
763
- $[12] = t12;
817
+ $[15] = color;
818
+ $[16] = dimOpacity;
819
+ $[17] = endRoom;
820
+ $[18] = label;
821
+ $[19] = labeled;
822
+ $[20] = rowColors;
823
+ $[21] = stack;
824
+ $[22] = t12;
825
+ $[23] = t13;
826
+ $[24] = values;
827
+ $[25] = t14;
764
828
  } else {
765
- t12 = $[12];
829
+ t14 = $[25];
766
830
  }
767
- useRegistration(chart.store, "series", id, t12);
768
- let t13;
769
- if ($[13] !== chart) {
770
- t13 = chart.xScale === "time" && chart.data.length > 0 && chart.bucketAt(0) === null;
771
- $[13] = chart;
772
- $[14] = t13;
831
+ useRegistration(chart.store, "series", id, t14);
832
+ let t15;
833
+ if ($[26] !== chart) {
834
+ t15 = chart.xScale === "time" && chart.data.length > 0 && chart.bucketAt(0) === null;
835
+ $[26] = chart;
836
+ $[27] = t15;
773
837
  } else {
774
- t13 = $[14];
838
+ t15 = $[27];
775
839
  }
776
- const noSlot = t13;
777
- let t14;
778
- let t15;
779
- if ($[15] !== noSlot) {
780
- t14 = () => {
840
+ const noSlot = t15;
841
+ let t16;
842
+ let t17;
843
+ if ($[28] !== noSlot) {
844
+ t16 = () => {
781
845
  if (noSlot) {
782
846
  warnOnce("Chart.Bar: a time scale with one row draws no columns without a `step` on the root.");
783
847
  }
784
848
  };
785
- t15 = [noSlot];
786
- $[15] = noSlot;
787
- $[16] = t14;
788
- $[17] = t15;
849
+ t17 = [noSlot];
850
+ $[28] = noSlot;
851
+ $[29] = t16;
852
+ $[30] = t17;
789
853
  } else {
790
- t14 = $[16];
791
- t15 = $[17];
854
+ t16 = $[29];
855
+ t17 = $[30];
792
856
  }
793
- useEffect(t14, t15);
857
+ useEffect(t16, t17);
794
858
  const {
795
859
  slot,
796
860
  count
@@ -799,195 +863,258 @@ export function ChartBar(t0) {
799
863
  count: 1
800
864
  };
801
865
  const stacked = chart.stacked.get(id);
802
- let t16;
803
- if ($[18] !== chart.colors || $[19] !== id) {
804
- t16 = chart.colors.get(id) ?? seriesColor(0);
805
- $[18] = chart.colors;
806
- $[19] = id;
807
- $[20] = t16;
866
+ let t18;
867
+ if ($[31] !== chart.colors || $[32] !== id) {
868
+ t18 = chart.colors.get(id) ?? seriesColor(0);
869
+ $[31] = chart.colors;
870
+ $[32] = id;
871
+ $[33] = t18;
808
872
  } else {
809
- t16 = $[20];
873
+ t18 = $[33];
810
874
  }
811
- const fallback = t16;
875
+ const fallback = t18;
812
876
  const anySelected = chart.selected.some(Boolean);
813
- let t17;
814
- if ($[21] !== chart.band?.groups || $[22] !== values.length) {
815
- t17 = index => chart.band?.groups.find(run => index >= run.first && index <= run.last) ?? {
877
+ let t19;
878
+ if ($[34] !== chart.band?.groups || $[35] !== values.length) {
879
+ t19 = index_1 => chart.band?.groups.find(run => index_1 >= run.first && index_1 <= run.last) ?? {
816
880
  first: 0,
817
881
  last: values.length - 1
818
882
  };
819
- $[21] = chart.band?.groups;
820
- $[22] = values.length;
821
- $[23] = t17;
822
- } else {
823
- t17 = $[23];
824
- }
825
- const groupOf = t17;
826
- let t18;
827
- if ($[24] !== chart || $[25] !== valueLabels) {
828
- t18 = typeof valueLabels === "function" ? valueLabels : amount => chart.formatY(amount);
829
- $[24] = chart;
830
- $[25] = valueLabels;
831
- $[26] = t18;
883
+ $[34] = chart.band?.groups;
884
+ $[35] = values.length;
885
+ $[36] = t19;
832
886
  } else {
833
- t18 = $[26];
887
+ t19 = $[36];
834
888
  }
835
- const writeValue = t18;
836
- const drawn = values.flatMap((amount_0, index_0) => {
837
- const top = stacked?.top[index_0];
838
- const base = stacked?.base[index_0] ?? 0;
889
+ const groupOf = t19;
890
+ const focusOf = index_2 => {
891
+ const focused = index_2 === chart.activeIndex || chart.selected[index_2] === true;
892
+ return {
893
+ focused,
894
+ outOfFocus: chart.dimmed[index_2] === true || anySelected && !focused
895
+ };
896
+ };
897
+ const drawn = values.flatMap((amount_1, index_3) => {
898
+ const top = stacked?.top[index_3];
899
+ const base = stacked?.base[index_3] ?? 0;
839
900
  const topPixel = top === null || top === undefined ? null : chart.pixelOfY(top);
840
- const basePixel = chart.pixelOfY(base) ?? chart.plot.bottom;
841
- const bucket = chart.bucketAt(index_0);
842
- if (amount_0 === null || topPixel === null || bucket === null) {
901
+ const basePixel = chart.pixelOfY(base) ?? (horizontal ? chart.plot.left : chart.plot.bottom);
902
+ const bucket = chart.bucketAt(index_3);
903
+ if (amount_1 === null || topPixel === null || bucket === null) {
843
904
  return [];
844
905
  }
845
906
  const column = columnsIn(bucket.left, bucket.width, count, columnWidth)[slot];
907
+ const least = stack === null ? minHeight : 0;
908
+ let box;
909
+ if (horizontal) {
910
+ const segment = segmentOf(-topPixel, -basePixel, base === 0, amount_1, least);
911
+ box = {
912
+ x: -(segment.y + segment.height),
913
+ y: column.x,
914
+ width: segment.height,
915
+ height: column.width
916
+ };
917
+ } else {
918
+ const segment_0 = segmentOf(topPixel, basePixel, base === 0, amount_1, least);
919
+ box = {
920
+ x: column.x,
921
+ y: segment_0.y,
922
+ width: column.width,
923
+ height: segment_0.height
924
+ };
925
+ }
846
926
  const {
847
- y,
848
- height
849
- } = segmentOf(topPixel, basePixel, base === 0, amount_0, bars?.stack === true ? 0 : minHeight);
850
- const focused = index_0 === chart.activeIndex || chart.selected[index_0] === true;
851
- const outOfFocus = chart.dimmed[index_0] === true || anySelected && !focused;
852
- const run_0 = groupOf(index_0);
853
- let alpha = focused ? 1 : opacity?.(rows[index_0], index_0 - run_0.first, run_0.last - run_0.first + 1) ?? 1;
927
+ focused: focused_0,
928
+ outOfFocus
929
+ } = focusOf(index_3);
930
+ const run_0 = groupOf(index_3);
931
+ let alpha = focused_0 ? 1 : opacity?.(rows[index_3], index_3 - run_0.first, run_0.last - run_0.first + 1) ?? 1;
854
932
  if (outOfFocus) {
855
933
  alpha = alpha * dimOpacity;
856
934
  } else {
857
- if (chart.activeIndex >= 0 && !focused) {
935
+ if (chart.activeIndex >= 0 && !focused_0) {
858
936
  alpha = alpha * hoverOpacity;
859
937
  }
860
938
  }
861
- const text = labeled ? writeValue(amount_0, rows[index_0], index_0) : "";
939
+ const text_0 = labeled && !horizontal ? writeValue(amount_1, rows[index_3], index_3) : "";
862
940
  return [{
863
- index: index_0,
864
- column,
865
- y,
866
- height,
941
+ index: index_3,
942
+ box,
867
943
  alpha,
868
944
  outOfFocus,
869
- text
945
+ text: text_0
870
946
  }];
871
947
  });
872
- let t19;
873
- if ($[27] !== valueLabelSize || $[28] !== widths) {
874
- t19 = t20 => {
875
- const {
876
- column: column_0,
877
- y: y_0,
878
- text: text_0
879
- } = t20;
880
- return {
881
- center: column_0.x + column_0.width / 2,
882
- top: y_0,
883
- width: widths.get(text_0) ?? guessLabelWidth(text_0, valueLabelSize)
884
- };
948
+ const labelTops = horizontal ? [] : placeValueLabels(drawn.map(t20 => {
949
+ const {
950
+ box: box_0,
951
+ text: text_1
952
+ } = t20;
953
+ return {
954
+ center: box_0.x + box_0.width / 2,
955
+ top: box_0.y,
956
+ width: widthOf(text_1)
885
957
  };
886
- $[27] = valueLabelSize;
887
- $[28] = widths;
888
- $[29] = t19;
889
- } else {
890
- t19 = $[29];
891
- }
892
- const labelTops = placeValueLabels(drawn.map(t19), valueLabelSize);
893
- let t20;
894
- if ($[30] !== widths) {
895
- t20 = () => {
958
+ }), valueLabelSize);
959
+ const rowLabels = rowTexts.flatMap((text_2, index_4) => {
960
+ const total = labelValueAt(index_4);
961
+ const bucket_0 = chart.bucketAt(index_4);
962
+ if (text_2 === "" || total === null || bucket_0 === null) {
963
+ return [];
964
+ }
965
+ const column_0 = columnsIn(bucket_0.left, bucket_0.width, count, columnWidth)[slot];
966
+ const own = totals ? undefined : drawn.find(entry_2 => entry_2.index === index_4)?.box;
967
+ const end = own === undefined ? chart.pixelOfY(total) ?? chart.plot.left : total >= 0 ? own.x + own.width : own.x;
968
+ return [{
969
+ index: index_4,
970
+ text: text_2,
971
+ x: Math.round(total >= 0 ? end + LABEL_INSET : end - LABEL_INSET),
972
+ y: Math.round(column_0.x + column_0.width / 2),
973
+ anchor: total >= 0 ? "start" : "end",
974
+ outOfFocus: focusOf(index_4).outOfFocus
975
+ }];
976
+ });
977
+ let t21;
978
+ if ($[37] !== widths) {
979
+ t21 = () => {
896
980
  const texts = [...(labels.current?.querySelectorAll("text") ?? [])];
897
981
  if (texts.length === 0 || typeof texts[0].getComputedTextLength !== "function") {
898
982
  return;
899
983
  }
900
- const next = new Map(texts.map(_temp7));
901
- if (next.size !== widths.size || [...next].some(t21 => {
902
- const [text_1, width] = t21;
903
- return widths.get(text_1) !== width;
984
+ const next = new Map(texts.map(_temp9));
985
+ if (next.size !== widths.size || [...next].some(t22 => {
986
+ const [text_3, width] = t22;
987
+ return widths.get(text_3) !== width;
904
988
  })) {
905
989
  setWidths(next);
906
990
  }
907
991
  };
908
- $[30] = widths;
909
- $[31] = t20;
992
+ $[37] = widths;
993
+ $[38] = t21;
910
994
  } else {
911
- t20 = $[31];
995
+ t21 = $[38];
912
996
  }
913
- useBeforePaint(t20);
914
- let t21;
915
- if ($[32] !== className) {
916
- t21 = clsx("pointer-events-none", className);
917
- $[32] = className;
918
- $[33] = t21;
997
+ useBeforePaint(t21);
998
+ let t22;
999
+ if ($[39] !== className) {
1000
+ t22 = clsx("pointer-events-none", className);
1001
+ $[39] = className;
1002
+ $[40] = t22;
919
1003
  } else {
920
- t21 = $[33];
1004
+ t22 = $[40];
921
1005
  }
922
- let t22;
923
- if ($[34] !== animate || $[35] !== chart) {
924
- t22 = animate ? {
925
- transformOrigin: `0px ${groundOf(chart)}px`
1006
+ let t23;
1007
+ if ($[41] !== animate || $[42] !== horizontal) {
1008
+ t23 = animate ? clsx("transition-[scale] duration-400 ease-out motion-reduce:transition-none", horizontal ? "starting:scale-x-0" : "starting:scale-y-0") : undefined;
1009
+ $[41] = animate;
1010
+ $[42] = horizontal;
1011
+ $[43] = t23;
1012
+ } else {
1013
+ t23 = $[43];
1014
+ }
1015
+ let t24;
1016
+ if ($[44] !== animate || $[45] !== chart || $[46] !== horizontal) {
1017
+ t24 = animate ? {
1018
+ transformOrigin: horizontal ? `${groundOf(chart)}px 0px` : `0px ${groundOf(chart)}px`
926
1019
  } : undefined;
927
- $[34] = animate;
928
- $[35] = chart;
929
- $[36] = t22;
1020
+ $[44] = animate;
1021
+ $[45] = chart;
1022
+ $[46] = horizontal;
1023
+ $[47] = t24;
930
1024
  } else {
931
- t22 = $[36];
1025
+ t24 = $[47];
932
1026
  }
933
- let t23;
934
- if ($[37] !== bars?.stack || $[38] !== color || $[39] !== fallback || $[40] !== radius || $[41] !== rounded || $[42] !== rowColors || $[43] !== values) {
935
- t23 = t24 => {
1027
+ let t25;
1028
+ if ($[48] !== color || $[49] !== fallback || $[50] !== horizontal || $[51] !== radius || $[52] !== rounded || $[53] !== rowColors || $[54] !== stack || $[55] !== values) {
1029
+ t25 = t26 => {
936
1030
  const {
937
- index: index_1,
938
- column: column_1,
939
- y: y_1,
940
- height: height_0,
1031
+ index: index_5,
1032
+ box: box_1,
941
1033
  alpha: alpha_0
942
- } = t24;
943
- const corner = bars?.stack === true ? 0 : Math.min(radius, Math.floor(column_1.width / 4));
944
- const fill = rowColors?.[index_1] ?? color ?? fallback;
1034
+ } = t26;
1035
+ const thickness = horizontal ? box_1.height : box_1.width;
1036
+ const corner = stack !== null ? 0 : Math.min(radius, Math.floor(thickness / 4));
1037
+ const fill = rowColors?.[index_5] ?? color ?? fallback;
1038
+ const forward = (values[index_5] ?? 0) >= 0;
945
1039
  return rounded === "end" && corner > 0 ? /*#__PURE__*/_jsx("path", {
946
- d: endRoundedColumn(column_1.x, y_1, column_1.width, height_0, corner, (values[index_1] ?? 0) >= 0),
1040
+ d: horizontal ? endRoundedBar(box_1.x, box_1.y, box_1.width, box_1.height, corner, forward) : endRoundedColumn(box_1.x, box_1.y, box_1.width, box_1.height, corner, forward),
947
1041
  opacity: alpha_0,
948
1042
  style: {
949
1043
  fill
950
1044
  }
951
- }, index_1) : /*#__PURE__*/_jsx("rect", {
952
- x: column_1.x,
953
- y: y_1,
954
- width: column_1.width,
955
- height: height_0,
1045
+ }, index_5) : /*#__PURE__*/_jsx("rect", {
1046
+ ...box_1,
956
1047
  rx: corner,
957
1048
  opacity: alpha_0,
958
1049
  style: {
959
1050
  fill
960
1051
  }
961
- }, index_1);
1052
+ }, index_5);
1053
+ };
1054
+ $[48] = color;
1055
+ $[49] = fallback;
1056
+ $[50] = horizontal;
1057
+ $[51] = radius;
1058
+ $[52] = rounded;
1059
+ $[53] = rowColors;
1060
+ $[54] = stack;
1061
+ $[55] = values;
1062
+ $[56] = t25;
1063
+ } else {
1064
+ t25 = $[56];
1065
+ }
1066
+ let t26;
1067
+ if ($[57] !== chart.halo || $[58] !== dimOpacity || $[59] !== valueLabelSize) {
1068
+ t26 = t27 => {
1069
+ const {
1070
+ index: index_6,
1071
+ text: text_4,
1072
+ x,
1073
+ y,
1074
+ anchor,
1075
+ outOfFocus: outOfFocus_0
1076
+ } = t27;
1077
+ return /*#__PURE__*/_jsx("text", {
1078
+ x: x,
1079
+ y: y,
1080
+ dy: "0.32em",
1081
+ textAnchor: anchor,
1082
+ opacity: outOfFocus_0 ? dimOpacity : 1,
1083
+ "aria-hidden": true,
1084
+ strokeWidth: 3,
1085
+ paintOrder: "stroke",
1086
+ style: {
1087
+ stroke: chart.halo
1088
+ },
1089
+ className: clsx("fill-text tabular-nums", valueLabelSize === "xs" ? "text-xs" : "text-2xs"),
1090
+ children: text_4
1091
+ }, `label-${index_6}`);
962
1092
  };
963
- $[37] = bars?.stack;
964
- $[38] = color;
965
- $[39] = fallback;
966
- $[40] = radius;
967
- $[41] = rounded;
968
- $[42] = rowColors;
969
- $[43] = values;
970
- $[44] = t23;
1093
+ $[57] = chart.halo;
1094
+ $[58] = dimOpacity;
1095
+ $[59] = valueLabelSize;
1096
+ $[60] = t26;
971
1097
  } else {
972
- t23 = $[44];
1098
+ t26 = $[60];
973
1099
  }
974
- const t24 = labeled && drawn.map((t25, i) => {
1100
+ const t27 = rowLabels.map(t26);
1101
+ const t28 = labeled && !horizontal && drawn.map((t29, i) => {
975
1102
  const {
976
- index: index_2,
977
- column: column_2,
978
- y: y_2,
979
- outOfFocus: outOfFocus_0,
980
- text: text_2
981
- } = t25;
982
- const center = Math.round(column_2.x + column_2.width / 2);
1103
+ index: index_7,
1104
+ box: box_2,
1105
+ outOfFocus: outOfFocus_1,
1106
+ text: text_5
1107
+ } = t29;
1108
+ const center = Math.round(box_2.x + box_2.width / 2);
1109
+ const y_0 = box_2.y;
983
1110
  const baseline = labelTops[i];
984
1111
  return /*#__PURE__*/_jsxs("g", {
985
- opacity: outOfFocus_0 ? dimOpacity : 1,
1112
+ opacity: outOfFocus_1 ? dimOpacity : 1,
986
1113
  "aria-hidden": true,
987
- children: [baseline < y_2 - LABEL_LIFT - 2 && /*#__PURE__*/_jsx("line", {
1114
+ children: [baseline < y_0 - LABEL_LIFT - 2 && /*#__PURE__*/_jsx("line", {
988
1115
  x1: center + 0.5,
989
1116
  x2: center + 0.5,
990
- y1: y_2 - 4,
1117
+ y1: y_0 - 4,
991
1118
  y2: baseline + 4,
992
1119
  className: "stroke-border-strong"
993
1120
  }), /*#__PURE__*/_jsx("text", {
@@ -1000,34 +1127,41 @@ export function ChartBar(t0) {
1000
1127
  stroke: chart.halo
1001
1128
  },
1002
1129
  className: clsx("fill-text tabular-nums", valueLabelSize === "xs" ? "text-xs" : "text-2xs"),
1003
- children: text_2
1130
+ children: text_5
1004
1131
  })]
1005
- }, `label-${index_2}`);
1132
+ }, `label-${index_7}`);
1006
1133
  });
1007
- let t26;
1008
- if ($[45] !== t24) {
1009
- t26 = /*#__PURE__*/_jsx("g", {
1134
+ let t30;
1135
+ if ($[61] !== t27 || $[62] !== t28) {
1136
+ t30 = /*#__PURE__*/_jsxs("g", {
1010
1137
  ref: labels,
1011
- children: t24
1138
+ children: [t27, t28]
1012
1139
  });
1013
- $[45] = t24;
1014
- $[46] = t26;
1140
+ $[61] = t27;
1141
+ $[62] = t28;
1142
+ $[63] = t30;
1015
1143
  } else {
1016
- t26 = $[46];
1144
+ t30 = $[63];
1017
1145
  }
1018
1146
  return /*#__PURE__*/_jsxs("g", {
1019
1147
  ref: ref,
1020
- className: t21,
1148
+ className: t22,
1021
1149
  children: [/*#__PURE__*/_jsx("g", {
1022
- className: animate ? "transition-[scale] duration-400 ease-out starting:scale-y-0 motion-reduce:transition-none" : undefined,
1023
- style: t22,
1024
- children: drawn.map(t23)
1025
- }), t26]
1150
+ className: t23,
1151
+ style: t24,
1152
+ children: drawn.map(t25)
1153
+ }), t30]
1026
1154
  });
1027
1155
  }
1028
- function _temp7(node) {
1156
+ function _temp9(node) {
1029
1157
  return [node.textContent ?? "", Math.ceil(node.getComputedTextLength())];
1030
1158
  }
1159
+ function _temp8(sum, part_0) {
1160
+ return sum + part_0;
1161
+ }
1162
+ function _temp7(part) {
1163
+ return part !== null && part !== undefined;
1164
+ }
1031
1165
  function _temp6() {
1032
1166
  return new Map();
1033
1167
  }