vvplot 0.5.1 → 0.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/vvplot.esm.js +843 -737
- package/dist/vvplot.esm.min.js +18 -18
- package/dist/vvplot.global.js +843 -737
- package/dist/vvplot.global.min.js +18 -18
- package/package.json +2 -1
package/dist/vvplot.esm.js
CHANGED
|
@@ -1957,6 +1957,16 @@ const numutils = {
|
|
|
1957
1957
|
if (infinity_rm) arr = arr.filter((x2) => isFinite(x2));
|
|
1958
1958
|
return Array.from(arr).reduce((a, b) => a > b ? a : b, -Infinity);
|
|
1959
1959
|
},
|
|
1960
|
+
sum(arr, { na_rm = true, infinity_rm = true } = {}) {
|
|
1961
|
+
if (na_rm) arr = arr.filter(is_continuous);
|
|
1962
|
+
if (infinity_rm) arr = arr.filter((x2) => isFinite(x2));
|
|
1963
|
+
return Array.from(arr).reduce((a, b) => a + b, 0);
|
|
1964
|
+
},
|
|
1965
|
+
diff(arr, { na_rm = true, infinity_rm = true } = {}) {
|
|
1966
|
+
if (na_rm) arr = arr.filter(is_continuous);
|
|
1967
|
+
if (infinity_rm) arr = arr.filter((x2) => isFinite(x2));
|
|
1968
|
+
return Array.from(arr).slice(1).map((v, i) => v - arr[i]);
|
|
1969
|
+
},
|
|
1960
1970
|
mean(arr, { na_rm = true, infinity_rm = true } = {}) {
|
|
1961
1971
|
if (na_rm) arr = arr.filter(is_continuous);
|
|
1962
1972
|
if (infinity_rm) arr = arr.filter((x2) => isFinite(x2));
|
|
@@ -1988,6 +1998,14 @@ const numutils = {
|
|
|
1988
1998
|
}
|
|
1989
1999
|
};
|
|
1990
2000
|
const vecutils = {
|
|
2001
|
+
coalesce(value, defaultValue) {
|
|
2002
|
+
if (Array.isArray(defaultValue)) {
|
|
2003
|
+
if (!Array.isArray(value) || value.length != defaultValue.length) throw new Error("Value and defaultValue must be arrays of the same length");
|
|
2004
|
+
return value.map((v, i) => v == null ? defaultValue[i] : v);
|
|
2005
|
+
}
|
|
2006
|
+
if (Array.isArray(value)) return value.map((v) => v ?? defaultValue);
|
|
2007
|
+
return value ?? defaultValue;
|
|
2008
|
+
},
|
|
1991
2009
|
/* vectorized summation of numbers */
|
|
1992
2010
|
sum(...values) {
|
|
1993
2011
|
if (values.some((x2) => x2 == null)) return null;
|
|
@@ -1997,12 +2015,10 @@ const vecutils = {
|
|
|
1997
2015
|
values = values.filter((x2) => Array.isArray(x2));
|
|
1998
2016
|
if (values.length == 0)
|
|
1999
2017
|
return [nums];
|
|
2000
|
-
if (values.some((v) => v.length == 0))
|
|
2001
|
-
return [];
|
|
2002
2018
|
let length = values[0].length;
|
|
2003
2019
|
if (values.some((v) => v.length != length))
|
|
2004
2020
|
throw new Error("Arrays must have the same length");
|
|
2005
|
-
return Array.from({ length }, (_, i) => values.reduce((s, a) => +(a[i] ?? 0) + s, nums));
|
|
2021
|
+
return Array.from({ length }, (_, i) => values.reduce((s, a) => +(a[i] ?? void 0) + s, nums));
|
|
2006
2022
|
},
|
|
2007
2023
|
/* vectorized opposite of numbers */
|
|
2008
2024
|
opposite(value) {
|
|
@@ -2256,7 +2272,7 @@ const theme_base = {
|
|
|
2256
2272
|
},
|
|
2257
2273
|
axis_v: {
|
|
2258
2274
|
title_offset: 30,
|
|
2259
|
-
title_angle: 90
|
|
2275
|
+
title_angle: -90
|
|
2260
2276
|
},
|
|
2261
2277
|
axis_left: {
|
|
2262
2278
|
tick_position: "left",
|
|
@@ -2342,7 +2358,8 @@ const theme_classic = {
|
|
|
2342
2358
|
line_color: "black",
|
|
2343
2359
|
tick_color: "black",
|
|
2344
2360
|
label_color: "black",
|
|
2345
|
-
title_color: "black"
|
|
2361
|
+
title_color: "black",
|
|
2362
|
+
grid_color: null
|
|
2346
2363
|
}
|
|
2347
2364
|
};
|
|
2348
2365
|
const theme_void = {
|
|
@@ -2463,11 +2480,11 @@ const blank$1 = {
|
|
|
2463
2480
|
return null;
|
|
2464
2481
|
}
|
|
2465
2482
|
};
|
|
2466
|
-
let psum$a = vecutils
|
|
2483
|
+
let { sum: psum$a, coalesce: coalesce$a } = vecutils;
|
|
2467
2484
|
const boxplot$1 = {
|
|
2468
2485
|
scale_attrs: ["fill", "color", "linewidth", "linetype", "alpha"],
|
|
2469
2486
|
coord_scale(ds, levels) {
|
|
2470
|
-
let xnudge = ds.xnudge
|
|
2487
|
+
let xnudge = coalesce$a(ds.xnudge, 0), ynudge = coalesce$a(ds.ynudge, 0);
|
|
2471
2488
|
if (ds.x) {
|
|
2472
2489
|
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
2490
|
($x, { y: ys, $raw }, nudge) => psum$a(ys, nudge).map(($y, i) => ({ x: $x, y: $y, $raw: $raw[i] })),
|
|
@@ -2542,12 +2559,12 @@ const curve$1 = {
|
|
|
2542
2559
|
return d;
|
|
2543
2560
|
}
|
|
2544
2561
|
};
|
|
2545
|
-
let psum$9 = vecutils
|
|
2562
|
+
let { sum: psum$9, coalesce: coalesce$9 } = vecutils;
|
|
2546
2563
|
const ellipse$1 = {
|
|
2547
2564
|
scale_attrs: ["fill", "color", "linewidth", "linetype", "alpha"],
|
|
2548
2565
|
coord_scale(ds, levels) {
|
|
2549
2566
|
let { A, B, C } = ds;
|
|
2550
|
-
let xnudge = ds.xnudge
|
|
2567
|
+
let xnudge = coalesce$9(ds.xnudge, 0), ynudge = coalesce$9(ds.ynudge, 0), cx = psum$9(levels.x?.apply?.(ds.cx) ?? ds.cx, xnudge), cy = psum$9(levels.y?.apply?.(ds.cy) ?? ds.cy, ynudge);
|
|
2551
2568
|
return { cx, cy, A, B, C };
|
|
2552
2569
|
},
|
|
2553
2570
|
get_range(ds, orientation) {
|
|
@@ -2565,11 +2582,11 @@ const ellipse$1 = {
|
|
|
2565
2582
|
return d;
|
|
2566
2583
|
}
|
|
2567
2584
|
};
|
|
2568
|
-
let psum$8 = vecutils
|
|
2585
|
+
let { sum: psum$8, coalesce: coalesce$8 } = vecutils;
|
|
2569
2586
|
const line$2 = {
|
|
2570
2587
|
scale_attrs: ["color", "linewidth", "linetype", "alpha"],
|
|
2571
2588
|
coord_scale(ds, levels) {
|
|
2572
|
-
let xnudge = ds.xnudge
|
|
2589
|
+
let xnudge = coalesce$8(ds.xnudge, 0), ynudge = coalesce$8(ds.ynudge, 0), x2 = psum$8(levels.x?.apply?.(ds.x) ?? ds.x, xnudge), y2 = psum$8(levels.y?.apply?.(ds.y) ?? ds.y, ynudge), xend = psum$8(levels.x?.apply?.(ds.xend) ?? ds.xend, xnudge), yend = psum$8(levels.y?.apply?.(ds.yend) ?? ds.yend, ynudge);
|
|
2573
2590
|
return { x: x2, y: y2, xend, yend };
|
|
2574
2591
|
},
|
|
2575
2592
|
get_range(ds, orientation) {
|
|
@@ -2581,11 +2598,11 @@ const line$2 = {
|
|
|
2581
2598
|
return d;
|
|
2582
2599
|
}
|
|
2583
2600
|
};
|
|
2584
|
-
let psum$7 = vecutils
|
|
2601
|
+
let { sum: psum$7, coalesce: coalesce$7 } = vecutils;
|
|
2585
2602
|
const markdown = {
|
|
2586
2603
|
scale_attrs: ["size", "color", "stroke", "linewidth", "linetype", "alpha"],
|
|
2587
2604
|
coord_scale(ds, levels) {
|
|
2588
|
-
let xnudge = ds.xnudge
|
|
2605
|
+
let xnudge = coalesce$7(ds.xnudge, 0), ynudge = coalesce$7(ds.ynudge, 0), x2 = psum$7(levels.x?.apply?.(ds.x) ?? ds.x, xnudge), y2 = psum$7(levels.y?.apply?.(ds.y) ?? ds.y, ynudge);
|
|
2589
2606
|
return { x: x2, y: y2 };
|
|
2590
2607
|
},
|
|
2591
2608
|
get_range(ds, orientation) {
|
|
@@ -2597,11 +2614,11 @@ const markdown = {
|
|
|
2597
2614
|
return d;
|
|
2598
2615
|
}
|
|
2599
2616
|
};
|
|
2600
|
-
let psum$6 = vecutils
|
|
2617
|
+
let { sum: psum$6, coalesce: coalesce$6 } = vecutils;
|
|
2601
2618
|
const markdownsegment = {
|
|
2602
2619
|
scale_attrs: ["size", "color", "stroke", "linewidth", "linetype", "alpha"],
|
|
2603
2620
|
coord_scale(ds, levels) {
|
|
2604
|
-
let xnudge = ds.xnudge
|
|
2621
|
+
let xnudge = coalesce$6(ds.xnudge, 0), ynudge = coalesce$6(ds.ynudge, 0), x2 = psum$6(levels.x?.apply?.(ds.x) ?? ds.x, xnudge), y2 = psum$6(levels.y?.apply?.(ds.y) ?? ds.y, ynudge), xend = psum$6(levels.x?.apply?.(ds.xend) ?? ds.xend, xnudge), yend = psum$6(levels.y?.apply?.(ds.yend) ?? ds.yend, ynudge);
|
|
2605
2622
|
return { x: x2, y: y2, xend, yend };
|
|
2606
2623
|
},
|
|
2607
2624
|
get_range(ds, orientation) {
|
|
@@ -2613,11 +2630,11 @@ const markdownsegment = {
|
|
|
2613
2630
|
return d;
|
|
2614
2631
|
}
|
|
2615
2632
|
};
|
|
2616
|
-
let psum$5 = vecutils
|
|
2633
|
+
let { sum: psum$5, coalesce: coalesce$5 } = vecutils;
|
|
2617
2634
|
const point$3 = {
|
|
2618
2635
|
scale_attrs: ["shape", "size", "color", "stroke", "linewidth", "linetype", "alpha"],
|
|
2619
2636
|
coord_scale(ds, levels) {
|
|
2620
|
-
let xnudge = ds.xnudge
|
|
2637
|
+
let xnudge = coalesce$5(ds.xnudge, 0), ynudge = coalesce$5(ds.ynudge, 0), x2 = psum$5(levels.x?.apply?.(ds.x) ?? ds.x, xnudge), y2 = psum$5(levels.y?.apply?.(ds.y) ?? ds.y, ynudge);
|
|
2621
2638
|
return { x: x2, y: y2 };
|
|
2622
2639
|
},
|
|
2623
2640
|
get_range(ds, orientation) {
|
|
@@ -2647,11 +2664,11 @@ const polygon$1 = {
|
|
|
2647
2664
|
return d;
|
|
2648
2665
|
}
|
|
2649
2666
|
};
|
|
2650
|
-
let psum$4 = vecutils
|
|
2667
|
+
let { sum: psum$4, coalesce: coalesce$4 } = vecutils;
|
|
2651
2668
|
const rect$2 = {
|
|
2652
2669
|
scale_attrs: ["fill", "color", "linewidth", "linetype", "alpha"],
|
|
2653
2670
|
coord_scale(ds, levels) {
|
|
2654
|
-
let xnudge = ds.xnudge
|
|
2671
|
+
let xnudge = coalesce$4(ds.xnudge, 0), ynudge = coalesce$4(ds.ynudge, 0), xmin = psum$4(levels.x?.apply?.(ds.xmin) ?? ds.xmin, xnudge), xmax = psum$4(levels.x?.apply?.(ds.xmax) ?? ds.xmax, xnudge), ymin = psum$4(levels.y?.apply?.(ds.ymin) ?? ds.ymin, ynudge), ymax = psum$4(levels.y?.apply?.(ds.ymax) ?? ds.ymax, ynudge);
|
|
2655
2672
|
return { xmin, xmax, ymin, ymax };
|
|
2656
2673
|
},
|
|
2657
2674
|
get_range(ds, orientation) {
|
|
@@ -2685,11 +2702,11 @@ const shape$1 = {
|
|
|
2685
2702
|
return d;
|
|
2686
2703
|
}
|
|
2687
2704
|
};
|
|
2688
|
-
let psum$3 = vecutils
|
|
2705
|
+
let { sum: psum$3, coalesce: coalesce$3 } = vecutils;
|
|
2689
2706
|
const stick$1 = {
|
|
2690
2707
|
scale_attrs: ["color", "linewidth", "linetype", "alpha"],
|
|
2691
2708
|
coord_scale(ds, levels) {
|
|
2692
|
-
let xnudge = ds.xnudge
|
|
2709
|
+
let xnudge = coalesce$3(ds.xnudge, 0), ynudge = coalesce$3(ds.ynudge, 0), x2 = psum$3(levels.x?.apply?.(ds.x) ?? ds.x, xnudge), y2 = psum$3(levels.y?.apply?.(ds.y) ?? ds.y, ynudge), xend = psum$3(x2, ds.dx), yend = psum$3(y2, ds.dy);
|
|
2693
2710
|
return { x: x2, y: y2, xend, yend };
|
|
2694
2711
|
},
|
|
2695
2712
|
get_values(ds, orientation) {
|
|
@@ -2705,11 +2722,11 @@ const stick$1 = {
|
|
|
2705
2722
|
return d;
|
|
2706
2723
|
}
|
|
2707
2724
|
};
|
|
2708
|
-
let psum$2 = vecutils
|
|
2725
|
+
let { sum: psum$2, coalesce: coalesce$2 } = vecutils;
|
|
2709
2726
|
const text$3 = {
|
|
2710
2727
|
scale_attrs: ["size", "color", "stroke", "linewidth", "linetype", "alpha"],
|
|
2711
2728
|
coord_scale(ds, levels) {
|
|
2712
|
-
let xnudge = ds.xnudge
|
|
2729
|
+
let xnudge = coalesce$2(ds.xnudge, 0), ynudge = coalesce$2(ds.ynudge, 0), x2 = psum$2(levels.x?.apply?.(ds.x) ?? ds.x, xnudge), y2 = psum$2(levels.y?.apply?.(ds.y) ?? ds.y, ynudge);
|
|
2713
2730
|
return { x: x2, y: y2 };
|
|
2714
2731
|
},
|
|
2715
2732
|
get_range(ds, orientation) {
|
|
@@ -2721,11 +2738,11 @@ const text$3 = {
|
|
|
2721
2738
|
return d;
|
|
2722
2739
|
}
|
|
2723
2740
|
};
|
|
2724
|
-
let psum$1 = vecutils
|
|
2741
|
+
let { sum: psum$1, coalesce: coalesce$1 } = vecutils;
|
|
2725
2742
|
const textsegment$1 = {
|
|
2726
2743
|
scale_attrs: ["size", "color", "stroke", "linewidth", "linetype", "alpha"],
|
|
2727
2744
|
coord_scale(ds, levels) {
|
|
2728
|
-
let xnudge = ds.xnudge
|
|
2745
|
+
let xnudge = coalesce$1(ds.xnudge, 0), ynudge = coalesce$1(ds.ynudge, 0), x2 = psum$1(levels.x?.apply?.(ds.x) ?? ds.x, xnudge), y2 = psum$1(levels.y?.apply?.(ds.y) ?? ds.y, ynudge), xend = psum$1(levels.x?.apply?.(ds.xend) ?? ds.xend, xnudge), yend = psum$1(levels.y?.apply?.(ds.yend) ?? ds.yend, ynudge);
|
|
2729
2746
|
return { x: x2, y: y2, xend, yend };
|
|
2730
2747
|
},
|
|
2731
2748
|
get_range(ds, orientation) {
|
|
@@ -2737,11 +2754,11 @@ const textsegment$1 = {
|
|
|
2737
2754
|
return d;
|
|
2738
2755
|
}
|
|
2739
2756
|
};
|
|
2740
|
-
let psum = vecutils
|
|
2757
|
+
let { sum: psum, coalesce } = vecutils;
|
|
2741
2758
|
const tile$1 = {
|
|
2742
2759
|
scale_attrs: ["fill", "color", "linewidth", "linetype", "alpha"],
|
|
2743
2760
|
coord_scale(ds, levels) {
|
|
2744
|
-
let xnudge = ds.xnudge
|
|
2761
|
+
let xnudge = coalesce(ds.xnudge, 0), ynudge = coalesce(ds.ynudge, 0), x2 = levels.x?.apply?.(ds.x) ?? ds.x, y2 = levels.y?.apply?.(ds.y) ?? ds.y, xmin = psum(x2, ds.width?.map?.((x3) => -x3 / 2) ?? -0.5, xnudge), xmax = psum(x2, ds.width?.map?.((x3) => +x3 / 2) ?? 0.5, xnudge), ymin = psum(y2, ds.height?.map?.((x3) => -x3 / 2) ?? -0.5, ynudge), ymax = psum(y2, ds.height?.map?.((x3) => +x3 / 2) ?? 0.5, ynudge);
|
|
2745
2762
|
return { xmin, xmax, ymin, ymax };
|
|
2746
2763
|
},
|
|
2747
2764
|
get_values(ds, orientation) {
|
|
@@ -2794,20 +2811,21 @@ const bar = Object.assign(function(data, { position = "stack", width = 0.9, heig
|
|
|
2794
2811
|
let group = intraaction(Object.fromEntries(keys.map((k) => [k, data[k]])));
|
|
2795
2812
|
let inter = intraaction({ group: group ?? 0, value: values });
|
|
2796
2813
|
let groups = Map.groupBy(data.$raw, (_, i) => inter.categories[inter[i]]);
|
|
2797
|
-
let $raw = Array.from(groups.values()), cates = Array.from(groups.keys());
|
|
2814
|
+
let $raw = Array.from(groups.values()), cates = Array.from(groups.keys()), val = $raw.map((v) => v.length);
|
|
2798
2815
|
let result = {
|
|
2799
2816
|
$raw,
|
|
2800
|
-
$group: cates.map((x2) => x2.group)
|
|
2817
|
+
$group: cates.map((x2) => x2.group),
|
|
2818
|
+
[cateAes]: cates.map((v) => v.value)
|
|
2801
2819
|
};
|
|
2802
2820
|
for (let key of keys) {
|
|
2803
2821
|
result[key] = cates.map((x2) => x2.group).map((i) => group.categories[i][key]);
|
|
2804
2822
|
}
|
|
2805
2823
|
if (cateAes == "x") {
|
|
2806
|
-
|
|
2807
|
-
result.height =
|
|
2824
|
+
width ??= 0.9;
|
|
2825
|
+
result.height = val;
|
|
2808
2826
|
} else {
|
|
2809
|
-
|
|
2810
|
-
result.width =
|
|
2827
|
+
height ??= 0.9;
|
|
2828
|
+
result.width = val;
|
|
2811
2829
|
}
|
|
2812
2830
|
if (position == "stack") {
|
|
2813
2831
|
let cate_group = Object.groupBy(result.$group, (v, i) => group.categories[v][cateAes]);
|
|
@@ -2816,7 +2834,7 @@ const bar = Object.assign(function(data, { position = "stack", width = 0.9, heig
|
|
|
2816
2834
|
let s = 0;
|
|
2817
2835
|
for (let i of cate_group[cate]) {
|
|
2818
2836
|
offset[i] = s;
|
|
2819
|
-
s +=
|
|
2837
|
+
s += val[i];
|
|
2820
2838
|
}
|
|
2821
2839
|
}
|
|
2822
2840
|
if (cateAes == "x") {
|
|
@@ -2906,6 +2924,85 @@ const boxplot = Object.assign(function(data, { position = "dodge", width = 0.9,
|
|
|
2906
2924
|
}
|
|
2907
2925
|
return result;
|
|
2908
2926
|
}, { core_attrs: ["x", "y", "xnudge", "ynudge"] });
|
|
2927
|
+
const col = Object.assign(function(data, { position = "stack", width, height, orientation = "x" }) {
|
|
2928
|
+
let missingAes = ["x", "y"].filter((a) => data[a] == null);
|
|
2929
|
+
if (missingAes.length > 0)
|
|
2930
|
+
throw new Error(`Missing aesthetics for "StatCol": "${missingAes.join('", "')}"`);
|
|
2931
|
+
let isXdiscrete = data.x.some(is_categorical);
|
|
2932
|
+
let isYdiscrete = data.y.some(is_categorical);
|
|
2933
|
+
if (isXdiscrete && isYdiscrete)
|
|
2934
|
+
throw new Error(`Both "x" and "y" are discrete, "StatCol" requires at most one discrete aesthetic`);
|
|
2935
|
+
let cateAes = isXdiscrete == isYdiscrete ? orientation != "y" ? "x" : "y" : isXdiscrete ? "x" : "y";
|
|
2936
|
+
let valueAes = cateAes == "x" ? "y" : "x";
|
|
2937
|
+
let keys = Object.keys(data).filter((k) => k != valueAes && !k.startsWith("$"));
|
|
2938
|
+
let group = intraaction(Object.fromEntries(keys.map((k) => [k, data[k]])));
|
|
2939
|
+
let inter = intraaction({ group: group ?? 0, cate: data[cateAes] });
|
|
2940
|
+
let groupIdx = Map.groupBy(inter.map((_, i) => i), (_, i) => inter.categories[inter[i]]);
|
|
2941
|
+
let groups = Map.groupBy(data.$raw, (_, i) => inter.categories[inter[i]]);
|
|
2942
|
+
let cates = Array.from(groups.keys()), $raw = Array.from(groupIdx.values()).map((arr) => arr.map((idx) => data.$raw[idx])), val = Array.from(groupIdx.values()).map((arr) => numutils.sum(arr.map((idx) => data[valueAes][idx])));
|
|
2943
|
+
let result = {
|
|
2944
|
+
$raw,
|
|
2945
|
+
$group: cates.map((x2) => x2.group),
|
|
2946
|
+
[cateAes]: cates.map((v) => v.value)
|
|
2947
|
+
};
|
|
2948
|
+
for (let key of keys) {
|
|
2949
|
+
result[key] = cates.map((x2) => x2.group).map((i) => group.categories[i][key]);
|
|
2950
|
+
}
|
|
2951
|
+
if (cateAes == "x") {
|
|
2952
|
+
if (isXdiscrete) {
|
|
2953
|
+
width ??= 0.9;
|
|
2954
|
+
} else {
|
|
2955
|
+
width ??= numutils.min(numutils.diff(Array.from(new Set(data[cateAes])).sort((a, b) => a - b))) * 0.9;
|
|
2956
|
+
}
|
|
2957
|
+
result.height = val;
|
|
2958
|
+
} else {
|
|
2959
|
+
if (isYdiscrete) {
|
|
2960
|
+
height ??= 0.9;
|
|
2961
|
+
} else {
|
|
2962
|
+
height ??= numutils.min(numutils.diff(Array.from(new Set(data[cateAes])).sort((a, b) => a - b))) * 0.9;
|
|
2963
|
+
}
|
|
2964
|
+
result.width = val;
|
|
2965
|
+
}
|
|
2966
|
+
if (position == "stack") {
|
|
2967
|
+
let cate_group = Object.groupBy(result.$group, (v, i) => group.categories[v][cateAes]);
|
|
2968
|
+
let offset = cates.map((_) => 0);
|
|
2969
|
+
for (let cate in cate_group) {
|
|
2970
|
+
let s = 0;
|
|
2971
|
+
for (let i of cate_group[cate]) {
|
|
2972
|
+
offset[i] = s;
|
|
2973
|
+
s += val[i];
|
|
2974
|
+
}
|
|
2975
|
+
}
|
|
2976
|
+
if (cateAes == "x") {
|
|
2977
|
+
result.y = result.height.map((v, i) => offset[i] + v / 2);
|
|
2978
|
+
result.width = cates.map((_) => width);
|
|
2979
|
+
} else {
|
|
2980
|
+
result.x = result.width.map((v, i) => offset[i] + v / 2);
|
|
2981
|
+
result.height = cates.map((_) => height);
|
|
2982
|
+
}
|
|
2983
|
+
} else if (position == "dodge") {
|
|
2984
|
+
let cate_group = Object.groupBy(result.$group, (v, i) => group.categories[v][cateAes]);
|
|
2985
|
+
let $group = result.$group.map((v) => cate_group[group.categories[v][cateAes]]);
|
|
2986
|
+
if (cateAes == "x") {
|
|
2987
|
+
result.y = result.height.map((v) => v / 2);
|
|
2988
|
+
result.width = $group.map((arr) => width / arr.length);
|
|
2989
|
+
result.xnudge = $group.map((arr, i) => (result.xnudge?.[i] ?? 0) + ((arr.indexOf(result.$group[i]) + 0.5) / arr.length - 0.5) * width);
|
|
2990
|
+
} else {
|
|
2991
|
+
result.x = result.width.map((v) => v / 2);
|
|
2992
|
+
result.height = $group.map((arr) => height / arr.length);
|
|
2993
|
+
result.ynudge = $group.map((arr, i) => (result.ynudge?.[i] ?? 0) + ((arr.indexOf(result.$group[i]) + 0.5) / arr.length - 0.5) * height);
|
|
2994
|
+
}
|
|
2995
|
+
} else {
|
|
2996
|
+
if (cateAes == "x") {
|
|
2997
|
+
result.y = result.height.map((v) => v / 2);
|
|
2998
|
+
result.width = cates.map((_) => width);
|
|
2999
|
+
} else {
|
|
3000
|
+
result.x = result.width.map((v) => v / 2);
|
|
3001
|
+
result.height = cates.map((_) => height);
|
|
3002
|
+
}
|
|
3003
|
+
}
|
|
3004
|
+
return result;
|
|
3005
|
+
}, { core_attrs: ["x", "y", "xnudge", "ynudge"] });
|
|
2909
3006
|
const curve = Object.assign(function(data) {
|
|
2910
3007
|
if (data.points != null) return data;
|
|
2911
3008
|
let missingAes = ["x", "y"].filter((a) => data[a] == null);
|
|
@@ -3330,6 +3427,7 @@ const vvstat = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProper
|
|
|
3330
3427
|
__proto__: null,
|
|
3331
3428
|
bar,
|
|
3332
3429
|
boxplot,
|
|
3430
|
+
col,
|
|
3333
3431
|
curve,
|
|
3334
3432
|
density,
|
|
3335
3433
|
ellipse,
|
|
@@ -7349,9 +7447,9 @@ class GPlot {
|
|
|
7349
7447
|
}
|
|
7350
7448
|
getComputedLayers() {
|
|
7351
7449
|
return this.layers.map((layer) => {
|
|
7352
|
-
let data =
|
|
7450
|
+
let data = layer.data.$group.map(
|
|
7353
7451
|
(_, i) => vvgeom[layer.geom].validate(object_map(layer.data, (k, v) => v?.[i]))
|
|
7354
|
-
).filter((x2) => x2 != null)
|
|
7452
|
+
).filter((x2) => x2 != null);
|
|
7355
7453
|
return { data, geom: layer.geom, vBind: layer.vBind };
|
|
7356
7454
|
});
|
|
7357
7455
|
}
|
|
@@ -7536,9 +7634,9 @@ class GAxis {
|
|
|
7536
7634
|
return breaks;
|
|
7537
7635
|
}
|
|
7538
7636
|
}
|
|
7539
|
-
const _hoisted_1$
|
|
7637
|
+
const _hoisted_1$q = ["font-size"];
|
|
7540
7638
|
const _hoisted_2$8 = { key: 0 };
|
|
7541
|
-
const _sfc_main$
|
|
7639
|
+
const _sfc_main$18 = {
|
|
7542
7640
|
__name: "CoreText",
|
|
7543
7641
|
props: {
|
|
7544
7642
|
x: { type: Number, default: 0 },
|
|
@@ -7566,8 +7664,9 @@ const _sfc_main$17 = {
|
|
|
7566
7664
|
setup(__props) {
|
|
7567
7665
|
const ele = useTemplateRef("ele");
|
|
7568
7666
|
const textBox = reactive({ width: 0, height: 0 });
|
|
7667
|
+
const visible = inject("vvplot-visible", true);
|
|
7569
7668
|
watch(
|
|
7570
|
-
[ele, () => __props.fontSize, () => __props.size, () => __props.text, () => __props.textLength, () => __props.fontFamily],
|
|
7669
|
+
[ele, visible, () => __props.fontSize, () => __props.size, () => __props.text, () => __props.textLength, () => __props.fontFamily],
|
|
7571
7670
|
async ([e]) => {
|
|
7572
7671
|
if (!e) return;
|
|
7573
7672
|
await nextTick();
|
|
@@ -7625,7 +7724,7 @@ const _sfc_main$17 = {
|
|
|
7625
7724
|
__props.title ? (openBlock(), createElementBlock("title", _hoisted_2$8, toDisplayString(__props.title), 1)) : createCommentVNode("", true),
|
|
7626
7725
|
createTextVNode(" " + toDisplayString(__props.text?.replace(/ /g, " ")), 1)
|
|
7627
7726
|
])
|
|
7628
|
-
], 16, _hoisted_1$
|
|
7727
|
+
], 16, _hoisted_1$q);
|
|
7629
7728
|
};
|
|
7630
7729
|
}
|
|
7631
7730
|
};
|
|
@@ -14787,9 +14886,9 @@ XmlRenderer.prototype.out = out;
|
|
|
14787
14886
|
XmlRenderer.prototype.cr = cr;
|
|
14788
14887
|
XmlRenderer.prototype.tag = tag;
|
|
14789
14888
|
XmlRenderer.prototype.esc = escapeXml;
|
|
14790
|
-
const _hoisted_1$
|
|
14889
|
+
const _hoisted_1$p = ["text-anchor", "font-size"];
|
|
14791
14890
|
const _hoisted_2$7 = { key: 0 };
|
|
14792
|
-
const _sfc_main$
|
|
14891
|
+
const _sfc_main$17 = {
|
|
14793
14892
|
__name: "CoreMarkdown",
|
|
14794
14893
|
props: {
|
|
14795
14894
|
x: { type: Number, default: 0 },
|
|
@@ -14818,8 +14917,9 @@ const _sfc_main$16 = {
|
|
|
14818
14917
|
const parser = new Parser();
|
|
14819
14918
|
const ele = useTemplateRef("ele");
|
|
14820
14919
|
const textBox = reactive({ width: 0, height: 0 });
|
|
14920
|
+
const visible = inject("vvplot-visible", true);
|
|
14821
14921
|
watch(
|
|
14822
|
-
[ele, () => __props.fontSize, () => __props.size, () => __props.text, () => __props.textLength, () => __props.fontFamily],
|
|
14922
|
+
[ele, visible, () => __props.fontSize, () => __props.size, () => __props.text, () => __props.textLength, () => __props.fontFamily],
|
|
14823
14923
|
async ([e]) => {
|
|
14824
14924
|
if (!e) return;
|
|
14825
14925
|
await nextTick();
|
|
@@ -14932,11 +15032,11 @@ const _sfc_main$16 = {
|
|
|
14932
15032
|
(openBlock(true), createElementBlock(Fragment, null, renderList(textFragments.value, (span) => {
|
|
14933
15033
|
return openBlock(), createElementBlock("tspan", mergeProps({ ref_for: true }, span.vbind), toDisplayString(span.text), 17);
|
|
14934
15034
|
}), 256))
|
|
14935
|
-
], 16, _hoisted_1$
|
|
15035
|
+
], 16, _hoisted_1$p);
|
|
14936
15036
|
};
|
|
14937
15037
|
}
|
|
14938
15038
|
};
|
|
14939
|
-
const _sfc_main$
|
|
15039
|
+
const _sfc_main$16 = {
|
|
14940
15040
|
__name: "CoreAxisLabel",
|
|
14941
15041
|
props: {
|
|
14942
15042
|
type: String,
|
|
@@ -14998,11 +15098,11 @@ const _sfc_main$15 = {
|
|
|
14998
15098
|
}
|
|
14999
15099
|
};
|
|
15000
15100
|
return (_ctx, _cache) => {
|
|
15001
|
-
return __props.type == "markdown" ? (openBlock(), createBlock(_sfc_main$
|
|
15101
|
+
return __props.type == "markdown" ? (openBlock(), createBlock(_sfc_main$17, mergeProps({ key: 0 }, toHandlers(vOn)), null, 16)) : (openBlock(), createBlock(_sfc_main$18, mergeProps({ key: 1 }, toHandlers(vOn)), null, 16));
|
|
15002
15102
|
};
|
|
15003
15103
|
}
|
|
15004
15104
|
};
|
|
15005
|
-
const _hoisted_1$
|
|
15105
|
+
const _hoisted_1$o = ["transform"];
|
|
15006
15106
|
const _hoisted_2$6 = ["x2"];
|
|
15007
15107
|
const _hoisted_3$4 = {
|
|
15008
15108
|
class: "vvplot-interactive",
|
|
@@ -15015,7 +15115,7 @@ const _hoisted_5$2 = {
|
|
|
15015
15115
|
fill: "transparent"
|
|
15016
15116
|
};
|
|
15017
15117
|
const _hoisted_6$2 = ["x"];
|
|
15018
|
-
const _sfc_main$
|
|
15118
|
+
const _sfc_main$15 = {
|
|
15019
15119
|
__name: "CoreAxisH",
|
|
15020
15120
|
props: {
|
|
15021
15121
|
coord: String,
|
|
@@ -15204,16 +15304,15 @@ const _sfc_main$14 = {
|
|
|
15204
15304
|
let { xmin, xmax, ymin, ymax } = __props.pos2coord({ hmin: hmin0 + dh, hmax: hmax0 + dh });
|
|
15205
15305
|
Object.assign(rangePreview, { xmin, xmax, ymin, ymax });
|
|
15206
15306
|
};
|
|
15207
|
-
e.target.
|
|
15307
|
+
e.target.addEventListener("pointerup", function(ev) {
|
|
15208
15308
|
e.target.onpointermove = null;
|
|
15209
|
-
e.target.onpointerup = null;
|
|
15210
15309
|
e.target.style.cursor = null;
|
|
15211
15310
|
if (!pointerMoved) return;
|
|
15212
15311
|
moveTimer = setTimeout(() => {
|
|
15213
15312
|
applyTransform(act, ev);
|
|
15214
15313
|
movementX = 0;
|
|
15215
15314
|
}, 300);
|
|
15216
|
-
};
|
|
15315
|
+
}, { once: true });
|
|
15217
15316
|
}
|
|
15218
15317
|
function axisRescaleLeftPointerdown(e) {
|
|
15219
15318
|
let act = __props.action.find((a) => a.action == "rescale");
|
|
@@ -15239,11 +15338,10 @@ const _sfc_main$14 = {
|
|
|
15239
15338
|
});
|
|
15240
15339
|
Object.assign(rangePreview, { xmin, xmax, ymin, ymax });
|
|
15241
15340
|
};
|
|
15242
|
-
e.target.
|
|
15341
|
+
e.target.addEventListener("pointerup", function(ev) {
|
|
15243
15342
|
e.target.onpointermove = null;
|
|
15244
|
-
e.target.onpointerup = null;
|
|
15245
15343
|
applyTransform(act, ev);
|
|
15246
|
-
};
|
|
15344
|
+
}, { once: true });
|
|
15247
15345
|
}
|
|
15248
15346
|
function axisRescaleRightPointerdown(e) {
|
|
15249
15347
|
let act = __props.action.find((a) => a.action == "rescale");
|
|
@@ -15269,11 +15367,10 @@ const _sfc_main$14 = {
|
|
|
15269
15367
|
});
|
|
15270
15368
|
Object.assign(rangePreview, { xmin, xmax, ymin, ymax });
|
|
15271
15369
|
};
|
|
15272
|
-
e.target.
|
|
15370
|
+
e.target.addEventListener("pointerup", function(ev) {
|
|
15273
15371
|
e.target.onpointermove = null;
|
|
15274
|
-
e.target.onpointerup = null;
|
|
15275
15372
|
applyTransform(act, ev);
|
|
15276
|
-
};
|
|
15373
|
+
}, { once: true });
|
|
15277
15374
|
}
|
|
15278
15375
|
let wheelDelta = 0, wheelTimer;
|
|
15279
15376
|
function axisWheel(e) {
|
|
@@ -15381,7 +15478,7 @@ const _sfc_main$14 = {
|
|
|
15381
15478
|
_cache[2] || (_cache[2] = createTextVNode()),
|
|
15382
15479
|
(openBlock(true), createElementBlock(Fragment, null, renderList(tickTexts.value, (tick) => {
|
|
15383
15480
|
return openBlock(), createElementBlock("g", mergeProps({ ref_for: true }, tick.wrapper), [
|
|
15384
|
-
createVNode(_sfc_main$
|
|
15481
|
+
createVNode(_sfc_main$16, mergeProps({ ref_for: true }, tick.text, { getPosition }), null, 16)
|
|
15385
15482
|
], 16);
|
|
15386
15483
|
}), 256)),
|
|
15387
15484
|
_cache[3] || (_cache[3] = createTextVNode()),
|
|
@@ -15414,13 +15511,13 @@ const _sfc_main$14 = {
|
|
|
15414
15511
|
])) : createCommentVNode("", true),
|
|
15415
15512
|
_cache[5] || (_cache[5] = createTextVNode()),
|
|
15416
15513
|
axisTitle.value.text ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
|
|
15417
|
-
__props.theme.title_type == "markdown" ? (openBlock(), createBlock(_sfc_main$
|
|
15514
|
+
__props.theme.title_type == "markdown" ? (openBlock(), createBlock(_sfc_main$17, normalizeProps(mergeProps({ key: 0 }, axisTitle.value)), null, 16)) : (openBlock(), createBlock(_sfc_main$18, normalizeProps(mergeProps({ key: 1 }, axisTitle.value)), null, 16))
|
|
15418
15515
|
], 64)) : createCommentVNode("", true)
|
|
15419
|
-
], 12, _hoisted_1$
|
|
15516
|
+
], 12, _hoisted_1$o);
|
|
15420
15517
|
};
|
|
15421
15518
|
}
|
|
15422
15519
|
};
|
|
15423
|
-
const _hoisted_1$
|
|
15520
|
+
const _hoisted_1$n = ["transform"];
|
|
15424
15521
|
const _hoisted_2$5 = ["y2"];
|
|
15425
15522
|
const _hoisted_3$3 = {
|
|
15426
15523
|
class: "vvplot-interactive",
|
|
@@ -15433,7 +15530,7 @@ const _hoisted_5$1 = {
|
|
|
15433
15530
|
fill: "transparent"
|
|
15434
15531
|
};
|
|
15435
15532
|
const _hoisted_6$1 = ["y"];
|
|
15436
|
-
const _sfc_main$
|
|
15533
|
+
const _sfc_main$14 = {
|
|
15437
15534
|
__name: "CoreAxisV",
|
|
15438
15535
|
props: {
|
|
15439
15536
|
coord: String,
|
|
@@ -15622,16 +15719,15 @@ const _sfc_main$13 = {
|
|
|
15622
15719
|
let { xmin, xmax, ymin, ymax } = __props.pos2coord({ vmin: vmin0 + dv, vmax: vmax0 + dv });
|
|
15623
15720
|
Object.assign(rangePreview, { xmin, xmax, ymin, ymax });
|
|
15624
15721
|
};
|
|
15625
|
-
e.target.
|
|
15722
|
+
e.target.addEventListener("pointerup", function(ev) {
|
|
15626
15723
|
e.target.onpointermove = null;
|
|
15627
|
-
e.target.onpointerup = null;
|
|
15628
15724
|
e.target.style.cursor = null;
|
|
15629
15725
|
if (!pointerMoved) return;
|
|
15630
15726
|
moveTimer = setTimeout(() => {
|
|
15631
15727
|
applyTransform(act, ev);
|
|
15632
15728
|
movementY = 0;
|
|
15633
15729
|
}, 300);
|
|
15634
|
-
};
|
|
15730
|
+
}, { once: true });
|
|
15635
15731
|
}
|
|
15636
15732
|
function axisRescaleTopPointerdown(e) {
|
|
15637
15733
|
let act = __props.action.find((a) => a.action == "rescale");
|
|
@@ -15657,11 +15753,10 @@ const _sfc_main$13 = {
|
|
|
15657
15753
|
});
|
|
15658
15754
|
Object.assign(rangePreview, { xmin, xmax, ymin, ymax });
|
|
15659
15755
|
};
|
|
15660
|
-
e.target.
|
|
15756
|
+
e.target.addEventListener("pointerup", function(ev) {
|
|
15661
15757
|
e.target.onpointermove = null;
|
|
15662
|
-
e.target.onpointerup = null;
|
|
15663
15758
|
applyTransform(act, ev);
|
|
15664
|
-
};
|
|
15759
|
+
}, { once: true });
|
|
15665
15760
|
}
|
|
15666
15761
|
function axisRescaleBottomPointerdown(e) {
|
|
15667
15762
|
let act = __props.action.find((a) => a.action == "rescale");
|
|
@@ -15687,11 +15782,10 @@ const _sfc_main$13 = {
|
|
|
15687
15782
|
});
|
|
15688
15783
|
Object.assign(rangePreview, { xmin, xmax, ymin, ymax });
|
|
15689
15784
|
};
|
|
15690
|
-
e.target.
|
|
15785
|
+
e.target.addEventListener("pointerup", function(ev) {
|
|
15691
15786
|
e.target.onpointermove = null;
|
|
15692
|
-
e.target.onpointerup = null;
|
|
15693
15787
|
applyTransform(act, ev);
|
|
15694
|
-
};
|
|
15788
|
+
}, { once: true });
|
|
15695
15789
|
}
|
|
15696
15790
|
let wheelDelta = 0, wheelTimer;
|
|
15697
15791
|
function axisWheel(e) {
|
|
@@ -15799,7 +15893,7 @@ const _sfc_main$13 = {
|
|
|
15799
15893
|
_cache[2] || (_cache[2] = createTextVNode()),
|
|
15800
15894
|
(openBlock(true), createElementBlock(Fragment, null, renderList(tickTexts.value, (tick) => {
|
|
15801
15895
|
return openBlock(), createElementBlock("g", mergeProps({ ref_for: true }, tick.wrapper), [
|
|
15802
|
-
createVNode(_sfc_main$
|
|
15896
|
+
createVNode(_sfc_main$16, mergeProps({ ref_for: true }, tick.text, { getPosition }), null, 16)
|
|
15803
15897
|
], 16);
|
|
15804
15898
|
}), 256)),
|
|
15805
15899
|
_cache[3] || (_cache[3] = createTextVNode()),
|
|
@@ -15832,13 +15926,13 @@ const _sfc_main$13 = {
|
|
|
15832
15926
|
])) : createCommentVNode("", true),
|
|
15833
15927
|
_cache[5] || (_cache[5] = createTextVNode()),
|
|
15834
15928
|
axisTitle.value.text ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
|
|
15835
|
-
__props.theme.title_type == "markdown" ? (openBlock(), createBlock(_sfc_main$
|
|
15929
|
+
__props.theme.title_type == "markdown" ? (openBlock(), createBlock(_sfc_main$17, normalizeProps(mergeProps({ key: 0 }, axisTitle.value)), null, 16)) : (openBlock(), createBlock(_sfc_main$18, normalizeProps(mergeProps({ key: 1 }, axisTitle.value)), null, 16))
|
|
15836
15930
|
], 64)) : createCommentVNode("", true)
|
|
15837
|
-
], 12, _hoisted_1$
|
|
15931
|
+
], 12, _hoisted_1$n);
|
|
15838
15932
|
};
|
|
15839
15933
|
}
|
|
15840
15934
|
};
|
|
15841
|
-
const _sfc_main$
|
|
15935
|
+
const _sfc_main$13 = {
|
|
15842
15936
|
__name: "CoreAxis",
|
|
15843
15937
|
props: {
|
|
15844
15938
|
theme: { type: Object, default: () => ({}) },
|
|
@@ -15847,8 +15941,8 @@ const _sfc_main$12 = {
|
|
|
15847
15941
|
},
|
|
15848
15942
|
setup(__props) {
|
|
15849
15943
|
const axis = {
|
|
15850
|
-
h: _sfc_main$
|
|
15851
|
-
v: _sfc_main$
|
|
15944
|
+
h: _sfc_main$15,
|
|
15945
|
+
v: _sfc_main$14
|
|
15852
15946
|
};
|
|
15853
15947
|
return (_ctx, _cache) => {
|
|
15854
15948
|
return __props.position != "none" ? (openBlock(), createBlock(resolveDynamicComponent(axis[__props.orientation]), {
|
|
@@ -15859,7 +15953,7 @@ const _sfc_main$12 = {
|
|
|
15859
15953
|
};
|
|
15860
15954
|
}
|
|
15861
15955
|
};
|
|
15862
|
-
const _sfc_main$
|
|
15956
|
+
const _sfc_main$12 = {
|
|
15863
15957
|
__name: "CoreGridH",
|
|
15864
15958
|
props: {
|
|
15865
15959
|
breaks: { type: Array, default: () => [] },
|
|
@@ -15931,7 +16025,7 @@ const _sfc_main$11 = {
|
|
|
15931
16025
|
};
|
|
15932
16026
|
}
|
|
15933
16027
|
};
|
|
15934
|
-
const _sfc_main$
|
|
16028
|
+
const _sfc_main$11 = {
|
|
15935
16029
|
__name: "CoreGridV",
|
|
15936
16030
|
props: {
|
|
15937
16031
|
breaks: { type: Array, default: () => [] },
|
|
@@ -16003,7 +16097,7 @@ const _sfc_main$10 = {
|
|
|
16003
16097
|
};
|
|
16004
16098
|
}
|
|
16005
16099
|
};
|
|
16006
|
-
const _sfc_main
|
|
16100
|
+
const _sfc_main$10 = {
|
|
16007
16101
|
__name: "CoreCanvasBoxplot",
|
|
16008
16102
|
props: {
|
|
16009
16103
|
extendX: { type: Number, default: 0 },
|
|
@@ -16037,83 +16131,81 @@ const _sfc_main$$ = {
|
|
|
16037
16131
|
ctx.scale(__props.dpi / 96, __props.dpi / 96);
|
|
16038
16132
|
ctx.translate(__props.layout.l + __props.layout.fullWidth * __props.extendX, __props.layout.t + __props.layout.fullHeight * __props.extendY);
|
|
16039
16133
|
let _path_data = /* @__PURE__ */ new Map(), path_data = /* @__PURE__ */ new Map();
|
|
16040
|
-
for (
|
|
16041
|
-
|
|
16042
|
-
|
|
16043
|
-
|
|
16044
|
-
|
|
16045
|
-
|
|
16046
|
-
|
|
16047
|
-
|
|
16048
|
-
|
|
16049
|
-
|
|
16050
|
-
|
|
16051
|
-
|
|
16052
|
-
|
|
16053
|
-
|
|
16054
|
-
|
|
16055
|
-
|
|
16056
|
-
|
|
16057
|
-
|
|
16058
|
-
|
|
16059
|
-
|
|
16060
|
-
|
|
16061
|
-
|
|
16062
|
-
|
|
16063
|
-
|
|
16064
|
-
|
|
16065
|
-
|
|
16066
|
-
}
|
|
16067
|
-
|
|
16068
|
-
|
|
16069
|
-
|
|
16070
|
-
|
|
16071
|
-
|
|
16072
|
-
|
|
16073
|
-
|
|
16074
|
-
|
|
16075
|
-
|
|
16076
|
-
|
|
16077
|
-
|
|
16078
|
-
|
|
16079
|
-
|
|
16080
|
-
|
|
16081
|
-
|
|
16082
|
-
|
|
16083
|
-
|
|
16084
|
-
|
|
16085
|
-
|
|
16086
|
-
|
|
16087
|
-
|
|
16088
|
-
|
|
16089
|
-
|
|
16090
|
-
|
|
16091
|
-
|
|
16092
|
-
|
|
16093
|
-
|
|
16094
|
-
|
|
16095
|
-
|
|
16096
|
-
|
|
16097
|
-
|
|
16098
|
-
|
|
16099
|
-
|
|
16100
|
-
|
|
16101
|
-
|
|
16134
|
+
for (let {
|
|
16135
|
+
x: x2,
|
|
16136
|
+
xmin,
|
|
16137
|
+
xmax,
|
|
16138
|
+
y: y2,
|
|
16139
|
+
ymin,
|
|
16140
|
+
ymax,
|
|
16141
|
+
lwisker,
|
|
16142
|
+
Q1,
|
|
16143
|
+
median,
|
|
16144
|
+
Q3,
|
|
16145
|
+
uwisker,
|
|
16146
|
+
outliers,
|
|
16147
|
+
$xmin,
|
|
16148
|
+
$xmax,
|
|
16149
|
+
$ymin,
|
|
16150
|
+
$ymax,
|
|
16151
|
+
fill = "white",
|
|
16152
|
+
color: color2 = "black",
|
|
16153
|
+
linewidth = 1,
|
|
16154
|
+
linetype,
|
|
16155
|
+
alpha: alpha2,
|
|
16156
|
+
"translate-x": translateX = 0,
|
|
16157
|
+
"translate-y": translateY = 0,
|
|
16158
|
+
$raw
|
|
16159
|
+
} of __props.data) {
|
|
16160
|
+
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 });
|
|
16161
|
+
const { h: lx1, v: ly1 } = __props.coord2pos(x2 == null ? { y: y2, x: lwisker } : { x: x2, y: lwisker });
|
|
16162
|
+
const { h: lx2, v: ly2 } = __props.coord2pos(x2 == null ? { y: y2, x: uwisker } : { x: x2, y: uwisker });
|
|
16163
|
+
const { h: mx1, v: my1 } = __props.coord2pos(x2 == null ? { y: ymin, x: median } : { x: xmin, y: median });
|
|
16164
|
+
const { h: mx2, v: my2 } = __props.coord2pos(x2 == null ? { y: ymax, x: median } : { x: xmax, y: median });
|
|
16165
|
+
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 });
|
|
16166
|
+
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 });
|
|
16167
|
+
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 });
|
|
16168
|
+
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 });
|
|
16169
|
+
ctx.globalAlpha = alpha2;
|
|
16170
|
+
ctx.setLineDash(parseLinetype(linetype));
|
|
16171
|
+
const linepath2d = new Path2D();
|
|
16172
|
+
linepath2d.moveTo(lx1 + translateX, ly1 + translateY);
|
|
16173
|
+
linepath2d.lineTo(lx2 + translateX, ly2 + translateY);
|
|
16174
|
+
const wiskerpath2d = new Path2D();
|
|
16175
|
+
wiskerpath2d.moveTo(uwx1 + translateX, uwy1 + translateY);
|
|
16176
|
+
wiskerpath2d.lineTo(uwx2 + translateX, uwy2 + translateY);
|
|
16177
|
+
wiskerpath2d.moveTo(lwx1 + translateX, lwy1 + translateY);
|
|
16178
|
+
wiskerpath2d.lineTo(lwx2 + translateX, lwy2 + translateY);
|
|
16179
|
+
const rectpath2d = new Path2D();
|
|
16180
|
+
rectpath2d.rect(rx1 + translateX, ry1 + translateY, rx2 - rx1, ry2 - ry1);
|
|
16181
|
+
_path_data.set(rectpath2d, $raw);
|
|
16182
|
+
const medianpath2d = new Path2D();
|
|
16183
|
+
medianpath2d.moveTo(mx1 + translateX, my1 + translateY);
|
|
16184
|
+
medianpath2d.lineTo(mx2 + translateX, my2 + translateY);
|
|
16185
|
+
if (color2 != null && color2 !== "none") {
|
|
16186
|
+
ctx.strokeStyle = color2;
|
|
16187
|
+
ctx.lineWidth = linewidth;
|
|
16188
|
+
ctx.stroke(linepath2d);
|
|
16189
|
+
ctx.stroke(wiskerpath2d);
|
|
16190
|
+
}
|
|
16191
|
+
if (fill !== "none") {
|
|
16192
|
+
ctx.fillStyle = fill;
|
|
16193
|
+
ctx.fill(rectpath2d);
|
|
16194
|
+
}
|
|
16195
|
+
if (color2 != null && color2 !== "none") {
|
|
16196
|
+
ctx.stroke(rectpath2d);
|
|
16197
|
+
ctx.lineWidth = linewidth * 2;
|
|
16198
|
+
ctx.stroke(medianpath2d);
|
|
16199
|
+
}
|
|
16200
|
+
for (let { x: x3, y: y3, $raw: $raw2 } of outliers) {
|
|
16201
|
+
const { h: ox, v: oy } = __props.coord2pos({ x: x3, y: y3 });
|
|
16202
|
+
const outlierpath2d = new Path2D();
|
|
16203
|
+
outlierpath2d.arc(ox + translateX, oy + translateY, 2, 0, Math.PI * 2);
|
|
16102
16204
|
if (color2 != null && color2 !== "none") {
|
|
16103
|
-
ctx.
|
|
16104
|
-
ctx.
|
|
16105
|
-
ctx.stroke(medianpath2d);
|
|
16106
|
-
}
|
|
16107
|
-
for (let { x: x3, y: y3, $raw: $raw2 } of outliers) {
|
|
16108
|
-
const { h: ox, v: oy } = __props.coord2pos({ x: x3, y: y3 });
|
|
16109
|
-
const outlierpath2d = new Path2D();
|
|
16110
|
-
outlierpath2d.arc(ox + translateX, oy + translateY, 2, 0, Math.PI * 2);
|
|
16111
|
-
if (color2 != null && color2 !== "none") {
|
|
16112
|
-
ctx.fillStyle = color2;
|
|
16113
|
-
ctx.fill(outlierpath2d);
|
|
16114
|
-
}
|
|
16115
|
-
_path_data.set(outlierpath2d, $raw2);
|
|
16205
|
+
ctx.fillStyle = color2;
|
|
16206
|
+
ctx.fill(outlierpath2d);
|
|
16116
16207
|
}
|
|
16208
|
+
_path_data.set(outlierpath2d, $raw2);
|
|
16117
16209
|
}
|
|
16118
16210
|
}
|
|
16119
16211
|
for (let path2 of Array.from(_path_data.keys()).reverse()) {
|
|
@@ -16141,11 +16233,11 @@ const _sfc_main$$ = {
|
|
|
16141
16233
|
dispatchEvent: (event) => layerCanvas.value?.dispatchEvent?.(event)
|
|
16142
16234
|
});
|
|
16143
16235
|
return (_ctx, _cache) => {
|
|
16144
|
-
return openBlock(), createElementBlock("foreignObject", mergeProps(vBind.value, { ref: "container" }), null, 16);
|
|
16236
|
+
return openBlock(), createElementBlock("foreignObject", mergeProps({ class: "vvplot-layer" }, vBind.value, { ref: "container" }), null, 16);
|
|
16145
16237
|
};
|
|
16146
16238
|
}
|
|
16147
16239
|
};
|
|
16148
|
-
const _sfc_main
|
|
16240
|
+
const _sfc_main$$ = {
|
|
16149
16241
|
__name: "CoreCanvasCurve",
|
|
16150
16242
|
props: {
|
|
16151
16243
|
extendX: { type: Number, default: 0 },
|
|
@@ -16179,41 +16271,39 @@ const _sfc_main$_ = {
|
|
|
16179
16271
|
ctx.scale(__props.dpi / 96, __props.dpi / 96);
|
|
16180
16272
|
ctx.translate(__props.layout.l + __props.layout.fullWidth * __props.extendX, __props.layout.t + __props.layout.fullHeight * __props.extendY);
|
|
16181
16273
|
let _path_data = /* @__PURE__ */ new Map(), path_data = /* @__PURE__ */ new Map();
|
|
16182
|
-
for (
|
|
16183
|
-
|
|
16184
|
-
|
|
16185
|
-
|
|
16186
|
-
|
|
16187
|
-
|
|
16188
|
-
|
|
16189
|
-
|
|
16190
|
-
|
|
16191
|
-
|
|
16192
|
-
|
|
16193
|
-
|
|
16194
|
-
}
|
|
16195
|
-
|
|
16196
|
-
|
|
16197
|
-
|
|
16198
|
-
|
|
16199
|
-
|
|
16200
|
-
|
|
16201
|
-
|
|
16202
|
-
|
|
16203
|
-
|
|
16204
|
-
|
|
16205
|
-
|
|
16206
|
-
|
|
16207
|
-
|
|
16208
|
-
|
|
16209
|
-
|
|
16210
|
-
|
|
16211
|
-
|
|
16212
|
-
|
|
16213
|
-
|
|
16214
|
-
|
|
16215
|
-
ctx.stroke(path2d);
|
|
16216
|
-
}
|
|
16274
|
+
for (let {
|
|
16275
|
+
points,
|
|
16276
|
+
fill,
|
|
16277
|
+
color: color2,
|
|
16278
|
+
linewidth,
|
|
16279
|
+
linetype,
|
|
16280
|
+
alpha: alpha2,
|
|
16281
|
+
"translate-x": translateX = 0,
|
|
16282
|
+
"translate-y": translateY = 0,
|
|
16283
|
+
$raw,
|
|
16284
|
+
interpolate: interpolate2
|
|
16285
|
+
} of __props.data) {
|
|
16286
|
+
points = points.map((p) => (({ h: x2, v: y2 }) => ({ x: x2, y: y2 }))(__props.coord2pos(p))).filter((p) => p.x != null && p.y != null);
|
|
16287
|
+
if (points.length === 0) continue;
|
|
16288
|
+
const path2d = new Path2D();
|
|
16289
|
+
let interpolatorFn = typeof interpolate2 == "function" ? interpolate2 : interpolators[interpolate2] ?? natural$1;
|
|
16290
|
+
let interpolator = interpolatorFn(path2d);
|
|
16291
|
+
interpolator.lineStart();
|
|
16292
|
+
for (let i = 0; i < points.length; i++) {
|
|
16293
|
+
interpolator.point(points[i].x + translateX, points[i].y + translateY);
|
|
16294
|
+
}
|
|
16295
|
+
interpolator.lineEnd();
|
|
16296
|
+
_path_data.set(path2d, $raw);
|
|
16297
|
+
ctx.lineWidth = linewidth;
|
|
16298
|
+
ctx.globalAlpha = alpha2;
|
|
16299
|
+
ctx.setLineDash(parseLinetype(linetype));
|
|
16300
|
+
if (fill !== "none") {
|
|
16301
|
+
ctx.fillStyle = fill;
|
|
16302
|
+
ctx.fill(path2d);
|
|
16303
|
+
}
|
|
16304
|
+
if (color2 != null && color2 !== "none") {
|
|
16305
|
+
ctx.strokeStyle = color2;
|
|
16306
|
+
ctx.stroke(path2d);
|
|
16217
16307
|
}
|
|
16218
16308
|
}
|
|
16219
16309
|
for (let path2 of Array.from(_path_data.keys()).reverse()) {
|
|
@@ -16250,11 +16340,11 @@ const _sfc_main$_ = {
|
|
|
16250
16340
|
natural: natural$1
|
|
16251
16341
|
};
|
|
16252
16342
|
return (_ctx, _cache) => {
|
|
16253
|
-
return openBlock(), createElementBlock("foreignObject", mergeProps(vBind.value, { ref: "container" }), null, 16);
|
|
16343
|
+
return openBlock(), createElementBlock("foreignObject", mergeProps({ class: "vvplot-layer" }, vBind.value, { ref: "container" }), null, 16);
|
|
16254
16344
|
};
|
|
16255
16345
|
}
|
|
16256
16346
|
};
|
|
16257
|
-
const _sfc_main$
|
|
16347
|
+
const _sfc_main$_ = {
|
|
16258
16348
|
__name: "CoreCanvasEllipse",
|
|
16259
16349
|
props: {
|
|
16260
16350
|
extendX: { type: Number, default: 0 },
|
|
@@ -16288,46 +16378,44 @@ const _sfc_main$Z = {
|
|
|
16288
16378
|
ctx.scale(__props.dpi / 96, __props.dpi / 96);
|
|
16289
16379
|
ctx.translate(__props.layout.l + __props.layout.fullWidth * __props.extendX, __props.layout.t + __props.layout.fullHeight * __props.extendY);
|
|
16290
16380
|
let _path_data = /* @__PURE__ */ new Map(), path_data = /* @__PURE__ */ new Map();
|
|
16291
|
-
for (
|
|
16292
|
-
|
|
16293
|
-
|
|
16294
|
-
|
|
16295
|
-
|
|
16296
|
-
|
|
16297
|
-
|
|
16298
|
-
|
|
16299
|
-
|
|
16300
|
-
|
|
16301
|
-
|
|
16302
|
-
|
|
16303
|
-
|
|
16304
|
-
|
|
16305
|
-
|
|
16306
|
-
|
|
16307
|
-
|
|
16308
|
-
|
|
16309
|
-
|
|
16310
|
-
|
|
16311
|
-
|
|
16312
|
-
|
|
16313
|
-
|
|
16314
|
-
|
|
16315
|
-
|
|
16316
|
-
|
|
16317
|
-
|
|
16318
|
-
|
|
16319
|
-
|
|
16320
|
-
|
|
16321
|
-
|
|
16322
|
-
|
|
16323
|
-
|
|
16324
|
-
|
|
16325
|
-
|
|
16326
|
-
|
|
16327
|
-
|
|
16328
|
-
|
|
16329
|
-
ctx.stroke(path2d);
|
|
16330
|
-
}
|
|
16381
|
+
for (let {
|
|
16382
|
+
cx,
|
|
16383
|
+
cy,
|
|
16384
|
+
A,
|
|
16385
|
+
B,
|
|
16386
|
+
C,
|
|
16387
|
+
fill,
|
|
16388
|
+
color: color2,
|
|
16389
|
+
linewidth,
|
|
16390
|
+
linetype,
|
|
16391
|
+
alpha: alpha2,
|
|
16392
|
+
"translate-x": translateX = 0,
|
|
16393
|
+
"translate-y": translateY = 0,
|
|
16394
|
+
$raw
|
|
16395
|
+
} of __props.data) {
|
|
16396
|
+
let dx = Math.sqrt(C / (A * C - B * B)), dy = Math.sqrt(A / (A * C - B * B));
|
|
16397
|
+
const { h: ch, v: cv } = __props.coord2pos({ x: cx, y: cy });
|
|
16398
|
+
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 });
|
|
16399
|
+
let scaleX = (h2 - h1) / (2 * dx), scaleY = (v2 - v1) / (2 * dy);
|
|
16400
|
+
A /= scaleX * scaleX;
|
|
16401
|
+
B /= scaleX * scaleY;
|
|
16402
|
+
C /= scaleY * scaleY;
|
|
16403
|
+
const tr = A + C, det = A * C - B * B;
|
|
16404
|
+
const disc = Math.sqrt(Math.max(0, tr * tr / 4 - det));
|
|
16405
|
+
let rx2 = 1 / Math.sqrt(tr / 2 + disc), ry = 1 / Math.sqrt(tr / 2 - disc), angle2 = Math.atan2(2 * B, A - C) / 2;
|
|
16406
|
+
const path2d = new Path2D();
|
|
16407
|
+
path2d.ellipse(ch + translateX, cv + translateY, rx2, ry, angle2, 0, 2 * Math.PI);
|
|
16408
|
+
_path_data.set(path2d, $raw);
|
|
16409
|
+
ctx.lineWidth = linewidth;
|
|
16410
|
+
ctx.globalAlpha = alpha2;
|
|
16411
|
+
ctx.setLineDash(parseLinetype(linetype));
|
|
16412
|
+
if (fill !== "none") {
|
|
16413
|
+
ctx.fillStyle = fill;
|
|
16414
|
+
ctx.fill(path2d);
|
|
16415
|
+
}
|
|
16416
|
+
if (color2 != null && color2 !== "none") {
|
|
16417
|
+
ctx.strokeStyle = color2;
|
|
16418
|
+
ctx.stroke(path2d);
|
|
16331
16419
|
}
|
|
16332
16420
|
}
|
|
16333
16421
|
for (let path2 of Array.from(_path_data.keys()).reverse()) {
|
|
@@ -16355,11 +16443,11 @@ const _sfc_main$Z = {
|
|
|
16355
16443
|
dispatchEvent: (event) => layerCanvas.value?.dispatchEvent?.(event)
|
|
16356
16444
|
});
|
|
16357
16445
|
return (_ctx, _cache) => {
|
|
16358
|
-
return openBlock(), createElementBlock("foreignObject", mergeProps(vBind.value, { ref: "container" }), null, 16);
|
|
16446
|
+
return openBlock(), createElementBlock("foreignObject", mergeProps({ class: "vvplot-layer" }, vBind.value, { ref: "container" }), null, 16);
|
|
16359
16447
|
};
|
|
16360
16448
|
}
|
|
16361
16449
|
};
|
|
16362
|
-
const _sfc_main$
|
|
16450
|
+
const _sfc_main$Z = {
|
|
16363
16451
|
__name: "CoreCanvasLine",
|
|
16364
16452
|
props: {
|
|
16365
16453
|
extendX: { type: Number, default: 0 },
|
|
@@ -16393,33 +16481,31 @@ const _sfc_main$Y = {
|
|
|
16393
16481
|
ctx.scale(__props.dpi / 96, __props.dpi / 96);
|
|
16394
16482
|
ctx.translate(__props.layout.l + __props.layout.fullWidth * __props.extendX, __props.layout.t + __props.layout.fullHeight * __props.extendY);
|
|
16395
16483
|
let _path_data = /* @__PURE__ */ new Map(), path_data = /* @__PURE__ */ new Map();
|
|
16396
|
-
for (
|
|
16397
|
-
|
|
16398
|
-
|
|
16399
|
-
|
|
16400
|
-
|
|
16401
|
-
|
|
16402
|
-
|
|
16403
|
-
|
|
16404
|
-
|
|
16405
|
-
|
|
16406
|
-
|
|
16407
|
-
|
|
16408
|
-
|
|
16409
|
-
}
|
|
16410
|
-
|
|
16411
|
-
|
|
16412
|
-
|
|
16413
|
-
|
|
16414
|
-
|
|
16415
|
-
|
|
16416
|
-
|
|
16417
|
-
|
|
16418
|
-
|
|
16419
|
-
|
|
16420
|
-
|
|
16421
|
-
ctx.stroke(path2d);
|
|
16422
|
-
}
|
|
16484
|
+
for (let {
|
|
16485
|
+
x: x2,
|
|
16486
|
+
y: y2,
|
|
16487
|
+
xend,
|
|
16488
|
+
yend,
|
|
16489
|
+
color: color2 = "black",
|
|
16490
|
+
linewidth,
|
|
16491
|
+
alpha: alpha2,
|
|
16492
|
+
linetype,
|
|
16493
|
+
"translate-x": translateX = 0,
|
|
16494
|
+
"translate-y": translateY = 0,
|
|
16495
|
+
$raw
|
|
16496
|
+
} of __props.data) {
|
|
16497
|
+
const { h: x1, v: y1 } = __props.coord2pos({ x: x2, y: y2 });
|
|
16498
|
+
const { h: x22, v: y22 } = __props.coord2pos({ x: xend, y: yend });
|
|
16499
|
+
const path2d = new Path2D();
|
|
16500
|
+
path2d.moveTo(x1 + translateX, y1 + translateY);
|
|
16501
|
+
path2d.lineTo(x22 + translateX, y22 + translateY);
|
|
16502
|
+
_path_data.set(path2d, $raw);
|
|
16503
|
+
ctx.lineWidth = linewidth;
|
|
16504
|
+
ctx.globalAlpha = alpha2;
|
|
16505
|
+
ctx.setLineDash(parseLinetype(linetype));
|
|
16506
|
+
if (color2 != null && color2 !== "none") {
|
|
16507
|
+
ctx.strokeStyle = color2;
|
|
16508
|
+
ctx.stroke(path2d);
|
|
16423
16509
|
}
|
|
16424
16510
|
}
|
|
16425
16511
|
for (let path2 of Array.from(_path_data.keys()).reverse()) {
|
|
@@ -16447,11 +16533,11 @@ const _sfc_main$Y = {
|
|
|
16447
16533
|
dispatchEvent: (event) => layerCanvas.value?.dispatchEvent?.(event)
|
|
16448
16534
|
});
|
|
16449
16535
|
return (_ctx, _cache) => {
|
|
16450
|
-
return openBlock(), createElementBlock("foreignObject", mergeProps(vBind.value, { ref: "container" }), null, 16);
|
|
16536
|
+
return openBlock(), createElementBlock("foreignObject", mergeProps({ class: "vvplot-layer" }, vBind.value, { ref: "container" }), null, 16);
|
|
16451
16537
|
};
|
|
16452
16538
|
}
|
|
16453
16539
|
};
|
|
16454
|
-
const _sfc_main$
|
|
16540
|
+
const _sfc_main$Y = {
|
|
16455
16541
|
__name: "CoreCanvasPoint",
|
|
16456
16542
|
props: {
|
|
16457
16543
|
extendX: { type: Number, default: 0 },
|
|
@@ -16493,55 +16579,53 @@ const _sfc_main$X = {
|
|
|
16493
16579
|
ctx.scale(__props.dpi / 96, __props.dpi / 96);
|
|
16494
16580
|
ctx.translate(__props.layout.l + __props.layout.fullWidth * __props.extendX, __props.layout.t + __props.layout.fullHeight * __props.extendY);
|
|
16495
16581
|
let _path_data = /* @__PURE__ */ new Map(), path_data = /* @__PURE__ */ new Map();
|
|
16496
|
-
for (
|
|
16497
|
-
|
|
16498
|
-
|
|
16499
|
-
|
|
16500
|
-
|
|
16501
|
-
|
|
16502
|
-
|
|
16503
|
-
|
|
16504
|
-
|
|
16505
|
-
|
|
16506
|
-
|
|
16507
|
-
|
|
16508
|
-
|
|
16509
|
-
|
|
16510
|
-
|
|
16511
|
-
}
|
|
16512
|
-
|
|
16513
|
-
|
|
16514
|
-
|
|
16515
|
-
|
|
16516
|
-
|
|
16517
|
-
|
|
16518
|
-
|
|
16519
|
-
|
|
16520
|
-
|
|
16521
|
-
|
|
16522
|
-
|
|
16523
|
-
|
|
16524
|
-
|
|
16525
|
-
|
|
16526
|
-
|
|
16527
|
-
|
|
16528
|
-
|
|
16529
|
-
|
|
16530
|
-
|
|
16531
|
-
|
|
16532
|
-
|
|
16533
|
-
|
|
16534
|
-
|
|
16535
|
-
|
|
16536
|
-
|
|
16537
|
-
|
|
16538
|
-
|
|
16539
|
-
|
|
16540
|
-
|
|
16541
|
-
|
|
16542
|
-
|
|
16543
|
-
ctx.stroke(path2d);
|
|
16544
|
-
}
|
|
16582
|
+
for (let {
|
|
16583
|
+
x: x2,
|
|
16584
|
+
y: y2,
|
|
16585
|
+
size = 6,
|
|
16586
|
+
shape: shape2,
|
|
16587
|
+
color: color2,
|
|
16588
|
+
stroke,
|
|
16589
|
+
linewidth,
|
|
16590
|
+
linetype,
|
|
16591
|
+
alpha: alpha2,
|
|
16592
|
+
"translate-x": translateX = 0,
|
|
16593
|
+
"translate-y": translateY = 0,
|
|
16594
|
+
angle: angle2 = 0,
|
|
16595
|
+
$raw
|
|
16596
|
+
} of __props.data) {
|
|
16597
|
+
const { h: cx, v: cy } = __props.coord2pos({ x: x2, y: y2 });
|
|
16598
|
+
if (typeof angle2 == "object") {
|
|
16599
|
+
let { dx = 0, dy = 0 } = angle2;
|
|
16600
|
+
let { h, v } = __props.coord2pos({ x: x2 + dx, y: y2 + dy });
|
|
16601
|
+
angle2 = Math.atan2(v - cy, h - cx) * 180 / Math.PI;
|
|
16602
|
+
}
|
|
16603
|
+
const path2d = new Path2D();
|
|
16604
|
+
if (String(shape2).startsWith("path:")) {
|
|
16605
|
+
path2d.addPath(
|
|
16606
|
+
new Path2D(shape2.slice(5)),
|
|
16607
|
+
new DOMMatrix().translateSelf(cx + translateX, cy + translateY).rotate(angle2)
|
|
16608
|
+
);
|
|
16609
|
+
} else if (shape2 in paths) {
|
|
16610
|
+
path2d.addPath(
|
|
16611
|
+
new Path2D(paths[shape2](size)),
|
|
16612
|
+
new DOMMatrix().translate(cx + translateX, cy + translateY).rotate(angle2)
|
|
16613
|
+
);
|
|
16614
|
+
} else {
|
|
16615
|
+
path2d.arc(cx + translateX, cy + translateY, size / 2, 0, Math.PI * 2);
|
|
16616
|
+
}
|
|
16617
|
+
_path_data.set(path2d, $raw);
|
|
16618
|
+
ctx.lineWidth = linewidth;
|
|
16619
|
+
ctx.globalAlpha = alpha2;
|
|
16620
|
+
ctx.beginPath();
|
|
16621
|
+
if (color2 !== "none") {
|
|
16622
|
+
ctx.fillStyle = color2;
|
|
16623
|
+
ctx.fill(path2d);
|
|
16624
|
+
}
|
|
16625
|
+
if (stroke != null && stroke !== "none") {
|
|
16626
|
+
ctx.strokeStyle = stroke;
|
|
16627
|
+
ctx.setLineDash(parseLinetype(linetype));
|
|
16628
|
+
ctx.stroke(path2d);
|
|
16545
16629
|
}
|
|
16546
16630
|
}
|
|
16547
16631
|
for (let path2 of Array.from(_path_data.keys()).reverse()) {
|
|
@@ -16569,11 +16653,11 @@ const _sfc_main$X = {
|
|
|
16569
16653
|
dispatchEvent: (event) => layerCanvas.value?.dispatchEvent?.(event)
|
|
16570
16654
|
});
|
|
16571
16655
|
return (_ctx, _cache) => {
|
|
16572
|
-
return openBlock(), createElementBlock("foreignObject", mergeProps(vBind.value, { ref: "container" }), null, 16);
|
|
16656
|
+
return openBlock(), createElementBlock("foreignObject", mergeProps({ class: "vvplot-layer" }, vBind.value, { ref: "container" }), null, 16);
|
|
16573
16657
|
};
|
|
16574
16658
|
}
|
|
16575
16659
|
};
|
|
16576
|
-
const _sfc_main$
|
|
16660
|
+
const _sfc_main$X = {
|
|
16577
16661
|
__name: "CoreCanvasPolygon",
|
|
16578
16662
|
props: {
|
|
16579
16663
|
extendX: { type: Number, default: 0 },
|
|
@@ -16607,38 +16691,36 @@ const _sfc_main$W = {
|
|
|
16607
16691
|
ctx.scale(__props.dpi / 96, __props.dpi / 96);
|
|
16608
16692
|
ctx.translate(__props.layout.l + __props.layout.fullWidth * __props.extendX, __props.layout.t + __props.layout.fullHeight * __props.extendY);
|
|
16609
16693
|
let _path_data = /* @__PURE__ */ new Map(), path_data = /* @__PURE__ */ new Map();
|
|
16610
|
-
for (
|
|
16611
|
-
|
|
16612
|
-
|
|
16613
|
-
|
|
16614
|
-
|
|
16615
|
-
|
|
16616
|
-
|
|
16617
|
-
|
|
16618
|
-
|
|
16619
|
-
|
|
16620
|
-
|
|
16621
|
-
}
|
|
16622
|
-
|
|
16623
|
-
|
|
16624
|
-
|
|
16625
|
-
|
|
16626
|
-
|
|
16627
|
-
|
|
16628
|
-
|
|
16629
|
-
|
|
16630
|
-
|
|
16631
|
-
|
|
16632
|
-
|
|
16633
|
-
|
|
16634
|
-
|
|
16635
|
-
|
|
16636
|
-
|
|
16637
|
-
|
|
16638
|
-
|
|
16639
|
-
|
|
16640
|
-
ctx.stroke(path2d);
|
|
16641
|
-
}
|
|
16694
|
+
for (let {
|
|
16695
|
+
points,
|
|
16696
|
+
fill,
|
|
16697
|
+
color: color2,
|
|
16698
|
+
linewidth,
|
|
16699
|
+
linetype,
|
|
16700
|
+
alpha: alpha2,
|
|
16701
|
+
"translate-x": translateX = 0,
|
|
16702
|
+
"translate-y": translateY = 0,
|
|
16703
|
+
$raw
|
|
16704
|
+
} of __props.data) {
|
|
16705
|
+
points = points.map((p) => (({ h: x2, v: y2 }) => ({ x: x2, y: y2 }))(__props.coord2pos(p))).filter((p) => p.x != null && p.y != null);
|
|
16706
|
+
if (points.length === 0) continue;
|
|
16707
|
+
const path2d = new Path2D();
|
|
16708
|
+
path2d.moveTo(points[0].x + translateX, points[0].y + translateY);
|
|
16709
|
+
for (let i = 1; i < points.length; i++) {
|
|
16710
|
+
path2d.lineTo(points[i].x + translateX, points[i].y + translateY);
|
|
16711
|
+
}
|
|
16712
|
+
path2d.closePath();
|
|
16713
|
+
_path_data.set(path2d, $raw);
|
|
16714
|
+
ctx.lineWidth = linewidth;
|
|
16715
|
+
ctx.globalAlpha = alpha2;
|
|
16716
|
+
ctx.setLineDash(parseLinetype(linetype));
|
|
16717
|
+
if (fill !== "none") {
|
|
16718
|
+
ctx.fillStyle = fill;
|
|
16719
|
+
ctx.fill(path2d);
|
|
16720
|
+
}
|
|
16721
|
+
if (color2 != null && color2 !== "none") {
|
|
16722
|
+
ctx.strokeStyle = color2;
|
|
16723
|
+
ctx.stroke(path2d);
|
|
16642
16724
|
}
|
|
16643
16725
|
}
|
|
16644
16726
|
for (let path2 of Array.from(_path_data.keys()).reverse()) {
|
|
@@ -16666,11 +16748,11 @@ const _sfc_main$W = {
|
|
|
16666
16748
|
dispatchEvent: (event) => layerCanvas.value?.dispatchEvent?.(event)
|
|
16667
16749
|
});
|
|
16668
16750
|
return (_ctx, _cache) => {
|
|
16669
|
-
return openBlock(), createElementBlock("foreignObject", mergeProps(vBind.value, { ref: "container" }), null, 16);
|
|
16751
|
+
return openBlock(), createElementBlock("foreignObject", mergeProps({ class: "vvplot-layer" }, vBind.value, { ref: "container" }), null, 16);
|
|
16670
16752
|
};
|
|
16671
16753
|
}
|
|
16672
16754
|
};
|
|
16673
|
-
const _sfc_main$
|
|
16755
|
+
const _sfc_main$W = {
|
|
16674
16756
|
__name: "CoreCanvasRect",
|
|
16675
16757
|
props: {
|
|
16676
16758
|
extendX: { type: Number, default: 0 },
|
|
@@ -16704,36 +16786,34 @@ const _sfc_main$V = {
|
|
|
16704
16786
|
ctx.scale(__props.dpi / 96, __props.dpi / 96);
|
|
16705
16787
|
ctx.translate(__props.layout.l + __props.layout.fullWidth * __props.extendX, __props.layout.t + __props.layout.fullHeight * __props.extendY);
|
|
16706
16788
|
let _path_data = /* @__PURE__ */ new Map(), path_data = /* @__PURE__ */ new Map();
|
|
16707
|
-
for (
|
|
16708
|
-
|
|
16709
|
-
|
|
16710
|
-
|
|
16711
|
-
|
|
16712
|
-
|
|
16713
|
-
|
|
16714
|
-
|
|
16715
|
-
|
|
16716
|
-
|
|
16717
|
-
|
|
16718
|
-
|
|
16719
|
-
|
|
16720
|
-
|
|
16721
|
-
}
|
|
16722
|
-
|
|
16723
|
-
|
|
16724
|
-
|
|
16725
|
-
|
|
16726
|
-
|
|
16727
|
-
|
|
16728
|
-
|
|
16729
|
-
|
|
16730
|
-
|
|
16731
|
-
|
|
16732
|
-
|
|
16733
|
-
|
|
16734
|
-
|
|
16735
|
-
ctx.stroke(path2d);
|
|
16736
|
-
}
|
|
16789
|
+
for (let {
|
|
16790
|
+
xmin,
|
|
16791
|
+
xmax,
|
|
16792
|
+
ymin,
|
|
16793
|
+
ymax,
|
|
16794
|
+
fill,
|
|
16795
|
+
color: color2,
|
|
16796
|
+
linewidth,
|
|
16797
|
+
linetype,
|
|
16798
|
+
alpha: alpha2,
|
|
16799
|
+
"translate-x": translateX = 0,
|
|
16800
|
+
"translate-y": translateY = 0,
|
|
16801
|
+
$raw
|
|
16802
|
+
} of __props.data) {
|
|
16803
|
+
const { hmin: x1, hmax: x2, vmin: y1, vmax: y2 } = __props.coord2pos({ xmin, xmax, ymin, ymax });
|
|
16804
|
+
const path2d = new Path2D();
|
|
16805
|
+
path2d.rect(x1 + translateX, y1 + translateY, x2 - x1, y2 - y1);
|
|
16806
|
+
_path_data.set(path2d, $raw);
|
|
16807
|
+
ctx.lineWidth = linewidth;
|
|
16808
|
+
ctx.globalAlpha = alpha2;
|
|
16809
|
+
ctx.setLineDash(parseLinetype(linetype));
|
|
16810
|
+
if (fill !== "none") {
|
|
16811
|
+
ctx.fillStyle = fill;
|
|
16812
|
+
ctx.fill(path2d);
|
|
16813
|
+
}
|
|
16814
|
+
if (color2 !== "none" && color2 != null) {
|
|
16815
|
+
ctx.strokeStyle = color2;
|
|
16816
|
+
ctx.stroke(path2d);
|
|
16737
16817
|
}
|
|
16738
16818
|
}
|
|
16739
16819
|
for (let path2 of Array.from(_path_data.keys()).reverse()) {
|
|
@@ -16761,11 +16841,11 @@ const _sfc_main$V = {
|
|
|
16761
16841
|
dispatchEvent: (event) => layerCanvas.value?.dispatchEvent?.(event)
|
|
16762
16842
|
});
|
|
16763
16843
|
return (_ctx, _cache) => {
|
|
16764
|
-
return openBlock(), createElementBlock("foreignObject", mergeProps(vBind.value, { ref: "container" }), null, 16);
|
|
16844
|
+
return openBlock(), createElementBlock("foreignObject", mergeProps({ class: "vvplot-layer" }, vBind.value, { ref: "container" }), null, 16);
|
|
16765
16845
|
};
|
|
16766
16846
|
}
|
|
16767
16847
|
};
|
|
16768
|
-
const _sfc_main$
|
|
16848
|
+
const _sfc_main$V = {
|
|
16769
16849
|
__name: "CoreCanvasText",
|
|
16770
16850
|
props: {
|
|
16771
16851
|
extendX: { type: Number, default: 0 },
|
|
@@ -16799,77 +16879,75 @@ const _sfc_main$U = {
|
|
|
16799
16879
|
ctx.scale(__props.dpi / 96, __props.dpi / 96);
|
|
16800
16880
|
ctx.translate(__props.layout.l + __props.layout.fullWidth * __props.extendX, __props.layout.t + __props.layout.fullHeight * __props.extendY);
|
|
16801
16881
|
let _path_data = /* @__PURE__ */ new Map(), path_data = /* @__PURE__ */ new Map();
|
|
16802
|
-
for (
|
|
16803
|
-
|
|
16804
|
-
|
|
16805
|
-
|
|
16806
|
-
|
|
16807
|
-
|
|
16808
|
-
|
|
16809
|
-
|
|
16810
|
-
|
|
16811
|
-
|
|
16812
|
-
|
|
16813
|
-
|
|
16814
|
-
|
|
16815
|
-
|
|
16816
|
-
|
|
16817
|
-
|
|
16818
|
-
|
|
16819
|
-
|
|
16820
|
-
|
|
16821
|
-
|
|
16822
|
-
|
|
16823
|
-
|
|
16824
|
-
|
|
16825
|
-
|
|
16826
|
-
|
|
16827
|
-
|
|
16828
|
-
|
|
16829
|
-
|
|
16830
|
-
|
|
16831
|
-
|
|
16832
|
-
|
|
16833
|
-
|
|
16834
|
-
|
|
16835
|
-
|
|
16836
|
-
|
|
16837
|
-
|
|
16838
|
-
|
|
16839
|
-
|
|
16840
|
-
|
|
16841
|
-
|
|
16842
|
-
|
|
16843
|
-
|
|
16844
|
-
|
|
16845
|
-
|
|
16846
|
-
|
|
16847
|
-
|
|
16848
|
-
|
|
16849
|
-
|
|
16850
|
-
|
|
16851
|
-
|
|
16852
|
-
|
|
16853
|
-
|
|
16854
|
-
}
|
|
16855
|
-
|
|
16856
|
-
|
|
16857
|
-
|
|
16858
|
-
|
|
16859
|
-
|
|
16860
|
-
|
|
16861
|
-
|
|
16862
|
-
|
|
16863
|
-
|
|
16864
|
-
|
|
16865
|
-
|
|
16866
|
-
|
|
16867
|
-
|
|
16868
|
-
|
|
16869
|
-
ctx.strokeText(label, 0, 0);
|
|
16870
|
-
}
|
|
16871
|
-
ctx.restore();
|
|
16882
|
+
for (let {
|
|
16883
|
+
x: x2,
|
|
16884
|
+
y: y2,
|
|
16885
|
+
color: color2,
|
|
16886
|
+
size = 4,
|
|
16887
|
+
label = "",
|
|
16888
|
+
title,
|
|
16889
|
+
stroke,
|
|
16890
|
+
linewidth,
|
|
16891
|
+
linetype,
|
|
16892
|
+
alpha: alpha2,
|
|
16893
|
+
"anchor-x": anchorX,
|
|
16894
|
+
"anchor-y": anchorY,
|
|
16895
|
+
"dock-x": dockX,
|
|
16896
|
+
"dock-y": dockY,
|
|
16897
|
+
"translate-x": translateX = 0,
|
|
16898
|
+
"translate-y": translateY = 0,
|
|
16899
|
+
angle: angle2,
|
|
16900
|
+
"text-length": textLength,
|
|
16901
|
+
"font-family": fontFamily = "sans-serif",
|
|
16902
|
+
$raw
|
|
16903
|
+
} of __props.data) {
|
|
16904
|
+
ctx.save();
|
|
16905
|
+
const { h: tx, v: ty } = __props.coord2pos({ x: x2, y: y2 });
|
|
16906
|
+
ctx.textAlign = "center";
|
|
16907
|
+
ctx.textBaseline = "middle";
|
|
16908
|
+
ctx.lineWidth = linewidth;
|
|
16909
|
+
ctx.globalAlpha = alpha2;
|
|
16910
|
+
ctx.font = `${size * 4}px ${fontFamily}`;
|
|
16911
|
+
ctx.setLineDash(parseLinetype(linetype));
|
|
16912
|
+
ctx.translate(tx + translateX, ty + translateY);
|
|
16913
|
+
let { width: w, fontBoundingBoxAscent: a, fontBoundingBoxDescent: d } = ctx.measureText(label), width = w, height = a + d;
|
|
16914
|
+
if (typeof textLength == "object") {
|
|
16915
|
+
let { x: lx = 0, y: ly = 0 } = textLength;
|
|
16916
|
+
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 });
|
|
16917
|
+
width = Math.hypot(h1 - h2 || 0, v1 - v2 || 0);
|
|
16918
|
+
} else if (textLength != null) {
|
|
16919
|
+
width = textLength;
|
|
16920
|
+
}
|
|
16921
|
+
if (typeof angle2 == "object") {
|
|
16922
|
+
let { dx = 0, dy = 0 } = angle2;
|
|
16923
|
+
let { h, v } = __props.coord2pos({ x: x2 + dx, y: y2 + dy });
|
|
16924
|
+
angle2 = Math.atan2(v - ty, h - tx) * 180 / Math.PI;
|
|
16925
|
+
}
|
|
16926
|
+
if (dockX != null || dockY != null) {
|
|
16927
|
+
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);
|
|
16928
|
+
if (isNaN(alnX)) alnX = 0.5;
|
|
16929
|
+
if (isNaN(alnY)) alnY = 0.5;
|
|
16930
|
+
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));
|
|
16931
|
+
ctx.translate(w2 * (0.5 - alnX), h * (alnY - 0.5));
|
|
16932
|
+
ctx.rotate(angle2 * Math.PI / 180);
|
|
16933
|
+
} else {
|
|
16934
|
+
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);
|
|
16935
|
+
if (isNaN(alnX)) alnX = 0.5;
|
|
16936
|
+
if (isNaN(alnY)) alnY = 0.5;
|
|
16937
|
+
let w2 = width, h = height;
|
|
16938
|
+
ctx.rotate(angle2 * Math.PI / 180);
|
|
16939
|
+
ctx.translate(w2 * (0.5 - alnX), h * (alnY - 0.5));
|
|
16940
|
+
}
|
|
16941
|
+
if (width != w) ctx.scale(width / w, 1);
|
|
16942
|
+
if (color2 !== "none") {
|
|
16943
|
+
ctx.fillStyle = color2;
|
|
16944
|
+
ctx.fillText(label, 0, 0);
|
|
16945
|
+
}
|
|
16946
|
+
if (stroke != null && stroke !== "none") {
|
|
16947
|
+
ctx.strokeStyle = stroke;
|
|
16948
|
+
ctx.strokeText(label, 0, 0);
|
|
16872
16949
|
}
|
|
16950
|
+
ctx.restore();
|
|
16873
16951
|
}
|
|
16874
16952
|
for (let path2 of Array.from(_path_data.keys()).reverse()) {
|
|
16875
16953
|
path_data.set(path2, _path_data.get(path2));
|
|
@@ -16896,11 +16974,11 @@ const _sfc_main$U = {
|
|
|
16896
16974
|
dispatchEvent: (event) => layerCanvas.value?.dispatchEvent?.(event)
|
|
16897
16975
|
});
|
|
16898
16976
|
return (_ctx, _cache) => {
|
|
16899
|
-
return openBlock(), createElementBlock("foreignObject", mergeProps(vBind.value, { ref: "container" }), null, 16);
|
|
16977
|
+
return openBlock(), createElementBlock("foreignObject", mergeProps({ class: "vvplot-layer" }, vBind.value, { ref: "container" }), null, 16);
|
|
16900
16978
|
};
|
|
16901
16979
|
}
|
|
16902
16980
|
};
|
|
16903
|
-
const _sfc_main$
|
|
16981
|
+
const _sfc_main$U = {
|
|
16904
16982
|
__name: "CoreCanvasTextsegment",
|
|
16905
16983
|
props: {
|
|
16906
16984
|
extendX: { type: Number, default: 0 },
|
|
@@ -16934,69 +17012,86 @@ const _sfc_main$T = {
|
|
|
16934
17012
|
ctx.scale(__props.dpi / 96, __props.dpi / 96);
|
|
16935
17013
|
ctx.translate(__props.layout.l + __props.layout.fullWidth * __props.extendX, __props.layout.t + __props.layout.fullHeight * __props.extendY);
|
|
16936
17014
|
let _path_data = /* @__PURE__ */ new Map(), path_data = /* @__PURE__ */ new Map();
|
|
16937
|
-
for (
|
|
16938
|
-
|
|
16939
|
-
|
|
16940
|
-
|
|
16941
|
-
|
|
16942
|
-
|
|
16943
|
-
|
|
16944
|
-
|
|
16945
|
-
|
|
16946
|
-
|
|
16947
|
-
|
|
16948
|
-
|
|
16949
|
-
|
|
16950
|
-
|
|
16951
|
-
|
|
16952
|
-
|
|
16953
|
-
|
|
16954
|
-
|
|
16955
|
-
|
|
16956
|
-
|
|
16957
|
-
|
|
16958
|
-
|
|
16959
|
-
}
|
|
16960
|
-
|
|
16961
|
-
|
|
16962
|
-
|
|
16963
|
-
|
|
16964
|
-
|
|
16965
|
-
|
|
16966
|
-
|
|
16967
|
-
|
|
16968
|
-
|
|
16969
|
-
|
|
16970
|
-
|
|
16971
|
-
|
|
16972
|
-
|
|
16973
|
-
|
|
16974
|
-
|
|
16975
|
-
|
|
16976
|
-
|
|
16977
|
-
|
|
16978
|
-
|
|
16979
|
-
|
|
16980
|
-
|
|
16981
|
-
|
|
16982
|
-
|
|
16983
|
-
|
|
16984
|
-
|
|
16985
|
-
|
|
16986
|
-
|
|
16987
|
-
|
|
16988
|
-
|
|
16989
|
-
|
|
16990
|
-
|
|
16991
|
-
|
|
16992
|
-
|
|
16993
|
-
|
|
16994
|
-
|
|
16995
|
-
|
|
17015
|
+
for (let {
|
|
17016
|
+
x: x2,
|
|
17017
|
+
xend,
|
|
17018
|
+
y: y2,
|
|
17019
|
+
yend,
|
|
17020
|
+
size = 4,
|
|
17021
|
+
label = "",
|
|
17022
|
+
title,
|
|
17023
|
+
color: color2,
|
|
17024
|
+
stroke,
|
|
17025
|
+
linewidth,
|
|
17026
|
+
linetype,
|
|
17027
|
+
alpha: alpha2,
|
|
17028
|
+
"translate-x": translateX = 0,
|
|
17029
|
+
"translate-y": translateY = 0,
|
|
17030
|
+
"text-length": textLength,
|
|
17031
|
+
"font-family": fontFamily = "sans-serif",
|
|
17032
|
+
"text-align": textAlign = "justify",
|
|
17033
|
+
angle: angle2 = "auto",
|
|
17034
|
+
inset = 0,
|
|
17035
|
+
$raw
|
|
17036
|
+
} of __props.data) {
|
|
17037
|
+
const { h: x1, v: y1 } = __props.coord2pos({ x: x2, y: y2 });
|
|
17038
|
+
const { h: x22, v: y22 } = __props.coord2pos({ x: xend, y: yend });
|
|
17039
|
+
ctx.save();
|
|
17040
|
+
ctx.translate(translateX, translateY);
|
|
17041
|
+
ctx.textBaseline = "middle";
|
|
17042
|
+
ctx.lineWidth = linewidth;
|
|
17043
|
+
ctx.globalAlpha = alpha2;
|
|
17044
|
+
ctx.font = `${size * 4}px ${fontFamily}`;
|
|
17045
|
+
ctx.setLineDash(parseLinetype(linetype));
|
|
17046
|
+
if (["stretch", "pre", "start", "center", "end", "post"].includes(textAlign)) {
|
|
17047
|
+
let radian = Math.atan2(y22 - y1, x22 - x1);
|
|
17048
|
+
let text2 = String(label).replace(/\x01|\x02/g, "");
|
|
17049
|
+
let insetX = Math.cos(radian) * inset, insetY = Math.sin(radian) * inset;
|
|
17050
|
+
switch (textAlign) {
|
|
17051
|
+
case "stretch":
|
|
17052
|
+
case "center":
|
|
17053
|
+
ctx.translate((x1 + x22) / 2, (y1 + y22) / 2);
|
|
17054
|
+
ctx.textAlign = "center";
|
|
17055
|
+
break;
|
|
17056
|
+
case "pre":
|
|
17057
|
+
ctx.translate(x1 - insetX, y1 - insetY);
|
|
17058
|
+
ctx.textAlign = "end";
|
|
17059
|
+
break;
|
|
17060
|
+
case "start":
|
|
17061
|
+
ctx.translate(x1 + insetX, y1 + insetY);
|
|
17062
|
+
ctx.textAlign = "start";
|
|
17063
|
+
break;
|
|
17064
|
+
case "end":
|
|
17065
|
+
ctx.translate(x22 - insetX, y22 - insetY);
|
|
17066
|
+
ctx.textAlign = "end";
|
|
17067
|
+
break;
|
|
17068
|
+
case "post":
|
|
17069
|
+
ctx.translate(x22 + insetX, y22 + insetY);
|
|
17070
|
+
ctx.textAlign = "start";
|
|
17071
|
+
break;
|
|
17072
|
+
}
|
|
17073
|
+
ctx.rotate(radian);
|
|
17074
|
+
if (textAlign === "stretch") {
|
|
17075
|
+
ctx.scale(Math.hypot(x22 - x1 || 0, y22 - y1 || 0) / ctx.measureText(text2).width, 1);
|
|
17076
|
+
}
|
|
17077
|
+
if (color2 !== "none") {
|
|
17078
|
+
ctx.fillStyle = color2;
|
|
17079
|
+
ctx.fillText(text2, 0, 0);
|
|
17080
|
+
}
|
|
17081
|
+
if (stroke != null && stroke !== "none") {
|
|
17082
|
+
ctx.strokeStyle = stroke;
|
|
17083
|
+
ctx.strokeText(text2, 0, 0);
|
|
17084
|
+
}
|
|
17085
|
+
} else {
|
|
17086
|
+
let radian = angle2 === "auto" ? Math.atan2(y22 - y1, x22 - x1) : angle2 * Math.PI / 180;
|
|
17087
|
+
ctx.textAlign = "center";
|
|
17088
|
+
let parts = splitLabel(String(label));
|
|
17089
|
+
let dx = (x22 - x1) / (parts.length - 1 || 1), dy = (y22 - y1) / (parts.length - 1 || 1);
|
|
17090
|
+
for (let i = 0; i < parts.length; i++) {
|
|
17091
|
+
ctx.save();
|
|
17092
|
+
ctx.translate(x1 + i * dx, y1 + i * dy);
|
|
16996
17093
|
ctx.rotate(radian);
|
|
16997
|
-
|
|
16998
|
-
ctx.scale(Math.hypot(x22 - x1 || 0, y22 - y1 || 0) / ctx.measureText(text2).width, 1);
|
|
16999
|
-
}
|
|
17094
|
+
let text2 = parts[i];
|
|
17000
17095
|
if (color2 !== "none") {
|
|
17001
17096
|
ctx.fillStyle = color2;
|
|
17002
17097
|
ctx.fillText(text2, 0, 0);
|
|
@@ -17005,29 +17100,10 @@ const _sfc_main$T = {
|
|
|
17005
17100
|
ctx.strokeStyle = stroke;
|
|
17006
17101
|
ctx.strokeText(text2, 0, 0);
|
|
17007
17102
|
}
|
|
17008
|
-
|
|
17009
|
-
let radian = angle2 === "auto" ? Math.atan2(y22 - y1, x22 - x1) : angle2 * Math.PI / 180;
|
|
17010
|
-
ctx.textAlign = "center";
|
|
17011
|
-
let parts = splitLabel(String(label));
|
|
17012
|
-
let dx = (x22 - x1) / (parts.length - 1 || 1), dy = (y22 - y1) / (parts.length - 1 || 1);
|
|
17013
|
-
for (let i = 0; i < parts.length; i++) {
|
|
17014
|
-
ctx.save();
|
|
17015
|
-
ctx.translate(x1 + i * dx, y1 + i * dy);
|
|
17016
|
-
ctx.rotate(radian);
|
|
17017
|
-
let text2 = parts[i];
|
|
17018
|
-
if (color2 !== "none") {
|
|
17019
|
-
ctx.fillStyle = color2;
|
|
17020
|
-
ctx.fillText(text2, 0, 0);
|
|
17021
|
-
}
|
|
17022
|
-
if (stroke != null && stroke !== "none") {
|
|
17023
|
-
ctx.strokeStyle = stroke;
|
|
17024
|
-
ctx.strokeText(text2, 0, 0);
|
|
17025
|
-
}
|
|
17026
|
-
ctx.restore();
|
|
17027
|
-
}
|
|
17103
|
+
ctx.restore();
|
|
17028
17104
|
}
|
|
17029
|
-
ctx.restore();
|
|
17030
17105
|
}
|
|
17106
|
+
ctx.restore();
|
|
17031
17107
|
}
|
|
17032
17108
|
for (let path2 of Array.from(_path_data.keys()).reverse()) {
|
|
17033
17109
|
path_data.set(path2, _path_data.get(path2));
|
|
@@ -17068,26 +17144,27 @@ const _sfc_main$T = {
|
|
|
17068
17144
|
return result;
|
|
17069
17145
|
}
|
|
17070
17146
|
return (_ctx, _cache) => {
|
|
17071
|
-
return openBlock(), createElementBlock("foreignObject", mergeProps(vBind.value, { ref: "container" }), null, 16);
|
|
17147
|
+
return openBlock(), createElementBlock("foreignObject", mergeProps({ class: "vvplot-layer" }, vBind.value, { ref: "container" }), null, 16);
|
|
17072
17148
|
};
|
|
17073
17149
|
}
|
|
17074
17150
|
};
|
|
17075
17151
|
const canvas = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
17076
17152
|
__proto__: null,
|
|
17077
|
-
boxplot: _sfc_main
|
|
17078
|
-
curve: _sfc_main
|
|
17079
|
-
ellipse: _sfc_main$
|
|
17080
|
-
line: _sfc_main$
|
|
17081
|
-
point: _sfc_main$
|
|
17082
|
-
polygon: _sfc_main$
|
|
17083
|
-
rect: _sfc_main$
|
|
17084
|
-
shape: _sfc_main
|
|
17085
|
-
stick: _sfc_main$
|
|
17086
|
-
text: _sfc_main$
|
|
17087
|
-
textsegment: _sfc_main$
|
|
17088
|
-
tile: _sfc_main$
|
|
17153
|
+
boxplot: _sfc_main$10,
|
|
17154
|
+
curve: _sfc_main$$,
|
|
17155
|
+
ellipse: _sfc_main$_,
|
|
17156
|
+
line: _sfc_main$Z,
|
|
17157
|
+
point: _sfc_main$Y,
|
|
17158
|
+
polygon: _sfc_main$X,
|
|
17159
|
+
rect: _sfc_main$W,
|
|
17160
|
+
shape: _sfc_main$$,
|
|
17161
|
+
stick: _sfc_main$Z,
|
|
17162
|
+
text: _sfc_main$V,
|
|
17163
|
+
textsegment: _sfc_main$U,
|
|
17164
|
+
tile: _sfc_main$W
|
|
17089
17165
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
17090
|
-
const
|
|
17166
|
+
const _hoisted_1$m = { class: "vvplot-layer" };
|
|
17167
|
+
const _sfc_main$T = {
|
|
17091
17168
|
__name: "CoreSvgBlank",
|
|
17092
17169
|
props: {
|
|
17093
17170
|
extendX: { type: Number, default: 0 },
|
|
@@ -17102,12 +17179,12 @@ const _sfc_main$S = {
|
|
|
17102
17179
|
emits: ["click", "contextmenu", "pointerover", "pointerout", "pointerenter", "pointerleave", "pointermove", "pointerdown", "pointerup"],
|
|
17103
17180
|
setup(__props, { emit: __emit }) {
|
|
17104
17181
|
return (_ctx, _cache) => {
|
|
17105
|
-
return openBlock(), createElementBlock("g");
|
|
17182
|
+
return openBlock(), createElementBlock("g", _hoisted_1$m);
|
|
17106
17183
|
};
|
|
17107
17184
|
}
|
|
17108
17185
|
};
|
|
17109
|
-
const _hoisted_1$
|
|
17110
|
-
const _sfc_main$
|
|
17186
|
+
const _hoisted_1$l = { key: 0 };
|
|
17187
|
+
const _sfc_main$S = {
|
|
17111
17188
|
__name: "CoreTile",
|
|
17112
17189
|
props: {
|
|
17113
17190
|
x: { type: Number, default: 0 },
|
|
@@ -17142,14 +17219,14 @@ const _sfc_main$R = {
|
|
|
17142
17219
|
});
|
|
17143
17220
|
return (_ctx, _cache) => {
|
|
17144
17221
|
return openBlock(), createElementBlock("rect", normalizeProps(guardReactiveProps(binds.value)), [
|
|
17145
|
-
__props.title ? (openBlock(), createElementBlock("title", _hoisted_1$
|
|
17222
|
+
__props.title ? (openBlock(), createElementBlock("title", _hoisted_1$l, toDisplayString(__props.title), 1)) : createCommentVNode("", true)
|
|
17146
17223
|
], 16);
|
|
17147
17224
|
};
|
|
17148
17225
|
}
|
|
17149
17226
|
};
|
|
17150
|
-
const _hoisted_1$
|
|
17227
|
+
const _hoisted_1$k = { key: 0 };
|
|
17151
17228
|
const _hoisted_2$4 = { key: 0 };
|
|
17152
|
-
const _sfc_main$
|
|
17229
|
+
const _sfc_main$R = {
|
|
17153
17230
|
__name: "CorePoint",
|
|
17154
17231
|
props: {
|
|
17155
17232
|
x: { type: Number, default: 0 },
|
|
@@ -17200,15 +17277,15 @@ const _sfc_main$Q = {
|
|
|
17200
17277
|
});
|
|
17201
17278
|
return (_ctx, _cache) => {
|
|
17202
17279
|
return binds.value.d ? (openBlock(), createElementBlock("path", normalizeProps(mergeProps({ key: 0 }, binds.value)), [
|
|
17203
|
-
__props.title ? (openBlock(), createElementBlock("title", _hoisted_1$
|
|
17280
|
+
__props.title ? (openBlock(), createElementBlock("title", _hoisted_1$k, toDisplayString(__props.title), 1)) : createCommentVNode("", true)
|
|
17204
17281
|
], 16)) : (openBlock(), createElementBlock("circle", normalizeProps(mergeProps({ key: 1 }, binds.value)), [
|
|
17205
17282
|
__props.title ? (openBlock(), createElementBlock("title", _hoisted_2$4, toDisplayString(__props.title), 1)) : createCommentVNode("", true)
|
|
17206
17283
|
], 16));
|
|
17207
17284
|
};
|
|
17208
17285
|
}
|
|
17209
17286
|
};
|
|
17210
|
-
const _hoisted_1$
|
|
17211
|
-
const _sfc_main$
|
|
17287
|
+
const _hoisted_1$j = { key: 0 };
|
|
17288
|
+
const _sfc_main$Q = {
|
|
17212
17289
|
__name: "CoreLine",
|
|
17213
17290
|
props: {
|
|
17214
17291
|
x1: { type: Number, default: 0 },
|
|
@@ -17241,12 +17318,13 @@ const _sfc_main$P = {
|
|
|
17241
17318
|
});
|
|
17242
17319
|
return (_ctx, _cache) => {
|
|
17243
17320
|
return openBlock(), createElementBlock("line", normalizeProps(guardReactiveProps(binds.value)), [
|
|
17244
|
-
__props.title ? (openBlock(), createElementBlock("title", _hoisted_1$
|
|
17321
|
+
__props.title ? (openBlock(), createElementBlock("title", _hoisted_1$j, toDisplayString(__props.title), 1)) : createCommentVNode("", true)
|
|
17245
17322
|
], 16);
|
|
17246
17323
|
};
|
|
17247
17324
|
}
|
|
17248
17325
|
};
|
|
17249
|
-
const
|
|
17326
|
+
const _hoisted_1$i = { class: "vvplot-layer" };
|
|
17327
|
+
const _sfc_main$P = {
|
|
17250
17328
|
__name: "CoreSvgBoxplot",
|
|
17251
17329
|
props: {
|
|
17252
17330
|
extendX: { type: Number, default: 0 },
|
|
@@ -17264,7 +17342,7 @@ const _sfc_main$O = {
|
|
|
17264
17342
|
const emit = __emit;
|
|
17265
17343
|
const binds = computed(() => {
|
|
17266
17344
|
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;
|
|
17267
|
-
return __props.data.map((group) => group.map(({
|
|
17345
|
+
return Object.values(Object.groupBy(__props.data, (d) => d.$group)).map((group) => group.map(({
|
|
17268
17346
|
x: x2,
|
|
17269
17347
|
xmin,
|
|
17270
17348
|
xmax,
|
|
@@ -17404,23 +17482,23 @@ const _sfc_main$O = {
|
|
|
17404
17482
|
}).filter((x2) => x2 != null));
|
|
17405
17483
|
});
|
|
17406
17484
|
return (_ctx, _cache) => {
|
|
17407
|
-
return openBlock(), createElementBlock("g",
|
|
17485
|
+
return openBlock(), createElementBlock("g", _hoisted_1$i, [
|
|
17408
17486
|
(openBlock(true), createElementBlock(Fragment, null, renderList(binds.value, (group) => {
|
|
17409
|
-
return openBlock(), createElementBlock("g", mergeProps({ ref_for: true }, { class: __props.groupClass, style: __props.groupStyle }), [
|
|
17487
|
+
return openBlock(), createElementBlock("g", mergeProps({ class: "vvplot-group" }, { ref_for: true }, { class: __props.groupClass, style: __props.groupStyle }), [
|
|
17410
17488
|
(openBlock(true), createElementBlock(Fragment, null, renderList(group, ([vbinds, von]) => {
|
|
17411
17489
|
return openBlock(), createElementBlock("g", null, [
|
|
17412
|
-
createVNode(_sfc_main$
|
|
17490
|
+
createVNode(_sfc_main$Q, mergeProps({ ref_for: true }, vbinds.line), null, 16),
|
|
17413
17491
|
_cache[0] || (_cache[0] = createTextVNode()),
|
|
17414
|
-
createVNode(_sfc_main$
|
|
17492
|
+
createVNode(_sfc_main$S, mergeProps({ ref_for: true }, vbinds.rect, toHandlers(von)), null, 16),
|
|
17415
17493
|
_cache[1] || (_cache[1] = createTextVNode()),
|
|
17416
|
-
createVNode(_sfc_main$
|
|
17494
|
+
createVNode(_sfc_main$Q, mergeProps({ ref_for: true }, vbinds.midline), null, 16),
|
|
17417
17495
|
_cache[2] || (_cache[2] = createTextVNode()),
|
|
17418
|
-
createVNode(_sfc_main$
|
|
17496
|
+
createVNode(_sfc_main$Q, mergeProps({ ref_for: true }, vbinds.uwisker), null, 16),
|
|
17419
17497
|
_cache[3] || (_cache[3] = createTextVNode()),
|
|
17420
|
-
createVNode(_sfc_main$
|
|
17498
|
+
createVNode(_sfc_main$Q, mergeProps({ ref_for: true }, vbinds.lwisker), null, 16),
|
|
17421
17499
|
_cache[4] || (_cache[4] = createTextVNode()),
|
|
17422
17500
|
(openBlock(true), createElementBlock(Fragment, null, renderList(vbinds.outliers, ([vbind, von2]) => {
|
|
17423
|
-
return openBlock(), createBlock(_sfc_main$
|
|
17501
|
+
return openBlock(), createBlock(_sfc_main$R, mergeProps({ ref_for: true }, vbind, toHandlers(von2)), null, 16);
|
|
17424
17502
|
}), 256))
|
|
17425
17503
|
]);
|
|
17426
17504
|
}), 256))
|
|
@@ -17430,8 +17508,8 @@ const _sfc_main$O = {
|
|
|
17430
17508
|
};
|
|
17431
17509
|
}
|
|
17432
17510
|
};
|
|
17433
|
-
const _hoisted_1$
|
|
17434
|
-
const _sfc_main$
|
|
17511
|
+
const _hoisted_1$h = { key: 0 };
|
|
17512
|
+
const _sfc_main$O = {
|
|
17435
17513
|
__name: "CoreCurve",
|
|
17436
17514
|
props: {
|
|
17437
17515
|
points: { type: Array, default: () => [] },
|
|
@@ -17471,12 +17549,13 @@ const _sfc_main$N = {
|
|
|
17471
17549
|
};
|
|
17472
17550
|
return (_ctx, _cache) => {
|
|
17473
17551
|
return openBlock(), createElementBlock("path", normalizeProps(guardReactiveProps(binds.value)), [
|
|
17474
|
-
__props.title ? (openBlock(), createElementBlock("title", _hoisted_1$
|
|
17552
|
+
__props.title ? (openBlock(), createElementBlock("title", _hoisted_1$h, toDisplayString(__props.title), 1)) : createCommentVNode("", true)
|
|
17475
17553
|
], 16);
|
|
17476
17554
|
};
|
|
17477
17555
|
}
|
|
17478
17556
|
};
|
|
17479
|
-
const
|
|
17557
|
+
const _hoisted_1$g = { class: "vvplot-layer vvplot-layer-curve" };
|
|
17558
|
+
const _sfc_main$N = {
|
|
17480
17559
|
__name: "CoreSvgCurve",
|
|
17481
17560
|
props: {
|
|
17482
17561
|
extendX: { type: Number, default: 0 },
|
|
@@ -17494,7 +17573,7 @@ const _sfc_main$M = {
|
|
|
17494
17573
|
const emit = __emit;
|
|
17495
17574
|
const binds = computed(() => {
|
|
17496
17575
|
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;
|
|
17497
|
-
return __props.data.map((group) => group.map(({
|
|
17576
|
+
return Object.values(Object.groupBy(__props.data, (d) => d.$group)).map((group) => group.map(({
|
|
17498
17577
|
points,
|
|
17499
17578
|
fill,
|
|
17500
17579
|
color: color2,
|
|
@@ -17536,11 +17615,11 @@ const _sfc_main$M = {
|
|
|
17536
17615
|
}).filter((x2) => x2 != null));
|
|
17537
17616
|
});
|
|
17538
17617
|
return (_ctx, _cache) => {
|
|
17539
|
-
return openBlock(), createElementBlock("g",
|
|
17618
|
+
return openBlock(), createElementBlock("g", _hoisted_1$g, [
|
|
17540
17619
|
(openBlock(true), createElementBlock(Fragment, null, renderList(binds.value, (group) => {
|
|
17541
|
-
return openBlock(), createElementBlock("g", mergeProps({ ref_for: true }, { class: __props.groupClass, style: __props.groupStyle }), [
|
|
17620
|
+
return openBlock(), createElementBlock("g", mergeProps({ class: "vvplot-group" }, { ref_for: true }, { class: __props.groupClass, style: __props.groupStyle }), [
|
|
17542
17621
|
(openBlock(true), createElementBlock(Fragment, null, renderList(group, ([vbind, von]) => {
|
|
17543
|
-
return openBlock(), createBlock(_sfc_main$
|
|
17622
|
+
return openBlock(), createBlock(_sfc_main$O, mergeProps({ ref_for: true }, vbind, toHandlers(von)), null, 16);
|
|
17544
17623
|
}), 256))
|
|
17545
17624
|
], 16);
|
|
17546
17625
|
}), 256))
|
|
@@ -17548,8 +17627,8 @@ const _sfc_main$M = {
|
|
|
17548
17627
|
};
|
|
17549
17628
|
}
|
|
17550
17629
|
};
|
|
17551
|
-
const _hoisted_1$
|
|
17552
|
-
const _sfc_main$
|
|
17630
|
+
const _hoisted_1$f = { key: 0 };
|
|
17631
|
+
const _sfc_main$M = {
|
|
17553
17632
|
__name: "CoreEllipse",
|
|
17554
17633
|
props: {
|
|
17555
17634
|
cx: { type: Number, default: 0 },
|
|
@@ -17589,12 +17668,13 @@ const _sfc_main$L = {
|
|
|
17589
17668
|
});
|
|
17590
17669
|
return (_ctx, _cache) => {
|
|
17591
17670
|
return openBlock(), createElementBlock("ellipse", normalizeProps(guardReactiveProps(binds.value)), [
|
|
17592
|
-
__props.title ? (openBlock(), createElementBlock("title", _hoisted_1$
|
|
17671
|
+
__props.title ? (openBlock(), createElementBlock("title", _hoisted_1$f, toDisplayString(__props.title), 1)) : createCommentVNode("", true)
|
|
17593
17672
|
], 16);
|
|
17594
17673
|
};
|
|
17595
17674
|
}
|
|
17596
17675
|
};
|
|
17597
|
-
const
|
|
17676
|
+
const _hoisted_1$e = { class: "vvplot-layer vvplot-layer-ellipse" };
|
|
17677
|
+
const _sfc_main$L = {
|
|
17598
17678
|
__name: "CoreSvgEllipse",
|
|
17599
17679
|
props: {
|
|
17600
17680
|
extendX: { type: Number, default: 0 },
|
|
@@ -17612,7 +17692,7 @@ const _sfc_main$K = {
|
|
|
17612
17692
|
const emit = __emit;
|
|
17613
17693
|
const binds = computed(() => {
|
|
17614
17694
|
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;
|
|
17615
|
-
return __props.data.map((group) => group.map(({
|
|
17695
|
+
return Object.values(Object.groupBy(__props.data, (d) => d.$group)).map((group) => group.map(({
|
|
17616
17696
|
cx,
|
|
17617
17697
|
cy,
|
|
17618
17698
|
A,
|
|
@@ -17664,11 +17744,11 @@ const _sfc_main$K = {
|
|
|
17664
17744
|
}).filter((x2) => x2 != null));
|
|
17665
17745
|
});
|
|
17666
17746
|
return (_ctx, _cache) => {
|
|
17667
|
-
return openBlock(), createElementBlock("g",
|
|
17747
|
+
return openBlock(), createElementBlock("g", _hoisted_1$e, [
|
|
17668
17748
|
(openBlock(true), createElementBlock(Fragment, null, renderList(binds.value, (group) => {
|
|
17669
|
-
return openBlock(), createElementBlock("g", mergeProps({ ref_for: true }, { class: __props.groupClass, style: __props.groupStyle }), [
|
|
17749
|
+
return openBlock(), createElementBlock("g", mergeProps({ class: "vvplot-group" }, { ref_for: true }, { class: __props.groupClass, style: __props.groupStyle }), [
|
|
17670
17750
|
(openBlock(true), createElementBlock(Fragment, null, renderList(group, ([vbind, von]) => {
|
|
17671
|
-
return openBlock(), createBlock(_sfc_main$
|
|
17751
|
+
return openBlock(), createBlock(_sfc_main$M, mergeProps({ ref_for: true }, vbind, toHandlers(von)), null, 16);
|
|
17672
17752
|
}), 256))
|
|
17673
17753
|
], 16);
|
|
17674
17754
|
}), 256))
|
|
@@ -17676,7 +17756,8 @@ const _sfc_main$K = {
|
|
|
17676
17756
|
};
|
|
17677
17757
|
}
|
|
17678
17758
|
};
|
|
17679
|
-
const
|
|
17759
|
+
const _hoisted_1$d = { class: "vvplot-layer vvplot-layer-line" };
|
|
17760
|
+
const _sfc_main$K = {
|
|
17680
17761
|
__name: "CoreSvgLine",
|
|
17681
17762
|
props: {
|
|
17682
17763
|
extendX: { type: Number, default: 0 },
|
|
@@ -17694,7 +17775,7 @@ const _sfc_main$J = {
|
|
|
17694
17775
|
const emit = __emit;
|
|
17695
17776
|
const binds = computed(() => {
|
|
17696
17777
|
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;
|
|
17697
|
-
return __props.data.map((group) => group.map(({
|
|
17778
|
+
return Object.values(Object.groupBy(__props.data, (d) => d.$group)).map((group) => group.map(({
|
|
17698
17779
|
x: x2,
|
|
17699
17780
|
y: y2,
|
|
17700
17781
|
xend,
|
|
@@ -17739,11 +17820,11 @@ const _sfc_main$J = {
|
|
|
17739
17820
|
}).filter((x2) => x2 != null));
|
|
17740
17821
|
});
|
|
17741
17822
|
return (_ctx, _cache) => {
|
|
17742
|
-
return openBlock(), createElementBlock("g",
|
|
17823
|
+
return openBlock(), createElementBlock("g", _hoisted_1$d, [
|
|
17743
17824
|
(openBlock(true), createElementBlock(Fragment, null, renderList(binds.value, (group) => {
|
|
17744
|
-
return openBlock(), createElementBlock("g", mergeProps({ ref_for: true }, { class: __props.groupClass, style: __props.groupStyle }), [
|
|
17825
|
+
return openBlock(), createElementBlock("g", mergeProps({ class: "vvplot-group" }, { ref_for: true }, { class: __props.groupClass, style: __props.groupStyle }), [
|
|
17745
17826
|
(openBlock(true), createElementBlock(Fragment, null, renderList(group, ([vbind, von]) => {
|
|
17746
|
-
return openBlock(), createBlock(_sfc_main$
|
|
17827
|
+
return openBlock(), createBlock(_sfc_main$Q, mergeProps({ ref_for: true }, vbind, toHandlers(von)), null, 16);
|
|
17747
17828
|
}), 256))
|
|
17748
17829
|
], 16);
|
|
17749
17830
|
}), 256))
|
|
@@ -17751,7 +17832,8 @@ const _sfc_main$J = {
|
|
|
17751
17832
|
};
|
|
17752
17833
|
}
|
|
17753
17834
|
};
|
|
17754
|
-
const
|
|
17835
|
+
const _hoisted_1$c = { class: "vvplot-layer" };
|
|
17836
|
+
const _sfc_main$J = {
|
|
17755
17837
|
__name: "CoreSvgMarkdown",
|
|
17756
17838
|
props: {
|
|
17757
17839
|
extendX: { type: Number, default: 0 },
|
|
@@ -17769,7 +17851,7 @@ const _sfc_main$I = {
|
|
|
17769
17851
|
const emit = __emit;
|
|
17770
17852
|
const binds = computed(() => {
|
|
17771
17853
|
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;
|
|
17772
|
-
return __props.data.map((group) => group.map(({
|
|
17854
|
+
return Object.values(Object.groupBy(__props.data, (d) => d.$group)).map((group) => group.map(({
|
|
17773
17855
|
x: x2,
|
|
17774
17856
|
y: y2,
|
|
17775
17857
|
size = 4,
|
|
@@ -17838,11 +17920,11 @@ const _sfc_main$I = {
|
|
|
17838
17920
|
}).filter((x2) => x2 != null));
|
|
17839
17921
|
});
|
|
17840
17922
|
return (_ctx, _cache) => {
|
|
17841
|
-
return openBlock(), createElementBlock("g",
|
|
17923
|
+
return openBlock(), createElementBlock("g", _hoisted_1$c, [
|
|
17842
17924
|
(openBlock(true), createElementBlock(Fragment, null, renderList(binds.value, (group) => {
|
|
17843
|
-
return openBlock(), createElementBlock("g", mergeProps({ ref_for: true }, { class: __props.groupClass, style: __props.groupStyle }), [
|
|
17925
|
+
return openBlock(), createElementBlock("g", mergeProps({ class: "vvplot-group" }, { ref_for: true }, { class: __props.groupClass, style: __props.groupStyle }), [
|
|
17844
17926
|
(openBlock(true), createElementBlock(Fragment, null, renderList(group, ([vbind, von]) => {
|
|
17845
|
-
return openBlock(), createBlock(_sfc_main$
|
|
17927
|
+
return openBlock(), createBlock(_sfc_main$17, mergeProps({ ref_for: true }, vbind, toHandlers(von)), null, 16);
|
|
17846
17928
|
}), 256))
|
|
17847
17929
|
], 16);
|
|
17848
17930
|
}), 256))
|
|
@@ -17850,7 +17932,8 @@ const _sfc_main$I = {
|
|
|
17850
17932
|
};
|
|
17851
17933
|
}
|
|
17852
17934
|
};
|
|
17853
|
-
const
|
|
17935
|
+
const _hoisted_1$b = { class: "vvplot-layer" };
|
|
17936
|
+
const _sfc_main$I = {
|
|
17854
17937
|
__name: "CoreSvgMarkdownsegment",
|
|
17855
17938
|
props: {
|
|
17856
17939
|
extendX: { type: Number, default: 0 },
|
|
@@ -17868,7 +17951,7 @@ const _sfc_main$H = {
|
|
|
17868
17951
|
const emit = __emit;
|
|
17869
17952
|
const binds = computed(() => {
|
|
17870
17953
|
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;
|
|
17871
|
-
return __props.data.map((group) => group.map(({
|
|
17954
|
+
return Object.values(Object.groupBy(__props.data, (d) => d.$group)).map((group) => group.map(({
|
|
17872
17955
|
x: x2,
|
|
17873
17956
|
xend,
|
|
17874
17957
|
y: y2,
|
|
@@ -17959,11 +18042,11 @@ const _sfc_main$H = {
|
|
|
17959
18042
|
}).filter((x2) => x2 != null));
|
|
17960
18043
|
});
|
|
17961
18044
|
return (_ctx, _cache) => {
|
|
17962
|
-
return openBlock(), createElementBlock("g",
|
|
18045
|
+
return openBlock(), createElementBlock("g", _hoisted_1$b, [
|
|
17963
18046
|
(openBlock(true), createElementBlock(Fragment, null, renderList(binds.value, (group) => {
|
|
17964
|
-
return openBlock(), createElementBlock("g", mergeProps({ ref_for: true }, { class: __props.groupClass, style: __props.groupStyle }), [
|
|
18047
|
+
return openBlock(), createElementBlock("g", mergeProps({ class: "vvplot-group" }, { ref_for: true }, { class: __props.groupClass, style: __props.groupStyle }), [
|
|
17965
18048
|
(openBlock(true), createElementBlock(Fragment, null, renderList(group, ([vbind, von]) => {
|
|
17966
|
-
return openBlock(), createBlock(_sfc_main$
|
|
18049
|
+
return openBlock(), createBlock(_sfc_main$17, mergeProps({ ref_for: true }, vbind, toHandlers(von)), null, 16);
|
|
17967
18050
|
}), 256))
|
|
17968
18051
|
], 16);
|
|
17969
18052
|
}), 256))
|
|
@@ -17971,7 +18054,8 @@ const _sfc_main$H = {
|
|
|
17971
18054
|
};
|
|
17972
18055
|
}
|
|
17973
18056
|
};
|
|
17974
|
-
const
|
|
18057
|
+
const _hoisted_1$a = { class: "vvplot-layer" };
|
|
18058
|
+
const _sfc_main$H = {
|
|
17975
18059
|
__name: "CoreSvgPoint",
|
|
17976
18060
|
props: {
|
|
17977
18061
|
extendX: { type: Number, default: 0 },
|
|
@@ -17989,7 +18073,7 @@ const _sfc_main$G = {
|
|
|
17989
18073
|
const emit = __emit;
|
|
17990
18074
|
const binds = computed(() => {
|
|
17991
18075
|
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;
|
|
17992
|
-
return __props.data.map((group) => group.map(({
|
|
18076
|
+
return Object.values(Object.groupBy(__props.data, (d) => d.$group)).map((group) => group.map(({
|
|
17993
18077
|
x: x2,
|
|
17994
18078
|
y: y2,
|
|
17995
18079
|
shape: shape2,
|
|
@@ -18038,11 +18122,11 @@ const _sfc_main$G = {
|
|
|
18038
18122
|
}).filter((x2) => x2 != null));
|
|
18039
18123
|
});
|
|
18040
18124
|
return (_ctx, _cache) => {
|
|
18041
|
-
return openBlock(), createElementBlock("g",
|
|
18125
|
+
return openBlock(), createElementBlock("g", _hoisted_1$a, [
|
|
18042
18126
|
(openBlock(true), createElementBlock(Fragment, null, renderList(binds.value, (group) => {
|
|
18043
|
-
return openBlock(), createElementBlock("g", mergeProps({ ref_for: true }, { class: __props.groupClass, style: __props.groupStyle }), [
|
|
18127
|
+
return openBlock(), createElementBlock("g", mergeProps({ class: "vvplot-group" }, { ref_for: true }, { class: __props.groupClass, style: __props.groupStyle }), [
|
|
18044
18128
|
(openBlock(true), createElementBlock(Fragment, null, renderList(group, ([vbind, von]) => {
|
|
18045
|
-
return openBlock(), createBlock(_sfc_main$
|
|
18129
|
+
return openBlock(), createBlock(_sfc_main$R, mergeProps({ ref_for: true }, vbind, toHandlers(von)), null, 16);
|
|
18046
18130
|
}), 256))
|
|
18047
18131
|
], 16);
|
|
18048
18132
|
}), 256))
|
|
@@ -18050,8 +18134,8 @@ const _sfc_main$G = {
|
|
|
18050
18134
|
};
|
|
18051
18135
|
}
|
|
18052
18136
|
};
|
|
18053
|
-
const _hoisted_1$
|
|
18054
|
-
const _sfc_main$
|
|
18137
|
+
const _hoisted_1$9 = { key: 0 };
|
|
18138
|
+
const _sfc_main$G = {
|
|
18055
18139
|
__name: "CorePolygon",
|
|
18056
18140
|
props: {
|
|
18057
18141
|
points: { type: Array, default: () => [] },
|
|
@@ -18080,12 +18164,13 @@ const _sfc_main$F = {
|
|
|
18080
18164
|
});
|
|
18081
18165
|
return (_ctx, _cache) => {
|
|
18082
18166
|
return openBlock(), createElementBlock("polygon", normalizeProps(guardReactiveProps(binds.value)), [
|
|
18083
|
-
__props.title ? (openBlock(), createElementBlock("title", _hoisted_1$
|
|
18167
|
+
__props.title ? (openBlock(), createElementBlock("title", _hoisted_1$9, toDisplayString(__props.title), 1)) : createCommentVNode("", true)
|
|
18084
18168
|
], 16);
|
|
18085
18169
|
};
|
|
18086
18170
|
}
|
|
18087
18171
|
};
|
|
18088
|
-
const
|
|
18172
|
+
const _hoisted_1$8 = { class: "vvplot-layer" };
|
|
18173
|
+
const _sfc_main$F = {
|
|
18089
18174
|
__name: "CoreSvgPolygon",
|
|
18090
18175
|
props: {
|
|
18091
18176
|
extendX: { type: Number, default: 0 },
|
|
@@ -18103,7 +18188,7 @@ const _sfc_main$E = {
|
|
|
18103
18188
|
const emit = __emit;
|
|
18104
18189
|
const binds = computed(() => {
|
|
18105
18190
|
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;
|
|
18106
|
-
return __props.data.map((group) => group.map(({
|
|
18191
|
+
return Object.values(Object.groupBy(__props.data, (d) => d.$group)).map((group) => group.map(({
|
|
18107
18192
|
points,
|
|
18108
18193
|
fill,
|
|
18109
18194
|
color: color2,
|
|
@@ -18145,11 +18230,11 @@ const _sfc_main$E = {
|
|
|
18145
18230
|
}).filter((x2) => x2 != null));
|
|
18146
18231
|
});
|
|
18147
18232
|
return (_ctx, _cache) => {
|
|
18148
|
-
return openBlock(), createElementBlock("g",
|
|
18233
|
+
return openBlock(), createElementBlock("g", _hoisted_1$8, [
|
|
18149
18234
|
(openBlock(true), createElementBlock(Fragment, null, renderList(binds.value, (group) => {
|
|
18150
|
-
return openBlock(), createElementBlock("g", mergeProps({ ref_for: true }, { class: __props.groupClass, style: __props.groupStyle }), [
|
|
18235
|
+
return openBlock(), createElementBlock("g", mergeProps({ class: "vvplot-group" }, { ref_for: true }, { class: __props.groupClass, style: __props.groupStyle }), [
|
|
18151
18236
|
(openBlock(true), createElementBlock(Fragment, null, renderList(group, ([vbind, von]) => {
|
|
18152
|
-
return openBlock(), createBlock(_sfc_main$
|
|
18237
|
+
return openBlock(), createBlock(_sfc_main$G, mergeProps({ ref_for: true }, vbind, toHandlers(von)), null, 16);
|
|
18153
18238
|
}), 256))
|
|
18154
18239
|
], 16);
|
|
18155
18240
|
}), 256))
|
|
@@ -18157,7 +18242,8 @@ const _sfc_main$E = {
|
|
|
18157
18242
|
};
|
|
18158
18243
|
}
|
|
18159
18244
|
};
|
|
18160
|
-
const
|
|
18245
|
+
const _hoisted_1$7 = { class: "vvplot-layer" };
|
|
18246
|
+
const _sfc_main$E = {
|
|
18161
18247
|
__name: "CoreSvgRect",
|
|
18162
18248
|
props: {
|
|
18163
18249
|
extendX: { type: Number, default: 0 },
|
|
@@ -18175,7 +18261,7 @@ const _sfc_main$D = {
|
|
|
18175
18261
|
const emit = __emit;
|
|
18176
18262
|
const binds = computed(() => {
|
|
18177
18263
|
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;
|
|
18178
|
-
return __props.data.map((group) => group.map(({
|
|
18264
|
+
return Object.values(Object.groupBy(__props.data, (d) => d.$group)).map((group) => group.map(({
|
|
18179
18265
|
xmin,
|
|
18180
18266
|
xmax,
|
|
18181
18267
|
ymin,
|
|
@@ -18217,11 +18303,11 @@ const _sfc_main$D = {
|
|
|
18217
18303
|
}).filter((x2) => x2 != null));
|
|
18218
18304
|
});
|
|
18219
18305
|
return (_ctx, _cache) => {
|
|
18220
|
-
return openBlock(), createElementBlock("g",
|
|
18306
|
+
return openBlock(), createElementBlock("g", _hoisted_1$7, [
|
|
18221
18307
|
(openBlock(true), createElementBlock(Fragment, null, renderList(binds.value, (group) => {
|
|
18222
|
-
return openBlock(), createElementBlock("g", mergeProps({ ref_for: true }, { class: __props.groupClass, style: __props.groupStyle }), [
|
|
18308
|
+
return openBlock(), createElementBlock("g", mergeProps({ class: "vvplot-group" }, { ref_for: true }, { class: __props.groupClass, style: __props.groupStyle }), [
|
|
18223
18309
|
(openBlock(true), createElementBlock(Fragment, null, renderList(group, ([vbind, von]) => {
|
|
18224
|
-
return openBlock(), createBlock(_sfc_main$
|
|
18310
|
+
return openBlock(), createBlock(_sfc_main$S, mergeProps({ ref_for: true }, vbind, toHandlers(von)), null, 16);
|
|
18225
18311
|
}), 256))
|
|
18226
18312
|
], 16);
|
|
18227
18313
|
}), 256))
|
|
@@ -18229,7 +18315,8 @@ const _sfc_main$D = {
|
|
|
18229
18315
|
};
|
|
18230
18316
|
}
|
|
18231
18317
|
};
|
|
18232
|
-
const
|
|
18318
|
+
const _hoisted_1$6 = { class: "vvplot-layer" };
|
|
18319
|
+
const _sfc_main$D = {
|
|
18233
18320
|
__name: "CoreSvgText",
|
|
18234
18321
|
props: {
|
|
18235
18322
|
extendX: { type: Number, default: 0 },
|
|
@@ -18247,7 +18334,7 @@ const _sfc_main$C = {
|
|
|
18247
18334
|
const emit = __emit;
|
|
18248
18335
|
const binds = computed(() => {
|
|
18249
18336
|
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;
|
|
18250
|
-
return __props.data.map((group) => group.map(({
|
|
18337
|
+
return Object.values(Object.groupBy(__props.data, (d) => d.$group)).map((group) => group.map(({
|
|
18251
18338
|
x: x2,
|
|
18252
18339
|
y: y2,
|
|
18253
18340
|
size = 4,
|
|
@@ -18316,11 +18403,11 @@ const _sfc_main$C = {
|
|
|
18316
18403
|
}).filter((x2) => x2 != null));
|
|
18317
18404
|
});
|
|
18318
18405
|
return (_ctx, _cache) => {
|
|
18319
|
-
return openBlock(), createElementBlock("g",
|
|
18406
|
+
return openBlock(), createElementBlock("g", _hoisted_1$6, [
|
|
18320
18407
|
(openBlock(true), createElementBlock(Fragment, null, renderList(binds.value, (group) => {
|
|
18321
|
-
return openBlock(), createElementBlock("g", mergeProps({ ref_for: true }, { class: __props.groupClass, style: __props.groupStyle }), [
|
|
18408
|
+
return openBlock(), createElementBlock("g", mergeProps({ class: "vvplot-group" }, { ref_for: true }, { class: __props.groupClass, style: __props.groupStyle }), [
|
|
18322
18409
|
(openBlock(true), createElementBlock(Fragment, null, renderList(group, ([vbind, von]) => {
|
|
18323
|
-
return openBlock(), createBlock(_sfc_main$
|
|
18410
|
+
return openBlock(), createBlock(_sfc_main$18, mergeProps({ ref_for: true }, vbind, toHandlers(von)), null, 16);
|
|
18324
18411
|
}), 256))
|
|
18325
18412
|
], 16);
|
|
18326
18413
|
}), 256))
|
|
@@ -18328,7 +18415,8 @@ const _sfc_main$C = {
|
|
|
18328
18415
|
};
|
|
18329
18416
|
}
|
|
18330
18417
|
};
|
|
18331
|
-
const
|
|
18418
|
+
const _hoisted_1$5 = { class: "vvplot-layer" };
|
|
18419
|
+
const _sfc_main$C = {
|
|
18332
18420
|
__name: "CoreSvgTextsegment",
|
|
18333
18421
|
props: {
|
|
18334
18422
|
extendX: { type: Number, default: 0 },
|
|
@@ -18346,7 +18434,7 @@ const _sfc_main$B = {
|
|
|
18346
18434
|
const emit = __emit;
|
|
18347
18435
|
const binds = computed(() => {
|
|
18348
18436
|
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;
|
|
18349
|
-
return __props.data.map((group) => group.map(({
|
|
18437
|
+
return Object.values(Object.groupBy(__props.data, (d) => d.$group)).map((group) => group.map(({
|
|
18350
18438
|
x: x2,
|
|
18351
18439
|
xend,
|
|
18352
18440
|
y: y2,
|
|
@@ -18480,9 +18568,9 @@ const _sfc_main$B = {
|
|
|
18480
18568
|
return result;
|
|
18481
18569
|
}
|
|
18482
18570
|
return (_ctx, _cache) => {
|
|
18483
|
-
return openBlock(), createElementBlock("g",
|
|
18571
|
+
return openBlock(), createElementBlock("g", _hoisted_1$5, [
|
|
18484
18572
|
(openBlock(true), createElementBlock(Fragment, null, renderList(binds.value, (group) => {
|
|
18485
|
-
return openBlock(), createElementBlock("g", mergeProps({ ref_for: true }, { class: __props.groupClass, style: __props.groupStyle }), [
|
|
18573
|
+
return openBlock(), createElementBlock("g", mergeProps({ class: "vvplot-group" }, { ref_for: true }, { class: __props.groupClass, style: __props.groupStyle }), [
|
|
18486
18574
|
(openBlock(true), createElementBlock(Fragment, null, renderList(group, ([vbind, von, content, title]) => {
|
|
18487
18575
|
return openBlock(), createElementBlock("text", mergeProps({ ref_for: true }, vbind, toHandlers(von, true)), [
|
|
18488
18576
|
createElementVNode("title", null, toDisplayString(title), 1),
|
|
@@ -18507,23 +18595,23 @@ const _sfc_main$B = {
|
|
|
18507
18595
|
};
|
|
18508
18596
|
const svg = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
18509
18597
|
__proto__: null,
|
|
18510
|
-
blank: _sfc_main$
|
|
18511
|
-
boxplot: _sfc_main$
|
|
18512
|
-
curve: _sfc_main$
|
|
18513
|
-
ellipse: _sfc_main$
|
|
18514
|
-
line: _sfc_main$
|
|
18515
|
-
markdown: _sfc_main$
|
|
18516
|
-
markdownsegment: _sfc_main$
|
|
18517
|
-
point: _sfc_main$
|
|
18518
|
-
polygon: _sfc_main$
|
|
18519
|
-
rect: _sfc_main$
|
|
18520
|
-
shape: _sfc_main$
|
|
18521
|
-
stick: _sfc_main$
|
|
18522
|
-
text: _sfc_main$
|
|
18523
|
-
textsegment: _sfc_main$
|
|
18524
|
-
tile: _sfc_main$
|
|
18598
|
+
blank: _sfc_main$T,
|
|
18599
|
+
boxplot: _sfc_main$P,
|
|
18600
|
+
curve: _sfc_main$N,
|
|
18601
|
+
ellipse: _sfc_main$L,
|
|
18602
|
+
line: _sfc_main$K,
|
|
18603
|
+
markdown: _sfc_main$J,
|
|
18604
|
+
markdownsegment: _sfc_main$I,
|
|
18605
|
+
point: _sfc_main$H,
|
|
18606
|
+
polygon: _sfc_main$F,
|
|
18607
|
+
rect: _sfc_main$E,
|
|
18608
|
+
shape: _sfc_main$N,
|
|
18609
|
+
stick: _sfc_main$K,
|
|
18610
|
+
text: _sfc_main$D,
|
|
18611
|
+
textsegment: _sfc_main$C,
|
|
18612
|
+
tile: _sfc_main$E
|
|
18525
18613
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
18526
|
-
const _sfc_main$
|
|
18614
|
+
const _sfc_main$B = {
|
|
18527
18615
|
__name: "CoreLayer",
|
|
18528
18616
|
props: {
|
|
18529
18617
|
data: Object,
|
|
@@ -18564,7 +18652,7 @@ const _sfc_main$A = {
|
|
|
18564
18652
|
};
|
|
18565
18653
|
const _hoisted_1$4 = { key: 0 };
|
|
18566
18654
|
const _hoisted_2$3 = ["onPointerdown"];
|
|
18567
|
-
const _sfc_main$
|
|
18655
|
+
const _sfc_main$A = {
|
|
18568
18656
|
__name: "CoreSelection",
|
|
18569
18657
|
props: /* @__PURE__ */ mergeModels({
|
|
18570
18658
|
coord2pos: Function,
|
|
@@ -18653,9 +18741,6 @@ const _sfc_main$z = {
|
|
|
18653
18741
|
transform2.push(`scale(${sclH}, ${sclV})`);
|
|
18654
18742
|
return transform2.join(" ") || null;
|
|
18655
18743
|
});
|
|
18656
|
-
const translating = computed(
|
|
18657
|
-
() => __props.activeTransform.translateH != 0 || __props.activeTransform.translateV != 0 || __props.activeTransform.scaleH != 1 || __props.activeTransform.scaleV != 1
|
|
18658
|
-
);
|
|
18659
18744
|
const rectBind = computed(() => {
|
|
18660
18745
|
if (!position.value) return null;
|
|
18661
18746
|
let { hmin, hmax, vmin, vmax, pos } = position.value;
|
|
@@ -18680,7 +18765,7 @@ const _sfc_main$z = {
|
|
|
18680
18765
|
};
|
|
18681
18766
|
});
|
|
18682
18767
|
const interactiveBind = computed(() => {
|
|
18683
|
-
if (!position.value
|
|
18768
|
+
if (!position.value) return null;
|
|
18684
18769
|
let size = 10;
|
|
18685
18770
|
let { hmin, hmax, vmin, vmax, pos } = position.value;
|
|
18686
18771
|
let width = Math.max(0, hmax - hmin), height = Math.max(0, vmax - vmin);
|
|
@@ -18695,7 +18780,7 @@ const _sfc_main$z = {
|
|
|
18695
18780
|
};
|
|
18696
18781
|
if (config.resize) {
|
|
18697
18782
|
if (pos.hmin != null)
|
|
18698
|
-
binds.l = { x: hmin - size / 2, y: vmin, width: size, height, style: "cursor:ew-resize;"
|
|
18783
|
+
binds.l = { x: hmin - size / 2, y: vmin, width: size, height, style: "cursor:ew-resize;" };
|
|
18699
18784
|
if (pos.hmax != null)
|
|
18700
18785
|
binds.r = { x: hmax - size / 2, y: vmin, width: size, height, style: "cursor:ew-resize;" };
|
|
18701
18786
|
if (pos.vmin != null)
|
|
@@ -18775,8 +18860,7 @@ const _sfc_main$z = {
|
|
|
18775
18860
|
if (ymin > ymax) [ymin, ymax] = [ymax, ymin];
|
|
18776
18861
|
emit("selecting", { xmin, xmax, ymin, ymax }, __props.theme);
|
|
18777
18862
|
};
|
|
18778
|
-
e.target.
|
|
18779
|
-
ev.currentTarget.onpointerup = null;
|
|
18863
|
+
e.target.addEventListener("pointerup", function(ev) {
|
|
18780
18864
|
ev.currentTarget.onpointermove = null;
|
|
18781
18865
|
if (config.buttons & 1) {
|
|
18782
18866
|
ev.currentTarget.onclick = (event2) => {
|
|
@@ -18802,7 +18886,7 @@ const _sfc_main$z = {
|
|
|
18802
18886
|
model.value = dropNull(res);
|
|
18803
18887
|
emit("selectend");
|
|
18804
18888
|
emit("select", dropNull(res), event);
|
|
18805
|
-
};
|
|
18889
|
+
}, { once: true });
|
|
18806
18890
|
}
|
|
18807
18891
|
return (_ctx, _cache) => {
|
|
18808
18892
|
return rectBind.value ? (openBlock(), createElementBlock("g", _hoisted_1$4, [
|
|
@@ -18821,7 +18905,7 @@ const _sfc_main$z = {
|
|
|
18821
18905
|
const _hoisted_1$3 = ["height", "width"];
|
|
18822
18906
|
const _hoisted_2$2 = ["y1", "y2"];
|
|
18823
18907
|
const _hoisted_3$2 = ["y"];
|
|
18824
|
-
const _sfc_main$
|
|
18908
|
+
const _sfc_main$z = {
|
|
18825
18909
|
__name: "CoreGuideGradientbar",
|
|
18826
18910
|
props: {
|
|
18827
18911
|
scales: Array,
|
|
@@ -18861,7 +18945,7 @@ const _sfc_main$y = {
|
|
|
18861
18945
|
ref: "svg"
|
|
18862
18946
|
}, [
|
|
18863
18947
|
(openBlock(true), createElementBlock(Fragment, null, renderList(gradient_values.value, (v, i) => {
|
|
18864
|
-
return openBlock(), createBlock(_sfc_main$
|
|
18948
|
+
return openBlock(), createBlock(_sfc_main$S, mergeProps({
|
|
18865
18949
|
width: 10,
|
|
18866
18950
|
height: 3.1,
|
|
18867
18951
|
x: 10,
|
|
@@ -18893,12 +18977,12 @@ const _sfc_main$y = {
|
|
|
18893
18977
|
};
|
|
18894
18978
|
const element = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
18895
18979
|
__proto__: null,
|
|
18896
|
-
curve: _sfc_main$
|
|
18897
|
-
line: _sfc_main$
|
|
18898
|
-
point: _sfc_main$
|
|
18899
|
-
polygon: _sfc_main$
|
|
18900
|
-
text: _sfc_main$
|
|
18901
|
-
tile: _sfc_main$
|
|
18980
|
+
curve: _sfc_main$O,
|
|
18981
|
+
line: _sfc_main$Q,
|
|
18982
|
+
point: _sfc_main$R,
|
|
18983
|
+
polygon: _sfc_main$G,
|
|
18984
|
+
text: _sfc_main$18,
|
|
18985
|
+
tile: _sfc_main$S
|
|
18902
18986
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
18903
18987
|
const _hoisted_1$2 = ["height", "width"];
|
|
18904
18988
|
const _hoisted_2$1 = ["transform"];
|
|
@@ -18908,7 +18992,7 @@ const _hoisted_4$1 = {
|
|
|
18908
18992
|
y: "10",
|
|
18909
18993
|
"alignment-baseline": "central"
|
|
18910
18994
|
};
|
|
18911
|
-
const _sfc_main$
|
|
18995
|
+
const _sfc_main$y = {
|
|
18912
18996
|
__name: "CoreGuideLegendkey",
|
|
18913
18997
|
props: {
|
|
18914
18998
|
scales: Array,
|
|
@@ -18975,7 +19059,7 @@ const _sfc_main$x = {
|
|
|
18975
19059
|
};
|
|
18976
19060
|
}
|
|
18977
19061
|
};
|
|
18978
|
-
const _sfc_main$
|
|
19062
|
+
const _sfc_main$x = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
|
|
18979
19063
|
__name: "CoreGuide",
|
|
18980
19064
|
props: {
|
|
18981
19065
|
scales: Array,
|
|
@@ -18983,8 +19067,8 @@ const _sfc_main$w = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
|
|
|
18983
19067
|
},
|
|
18984
19068
|
setup(__props) {
|
|
18985
19069
|
const guide = {
|
|
18986
|
-
legendkey: _sfc_main$
|
|
18987
|
-
gradientbar: _sfc_main$
|
|
19070
|
+
legendkey: _sfc_main$y,
|
|
19071
|
+
gradientbar: _sfc_main$z
|
|
18988
19072
|
};
|
|
18989
19073
|
const title = computed(() => {
|
|
18990
19074
|
return __props.scales.reduce((v, [s]) => v ?? s.title, null) ?? __props.scales.reduce((v, [s]) => v ?? s._title, null);
|
|
@@ -19028,7 +19112,7 @@ const _sfc_main$w = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
|
|
|
19028
19112
|
};
|
|
19029
19113
|
}
|
|
19030
19114
|
});
|
|
19031
|
-
const _sfc_main$
|
|
19115
|
+
const _sfc_main$w = {
|
|
19032
19116
|
__name: "CoreLegend",
|
|
19033
19117
|
props: {
|
|
19034
19118
|
theme: { type: Object, default: () => ({}) },
|
|
@@ -19062,7 +19146,7 @@ const _sfc_main$v = {
|
|
|
19062
19146
|
style: normalizeStyle({ gap: __props.theme.spacing + "px" })
|
|
19063
19147
|
}, [
|
|
19064
19148
|
(openBlock(true), createElementBlock(Fragment, null, renderList(guides.value, ([[key, type], scales]) => {
|
|
19065
|
-
return openBlock(), createBlock(_sfc_main$
|
|
19149
|
+
return openBlock(), createBlock(_sfc_main$x, {
|
|
19066
19150
|
key,
|
|
19067
19151
|
type,
|
|
19068
19152
|
scales
|
|
@@ -19076,11 +19160,11 @@ const _hoisted_1$1 = ["id"];
|
|
|
19076
19160
|
const _hoisted_2 = ["width", "height"];
|
|
19077
19161
|
const _hoisted_3 = ["transform", "width", "height", "fill"];
|
|
19078
19162
|
const _hoisted_4 = ["transform"];
|
|
19079
|
-
const _hoisted_5 = ["transform"
|
|
19080
|
-
const _hoisted_6 = ["
|
|
19081
|
-
const _hoisted_7 = ["clip-path"];
|
|
19163
|
+
const _hoisted_5 = ["transform"];
|
|
19164
|
+
const _hoisted_6 = ["clip-path"];
|
|
19165
|
+
const _hoisted_7 = ["transform", "clip-path"];
|
|
19082
19166
|
const _hoisted_8 = { key: 1 };
|
|
19083
|
-
const _sfc_main$
|
|
19167
|
+
const _sfc_main$v = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
|
|
19084
19168
|
__name: "CorePlot",
|
|
19085
19169
|
props: /* @__PURE__ */ mergeModels({
|
|
19086
19170
|
schema: Object,
|
|
@@ -19124,6 +19208,7 @@ const _sfc_main$u = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
|
|
|
19124
19208
|
"pointermove",
|
|
19125
19209
|
"wheel",
|
|
19126
19210
|
"select",
|
|
19211
|
+
"selecting",
|
|
19127
19212
|
"move",
|
|
19128
19213
|
"zoom",
|
|
19129
19214
|
"rescale",
|
|
@@ -19431,11 +19516,13 @@ const _sfc_main$u = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
|
|
|
19431
19516
|
res.ymin = ystart > yend ? yend : ystart;
|
|
19432
19517
|
res.ymax = ystart > yend ? ystart : yend;
|
|
19433
19518
|
}
|
|
19519
|
+
if (!emitEvent(sel["onSelecting"], dropNull(res), sel.theme)) {
|
|
19520
|
+
emit("selecting", dropNull(res), sel.theme);
|
|
19521
|
+
}
|
|
19434
19522
|
selectionPreview.value = res;
|
|
19435
19523
|
selectionPreviewTheme.value = sel.theme;
|
|
19436
19524
|
};
|
|
19437
|
-
e.target.
|
|
19438
|
-
ev.currentTarget.onpointerup = null;
|
|
19525
|
+
e.target.addEventListener("pointerup", function(ev) {
|
|
19439
19526
|
ev.currentTarget.onpointermove = null;
|
|
19440
19527
|
svg2.style.userSelect = null;
|
|
19441
19528
|
selectionPreview.value = {};
|
|
@@ -19483,7 +19570,7 @@ const _sfc_main$u = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
|
|
|
19483
19570
|
emit("select", dropNull(res), event);
|
|
19484
19571
|
}
|
|
19485
19572
|
}
|
|
19486
|
-
};
|
|
19573
|
+
}, { once: true });
|
|
19487
19574
|
return;
|
|
19488
19575
|
}
|
|
19489
19576
|
let act = props.action.find((a) => a.action == "move" && ["buttons", "ctrlKey", "shiftKey", "altKey", "metaKey"].every((k) => a[k] == e[k]));
|
|
@@ -19513,15 +19600,14 @@ const _sfc_main$u = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
|
|
|
19513
19600
|
let { xmin, xmax, ymin, ymax } = pos2coord({ hmin: h1, hmax: h2, vmin: v1, vmax: v2 });
|
|
19514
19601
|
Object.assign(rangePreview, { xmin, xmax, ymin, ymax });
|
|
19515
19602
|
};
|
|
19516
|
-
e.target.
|
|
19517
|
-
ev.currentTarget.onpointerup = null;
|
|
19603
|
+
e.target.addEventListener("pointerup", function(ev) {
|
|
19518
19604
|
ev.currentTarget.onpointermove = null;
|
|
19519
19605
|
svg2.style.userSelect = null;
|
|
19520
19606
|
moveTimer = setTimeout(() => {
|
|
19521
19607
|
applyTransform(act, ev);
|
|
19522
19608
|
movementX = movementY = 0;
|
|
19523
19609
|
}, 300);
|
|
19524
|
-
};
|
|
19610
|
+
}, { once: true });
|
|
19525
19611
|
return;
|
|
19526
19612
|
}
|
|
19527
19613
|
}
|
|
@@ -19779,7 +19865,7 @@ const _sfc_main$u = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
|
|
|
19779
19865
|
transform: `translate(${unref(panel).left}, ${unref(panel).top})`,
|
|
19780
19866
|
style: { "pointer-events": "none" }
|
|
19781
19867
|
}, [
|
|
19782
|
-
createVNode(_sfc_main$
|
|
19868
|
+
createVNode(_sfc_main$12, {
|
|
19783
19869
|
breaks: gridBreaks.value.h,
|
|
19784
19870
|
layout: unref(innerRect),
|
|
19785
19871
|
activeTransform: activeTransform.value,
|
|
@@ -19787,7 +19873,7 @@ const _sfc_main$u = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
|
|
|
19787
19873
|
transition: transition.value
|
|
19788
19874
|
}, null, 8, ["breaks", "layout", "activeTransform", "transition"]),
|
|
19789
19875
|
_cache[2] || (_cache[2] = createTextVNode()),
|
|
19790
|
-
createVNode(_sfc_main$
|
|
19876
|
+
createVNode(_sfc_main$11, {
|
|
19791
19877
|
breaks: gridBreaks.value.v,
|
|
19792
19878
|
layout: unref(innerRect),
|
|
19793
19879
|
activeTransform: activeTransform.value,
|
|
@@ -19796,6 +19882,30 @@ const _sfc_main$u = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
|
|
|
19796
19882
|
}, null, 8, ["breaks", "layout", "activeTransform", "transition"])
|
|
19797
19883
|
], 8, _hoisted_4),
|
|
19798
19884
|
_cache[8] || (_cache[8] = createTextVNode()),
|
|
19885
|
+
createElementVNode("g", {
|
|
19886
|
+
transform: `translate(${unref(panel).left}, ${unref(panel).top})`
|
|
19887
|
+
}, [
|
|
19888
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(axes.value.filter((a) => typeof a.bind.position !== "number"), (axis) => {
|
|
19889
|
+
return openBlock(), createBlock(_sfc_main$13, mergeProps({ ref_for: true }, axis.bind, toHandlers(axis.on), {
|
|
19890
|
+
transition: transition.value,
|
|
19891
|
+
"onUpdate:transition": _cache[0] || (_cache[0] = ($event) => transition.value = $event),
|
|
19892
|
+
activeTransform: activeTransform.value
|
|
19893
|
+
}), null, 16, ["transition", "activeTransform"]);
|
|
19894
|
+
}), 256)),
|
|
19895
|
+
_cache[3] || (_cache[3] = createTextVNode()),
|
|
19896
|
+
createElementVNode("g", {
|
|
19897
|
+
"clip-path": props.clip ? `url(#${unref(vid)}-plot-clip)` : null
|
|
19898
|
+
}, [
|
|
19899
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(axes.value.filter((a) => typeof a.bind.position === "number"), (axis) => {
|
|
19900
|
+
return openBlock(), createBlock(_sfc_main$13, mergeProps({ ref_for: true }, axis.bind, toHandlers(axis.on), {
|
|
19901
|
+
transition: transition.value,
|
|
19902
|
+
"onUpdate:transition": _cache[1] || (_cache[1] = ($event) => transition.value = $event),
|
|
19903
|
+
activeTransform: activeTransform.value
|
|
19904
|
+
}), null, 16, ["transition", "activeTransform"]);
|
|
19905
|
+
}), 256))
|
|
19906
|
+
], 8, _hoisted_6)
|
|
19907
|
+
], 8, _hoisted_5),
|
|
19908
|
+
_cache[9] || (_cache[9] = createTextVNode()),
|
|
19799
19909
|
createElementVNode("g", {
|
|
19800
19910
|
transform: `translate(${unref(panel).left}, ${unref(panel).top})`,
|
|
19801
19911
|
"clip-path": props.clip ? `url(#${unref(vid)}-plot-clip)` : null
|
|
@@ -19804,7 +19914,7 @@ const _sfc_main$u = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
|
|
|
19804
19914
|
style: { transition: transition.value }
|
|
19805
19915
|
}), [
|
|
19806
19916
|
(openBlock(true), createElementBlock(Fragment, null, renderList(vplot.value.layers, (layer) => {
|
|
19807
|
-
return openBlock(), createBlock(_sfc_main$
|
|
19917
|
+
return openBlock(), createBlock(_sfc_main$B, mergeProps({
|
|
19808
19918
|
ref_for: true,
|
|
19809
19919
|
ref_key: "layers",
|
|
19810
19920
|
ref: layers,
|
|
@@ -19819,9 +19929,9 @@ const _sfc_main$u = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
|
|
|
19819
19929
|
}), null, 16, ["data", "layout", "geom", "default-render", "default-dpi"]);
|
|
19820
19930
|
}), 256))
|
|
19821
19931
|
], 16),
|
|
19822
|
-
_cache[
|
|
19932
|
+
_cache[4] || (_cache[4] = createTextVNode()),
|
|
19823
19933
|
(openBlock(true), createElementBlock(Fragment, null, renderList(props.selections, (sel) => {
|
|
19824
|
-
return openBlock(), createBlock(_sfc_main$
|
|
19934
|
+
return openBlock(), createBlock(_sfc_main$A, mergeProps({
|
|
19825
19935
|
coord2pos,
|
|
19826
19936
|
pos2coord,
|
|
19827
19937
|
layout: unref(innerRect),
|
|
@@ -19831,8 +19941,8 @@ const _sfc_main$u = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
|
|
|
19831
19941
|
activeTransform: activeTransform.value
|
|
19832
19942
|
}, { ref_for: true }, sel, { flip: __props.flip }), null, 16, ["layout", "transition", "activeTransform", "flip"]);
|
|
19833
19943
|
}), 256)),
|
|
19834
|
-
_cache[
|
|
19835
|
-
createVNode(_sfc_main$
|
|
19944
|
+
_cache[5] || (_cache[5] = createTextVNode()),
|
|
19945
|
+
createVNode(_sfc_main$A, {
|
|
19836
19946
|
coord2pos,
|
|
19837
19947
|
pos2coord,
|
|
19838
19948
|
layout: unref(innerRect),
|
|
@@ -19842,31 +19952,7 @@ const _sfc_main$u = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
|
|
|
19842
19952
|
theme: _selectionPreviewTheme.value,
|
|
19843
19953
|
flip: __props.flip
|
|
19844
19954
|
}, null, 8, ["layout", "modelValue", "transition", "activeTransform", "theme", "flip"])
|
|
19845
|
-
], 8,
|
|
19846
|
-
_cache[9] || (_cache[9] = createTextVNode()),
|
|
19847
|
-
createElementVNode("g", {
|
|
19848
|
-
transform: `translate(${unref(panel).left}, ${unref(panel).top})`
|
|
19849
|
-
}, [
|
|
19850
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(axes.value.filter((a) => typeof a.bind.position !== "number"), (axis) => {
|
|
19851
|
-
return openBlock(), createBlock(_sfc_main$12, mergeProps({ ref_for: true }, axis.bind, toHandlers(axis.on), {
|
|
19852
|
-
transition: transition.value,
|
|
19853
|
-
"onUpdate:transition": _cache[0] || (_cache[0] = ($event) => transition.value = $event),
|
|
19854
|
-
activeTransform: activeTransform.value
|
|
19855
|
-
}), null, 16, ["transition", "activeTransform"]);
|
|
19856
|
-
}), 256)),
|
|
19857
|
-
_cache[5] || (_cache[5] = createTextVNode()),
|
|
19858
|
-
createElementVNode("g", {
|
|
19859
|
-
"clip-path": props.clip ? `url(#${unref(vid)}-plot-clip)` : null
|
|
19860
|
-
}, [
|
|
19861
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(axes.value.filter((a) => typeof a.bind.position === "number"), (axis) => {
|
|
19862
|
-
return openBlock(), createBlock(_sfc_main$12, mergeProps({ ref_for: true }, axis.bind, toHandlers(axis.on), {
|
|
19863
|
-
transition: transition.value,
|
|
19864
|
-
"onUpdate:transition": _cache[1] || (_cache[1] = ($event) => transition.value = $event),
|
|
19865
|
-
activeTransform: activeTransform.value
|
|
19866
|
-
}), null, 16, ["transition", "activeTransform"]);
|
|
19867
|
-
}), 256))
|
|
19868
|
-
], 8, _hoisted_7)
|
|
19869
|
-
], 8, _hoisted_6),
|
|
19955
|
+
], 8, _hoisted_7),
|
|
19870
19956
|
_cache[10] || (_cache[10] = createTextVNode()),
|
|
19871
19957
|
renderSlot(_ctx.$slots, "default"),
|
|
19872
19958
|
_cache[11] || (_cache[11] = createTextVNode()),
|
|
@@ -19875,7 +19961,7 @@ const _sfc_main$u = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
|
|
|
19875
19961
|
defer: "",
|
|
19876
19962
|
to: props.legendTeleport
|
|
19877
19963
|
}, [
|
|
19878
|
-
createVNode(_sfc_main$
|
|
19964
|
+
createVNode(_sfc_main$w, {
|
|
19879
19965
|
scales: vplot.value?.scales,
|
|
19880
19966
|
theme: __props.theme.legend
|
|
19881
19967
|
}, null, 8, ["scales", "theme"])
|
|
@@ -19885,14 +19971,14 @@ const _sfc_main$u = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
|
|
|
19885
19971
|
};
|
|
19886
19972
|
}
|
|
19887
19973
|
});
|
|
19888
|
-
const _sfc_main$
|
|
19974
|
+
const _sfc_main$u = {
|
|
19889
19975
|
$_type: "action",
|
|
19890
19976
|
$_props: {}
|
|
19891
19977
|
};
|
|
19892
|
-
const _sfc_main$
|
|
19978
|
+
const _sfc_main$t = {
|
|
19893
19979
|
$_type: "layer"
|
|
19894
19980
|
};
|
|
19895
|
-
const _sfc_main$
|
|
19981
|
+
const _sfc_main$s = {
|
|
19896
19982
|
$_props: {
|
|
19897
19983
|
geom: "tile",
|
|
19898
19984
|
stat: "bar"
|
|
@@ -19900,14 +19986,14 @@ const _sfc_main$r = {
|
|
|
19900
19986
|
$_type: "layer",
|
|
19901
19987
|
$_argnames: ["width", "height", "position"]
|
|
19902
19988
|
};
|
|
19903
|
-
const _sfc_main$
|
|
19989
|
+
const _sfc_main$r = {
|
|
19904
19990
|
$_props: {
|
|
19905
19991
|
geom: "blank",
|
|
19906
19992
|
stat: "identity"
|
|
19907
19993
|
},
|
|
19908
19994
|
$_type: "layer"
|
|
19909
19995
|
};
|
|
19910
|
-
const _sfc_main$
|
|
19996
|
+
const _sfc_main$q = {
|
|
19911
19997
|
$_props: {
|
|
19912
19998
|
geom: "boxplot",
|
|
19913
19999
|
stat: "boxplot"
|
|
@@ -19915,6 +20001,14 @@ const _sfc_main$p = {
|
|
|
19915
20001
|
$_type: "layer",
|
|
19916
20002
|
$_argnames: ["width", "height", "position"]
|
|
19917
20003
|
};
|
|
20004
|
+
const _sfc_main$p = {
|
|
20005
|
+
$_props: {
|
|
20006
|
+
geom: "tile",
|
|
20007
|
+
stat: "col"
|
|
20008
|
+
},
|
|
20009
|
+
$_type: "layer",
|
|
20010
|
+
$_argnames: ["width", "height", "position", "orientation"]
|
|
20011
|
+
};
|
|
19918
20012
|
const _sfc_main$o = {
|
|
19919
20013
|
$_props: {
|
|
19920
20014
|
geom: "curve",
|
|
@@ -20064,10 +20158,11 @@ const _sfc_main$6 = {
|
|
|
20064
20158
|
};
|
|
20065
20159
|
const geom_components = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
20066
20160
|
__proto__: null,
|
|
20067
|
-
VVGeom: _sfc_main$
|
|
20068
|
-
VVGeomBar: _sfc_main$
|
|
20069
|
-
VVGeomBlank: _sfc_main$
|
|
20070
|
-
VVGeomBoxplot: _sfc_main$
|
|
20161
|
+
VVGeom: _sfc_main$t,
|
|
20162
|
+
VVGeomBar: _sfc_main$s,
|
|
20163
|
+
VVGeomBlank: _sfc_main$r,
|
|
20164
|
+
VVGeomBoxplot: _sfc_main$q,
|
|
20165
|
+
VVGeomCol: _sfc_main$p,
|
|
20071
20166
|
VVGeomCurve: _sfc_main$o,
|
|
20072
20167
|
VVGeomDensity: _sfc_main$n,
|
|
20073
20168
|
VVGeomEllipse: _sfc_main$m,
|
|
@@ -20156,8 +20251,8 @@ const _sfc_main$1 = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
|
|
|
20156
20251
|
const components = {
|
|
20157
20252
|
...geom_components,
|
|
20158
20253
|
...axis_components,
|
|
20159
|
-
VVAction: _sfc_main$
|
|
20160
|
-
VVSelection: _sfc_main$
|
|
20254
|
+
VVAction: _sfc_main$u,
|
|
20255
|
+
VVSelection: _sfc_main$u
|
|
20161
20256
|
};
|
|
20162
20257
|
const opponents = {
|
|
20163
20258
|
x: "y",
|
|
@@ -20214,8 +20309,12 @@ const _sfc_main$1 = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
|
|
|
20214
20309
|
}
|
|
20215
20310
|
}).filter((x2) => x2 != null);
|
|
20216
20311
|
let res = Object.groupBy(comps, (c) => c.type.$_type ?? "dom");
|
|
20217
|
-
for (let type in
|
|
20218
|
-
|
|
20312
|
+
for (let type in vnodes) {
|
|
20313
|
+
if (res[type] == null) {
|
|
20314
|
+
delete vnodes[type][key];
|
|
20315
|
+
} else {
|
|
20316
|
+
vnodes[type][key] = res[type];
|
|
20317
|
+
}
|
|
20219
20318
|
}
|
|
20220
20319
|
}, { immediate: true });
|
|
20221
20320
|
}
|
|
@@ -20622,6 +20721,8 @@ const _sfc_main$1 = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
|
|
|
20622
20721
|
const plotRef = useTemplateRef("plot");
|
|
20623
20722
|
const width = useModel(__props, "width");
|
|
20624
20723
|
const height = useModel(__props, "height");
|
|
20724
|
+
const visible = ref(null);
|
|
20725
|
+
provide("vvplot-visible", visible);
|
|
20625
20726
|
onMounted(() => {
|
|
20626
20727
|
watch(width, (v) => {
|
|
20627
20728
|
wrapperRef.value.style.width = str_c(v, "px") ?? null;
|
|
@@ -20631,8 +20732,11 @@ const _sfc_main$1 = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
|
|
|
20631
20732
|
}, { immediate: true });
|
|
20632
20733
|
});
|
|
20633
20734
|
let oldSize = { width: 0, height: 0 };
|
|
20634
|
-
useResizeObserver(plotRef, (
|
|
20635
|
-
|
|
20735
|
+
useResizeObserver(plotRef, ([entry]) => {
|
|
20736
|
+
visible.value = entry.target.getClientRects().length > 0;
|
|
20737
|
+
if (!visible.value) return;
|
|
20738
|
+
let { width: w, height: h } = entry.contentRect;
|
|
20739
|
+
if (width.value - w < 0.5 && height.value - h < 0.5) return;
|
|
20636
20740
|
if (wrapperRef.value.style.width) width.value = w;
|
|
20637
20741
|
if (wrapperRef.value.style.height) height.value = h;
|
|
20638
20742
|
if ((w > 0 || h > 0) && (oldSize.width > 0 || oldSize.height > 0))
|
|
@@ -20674,7 +20778,7 @@ const _sfc_main$1 = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
|
|
|
20674
20778
|
class: "vvplot",
|
|
20675
20779
|
style: wrapperStyle.value
|
|
20676
20780
|
}, vBind.value.wrapper), [
|
|
20677
|
-
createVNode(_sfc_main$
|
|
20781
|
+
createVNode(_sfc_main$v, mergeProps({
|
|
20678
20782
|
ref: "plot",
|
|
20679
20783
|
paddings,
|
|
20680
20784
|
schema: schema.value,
|
|
@@ -20736,15 +20840,16 @@ const _sfc_main = {
|
|
|
20736
20840
|
};
|
|
20737
20841
|
const index = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
20738
20842
|
__proto__: null,
|
|
20739
|
-
VVAction: _sfc_main$
|
|
20843
|
+
VVAction: _sfc_main$u,
|
|
20740
20844
|
VVAxis: _sfc_main$5,
|
|
20741
20845
|
VVAxisBreak: _sfc_main$2,
|
|
20742
20846
|
VVAxisX: _sfc_main$4,
|
|
20743
20847
|
VVAxisY: _sfc_main$3,
|
|
20744
|
-
VVGeom: _sfc_main$
|
|
20745
|
-
VVGeomBar: _sfc_main$
|
|
20746
|
-
VVGeomBlank: _sfc_main$
|
|
20747
|
-
VVGeomBoxplot: _sfc_main$
|
|
20848
|
+
VVGeom: _sfc_main$t,
|
|
20849
|
+
VVGeomBar: _sfc_main$s,
|
|
20850
|
+
VVGeomBlank: _sfc_main$r,
|
|
20851
|
+
VVGeomBoxplot: _sfc_main$q,
|
|
20852
|
+
VVGeomCol: _sfc_main$p,
|
|
20748
20853
|
VVGeomCurve: _sfc_main$o,
|
|
20749
20854
|
VVGeomDensity: _sfc_main$n,
|
|
20750
20855
|
VVGeomEllipse: _sfc_main$m,
|
|
@@ -20768,15 +20873,16 @@ const index = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePropert
|
|
|
20768
20873
|
VVSelection: _sfc_main
|
|
20769
20874
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
20770
20875
|
export {
|
|
20771
|
-
_sfc_main$
|
|
20876
|
+
_sfc_main$u as VVAction,
|
|
20772
20877
|
_sfc_main$5 as VVAxis,
|
|
20773
20878
|
_sfc_main$2 as VVAxisBreak,
|
|
20774
20879
|
_sfc_main$4 as VVAxisX,
|
|
20775
20880
|
_sfc_main$3 as VVAxisY,
|
|
20776
|
-
_sfc_main$
|
|
20777
|
-
_sfc_main$
|
|
20778
|
-
_sfc_main$
|
|
20779
|
-
_sfc_main$
|
|
20881
|
+
_sfc_main$t as VVGeom,
|
|
20882
|
+
_sfc_main$s as VVGeomBar,
|
|
20883
|
+
_sfc_main$r as VVGeomBlank,
|
|
20884
|
+
_sfc_main$q as VVGeomBoxplot,
|
|
20885
|
+
_sfc_main$p as VVGeomCol,
|
|
20780
20886
|
_sfc_main$o as VVGeomCurve,
|
|
20781
20887
|
_sfc_main$n as VVGeomDensity,
|
|
20782
20888
|
_sfc_main$m as VVGeomEllipse,
|