vvplot 0.5.0 → 0.5.2

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.
@@ -56,7 +56,7 @@ const isClient = typeof window !== "undefined" && typeof document !== "undefined
56
56
  typeof WorkerGlobalScope !== "undefined" && globalThis instanceof WorkerGlobalScope;
57
57
  const toString = Object.prototype.toString;
58
58
  const isObject = (val) => toString.call(val) === "[object Object]";
59
- const noop$1 = () => {
59
+ const noop$2 = () => {
60
60
  };
61
61
  function pxValue(px) {
62
62
  return px.endsWith("rem") ? Number.parseFloat(px) * 16 : Number.parseFloat(px);
@@ -195,7 +195,7 @@ function useDevicePixelRatio(options = {}) {
195
195
  } = options;
196
196
  const pixelRatio = shallowRef(1);
197
197
  const query = useMediaQuery(() => `(resolution: ${pixelRatio.value}dppx)`, options);
198
- let stop = noop$1;
198
+ let stop = noop$2;
199
199
  if (window2) {
200
200
  stop = watchImmediate(query, () => pixelRatio.value = window2.devicePixelRatio);
201
201
  }
@@ -2469,7 +2469,7 @@ const boxplot$1 = {
2469
2469
  coord_scale(ds, levels) {
2470
2470
  let xnudge = ds.xnudge ?? 0, ynudge = ds.ynudge ?? 0;
2471
2471
  if (ds.x) {
2472
- let x2 = psum$a(levels.x?.apply?.(ds.x) ?? ds.x, xnudge), xmin = psum$a(x2, ds.width?.map?.((x3) => -x3 / 2) ?? -0.5, xnudge), xmax = psum$a(x2, ds.width?.map?.((x3) => +x3 / 2) ?? 0.5, xnudge), lwisker = psum$a(ds.lwisker, ynudge), Q1 = psum$a(ds.Q1, ynudge), median = psum$a(ds.median, ynudge), Q3 = psum$a(ds.Q3, ynudge), uwisker = psum$a(ds.uwisker, ynudge), outliers = vecutils.apply(
2472
+ let x2 = psum$a(levels.x?.apply?.(ds.x) ?? ds.x, xnudge), xmin = psum$a(x2, ds.width?.map?.((x3) => -x3 / 2) ?? -0.5), xmax = psum$a(x2, ds.width?.map?.((x3) => +x3 / 2) ?? 0.5), lwisker = psum$a(ds.lwisker, ynudge), Q1 = psum$a(ds.Q1, ynudge), median = psum$a(ds.median, ynudge), Q3 = psum$a(ds.Q3, ynudge), uwisker = psum$a(ds.uwisker, ynudge), outliers = vecutils.apply(
2473
2473
  ($x, { y: ys, $raw }, nudge) => psum$a(ys, nudge).map(($y, i) => ({ x: $x, y: $y, $raw: $raw[i] })),
2474
2474
  x2,
2475
2475
  ds.outliers ?? [],
@@ -2491,7 +2491,7 @@ const boxplot$1 = {
2491
2491
  $ymax
2492
2492
  };
2493
2493
  } else if (ds.y) {
2494
- let y2 = psum$a(levels.y?.apply?.(ds.y) ?? ds.y, ynudge), ymin = psum$a(y2, ds.height?.map?.((y3) => -y3 / 2) ?? -0.5, ynudge), ymax = psum$a(y2, ds.height?.map?.((y3) => +y3 / 2) ?? 0.5, ynudge), lwisker = psum$a(ds.lwisker, xnudge), Q1 = psum$a(ds.Q1, xnudge), median = psum$a(ds.median, xnudge), Q3 = psum$a(ds.Q3, xnudge), uwisker = psum$a(ds.uwisker, xnudge), outliers = vecutils.apply(
2494
+ let y2 = psum$a(levels.y?.apply?.(ds.y) ?? ds.y, ynudge), ymin = psum$a(y2, ds.height?.map?.((y3) => -y3 / 2) ?? -0.5), ymax = psum$a(y2, ds.height?.map?.((y3) => +y3 / 2) ?? 0.5), lwisker = psum$a(ds.lwisker, xnudge), Q1 = psum$a(ds.Q1, xnudge), median = psum$a(ds.median, xnudge), Q3 = psum$a(ds.Q3, xnudge), uwisker = psum$a(ds.uwisker, xnudge), outliers = vecutils.apply(
2495
2495
  ($y, { x: xs, $raw }, nudge) => psum$a(xs, nudge).map(($x, i) => ({ x: $x, y: $y, $raw: $raw[i] })),
2496
2496
  y2,
2497
2497
  ds.outliers ?? [],
@@ -2527,13 +2527,10 @@ const boxplot$1 = {
2527
2527
  const curve$1 = {
2528
2528
  scale_attrs: ["fill", "color", "linewidth", "linetype", "alpha"],
2529
2529
  coord_scale(ds, levels) {
2530
- let xnudge = ds.xnudge?.map((v) => +v), ynudge = ds.ynudge?.map((v) => +v), points = ds.points.map((points2, i) => points2.map((p) => {
2531
- let xn = xnudge?.[i] ?? 0, yn = ynudge?.[i] ?? 0;
2532
- return {
2533
- x: +(levels?.x?.[p.x] ?? p.x) + xn,
2534
- y: +(levels?.y?.[p.y] ?? p.y) + yn
2535
- };
2536
- }));
2530
+ let xnudge = ds.xnudge?.map((v) => +v), ynudge = ds.ynudge?.map((v) => +v), points = ds.points.map((points2, i) => points2.map((p) => ({
2531
+ x: +(levels?.x?.[p.x] ?? p.x) + (xnudge?.[i] ?? 0),
2532
+ y: +(levels?.y?.[p.y] ?? p.y) + (ynudge?.[i] ?? 0)
2533
+ })));
2537
2534
  return { points };
2538
2535
  },
2539
2536
  get_range(ds, orientation) {
@@ -2635,13 +2632,10 @@ const point$3 = {
2635
2632
  const polygon$1 = {
2636
2633
  scale_attrs: ["fill", "color", "linewidth", "linetype", "alpha"],
2637
2634
  coord_scale(ds, levels) {
2638
- let xnudge = ds.xnudge?.map((v) => +v), ynudge = ds.ynudge?.map((v) => +v), points = ds.points.map((points2, i) => points2.map((p) => {
2639
- let xn = xnudge?.[i] ?? 0, yn = ynudge?.[i] ?? 0;
2640
- return {
2641
- x: +(levels?.x?.[p.x] ?? p.x) + xn,
2642
- y: +(levels?.y?.[p.y] ?? p.y) + yn
2643
- };
2644
- }));
2635
+ let xnudge = ds.xnudge?.map((v) => +v), ynudge = ds.ynudge?.map((v) => +v), points = ds.points.map((points2, i) => points2.map((p) => ({
2636
+ x: +(levels?.x?.[p.x] ?? p.x) + (xnudge?.[i] ?? 0),
2637
+ y: +(levels?.y?.[p.y] ?? p.y) + (ynudge?.[i] ?? 0)
2638
+ })));
2645
2639
  return { points };
2646
2640
  },
2647
2641
  get_range(ds, orientation) {
@@ -2669,6 +2663,28 @@ const rect$2 = {
2669
2663
  return d;
2670
2664
  }
2671
2665
  };
2666
+ const shape$1 = {
2667
+ scale_attrs: ["fill", "color", "linewidth", "linetype", "alpha"],
2668
+ coord_scale(ds, levels) {
2669
+ let x2 = levels.x?.apply?.(ds.x) ?? ds.x, y2 = levels.y?.apply?.(ds.y) ?? ds.y, xnudge = ds.xnudge?.map((v) => +v), ynudge = ds.ynudge?.map((v) => +v), points = ds.points.map((points2, i) => points2.map((p) => ({
2670
+ x: +(levels?.x?.[p.x] ?? p.x) + (xnudge?.[i] ?? 0) + x2[i],
2671
+ y: +(levels?.y?.[p.y] ?? p.y) + (ynudge?.[i] ?? 0) + y2[i]
2672
+ })));
2673
+ return { points };
2674
+ },
2675
+ get_values(ds, orientation) {
2676
+ if (orientation == "x") return ds.x;
2677
+ if (orientation == "y") return ds.y;
2678
+ },
2679
+ get_range(ds, orientation) {
2680
+ if (orientation == "x") return (ds.points ?? []).flatMap((ps, i) => ps.map((p) => p.x + ds.x[i]));
2681
+ if (orientation == "y") return (ds.points ?? []).flatMap((ps, i) => ps.map((p) => p.y + ds.y[i]));
2682
+ },
2683
+ validate(d) {
2684
+ if (!Array.isArray(d.points)) return null;
2685
+ return d;
2686
+ }
2687
+ };
2672
2688
  let psum$3 = vecutils.sum;
2673
2689
  const stick$1 = {
2674
2690
  scale_attrs: ["color", "linewidth", "linetype", "alpha"],
@@ -2759,20 +2775,22 @@ const vvgeom = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProper
2759
2775
  point: point$3,
2760
2776
  polygon: polygon$1,
2761
2777
  rect: rect$2,
2778
+ shape: shape$1,
2762
2779
  stick: stick$1,
2763
2780
  text: text$3,
2764
2781
  textsegment: textsegment$1,
2765
2782
  tile: tile$1
2766
2783
  }, Symbol.toStringTag, { value: "Module" }));
2767
- const bar = Object.assign(function(data, { position = "stack", width = 1, height = 1 }) {
2784
+ const bar = Object.assign(function(data, { position = "stack", width = 0.9, height = 0.9 }) {
2768
2785
  if (data.x != null && data.y != null)
2769
2786
  throw new Error(`"StatBar" only supports "x" or "y", not both`);
2770
- let values = data.x ?? data.y;
2787
+ let cateAes = data.x ? "x" : "y";
2788
+ let values = data[cateAes];
2771
2789
  if (values == null)
2772
2790
  throw new Error(`Missing aesthetics for "StatBar": "x" or "y"`);
2773
2791
  if (values.some((x2) => typeof x2 === "number"))
2774
2792
  throw new Error(`"StatBar" requires a discrete aesthetic`);
2775
- let keys = Object.keys(data).filter((k) => !["x", "y"].includes(k) && !k.startsWith("$"));
2793
+ let keys = Object.keys(data).filter((k) => !k.startsWith("$"));
2776
2794
  let group = intraaction(Object.fromEntries(keys.map((k) => [k, data[k]])));
2777
2795
  let inter = intraaction({ group: group ?? 0, value: values });
2778
2796
  let groups = Map.groupBy(data.$raw, (_, i) => inter.categories[inter[i]]);
@@ -2784,42 +2802,54 @@ const bar = Object.assign(function(data, { position = "stack", width = 1, height
2784
2802
  for (let key of keys) {
2785
2803
  result[key] = cates.map((x2) => x2.group).map((i) => group.categories[i][key]);
2786
2804
  }
2787
- if (data.x) {
2805
+ if (cateAes == "x") {
2788
2806
  result.x = cates.map((v) => v.value);
2789
2807
  result.height = $raw.map((v) => v.length);
2790
2808
  } else {
2791
2809
  result.y = cates.map((v) => v.value);
2792
2810
  result.width = $raw.map((v) => v.length);
2793
2811
  }
2794
- if (position == "dodge") {
2795
- if (data.x) {
2812
+ if (position == "stack") {
2813
+ let cate_group = Object.groupBy(result.$group, (v, i) => group.categories[v][cateAes]);
2814
+ let offset = cates.map((_) => 0);
2815
+ for (let cate in cate_group) {
2816
+ let s = 0;
2817
+ for (let i of cate_group[cate]) {
2818
+ offset[i] = s;
2819
+ s += $raw[i].length;
2820
+ }
2821
+ }
2822
+ if (cateAes == "x") {
2823
+ result.y = result.height.map((v, i) => offset[i] + v / 2);
2824
+ result.width = cates.map((_) => width);
2825
+ } else {
2826
+ result.x = result.width.map((v, i) => offset[i] + v / 2);
2827
+ result.height = cates.map((_) => height);
2828
+ }
2829
+ } else if (position == "dodge") {
2830
+ let cate_group = Object.groupBy(result.$group, (v, i) => group.categories[v][cateAes]);
2831
+ let $group = result.$group.map((v) => cate_group[group.categories[v][cateAes]]);
2832
+ if (cateAes == "x") {
2796
2833
  result.y = result.height.map((v) => v / 2);
2797
- result.width = cates.map((_, i) => width / group.categories.length);
2798
- result.xnudge = result.$group.map((v, i) => (result.xnudge?.[i] ?? 0) + ((v + 0.5) / group.categories.length - 0.5) * width);
2834
+ result.width = $group.map((arr) => width / arr.length);
2835
+ result.xnudge = $group.map((arr, i) => (result.xnudge?.[i] ?? 0) + ((arr.indexOf(result.$group[i]) + 0.5) / arr.length - 0.5) * width);
2799
2836
  } else {
2800
2837
  result.x = result.width.map((v) => v / 2);
2801
- result.height = cates.map((_, i) => height / group.categories.length);
2802
- result.ynudge = result.$group.map((v, i) => (result.ynudge?.[i] ?? 0) + ((v + 0.5) / group.categories.length - 0.5) * height);
2838
+ result.height = $group.map((arr) => height / arr.length);
2839
+ result.ynudge = $group.map((arr, i) => (result.ynudge?.[i] ?? 0) + ((arr.indexOf(result.$group[i]) + 0.5) / arr.length - 0.5) * height);
2803
2840
  }
2804
2841
  } else {
2805
- let tmp = Object.fromEntries(Array.from(new Set(values)).map((v) => [v, 0]));
2806
- let offset = cates.map((_) => 0);
2807
- let indices = cates.map((cate, i) => [cate, i]).sort(([{ group: a }], [{ group: b }]) => a - b);
2808
- for (let [cate, i] of indices) {
2809
- offset[i] = tmp[cate.value];
2810
- tmp[cate.value] += $raw[i].length;
2811
- }
2812
- if (data.x) {
2813
- result.y = result.height.map((v, i) => offset[i] + v / 2);
2842
+ if (cateAes == "x") {
2843
+ result.y = result.height.map((v) => v / 2);
2814
2844
  result.width = cates.map((_) => width);
2815
2845
  } else {
2816
- result.x = result.width.map((v, i) => offset[i] + v / 2);
2846
+ result.x = result.width.map((v) => v / 2);
2817
2847
  result.height = cates.map((_) => height);
2818
2848
  }
2819
2849
  }
2820
2850
  return result;
2821
2851
  }, { core_attrs: ["x", "y", "xnudge", "ynudge"] });
2822
- const boxplot = Object.assign(function(data, {}) {
2852
+ const boxplot = Object.assign(function(data, { position = "dodge", width = 0.9, height = 0.9 }) {
2823
2853
  let missingAes = ["x", "y"].filter((a) => data[a] == null);
2824
2854
  if (missingAes.length > 0)
2825
2855
  throw new Error(`Missing aesthetics for "StatBoxplot": "${missingAes.join('", "')}"`);
@@ -2854,11 +2884,28 @@ const boxplot = Object.assign(function(data, {}) {
2854
2884
  max,
2855
2885
  outliers
2856
2886
  };
2887
+ if (position == "dodge") {
2888
+ let cate_group = Object.groupBy(result.$group, (v, i) => group.categories[v][cateAes]);
2889
+ let $group = result.$group.map((v) => cate_group[group.categories[v][cateAes]]);
2890
+ if (isXdiscrete) {
2891
+ result.width = $group.map((arr) => width / arr.length);
2892
+ result.xnudge = $group.map((arr, i) => (result.xnudge?.[i] ?? 0) + ((arr.indexOf(result.$group[i]) + 0.5) / arr.length - 0.5) * width);
2893
+ } else {
2894
+ result.height = $group.map((arr) => height / arr.length);
2895
+ result.ynudge = $group.map((arr, i) => (result.ynudge?.[i] ?? 0) + ((arr.indexOf(result.$group[i]) + 0.5) / arr.length - 0.5) * height);
2896
+ }
2897
+ } else {
2898
+ if (isXdiscrete) {
2899
+ result.width = cates.map((_) => width);
2900
+ } else {
2901
+ result.height = cates.map((_) => height);
2902
+ }
2903
+ }
2857
2904
  for (let key of keys) {
2858
2905
  result[key] = cates.map((x2) => x2.group).map((i) => group.categories[i][key]);
2859
2906
  }
2860
2907
  return result;
2861
- }, { core_attrs: ["x", "y", "width", "height", "xnudge", "ynudge"] });
2908
+ }, { core_attrs: ["x", "y", "xnudge", "ynudge"] });
2862
2909
  const curve = Object.assign(function(data) {
2863
2910
  if (data.points != null) return data;
2864
2911
  let missingAes = ["x", "y"].filter((a) => data[a] == null);
@@ -2881,7 +2928,7 @@ const curve = Object.assign(function(data) {
2881
2928
  }
2882
2929
  return result;
2883
2930
  }, { core_attrs: ["x", "y", "xnudge", "ynudge"] });
2884
- const density = Object.assign(function(data, { n = 512, kernel = "gaussian" } = {}) {
2931
+ const density = Object.assign(function(data, { n = 512, kernel = "gaussian", scale = "area" } = {}) {
2885
2932
  if (data.x != null && data.y != null)
2886
2933
  throw new Error(`"StatDensity" only supports "x" or "y", not both`);
2887
2934
  let values = data.x ?? data.y;
@@ -2889,9 +2936,9 @@ const density = Object.assign(function(data, { n = 512, kernel = "gaussian" } =
2889
2936
  throw new Error(`Missing aesthetics for "StatDensity": "x" or "y"`);
2890
2937
  if (values.some((x2) => typeof x2 !== "number"))
2891
2938
  throw new Error(`"StatDensity" requires a continuous aesthetic`);
2892
- kernel = density_kernels[kernel];
2939
+ kernel = density_kernels$1[kernel];
2893
2940
  if (!kernel) {
2894
- throw new Error(`kernel must be one of ${Object.keys(density_kernels).map((k) => `"${k}"`).join(", ")}`);
2941
+ throw new Error(`kernel must be one of ${Object.keys(density_kernels$1).map((k) => `"${k}"`).join(", ")}`);
2895
2942
  }
2896
2943
  let keys = Object.keys(data).filter((k) => !["x", "y"].includes(k) && !k.startsWith("$"));
2897
2944
  let group = intraaction(Object.fromEntries(keys.map((k) => [k, data[k]])));
@@ -2906,13 +2953,14 @@ const density = Object.assign(function(data, { n = 512, kernel = "gaussian" } =
2906
2953
  $group: cates.map((x2) => x2.group)
2907
2954
  };
2908
2955
  let density2 = vs.map((v) => {
2909
- let bandwidth = bw.nrd0(v);
2956
+ let bandwidth = bw$1.nrd0(v);
2910
2957
  let { min, max } = numutils.extent(v);
2911
2958
  min -= 3 * bandwidth;
2912
2959
  max += 3 * bandwidth;
2913
2960
  let step = (max - min) / (n - 1);
2914
2961
  let breaks = Array.from({ length: n }, (_, i) => min + i * step);
2915
- return breaks.map((t) => [t, numutils.mean(v.map((d) => kernel((t - d) / bandwidth))) / bandwidth]);
2962
+ let ratio2 = scale === "count" ? v.length : 1;
2963
+ return breaks.map((t) => [t, numutils.mean(v.map((d) => kernel((t - d) / bandwidth))) / bandwidth * ratio2]);
2916
2964
  });
2917
2965
  for (let key of keys) {
2918
2966
  result[key] = cates.map((x2) => group.categories[x2.group][key]);
@@ -2924,7 +2972,7 @@ const density = Object.assign(function(data, { n = 512, kernel = "gaussian" } =
2924
2972
  }
2925
2973
  return result;
2926
2974
  }, { core_attrs: ["x", "y", "xnudge", "ynudge"] });
2927
- const bw = {
2975
+ const bw$1 = {
2928
2976
  nrd0: function(x2) {
2929
2977
  x2 = x2.filter((v2) => (typeof v2 === "number" || v2 instanceof Date) && isFinite(v2));
2930
2978
  let sd = numutils.sd(x2);
@@ -2940,7 +2988,7 @@ const bw = {
2940
2988
  return 1.06 * v * x2.length ** -0.2;
2941
2989
  }
2942
2990
  };
2943
- const density_kernels = {
2991
+ const density_kernels$1 = {
2944
2992
  uniform: (x2) => Math.abs(x2) <= 1 ? 0.5 : 0,
2945
2993
  triangular: (x2) => Math.abs(x2) <= 1 ? 1 - Math.abs(x2) : 0,
2946
2994
  epanechnikov: (x2) => Math.abs(x2) <= 1 ? 0.75 * (1 - x2 ** 2) : 0,
@@ -3141,6 +3189,12 @@ const segment = Object.assign(function(data) {
3141
3189
  throw new Error(`Missing aesthetics for "StatSegment": "${missingAes.join('", "')}"`);
3142
3190
  return data;
3143
3191
  }, { core_attrs: ["x", "y", "xend", "yend", "xnudge", "ynudge"] });
3192
+ const shape = Object.assign(function(data) {
3193
+ let missingAes = ["x", "y", "points"].filter((a) => data[a] == null);
3194
+ if (missingAes.length > 0)
3195
+ throw new Error(`Missing aesthetics for "StatShape": "${missingAes.join('", "')}"`);
3196
+ return data;
3197
+ }, { core_attrs: ["x", "y", "points", "xnudge", "ynudge"] });
3144
3198
  const stick = Object.assign(function(data) {
3145
3199
  if (data.dx == null) data.dx = Array(data.x.length).fill(0);
3146
3200
  if (data.dy == null) data.dy = Array(data.y.length).fill(0);
@@ -3175,6 +3229,103 @@ const tile = Object.assign(function(data) {
3175
3229
  throw new Error(`Missing aesthetics for "StatTile": "${missingAes.join('", "')}"`);
3176
3230
  return data;
3177
3231
  }, { core_attrs: ["x", "y", "width", "height", "xnudge", "ynudge"] });
3232
+ const violin = Object.assign(function(data, {
3233
+ n = 512,
3234
+ kernel = "gaussian",
3235
+ scale = "width",
3236
+ position = "dodge",
3237
+ width = 0.9,
3238
+ height = 0.9
3239
+ } = {}) {
3240
+ let missingAes = ["x", "y"].filter((a) => data[a] == null);
3241
+ if (missingAes.length > 0)
3242
+ throw new Error(`Missing aesthetics for "StatViolin": "${missingAes.join('", "')}"`);
3243
+ let isXdiscrete = data.x.some(is_categorical);
3244
+ let isYdiscrete = data.y.some(is_categorical);
3245
+ if (isXdiscrete && isYdiscrete)
3246
+ throw new Error(`Both "x" and "y" are discrete, "StatViolin" requires one continuous and one discrete aesthetic`);
3247
+ if (!isXdiscrete && !isYdiscrete)
3248
+ throw new Error(`Both "x" and "y" are continuous, "StatViolin" requires one continuous and one discrete aesthetic`);
3249
+ kernel = density_kernels[kernel];
3250
+ if (!kernel) {
3251
+ throw new Error(`kernel must be one of ${Object.keys(density_kernels).map((k) => `"${k}"`).join(", ")}`);
3252
+ }
3253
+ let [valueAes, cateAes, size] = isXdiscrete ? ["y", "x", width] : ["x", "y", height];
3254
+ let values = data[valueAes];
3255
+ let keys = Object.keys(data).filter((k) => k != valueAes && !k.startsWith("$"));
3256
+ let group = intraaction(Object.fromEntries(keys.map((k) => [k, data[k]])));
3257
+ let cut = intraaction({
3258
+ group: group ?? new Array(values.length).fill(0)
3259
+ }).map((v, _, a) => a.categories[v]);
3260
+ let map2 = Map.groupBy(data.$raw, (_, i) => cut[i]);
3261
+ let $raw = Array.from(map2.values()), cates = Array.from(map2.keys());
3262
+ let vs = Array.from(Map.groupBy(values, (_, i) => cut[i]).values());
3263
+ let result = {
3264
+ $raw,
3265
+ $group: cates.map((x2) => x2.group),
3266
+ [valueAes]: cates.map((v) => 0)
3267
+ };
3268
+ let density2 = vs.map((v) => {
3269
+ let bandwidth = bw.nrd0(v);
3270
+ let { min, max } = numutils.extent(v);
3271
+ min -= 3 * bandwidth;
3272
+ max += 3 * bandwidth;
3273
+ let step = (max - min) / (n - 1);
3274
+ let breaks = Array.from({ length: n }, (_, i) => min + i * step);
3275
+ let res = breaks.map((t) => numutils.mean(v.map((d) => kernel((t - d) / bandwidth))) / bandwidth);
3276
+ let ratio2 = scale == "area" ? 1 : 1 / numutils.max(res);
3277
+ return breaks.map((t, i) => [t, res[i] * ratio2 / 2]);
3278
+ });
3279
+ for (let key of keys) {
3280
+ result[key] = cates.map((x2) => group.categories[x2.group][key]);
3281
+ }
3282
+ if (position == "dodge") {
3283
+ let cate_group = Object.groupBy(result.$group, (v, i) => group.categories[v][cateAes]);
3284
+ let $group = result.$group.map((v) => cate_group[group.categories[v][cateAes]]);
3285
+ density2 = $group.map((arr, i) => density2[i].map(([x2, y2]) => [x2, y2 * size / arr.length]));
3286
+ if (isXdiscrete) {
3287
+ result.xnudge = $group.map((arr, i) => (result.xnudge?.[i] ?? 0) + ((arr.indexOf(result.$group[i]) + 0.5) / arr.length - 0.5) * width);
3288
+ } else {
3289
+ result.ynudge = $group.map((arr, i) => (result.ynudge?.[i] ?? 0) + ((arr.indexOf(result.$group[i]) + 0.5) / arr.length - 0.5) * height);
3290
+ }
3291
+ } else {
3292
+ density2 = density2.map((v) => v.map(([x2, y2]) => [x2, y2 * size]));
3293
+ }
3294
+ if (isXdiscrete) {
3295
+ result.points = density2.map((v) => v.map(([y2, x2]) => ({ x: x2, y: y2 })).concat(v.map(([y2, x2]) => ({ x: -x2, y: y2 })).reverse()));
3296
+ } else {
3297
+ result.points = density2.map((v) => v.map(([x2, y2]) => ({ x: x2, y: y2 })).concat(v.map(([x2, y2]) => ({ x: x2, y: -y2 })).reverse()));
3298
+ }
3299
+ return result;
3300
+ }, { core_attrs: ["x", "y", "xnudge", "ynudge"] });
3301
+ const bw = {
3302
+ nrd0: function(x2) {
3303
+ x2 = x2.filter((v2) => (typeof v2 === "number" || v2 instanceof Date) && isFinite(v2));
3304
+ let sd = numutils.sd(x2);
3305
+ let iqr = numutils.quantile(x2, 0.75) - numutils.quantile(x2, 0.25);
3306
+ let v = Math.min(sd, iqr / 1.34) || 1;
3307
+ return 0.9 * v * x2.length ** -0.2;
3308
+ },
3309
+ nrd: function(x2) {
3310
+ x2 = x2.filter((v2) => (typeof v2 === "number" || v2 instanceof Date) && isFinite(v2));
3311
+ let sd = numutils.sd(x2);
3312
+ let iqr = numutils.quantile(x2, 0.75) - numutils.quantile(x2, 0.25);
3313
+ let v = Math.min(sd, iqr / 1.34) || 1;
3314
+ return 1.06 * v * x2.length ** -0.2;
3315
+ }
3316
+ };
3317
+ const density_kernels = {
3318
+ uniform: (x2) => Math.abs(x2) <= 1 ? 0.5 : 0,
3319
+ triangular: (x2) => Math.abs(x2) <= 1 ? 1 - Math.abs(x2) : 0,
3320
+ epanechnikov: (x2) => Math.abs(x2) <= 1 ? 0.75 * (1 - x2 ** 2) : 0,
3321
+ biweight: (x2) => Math.abs(x2) <= 1 ? 15 / 16 * (1 - x2 ** 2) ** 2 : 0,
3322
+ triweight: (x2) => Math.abs(x2) <= 1 ? 35 / 32 * (1 - x2 ** 2) ** 3 : 0,
3323
+ tricube: (x2) => Math.abs(x2) <= 1 ? 70 / 81 * (1 - Math.abs(x2) ** 3) ** 3 : 0,
3324
+ gaussian: (x2) => Math.exp(-0.5 * x2 ** 2) / Math.sqrt(2 * Math.PI),
3325
+ cosine: (x2) => Math.abs(x2) <= 1 ? Math.PI / 4 * Math.cos(Math.PI / 2 * x2) : 0,
3326
+ logistic: (x2) => 1 / Math.cosh(x2) ** 2 / Math.PI,
3327
+ sigmoid: (x2) => 2 / (Math.exp(x2) + Math.exp(-x2)) ** 2 / Math.PI
3328
+ };
3178
3329
  const vvstat = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3179
3330
  __proto__: null,
3180
3331
  bar,
@@ -3191,10 +3342,12 @@ const vvstat = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProper
3191
3342
  polygon,
3192
3343
  rect: rect$1,
3193
3344
  segment,
3345
+ shape,
3194
3346
  stick,
3195
3347
  text: text$2,
3196
3348
  textsegment,
3197
- tile
3349
+ tile,
3350
+ violin
3198
3351
  }, Symbol.toStringTag, { value: "Module" }));
3199
3352
  function ascending$1(a, b) {
3200
3353
  return a == null || b == null ? NaN : a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN;
@@ -3296,7 +3449,7 @@ function tickStep(start2, stop, count) {
3296
3449
  const reverse = stop < start2, inc = reverse ? tickIncrement(stop, start2, count) : tickIncrement(start2, stop, count);
3297
3450
  return (reverse ? -1 : 1) * (inc < 0 ? 1 / -inc : inc);
3298
3451
  }
3299
- var noop = { value: () => {
3452
+ var noop$1 = { value: () => {
3300
3453
  } };
3301
3454
  function dispatch() {
3302
3455
  for (var i = 0, n = arguments.length, _ = {}, t; i < n; ++i) {
@@ -3356,7 +3509,7 @@ function get$1(type, name) {
3356
3509
  function set$1(type, name, callback) {
3357
3510
  for (var i = 0, n = type.length; i < n; ++i) {
3358
3511
  if (type[i].name === name) {
3359
- type[i] = noop, type = type.slice(0, i).concat(type.slice(i + 1));
3512
+ type[i] = noop$1, type = type.slice(0, i).concat(type.slice(i + 1));
3360
3513
  break;
3361
3514
  }
3362
3515
  }
@@ -5922,9 +6075,9 @@ function constant(x2) {
5922
6075
  };
5923
6076
  }
5924
6077
  const epsilon$1 = 1e-12;
5925
- function withPath(shape) {
6078
+ function withPath(shape2) {
5926
6079
  let digits = 3;
5927
- shape.digits = function(_) {
6080
+ shape2.digits = function(_) {
5928
6081
  if (!arguments.length) return digits;
5929
6082
  if (_ == null) {
5930
6083
  digits = null;
@@ -5933,7 +6086,7 @@ function withPath(shape) {
5933
6086
  if (!(d >= 0)) throw new RangeError(`invalid digits: ${_}`);
5934
6087
  digits = d;
5935
6088
  }
5936
- return shape;
6089
+ return shape2;
5937
6090
  };
5938
6091
  return () => new Path(digits);
5939
6092
  }
@@ -6015,6 +6168,8 @@ function line(x$1, y$1) {
6015
6168
  };
6016
6169
  return line2;
6017
6170
  }
6171
+ function noop() {
6172
+ }
6018
6173
  function point$1(that, x2, y2) {
6019
6174
  that._context.bezierCurveTo(
6020
6175
  that._x1 + that._k * (that._x2 - that._x0),
@@ -6083,6 +6238,69 @@ const cardinal = (function custom(tension) {
6083
6238
  };
6084
6239
  return cardinal2;
6085
6240
  })(0);
6241
+ function CardinalClosed(context, tension) {
6242
+ this._context = context;
6243
+ this._k = (1 - tension) / 6;
6244
+ }
6245
+ CardinalClosed.prototype = {
6246
+ areaStart: noop,
6247
+ areaEnd: noop,
6248
+ lineStart: function() {
6249
+ this._x0 = this._x1 = this._x2 = this._x3 = this._x4 = this._x5 = this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = this._y5 = NaN;
6250
+ this._point = 0;
6251
+ },
6252
+ lineEnd: function() {
6253
+ switch (this._point) {
6254
+ case 1: {
6255
+ this._context.moveTo(this._x3, this._y3);
6256
+ this._context.closePath();
6257
+ break;
6258
+ }
6259
+ case 2: {
6260
+ this._context.lineTo(this._x3, this._y3);
6261
+ this._context.closePath();
6262
+ break;
6263
+ }
6264
+ case 3: {
6265
+ this.point(this._x3, this._y3);
6266
+ this.point(this._x4, this._y4);
6267
+ this.point(this._x5, this._y5);
6268
+ break;
6269
+ }
6270
+ }
6271
+ },
6272
+ point: function(x2, y2) {
6273
+ x2 = +x2, y2 = +y2;
6274
+ switch (this._point) {
6275
+ case 0:
6276
+ this._point = 1;
6277
+ this._x3 = x2, this._y3 = y2;
6278
+ break;
6279
+ case 1:
6280
+ this._point = 2;
6281
+ this._context.moveTo(this._x4 = x2, this._y4 = y2);
6282
+ break;
6283
+ case 2:
6284
+ this._point = 3;
6285
+ this._x5 = x2, this._y5 = y2;
6286
+ break;
6287
+ default:
6288
+ point$1(this, x2, y2);
6289
+ break;
6290
+ }
6291
+ this._x0 = this._x1, this._x1 = this._x2, this._x2 = x2;
6292
+ this._y0 = this._y1, this._y1 = this._y2, this._y2 = y2;
6293
+ }
6294
+ };
6295
+ const cardinalClosed = (function custom2(tension) {
6296
+ function cardinal2(context) {
6297
+ return new CardinalClosed(context, tension);
6298
+ }
6299
+ cardinal2.tension = function(tension2) {
6300
+ return custom2(+tension2);
6301
+ };
6302
+ return cardinal2;
6303
+ })(0);
6086
6304
  function point(that, x2, y2) {
6087
6305
  var x1 = that._x1, y1 = that._y1, x22 = that._x2, y22 = that._y2;
6088
6306
  if (that._l01_a > epsilon$1) {
@@ -6151,15 +6369,105 @@ CatmullRom.prototype = {
6151
6369
  this._y0 = this._y1, this._y1 = this._y2, this._y2 = y2;
6152
6370
  }
6153
6371
  };
6154
- const catmullRom = (function custom2(alpha2) {
6372
+ const catmullRom = (function custom3(alpha2) {
6155
6373
  function catmullRom2(context) {
6156
6374
  return alpha2 ? new CatmullRom(context, alpha2) : new Cardinal(context, 0);
6157
6375
  }
6158
6376
  catmullRom2.alpha = function(alpha3) {
6159
- return custom2(+alpha3);
6377
+ return custom3(+alpha3);
6378
+ };
6379
+ return catmullRom2;
6380
+ })(0.5);
6381
+ function CatmullRomClosed(context, alpha2) {
6382
+ this._context = context;
6383
+ this._alpha = alpha2;
6384
+ }
6385
+ CatmullRomClosed.prototype = {
6386
+ areaStart: noop,
6387
+ areaEnd: noop,
6388
+ lineStart: function() {
6389
+ this._x0 = this._x1 = this._x2 = this._x3 = this._x4 = this._x5 = this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = this._y5 = NaN;
6390
+ this._l01_a = this._l12_a = this._l23_a = this._l01_2a = this._l12_2a = this._l23_2a = this._point = 0;
6391
+ },
6392
+ lineEnd: function() {
6393
+ switch (this._point) {
6394
+ case 1: {
6395
+ this._context.moveTo(this._x3, this._y3);
6396
+ this._context.closePath();
6397
+ break;
6398
+ }
6399
+ case 2: {
6400
+ this._context.lineTo(this._x3, this._y3);
6401
+ this._context.closePath();
6402
+ break;
6403
+ }
6404
+ case 3: {
6405
+ this.point(this._x3, this._y3);
6406
+ this.point(this._x4, this._y4);
6407
+ this.point(this._x5, this._y5);
6408
+ break;
6409
+ }
6410
+ }
6411
+ },
6412
+ point: function(x2, y2) {
6413
+ x2 = +x2, y2 = +y2;
6414
+ if (this._point) {
6415
+ var x23 = this._x2 - x2, y23 = this._y2 - y2;
6416
+ this._l23_a = Math.sqrt(this._l23_2a = Math.pow(x23 * x23 + y23 * y23, this._alpha));
6417
+ }
6418
+ switch (this._point) {
6419
+ case 0:
6420
+ this._point = 1;
6421
+ this._x3 = x2, this._y3 = y2;
6422
+ break;
6423
+ case 1:
6424
+ this._point = 2;
6425
+ this._context.moveTo(this._x4 = x2, this._y4 = y2);
6426
+ break;
6427
+ case 2:
6428
+ this._point = 3;
6429
+ this._x5 = x2, this._y5 = y2;
6430
+ break;
6431
+ default:
6432
+ point(this, x2, y2);
6433
+ break;
6434
+ }
6435
+ this._l01_a = this._l12_a, this._l12_a = this._l23_a;
6436
+ this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a;
6437
+ this._x0 = this._x1, this._x1 = this._x2, this._x2 = x2;
6438
+ this._y0 = this._y1, this._y1 = this._y2, this._y2 = y2;
6439
+ }
6440
+ };
6441
+ const catmullRomClosed = (function custom4(alpha2) {
6442
+ function catmullRom2(context) {
6443
+ return alpha2 ? new CatmullRomClosed(context, alpha2) : new CardinalClosed(context, 0);
6444
+ }
6445
+ catmullRom2.alpha = function(alpha3) {
6446
+ return custom4(+alpha3);
6160
6447
  };
6161
6448
  return catmullRom2;
6162
6449
  })(0.5);
6450
+ function LinearClosed(context) {
6451
+ this._context = context;
6452
+ }
6453
+ LinearClosed.prototype = {
6454
+ areaStart: noop,
6455
+ areaEnd: noop,
6456
+ lineStart: function() {
6457
+ this._point = 0;
6458
+ },
6459
+ lineEnd: function() {
6460
+ if (this._point) this._context.closePath();
6461
+ },
6462
+ point: function(x2, y2) {
6463
+ x2 = +x2, y2 = +y2;
6464
+ if (this._point) this._context.lineTo(x2, y2);
6465
+ else this._point = 1, this._context.moveTo(x2, y2);
6466
+ }
6467
+ };
6468
+ function linearClosed(context) {
6469
+ return new LinearClosed(context);
6470
+ }
6163
6471
  function Natural(context) {
6164
6472
  this._context = context;
6165
6473
  }
@@ -7041,9 +7349,9 @@ class GPlot {
7041
7349
  }
7042
7350
  getComputedLayers() {
7043
7351
  return this.layers.map((layer) => {
7044
- let data = Object.values(Object.groupBy(layer.data.$group.map(
7352
+ let data = layer.data.$group.map(
7045
7353
  (_, i) => vvgeom[layer.geom].validate(object_map(layer.data, (k, v) => v?.[i]))
7046
- ).filter((x2) => x2 != null), (d) => d.$group));
7354
+ ).filter((x2) => x2 != null);
7047
7355
  return { data, geom: layer.geom, vBind: layer.vBind };
7048
7356
  });
7049
7357
  }
@@ -7230,7 +7538,7 @@ class GAxis {
7230
7538
  }
7231
7539
  const _hoisted_1$e = ["font-size"];
7232
7540
  const _hoisted_2$8 = { key: 0 };
7233
- const _sfc_main$15 = {
7541
+ const _sfc_main$17 = {
7234
7542
  __name: "CoreText",
7235
7543
  props: {
7236
7544
  x: { type: Number, default: 0 },
@@ -14481,7 +14789,7 @@ XmlRenderer.prototype.tag = tag;
14481
14789
  XmlRenderer.prototype.esc = escapeXml;
14482
14790
  const _hoisted_1$d = ["text-anchor", "font-size"];
14483
14791
  const _hoisted_2$7 = { key: 0 };
14484
- const _sfc_main$14 = {
14792
+ const _sfc_main$16 = {
14485
14793
  __name: "CoreMarkdown",
14486
14794
  props: {
14487
14795
  x: { type: Number, default: 0 },
@@ -14628,7 +14936,7 @@ const _sfc_main$14 = {
14628
14936
  };
14629
14937
  }
14630
14938
  };
14631
- const _sfc_main$13 = {
14939
+ const _sfc_main$15 = {
14632
14940
  __name: "CoreAxisLabel",
14633
14941
  props: {
14634
14942
  type: String,
@@ -14690,7 +14998,7 @@ const _sfc_main$13 = {
14690
14998
  }
14691
14999
  };
14692
15000
  return (_ctx, _cache) => {
14693
- return __props.type == "markdown" ? (openBlock(), createBlock(_sfc_main$14, mergeProps({ key: 0 }, toHandlers(vOn)), null, 16)) : (openBlock(), createBlock(_sfc_main$15, mergeProps({ key: 1 }, toHandlers(vOn)), null, 16));
15001
+ return __props.type == "markdown" ? (openBlock(), createBlock(_sfc_main$16, mergeProps({ key: 0 }, toHandlers(vOn)), null, 16)) : (openBlock(), createBlock(_sfc_main$17, mergeProps({ key: 1 }, toHandlers(vOn)), null, 16));
14694
15002
  };
14695
15003
  }
14696
15004
  };
@@ -14707,7 +15015,7 @@ const _hoisted_5$2 = {
14707
15015
  fill: "transparent"
14708
15016
  };
14709
15017
  const _hoisted_6$2 = ["x"];
14710
- const _sfc_main$12 = {
15018
+ const _sfc_main$14 = {
14711
15019
  __name: "CoreAxisH",
14712
15020
  props: {
14713
15021
  coord: String,
@@ -15073,7 +15381,7 @@ const _sfc_main$12 = {
15073
15381
  _cache[2] || (_cache[2] = createTextVNode()),
15074
15382
  (openBlock(true), createElementBlock(Fragment, null, renderList(tickTexts.value, (tick) => {
15075
15383
  return openBlock(), createElementBlock("g", mergeProps({ ref_for: true }, tick.wrapper), [
15076
- createVNode(_sfc_main$13, mergeProps({ ref_for: true }, tick.text, { getPosition }), null, 16)
15384
+ createVNode(_sfc_main$15, mergeProps({ ref_for: true }, tick.text, { getPosition }), null, 16)
15077
15385
  ], 16);
15078
15386
  }), 256)),
15079
15387
  _cache[3] || (_cache[3] = createTextVNode()),
@@ -15106,7 +15414,7 @@ const _sfc_main$12 = {
15106
15414
  ])) : createCommentVNode("", true),
15107
15415
  _cache[5] || (_cache[5] = createTextVNode()),
15108
15416
  axisTitle.value.text ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
15109
- __props.theme.title_type == "markdown" ? (openBlock(), createBlock(_sfc_main$14, normalizeProps(mergeProps({ key: 0 }, axisTitle.value)), null, 16)) : (openBlock(), createBlock(_sfc_main$15, normalizeProps(mergeProps({ key: 1 }, axisTitle.value)), null, 16))
15417
+ __props.theme.title_type == "markdown" ? (openBlock(), createBlock(_sfc_main$16, normalizeProps(mergeProps({ key: 0 }, axisTitle.value)), null, 16)) : (openBlock(), createBlock(_sfc_main$17, normalizeProps(mergeProps({ key: 1 }, axisTitle.value)), null, 16))
15110
15418
  ], 64)) : createCommentVNode("", true)
15111
15419
  ], 12, _hoisted_1$c);
15112
15420
  };
@@ -15125,7 +15433,7 @@ const _hoisted_5$1 = {
15125
15433
  fill: "transparent"
15126
15434
  };
15127
15435
  const _hoisted_6$1 = ["y"];
15128
- const _sfc_main$11 = {
15436
+ const _sfc_main$13 = {
15129
15437
  __name: "CoreAxisV",
15130
15438
  props: {
15131
15439
  coord: String,
@@ -15491,7 +15799,7 @@ const _sfc_main$11 = {
15491
15799
  _cache[2] || (_cache[2] = createTextVNode()),
15492
15800
  (openBlock(true), createElementBlock(Fragment, null, renderList(tickTexts.value, (tick) => {
15493
15801
  return openBlock(), createElementBlock("g", mergeProps({ ref_for: true }, tick.wrapper), [
15494
- createVNode(_sfc_main$13, mergeProps({ ref_for: true }, tick.text, { getPosition }), null, 16)
15802
+ createVNode(_sfc_main$15, mergeProps({ ref_for: true }, tick.text, { getPosition }), null, 16)
15495
15803
  ], 16);
15496
15804
  }), 256)),
15497
15805
  _cache[3] || (_cache[3] = createTextVNode()),
@@ -15524,13 +15832,13 @@ const _sfc_main$11 = {
15524
15832
  ])) : createCommentVNode("", true),
15525
15833
  _cache[5] || (_cache[5] = createTextVNode()),
15526
15834
  axisTitle.value.text ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
15527
- __props.theme.title_type == "markdown" ? (openBlock(), createBlock(_sfc_main$14, normalizeProps(mergeProps({ key: 0 }, axisTitle.value)), null, 16)) : (openBlock(), createBlock(_sfc_main$15, normalizeProps(mergeProps({ key: 1 }, axisTitle.value)), null, 16))
15835
+ __props.theme.title_type == "markdown" ? (openBlock(), createBlock(_sfc_main$16, normalizeProps(mergeProps({ key: 0 }, axisTitle.value)), null, 16)) : (openBlock(), createBlock(_sfc_main$17, normalizeProps(mergeProps({ key: 1 }, axisTitle.value)), null, 16))
15528
15836
  ], 64)) : createCommentVNode("", true)
15529
15837
  ], 12, _hoisted_1$b);
15530
15838
  };
15531
15839
  }
15532
15840
  };
15533
- const _sfc_main$10 = {
15841
+ const _sfc_main$12 = {
15534
15842
  __name: "CoreAxis",
15535
15843
  props: {
15536
15844
  theme: { type: Object, default: () => ({}) },
@@ -15539,8 +15847,8 @@ const _sfc_main$10 = {
15539
15847
  },
15540
15848
  setup(__props) {
15541
15849
  const axis = {
15542
- h: _sfc_main$12,
15543
- v: _sfc_main$11
15850
+ h: _sfc_main$14,
15851
+ v: _sfc_main$13
15544
15852
  };
15545
15853
  return (_ctx, _cache) => {
15546
15854
  return __props.position != "none" ? (openBlock(), createBlock(resolveDynamicComponent(axis[__props.orientation]), {
@@ -15551,7 +15859,7 @@ const _sfc_main$10 = {
15551
15859
  };
15552
15860
  }
15553
15861
  };
15554
- const _sfc_main$$ = {
15862
+ const _sfc_main$11 = {
15555
15863
  __name: "CoreGridH",
15556
15864
  props: {
15557
15865
  breaks: { type: Array, default: () => [] },
@@ -15623,7 +15931,7 @@ const _sfc_main$$ = {
15623
15931
  };
15624
15932
  }
15625
15933
  };
15626
- const _sfc_main$_ = {
15934
+ const _sfc_main$10 = {
15627
15935
  __name: "CoreGridV",
15628
15936
  props: {
15629
15937
  breaks: { type: Array, default: () => [] },
@@ -15695,7 +16003,7 @@ const _sfc_main$_ = {
15695
16003
  };
15696
16004
  }
15697
16005
  };
15698
- const _sfc_main$Z = {
16006
+ const _sfc_main$$ = {
15699
16007
  __name: "CoreCanvasBoxplot",
15700
16008
  props: {
15701
16009
  extendX: { type: Number, default: 0 },
@@ -15729,88 +16037,81 @@ const _sfc_main$Z = {
15729
16037
  ctx.scale(__props.dpi / 96, __props.dpi / 96);
15730
16038
  ctx.translate(__props.layout.l + __props.layout.fullWidth * __props.extendX, __props.layout.t + __props.layout.fullHeight * __props.extendY);
15731
16039
  let _path_data = /* @__PURE__ */ new Map(), path_data = /* @__PURE__ */ new Map();
15732
- for (const group of __props.data) {
15733
- for (let {
15734
- x: x2,
15735
- xmin,
15736
- xmax,
15737
- y: y2,
15738
- ymin,
15739
- ymax,
15740
- lwisker,
15741
- Q1,
15742
- median,
15743
- Q3,
15744
- uwisker,
15745
- outliers,
15746
- $xmin,
15747
- $xmax,
15748
- $ymin,
15749
- $ymax,
15750
- fill = "white",
15751
- color: color2 = "black",
15752
- linewidth = 1,
15753
- linetype,
15754
- alpha: alpha2,
15755
- "translate-x": translateX = 0,
15756
- "translate-y": translateY = 0,
15757
- $raw
15758
- } of group) {
15759
- if (color2 === "transparent") continue;
15760
- const { hmin: rx1, hmax: rx2, vmin: ry1, vmax: ry2 } = __props.coord2pos(x2 == null ? { ymin, ymax, xmin: Q1, xmax: Q3 } : { xmin, xmax, ymin: Q1, ymax: Q3 });
15761
- const { h: lx1, v: ly1 } = __props.coord2pos(x2 == null ? { y: y2, x: lwisker } : { x: x2, y: lwisker });
15762
- const { h: lx2, v: ly2 } = __props.coord2pos(x2 == null ? { y: y2, x: uwisker } : { x: x2, y: uwisker });
15763
- const { h: mx1, v: my1 } = __props.coord2pos(x2 == null ? { y: ymin, x: median } : { x: xmin, y: median });
15764
- const { h: mx2, v: my2 } = __props.coord2pos(x2 == null ? { y: ymax, x: median } : { x: xmax, y: median });
15765
- const { h: uwx1, v: uwy1 } = __props.coord2pos(x2 == null ? { y: ymin * 0.25 + ymax * 0.75, x: uwisker } : { x: xmin * 0.25 + xmax * 0.75, y: uwisker });
15766
- const { h: uwx2, v: uwy2 } = __props.coord2pos(x2 == null ? { y: ymin * 0.75 + ymax * 0.25, x: uwisker } : { x: xmin * 0.75 + xmax * 0.25, y: uwisker });
15767
- const { h: lwx1, v: lwy1 } = __props.coord2pos(x2 == null ? { y: ymin * 0.25 + ymax * 0.75, x: lwisker } : { x: xmin * 0.25 + xmax * 0.75, y: lwisker });
15768
- const { h: lwx2, v: lwy2 } = __props.coord2pos(x2 == null ? { y: ymin * 0.75 + ymax * 0.25, x: lwisker } : { x: xmin * 0.75 + xmax * 0.25, y: lwisker });
15769
- ctx.globalAlpha = alpha2;
15770
- ctx.setLineDash(parseLinetype(linetype));
15771
- const linepath2d = new Path2D();
15772
- linepath2d.moveTo(lx1 + translateX, ly1 + translateY);
15773
- linepath2d.lineTo(lx2 + translateX, ly2 + translateY);
15774
- const wiskerpath2d = new Path2D();
15775
- wiskerpath2d.moveTo(uwx1 + translateX, uwy1 + translateY);
15776
- wiskerpath2d.lineTo(uwx2 + translateX, uwy2 + translateY);
15777
- wiskerpath2d.moveTo(lwx1 + translateX, lwy1 + translateY);
15778
- wiskerpath2d.lineTo(lwx2 + translateX, lwy2 + translateY);
15779
- ctx.lineWidth = linewidth;
15780
- if (color2 !== "none") {
15781
- ctx.strokeStyle = color2;
15782
- ctx.stroke(linepath2d);
15783
- ctx.stroke(wiskerpath2d);
15784
- }
15785
- const rectpath2d = new Path2D();
15786
- rectpath2d.rect(rx1 + translateX, ry1 + translateY, rx2 - rx1, ry2 - ry1);
15787
- if (fill !== "none") {
15788
- ctx.fillStyle = fill;
15789
- ctx.fill(rectpath2d);
15790
- }
15791
- if (color2 != null) {
15792
- ctx.strokeStyle = color2;
15793
- ctx.stroke(rectpath2d);
15794
- }
15795
- _path_data.set(rectpath2d, $raw);
15796
- const medianpath2d = new Path2D();
15797
- medianpath2d.moveTo(mx1 + translateX, my1 + translateY);
15798
- medianpath2d.lineTo(mx2 + translateX, my2 + translateY);
16040
+ for (let {
16041
+ x: x2,
16042
+ xmin,
16043
+ xmax,
16044
+ y: y2,
16045
+ ymin,
16046
+ ymax,
16047
+ lwisker,
16048
+ Q1,
16049
+ median,
16050
+ Q3,
16051
+ uwisker,
16052
+ outliers,
16053
+ $xmin,
16054
+ $xmax,
16055
+ $ymin,
16056
+ $ymax,
16057
+ fill = "white",
16058
+ color: color2 = "black",
16059
+ linewidth = 1,
16060
+ linetype,
16061
+ alpha: alpha2,
16062
+ "translate-x": translateX = 0,
16063
+ "translate-y": translateY = 0,
16064
+ $raw
16065
+ } of __props.data) {
16066
+ const { hmin: rx1, hmax: rx2, vmin: ry1, vmax: ry2 } = __props.coord2pos(x2 == null ? { ymin, ymax, xmin: Q1, xmax: Q3 } : { xmin, xmax, ymin: Q1, ymax: Q3 });
16067
+ const { h: lx1, v: ly1 } = __props.coord2pos(x2 == null ? { y: y2, x: lwisker } : { x: x2, y: lwisker });
16068
+ const { h: lx2, v: ly2 } = __props.coord2pos(x2 == null ? { y: y2, x: uwisker } : { x: x2, y: uwisker });
16069
+ const { h: mx1, v: my1 } = __props.coord2pos(x2 == null ? { y: ymin, x: median } : { x: xmin, y: median });
16070
+ const { h: mx2, v: my2 } = __props.coord2pos(x2 == null ? { y: ymax, x: median } : { x: xmax, y: median });
16071
+ const { h: uwx1, v: uwy1 } = __props.coord2pos(x2 == null ? { y: ymin * 0.25 + ymax * 0.75, x: uwisker } : { x: xmin * 0.25 + xmax * 0.75, y: uwisker });
16072
+ const { h: uwx2, v: uwy2 } = __props.coord2pos(x2 == null ? { y: ymin * 0.75 + ymax * 0.25, x: uwisker } : { x: xmin * 0.75 + xmax * 0.25, y: uwisker });
16073
+ const { h: lwx1, v: lwy1 } = __props.coord2pos(x2 == null ? { y: ymin * 0.25 + ymax * 0.75, x: lwisker } : { x: xmin * 0.25 + xmax * 0.75, y: lwisker });
16074
+ const { h: lwx2, v: lwy2 } = __props.coord2pos(x2 == null ? { y: ymin * 0.75 + ymax * 0.25, x: lwisker } : { x: xmin * 0.75 + xmax * 0.25, y: lwisker });
16075
+ ctx.globalAlpha = alpha2;
16076
+ ctx.setLineDash(parseLinetype(linetype));
16077
+ const linepath2d = new Path2D();
16078
+ linepath2d.moveTo(lx1 + translateX, ly1 + translateY);
16079
+ linepath2d.lineTo(lx2 + translateX, ly2 + translateY);
16080
+ const wiskerpath2d = new Path2D();
16081
+ wiskerpath2d.moveTo(uwx1 + translateX, uwy1 + translateY);
16082
+ wiskerpath2d.lineTo(uwx2 + translateX, uwy2 + translateY);
16083
+ wiskerpath2d.moveTo(lwx1 + translateX, lwy1 + translateY);
16084
+ wiskerpath2d.lineTo(lwx2 + translateX, lwy2 + translateY);
16085
+ const rectpath2d = new Path2D();
16086
+ rectpath2d.rect(rx1 + translateX, ry1 + translateY, rx2 - rx1, ry2 - ry1);
16087
+ _path_data.set(rectpath2d, $raw);
16088
+ const medianpath2d = new Path2D();
16089
+ medianpath2d.moveTo(mx1 + translateX, my1 + translateY);
16090
+ medianpath2d.lineTo(mx2 + translateX, my2 + translateY);
16091
+ if (color2 != null && color2 !== "none") {
16092
+ ctx.strokeStyle = color2;
16093
+ ctx.lineWidth = linewidth;
16094
+ ctx.stroke(linepath2d);
16095
+ ctx.stroke(wiskerpath2d);
16096
+ }
16097
+ if (fill !== "none") {
16098
+ ctx.fillStyle = fill;
16099
+ ctx.fill(rectpath2d);
16100
+ }
16101
+ if (color2 != null && color2 !== "none") {
16102
+ ctx.stroke(rectpath2d);
15799
16103
  ctx.lineWidth = linewidth * 2;
15800
- if (color2 !== "none") {
15801
- ctx.strokeStyle = color2;
15802
- ctx.stroke(medianpath2d);
15803
- }
15804
- for (let { x: x3, y: y3, $raw: $raw2 } of outliers) {
15805
- const { h: ox, v: oy } = __props.coord2pos({ x: x3, y: y3 });
15806
- const outlierpath2d = new Path2D();
15807
- outlierpath2d.arc(ox + translateX, oy + translateY, 2, 0, Math.PI * 2);
15808
- if (fill !== "none") {
15809
- ctx.fillStyle = color2;
15810
- ctx.fill(outlierpath2d);
15811
- }
15812
- _path_data.set(outlierpath2d, $raw2);
16104
+ ctx.stroke(medianpath2d);
16105
+ }
16106
+ for (let { x: x3, y: y3, $raw: $raw2 } of outliers) {
16107
+ const { h: ox, v: oy } = __props.coord2pos({ x: x3, y: y3 });
16108
+ const outlierpath2d = new Path2D();
16109
+ outlierpath2d.arc(ox + translateX, oy + translateY, 2, 0, Math.PI * 2);
16110
+ if (color2 != null && color2 !== "none") {
16111
+ ctx.fillStyle = color2;
16112
+ ctx.fill(outlierpath2d);
15813
16113
  }
16114
+ _path_data.set(outlierpath2d, $raw2);
15814
16115
  }
15815
16116
  }
15816
16117
  for (let path2 of Array.from(_path_data.keys()).reverse()) {
@@ -15842,7 +16143,7 @@ const _sfc_main$Z = {
15842
16143
  };
15843
16144
  }
15844
16145
  };
15845
- const _sfc_main$Y = {
16146
+ const _sfc_main$_ = {
15846
16147
  __name: "CoreCanvasCurve",
15847
16148
  props: {
15848
16149
  extendX: { type: Number, default: 0 },
@@ -15876,41 +16177,39 @@ const _sfc_main$Y = {
15876
16177
  ctx.scale(__props.dpi / 96, __props.dpi / 96);
15877
16178
  ctx.translate(__props.layout.l + __props.layout.fullWidth * __props.extendX, __props.layout.t + __props.layout.fullHeight * __props.extendY);
15878
16179
  let _path_data = /* @__PURE__ */ new Map(), path_data = /* @__PURE__ */ new Map();
15879
- for (const group of __props.data) {
15880
- for (let {
15881
- points,
15882
- fill = "none",
15883
- color: color2 = "black",
15884
- linewidth,
15885
- linetype,
15886
- alpha: alpha2,
15887
- "translate-x": translateX = 0,
15888
- "translate-y": translateY = 0,
15889
- $raw,
15890
- interpolate: interpolate2
15891
- } of group) {
15892
- points = points.map((p) => (({ h: x2, v: y2 }) => ({ x: x2, y: y2 }))(__props.coord2pos(p))).filter((p) => p.x != null && p.y != null);
15893
- if (points.length === 0) continue;
15894
- const path2d = new Path2D();
15895
- let interpolatorFn = typeof interpolate2 == "function" ? interpolate2 : interpolators[interpolate2] ?? natural$1;
15896
- let interpolator = interpolatorFn(path2d);
15897
- interpolator.lineStart();
15898
- for (let i = 0; i < points.length; i++) {
15899
- interpolator.point(points[i].x + translateX, points[i].y + translateY);
15900
- }
15901
- interpolator.lineEnd();
15902
- _path_data.set(path2d, $raw);
15903
- ctx.lineWidth = linewidth;
15904
- ctx.globalAlpha = alpha2;
15905
- ctx.setLineDash(parseLinetype(linetype));
15906
- if (fill !== "none") {
15907
- ctx.fillStyle = fill;
15908
- ctx.fill(path2d);
15909
- }
15910
- if (color2 != null) {
15911
- ctx.strokeStyle = color2;
15912
- ctx.stroke(path2d);
15913
- }
16180
+ for (let {
16181
+ points,
16182
+ fill,
16183
+ color: color2,
16184
+ linewidth,
16185
+ linetype,
16186
+ alpha: alpha2,
16187
+ "translate-x": translateX = 0,
16188
+ "translate-y": translateY = 0,
16189
+ $raw,
16190
+ interpolate: interpolate2
16191
+ } of __props.data) {
16192
+ points = points.map((p) => (({ h: x2, v: y2 }) => ({ x: x2, y: y2 }))(__props.coord2pos(p))).filter((p) => p.x != null && p.y != null);
16193
+ if (points.length === 0) continue;
16194
+ const path2d = new Path2D();
16195
+ let interpolatorFn = typeof interpolate2 == "function" ? interpolate2 : interpolators[interpolate2] ?? natural$1;
16196
+ let interpolator = interpolatorFn(path2d);
16197
+ interpolator.lineStart();
16198
+ for (let i = 0; i < points.length; i++) {
16199
+ interpolator.point(points[i].x + translateX, points[i].y + translateY);
16200
+ }
16201
+ interpolator.lineEnd();
16202
+ _path_data.set(path2d, $raw);
16203
+ ctx.lineWidth = linewidth;
16204
+ ctx.globalAlpha = alpha2;
16205
+ ctx.setLineDash(parseLinetype(linetype));
16206
+ if (fill !== "none") {
16207
+ ctx.fillStyle = fill;
16208
+ ctx.fill(path2d);
16209
+ }
16210
+ if (color2 != null && color2 !== "none") {
16211
+ ctx.strokeStyle = color2;
16212
+ ctx.stroke(path2d);
15914
16213
  }
15915
16214
  }
15916
16215
  for (let path2 of Array.from(_path_data.keys()).reverse()) {
@@ -15939,8 +16238,11 @@ const _sfc_main$Y = {
15939
16238
  });
15940
16239
  const interpolators = {
15941
16240
  cardinal,
16241
+ cardinalClosed,
15942
16242
  catmullRom,
16243
+ catmullRomClosed,
15943
16244
  linear: curveLinear,
16245
+ linearClosed,
15944
16246
  natural: natural$1
15945
16247
  };
15946
16248
  return (_ctx, _cache) => {
@@ -15948,7 +16250,7 @@ const _sfc_main$Y = {
15948
16250
  };
15949
16251
  }
15950
16252
  };
15951
- const _sfc_main$X = {
16253
+ const _sfc_main$Z = {
15952
16254
  __name: "CoreCanvasEllipse",
15953
16255
  props: {
15954
16256
  extendX: { type: Number, default: 0 },
@@ -15982,46 +16284,44 @@ const _sfc_main$X = {
15982
16284
  ctx.scale(__props.dpi / 96, __props.dpi / 96);
15983
16285
  ctx.translate(__props.layout.l + __props.layout.fullWidth * __props.extendX, __props.layout.t + __props.layout.fullHeight * __props.extendY);
15984
16286
  let _path_data = /* @__PURE__ */ new Map(), path_data = /* @__PURE__ */ new Map();
15985
- for (const group of __props.data) {
15986
- for (let {
15987
- cx,
15988
- cy,
15989
- A,
15990
- B,
15991
- C,
15992
- fill = "none",
15993
- color: color2 = "black",
15994
- linewidth,
15995
- linetype,
15996
- alpha: alpha2,
15997
- "translate-x": translateX = 0,
15998
- "translate-y": translateY = 0,
15999
- $raw
16000
- } of group) {
16001
- let dx = Math.sqrt(C / (A * C - B * B)), dy = Math.sqrt(A / (A * C - B * B));
16002
- const { h: ch, v: cv } = __props.coord2pos({ x: cx, y: cy });
16003
- let { h: h1, v: v1 } = __props.coord2pos({ x: cx - dx, y: cy - dy }), { h: h2, v: v2 } = __props.coord2pos({ x: cx + dx, y: cy + dy });
16004
- let scaleX = (h2 - h1) / (2 * dx), scaleY = (v2 - v1) / (2 * dy);
16005
- A /= scaleX * scaleX;
16006
- B /= scaleX * scaleY;
16007
- C /= scaleY * scaleY;
16008
- const tr = A + C, det = A * C - B * B;
16009
- const disc = Math.sqrt(Math.max(0, tr * tr / 4 - det));
16010
- let rx2 = 1 / Math.sqrt(tr / 2 + disc), ry = 1 / Math.sqrt(tr / 2 - disc), angle2 = Math.atan2(2 * B, A - C) / 2;
16011
- const path2d = new Path2D();
16012
- path2d.ellipse(ch + translateX, cv + translateY, rx2, ry, angle2, 0, 2 * Math.PI);
16013
- _path_data.set(path2d, $raw);
16014
- ctx.lineWidth = linewidth;
16015
- ctx.globalAlpha = alpha2;
16016
- ctx.setLineDash(parseLinetype(linetype));
16017
- if (fill !== "none") {
16018
- ctx.fillStyle = fill;
16019
- ctx.fill(path2d);
16020
- }
16021
- if (color2 != null) {
16022
- ctx.strokeStyle = color2;
16023
- ctx.stroke(path2d);
16024
- }
16287
+ for (let {
16288
+ cx,
16289
+ cy,
16290
+ A,
16291
+ B,
16292
+ C,
16293
+ fill,
16294
+ color: color2,
16295
+ linewidth,
16296
+ linetype,
16297
+ alpha: alpha2,
16298
+ "translate-x": translateX = 0,
16299
+ "translate-y": translateY = 0,
16300
+ $raw
16301
+ } of __props.data) {
16302
+ let dx = Math.sqrt(C / (A * C - B * B)), dy = Math.sqrt(A / (A * C - B * B));
16303
+ const { h: ch, v: cv } = __props.coord2pos({ x: cx, y: cy });
16304
+ let { h: h1, v: v1 } = __props.coord2pos({ x: cx - dx, y: cy - dy }), { h: h2, v: v2 } = __props.coord2pos({ x: cx + dx, y: cy + dy });
16305
+ let scaleX = (h2 - h1) / (2 * dx), scaleY = (v2 - v1) / (2 * dy);
16306
+ A /= scaleX * scaleX;
16307
+ B /= scaleX * scaleY;
16308
+ C /= scaleY * scaleY;
16309
+ const tr = A + C, det = A * C - B * B;
16310
+ const disc = Math.sqrt(Math.max(0, tr * tr / 4 - det));
16311
+ let rx2 = 1 / Math.sqrt(tr / 2 + disc), ry = 1 / Math.sqrt(tr / 2 - disc), angle2 = Math.atan2(2 * B, A - C) / 2;
16312
+ const path2d = new Path2D();
16313
+ path2d.ellipse(ch + translateX, cv + translateY, rx2, ry, angle2, 0, 2 * Math.PI);
16314
+ _path_data.set(path2d, $raw);
16315
+ ctx.lineWidth = linewidth;
16316
+ ctx.globalAlpha = alpha2;
16317
+ ctx.setLineDash(parseLinetype(linetype));
16318
+ if (fill !== "none") {
16319
+ ctx.fillStyle = fill;
16320
+ ctx.fill(path2d);
16321
+ }
16322
+ if (color2 != null && color2 !== "none") {
16323
+ ctx.strokeStyle = color2;
16324
+ ctx.stroke(path2d);
16025
16325
  }
16026
16326
  }
16027
16327
  for (let path2 of Array.from(_path_data.keys()).reverse()) {
@@ -16053,7 +16353,7 @@ const _sfc_main$X = {
16053
16353
  };
16054
16354
  }
16055
16355
  };
16056
- const _sfc_main$W = {
16356
+ const _sfc_main$Y = {
16057
16357
  __name: "CoreCanvasLine",
16058
16358
  props: {
16059
16359
  extendX: { type: Number, default: 0 },
@@ -16087,34 +16387,31 @@ const _sfc_main$W = {
16087
16387
  ctx.scale(__props.dpi / 96, __props.dpi / 96);
16088
16388
  ctx.translate(__props.layout.l + __props.layout.fullWidth * __props.extendX, __props.layout.t + __props.layout.fullHeight * __props.extendY);
16089
16389
  let _path_data = /* @__PURE__ */ new Map(), path_data = /* @__PURE__ */ new Map();
16090
- for (const group of __props.data) {
16091
- for (let {
16092
- x: x2,
16093
- y: y2,
16094
- xend,
16095
- yend,
16096
- color: color2,
16097
- linewidth,
16098
- alpha: alpha2,
16099
- linetype,
16100
- "translate-x": translateX = 0,
16101
- "translate-y": translateY = 0,
16102
- $raw
16103
- } of group) {
16104
- if (color2 === "transparent") continue;
16105
- const { h: x1, v: y1 } = __props.coord2pos({ x: x2, y: y2 });
16106
- const { h: x22, v: y22 } = __props.coord2pos({ x: xend, y: yend });
16107
- const path2d = new Path2D();
16108
- path2d.moveTo(x1 + translateX, y1 + translateY);
16109
- path2d.lineTo(x22 + translateX, y22 + translateY);
16110
- _path_data.set(path2d, $raw);
16111
- ctx.lineWidth = linewidth;
16112
- ctx.globalAlpha = alpha2;
16113
- ctx.setLineDash(parseLinetype(linetype));
16114
- if (color2 !== "none") {
16115
- ctx.strokeStyle = color2;
16116
- ctx.stroke(path2d);
16117
- }
16390
+ for (let {
16391
+ x: x2,
16392
+ y: y2,
16393
+ xend,
16394
+ yend,
16395
+ color: color2 = "black",
16396
+ linewidth,
16397
+ alpha: alpha2,
16398
+ linetype,
16399
+ "translate-x": translateX = 0,
16400
+ "translate-y": translateY = 0,
16401
+ $raw
16402
+ } of __props.data) {
16403
+ const { h: x1, v: y1 } = __props.coord2pos({ x: x2, y: y2 });
16404
+ const { h: x22, v: y22 } = __props.coord2pos({ x: xend, y: yend });
16405
+ const path2d = new Path2D();
16406
+ path2d.moveTo(x1 + translateX, y1 + translateY);
16407
+ path2d.lineTo(x22 + translateX, y22 + translateY);
16408
+ _path_data.set(path2d, $raw);
16409
+ ctx.lineWidth = linewidth;
16410
+ ctx.globalAlpha = alpha2;
16411
+ ctx.setLineDash(parseLinetype(linetype));
16412
+ if (color2 != null && color2 !== "none") {
16413
+ ctx.strokeStyle = color2;
16414
+ ctx.stroke(path2d);
16118
16415
  }
16119
16416
  }
16120
16417
  for (let path2 of Array.from(_path_data.keys()).reverse()) {
@@ -16146,7 +16443,7 @@ const _sfc_main$W = {
16146
16443
  };
16147
16444
  }
16148
16445
  };
16149
- const _sfc_main$V = {
16446
+ const _sfc_main$X = {
16150
16447
  __name: "CoreCanvasPoint",
16151
16448
  props: {
16152
16449
  extendX: { type: Number, default: 0 },
@@ -16188,55 +16485,53 @@ const _sfc_main$V = {
16188
16485
  ctx.scale(__props.dpi / 96, __props.dpi / 96);
16189
16486
  ctx.translate(__props.layout.l + __props.layout.fullWidth * __props.extendX, __props.layout.t + __props.layout.fullHeight * __props.extendY);
16190
16487
  let _path_data = /* @__PURE__ */ new Map(), path_data = /* @__PURE__ */ new Map();
16191
- for (const group of __props.data) {
16192
- for (let {
16193
- x: x2,
16194
- y: y2,
16195
- size = 6,
16196
- shape,
16197
- color: color2,
16198
- stroke,
16199
- linewidth,
16200
- linetype,
16201
- alpha: alpha2,
16202
- "translate-x": translateX = 0,
16203
- "translate-y": translateY = 0,
16204
- angle: angle2 = 0,
16205
- $raw
16206
- } of group) {
16207
- const { h: cx, v: cy } = __props.coord2pos({ x: x2, y: y2 });
16208
- if (typeof angle2 == "object") {
16209
- let { dx = 0, dy = 0 } = angle2;
16210
- let { h, v } = __props.coord2pos({ x: x2 + dx, y: y2 + dy });
16211
- angle2 = Math.atan2(v - cy, h - cx) * 180 / Math.PI;
16212
- }
16213
- const path2d = new Path2D();
16214
- if (String(shape).startsWith("path:")) {
16215
- path2d.addPath(
16216
- new Path2D(shape.slice(5)),
16217
- new DOMMatrix().translateSelf(cx + translateX, cy + translateY).rotate(angle2)
16218
- );
16219
- } else if (shape in paths) {
16220
- path2d.addPath(
16221
- new Path2D(paths[shape](size)),
16222
- new DOMMatrix().translate(cx + translateX, cy + translateY).rotate(angle2)
16223
- );
16224
- } else {
16225
- path2d.arc(cx + translateX, cy + translateY, size / 2, 0, Math.PI * 2);
16226
- }
16227
- _path_data.set(path2d, $raw);
16228
- ctx.lineWidth = linewidth;
16229
- ctx.globalAlpha = alpha2;
16230
- ctx.beginPath();
16231
- if (color2 !== "none") {
16232
- ctx.fillStyle = color2;
16233
- ctx.fill(path2d);
16234
- }
16235
- if (stroke != null) {
16236
- ctx.strokeStyle = stroke;
16237
- ctx.setLineDash(parseLinetype(linetype));
16238
- ctx.stroke(path2d);
16239
- }
16488
+ for (let {
16489
+ x: x2,
16490
+ y: y2,
16491
+ size = 6,
16492
+ shape: shape2,
16493
+ color: color2,
16494
+ stroke,
16495
+ linewidth,
16496
+ linetype,
16497
+ alpha: alpha2,
16498
+ "translate-x": translateX = 0,
16499
+ "translate-y": translateY = 0,
16500
+ angle: angle2 = 0,
16501
+ $raw
16502
+ } of __props.data) {
16503
+ const { h: cx, v: cy } = __props.coord2pos({ x: x2, y: y2 });
16504
+ if (typeof angle2 == "object") {
16505
+ let { dx = 0, dy = 0 } = angle2;
16506
+ let { h, v } = __props.coord2pos({ x: x2 + dx, y: y2 + dy });
16507
+ angle2 = Math.atan2(v - cy, h - cx) * 180 / Math.PI;
16508
+ }
16509
+ const path2d = new Path2D();
16510
+ if (String(shape2).startsWith("path:")) {
16511
+ path2d.addPath(
16512
+ new Path2D(shape2.slice(5)),
16513
+ new DOMMatrix().translateSelf(cx + translateX, cy + translateY).rotate(angle2)
16514
+ );
16515
+ } else if (shape2 in paths) {
16516
+ path2d.addPath(
16517
+ new Path2D(paths[shape2](size)),
16518
+ new DOMMatrix().translate(cx + translateX, cy + translateY).rotate(angle2)
16519
+ );
16520
+ } else {
16521
+ path2d.arc(cx + translateX, cy + translateY, size / 2, 0, Math.PI * 2);
16522
+ }
16523
+ _path_data.set(path2d, $raw);
16524
+ ctx.lineWidth = linewidth;
16525
+ ctx.globalAlpha = alpha2;
16526
+ ctx.beginPath();
16527
+ if (color2 !== "none") {
16528
+ ctx.fillStyle = color2;
16529
+ ctx.fill(path2d);
16530
+ }
16531
+ if (stroke != null && stroke !== "none") {
16532
+ ctx.strokeStyle = stroke;
16533
+ ctx.setLineDash(parseLinetype(linetype));
16534
+ ctx.stroke(path2d);
16240
16535
  }
16241
16536
  }
16242
16537
  for (let path2 of Array.from(_path_data.keys()).reverse()) {
@@ -16268,7 +16563,7 @@ const _sfc_main$V = {
16268
16563
  };
16269
16564
  }
16270
16565
  };
16271
- const _sfc_main$U = {
16566
+ const _sfc_main$W = {
16272
16567
  __name: "CoreCanvasPolygon",
16273
16568
  props: {
16274
16569
  extendX: { type: Number, default: 0 },
@@ -16302,38 +16597,36 @@ const _sfc_main$U = {
16302
16597
  ctx.scale(__props.dpi / 96, __props.dpi / 96);
16303
16598
  ctx.translate(__props.layout.l + __props.layout.fullWidth * __props.extendX, __props.layout.t + __props.layout.fullHeight * __props.extendY);
16304
16599
  let _path_data = /* @__PURE__ */ new Map(), path_data = /* @__PURE__ */ new Map();
16305
- for (const group of __props.data) {
16306
- for (let {
16307
- points,
16308
- fill,
16309
- color: color2,
16310
- linewidth,
16311
- linetype,
16312
- alpha: alpha2,
16313
- "translate-x": translateX = 0,
16314
- "translate-y": translateY = 0,
16315
- $raw
16316
- } of group) {
16317
- points = points.map((p) => (({ h: x2, v: y2 }) => ({ x: x2, y: y2 }))(__props.coord2pos(p))).filter((p) => p.x != null && p.y != null);
16318
- if (points.length === 0) continue;
16319
- const path2d = new Path2D();
16320
- path2d.moveTo(points[0].x + translateX, points[0].y + translateY);
16321
- for (let i = 1; i < points.length; i++) {
16322
- path2d.lineTo(points[i].x + translateX, points[i].y + translateY);
16323
- }
16324
- path2d.closePath();
16325
- _path_data.set(path2d, $raw);
16326
- ctx.lineWidth = linewidth;
16327
- ctx.globalAlpha = alpha2;
16328
- ctx.setLineDash(parseLinetype(linetype));
16329
- if (fill !== "none") {
16330
- ctx.fillStyle = fill;
16331
- ctx.fill(path2d);
16332
- }
16333
- if (color2 != null) {
16334
- ctx.strokeStyle = color2;
16335
- ctx.stroke(path2d);
16336
- }
16600
+ for (let {
16601
+ points,
16602
+ fill,
16603
+ color: color2,
16604
+ linewidth,
16605
+ linetype,
16606
+ alpha: alpha2,
16607
+ "translate-x": translateX = 0,
16608
+ "translate-y": translateY = 0,
16609
+ $raw
16610
+ } of __props.data) {
16611
+ points = points.map((p) => (({ h: x2, v: y2 }) => ({ x: x2, y: y2 }))(__props.coord2pos(p))).filter((p) => p.x != null && p.y != null);
16612
+ if (points.length === 0) continue;
16613
+ const path2d = new Path2D();
16614
+ path2d.moveTo(points[0].x + translateX, points[0].y + translateY);
16615
+ for (let i = 1; i < points.length; i++) {
16616
+ path2d.lineTo(points[i].x + translateX, points[i].y + translateY);
16617
+ }
16618
+ path2d.closePath();
16619
+ _path_data.set(path2d, $raw);
16620
+ ctx.lineWidth = linewidth;
16621
+ ctx.globalAlpha = alpha2;
16622
+ ctx.setLineDash(parseLinetype(linetype));
16623
+ if (fill !== "none") {
16624
+ ctx.fillStyle = fill;
16625
+ ctx.fill(path2d);
16626
+ }
16627
+ if (color2 != null && color2 !== "none") {
16628
+ ctx.strokeStyle = color2;
16629
+ ctx.stroke(path2d);
16337
16630
  }
16338
16631
  }
16339
16632
  for (let path2 of Array.from(_path_data.keys()).reverse()) {
@@ -16365,7 +16658,7 @@ const _sfc_main$U = {
16365
16658
  };
16366
16659
  }
16367
16660
  };
16368
- const _sfc_main$T = {
16661
+ const _sfc_main$V = {
16369
16662
  __name: "CoreCanvasRect",
16370
16663
  props: {
16371
16664
  extendX: { type: Number, default: 0 },
@@ -16399,36 +16692,34 @@ const _sfc_main$T = {
16399
16692
  ctx.scale(__props.dpi / 96, __props.dpi / 96);
16400
16693
  ctx.translate(__props.layout.l + __props.layout.fullWidth * __props.extendX, __props.layout.t + __props.layout.fullHeight * __props.extendY);
16401
16694
  let _path_data = /* @__PURE__ */ new Map(), path_data = /* @__PURE__ */ new Map();
16402
- for (const group of __props.data) {
16403
- for (let {
16404
- xmin,
16405
- xmax,
16406
- ymin,
16407
- ymax,
16408
- fill,
16409
- color: color2,
16410
- linewidth,
16411
- linetype,
16412
- alpha: alpha2,
16413
- "translate-x": translateX = 0,
16414
- "translate-y": translateY = 0,
16415
- $raw
16416
- } of group) {
16417
- const { hmin: x1, hmax: x2, vmin: y1, vmax: y2 } = __props.coord2pos({ xmin, xmax, ymin, ymax });
16418
- const path2d = new Path2D();
16419
- path2d.rect(x1 + translateX, y1 + translateY, x2 - x1, y2 - y1);
16420
- _path_data.set(path2d, $raw);
16421
- ctx.lineWidth = linewidth;
16422
- ctx.globalAlpha = alpha2;
16423
- ctx.setLineDash(parseLinetype(linetype));
16424
- if (fill !== "none") {
16425
- ctx.fillStyle = fill;
16426
- ctx.fill(path2d);
16427
- }
16428
- if (color2 != null) {
16429
- ctx.strokeStyle = color2;
16430
- ctx.stroke(path2d);
16431
- }
16695
+ for (let {
16696
+ xmin,
16697
+ xmax,
16698
+ ymin,
16699
+ ymax,
16700
+ fill,
16701
+ color: color2,
16702
+ linewidth,
16703
+ linetype,
16704
+ alpha: alpha2,
16705
+ "translate-x": translateX = 0,
16706
+ "translate-y": translateY = 0,
16707
+ $raw
16708
+ } of __props.data) {
16709
+ const { hmin: x1, hmax: x2, vmin: y1, vmax: y2 } = __props.coord2pos({ xmin, xmax, ymin, ymax });
16710
+ const path2d = new Path2D();
16711
+ path2d.rect(x1 + translateX, y1 + translateY, x2 - x1, y2 - y1);
16712
+ _path_data.set(path2d, $raw);
16713
+ ctx.lineWidth = linewidth;
16714
+ ctx.globalAlpha = alpha2;
16715
+ ctx.setLineDash(parseLinetype(linetype));
16716
+ if (fill !== "none") {
16717
+ ctx.fillStyle = fill;
16718
+ ctx.fill(path2d);
16719
+ }
16720
+ if (color2 !== "none" && color2 != null) {
16721
+ ctx.strokeStyle = color2;
16722
+ ctx.stroke(path2d);
16432
16723
  }
16433
16724
  }
16434
16725
  for (let path2 of Array.from(_path_data.keys()).reverse()) {
@@ -16460,7 +16751,7 @@ const _sfc_main$T = {
16460
16751
  };
16461
16752
  }
16462
16753
  };
16463
- const _sfc_main$S = {
16754
+ const _sfc_main$U = {
16464
16755
  __name: "CoreCanvasText",
16465
16756
  props: {
16466
16757
  extendX: { type: Number, default: 0 },
@@ -16494,77 +16785,75 @@ const _sfc_main$S = {
16494
16785
  ctx.scale(__props.dpi / 96, __props.dpi / 96);
16495
16786
  ctx.translate(__props.layout.l + __props.layout.fullWidth * __props.extendX, __props.layout.t + __props.layout.fullHeight * __props.extendY);
16496
16787
  let _path_data = /* @__PURE__ */ new Map(), path_data = /* @__PURE__ */ new Map();
16497
- for (const group of __props.data) {
16498
- for (let {
16499
- x: x2,
16500
- y: y2,
16501
- color: color2,
16502
- size = 4,
16503
- label = "",
16504
- title,
16505
- stroke,
16506
- linewidth,
16507
- linetype,
16508
- alpha: alpha2,
16509
- "anchor-x": anchorX,
16510
- "anchor-y": anchorY,
16511
- "dock-x": dockX,
16512
- "dock-y": dockY,
16513
- "translate-x": translateX = 0,
16514
- "translate-y": translateY = 0,
16515
- angle: angle2,
16516
- "text-length": textLength,
16517
- "font-family": fontFamily = "sans-serif",
16518
- $raw
16519
- } of group) {
16520
- ctx.save();
16521
- const { h: tx, v: ty } = __props.coord2pos({ x: x2, y: y2 });
16522
- ctx.textAlign = "center";
16523
- ctx.textBaseline = "middle";
16524
- ctx.lineWidth = linewidth;
16525
- ctx.globalAlpha = alpha2;
16526
- ctx.font = `${size * 4}px ${fontFamily}`;
16527
- ctx.setLineDash(parseLinetype(linetype));
16528
- ctx.translate(tx + translateX, ty + translateY);
16529
- let { width: w, fontBoundingBoxAscent: a, fontBoundingBoxDescent: d } = ctx.measureText(label), width = w, height = a + d;
16530
- if (typeof textLength == "object") {
16531
- let { x: lx = 0, y: ly = 0 } = textLength;
16532
- let { h: h1, v: v1 } = __props.coord2pos({ x: x2 + lx / 2, y: y2 + ly / 2 }), { h: h2, v: v2 } = __props.coord2pos({ x: x2 - lx / 2, y: y2 - ly / 2 });
16533
- width = Math.hypot(h1 - h2 || 0, v1 - v2 || 0);
16534
- } else if (textLength != null) {
16535
- width = textLength;
16536
- }
16537
- if (typeof angle2 == "object") {
16538
- let { dx = 0, dy = 0 } = angle2;
16539
- let { h, v } = __props.coord2pos({ x: x2 + dx, y: y2 + dy });
16540
- angle2 = Math.atan2(v - ty, h - tx) * 180 / Math.PI;
16541
- }
16542
- if (dockX != null || dockY != null) {
16543
- let alnX = { left: 0, center: 0.5, right: 1 }[dockX] ?? +(dockX ?? 0.5), alnY = { bottom: 0, center: 0.5, top: 1 }[dockY] ?? +(dockY ?? 0.5);
16544
- if (isNaN(alnX)) alnX = 0.5;
16545
- if (isNaN(alnY)) alnY = 0.5;
16546
- let w2 = width * Math.abs(Math.cos(angle2 * Math.PI / 180)) + height * Math.abs(Math.sin(angle2 * Math.PI / 180)), h = width * Math.abs(Math.sin(angle2 * Math.PI / 180)) + height * Math.abs(Math.cos(angle2 * Math.PI / 180));
16547
- ctx.translate(w2 * (0.5 - alnX), h * (alnY - 0.5));
16548
- ctx.rotate(angle2 * Math.PI / 180);
16549
- } else {
16550
- let alnX = { left: 0, center: 0.5, right: 1 }[anchorX] ?? +(anchorX ?? 0.5), alnY = { bottom: 0, center: 0.5, top: 1 }[anchorY] ?? +(anchorY ?? 0.5);
16551
- if (isNaN(alnX)) alnX = 0.5;
16552
- if (isNaN(alnY)) alnY = 0.5;
16553
- let w2 = width, h = height;
16554
- ctx.rotate(angle2 * Math.PI / 180);
16555
- ctx.translate(w2 * (0.5 - alnX), h * (alnY - 0.5));
16556
- }
16557
- if (width != w) ctx.scale(width / w, 1);
16558
- if (color2 !== "none") {
16559
- ctx.fillStyle = color2;
16560
- ctx.fillText(label, 0, 0);
16561
- }
16562
- if (stroke != null) {
16563
- ctx.strokeStyle = stroke;
16564
- ctx.strokeText(label, 0, 0);
16565
- }
16566
- ctx.restore();
16788
+ for (let {
16789
+ x: x2,
16790
+ y: y2,
16791
+ color: color2,
16792
+ size = 4,
16793
+ label = "",
16794
+ title,
16795
+ stroke,
16796
+ linewidth,
16797
+ linetype,
16798
+ alpha: alpha2,
16799
+ "anchor-x": anchorX,
16800
+ "anchor-y": anchorY,
16801
+ "dock-x": dockX,
16802
+ "dock-y": dockY,
16803
+ "translate-x": translateX = 0,
16804
+ "translate-y": translateY = 0,
16805
+ angle: angle2,
16806
+ "text-length": textLength,
16807
+ "font-family": fontFamily = "sans-serif",
16808
+ $raw
16809
+ } of __props.data) {
16810
+ ctx.save();
16811
+ const { h: tx, v: ty } = __props.coord2pos({ x: x2, y: y2 });
16812
+ ctx.textAlign = "center";
16813
+ ctx.textBaseline = "middle";
16814
+ ctx.lineWidth = linewidth;
16815
+ ctx.globalAlpha = alpha2;
16816
+ ctx.font = `${size * 4}px ${fontFamily}`;
16817
+ ctx.setLineDash(parseLinetype(linetype));
16818
+ ctx.translate(tx + translateX, ty + translateY);
16819
+ let { width: w, fontBoundingBoxAscent: a, fontBoundingBoxDescent: d } = ctx.measureText(label), width = w, height = a + d;
16820
+ if (typeof textLength == "object") {
16821
+ let { x: lx = 0, y: ly = 0 } = textLength;
16822
+ let { h: h1, v: v1 } = __props.coord2pos({ x: x2 + lx / 2, y: y2 + ly / 2 }), { h: h2, v: v2 } = __props.coord2pos({ x: x2 - lx / 2, y: y2 - ly / 2 });
16823
+ width = Math.hypot(h1 - h2 || 0, v1 - v2 || 0);
16824
+ } else if (textLength != null) {
16825
+ width = textLength;
16826
+ }
16827
+ if (typeof angle2 == "object") {
16828
+ let { dx = 0, dy = 0 } = angle2;
16829
+ let { h, v } = __props.coord2pos({ x: x2 + dx, y: y2 + dy });
16830
+ angle2 = Math.atan2(v - ty, h - tx) * 180 / Math.PI;
16831
+ }
16832
+ if (dockX != null || dockY != null) {
16833
+ let alnX = { left: 0, center: 0.5, right: 1 }[dockX] ?? +(dockX ?? 0.5), alnY = { bottom: 0, center: 0.5, top: 1 }[dockY] ?? +(dockY ?? 0.5);
16834
+ if (isNaN(alnX)) alnX = 0.5;
16835
+ if (isNaN(alnY)) alnY = 0.5;
16836
+ let w2 = width * Math.abs(Math.cos(angle2 * Math.PI / 180)) + height * Math.abs(Math.sin(angle2 * Math.PI / 180)), h = width * Math.abs(Math.sin(angle2 * Math.PI / 180)) + height * Math.abs(Math.cos(angle2 * Math.PI / 180));
16837
+ ctx.translate(w2 * (0.5 - alnX), h * (alnY - 0.5));
16838
+ ctx.rotate(angle2 * Math.PI / 180);
16839
+ } else {
16840
+ let alnX = { left: 0, center: 0.5, right: 1 }[anchorX] ?? +(anchorX ?? 0.5), alnY = { bottom: 0, center: 0.5, top: 1 }[anchorY] ?? +(anchorY ?? 0.5);
16841
+ if (isNaN(alnX)) alnX = 0.5;
16842
+ if (isNaN(alnY)) alnY = 0.5;
16843
+ let w2 = width, h = height;
16844
+ ctx.rotate(angle2 * Math.PI / 180);
16845
+ ctx.translate(w2 * (0.5 - alnX), h * (alnY - 0.5));
16846
+ }
16847
+ if (width != w) ctx.scale(width / w, 1);
16848
+ if (color2 !== "none") {
16849
+ ctx.fillStyle = color2;
16850
+ ctx.fillText(label, 0, 0);
16567
16851
  }
16852
+ if (stroke != null && stroke !== "none") {
16853
+ ctx.strokeStyle = stroke;
16854
+ ctx.strokeText(label, 0, 0);
16855
+ }
16856
+ ctx.restore();
16568
16857
  }
16569
16858
  for (let path2 of Array.from(_path_data.keys()).reverse()) {
16570
16859
  path_data.set(path2, _path_data.get(path2));
@@ -16595,7 +16884,7 @@ const _sfc_main$S = {
16595
16884
  };
16596
16885
  }
16597
16886
  };
16598
- const _sfc_main$R = {
16887
+ const _sfc_main$T = {
16599
16888
  __name: "CoreCanvasTextsegment",
16600
16889
  props: {
16601
16890
  extendX: { type: Number, default: 0 },
@@ -16629,100 +16918,98 @@ const _sfc_main$R = {
16629
16918
  ctx.scale(__props.dpi / 96, __props.dpi / 96);
16630
16919
  ctx.translate(__props.layout.l + __props.layout.fullWidth * __props.extendX, __props.layout.t + __props.layout.fullHeight * __props.extendY);
16631
16920
  let _path_data = /* @__PURE__ */ new Map(), path_data = /* @__PURE__ */ new Map();
16632
- for (const group of __props.data) {
16633
- for (let {
16634
- x: x2,
16635
- xend,
16636
- y: y2,
16637
- yend,
16638
- size = 4,
16639
- label = "",
16640
- title,
16641
- color: color2,
16642
- stroke,
16643
- linewidth,
16644
- linetype,
16645
- alpha: alpha2,
16646
- "translate-x": translateX = 0,
16647
- "translate-y": translateY = 0,
16648
- "text-length": textLength,
16649
- "font-family": fontFamily = "sans-serif",
16650
- "text-align": textAlign = "justify",
16651
- angle: angle2 = "auto",
16652
- inset = 0,
16653
- $raw
16654
- } of group) {
16655
- const { h: x1, v: y1 } = __props.coord2pos({ x: x2, y: y2 });
16656
- const { h: x22, v: y22 } = __props.coord2pos({ x: xend, y: yend });
16657
- ctx.save();
16658
- ctx.translate(translateX, translateY);
16659
- ctx.textBaseline = "middle";
16660
- ctx.lineWidth = linewidth;
16661
- ctx.globalAlpha = alpha2;
16662
- ctx.font = `${size * 4}px ${fontFamily}`;
16663
- ctx.setLineDash(parseLinetype(linetype));
16664
- if (["stretch", "pre", "start", "center", "end", "post"].includes(textAlign)) {
16665
- let radian = Math.atan2(y22 - y1, x22 - x1);
16666
- let text2 = String(label).replace(/\x01|\x02/g, "");
16667
- let insetX = Math.cos(radian) * inset, insetY = Math.sin(radian) * inset;
16668
- switch (textAlign) {
16669
- case "stretch":
16670
- case "center":
16671
- ctx.translate((x1 + x22) / 2, (y1 + y22) / 2);
16672
- ctx.textAlign = "center";
16673
- break;
16674
- case "pre":
16675
- ctx.translate(x1 - insetX, y1 - insetY);
16676
- ctx.textAlign = "end";
16677
- break;
16678
- case "start":
16679
- ctx.translate(x1 + insetX, y1 + insetY);
16680
- ctx.textAlign = "start";
16681
- break;
16682
- case "end":
16683
- ctx.translate(x22 - insetX, y22 - insetY);
16684
- ctx.textAlign = "end";
16685
- break;
16686
- case "post":
16687
- ctx.translate(x22 + insetX, y22 + insetY);
16688
- ctx.textAlign = "start";
16689
- break;
16690
- }
16921
+ for (let {
16922
+ x: x2,
16923
+ xend,
16924
+ y: y2,
16925
+ yend,
16926
+ size = 4,
16927
+ label = "",
16928
+ title,
16929
+ color: color2,
16930
+ stroke,
16931
+ linewidth,
16932
+ linetype,
16933
+ alpha: alpha2,
16934
+ "translate-x": translateX = 0,
16935
+ "translate-y": translateY = 0,
16936
+ "text-length": textLength,
16937
+ "font-family": fontFamily = "sans-serif",
16938
+ "text-align": textAlign = "justify",
16939
+ angle: angle2 = "auto",
16940
+ inset = 0,
16941
+ $raw
16942
+ } of __props.data) {
16943
+ const { h: x1, v: y1 } = __props.coord2pos({ x: x2, y: y2 });
16944
+ const { h: x22, v: y22 } = __props.coord2pos({ x: xend, y: yend });
16945
+ ctx.save();
16946
+ ctx.translate(translateX, translateY);
16947
+ ctx.textBaseline = "middle";
16948
+ ctx.lineWidth = linewidth;
16949
+ ctx.globalAlpha = alpha2;
16950
+ ctx.font = `${size * 4}px ${fontFamily}`;
16951
+ ctx.setLineDash(parseLinetype(linetype));
16952
+ if (["stretch", "pre", "start", "center", "end", "post"].includes(textAlign)) {
16953
+ let radian = Math.atan2(y22 - y1, x22 - x1);
16954
+ let text2 = String(label).replace(/\x01|\x02/g, "");
16955
+ let insetX = Math.cos(radian) * inset, insetY = Math.sin(radian) * inset;
16956
+ switch (textAlign) {
16957
+ case "stretch":
16958
+ case "center":
16959
+ ctx.translate((x1 + x22) / 2, (y1 + y22) / 2);
16960
+ ctx.textAlign = "center";
16961
+ break;
16962
+ case "pre":
16963
+ ctx.translate(x1 - insetX, y1 - insetY);
16964
+ ctx.textAlign = "end";
16965
+ break;
16966
+ case "start":
16967
+ ctx.translate(x1 + insetX, y1 + insetY);
16968
+ ctx.textAlign = "start";
16969
+ break;
16970
+ case "end":
16971
+ ctx.translate(x22 - insetX, y22 - insetY);
16972
+ ctx.textAlign = "end";
16973
+ break;
16974
+ case "post":
16975
+ ctx.translate(x22 + insetX, y22 + insetY);
16976
+ ctx.textAlign = "start";
16977
+ break;
16978
+ }
16979
+ ctx.rotate(radian);
16980
+ if (textAlign === "stretch") {
16981
+ ctx.scale(Math.hypot(x22 - x1 || 0, y22 - y1 || 0) / ctx.measureText(text2).width, 1);
16982
+ }
16983
+ if (color2 !== "none") {
16984
+ ctx.fillStyle = color2;
16985
+ ctx.fillText(text2, 0, 0);
16986
+ }
16987
+ if (stroke != null && stroke !== "none") {
16988
+ ctx.strokeStyle = stroke;
16989
+ ctx.strokeText(text2, 0, 0);
16990
+ }
16991
+ } else {
16992
+ let radian = angle2 === "auto" ? Math.atan2(y22 - y1, x22 - x1) : angle2 * Math.PI / 180;
16993
+ ctx.textAlign = "center";
16994
+ let parts = splitLabel(String(label));
16995
+ let dx = (x22 - x1) / (parts.length - 1 || 1), dy = (y22 - y1) / (parts.length - 1 || 1);
16996
+ for (let i = 0; i < parts.length; i++) {
16997
+ ctx.save();
16998
+ ctx.translate(x1 + i * dx, y1 + i * dy);
16691
16999
  ctx.rotate(radian);
16692
- if (textAlign === "stretch") {
16693
- ctx.scale(Math.hypot(x22 - x1 || 0, y22 - y1 || 0) / ctx.measureText(text2).width, 1);
16694
- }
17000
+ let text2 = parts[i];
16695
17001
  if (color2 !== "none") {
16696
17002
  ctx.fillStyle = color2;
16697
17003
  ctx.fillText(text2, 0, 0);
16698
17004
  }
16699
- if (stroke != null) {
17005
+ if (stroke != null && stroke !== "none") {
16700
17006
  ctx.strokeStyle = stroke;
16701
17007
  ctx.strokeText(text2, 0, 0);
16702
17008
  }
16703
- } else {
16704
- let radian = angle2 === "auto" ? Math.atan2(y22 - y1, x22 - x1) : angle2 * Math.PI / 180;
16705
- ctx.textAlign = "center";
16706
- let parts = splitLabel(String(label));
16707
- let dx = (x22 - x1) / (parts.length - 1 || 1), dy = (y22 - y1) / (parts.length - 1 || 1);
16708
- for (let i = 0; i < parts.length; i++) {
16709
- ctx.save();
16710
- ctx.translate(x1 + i * dx, y1 + i * dy);
16711
- ctx.rotate(radian);
16712
- let text2 = parts[i];
16713
- if (color2 !== "none") {
16714
- ctx.fillStyle = color2;
16715
- ctx.fillText(text2, 0, 0);
16716
- }
16717
- if (stroke != null) {
16718
- ctx.strokeStyle = stroke;
16719
- ctx.strokeText(text2, 0, 0);
16720
- }
16721
- ctx.restore();
16722
- }
17009
+ ctx.restore();
16723
17010
  }
16724
- ctx.restore();
16725
17011
  }
17012
+ ctx.restore();
16726
17013
  }
16727
17014
  for (let path2 of Array.from(_path_data.keys()).reverse()) {
16728
17015
  path_data.set(path2, _path_data.get(path2));
@@ -16769,19 +17056,20 @@ const _sfc_main$R = {
16769
17056
  };
16770
17057
  const canvas = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
16771
17058
  __proto__: null,
16772
- boxplot: _sfc_main$Z,
16773
- curve: _sfc_main$Y,
16774
- ellipse: _sfc_main$X,
16775
- line: _sfc_main$W,
16776
- point: _sfc_main$V,
16777
- polygon: _sfc_main$U,
16778
- rect: _sfc_main$T,
16779
- stick: _sfc_main$W,
16780
- text: _sfc_main$S,
16781
- textsegment: _sfc_main$R,
16782
- tile: _sfc_main$T
17059
+ boxplot: _sfc_main$$,
17060
+ curve: _sfc_main$_,
17061
+ ellipse: _sfc_main$Z,
17062
+ line: _sfc_main$Y,
17063
+ point: _sfc_main$X,
17064
+ polygon: _sfc_main$W,
17065
+ rect: _sfc_main$V,
17066
+ shape: _sfc_main$_,
17067
+ stick: _sfc_main$Y,
17068
+ text: _sfc_main$U,
17069
+ textsegment: _sfc_main$T,
17070
+ tile: _sfc_main$V
16783
17071
  }, Symbol.toStringTag, { value: "Module" }));
16784
- const _sfc_main$Q = {
17072
+ const _sfc_main$S = {
16785
17073
  __name: "CoreSvgBlank",
16786
17074
  props: {
16787
17075
  extendX: { type: Number, default: 0 },
@@ -16801,7 +17089,7 @@ const _sfc_main$Q = {
16801
17089
  }
16802
17090
  };
16803
17091
  const _hoisted_1$a = { key: 0 };
16804
- const _sfc_main$P = {
17092
+ const _sfc_main$R = {
16805
17093
  __name: "CoreTile",
16806
17094
  props: {
16807
17095
  x: { type: Number, default: 0 },
@@ -16843,7 +17131,7 @@ const _sfc_main$P = {
16843
17131
  };
16844
17132
  const _hoisted_1$9 = { key: 0 };
16845
17133
  const _hoisted_2$4 = { key: 0 };
16846
- const _sfc_main$O = {
17134
+ const _sfc_main$Q = {
16847
17135
  __name: "CorePoint",
16848
17136
  props: {
16849
17137
  x: { type: Number, default: 0 },
@@ -16902,7 +17190,7 @@ const _sfc_main$O = {
16902
17190
  }
16903
17191
  };
16904
17192
  const _hoisted_1$8 = { key: 0 };
16905
- const _sfc_main$N = {
17193
+ const _sfc_main$P = {
16906
17194
  __name: "CoreLine",
16907
17195
  props: {
16908
17196
  x1: { type: Number, default: 0 },
@@ -16940,7 +17228,7 @@ const _sfc_main$N = {
16940
17228
  };
16941
17229
  }
16942
17230
  };
16943
- const _sfc_main$M = {
17231
+ const _sfc_main$O = {
16944
17232
  __name: "CoreSvgBoxplot",
16945
17233
  props: {
16946
17234
  extendX: { type: Number, default: 0 },
@@ -16958,7 +17246,7 @@ const _sfc_main$M = {
16958
17246
  const emit = __emit;
16959
17247
  const binds = computed(() => {
16960
17248
  let xlim_min = -__props.layout.fullWidth * __props.extendX - __props.layout.l, xlim_max = __props.layout.fullWidth * (1 + __props.extendX) - __props.layout.l, ylim_min = -__props.layout.fullHeight * __props.extendY - __props.layout.t, ylim_max = __props.layout.fullHeight * (1 + __props.extendY) - __props.layout.t;
16961
- return __props.data.map((group) => group.map(({
17249
+ return Object.values(Object.groupBy(__props.data, (d) => d.$group)).map((group) => group.map(({
16962
17250
  x: x2,
16963
17251
  xmin,
16964
17252
  xmax,
@@ -17103,18 +17391,18 @@ const _sfc_main$M = {
17103
17391
  return openBlock(), createElementBlock("g", mergeProps({ ref_for: true }, { class: __props.groupClass, style: __props.groupStyle }), [
17104
17392
  (openBlock(true), createElementBlock(Fragment, null, renderList(group, ([vbinds, von]) => {
17105
17393
  return openBlock(), createElementBlock("g", null, [
17106
- createVNode(_sfc_main$N, mergeProps({ ref_for: true }, vbinds.line), null, 16),
17394
+ createVNode(_sfc_main$P, mergeProps({ ref_for: true }, vbinds.line), null, 16),
17107
17395
  _cache[0] || (_cache[0] = createTextVNode()),
17108
- createVNode(_sfc_main$P, mergeProps({ ref_for: true }, vbinds.rect, toHandlers(von)), null, 16),
17396
+ createVNode(_sfc_main$R, mergeProps({ ref_for: true }, vbinds.rect, toHandlers(von)), null, 16),
17109
17397
  _cache[1] || (_cache[1] = createTextVNode()),
17110
- createVNode(_sfc_main$N, mergeProps({ ref_for: true }, vbinds.midline), null, 16),
17398
+ createVNode(_sfc_main$P, mergeProps({ ref_for: true }, vbinds.midline), null, 16),
17111
17399
  _cache[2] || (_cache[2] = createTextVNode()),
17112
- createVNode(_sfc_main$N, mergeProps({ ref_for: true }, vbinds.uwisker), null, 16),
17400
+ createVNode(_sfc_main$P, mergeProps({ ref_for: true }, vbinds.uwisker), null, 16),
17113
17401
  _cache[3] || (_cache[3] = createTextVNode()),
17114
- createVNode(_sfc_main$N, mergeProps({ ref_for: true }, vbinds.lwisker), null, 16),
17402
+ createVNode(_sfc_main$P, mergeProps({ ref_for: true }, vbinds.lwisker), null, 16),
17115
17403
  _cache[4] || (_cache[4] = createTextVNode()),
17116
17404
  (openBlock(true), createElementBlock(Fragment, null, renderList(vbinds.outliers, ([vbind, von2]) => {
17117
- return openBlock(), createBlock(_sfc_main$O, mergeProps({ ref_for: true }, vbind, toHandlers(von2)), null, 16);
17405
+ return openBlock(), createBlock(_sfc_main$Q, mergeProps({ ref_for: true }, vbind, toHandlers(von2)), null, 16);
17118
17406
  }), 256))
17119
17407
  ]);
17120
17408
  }), 256))
@@ -17125,14 +17413,13 @@ const _sfc_main$M = {
17125
17413
  }
17126
17414
  };
17127
17415
  const _hoisted_1$7 = { key: 0 };
17128
- const _sfc_main$L = {
17416
+ const _sfc_main$N = {
17129
17417
  __name: "CoreCurve",
17130
17418
  props: {
17131
17419
  points: { type: Array, default: () => [] },
17132
17420
  interpolate: { default: "natural" },
17133
- fill: { type: String, default: "none" },
17421
+ fill: String,
17134
17422
  color: String,
17135
- stroke: String,
17136
17423
  linewidth: Number,
17137
17424
  linetype: String,
17138
17425
  alpha: { type: Number, default: 1 },
@@ -17157,8 +17444,11 @@ const _sfc_main$L = {
17157
17444
  });
17158
17445
  const interpolators = {
17159
17446
  cardinal,
17447
+ cardinalClosed,
17160
17448
  catmullRom,
17449
+ catmullRomClosed,
17161
17450
  linear: curveLinear,
17451
+ linearClosed,
17162
17452
  natural: natural$1
17163
17453
  };
17164
17454
  return (_ctx, _cache) => {
@@ -17168,7 +17458,7 @@ const _sfc_main$L = {
17168
17458
  };
17169
17459
  }
17170
17460
  };
17171
- const _sfc_main$K = {
17461
+ const _sfc_main$M = {
17172
17462
  __name: "CoreSvgCurve",
17173
17463
  props: {
17174
17464
  extendX: { type: Number, default: 0 },
@@ -17186,10 +17476,10 @@ const _sfc_main$K = {
17186
17476
  const emit = __emit;
17187
17477
  const binds = computed(() => {
17188
17478
  let xlim_min = -__props.layout.fullWidth * __props.extendX - __props.layout.l, xlim_max = __props.layout.fullWidth * (1 + __props.extendX) - __props.layout.l, ylim_min = -__props.layout.fullHeight * __props.extendY - __props.layout.t, ylim_max = __props.layout.fullHeight * (1 + __props.extendY) - __props.layout.t;
17189
- return __props.data.map((group) => group.map(({
17479
+ return Object.values(Object.groupBy(__props.data, (d) => d.$group)).map((group) => group.map(({
17190
17480
  points,
17191
- fill = "none",
17192
- color: color2 = "black",
17481
+ fill,
17482
+ color: color2,
17193
17483
  linewidth,
17194
17484
  linetype,
17195
17485
  alpha: alpha2,
@@ -17232,7 +17522,7 @@ const _sfc_main$K = {
17232
17522
  (openBlock(true), createElementBlock(Fragment, null, renderList(binds.value, (group) => {
17233
17523
  return openBlock(), createElementBlock("g", mergeProps({ ref_for: true }, { class: __props.groupClass, style: __props.groupStyle }), [
17234
17524
  (openBlock(true), createElementBlock(Fragment, null, renderList(group, ([vbind, von]) => {
17235
- return openBlock(), createBlock(_sfc_main$L, mergeProps({ ref_for: true }, vbind, toHandlers(von)), null, 16);
17525
+ return openBlock(), createBlock(_sfc_main$N, mergeProps({ ref_for: true }, vbind, toHandlers(von)), null, 16);
17236
17526
  }), 256))
17237
17527
  ], 16);
17238
17528
  }), 256))
@@ -17241,7 +17531,7 @@ const _sfc_main$K = {
17241
17531
  }
17242
17532
  };
17243
17533
  const _hoisted_1$6 = { key: 0 };
17244
- const _sfc_main$J = {
17534
+ const _sfc_main$L = {
17245
17535
  __name: "CoreEllipse",
17246
17536
  props: {
17247
17537
  cx: { type: Number, default: 0 },
@@ -17286,7 +17576,7 @@ const _sfc_main$J = {
17286
17576
  };
17287
17577
  }
17288
17578
  };
17289
- const _sfc_main$I = {
17579
+ const _sfc_main$K = {
17290
17580
  __name: "CoreSvgEllipse",
17291
17581
  props: {
17292
17582
  extendX: { type: Number, default: 0 },
@@ -17304,14 +17594,14 @@ const _sfc_main$I = {
17304
17594
  const emit = __emit;
17305
17595
  const binds = computed(() => {
17306
17596
  let xlim_min = -__props.layout.fullWidth * __props.extendX - __props.layout.l, xlim_max = __props.layout.fullWidth * (1 + __props.extendX) - __props.layout.l, ylim_min = -__props.layout.fullHeight * __props.extendY - __props.layout.t, ylim_max = __props.layout.fullHeight * (1 + __props.extendY) - __props.layout.t;
17307
- return __props.data.map((group) => group.map(({
17597
+ return Object.values(Object.groupBy(__props.data, (d) => d.$group)).map((group) => group.map(({
17308
17598
  cx,
17309
17599
  cy,
17310
17600
  A,
17311
17601
  B,
17312
17602
  C,
17313
- fill = "none",
17314
- color: color2 = "black",
17603
+ fill,
17604
+ color: color2,
17315
17605
  linewidth,
17316
17606
  linetype,
17317
17607
  alpha: alpha2,
@@ -17360,7 +17650,7 @@ const _sfc_main$I = {
17360
17650
  (openBlock(true), createElementBlock(Fragment, null, renderList(binds.value, (group) => {
17361
17651
  return openBlock(), createElementBlock("g", mergeProps({ ref_for: true }, { class: __props.groupClass, style: __props.groupStyle }), [
17362
17652
  (openBlock(true), createElementBlock(Fragment, null, renderList(group, ([vbind, von]) => {
17363
- return openBlock(), createBlock(_sfc_main$J, mergeProps({ ref_for: true }, vbind, toHandlers(von)), null, 16);
17653
+ return openBlock(), createBlock(_sfc_main$L, mergeProps({ ref_for: true }, vbind, toHandlers(von)), null, 16);
17364
17654
  }), 256))
17365
17655
  ], 16);
17366
17656
  }), 256))
@@ -17368,7 +17658,7 @@ const _sfc_main$I = {
17368
17658
  };
17369
17659
  }
17370
17660
  };
17371
- const _sfc_main$H = {
17661
+ const _sfc_main$J = {
17372
17662
  __name: "CoreSvgLine",
17373
17663
  props: {
17374
17664
  extendX: { type: Number, default: 0 },
@@ -17386,7 +17676,7 @@ const _sfc_main$H = {
17386
17676
  const emit = __emit;
17387
17677
  const binds = computed(() => {
17388
17678
  let xlim_min = -__props.layout.fullWidth * __props.extendX - __props.layout.l, xlim_max = __props.layout.fullWidth * (1 + __props.extendX) - __props.layout.l, ylim_min = -__props.layout.fullHeight * __props.extendY - __props.layout.t, ylim_max = __props.layout.fullHeight * (1 + __props.extendY) - __props.layout.t;
17389
- return __props.data.map((group) => group.map(({
17679
+ return Object.values(Object.groupBy(__props.data, (d) => d.$group)).map((group) => group.map(({
17390
17680
  x: x2,
17391
17681
  y: y2,
17392
17682
  xend,
@@ -17435,7 +17725,7 @@ const _sfc_main$H = {
17435
17725
  (openBlock(true), createElementBlock(Fragment, null, renderList(binds.value, (group) => {
17436
17726
  return openBlock(), createElementBlock("g", mergeProps({ ref_for: true }, { class: __props.groupClass, style: __props.groupStyle }), [
17437
17727
  (openBlock(true), createElementBlock(Fragment, null, renderList(group, ([vbind, von]) => {
17438
- return openBlock(), createBlock(_sfc_main$N, mergeProps({ ref_for: true }, vbind, toHandlers(von)), null, 16);
17728
+ return openBlock(), createBlock(_sfc_main$P, mergeProps({ ref_for: true }, vbind, toHandlers(von)), null, 16);
17439
17729
  }), 256))
17440
17730
  ], 16);
17441
17731
  }), 256))
@@ -17443,7 +17733,7 @@ const _sfc_main$H = {
17443
17733
  };
17444
17734
  }
17445
17735
  };
17446
- const _sfc_main$G = {
17736
+ const _sfc_main$I = {
17447
17737
  __name: "CoreSvgMarkdown",
17448
17738
  props: {
17449
17739
  extendX: { type: Number, default: 0 },
@@ -17461,7 +17751,7 @@ const _sfc_main$G = {
17461
17751
  const emit = __emit;
17462
17752
  const binds = computed(() => {
17463
17753
  let xlim_min = -__props.layout.fullWidth * __props.extendX - __props.layout.l, xlim_max = __props.layout.fullWidth * (1 + __props.extendX) - __props.layout.l, ylim_min = -__props.layout.fullHeight * __props.extendY - __props.layout.t, ylim_max = __props.layout.fullHeight * (1 + __props.extendY) - __props.layout.t;
17464
- return __props.data.map((group) => group.map(({
17754
+ return Object.values(Object.groupBy(__props.data, (d) => d.$group)).map((group) => group.map(({
17465
17755
  x: x2,
17466
17756
  y: y2,
17467
17757
  size = 4,
@@ -17534,7 +17824,7 @@ const _sfc_main$G = {
17534
17824
  (openBlock(true), createElementBlock(Fragment, null, renderList(binds.value, (group) => {
17535
17825
  return openBlock(), createElementBlock("g", mergeProps({ ref_for: true }, { class: __props.groupClass, style: __props.groupStyle }), [
17536
17826
  (openBlock(true), createElementBlock(Fragment, null, renderList(group, ([vbind, von]) => {
17537
- return openBlock(), createBlock(_sfc_main$14, mergeProps({ ref_for: true }, vbind, toHandlers(von)), null, 16);
17827
+ return openBlock(), createBlock(_sfc_main$16, mergeProps({ ref_for: true }, vbind, toHandlers(von)), null, 16);
17538
17828
  }), 256))
17539
17829
  ], 16);
17540
17830
  }), 256))
@@ -17542,7 +17832,7 @@ const _sfc_main$G = {
17542
17832
  };
17543
17833
  }
17544
17834
  };
17545
- const _sfc_main$F = {
17835
+ const _sfc_main$H = {
17546
17836
  __name: "CoreSvgMarkdownsegment",
17547
17837
  props: {
17548
17838
  extendX: { type: Number, default: 0 },
@@ -17560,7 +17850,7 @@ const _sfc_main$F = {
17560
17850
  const emit = __emit;
17561
17851
  const binds = computed(() => {
17562
17852
  let xlim_min = -__props.layout.fullWidth * __props.extendX - __props.layout.l, xlim_max = __props.layout.fullWidth * (1 + __props.extendX) - __props.layout.l, ylim_min = -__props.layout.fullHeight * __props.extendY - __props.layout.t, ylim_max = __props.layout.fullHeight * (1 + __props.extendY) - __props.layout.t;
17563
- return __props.data.map((group) => group.map(({
17853
+ return Object.values(Object.groupBy(__props.data, (d) => d.$group)).map((group) => group.map(({
17564
17854
  x: x2,
17565
17855
  xend,
17566
17856
  y: y2,
@@ -17655,7 +17945,7 @@ const _sfc_main$F = {
17655
17945
  (openBlock(true), createElementBlock(Fragment, null, renderList(binds.value, (group) => {
17656
17946
  return openBlock(), createElementBlock("g", mergeProps({ ref_for: true }, { class: __props.groupClass, style: __props.groupStyle }), [
17657
17947
  (openBlock(true), createElementBlock(Fragment, null, renderList(group, ([vbind, von]) => {
17658
- return openBlock(), createBlock(_sfc_main$14, mergeProps({ ref_for: true }, vbind, toHandlers(von)), null, 16);
17948
+ return openBlock(), createBlock(_sfc_main$16, mergeProps({ ref_for: true }, vbind, toHandlers(von)), null, 16);
17659
17949
  }), 256))
17660
17950
  ], 16);
17661
17951
  }), 256))
@@ -17663,7 +17953,7 @@ const _sfc_main$F = {
17663
17953
  };
17664
17954
  }
17665
17955
  };
17666
- const _sfc_main$E = {
17956
+ const _sfc_main$G = {
17667
17957
  __name: "CoreSvgPoint",
17668
17958
  props: {
17669
17959
  extendX: { type: Number, default: 0 },
@@ -17681,10 +17971,10 @@ const _sfc_main$E = {
17681
17971
  const emit = __emit;
17682
17972
  const binds = computed(() => {
17683
17973
  let xlim_min = -__props.layout.fullWidth * __props.extendX - __props.layout.l, xlim_max = __props.layout.fullWidth * (1 + __props.extendX) - __props.layout.l, ylim_min = -__props.layout.fullHeight * __props.extendY - __props.layout.t, ylim_max = __props.layout.fullHeight * (1 + __props.extendY) - __props.layout.t;
17684
- return __props.data.map((group) => group.map(({
17974
+ return Object.values(Object.groupBy(__props.data, (d) => d.$group)).map((group) => group.map(({
17685
17975
  x: x2,
17686
17976
  y: y2,
17687
- shape,
17977
+ shape: shape2,
17688
17978
  size = 6,
17689
17979
  color: color2,
17690
17980
  stroke,
@@ -17709,7 +17999,7 @@ const _sfc_main$E = {
17709
17999
  let vbind = {
17710
18000
  x: cx,
17711
18001
  y: cy,
17712
- shape,
18002
+ shape: shape2,
17713
18003
  size,
17714
18004
  color: color2,
17715
18005
  stroke,
@@ -17734,7 +18024,7 @@ const _sfc_main$E = {
17734
18024
  (openBlock(true), createElementBlock(Fragment, null, renderList(binds.value, (group) => {
17735
18025
  return openBlock(), createElementBlock("g", mergeProps({ ref_for: true }, { class: __props.groupClass, style: __props.groupStyle }), [
17736
18026
  (openBlock(true), createElementBlock(Fragment, null, renderList(group, ([vbind, von]) => {
17737
- return openBlock(), createBlock(_sfc_main$O, mergeProps({ ref_for: true }, vbind, toHandlers(von)), null, 16);
18027
+ return openBlock(), createBlock(_sfc_main$Q, mergeProps({ ref_for: true }, vbind, toHandlers(von)), null, 16);
17738
18028
  }), 256))
17739
18029
  ], 16);
17740
18030
  }), 256))
@@ -17743,7 +18033,7 @@ const _sfc_main$E = {
17743
18033
  }
17744
18034
  };
17745
18035
  const _hoisted_1$5 = { key: 0 };
17746
- const _sfc_main$D = {
18036
+ const _sfc_main$F = {
17747
18037
  __name: "CorePolygon",
17748
18038
  props: {
17749
18039
  points: { type: Array, default: () => [] },
@@ -17777,7 +18067,7 @@ const _sfc_main$D = {
17777
18067
  };
17778
18068
  }
17779
18069
  };
17780
- const _sfc_main$C = {
18070
+ const _sfc_main$E = {
17781
18071
  __name: "CoreSvgPolygon",
17782
18072
  props: {
17783
18073
  extendX: { type: Number, default: 0 },
@@ -17795,7 +18085,7 @@ const _sfc_main$C = {
17795
18085
  const emit = __emit;
17796
18086
  const binds = computed(() => {
17797
18087
  let xlim_min = -__props.layout.fullWidth * __props.extendX - __props.layout.l, xlim_max = __props.layout.fullWidth * (1 + __props.extendX) - __props.layout.l, ylim_min = -__props.layout.fullHeight * __props.extendY - __props.layout.t, ylim_max = __props.layout.fullHeight * (1 + __props.extendY) - __props.layout.t;
17798
- return __props.data.map((group) => group.map(({
18088
+ return Object.values(Object.groupBy(__props.data, (d) => d.$group)).map((group) => group.map(({
17799
18089
  points,
17800
18090
  fill,
17801
18091
  color: color2,
@@ -17841,7 +18131,7 @@ const _sfc_main$C = {
17841
18131
  (openBlock(true), createElementBlock(Fragment, null, renderList(binds.value, (group) => {
17842
18132
  return openBlock(), createElementBlock("g", mergeProps({ ref_for: true }, { class: __props.groupClass, style: __props.groupStyle }), [
17843
18133
  (openBlock(true), createElementBlock(Fragment, null, renderList(group, ([vbind, von]) => {
17844
- return openBlock(), createBlock(_sfc_main$D, mergeProps({ ref_for: true }, vbind, toHandlers(von)), null, 16);
18134
+ return openBlock(), createBlock(_sfc_main$F, mergeProps({ ref_for: true }, vbind, toHandlers(von)), null, 16);
17845
18135
  }), 256))
17846
18136
  ], 16);
17847
18137
  }), 256))
@@ -17849,7 +18139,7 @@ const _sfc_main$C = {
17849
18139
  };
17850
18140
  }
17851
18141
  };
17852
- const _sfc_main$B = {
18142
+ const _sfc_main$D = {
17853
18143
  __name: "CoreSvgRect",
17854
18144
  props: {
17855
18145
  extendX: { type: Number, default: 0 },
@@ -17867,12 +18157,12 @@ const _sfc_main$B = {
17867
18157
  const emit = __emit;
17868
18158
  const binds = computed(() => {
17869
18159
  let xlim_min = -__props.layout.fullWidth * __props.extendX - __props.layout.l, xlim_max = __props.layout.fullWidth * (1 + __props.extendX) - __props.layout.l, ylim_min = -__props.layout.fullHeight * __props.extendY - __props.layout.t, ylim_max = __props.layout.fullHeight * (1 + __props.extendY) - __props.layout.t;
17870
- return __props.data.map((group) => group.map(({
18160
+ return Object.values(Object.groupBy(__props.data, (d) => d.$group)).map((group) => group.map(({
17871
18161
  xmin,
17872
18162
  xmax,
17873
18163
  ymin,
17874
18164
  ymax,
17875
- fill = "black",
18165
+ fill,
17876
18166
  color: color2,
17877
18167
  linewidth,
17878
18168
  linetype,
@@ -17913,7 +18203,7 @@ const _sfc_main$B = {
17913
18203
  (openBlock(true), createElementBlock(Fragment, null, renderList(binds.value, (group) => {
17914
18204
  return openBlock(), createElementBlock("g", mergeProps({ ref_for: true }, { class: __props.groupClass, style: __props.groupStyle }), [
17915
18205
  (openBlock(true), createElementBlock(Fragment, null, renderList(group, ([vbind, von]) => {
17916
- return openBlock(), createBlock(_sfc_main$P, mergeProps({ ref_for: true }, vbind, toHandlers(von)), null, 16);
18206
+ return openBlock(), createBlock(_sfc_main$R, mergeProps({ ref_for: true }, vbind, toHandlers(von)), null, 16);
17917
18207
  }), 256))
17918
18208
  ], 16);
17919
18209
  }), 256))
@@ -17921,7 +18211,7 @@ const _sfc_main$B = {
17921
18211
  };
17922
18212
  }
17923
18213
  };
17924
- const _sfc_main$A = {
18214
+ const _sfc_main$C = {
17925
18215
  __name: "CoreSvgText",
17926
18216
  props: {
17927
18217
  extendX: { type: Number, default: 0 },
@@ -17939,7 +18229,7 @@ const _sfc_main$A = {
17939
18229
  const emit = __emit;
17940
18230
  const binds = computed(() => {
17941
18231
  let xlim_min = -__props.layout.fullWidth * __props.extendX - __props.layout.l, xlim_max = __props.layout.fullWidth * (1 + __props.extendX) - __props.layout.l, ylim_min = -__props.layout.fullHeight * __props.extendY - __props.layout.t, ylim_max = __props.layout.fullHeight * (1 + __props.extendY) - __props.layout.t;
17942
- return __props.data.map((group) => group.map(({
18232
+ return Object.values(Object.groupBy(__props.data, (d) => d.$group)).map((group) => group.map(({
17943
18233
  x: x2,
17944
18234
  y: y2,
17945
18235
  size = 4,
@@ -18012,7 +18302,7 @@ const _sfc_main$A = {
18012
18302
  (openBlock(true), createElementBlock(Fragment, null, renderList(binds.value, (group) => {
18013
18303
  return openBlock(), createElementBlock("g", mergeProps({ ref_for: true }, { class: __props.groupClass, style: __props.groupStyle }), [
18014
18304
  (openBlock(true), createElementBlock(Fragment, null, renderList(group, ([vbind, von]) => {
18015
- return openBlock(), createBlock(_sfc_main$15, mergeProps({ ref_for: true }, vbind, toHandlers(von)), null, 16);
18305
+ return openBlock(), createBlock(_sfc_main$17, mergeProps({ ref_for: true }, vbind, toHandlers(von)), null, 16);
18016
18306
  }), 256))
18017
18307
  ], 16);
18018
18308
  }), 256))
@@ -18020,7 +18310,7 @@ const _sfc_main$A = {
18020
18310
  };
18021
18311
  }
18022
18312
  };
18023
- const _sfc_main$z = {
18313
+ const _sfc_main$B = {
18024
18314
  __name: "CoreSvgTextsegment",
18025
18315
  props: {
18026
18316
  extendX: { type: Number, default: 0 },
@@ -18038,7 +18328,7 @@ const _sfc_main$z = {
18038
18328
  const emit = __emit;
18039
18329
  const binds = computed(() => {
18040
18330
  let xlim_min = -__props.layout.fullWidth * __props.extendX - __props.layout.l, xlim_max = __props.layout.fullWidth * (1 + __props.extendX) - __props.layout.l, ylim_min = -__props.layout.fullHeight * __props.extendY - __props.layout.t, ylim_max = __props.layout.fullHeight * (1 + __props.extendY) - __props.layout.t;
18041
- return __props.data.map((group) => group.map(({
18331
+ return Object.values(Object.groupBy(__props.data, (d) => d.$group)).map((group) => group.map(({
18042
18332
  x: x2,
18043
18333
  xend,
18044
18334
  y: y2,
@@ -18199,22 +18489,23 @@ const _sfc_main$z = {
18199
18489
  };
18200
18490
  const svg = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
18201
18491
  __proto__: null,
18202
- blank: _sfc_main$Q,
18203
- boxplot: _sfc_main$M,
18204
- curve: _sfc_main$K,
18205
- ellipse: _sfc_main$I,
18206
- line: _sfc_main$H,
18207
- markdown: _sfc_main$G,
18208
- markdownsegment: _sfc_main$F,
18209
- point: _sfc_main$E,
18210
- polygon: _sfc_main$C,
18211
- rect: _sfc_main$B,
18212
- stick: _sfc_main$H,
18213
- text: _sfc_main$A,
18214
- textsegment: _sfc_main$z,
18215
- tile: _sfc_main$B
18492
+ blank: _sfc_main$S,
18493
+ boxplot: _sfc_main$O,
18494
+ curve: _sfc_main$M,
18495
+ ellipse: _sfc_main$K,
18496
+ line: _sfc_main$J,
18497
+ markdown: _sfc_main$I,
18498
+ markdownsegment: _sfc_main$H,
18499
+ point: _sfc_main$G,
18500
+ polygon: _sfc_main$E,
18501
+ rect: _sfc_main$D,
18502
+ shape: _sfc_main$M,
18503
+ stick: _sfc_main$J,
18504
+ text: _sfc_main$C,
18505
+ textsegment: _sfc_main$B,
18506
+ tile: _sfc_main$D
18216
18507
  }, Symbol.toStringTag, { value: "Module" }));
18217
- const _sfc_main$y = {
18508
+ const _sfc_main$A = {
18218
18509
  __name: "CoreLayer",
18219
18510
  props: {
18220
18511
  data: Object,
@@ -18255,7 +18546,7 @@ const _sfc_main$y = {
18255
18546
  };
18256
18547
  const _hoisted_1$4 = { key: 0 };
18257
18548
  const _hoisted_2$3 = ["onPointerdown"];
18258
- const _sfc_main$x = {
18549
+ const _sfc_main$z = {
18259
18550
  __name: "CoreSelection",
18260
18551
  props: /* @__PURE__ */ mergeModels({
18261
18552
  coord2pos: Function,
@@ -18512,7 +18803,7 @@ const _sfc_main$x = {
18512
18803
  const _hoisted_1$3 = ["height", "width"];
18513
18804
  const _hoisted_2$2 = ["y1", "y2"];
18514
18805
  const _hoisted_3$2 = ["y"];
18515
- const _sfc_main$w = {
18806
+ const _sfc_main$y = {
18516
18807
  __name: "CoreGuideGradientbar",
18517
18808
  props: {
18518
18809
  scales: Array,
@@ -18552,7 +18843,7 @@ const _sfc_main$w = {
18552
18843
  ref: "svg"
18553
18844
  }, [
18554
18845
  (openBlock(true), createElementBlock(Fragment, null, renderList(gradient_values.value, (v, i) => {
18555
- return openBlock(), createBlock(_sfc_main$P, mergeProps({
18846
+ return openBlock(), createBlock(_sfc_main$R, mergeProps({
18556
18847
  width: 10,
18557
18848
  height: 3.1,
18558
18849
  x: 10,
@@ -18584,12 +18875,12 @@ const _sfc_main$w = {
18584
18875
  };
18585
18876
  const element = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
18586
18877
  __proto__: null,
18587
- curve: _sfc_main$L,
18588
- line: _sfc_main$N,
18589
- point: _sfc_main$O,
18590
- polygon: _sfc_main$D,
18591
- text: _sfc_main$15,
18592
- tile: _sfc_main$P
18878
+ curve: _sfc_main$N,
18879
+ line: _sfc_main$P,
18880
+ point: _sfc_main$Q,
18881
+ polygon: _sfc_main$F,
18882
+ text: _sfc_main$17,
18883
+ tile: _sfc_main$R
18593
18884
  }, Symbol.toStringTag, { value: "Module" }));
18594
18885
  const _hoisted_1$2 = ["height", "width"];
18595
18886
  const _hoisted_2$1 = ["transform"];
@@ -18599,7 +18890,7 @@ const _hoisted_4$1 = {
18599
18890
  y: "10",
18600
18891
  "alignment-baseline": "central"
18601
18892
  };
18602
- const _sfc_main$v = {
18893
+ const _sfc_main$x = {
18603
18894
  __name: "CoreGuideLegendkey",
18604
18895
  props: {
18605
18896
  scales: Array,
@@ -18629,7 +18920,7 @@ const _sfc_main$v = {
18629
18920
  const geoms = computed(() => {
18630
18921
  let { text: text2, line: line2, point: point2, tile: tile2 } = __props.appearances;
18631
18922
  let result = {};
18632
- if (tile2 != null) result.tile = { width: 10, height: 10, fill: "transparent", ...tile2 };
18923
+ if (tile2 != null) result.tile = { width: 10, height: 10, fill: "none", ...tile2 };
18633
18924
  if (line2 != null) result.line = { x1: -5, x2: 5, color: "black", ...line2 };
18634
18925
  if (point2 != null) result.point = { size: 6, ...point2 };
18635
18926
  if (text2 != null) result.text = { size: 4, text: "a", ...text2 };
@@ -18666,7 +18957,7 @@ const _sfc_main$v = {
18666
18957
  };
18667
18958
  }
18668
18959
  };
18669
- const _sfc_main$u = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
18960
+ const _sfc_main$w = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
18670
18961
  __name: "CoreGuide",
18671
18962
  props: {
18672
18963
  scales: Array,
@@ -18674,8 +18965,8 @@ const _sfc_main$u = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
18674
18965
  },
18675
18966
  setup(__props) {
18676
18967
  const guide = {
18677
- legendkey: _sfc_main$v,
18678
- gradientbar: _sfc_main$w
18968
+ legendkey: _sfc_main$x,
18969
+ gradientbar: _sfc_main$y
18679
18970
  };
18680
18971
  const title = computed(() => {
18681
18972
  return __props.scales.reduce((v, [s]) => v ?? s.title, null) ?? __props.scales.reduce((v, [s]) => v ?? s._title, null);
@@ -18719,7 +19010,7 @@ const _sfc_main$u = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
18719
19010
  };
18720
19011
  }
18721
19012
  });
18722
- const _sfc_main$t = {
19013
+ const _sfc_main$v = {
18723
19014
  __name: "CoreLegend",
18724
19015
  props: {
18725
19016
  theme: { type: Object, default: () => ({}) },
@@ -18753,7 +19044,7 @@ const _sfc_main$t = {
18753
19044
  style: normalizeStyle({ gap: __props.theme.spacing + "px" })
18754
19045
  }, [
18755
19046
  (openBlock(true), createElementBlock(Fragment, null, renderList(guides.value, ([[key, type], scales]) => {
18756
- return openBlock(), createBlock(_sfc_main$u, {
19047
+ return openBlock(), createBlock(_sfc_main$w, {
18757
19048
  key,
18758
19049
  type,
18759
19050
  scales
@@ -18771,7 +19062,7 @@ const _hoisted_5 = ["transform", "clip-path"];
18771
19062
  const _hoisted_6 = ["transform"];
18772
19063
  const _hoisted_7 = ["clip-path"];
18773
19064
  const _hoisted_8 = { key: 1 };
18774
- const _sfc_main$s = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
19065
+ const _sfc_main$u = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
18775
19066
  __name: "CorePlot",
18776
19067
  props: /* @__PURE__ */ mergeModels({
18777
19068
  schema: Object,
@@ -19470,7 +19761,7 @@ const _sfc_main$s = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
19470
19761
  transform: `translate(${unref(panel).left}, ${unref(panel).top})`,
19471
19762
  style: { "pointer-events": "none" }
19472
19763
  }, [
19473
- createVNode(_sfc_main$$, {
19764
+ createVNode(_sfc_main$11, {
19474
19765
  breaks: gridBreaks.value.h,
19475
19766
  layout: unref(innerRect),
19476
19767
  activeTransform: activeTransform.value,
@@ -19478,7 +19769,7 @@ const _sfc_main$s = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
19478
19769
  transition: transition.value
19479
19770
  }, null, 8, ["breaks", "layout", "activeTransform", "transition"]),
19480
19771
  _cache[2] || (_cache[2] = createTextVNode()),
19481
- createVNode(_sfc_main$_, {
19772
+ createVNode(_sfc_main$10, {
19482
19773
  breaks: gridBreaks.value.v,
19483
19774
  layout: unref(innerRect),
19484
19775
  activeTransform: activeTransform.value,
@@ -19495,7 +19786,7 @@ const _sfc_main$s = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
19495
19786
  style: { transition: transition.value }
19496
19787
  }), [
19497
19788
  (openBlock(true), createElementBlock(Fragment, null, renderList(vplot.value.layers, (layer) => {
19498
- return openBlock(), createBlock(_sfc_main$y, mergeProps({
19789
+ return openBlock(), createBlock(_sfc_main$A, mergeProps({
19499
19790
  ref_for: true,
19500
19791
  ref_key: "layers",
19501
19792
  ref: layers,
@@ -19512,7 +19803,7 @@ const _sfc_main$s = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
19512
19803
  ], 16),
19513
19804
  _cache[3] || (_cache[3] = createTextVNode()),
19514
19805
  (openBlock(true), createElementBlock(Fragment, null, renderList(props.selections, (sel) => {
19515
- return openBlock(), createBlock(_sfc_main$x, mergeProps({
19806
+ return openBlock(), createBlock(_sfc_main$z, mergeProps({
19516
19807
  coord2pos,
19517
19808
  pos2coord,
19518
19809
  layout: unref(innerRect),
@@ -19523,7 +19814,7 @@ const _sfc_main$s = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
19523
19814
  }, { ref_for: true }, sel, { flip: __props.flip }), null, 16, ["layout", "transition", "activeTransform", "flip"]);
19524
19815
  }), 256)),
19525
19816
  _cache[4] || (_cache[4] = createTextVNode()),
19526
- createVNode(_sfc_main$x, {
19817
+ createVNode(_sfc_main$z, {
19527
19818
  coord2pos,
19528
19819
  pos2coord,
19529
19820
  layout: unref(innerRect),
@@ -19539,7 +19830,7 @@ const _sfc_main$s = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
19539
19830
  transform: `translate(${unref(panel).left}, ${unref(panel).top})`
19540
19831
  }, [
19541
19832
  (openBlock(true), createElementBlock(Fragment, null, renderList(axes.value.filter((a) => typeof a.bind.position !== "number"), (axis) => {
19542
- return openBlock(), createBlock(_sfc_main$10, mergeProps({ ref_for: true }, axis.bind, toHandlers(axis.on), {
19833
+ return openBlock(), createBlock(_sfc_main$12, mergeProps({ ref_for: true }, axis.bind, toHandlers(axis.on), {
19543
19834
  transition: transition.value,
19544
19835
  "onUpdate:transition": _cache[0] || (_cache[0] = ($event) => transition.value = $event),
19545
19836
  activeTransform: activeTransform.value
@@ -19550,7 +19841,7 @@ const _sfc_main$s = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
19550
19841
  "clip-path": props.clip ? `url(#${unref(vid)}-plot-clip)` : null
19551
19842
  }, [
19552
19843
  (openBlock(true), createElementBlock(Fragment, null, renderList(axes.value.filter((a) => typeof a.bind.position === "number"), (axis) => {
19553
- return openBlock(), createBlock(_sfc_main$10, mergeProps({ ref_for: true }, axis.bind, toHandlers(axis.on), {
19844
+ return openBlock(), createBlock(_sfc_main$12, mergeProps({ ref_for: true }, axis.bind, toHandlers(axis.on), {
19554
19845
  transition: transition.value,
19555
19846
  "onUpdate:transition": _cache[1] || (_cache[1] = ($event) => transition.value = $event),
19556
19847
  activeTransform: activeTransform.value
@@ -19566,7 +19857,7 @@ const _sfc_main$s = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
19566
19857
  defer: "",
19567
19858
  to: props.legendTeleport
19568
19859
  }, [
19569
- createVNode(_sfc_main$t, {
19860
+ createVNode(_sfc_main$v, {
19570
19861
  scales: vplot.value?.scales,
19571
19862
  theme: __props.theme.legend
19572
19863
  }, null, 8, ["scales", "theme"])
@@ -19576,14 +19867,14 @@ const _sfc_main$s = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
19576
19867
  };
19577
19868
  }
19578
19869
  });
19579
- const _sfc_main$r = {
19870
+ const _sfc_main$t = {
19580
19871
  $_type: "action",
19581
19872
  $_props: {}
19582
19873
  };
19583
- const _sfc_main$q = {
19874
+ const _sfc_main$s = {
19584
19875
  $_type: "layer"
19585
19876
  };
19586
- const _sfc_main$p = {
19877
+ const _sfc_main$r = {
19587
19878
  $_props: {
19588
19879
  geom: "tile",
19589
19880
  stat: "bar"
@@ -19591,45 +19882,52 @@ const _sfc_main$p = {
19591
19882
  $_type: "layer",
19592
19883
  $_argnames: ["width", "height", "position"]
19593
19884
  };
19594
- const _sfc_main$o = {
19885
+ const _sfc_main$q = {
19595
19886
  $_props: {
19596
19887
  geom: "blank",
19597
19888
  stat: "identity"
19598
19889
  },
19599
19890
  $_type: "layer"
19600
19891
  };
19601
- const _sfc_main$n = {
19892
+ const _sfc_main$p = {
19602
19893
  $_props: {
19603
19894
  geom: "boxplot",
19604
19895
  stat: "boxplot"
19605
19896
  },
19606
- $_type: "layer"
19897
+ $_type: "layer",
19898
+ $_argnames: ["width", "height", "position"]
19607
19899
  };
19608
- const _sfc_main$m = {
19900
+ const _sfc_main$o = {
19609
19901
  $_props: {
19610
19902
  geom: "curve",
19611
- stat: "curve"
19903
+ stat: "curve",
19904
+ fill: "none",
19905
+ color: "black"
19612
19906
  },
19613
19907
  $_type: "layer",
19614
19908
  $_attrnames: ["interpolate"]
19615
19909
  };
19616
- const _sfc_main$l = {
19910
+ const _sfc_main$n = {
19617
19911
  $_props: {
19618
19912
  geom: "curve",
19619
- stat: "density"
19913
+ stat: "density",
19914
+ fill: "none",
19915
+ color: "black"
19620
19916
  },
19621
19917
  $_type: "layer",
19622
- $_argnames: ["n", "kernel"]
19918
+ $_argnames: ["n", "kernel", "scale"]
19623
19919
  };
19624
- const _sfc_main$k = {
19920
+ const _sfc_main$m = {
19625
19921
  $_props: {
19626
19922
  geom: "ellipse",
19627
- stat: "ellipse"
19923
+ stat: "ellipse",
19924
+ fill: "none",
19925
+ color: "black"
19628
19926
  },
19629
19927
  $_type: "layer",
19630
19928
  $_argnames: ["CI"]
19631
19929
  };
19632
- const _sfc_main$j = {
19930
+ const _sfc_main$l = {
19633
19931
  $_props: {
19634
19932
  geom: "rect",
19635
19933
  stat: "histogram"
@@ -19637,7 +19935,7 @@ const _sfc_main$j = {
19637
19935
  $_type: "layer",
19638
19936
  $_argnames: ["bins", "binwidth", "breaks"]
19639
19937
  };
19640
- const _sfc_main$i = {
19938
+ const _sfc_main$k = {
19641
19939
  $_props: {
19642
19940
  geom: "line",
19643
19941
  stat: "line"
@@ -19645,113 +19943,132 @@ const _sfc_main$i = {
19645
19943
  $_type: "layer",
19646
19944
  $_argnames: ["orientation"]
19647
19945
  };
19648
- const _sfc_main$h = {
19946
+ const _sfc_main$j = {
19649
19947
  $_props: {
19650
19948
  geom: "line",
19651
19949
  stat: "linerange"
19652
19950
  },
19653
19951
  $_type: "layer"
19654
19952
  };
19655
- const _sfc_main$g = {
19953
+ const _sfc_main$i = {
19656
19954
  $_props: {
19657
19955
  geom: "markdown",
19658
19956
  stat: "text"
19659
19957
  },
19660
19958
  $_type: "layer"
19661
19959
  };
19662
- const _sfc_main$f = {
19960
+ const _sfc_main$h = {
19663
19961
  $_props: {
19664
19962
  geom: "markdownsegment",
19665
19963
  stat: "textsegment"
19666
19964
  },
19667
19965
  $_type: "layer"
19668
19966
  };
19669
- const _sfc_main$e = {
19967
+ const _sfc_main$g = {
19670
19968
  $_props: {
19671
19969
  geom: "line",
19672
19970
  stat: "path"
19673
19971
  },
19674
19972
  $_type: "layer"
19675
19973
  };
19676
- const _sfc_main$d = {
19974
+ const _sfc_main$f = {
19677
19975
  $_props: {
19678
19976
  geom: "point",
19679
19977
  stat: "point"
19680
19978
  },
19681
19979
  $_type: "layer"
19682
19980
  };
19683
- const _sfc_main$c = {
19981
+ const _sfc_main$e = {
19684
19982
  $_props: {
19685
19983
  geom: "polygon",
19686
19984
  stat: "polygon"
19687
19985
  },
19688
19986
  $_type: "layer"
19689
19987
  };
19690
- const _sfc_main$b = {
19988
+ const _sfc_main$d = {
19691
19989
  $_props: {
19692
19990
  geom: "rect",
19693
19991
  stat: "rect"
19694
19992
  },
19695
19993
  $_type: "layer"
19696
19994
  };
19697
- const _sfc_main$a = {
19995
+ const _sfc_main$c = {
19698
19996
  $_props: {
19699
19997
  geom: "line",
19700
19998
  stat: "segment"
19701
19999
  },
19702
20000
  $_type: "layer"
19703
20001
  };
19704
- const _sfc_main$9 = {
20002
+ const _sfc_main$b = {
20003
+ $_props: {
20004
+ geom: "shape",
20005
+ stat: "shape",
20006
+ interpolate: "catmullRomClosed"
20007
+ },
20008
+ $_type: "layer",
20009
+ $_attrnames: ["interpolate"]
20010
+ };
20011
+ const _sfc_main$a = {
19705
20012
  $_props: {
19706
20013
  geom: "stick",
19707
20014
  stat: "stick"
19708
20015
  },
19709
20016
  $_type: "layer"
19710
20017
  };
19711
- const _sfc_main$8 = {
20018
+ const _sfc_main$9 = {
19712
20019
  $_props: {
19713
20020
  geom: "text",
19714
20021
  stat: "text"
19715
20022
  },
19716
20023
  $_type: "layer"
19717
20024
  };
19718
- const _sfc_main$7 = {
20025
+ const _sfc_main$8 = {
19719
20026
  $_props: {
19720
20027
  geom: "textsegment",
19721
20028
  stat: "textsegment"
19722
20029
  },
19723
20030
  $_type: "layer"
19724
20031
  };
19725
- const _sfc_main$6 = {
20032
+ const _sfc_main$7 = {
19726
20033
  $_props: {
19727
20034
  geom: "tile",
19728
20035
  stat: "tile"
19729
20036
  },
19730
20037
  $_type: "layer"
19731
20038
  };
20039
+ const _sfc_main$6 = {
20040
+ $_props: {
20041
+ geom: "shape",
20042
+ stat: "violin"
20043
+ },
20044
+ $_type: "layer",
20045
+ $_argnames: ["n", "kernel", "scale", "width", "height", "position"]
20046
+ };
19732
20047
  const geom_components = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
19733
20048
  __proto__: null,
19734
- VVGeom: _sfc_main$q,
19735
- VVGeomBar: _sfc_main$p,
19736
- VVGeomBlank: _sfc_main$o,
19737
- VVGeomBoxplot: _sfc_main$n,
19738
- VVGeomCurve: _sfc_main$m,
19739
- VVGeomDensity: _sfc_main$l,
19740
- VVGeomEllipse: _sfc_main$k,
19741
- VVGeomHistogram: _sfc_main$j,
19742
- VVGeomLine: _sfc_main$i,
19743
- VVGeomLinerange: _sfc_main$h,
19744
- VVGeomMarkdown: _sfc_main$g,
19745
- VVGeomMarkdownsegment: _sfc_main$f,
19746
- VVGeomPath: _sfc_main$e,
19747
- VVGeomPoint: _sfc_main$d,
19748
- VVGeomPolygon: _sfc_main$c,
19749
- VVGeomRect: _sfc_main$b,
19750
- VVGeomSegment: _sfc_main$a,
19751
- VVGeomStick: _sfc_main$9,
19752
- VVGeomText: _sfc_main$8,
19753
- VVGeomTextsegment: _sfc_main$7,
19754
- VVGeomTile: _sfc_main$6
20049
+ VVGeom: _sfc_main$s,
20050
+ VVGeomBar: _sfc_main$r,
20051
+ VVGeomBlank: _sfc_main$q,
20052
+ VVGeomBoxplot: _sfc_main$p,
20053
+ VVGeomCurve: _sfc_main$o,
20054
+ VVGeomDensity: _sfc_main$n,
20055
+ VVGeomEllipse: _sfc_main$m,
20056
+ VVGeomHistogram: _sfc_main$l,
20057
+ VVGeomLine: _sfc_main$k,
20058
+ VVGeomLinerange: _sfc_main$j,
20059
+ VVGeomMarkdown: _sfc_main$i,
20060
+ VVGeomMarkdownsegment: _sfc_main$h,
20061
+ VVGeomPath: _sfc_main$g,
20062
+ VVGeomPoint: _sfc_main$f,
20063
+ VVGeomPolygon: _sfc_main$e,
20064
+ VVGeomRect: _sfc_main$d,
20065
+ VVGeomSegment: _sfc_main$c,
20066
+ VVGeomShape: _sfc_main$b,
20067
+ VVGeomStick: _sfc_main$a,
20068
+ VVGeomText: _sfc_main$9,
20069
+ VVGeomTextsegment: _sfc_main$8,
20070
+ VVGeomTile: _sfc_main$7,
20071
+ VVGeomViolin: _sfc_main$6
19755
20072
  }, Symbol.toStringTag, { value: "Module" }));
19756
20073
  const _sfc_main$5 = {
19757
20074
  $_type: "axis",
@@ -19821,8 +20138,8 @@ const _sfc_main$1 = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
19821
20138
  const components = {
19822
20139
  ...geom_components,
19823
20140
  ...axis_components,
19824
- VVAction: _sfc_main$r,
19825
- VVSelection: _sfc_main$r
20141
+ VVAction: _sfc_main$t,
20142
+ VVSelection: _sfc_main$t
19826
20143
  };
19827
20144
  const opponents = {
19828
20145
  x: "y",
@@ -20298,6 +20615,7 @@ const _sfc_main$1 = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
20298
20615
  let oldSize = { width: 0, height: 0 };
20299
20616
  useResizeObserver(plotRef, (e) => {
20300
20617
  let { width: w, height: h } = e[0].contentRect;
20618
+ if (width.value - w < 0.5 && height.value - h < 0.5) return;
20301
20619
  if (wrapperRef.value.style.width) width.value = w;
20302
20620
  if (wrapperRef.value.style.height) height.value = h;
20303
20621
  if ((w > 0 || h > 0) && (oldSize.width > 0 || oldSize.height > 0))
@@ -20339,7 +20657,7 @@ const _sfc_main$1 = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
20339
20657
  class: "vvplot",
20340
20658
  style: wrapperStyle.value
20341
20659
  }, vBind.value.wrapper), [
20342
- createVNode(_sfc_main$s, mergeProps({
20660
+ createVNode(_sfc_main$u, mergeProps({
20343
20661
  ref: "plot",
20344
20662
  paddings,
20345
20663
  schema: schema.value,
@@ -20401,62 +20719,66 @@ const _sfc_main = {
20401
20719
  };
20402
20720
  const index = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
20403
20721
  __proto__: null,
20404
- VVAction: _sfc_main$r,
20722
+ VVAction: _sfc_main$t,
20405
20723
  VVAxis: _sfc_main$5,
20406
20724
  VVAxisBreak: _sfc_main$2,
20407
20725
  VVAxisX: _sfc_main$4,
20408
20726
  VVAxisY: _sfc_main$3,
20409
- VVGeom: _sfc_main$q,
20410
- VVGeomBar: _sfc_main$p,
20411
- VVGeomBlank: _sfc_main$o,
20412
- VVGeomBoxplot: _sfc_main$n,
20413
- VVGeomCurve: _sfc_main$m,
20414
- VVGeomDensity: _sfc_main$l,
20415
- VVGeomEllipse: _sfc_main$k,
20416
- VVGeomHistogram: _sfc_main$j,
20417
- VVGeomLine: _sfc_main$i,
20418
- VVGeomLinerange: _sfc_main$h,
20419
- VVGeomMarkdown: _sfc_main$g,
20420
- VVGeomMarkdownsegment: _sfc_main$f,
20421
- VVGeomPath: _sfc_main$e,
20422
- VVGeomPoint: _sfc_main$d,
20423
- VVGeomPolygon: _sfc_main$c,
20424
- VVGeomRect: _sfc_main$b,
20425
- VVGeomSegment: _sfc_main$a,
20426
- VVGeomStick: _sfc_main$9,
20427
- VVGeomText: _sfc_main$8,
20428
- VVGeomTextsegment: _sfc_main$7,
20429
- VVGeomTile: _sfc_main$6,
20727
+ VVGeom: _sfc_main$s,
20728
+ VVGeomBar: _sfc_main$r,
20729
+ VVGeomBlank: _sfc_main$q,
20730
+ VVGeomBoxplot: _sfc_main$p,
20731
+ VVGeomCurve: _sfc_main$o,
20732
+ VVGeomDensity: _sfc_main$n,
20733
+ VVGeomEllipse: _sfc_main$m,
20734
+ VVGeomHistogram: _sfc_main$l,
20735
+ VVGeomLine: _sfc_main$k,
20736
+ VVGeomLinerange: _sfc_main$j,
20737
+ VVGeomMarkdown: _sfc_main$i,
20738
+ VVGeomMarkdownsegment: _sfc_main$h,
20739
+ VVGeomPath: _sfc_main$g,
20740
+ VVGeomPoint: _sfc_main$f,
20741
+ VVGeomPolygon: _sfc_main$e,
20742
+ VVGeomRect: _sfc_main$d,
20743
+ VVGeomSegment: _sfc_main$c,
20744
+ VVGeomShape: _sfc_main$b,
20745
+ VVGeomStick: _sfc_main$a,
20746
+ VVGeomText: _sfc_main$9,
20747
+ VVGeomTextsegment: _sfc_main$8,
20748
+ VVGeomTile: _sfc_main$7,
20749
+ VVGeomViolin: _sfc_main$6,
20430
20750
  VVPlot: _sfc_main$1,
20431
20751
  VVSelection: _sfc_main
20432
20752
  }, Symbol.toStringTag, { value: "Module" }));
20433
20753
  export {
20434
- _sfc_main$r as VVAction,
20754
+ _sfc_main$t as VVAction,
20435
20755
  _sfc_main$5 as VVAxis,
20436
20756
  _sfc_main$2 as VVAxisBreak,
20437
20757
  _sfc_main$4 as VVAxisX,
20438
20758
  _sfc_main$3 as VVAxisY,
20439
- _sfc_main$q as VVGeom,
20440
- _sfc_main$p as VVGeomBar,
20441
- _sfc_main$o as VVGeomBlank,
20442
- _sfc_main$n as VVGeomBoxplot,
20443
- _sfc_main$m as VVGeomCurve,
20444
- _sfc_main$l as VVGeomDensity,
20445
- _sfc_main$k as VVGeomEllipse,
20446
- _sfc_main$j as VVGeomHistogram,
20447
- _sfc_main$i as VVGeomLine,
20448
- _sfc_main$h as VVGeomLinerange,
20449
- _sfc_main$g as VVGeomMarkdown,
20450
- _sfc_main$f as VVGeomMarkdownsegment,
20451
- _sfc_main$e as VVGeomPath,
20452
- _sfc_main$d as VVGeomPoint,
20453
- _sfc_main$c as VVGeomPolygon,
20454
- _sfc_main$b as VVGeomRect,
20455
- _sfc_main$a as VVGeomSegment,
20456
- _sfc_main$9 as VVGeomStick,
20457
- _sfc_main$8 as VVGeomText,
20458
- _sfc_main$7 as VVGeomTextsegment,
20459
- _sfc_main$6 as VVGeomTile,
20759
+ _sfc_main$s as VVGeom,
20760
+ _sfc_main$r as VVGeomBar,
20761
+ _sfc_main$q as VVGeomBlank,
20762
+ _sfc_main$p as VVGeomBoxplot,
20763
+ _sfc_main$o as VVGeomCurve,
20764
+ _sfc_main$n as VVGeomDensity,
20765
+ _sfc_main$m as VVGeomEllipse,
20766
+ _sfc_main$l as VVGeomHistogram,
20767
+ _sfc_main$k as VVGeomLine,
20768
+ _sfc_main$j as VVGeomLinerange,
20769
+ _sfc_main$i as VVGeomMarkdown,
20770
+ _sfc_main$h as VVGeomMarkdownsegment,
20771
+ _sfc_main$g as VVGeomPath,
20772
+ _sfc_main$f as VVGeomPoint,
20773
+ _sfc_main$e as VVGeomPolygon,
20774
+ _sfc_main$d as VVGeomRect,
20775
+ _sfc_main$c as VVGeomSegment,
20776
+ _sfc_main$b as VVGeomShape,
20777
+ _sfc_main$a as VVGeomStick,
20778
+ _sfc_main$9 as VVGeomText,
20779
+ _sfc_main$8 as VVGeomTextsegment,
20780
+ _sfc_main$7 as VVGeomTile,
20781
+ _sfc_main$6 as VVGeomViolin,
20460
20782
  _sfc_main$1 as VVPlot,
20461
20783
  _sfc_main as VVSelection,
20462
20784
  index as components,