vvplot 0.1.2 → 0.1.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/Selection.js CHANGED
@@ -1,4 +1,4 @@
1
- import { computed, isRef, reactive, unref, onMounted, nextTick, getCurrentScope, onScopeDispose, getCurrentInstance, shallowRef, watch, toValue, useTemplateRef, createElementBlock, openBlock, mergeProps, renderSlot, createCommentVNode, createTextVNode, toDisplayString, inject, normalizeStyle, createElementVNode, createBlock, Fragment, renderList, createVNode, toHandlers, normalizeProps, resolveDynamicComponent, guardReactiveProps, mergeModels, useModel, createPropsRestProxy, ref, useId, Teleport, useSlots, useAttrs, provide } from "vue";
1
+ import { computed, isRef, reactive, unref, getCurrentScope, onScopeDispose, toValue, watch, shallowRef, getCurrentInstance, onMounted, useTemplateRef, nextTick, createElementBlock, openBlock, mergeProps, renderSlot, createCommentVNode, createTextVNode, toDisplayString, inject, normalizeStyle, createElementVNode, createBlock, Fragment, renderList, createVNode, toHandlers, normalizeProps, resolveDynamicComponent, guardReactiveProps, mergeModels, useModel, createPropsRestProxy, ref, useId, Teleport, useSlots, useAttrs, provide } from "vue";
2
2
  import { theme_base, theme_default, themeBuild, themePreprocess, themeMerge } from "./theme.js";
3
3
  import { vecutils, intraaction, numutils, intrazip, GEnumLevel, plus, oob_squish_any, dropNull, emitEvent, categorize, obj_merge, interaction, unique, oob_squish_infinite, str_c, serializeSVG } from "./utils.js";
4
4
  import vvscale from "./scale.js";
@@ -48,21 +48,6 @@ function reactiveComputed(fn) {
48
48
  }
49
49
  const isClient = typeof window !== "undefined" && typeof document !== "undefined";
50
50
  typeof WorkerGlobalScope !== "undefined" && globalThis instanceof WorkerGlobalScope;
51
- function toArray(value) {
52
- return Array.isArray(value) ? value : [value];
53
- }
54
- function getLifeCycleTarget(target) {
55
- return getCurrentInstance();
56
- }
57
- function tryOnMounted(fn, sync = true, target) {
58
- const instance = getLifeCycleTarget();
59
- if (instance)
60
- onMounted(fn, target);
61
- else if (sync)
62
- fn();
63
- else
64
- nextTick(fn);
65
- }
66
51
  const defaultWindow = isClient ? window : void 0;
67
52
  function unrefElement(elRef) {
68
53
  var _a;
@@ -126,68 +111,12 @@ function useResizeObserver(target, callback, options = {}) {
126
111
  stop
127
112
  };
128
113
  }
129
- function useElementSize(target, initialSize = { width: 0, height: 0 }, options = {}) {
130
- const { window: window2 = defaultWindow, box = "content-box" } = options;
131
- const isSVG = computed(() => {
132
- var _a, _b;
133
- return (_b = (_a = unrefElement(target)) == null ? void 0 : _a.namespaceURI) == null ? void 0 : _b.includes("svg");
134
- });
135
- const width = shallowRef(initialSize.width);
136
- const height = shallowRef(initialSize.height);
137
- const { stop: stop1 } = useResizeObserver(
138
- target,
139
- ([entry]) => {
140
- const boxSize = box === "border-box" ? entry.borderBoxSize : box === "content-box" ? entry.contentBoxSize : entry.devicePixelContentBoxSize;
141
- if (window2 && isSVG.value) {
142
- const $elem = unrefElement(target);
143
- if ($elem) {
144
- const rect = $elem.getBoundingClientRect();
145
- width.value = rect.width;
146
- height.value = rect.height;
147
- }
148
- } else {
149
- if (boxSize) {
150
- const formatBoxSize = toArray(boxSize);
151
- width.value = formatBoxSize.reduce((acc, { inlineSize }) => acc + inlineSize, 0);
152
- height.value = formatBoxSize.reduce((acc, { blockSize }) => acc + blockSize, 0);
153
- } else {
154
- width.value = entry.contentRect.width;
155
- height.value = entry.contentRect.height;
156
- }
157
- }
158
- },
159
- options
160
- );
161
- tryOnMounted(() => {
162
- const ele = unrefElement(target);
163
- if (ele) {
164
- width.value = "offsetWidth" in ele ? ele.offsetWidth : initialSize.width;
165
- height.value = "offsetHeight" in ele ? ele.offsetHeight : initialSize.height;
166
- }
167
- });
168
- const stop2 = watch(
169
- () => unrefElement(target),
170
- (ele) => {
171
- width.value = ele ? initialSize.width : 0;
172
- height.value = ele ? initialSize.height : 0;
173
- }
174
- );
175
- function stop() {
176
- stop1();
177
- stop2();
178
- }
179
- return {
180
- width,
181
- height,
182
- stop
183
- };
184
- }
185
114
  const NO = () => false;
186
115
  const extend = Object.assign;
187
- const TELEPORT = Symbol(``);
188
- const SUSPENSE = Symbol(``);
189
- const KEEP_ALIVE = Symbol(``);
190
- const BASE_TRANSITION = Symbol(
116
+ const TELEPORT = /* @__PURE__ */ Symbol(``);
117
+ const SUSPENSE = /* @__PURE__ */ Symbol(``);
118
+ const KEEP_ALIVE = /* @__PURE__ */ Symbol(``);
119
+ const BASE_TRANSITION = /* @__PURE__ */ Symbol(
191
120
  ``
192
121
  );
193
122
  const locStub = {
@@ -311,14 +240,28 @@ class Tokenizer {
311
240
  getPos(index) {
312
241
  let line2 = 1;
313
242
  let column = index + 1;
314
- for (let i = this.newlines.length - 1; i >= 0; i--) {
315
- const newlineIndex = this.newlines[i];
316
- if (index > newlineIndex) {
317
- line2 = i + 2;
318
- column = index - newlineIndex;
319
- break;
243
+ const length = this.newlines.length;
244
+ let j = -1;
245
+ if (length > 100) {
246
+ let l = -1;
247
+ let r = length;
248
+ while (l + 1 < r) {
249
+ const m = l + r >>> 1;
250
+ this.newlines[m] < index ? l = m : r = m;
251
+ }
252
+ j = l;
253
+ } else {
254
+ for (let i = length - 1; i >= 0; i--) {
255
+ if (index > this.newlines[i]) {
256
+ j = i;
257
+ break;
258
+ }
320
259
  }
321
260
  }
261
+ if (j >= 0) {
262
+ line2 = j + 2;
263
+ column = index - this.newlines[j];
264
+ }
322
265
  return {
323
266
  column,
324
267
  line: line2,
@@ -1748,7 +1691,7 @@ const vvgeom = {
1748
1691
  if (orientation == "y") return ds.y ?? [];
1749
1692
  },
1750
1693
  validate(d) {
1751
- if (isNaN(+d.x) || isNaN(+d.y)) return null;
1694
+ if (isNaN(d.x) || isNaN(d.y)) return null;
1752
1695
  return d;
1753
1696
  }
1754
1697
  },
@@ -1763,7 +1706,7 @@ const vvgeom = {
1763
1706
  if (orientation == "y") return (ds.y ?? []).concat(ds.yend ?? []);
1764
1707
  },
1765
1708
  validate(d) {
1766
- if (isNaN(+d.x) || isNaN(+d.y) || isNaN(+d.xend) || isNaN(+d.yend)) return null;
1709
+ if (isNaN(d.x) || isNaN(d.y) || isNaN(d.xend) || isNaN(d.yend)) return null;
1767
1710
  return d;
1768
1711
  }
1769
1712
  },
@@ -1782,7 +1725,7 @@ const vvgeom = {
1782
1725
  if (orientation == "y") return (ds.y ?? []).concat(psum(ds.y ?? [], ds.dy ?? 0) ?? []);
1783
1726
  },
1784
1727
  validate(d) {
1785
- if (isNaN(+d.x) || isNaN(+d.y) || isNaN(+d.xend) || isNaN(+d.yend)) return null;
1728
+ if (isNaN(d.x) || isNaN(d.y) || isNaN(d.xend) || isNaN(d.yend)) return null;
1786
1729
  return d;
1787
1730
  }
1788
1731
  },
@@ -1828,7 +1771,7 @@ const vvgeom = {
1828
1771
  }
1829
1772
  },
1830
1773
  validate(d) {
1831
- if (isNaN(+d.xmin) || isNaN(+d.ymin) || isNaN(+d.xmax) || isNaN(+d.ymax)) return null;
1774
+ if (isNaN(d.xmin) || isNaN(d.ymin) || isNaN(d.xmax) || isNaN(d.ymax)) return null;
1832
1775
  return d;
1833
1776
  }
1834
1777
  },
@@ -1843,7 +1786,7 @@ const vvgeom = {
1843
1786
  if (orientation == "y") return (ds.ymin ?? []).concat(ds.ymax ?? []);
1844
1787
  },
1845
1788
  validate(d) {
1846
- if (isNaN(+d.xmin) || isNaN(+d.ymin) || isNaN(+d.xmax) || isNaN(+d.ymax)) return null;
1789
+ if (isNaN(d.xmin) || isNaN(d.ymin) || isNaN(d.xmax) || isNaN(d.ymax)) return null;
1847
1790
  return d;
1848
1791
  }
1849
1792
  },
@@ -1879,7 +1822,7 @@ const vvgeom = {
1879
1822
  if (orientation == "y") return ds.y ?? [];
1880
1823
  },
1881
1824
  validate(d) {
1882
- if (isNaN(+d.x) || isNaN(+d.y)) return null;
1825
+ if (isNaN(d.x) || isNaN(d.y)) return null;
1883
1826
  return d;
1884
1827
  }
1885
1828
  },
@@ -1894,22 +1837,88 @@ const vvgeom = {
1894
1837
  if (orientation == "y") return (ds.y ?? []).concat(ds.yend ?? []);
1895
1838
  },
1896
1839
  validate(d) {
1897
- if (isNaN(+d.x) || isNaN(+d.xend) || isNaN(+d.y) || isNaN(+d.yend)) return null;
1840
+ if (isNaN(d.x) || isNaN(d.xend) || isNaN(d.y) || isNaN(d.yend)) return null;
1841
+ return d;
1842
+ }
1843
+ },
1844
+ boxplot: {
1845
+ scale_attrs: ["fill", "color", "linewidth", "linetype", "alpha"],
1846
+ coord_scale(ds, levels) {
1847
+ let xnudge = ds.xnudge ?? 0, ynudge = ds.ynudge ?? 0;
1848
+ if (ds.x) {
1849
+ let x2 = psum(levels.x?.apply?.(ds.x) ?? ds.x, xnudge), xmin = psum(x2, ds.width?.map?.((x3) => -x3 / 2) ?? -0.5, xnudge), xmax = psum(x2, ds.width?.map?.((x3) => +x3 / 2) ?? 0.5, xnudge), lwisker = psum(ds.lwisker, ynudge), Q1 = psum(ds.Q1, ynudge), median = psum(ds.median, ynudge), Q3 = psum(ds.Q3, ynudge), uwisker = psum(ds.uwisker, ynudge), outliers = vecutils.apply(
1850
+ ($x, { y: ys, $raw }, nudge) => psum(ys, nudge).map(($y, i) => ({ x: $x, y: $y, $raw: $raw[i] })),
1851
+ x2,
1852
+ ds.outliers ?? [],
1853
+ ynudge
1854
+ ), $ymin = psum(ds.min, ynudge), $ymax = psum(ds.max, ynudge);
1855
+ return {
1856
+ x: x2,
1857
+ xmin,
1858
+ xmax,
1859
+ lwisker,
1860
+ Q1,
1861
+ median,
1862
+ Q3,
1863
+ uwisker,
1864
+ outliers,
1865
+ $xmin: xmin,
1866
+ $xmax: xmax,
1867
+ $ymin,
1868
+ $ymax
1869
+ };
1870
+ } else if (ds.y) {
1871
+ let y2 = psum(levels.y?.apply?.(ds.y) ?? ds.y, ynudge), ymin = psum(y2, ds.height?.map?.((y3) => -y3 / 2) ?? -0.5, ynudge), ymax = psum(y2, ds.height?.map?.((y3) => +y3 / 2) ?? 0.5, ynudge), lwisker = psum(ds.lwisker, xnudge), Q1 = psum(ds.Q1, xnudge), median = psum(ds.median, xnudge), Q3 = psum(ds.Q3, xnudge), uwisker = psum(ds.uwisker, xnudge), outliers = vecutils.apply(
1872
+ ($y, { x: xs, $raw }, nudge) => psum(xs, nudge).map(($x, i) => ({ x: $x, y: $y, $raw: $raw[i] })),
1873
+ y2,
1874
+ ds.outliers ?? [],
1875
+ xnudge
1876
+ ), $xmin = psum(ds.xmin, xnudge), $xmax = psum(ds.xmax, xnudge);
1877
+ return {
1878
+ y: y2,
1879
+ ymin,
1880
+ ymax,
1881
+ lwisker,
1882
+ Q1,
1883
+ median,
1884
+ Q3,
1885
+ uwisker,
1886
+ outliers,
1887
+ $xmin,
1888
+ $xmax,
1889
+ $ymin: ymin,
1890
+ $ymax: ymax
1891
+ };
1892
+ }
1893
+ return {};
1894
+ },
1895
+ get_range(ds, orientation) {
1896
+ if (orientation == "x") return ds.x || (ds.min ?? []).concat(ds.max ?? []);
1897
+ if (orientation == "y") return ds.y || (ds.min ?? []).concat(ds.max ?? []);
1898
+ },
1899
+ validate(d) {
1900
+ if ([d.$xmin, d.$xmax, d.$ymin, d.$ymax].some((v) => isNaN(v))) return null;
1898
1901
  return d;
1899
1902
  }
1900
1903
  }
1901
1904
  };
1902
1905
  const vvstat = {
1903
- blank: Object.assign(function(data) {
1904
- let missingAes = ["x", "y"].filter((a) => data[a] == null);
1905
- if (missingAes.length > 0)
1906
- throw new Error(`Missing aesthetics for GeomBlank: "${missingAes.join('", "')}"`);
1906
+ /**
1907
+ * identity transformation
1908
+ * keep data points as is
1909
+ */
1910
+ identity: Object.assign(function(data) {
1907
1911
  return data;
1908
- }, { core_attrs: ["x", "y"] }),
1912
+ }, { core_attrs: ["x", "y", "xnudge", "ynudge"] }),
1913
+ /**
1914
+ * line transformation
1915
+ * connect data points in the order of one variable
1916
+ * { x, y } => { x, y, xend, yend }
1917
+ */
1909
1918
  line: Object.assign(function(data, { orientation = "x" } = {}) {
1910
1919
  let missingAes = ["x", "y"].filter((a) => data[a] == null);
1911
1920
  if (missingAes.length > 0)
1912
- throw new Error(`Missing aesthetics for GeomLine: "${missingAes.join('", "')}"`);
1921
+ throw new Error(`Missing aesthetics for "StatLine": "${missingAes.join('", "')}"`);
1913
1922
  let group = data.group ?? new Array(data.x.length).fill(null);
1914
1923
  let groups = Object.values(group.reduce((acc, cur, i) => {
1915
1924
  acc[cur] ??= [];
@@ -1929,25 +1938,35 @@ const vvstat = {
1929
1938
  result.yend = order2.map((i) => data.y[i]);
1930
1939
  return result;
1931
1940
  }, { core_attrs: ["x", "y", "xnudge", "ynudge"] }),
1941
+ /**
1942
+ * linerange transformation
1943
+ * { x, ymin, ymax } => { x, y, xend, yend }
1944
+ * { y, xmin, xmax } => { y, x, yend, xend }
1945
+ */
1932
1946
  linerange: Object.assign(function(data) {
1933
1947
  if (data.x != null) {
1934
1948
  let missingAes = ["x", "ymin", "ymax"].filter((a) => data[a] == null);
1935
1949
  if (missingAes.length > 0)
1936
- throw new Error(`Missing aesthetics for GeomLinerange: "${missingAes.join('", "')}"`);
1950
+ throw new Error(`Missing aesthetics for "StatLinerange": "${missingAes.join('", "')}"`);
1937
1951
  return (({ x: x2, ymin, ymax, ...etc }) => ({ x: x2, xend: x2, y: ymin, yend: ymax, ...etc }))(data);
1938
1952
  } else if (data.y != null) {
1939
1953
  let missingAes = ["y", "xmin", "xmax"].filter((a) => data[a] == null);
1940
1954
  if (missingAes.length > 0)
1941
- throw new Error(`Missing aesthetics for GeomLinerange: "${missingAes.join('", "')}"`);
1955
+ throw new Error(`Missing aesthetics for "StatLinerange": "${missingAes.join('", "')}"`);
1942
1956
  return (({ y: y2, xmin, xmax, ...etc }) => ({ y: y2, yend: y2, x: xmin, xend: xmax, ...etc }))(data);
1943
1957
  } else {
1944
- throw new Error(`Missing aesthetics for GeomLinerange: x,ymin,ymax or y,xmin,xmax`);
1958
+ throw new Error(`Missing aesthetics for "StatLinerange": x,ymin,ymax or y,xmin,xmax`);
1945
1959
  }
1946
1960
  }, { core_attrs: ["x", "y", "xmin", "xmax", "ymin", "ymax", "xnudge", "ynudge"] }),
1961
+ /**
1962
+ * path transformation
1963
+ * connect data points in appearance order
1964
+ * { x, y } => { x, y, xend, yend }
1965
+ */
1947
1966
  path: Object.assign(function(data) {
1948
1967
  let missingAes = ["x", "y"].filter((a) => data[a] == null);
1949
1968
  if (missingAes.length > 0)
1950
- throw new Error(`Missing aesthetics for GeomPath: "${missingAes.join('", "')}"`);
1969
+ throw new Error(`Missing aesthetics for "StatPath": "${missingAes.join('", "')}"`);
1951
1970
  let group = data.group ?? new Array(data.x.length).fill(null);
1952
1971
  let groups = Object.values(group.reduce((acc, cur, i) => {
1953
1972
  acc[cur] ??= [];
@@ -1965,27 +1984,40 @@ const vvstat = {
1965
1984
  result.yend = order2.map((i) => data.y[i]);
1966
1985
  return result;
1967
1986
  }, { core_attrs: ["x", "y", "xnudge", "ynudge"] }),
1987
+ /**
1988
+ * segment transformation
1989
+ * { x, y, xend?, yend? } => { x, y, xend, yend }
1990
+ */
1968
1991
  segment: Object.assign(function(data) {
1969
1992
  if (data.xend == null) data.xend = data.x;
1970
1993
  if (data.yend == null) data.yend = data.y;
1971
1994
  let missingAes = ["x", "y", "xend", "yend"].filter((a) => data[a] == null);
1972
1995
  if (missingAes.length > 0)
1973
- throw new Error(`Missing aesthetics for GeomSegment: "${missingAes.join('", "')}"`);
1996
+ throw new Error(`Missing aesthetics for "StatSegment": "${missingAes.join('", "')}"`);
1974
1997
  return data;
1975
1998
  }, { core_attrs: ["x", "y", "xend", "yend", "xnudge", "ynudge"] }),
1999
+ /**
2000
+ * stick transformation
2001
+ * { x, y, dx, dy } => { x, y, xend, yend }
2002
+ */
1976
2003
  stick: Object.assign(function(data) {
1977
2004
  if (data.dx == null) data.dx = Array(data.x.length).fill(0);
1978
2005
  if (data.dy == null) data.dy = Array(data.y.length).fill(0);
1979
2006
  let missingAes = ["x", "y", "dx", "dy"].filter((a) => data[a] == null);
1980
2007
  if (missingAes.length > 0)
1981
- throw new Error(`Missing aesthetics for GeomStick: "${missingAes.join('", "')}"`);
2008
+ throw new Error(`Missing aesthetics for "StatStick": "${missingAes.join('", "')}"`);
1982
2009
  return data;
1983
2010
  }, { core_attrs: ["x", "y", "dx", "dy", "xnudge", "ynudge"] }),
2011
+ /**
2012
+ * curve transformation
2013
+ * { x, y } => { points }
2014
+ * { points } => { points }
2015
+ */
1984
2016
  curve: Object.assign(function(data) {
1985
2017
  if (data.points != null) return data;
1986
2018
  let missingAes = ["x", "y"].filter((a) => data[a] == null);
1987
2019
  if (missingAes.length > 0)
1988
- throw new Error(`Missing aesthetics for GeomCurve: "${missingAes.join('", "')}" or "points"`);
2020
+ throw new Error(`Missing aesthetics for "StatCurve": "${missingAes.join('", "')}" or "points"`);
1989
2021
  let keys = Object.keys(data).filter((k) => !["x", "y"].includes(k) && !k.startsWith("$"));
1990
2022
  let group = intraaction(Object.fromEntries(keys.map((k) => [k, data[k]])));
1991
2023
  let cut = intraaction({
@@ -2003,17 +2035,26 @@ const vvstat = {
2003
2035
  }
2004
2036
  return result;
2005
2037
  }, { core_attrs: ["x", "y", "xnudge", "ynudge"] }),
2038
+ /**
2039
+ * point transformation
2040
+ * { x, y } => { x, y }
2041
+ */
2006
2042
  point: Object.assign(function(data) {
2007
2043
  let missingAes = ["x", "y"].filter((a) => data[a] == null);
2008
2044
  if (missingAes.length > 0)
2009
- throw new Error(`Missing aesthetics for GeomPoint: "${missingAes.join('", "')}"`);
2045
+ throw new Error(`Missing aesthetics for "StatPoint": "${missingAes.join('", "')}"`);
2010
2046
  return data;
2011
2047
  }, { core_attrs: ["x", "y", "xnudge", "ynudge"] }),
2048
+ /**
2049
+ * polygon transformation
2050
+ * { x, y } => { points }
2051
+ * { points } => { points }
2052
+ */
2012
2053
  polygon: Object.assign(function(data) {
2013
2054
  if (data.points != null) return data;
2014
2055
  let missingAes = ["x", "y"].filter((a) => data[a] == null);
2015
2056
  if (missingAes.length > 0)
2016
- throw new Error(`Missing aesthetics for GeomPolygon: "${missingAes.join('", "')}" or "points"`);
2057
+ throw new Error(`Missing aesthetics for "StatPolygon": "${missingAes.join('", "')}" or "points"`);
2017
2058
  let keys = Object.keys(data).filter((k) => !["x", "y"].includes(k) && !k.startsWith("$"));
2018
2059
  let group = intraaction(Object.fromEntries(keys.map((k) => [k, data[k]])));
2019
2060
  let cut = intraaction({
@@ -2031,12 +2072,20 @@ const vvstat = {
2031
2072
  }
2032
2073
  return result;
2033
2074
  }, { core_attrs: ["points", "xnudge", "ynudge"] }),
2075
+ /**
2076
+ * rect transformation
2077
+ * { xmin, xmax, ymin, ymax } => { xmin, xmax, ymin, ymax }
2078
+ */
2034
2079
  rect: Object.assign(function(data) {
2035
2080
  let missingAes = ["xmin", "xmax", "ymin", "ymax"].filter((a) => data[a] == null);
2036
2081
  if (missingAes.length > 0)
2037
- throw new Error(`Missing aesthetics for GeomRect: "${missingAes.join('", "')}"`);
2082
+ throw new Error(`Missing aesthetics for "StatRect": "${missingAes.join('", "')}"`);
2038
2083
  return data;
2039
2084
  }, { core_attrs: ["xmin", "xmax", "ymin", "ymax", "xnudge", "ynudge"] }),
2085
+ /**
2086
+ * tile transformation
2087
+ * { x, y, width?, height? } => { x, y, width, height }
2088
+ */
2040
2089
  tile: Object.assign(function(data) {
2041
2090
  if (data.width == null && data.x.some((x2) => typeof x2 === "string")) {
2042
2091
  data.width = Array(data.x.length).fill(1);
@@ -2046,31 +2095,44 @@ const vvstat = {
2046
2095
  }
2047
2096
  let missingAes = ["x", "y", "width", "height"].filter((a) => data[a] == null);
2048
2097
  if (missingAes.length > 0)
2049
- throw new Error(`Missing aesthetics for GeomTile: "${missingAes.join('", "')}"`);
2098
+ throw new Error(`Missing aesthetics for "StatTile": "${missingAes.join('", "')}"`);
2050
2099
  return data;
2051
2100
  }, { core_attrs: ["x", "y", "width", "height", "xnudge", "ynudge"] }),
2101
+ /**
2102
+ * text transformation
2103
+ * { x, y, label } => { x, y, label }
2104
+ */
2052
2105
  text: Object.assign(function(data) {
2053
2106
  let missingAes = ["x", "y", "label"].filter((a) => data[a] == null);
2054
2107
  if (missingAes.length > 0)
2055
- throw new Error(`Missing aesthetics for GeomText: "${missingAes.join('", "')}"`);
2108
+ throw new Error(`Missing aesthetics for "StatText": "${missingAes.join('", "')}"`);
2056
2109
  return data;
2057
2110
  }, { core_attrs: ["x", "y", "xnudge", "ynudge", "label", "text-length"] }),
2111
+ /**
2112
+ * textsegment transformation
2113
+ * { x, y, xend, yend, label } => { x, y, xend, yend, label }
2114
+ */
2058
2115
  textsegment: Object.assign(function(data) {
2059
2116
  if (data.xend == null) data.xend = data.x;
2060
2117
  if (data.yend == null) data.yend = data.y;
2061
2118
  let missingAes = ["x", "y", "xend", "yend", "label"].filter((a) => data[a] == null);
2062
2119
  if (missingAes.length > 0)
2063
- throw new Error(`Missing aesthetics for GeomTextsegment: "${missingAes.join('", "')}"`);
2120
+ throw new Error(`Missing aesthetics for "StatTextsegment": "${missingAes.join('", "')}"`);
2064
2121
  return data;
2065
2122
  }, { core_attrs: ["x", "y", "xend", "yend", "xnudge", "ynudge", "label"] }),
2123
+ /**
2124
+ * histogram transformation
2125
+ * { x } => { xmin, xmax, ymin, ymax }
2126
+ * { y } => { ymin, ymax, xmin, xmax }
2127
+ */
2066
2128
  histogram: Object.assign(function(data, { bins = 30, binwidth, breaks } = {}) {
2067
2129
  if (data.x != null && data.y != null)
2068
- throw new Error(`Histogram only supports x or y, not both`);
2130
+ throw new Error(`"StatHistogram" only supports "x" or "y", not both`);
2069
2131
  let values = data.x ?? data.y;
2070
2132
  if (values == null)
2071
- throw new Error(`Missing aesthetics for GeomHistogram: x or y`);
2133
+ throw new Error(`Missing aesthetics for "StatHistogram": "x" or "y"`);
2072
2134
  if (values.some((x2) => typeof x2 !== "number"))
2073
- throw new Error(`"stat.histogram" requires a continuous aesthetic`);
2135
+ throw new Error(`"StatHistogram" requires a continuous aesthetic`);
2074
2136
  if (breaks) {
2075
2137
  breaks.sort((a, b) => a - b);
2076
2138
  } else {
@@ -2116,14 +2178,19 @@ const vvstat = {
2116
2178
  }) => ({ xmin, xmax, ymin, ymax, ...etc }))(result);
2117
2179
  }
2118
2180
  }, { core_attrs: ["x", "y", "xnudge", "ynudge"] }),
2181
+ /**
2182
+ * bar transformation
2183
+ * { x } => { x, y, height }
2184
+ * { y } => { x, y, width }
2185
+ */
2119
2186
  bar: Object.assign(function(data) {
2120
2187
  if (data.x != null && data.y != null)
2121
- throw new Error(`Bar only supports x or y, not both`);
2188
+ throw new Error(`"StatBar" only supports "x" or "y", not both`);
2122
2189
  let values = data.x ?? data.y;
2123
2190
  if (values == null)
2124
- throw new Error(`Missing aesthetics for GeomBar: x or y`);
2191
+ throw new Error(`Missing aesthetics for "StatBar": "x" or "y"`);
2125
2192
  if (values.some((x2) => typeof x2 === "number"))
2126
- throw new Error(`"stat.bar" requires a discrete aesthetic`);
2193
+ throw new Error(`"StatBar" requires a discrete aesthetic`);
2127
2194
  let keys = Object.keys(data).filter((k) => !["x", "y"].includes(k) && !k.startsWith("$"));
2128
2195
  let group = intraaction(Object.fromEntries(keys.map((k) => [k, data[k]])));
2129
2196
  let inter = intraaction({ group: group ?? 0, value: values });
@@ -2144,14 +2211,64 @@ const vvstat = {
2144
2211
  return (({ value, count, ...etc }) => ({ y: value, x: count.map((x2) => x2 / 2), width: count, ...etc }))(result);
2145
2212
  }
2146
2213
  }, { core_attrs: ["x", "y", "xnudge", "ynudge"] }),
2214
+ /**
2215
+ * boxplot transformation
2216
+ * { x, y } => { x, min, lwisker, Q1, median, Q3, uwisker, max, outliers }
2217
+ * { x, y } => { y, min, lwisker, Q1, median, Q3, uwisker, max, outliers }
2218
+ */
2219
+ boxplot: Object.assign(function(data, {}) {
2220
+ let missingAes = ["x", "y"].filter((a) => data[a] == null);
2221
+ if (missingAes.length > 0)
2222
+ throw new Error(`Missing aesthetics for "StatBoxplot": "${missingAes.join('", "')}"`);
2223
+ let isXdiscrete = data.x.some((x2) => typeof x2 !== "number");
2224
+ let isYdiscrete = data.y.some((y2) => typeof y2 !== "number");
2225
+ if (isXdiscrete && isYdiscrete)
2226
+ throw new Error(`Both "x" and "y" are discrete, "StatBoxplot" requires one continuous and one discrete aesthetic`);
2227
+ if (!isXdiscrete && !isYdiscrete)
2228
+ throw new Error(`Both "x" and "y" are continuous, "StatBoxplot" requires one continuous and one discrete aesthetic`);
2229
+ let [valueAes, cateAes] = isXdiscrete ? ["y", "x"] : ["x", "y"];
2230
+ let keys = Object.keys(data).filter((k) => k != valueAes && !k.startsWith("$"));
2231
+ let group = intraaction(Object.fromEntries(keys.map((k) => [k, data[k]])));
2232
+ let inter = intraaction({ group: group ?? 0, cate: data[cateAes] });
2233
+ let groupIdx = Map.groupBy(inter.map((_, i) => i), (_, i) => inter.categories[inter[i]]);
2234
+ let cates = Array.from(groupIdx.keys()), $raw = Array.from(groupIdx.values()).map((arr) => arr.map((idx) => data.$raw[idx])), val = Array.from(groupIdx.values()).map((arr) => arr.map((idx) => data[valueAes][idx]));
2235
+ let min = val.map((v) => numutils.min(v)), Q1 = val.map((v) => numutils.quantile(v, 0.25)), median = val.map((v) => numutils.quantile(v, 0.5)), Q3 = val.map((v) => numutils.quantile(v, 0.75)), max = val.map((v) => numutils.max(v)), IQR = val.map((_, i) => Q3[i] - Q1[i]), lwisker = val.map((_, i) => Math.max(min[i], Q1[i] - 1.5 * IQR[i])), uwisker = val.map((_, i) => Math.min(max[i], Q3[i] + 1.5 * IQR[i])), outliers = Array.from(groupIdx.values()).map((arr, i) => {
2236
+ let ids = arr.filter((idx) => data[valueAes][idx] < lwisker[i] || data[valueAes][idx] > uwisker[i]);
2237
+ return {
2238
+ [valueAes]: ids.map((idx) => data[valueAes][idx]),
2239
+ $raw: ids.map((idx) => data.$raw[idx])
2240
+ };
2241
+ });
2242
+ let result = {
2243
+ $raw,
2244
+ $group: cates.map((x2) => x2.group),
2245
+ min,
2246
+ lwisker,
2247
+ Q1,
2248
+ median,
2249
+ Q3,
2250
+ uwisker,
2251
+ max,
2252
+ outliers
2253
+ };
2254
+ for (let key of keys) {
2255
+ result[key] = cates.map((x2) => x2.group).map((i) => group.categories[i][key]);
2256
+ }
2257
+ return result;
2258
+ }, { core_attrs: ["x", "y", "xnudge", "ynudge"] }),
2259
+ /**
2260
+ * density transformation
2261
+ * { x } => { points }
2262
+ * { y } => { points }
2263
+ */
2147
2264
  density: Object.assign(function(data, { n = 512, kernel = "gaussian" } = {}) {
2148
2265
  if (data.x != null && data.y != null)
2149
- throw new Error(`Density only supports x or y, not both`);
2266
+ throw new Error(`"StatDensity" only supports "x" or "y", not both`);
2150
2267
  let values = data.x ?? data.y;
2151
2268
  if (values == null)
2152
- throw new Error(`Missing aesthetics for GeomDensity: x or y`);
2269
+ throw new Error(`Missing aesthetics for "StatDensity": "x" or "y"`);
2153
2270
  if (values.some((x2) => typeof x2 !== "number"))
2154
- throw new Error(`"stat.density" requires a continuous aesthetic`);
2271
+ throw new Error(`"StatDensity" requires a continuous aesthetic`);
2155
2272
  kernel = density_kernels[kernel];
2156
2273
  if (!kernel) {
2157
2274
  throw new Error(`kernel must be one of ${Object.keys(density_kernels).map((k) => `"${k}"`).join(", ")}`);
@@ -2709,12 +2826,14 @@ class GLayer {
2709
2826
  }
2710
2827
  let values = this.$data[aes];
2711
2828
  if (!values?.length) continue;
2712
- if ($$levels?.[aes] != null) {
2713
- scale.level = $$levels[aes];
2714
- } else if (values.some((v) => typeof v === "string")) {
2715
- scale.level = GEnumLevel.from(values);
2716
- } else {
2717
- scale.extent = numutils.extent(values);
2829
+ if (!scale.asis) {
2830
+ if ($$levels?.[aes] != null) {
2831
+ scale.level = $$levels[aes];
2832
+ } else if (values.some((v) => typeof v === "string")) {
2833
+ scale.level = GEnumLevel.from(values);
2834
+ } else {
2835
+ scale.extent = numutils.extent(values);
2836
+ }
2718
2837
  }
2719
2838
  this.applyScale(aes, scale);
2720
2839
  }
@@ -2740,10 +2859,8 @@ class GLayer {
2740
2859
  applyScale(aes, scale) {
2741
2860
  let values = this.$data[aes];
2742
2861
  if (values == null) return;
2743
- if (scale.level != null) {
2744
- values = scale.level.apply(values);
2745
- }
2746
- values.extent = scale.limits;
2862
+ if (scale.level) values = scale.level.apply(values);
2863
+ if (scale.limits) values.extent = scale.limits;
2747
2864
  scale.aes = aes;
2748
2865
  this.data[aes] = scale(values);
2749
2866
  this.scales[aes] = scale;
@@ -2776,12 +2893,14 @@ class GPlot {
2776
2893
  if (values.length != 0) {
2777
2894
  let scale = new Scale(scales?.[aes] ?? vvscale[aes].default());
2778
2895
  scale.aesthetics = aes;
2779
- if (levels?.[aes] != null) {
2780
- scale.level = levels[aes];
2781
- } else if (values.some((v) => typeof v === "string")) {
2782
- scale.level = GEnumLevel.from(values);
2783
- } else if (!scale.asis) {
2784
- scale.extent = numutils.extent(values);
2896
+ if (!scale.asis) {
2897
+ if (levels?.[aes] != null) {
2898
+ scale.level = levels[aes];
2899
+ } else if (values.some((v) => typeof v === "string")) {
2900
+ scale.level = GEnumLevel.from(values);
2901
+ } else {
2902
+ scale.extent = numutils.extent(values);
2903
+ }
2785
2904
  }
2786
2905
  if (scale.title == null) {
2787
2906
  scale.title = this.layers.map((layer) => layer.$fns?.[aes]).find((s) => s != null);
@@ -2857,8 +2976,8 @@ class GPlot {
2857
2976
  } else if (range?.xmax != null && range?.xmin == null) {
2858
2977
  min = plus(max, -dmin);
2859
2978
  } else {
2860
- let interval2 = max - min;
2861
- max = plus(max, -interval2 / 2 + dmin / 2);
2979
+ let interval = max - min;
2980
+ max = plus(max, -interval / 2 + dmin / 2);
2862
2981
  min = plus(max, -dmin);
2863
2982
  }
2864
2983
  }
@@ -2881,6 +3000,7 @@ class GPlot {
2881
3000
  } else if (range?.ymax != null && range?.ymin == null) {
2882
3001
  min = plus(max, -dmin);
2883
3002
  } else {
3003
+ let interval = max - min;
2884
3004
  max = plus(max, -interval / 2 + dmin / 2);
2885
3005
  min = plus(max, -dmin);
2886
3006
  }
@@ -2988,11 +3108,11 @@ class GAxis {
2988
3108
  this.titles = titles ?? vvlabel.asis();
2989
3109
  this.minorBreaks = minorBreaks ?? breaks ?? scale.minorBreaks ?? scale.breaks;
2990
3110
  }
2991
- getBindings({ range = this.range, expandMult = { min: 0, max: 0 } } = {}) {
3111
+ getBindings({ range, expandMult } = {}) {
2992
3112
  let majorBreaks = this.breaks, minorBreaks = this.minorBreaks, labels = this.labels, titles = this.titles;
2993
- let { min, max } = range, interval2 = max - min || 0;
2994
- min = min == null ? min : plus(min, -expandMult.min * interval2);
2995
- max = max == null ? max : plus(max, +expandMult.max * interval2);
3113
+ let min = range?.min ?? this?.range?.min, max = range?.max ?? this?.range?.max, interval = max - min || 0;
3114
+ min = min == null ? min : plus(min, -(expandMult?.min ?? 0) * interval);
3115
+ max = max == null ? max : plus(max, +(expandMult?.max ?? 0) * interval);
2996
3116
  function normalizeBreaks(val) {
2997
3117
  if (val.position != null) return val;
2998
3118
  return { position: val };
@@ -3023,7 +3143,7 @@ class GAxis {
3023
3143
  }
3024
3144
  const _hoisted_1$7 = ["font-size"];
3025
3145
  const _hoisted_2$6 = { key: 0 };
3026
- const _sfc_main$T = {
3146
+ const _sfc_main$W = {
3027
3147
  __name: "CoreText",
3028
3148
  props: {
3029
3149
  x: { type: Number, default: 0 },
@@ -3077,12 +3197,12 @@ const _sfc_main$T = {
3077
3197
  return {
3078
3198
  x: __props.x,
3079
3199
  y: __props.y,
3080
- fill: __props.color,
3081
- "fill-opacity": __props.alpha,
3082
- stroke: __props.stroke,
3200
+ fill: __props.color || null,
3201
+ "fill-opacity": __props.alpha == 1 ? null : __props.alpha,
3202
+ stroke: __props.stroke || null,
3083
3203
  "stroke-width": __props.linewidth,
3084
3204
  "stroke-dasharray": parseLineType(__props.linetype),
3085
- "stroke-opacity": __props.alpha,
3205
+ "stroke-opacity": __props.alpha == 1 ? null : __props.alpha,
3086
3206
  transform,
3087
3207
  textLength: __props.textLength,
3088
3208
  lengthAdjust: __props.textLength ? "spacingAndGlyphs" : null,
@@ -3112,7 +3232,7 @@ const _sfc_main$T = {
3112
3232
  }), [
3113
3233
  renderSlot(_ctx.$slots, "default", {}, () => [
3114
3234
  __props.title ? (openBlock(), createElementBlock("title", _hoisted_2$6, toDisplayString(__props.title), 1)) : createCommentVNode("", true),
3115
- createTextVNode(" " + toDisplayString(__props.text), 1)
3235
+ createTextVNode(" " + toDisplayString(__props.text.replace(/ /g, " ")), 1)
3116
3236
  ])
3117
3237
  ], 16, _hoisted_1$7);
3118
3238
  };
@@ -3131,7 +3251,7 @@ const _hoisted_5$2 = {
3131
3251
  fill: "transparent"
3132
3252
  };
3133
3253
  const _hoisted_6$2 = ["x"];
3134
- const _sfc_main$S = {
3254
+ const _sfc_main$V = {
3135
3255
  __name: "CoreAxisH",
3136
3256
  props: {
3137
3257
  coord: String,
@@ -3229,7 +3349,7 @@ const _sfc_main$S = {
3229
3349
  style: { transition: __props.transition }
3230
3350
  });
3231
3351
  }
3232
- return result.filter((t) => t.stroke != null);
3352
+ return result.filter((t) => t.stroke != null).sort((a, b) => a.x1 - b.x1);
3233
3353
  });
3234
3354
  const tickTexts = computed(() => {
3235
3355
  let isTop = __props.theme.tick_position == "top";
@@ -3270,7 +3390,7 @@ const _sfc_main$S = {
3270
3390
  }
3271
3391
  });
3272
3392
  }
3273
- return result.filter((t) => t.text.fill != null);
3393
+ return result.filter((t) => t.text.fill != null).sort((a, b) => a.text.x - b.text.x);
3274
3394
  });
3275
3395
  const iRef = useTemplateRef("i");
3276
3396
  function getPosition(event) {
@@ -3313,6 +3433,7 @@ const _sfc_main$S = {
3313
3433
  e.target.setPointerCapture(e.pointerId);
3314
3434
  e.target.onpointermove = (ev) => {
3315
3435
  movementX += ev.movementX;
3436
+ if (!pointerMoved) return;
3316
3437
  let dh = oob_squish_any(-movementX, { min: boundary.hmin - hmin0, max: boundary.hmax - hmax0 });
3317
3438
  let { xmin, xmax, ymin, ymax } = __props.pos2coord({ hmin: hmin0 + dh, hmax: hmax0 + dh });
3318
3439
  Object.assign(rangePreview, { xmin, xmax, ymin, ymax });
@@ -3321,6 +3442,7 @@ const _sfc_main$S = {
3321
3442
  e.target.onpointermove = null;
3322
3443
  e.target.onpointerup = null;
3323
3444
  e.target.style.cursor = null;
3445
+ if (!pointerMoved) return;
3324
3446
  moveTimer = setTimeout(() => {
3325
3447
  applyTransform(act, ev);
3326
3448
  movementX = 0;
@@ -3426,11 +3548,13 @@ const _sfc_main$S = {
3426
3548
  }
3427
3549
  }
3428
3550
  function applyTransform(act, event) {
3429
- if (!Object.keys(dropNull(rangePreview) ?? {}).length) return;
3430
- if (!emitEvent(act.emit, rangePreview, event)) {
3431
- emit(act.action, rangePreview, event);
3551
+ let coord = dropNull(rangePreview) ?? {};
3552
+ if (!Object.keys(coord).length) return;
3553
+ let e = new PointerEvent(event.type, event);
3554
+ if (!emitEvent(act.emit, coord, e)) {
3555
+ emit(act.action, coord, e);
3432
3556
  }
3433
- emit("rangechange", rangePreview);
3557
+ emit("rangechange", coord);
3434
3558
  let xmin, xmax, ymin, ymax;
3435
3559
  Object.assign(rangePreview, { xmin, xmax, ymin, ymax });
3436
3560
  }
@@ -3477,14 +3601,17 @@ const _sfc_main$S = {
3477
3601
  y1: 0,
3478
3602
  y2: 0
3479
3603
  }, axisLine.value), null, 16, _hoisted_2$5),
3604
+ _cache[1] || (_cache[1] = createTextVNode()),
3480
3605
  (openBlock(true), createElementBlock(Fragment, null, renderList(tickLines.value, (tick) => {
3481
3606
  return openBlock(), createElementBlock("line", mergeProps({ ref_for: true }, tick), null, 16);
3482
3607
  }), 256)),
3608
+ _cache[2] || (_cache[2] = createTextVNode()),
3483
3609
  (openBlock(true), createElementBlock(Fragment, null, renderList(tickTexts.value, (tick) => {
3484
3610
  return openBlock(), createElementBlock("g", mergeProps({ ref_for: true }, tick.wrapper), [
3485
- createVNode(_sfc_main$T, mergeProps({ ref_for: true }, tick.text), null, 16)
3611
+ createVNode(_sfc_main$W, mergeProps({ ref_for: true }, tick.text), null, 16)
3486
3612
  ], 16);
3487
3613
  }), 256)),
3614
+ _cache[3] || (_cache[3] = createTextVNode()),
3488
3615
  createElementVNode("g", _hoisted_3$4, [
3489
3616
  createElementVNode("rect", mergeProps({
3490
3617
  width: width.value,
@@ -3494,6 +3621,7 @@ const _sfc_main$S = {
3494
3621
  cursor: __props.action.some?.((a) => a.action == "move") ? "grab" : null
3495
3622
  }), null, 16, _hoisted_4$3)
3496
3623
  ]),
3624
+ _cache[4] || (_cache[4] = createTextVNode()),
3497
3625
  __props.action.some?.((a) => a.action == "rescale") ? (openBlock(), createElementBlock("g", _hoisted_5$2, [
3498
3626
  createElementVNode("rect", {
3499
3627
  width: 20,
@@ -3502,6 +3630,7 @@ const _sfc_main$S = {
3502
3630
  style: { "cursor": "ew-resize" },
3503
3631
  onPointerdown: axisRescaleLeftPointerdown
3504
3632
  }, null, 32),
3633
+ _cache[0] || (_cache[0] = createTextVNode()),
3505
3634
  createElementVNode("rect", {
3506
3635
  width: 20,
3507
3636
  height: 10,
@@ -3511,7 +3640,8 @@ const _sfc_main$S = {
3511
3640
  onPointerdown: axisRescaleRightPointerdown
3512
3641
  }, null, 40, _hoisted_6$2)
3513
3642
  ])) : createCommentVNode("", true),
3514
- axisTitle.value.text ? (openBlock(), createBlock(_sfc_main$T, normalizeProps(mergeProps({ key: 1 }, axisTitle.value)), null, 16)) : createCommentVNode("", true)
3643
+ _cache[5] || (_cache[5] = createTextVNode()),
3644
+ axisTitle.value.text ? (openBlock(), createBlock(_sfc_main$W, normalizeProps(mergeProps({ key: 1 }, axisTitle.value)), null, 16)) : createCommentVNode("", true)
3515
3645
  ], 12, _hoisted_1$6);
3516
3646
  };
3517
3647
  }
@@ -3529,7 +3659,7 @@ const _hoisted_5$1 = {
3529
3659
  fill: "transparent"
3530
3660
  };
3531
3661
  const _hoisted_6$1 = ["y"];
3532
- const _sfc_main$R = {
3662
+ const _sfc_main$U = {
3533
3663
  __name: "CoreAxisV",
3534
3664
  props: {
3535
3665
  coord: String,
@@ -3627,7 +3757,7 @@ const _sfc_main$R = {
3627
3757
  style: { transition: __props.transition }
3628
3758
  });
3629
3759
  }
3630
- return result.filter((t) => t.stroke != null);
3760
+ return result.filter((t) => t.stroke != null).sort((a, b) => a.y1 - b.y1);
3631
3761
  });
3632
3762
  const tickTexts = computed(() => {
3633
3763
  let isRight = __props.theme.tick_position == "right";
@@ -3668,7 +3798,7 @@ const _sfc_main$R = {
3668
3798
  }
3669
3799
  });
3670
3800
  }
3671
- return result.filter((t) => t.text.fill != null);
3801
+ return result.filter((t) => t.text.fill != null).sort((a, b) => a.text.y - b.text.y);
3672
3802
  });
3673
3803
  const iRef = useTemplateRef("i");
3674
3804
  function getPosition(event) {
@@ -3711,6 +3841,7 @@ const _sfc_main$R = {
3711
3841
  e.target.setPointerCapture(e.pointerId);
3712
3842
  e.target.onpointermove = (ev) => {
3713
3843
  movementY += ev.movementY;
3844
+ if (!pointerMoved) return;
3714
3845
  let dv = oob_squish_any(-movementY, { min: boundary.vmin - vmin0, max: boundary.vmax - vmax0 });
3715
3846
  let { xmin, xmax, ymin, ymax } = __props.pos2coord({ vmin: vmin0 + dv, vmax: vmax0 + dv });
3716
3847
  Object.assign(rangePreview, { xmin, xmax, ymin, ymax });
@@ -3719,6 +3850,7 @@ const _sfc_main$R = {
3719
3850
  e.target.onpointermove = null;
3720
3851
  e.target.onpointerup = null;
3721
3852
  e.target.style.cursor = null;
3853
+ if (!pointerMoved) return;
3722
3854
  moveTimer = setTimeout(() => {
3723
3855
  applyTransform(act, ev);
3724
3856
  movementY = 0;
@@ -3824,11 +3956,13 @@ const _sfc_main$R = {
3824
3956
  }
3825
3957
  }
3826
3958
  function applyTransform(act, event) {
3827
- if (!Object.keys(dropNull(rangePreview) ?? {}).length) return;
3828
- if (!emitEvent(act.emit, rangePreview, event)) {
3829
- emit(act.action, rangePreview, event);
3959
+ let coord = dropNull(rangePreview) ?? {};
3960
+ if (!Object.keys(coord).length) return;
3961
+ let e = new PointerEvent(event.type, event);
3962
+ if (!emitEvent(act.emit, coord, e)) {
3963
+ emit(act.action, coord, e);
3830
3964
  }
3831
- emit("rangechange", rangePreview);
3965
+ emit("rangechange", coord);
3832
3966
  let xmin, xmax, ymin, ymax;
3833
3967
  Object.assign(rangePreview, { xmin, xmax, ymin, ymax });
3834
3968
  }
@@ -3875,14 +4009,17 @@ const _sfc_main$R = {
3875
4009
  y1: 0,
3876
4010
  y2: height.value
3877
4011
  }, axisLine.value), null, 16, _hoisted_2$4),
4012
+ _cache[1] || (_cache[1] = createTextVNode()),
3878
4013
  (openBlock(true), createElementBlock(Fragment, null, renderList(tickLines.value, (tick) => {
3879
4014
  return openBlock(), createElementBlock("line", mergeProps({ ref_for: true }, tick), null, 16);
3880
4015
  }), 256)),
4016
+ _cache[2] || (_cache[2] = createTextVNode()),
3881
4017
  (openBlock(true), createElementBlock(Fragment, null, renderList(tickTexts.value, (tick) => {
3882
4018
  return openBlock(), createElementBlock("g", mergeProps({ ref_for: true }, tick.wrapper), [
3883
- createVNode(_sfc_main$T, mergeProps({ ref_for: true }, tick.text), null, 16)
4019
+ createVNode(_sfc_main$W, mergeProps({ ref_for: true }, tick.text), null, 16)
3884
4020
  ], 16);
3885
4021
  }), 256)),
4022
+ _cache[3] || (_cache[3] = createTextVNode()),
3886
4023
  createElementVNode("g", _hoisted_3$3, [
3887
4024
  createElementVNode("rect", mergeProps({
3888
4025
  width: 10,
@@ -3892,6 +4029,7 @@ const _sfc_main$R = {
3892
4029
  cursor: __props.action.some?.((a) => a.action == "move") ? "grab" : null
3893
4030
  }), null, 16, _hoisted_4$2)
3894
4031
  ]),
4032
+ _cache[4] || (_cache[4] = createTextVNode()),
3895
4033
  __props.action.some?.((a) => a.action == "rescale") ? (openBlock(), createElementBlock("g", _hoisted_5$1, [
3896
4034
  createElementVNode("rect", {
3897
4035
  width: 10,
@@ -3900,6 +4038,7 @@ const _sfc_main$R = {
3900
4038
  style: { "cursor": "ns-resize" },
3901
4039
  onPointerdown: axisRescaleTopPointerdown
3902
4040
  }, null, 32),
4041
+ _cache[0] || (_cache[0] = createTextVNode()),
3903
4042
  createElementVNode("rect", {
3904
4043
  width: 10,
3905
4044
  height: 20,
@@ -3909,12 +4048,13 @@ const _sfc_main$R = {
3909
4048
  onPointerdown: axisRescaleBottomPointerdown
3910
4049
  }, null, 40, _hoisted_6$1)
3911
4050
  ])) : createCommentVNode("", true),
3912
- axisTitle.value.text ? (openBlock(), createBlock(_sfc_main$T, normalizeProps(mergeProps({ key: 1 }, axisTitle.value)), null, 16)) : createCommentVNode("", true)
4051
+ _cache[5] || (_cache[5] = createTextVNode()),
4052
+ axisTitle.value.text ? (openBlock(), createBlock(_sfc_main$W, normalizeProps(mergeProps({ key: 1 }, axisTitle.value)), null, 16)) : createCommentVNode("", true)
3913
4053
  ], 12, _hoisted_1$5);
3914
4054
  };
3915
4055
  }
3916
4056
  };
3917
- const _sfc_main$Q = {
4057
+ const _sfc_main$T = {
3918
4058
  __name: "CoreAxis",
3919
4059
  props: {
3920
4060
  theme: { type: Object, default: () => ({}) },
@@ -3923,8 +4063,8 @@ const _sfc_main$Q = {
3923
4063
  },
3924
4064
  setup(__props) {
3925
4065
  const axis = {
3926
- h: _sfc_main$S,
3927
- v: _sfc_main$R
4066
+ h: _sfc_main$V,
4067
+ v: _sfc_main$U
3928
4068
  };
3929
4069
  return (_ctx, _cache) => {
3930
4070
  return __props.position != "none" ? (openBlock(), createBlock(resolveDynamicComponent(axis[__props.orientation]), {
@@ -3935,7 +4075,7 @@ const _sfc_main$Q = {
3935
4075
  };
3936
4076
  }
3937
4077
  };
3938
- const _sfc_main$P = {
4078
+ const _sfc_main$S = {
3939
4079
  __name: "CoreGridH",
3940
4080
  props: {
3941
4081
  majorBreaks: { type: Array, default: () => [] },
@@ -4008,7 +4148,7 @@ const _sfc_main$P = {
4008
4148
  };
4009
4149
  }
4010
4150
  };
4011
- const _sfc_main$O = {
4151
+ const _sfc_main$R = {
4012
4152
  __name: "CoreGridV",
4013
4153
  props: {
4014
4154
  majorBreaks: { type: Array, default: () => [] },
@@ -4081,7 +4221,7 @@ const _sfc_main$O = {
4081
4221
  };
4082
4222
  }
4083
4223
  };
4084
- const _sfc_main$N = {
4224
+ const _sfc_main$Q = {
4085
4225
  __name: "CoreCanvasCurve",
4086
4226
  props: {
4087
4227
  extendX: { type: Number, default: 0 },
@@ -4090,8 +4230,9 @@ const _sfc_main$N = {
4090
4230
  coord2pos: Function,
4091
4231
  layout: Object
4092
4232
  },
4093
- emits: ["click", "contextmenu", "pointerenter", "pointerleave", "pointermove", "pointerdown", "pointerup"],
4233
+ emits: ["click", "contextmenu", "singleclick", "dblclick", "pointermove", "pointerdown", "pointerup", "wheel"],
4094
4234
  setup(__props, { expose: __expose, emit: __emit }) {
4235
+ let events = ["click", "contextmenu", "singleclick", "dblclick", "pointermove", "pointerdown", "pointerup", "wheel"];
4095
4236
  const emit = __emit;
4096
4237
  const vBind = computed(() => ({
4097
4238
  width: __props.layout.fullWidth * (1 + __props.extendX * 2),
@@ -4146,17 +4287,21 @@ const _sfc_main$N = {
4146
4287
  }
4147
4288
  }
4148
4289
  }
4149
- canvas2.onclick = function(e) {
4150
- const rect = canvas2.getBoundingClientRect();
4151
- const x2 = e.clientX - rect.left;
4152
- const y2 = e.clientY - rect.top;
4153
- for (const [path, data] of path_data) {
4154
- if (ctx.isPointInPath(path, x2, y2)) {
4155
- emit("click", e, data);
4156
- break;
4290
+ for (let evt of events) {
4291
+ canvas2.addEventListener(evt, function(e) {
4292
+ if (e._vhandled) return;
4293
+ const rect = canvas2.getBoundingClientRect();
4294
+ const x2 = e.clientX - rect.left;
4295
+ const y2 = e.clientY - rect.top;
4296
+ for (const [path, data] of path_data) {
4297
+ if (ctx.isPointInPath(path, x2, y2)) {
4298
+ emit(evt, e, data);
4299
+ e._vhandled = true;
4300
+ break;
4301
+ }
4157
4302
  }
4158
- }
4159
- };
4303
+ });
4304
+ }
4160
4305
  return canvas2;
4161
4306
  });
4162
4307
  watch(layerCanvas, (node) => containerRef.value.replaceChildren(node));
@@ -4186,7 +4331,158 @@ const _sfc_main$N = {
4186
4331
  };
4187
4332
  }
4188
4333
  };
4189
- const _sfc_main$M = {
4334
+ const _sfc_main$P = {
4335
+ __name: "CoreCanvasBoxplot",
4336
+ props: {
4337
+ extendX: { type: Number, default: 0 },
4338
+ extendY: { type: Number, default: 0 },
4339
+ data: Object,
4340
+ coord2pos: Function,
4341
+ layout: Object
4342
+ },
4343
+ emits: ["click", "contextmenu", "singleclick", "dblclick", "pointermove", "pointerdown", "pointerup", "wheel"],
4344
+ setup(__props, { expose: __expose, emit: __emit }) {
4345
+ let events = ["click", "contextmenu", "singleclick", "dblclick", "pointermove", "pointerdown", "pointerup", "wheel"];
4346
+ const emit = __emit;
4347
+ const vBind = computed(() => ({
4348
+ width: __props.layout.fullWidth * (1 + __props.extendX * 2),
4349
+ height: __props.layout.fullHeight * (1 + __props.extendY * 2),
4350
+ x: -__props.layout.l - __props.layout.fullWidth * __props.extendX,
4351
+ y: -__props.layout.t - __props.layout.fullHeight * __props.extendY
4352
+ }));
4353
+ const containerRef = useTemplateRef("container");
4354
+ const layerCanvas = computed(() => {
4355
+ if (containerRef.value == null) return;
4356
+ const canvas2 = document.createElement("canvas");
4357
+ canvas2.width = __props.layout.fullWidth * (1 + __props.extendX * 2);
4358
+ canvas2.height = __props.layout.fullHeight * (1 + __props.extendY * 2);
4359
+ const ctx = canvas2.getContext("2d");
4360
+ ctx.clearRect(0, 0, canvas2.width, canvas2.height);
4361
+ ctx.translate(__props.layout.l + __props.layout.fullWidth * __props.extendX, __props.layout.t + __props.layout.fullHeight * __props.extendY);
4362
+ let path_data = /* @__PURE__ */ new Map();
4363
+ for (const group of __props.data) {
4364
+ for (let {
4365
+ x: x2,
4366
+ xmin,
4367
+ xmax,
4368
+ y: y2,
4369
+ ymin,
4370
+ ymax,
4371
+ lwisker,
4372
+ Q1,
4373
+ median,
4374
+ Q3,
4375
+ uwisker,
4376
+ outliers,
4377
+ $xmin,
4378
+ $xmax,
4379
+ $ymin,
4380
+ $ymax,
4381
+ fill = "white",
4382
+ color = "black",
4383
+ linewidth = 1,
4384
+ linetype,
4385
+ alpha,
4386
+ "translate-x": translateX = 0,
4387
+ "translate-y": translateY = 0,
4388
+ $raw
4389
+ } of group) {
4390
+ if (color === "transparent") continue;
4391
+ 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 });
4392
+ const { h: lx1, v: ly1 } = __props.coord2pos(x2 == null ? { y: y2, x: lwisker } : { x: x2, y: lwisker });
4393
+ const { h: lx2, v: ly2 } = __props.coord2pos(x2 == null ? { y: y2, x: uwisker } : { x: x2, y: uwisker });
4394
+ const { h: mx1, v: my1 } = __props.coord2pos(x2 == null ? { y: ymin, x: median } : { x: xmin, y: median });
4395
+ const { h: mx2, v: my2 } = __props.coord2pos(x2 == null ? { y: ymax, x: median } : { x: xmax, y: median });
4396
+ 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 });
4397
+ 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 });
4398
+ 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 });
4399
+ 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 });
4400
+ ctx.globalAlpha = alpha;
4401
+ ctx.setLineDash(parseLineType(linetype));
4402
+ const linepath2d = new Path2D();
4403
+ linepath2d.moveTo(lx1 + translateX, ly1 + translateY);
4404
+ linepath2d.lineTo(lx2 + translateX, ly2 + translateY);
4405
+ const wiskerpath2d = new Path2D();
4406
+ wiskerpath2d.moveTo(uwx1 + translateX, uwy1 + translateY);
4407
+ wiskerpath2d.lineTo(uwx2 + translateX, uwy2 + translateY);
4408
+ wiskerpath2d.moveTo(lwx1 + translateX, lwy1 + translateY);
4409
+ wiskerpath2d.lineTo(lwx2 + translateX, lwy2 + translateY);
4410
+ ctx.lineWidth = linewidth;
4411
+ if (color !== "none") {
4412
+ ctx.strokeStyle = color;
4413
+ ctx.stroke(linepath2d);
4414
+ ctx.stroke(wiskerpath2d);
4415
+ }
4416
+ const rectpath2d = new Path2D();
4417
+ rectpath2d.rect(rx1 + translateX, ry1 + translateY, rx2 - rx1, ry2 - ry1);
4418
+ if (fill !== "none") {
4419
+ ctx.fillStyle = fill;
4420
+ ctx.fill(rectpath2d);
4421
+ }
4422
+ if (color != null) {
4423
+ ctx.strokeStyle = color;
4424
+ ctx.stroke(rectpath2d);
4425
+ }
4426
+ path_data.set(rectpath2d, $raw);
4427
+ const medianpath2d = new Path2D();
4428
+ medianpath2d.moveTo(mx1 + translateX, my1 + translateY);
4429
+ medianpath2d.lineTo(mx2 + translateX, my2 + translateY);
4430
+ ctx.lineWidth = linewidth * 2;
4431
+ if (color !== "none") {
4432
+ ctx.strokeStyle = color;
4433
+ ctx.stroke(medianpath2d);
4434
+ }
4435
+ for (let { x: x3, y: y3, $raw: $raw2 } of outliers) {
4436
+ const { h: ox, v: oy } = __props.coord2pos({ x: x3, y: y3 });
4437
+ const outlierpath2d = new Path2D();
4438
+ outlierpath2d.arc(ox + translateX, oy + translateY, 2, 0, Math.PI * 2);
4439
+ if (fill !== "none") {
4440
+ ctx.fillStyle = color;
4441
+ ctx.fill(outlierpath2d);
4442
+ }
4443
+ path_data.set(outlierpath2d, $raw2);
4444
+ }
4445
+ }
4446
+ }
4447
+ for (let evt of events) {
4448
+ canvas2.addEventListener(evt, function(e) {
4449
+ if (e._vhandled) return;
4450
+ const rect = canvas2.getBoundingClientRect();
4451
+ const x2 = e.clientX - rect.left;
4452
+ const y2 = e.clientY - rect.top;
4453
+ for (const [path, data] of path_data) {
4454
+ if (ctx.isPointInPath(path, x2, y2)) {
4455
+ emit(evt, e, data);
4456
+ e._vhandled = true;
4457
+ break;
4458
+ }
4459
+ }
4460
+ });
4461
+ }
4462
+ return canvas2;
4463
+ });
4464
+ watch(layerCanvas, (node) => containerRef.value.replaceChildren(node));
4465
+ __expose({
4466
+ dispatchEvent: (event) => layerCanvas.value?.dispatchEvent?.(event)
4467
+ });
4468
+ function parseLineType(linetype) {
4469
+ if (linetype == null) return [];
4470
+ if (Array.isArray(linetype)) return linetype;
4471
+ if (linetype === "solid") return [];
4472
+ if (linetype === "dashed") return [4, 4];
4473
+ if (linetype === "dotted") return [1, 3];
4474
+ if (linetype === "dotdash") return [1, 3, 4, 3];
4475
+ if (linetype === "longdash") return [8, 4];
4476
+ if (linetype === "twodash") return [2, 2, 6, 2];
4477
+ if (linetype.includes(" ")) return linetype;
4478
+ return linetype.split("").map((v) => +("0x" + v));
4479
+ }
4480
+ return (_ctx, _cache) => {
4481
+ return openBlock(), createElementBlock("foreignObject", mergeProps(vBind.value, { ref: "container" }), null, 16);
4482
+ };
4483
+ }
4484
+ };
4485
+ const _sfc_main$O = {
4190
4486
  __name: "CoreCanvasLine",
4191
4487
  props: {
4192
4488
  extendX: { type: Number, default: 0 },
@@ -4195,8 +4491,9 @@ const _sfc_main$M = {
4195
4491
  coord2pos: Function,
4196
4492
  layout: Object
4197
4493
  },
4198
- emits: ["click", "contextmenu", "pointerenter", "pointerleave", "pointermove", "pointerdown", "pointerup"],
4494
+ emits: ["click", "contextmenu", "singleclick", "dblclick", "pointermove", "pointerdown", "pointerup", "wheel"],
4199
4495
  setup(__props, { expose: __expose, emit: __emit }) {
4496
+ let events = ["click", "contextmenu", "singleclick", "dblclick", "pointermove", "pointerdown", "pointerup", "wheel"];
4200
4497
  const emit = __emit;
4201
4498
  const vBind = computed(() => ({
4202
4499
  width: __props.layout.fullWidth * (1 + __props.extendX * 2),
@@ -4244,17 +4541,21 @@ const _sfc_main$M = {
4244
4541
  }
4245
4542
  }
4246
4543
  }
4247
- canvas2.onclick = function(e) {
4248
- const rect = canvas2.getBoundingClientRect();
4249
- const x2 = e.clientX - rect.left;
4250
- const y2 = e.clientY - rect.top;
4251
- for (const [path, data] of path_data) {
4252
- if (ctx.isPointInPath(path, x2, y2)) {
4253
- emit("click", e, data);
4254
- break;
4544
+ for (let evt of events) {
4545
+ canvas2.addEventListener(evt, function(e) {
4546
+ if (e._vhandled) return;
4547
+ const rect = canvas2.getBoundingClientRect();
4548
+ const x2 = e.clientX - rect.left;
4549
+ const y2 = e.clientY - rect.top;
4550
+ for (const [path, data] of path_data) {
4551
+ if (ctx.isPointInPath(path, x2, y2)) {
4552
+ emit(evt, e, data);
4553
+ e._vhandled = true;
4554
+ break;
4555
+ }
4255
4556
  }
4256
- }
4257
- };
4557
+ });
4558
+ }
4258
4559
  return canvas2;
4259
4560
  });
4260
4561
  watch(layerCanvas, (node) => containerRef.value.replaceChildren(node));
@@ -4278,7 +4579,7 @@ const _sfc_main$M = {
4278
4579
  };
4279
4580
  }
4280
4581
  };
4281
- const _sfc_main$L = {
4582
+ const _sfc_main$N = {
4282
4583
  __name: "CoreCanvasPoint",
4283
4584
  props: {
4284
4585
  extendX: { type: Number, default: 0 },
@@ -4287,8 +4588,9 @@ const _sfc_main$L = {
4287
4588
  coord2pos: Function,
4288
4589
  layout: Object
4289
4590
  },
4290
- emits: ["click", "contextmenu", "pointerenter", "pointerleave", "pointermove", "pointerdown", "pointerup"],
4591
+ emits: ["click", "contextmenu", "singleclick", "dblclick", "pointermove", "pointerdown", "pointerup", "wheel"],
4291
4592
  setup(__props, { expose: __expose, emit: __emit }) {
4593
+ let events = ["click", "contextmenu", "singleclick", "dblclick", "pointermove", "pointerdown", "pointerup", "wheel"];
4292
4594
  const emit = __emit;
4293
4595
  const paths = {
4294
4596
  triangle: (s) => `M0-${s * 2 / 3}L${s * 0.577},${s / 3}L-${s * 0.577},${s / 3}Z`,
@@ -4356,17 +4658,21 @@ const _sfc_main$L = {
4356
4658
  }
4357
4659
  }
4358
4660
  }
4359
- canvas2.onclick = function(e) {
4360
- const rect = canvas2.getBoundingClientRect();
4361
- const x2 = e.clientX - rect.left;
4362
- const y2 = e.clientY - rect.top;
4363
- for (const [path, data] of path_data) {
4364
- if (ctx.isPointInPath(path, x2, y2)) {
4365
- emit("click", e, data);
4366
- break;
4661
+ for (let evt of events) {
4662
+ canvas2.addEventListener(evt, function(e) {
4663
+ if (e._vhandled) return;
4664
+ const rect = canvas2.getBoundingClientRect();
4665
+ const x2 = e.clientX - rect.left;
4666
+ const y2 = e.clientY - rect.top;
4667
+ for (const [path, data] of path_data) {
4668
+ if (ctx.isPointInPath(path, x2, y2)) {
4669
+ emit(evt, e, data);
4670
+ e._vhandled = true;
4671
+ break;
4672
+ }
4367
4673
  }
4368
- }
4369
- };
4674
+ });
4675
+ }
4370
4676
  return canvas2;
4371
4677
  });
4372
4678
  watch(layerCanvas, (node) => containerRef.value.replaceChildren(node));
@@ -4378,7 +4684,7 @@ const _sfc_main$L = {
4378
4684
  };
4379
4685
  }
4380
4686
  };
4381
- const _sfc_main$K = {
4687
+ const _sfc_main$M = {
4382
4688
  __name: "CoreCanvasPolygon",
4383
4689
  props: {
4384
4690
  extendX: { type: Number, default: 0 },
@@ -4387,8 +4693,9 @@ const _sfc_main$K = {
4387
4693
  coord2pos: Function,
4388
4694
  layout: Object
4389
4695
  },
4390
- emits: ["click", "contextmenu", "pointerenter", "pointerleave", "pointermove", "pointerdown", "pointerup"],
4696
+ emits: ["click", "contextmenu", "singleclick", "dblclick", "pointermove", "pointerdown", "pointerup", "wheel"],
4391
4697
  setup(__props, { expose: __expose, emit: __emit }) {
4698
+ let events = ["click", "contextmenu", "singleclick", "dblclick", "pointermove", "pointerdown", "pointerup", "wheel"];
4392
4699
  const emit = __emit;
4393
4700
  const vBind = computed(() => ({
4394
4701
  width: __props.layout.fullWidth * (1 + __props.extendX * 2),
@@ -4440,17 +4747,21 @@ const _sfc_main$K = {
4440
4747
  }
4441
4748
  }
4442
4749
  }
4443
- canvas2.onclick = function(e) {
4444
- const rect = canvas2.getBoundingClientRect();
4445
- const x2 = e.clientX - rect.left;
4446
- const y2 = e.clientY - rect.top;
4447
- for (const [path, data] of path_data) {
4448
- if (ctx.isPointInPath(path, x2, y2)) {
4449
- emit("click", e, data);
4450
- break;
4750
+ for (let evt of events) {
4751
+ canvas2.addEventListener(evt, function(e) {
4752
+ if (e._vhandled) return;
4753
+ const rect = canvas2.getBoundingClientRect();
4754
+ const x2 = e.clientX - rect.left;
4755
+ const y2 = e.clientY - rect.top;
4756
+ for (const [path, data] of path_data) {
4757
+ if (ctx.isPointInPath(path, x2, y2)) {
4758
+ emit(evt, e, data);
4759
+ e._vhandled = true;
4760
+ break;
4761
+ }
4451
4762
  }
4452
- }
4453
- };
4763
+ });
4764
+ }
4454
4765
  return canvas2;
4455
4766
  });
4456
4767
  watch(layerCanvas, (node) => containerRef.value.replaceChildren(node));
@@ -4474,7 +4785,7 @@ const _sfc_main$K = {
4474
4785
  };
4475
4786
  }
4476
4787
  };
4477
- const _sfc_main$J = {
4788
+ const _sfc_main$L = {
4478
4789
  __name: "CoreCanvasRect",
4479
4790
  props: {
4480
4791
  extendX: { type: Number, default: 0 },
@@ -4483,8 +4794,9 @@ const _sfc_main$J = {
4483
4794
  coord2pos: Function,
4484
4795
  layout: Object
4485
4796
  },
4486
- emits: ["click", "contextmenu", "pointerenter", "pointerleave", "pointermove", "pointerdown", "pointerup"],
4797
+ emits: ["click", "contextmenu", "singleclick", "dblclick", "pointermove", "pointerdown", "pointerup", "wheel"],
4487
4798
  setup(__props, { expose: __expose, emit: __emit }) {
4799
+ let events = ["click", "contextmenu", "singleclick", "dblclick", "pointermove", "pointerdown", "pointerup", "wheel"];
4488
4800
  const emit = __emit;
4489
4801
  const vBind = computed(() => ({
4490
4802
  width: __props.layout.fullWidth * (1 + __props.extendX * 2),
@@ -4534,17 +4846,21 @@ const _sfc_main$J = {
4534
4846
  }
4535
4847
  }
4536
4848
  }
4537
- canvas2.onclick = function(e) {
4538
- const rect = canvas2.getBoundingClientRect();
4539
- const x2 = e.clientX - rect.left;
4540
- const y2 = e.clientY - rect.top;
4541
- for (const [path, data] of path_data) {
4542
- if (ctx.isPointInPath(path, x2, y2)) {
4543
- emit("click", e, data);
4544
- break;
4849
+ for (let evt of events) {
4850
+ canvas2.addEventListener(evt, function(e) {
4851
+ if (e._vhandled) return;
4852
+ const rect = canvas2.getBoundingClientRect();
4853
+ const x2 = e.clientX - rect.left;
4854
+ const y2 = e.clientY - rect.top;
4855
+ for (const [path, data] of path_data) {
4856
+ if (ctx.isPointInPath(path, x2, y2)) {
4857
+ emit(evt, e, data);
4858
+ e._vhandled = true;
4859
+ break;
4860
+ }
4545
4861
  }
4546
- }
4547
- };
4862
+ });
4863
+ }
4548
4864
  return canvas2;
4549
4865
  });
4550
4866
  watch(layerCanvas, (node) => containerRef.value.replaceChildren(node));
@@ -4568,7 +4884,7 @@ const _sfc_main$J = {
4568
4884
  };
4569
4885
  }
4570
4886
  };
4571
- const _sfc_main$I = {
4887
+ const _sfc_main$K = {
4572
4888
  __name: "CoreCanvasText",
4573
4889
  props: {
4574
4890
  extendX: { type: Number, default: 0 },
@@ -4577,8 +4893,9 @@ const _sfc_main$I = {
4577
4893
  coord2pos: Function,
4578
4894
  layout: Object
4579
4895
  },
4580
- emits: ["click", "contextmenu", "pointerenter", "pointerleave", "pointermove", "pointerdown", "pointerup"],
4896
+ emits: ["click", "contextmenu", "singleclick", "dblclick", "pointermove", "pointerdown", "pointerup", "wheel"],
4581
4897
  setup(__props, { expose: __expose, emit: __emit }) {
4898
+ let events = ["click", "contextmenu", "singleclick", "dblclick", "pointermove", "pointerdown", "pointerup", "wheel"];
4582
4899
  const emit = __emit;
4583
4900
  const vBind = computed(() => ({
4584
4901
  width: __props.layout.fullWidth * (1 + __props.extendX * 2),
@@ -4635,24 +4952,24 @@ const _sfc_main$I = {
4635
4952
  } else if (textLength != null) {
4636
4953
  width = textLength;
4637
4954
  }
4638
- if (anchorX != null || anchorY != null) {
4639
- 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);
4640
- if (isNaN(alnX)) alnX = 0.5;
4641
- if (isNaN(alnY)) alnY = 0.5;
4642
- let w2 = width, h = height;
4643
- ctx.rotate(angle * Math.PI / 180);
4644
- ctx.translate(w2 * (0.5 - alnX), h * (alnY - 0.5));
4645
- } else if (dockX != null || dockY != null) {
4955
+ if (dockX != null || dockY != null) {
4646
4956
  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);
4647
4957
  if (isNaN(alnX)) alnX = 0.5;
4648
4958
  if (isNaN(alnY)) alnY = 0.5;
4649
4959
  let w2 = width * Math.abs(Math.cos(angle * Math.PI / 180)) + height * Math.abs(Math.sin(angle * Math.PI / 180)), h = width * Math.abs(Math.sin(angle * Math.PI / 180)) + height * Math.abs(Math.cos(angle * Math.PI / 180));
4650
4960
  ctx.translate(w2 * (0.5 - alnX), h * (alnY - 0.5));
4651
4961
  ctx.rotate(angle * Math.PI / 180);
4652
- }
4653
- if (width != w) ctx.scale(width / w, 1);
4654
- if (color !== "none") {
4655
- ctx.fillStyle = color;
4962
+ } else {
4963
+ 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);
4964
+ if (isNaN(alnX)) alnX = 0.5;
4965
+ if (isNaN(alnY)) alnY = 0.5;
4966
+ let w2 = width, h = height;
4967
+ ctx.rotate(angle * Math.PI / 180);
4968
+ ctx.translate(w2 * (0.5 - alnX), h * (alnY - 0.5));
4969
+ }
4970
+ if (width != w) ctx.scale(width / w, 1);
4971
+ if (color !== "none") {
4972
+ ctx.fillStyle = color;
4656
4973
  ctx.fillText(label, 0, 0);
4657
4974
  }
4658
4975
  if (stroke != null) {
@@ -4662,17 +4979,21 @@ const _sfc_main$I = {
4662
4979
  ctx.restore();
4663
4980
  }
4664
4981
  }
4665
- canvas2.onclick = function(e) {
4666
- const rect = canvas2.getBoundingClientRect();
4667
- const x2 = e.clientX - rect.left;
4668
- const y2 = e.clientY - rect.top;
4669
- for (const [path, data] of path_data) {
4670
- if (ctx.isPointInPath(path, x2, y2)) {
4671
- emit("click", e, data);
4672
- break;
4982
+ for (let evt of events) {
4983
+ canvas2.addEventListener(evt, function(e) {
4984
+ if (e._vhandled) return;
4985
+ const rect = canvas2.getBoundingClientRect();
4986
+ const x2 = e.clientX - rect.left;
4987
+ const y2 = e.clientY - rect.top;
4988
+ for (const [path, data] of path_data) {
4989
+ if (ctx.isPointInPath(path, x2, y2)) {
4990
+ emit(evt, e, data);
4991
+ e._vhandled = true;
4992
+ break;
4993
+ }
4673
4994
  }
4674
- }
4675
- };
4995
+ });
4996
+ }
4676
4997
  return canvas2;
4677
4998
  });
4678
4999
  watch(layerCanvas, (node) => containerRef.value.replaceChildren(node));
@@ -4696,7 +5017,7 @@ const _sfc_main$I = {
4696
5017
  };
4697
5018
  }
4698
5019
  };
4699
- const _sfc_main$H = {
5020
+ const _sfc_main$J = {
4700
5021
  __name: "CoreCanvasTextsegment",
4701
5022
  props: {
4702
5023
  extendX: { type: Number, default: 0 },
@@ -4705,8 +5026,9 @@ const _sfc_main$H = {
4705
5026
  coord2pos: Function,
4706
5027
  layout: Object
4707
5028
  },
4708
- emits: ["click", "contextmenu", "pointerenter", "pointerleave", "pointermove", "pointerdown", "pointerup"],
5029
+ emits: ["click", "contextmenu", "singleclick", "dblclick", "pointermove", "pointerdown", "pointerup", "wheel"],
4709
5030
  setup(__props, { expose: __expose, emit: __emit }) {
5031
+ let events = ["click", "contextmenu", "singleclick", "dblclick", "pointermove", "pointerdown", "pointerup", "wheel"];
4710
5032
  const emit = __emit;
4711
5033
  const vBind = computed(() => ({
4712
5034
  width: __props.layout.fullWidth * (1 + __props.extendX * 2),
@@ -4782,17 +5104,21 @@ const _sfc_main$H = {
4782
5104
  ctx.restore();
4783
5105
  }
4784
5106
  }
4785
- canvas2.onclick = function(e) {
4786
- const rect = canvas2.getBoundingClientRect();
4787
- const x2 = e.clientX - rect.left;
4788
- const y2 = e.clientY - rect.top;
4789
- for (const [path, data] of path_data) {
4790
- if (ctx.isPointInPath(path, x2, y2)) {
4791
- emit("click", e, data);
4792
- break;
5107
+ for (let evt of events) {
5108
+ canvas2.addEventListener(evt, function(e) {
5109
+ if (e._vhandled) return;
5110
+ const rect = canvas2.getBoundingClientRect();
5111
+ const x2 = e.clientX - rect.left;
5112
+ const y2 = e.clientY - rect.top;
5113
+ for (const [path, data] of path_data) {
5114
+ if (ctx.isPointInPath(path, x2, y2)) {
5115
+ emit(evt, e, data);
5116
+ e._vhandled = true;
5117
+ break;
5118
+ }
4793
5119
  }
4794
- }
4795
- };
5120
+ });
5121
+ }
4796
5122
  return canvas2;
4797
5123
  });
4798
5124
  watch(layerCanvas, (node) => containerRef.value.replaceChildren(node));
@@ -4820,17 +5146,18 @@ const _sfc_main$H = {
4820
5146
  };
4821
5147
  const canvas = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4822
5148
  __proto__: null,
4823
- curve: _sfc_main$N,
4824
- line: _sfc_main$M,
4825
- point: _sfc_main$L,
4826
- polygon: _sfc_main$K,
4827
- rect: _sfc_main$J,
4828
- stick: _sfc_main$M,
4829
- text: _sfc_main$I,
4830
- textsegment: _sfc_main$H,
4831
- tile: _sfc_main$J
5149
+ boxplot: _sfc_main$P,
5150
+ curve: _sfc_main$Q,
5151
+ line: _sfc_main$O,
5152
+ point: _sfc_main$N,
5153
+ polygon: _sfc_main$M,
5154
+ rect: _sfc_main$L,
5155
+ stick: _sfc_main$O,
5156
+ text: _sfc_main$K,
5157
+ textsegment: _sfc_main$J,
5158
+ tile: _sfc_main$L
4832
5159
  }, Symbol.toStringTag, { value: "Module" }));
4833
- const _sfc_main$G = {
5160
+ const _sfc_main$I = {
4834
5161
  __name: "CoreSvgBlank",
4835
5162
  props: {
4836
5163
  extendX: { type: Number, default: 0 },
@@ -4846,12 +5173,121 @@ const _sfc_main$G = {
4846
5173
  };
4847
5174
  }
4848
5175
  };
5176
+ const _sfc_main$H = {
5177
+ __name: "CoreTile",
5178
+ props: {
5179
+ x: { type: Number, default: 0 },
5180
+ y: { type: Number, default: 0 },
5181
+ width: { type: Number, default: 0 },
5182
+ height: { type: Number, default: 0 },
5183
+ fill: String,
5184
+ color: String,
5185
+ linewidth: Number,
5186
+ linetype: String,
5187
+ alpha: { type: Number, default: 1 },
5188
+ translateX: { type: Number, default: 0 },
5189
+ translateY: { type: Number, default: 0 }
5190
+ },
5191
+ setup(__props) {
5192
+ const binds = computed(() => {
5193
+ return {
5194
+ x: __props.x - __props.width / 2,
5195
+ y: __props.y - __props.height / 2,
5196
+ width: __props.width,
5197
+ height: __props.height,
5198
+ fill: __props.fill || null,
5199
+ "fill-opacity": __props.alpha == 1 ? null : __props.alpha,
5200
+ stroke: __props.color || null,
5201
+ "stroke-width": __props.linewidth,
5202
+ "stroke-opacity": __props.alpha == 1 ? null : __props.alpha,
5203
+ "stroke-dasharray": parseLineType(__props.linetype),
5204
+ transform: __props.translateX || __props.translateY ? `translate(${__props.translateX}, ${__props.translateY})` : null
5205
+ };
5206
+ });
5207
+ function parseLineType(linetype) {
5208
+ if (linetype == null) return null;
5209
+ if (Array.isArray(linetype)) return linetype.join(" ");
5210
+ if (linetype === "solid") return null;
5211
+ if (linetype === "dashed") return "4 4";
5212
+ if (linetype === "dotted") return "1 3";
5213
+ if (linetype === "dotdash") return "1 3 4 3";
5214
+ if (linetype === "longdash") return "8 4";
5215
+ if (linetype === "twodash") return "2 2 6 2";
5216
+ if (linetype.includes(" ")) return linetype;
5217
+ return linetype.split("").map((v) => +("0x" + v)).join(" ");
5218
+ }
5219
+ return (_ctx, _cache) => {
5220
+ return openBlock(), createElementBlock("rect", normalizeProps(guardReactiveProps(binds.value)), null, 16);
5221
+ };
5222
+ }
5223
+ };
5224
+ const _sfc_main$G = {
5225
+ __name: "CorePoint",
5226
+ props: {
5227
+ x: { type: Number, default: 0 },
5228
+ y: { type: Number, default: 0 },
5229
+ shape: String,
5230
+ size: { type: Number, default: 6 },
5231
+ color: String,
5232
+ stroke: String,
5233
+ linewidth: Number,
5234
+ linetype: String,
5235
+ alpha: { type: Number, default: 1 },
5236
+ angle: { type: Number, default: 0 },
5237
+ translateX: { type: Number, default: 0 },
5238
+ translateY: { type: Number, default: 0 }
5239
+ },
5240
+ setup(__props) {
5241
+ const paths = {
5242
+ square: "M-0.5-0.5H0.5V0.5H-0.5Z",
5243
+ triangle: "M0-0.667L0.577,0.333L-0.577,0.333Z",
5244
+ diamond: "M0-0.707L0.707,0L0,0.707L-0.707,0Z",
5245
+ plus: "M-0.1-0.5V-0.1H-0.5V0.1H-0.1V0.5H0.1V0.1H0.5V-0.1H0.1V-0.5H-0.1Z",
5246
+ cross: "M-0.283-0.424L-0.424-0.283L-0.141,0L-0.424,0.283L-0.283,0.424L0,0.141L0.283,0.424L0.424,0.283L0.141,0L0.424,-0.283L0.283,-0.424L0,-0.141Z"
5247
+ };
5248
+ const binds = computed(() => {
5249
+ let d = __props.shape?.startsWith?.("path:") ? __props.shape?.slice?.(5) : paths[__props.shape];
5250
+ let result = {
5251
+ fill: __props.color || null,
5252
+ "fill-opacity": __props.alpha == 1 ? null : __props.alpha,
5253
+ stroke: __props.stroke || null,
5254
+ "stroke-width": __props.linewidth,
5255
+ "stroke-opacity": __props.alpha == 1 ? null : __props.alpha,
5256
+ "stroke-dasharray": parseLineType(__props.linetype)
5257
+ };
5258
+ if (d != null) {
5259
+ let transform = `translate(${__props.x + __props.translateX},${__props.y + __props.translateY}) scale(${__props.size}) rotate(${__props.angle})`;
5260
+ Object.assign(result, { d, transform });
5261
+ } else {
5262
+ let transform = __props.translateX || __props.translateY ? `translate(${__props.translateX}, ${__props.translateY})` : null;
5263
+ Object.assign(result, { cx: __props.x, cy: __props.y, r: __props.size / 2, transform });
5264
+ }
5265
+ return result;
5266
+ });
5267
+ function parseLineType(linetype) {
5268
+ if (linetype == null) return null;
5269
+ if (Array.isArray(linetype)) return linetype.join(" ");
5270
+ if (linetype === "solid") return null;
5271
+ if (linetype === "dashed") return "4 4";
5272
+ if (linetype === "dotted") return "1 3";
5273
+ if (linetype === "dotdash") return "1 3 4 3";
5274
+ if (linetype === "longdash") return "8 4";
5275
+ if (linetype === "twodash") return "2 2 6 2";
5276
+ if (linetype.includes(" ")) return linetype;
5277
+ return linetype.split("").map((v) => +("0x" + v)).join(" ");
5278
+ }
5279
+ return (_ctx, _cache) => {
5280
+ return binds.value.d ? (openBlock(), createElementBlock("path", normalizeProps(mergeProps({ key: 0 }, binds.value)), null, 16)) : (openBlock(), createElementBlock("circle", normalizeProps(mergeProps({ key: 1 }, binds.value)), null, 16));
5281
+ };
5282
+ }
5283
+ };
4849
5284
  const _sfc_main$F = {
4850
- __name: "CoreCurve",
5285
+ __name: "CoreLine",
4851
5286
  props: {
4852
- points: { type: Array, default: () => [] },
4853
- interpolate: { default: "natural" },
4854
- fill: { type: String, default: "none" },
5287
+ x1: { type: Number, default: 0 },
5288
+ y1: { type: Number, default: 0 },
5289
+ x2: { type: Number, default: 0 },
5290
+ y2: { type: Number, default: 0 },
4855
5291
  color: String,
4856
5292
  stroke: String,
4857
5293
  linewidth: Number,
@@ -4862,23 +5298,18 @@ const _sfc_main$F = {
4862
5298
  },
4863
5299
  setup(__props) {
4864
5300
  const binds = computed(() => {
4865
- let interpolatorFn = interpolators[__props.interpolate] ?? natural;
4866
5301
  return {
4867
- d: line().curve(interpolatorFn)(__props.points.map((p) => [p.x, p.y])),
4868
- fill: __props.fill,
4869
- stroke: __props.color,
5302
+ x1: __props.x1,
5303
+ x2: __props.x2,
5304
+ y1: __props.y1,
5305
+ y2: __props.y2,
5306
+ stroke: __props.color || null,
4870
5307
  "stroke-width": __props.linewidth,
4871
- "stroke-opacity": __props.alpha,
5308
+ "stroke-opacity": __props.alpha == 1 ? null : __props.alpha,
4872
5309
  "stroke-dasharray": parseLineType(__props.linetype),
4873
5310
  transform: __props.translateX || __props.translateY ? `translate(${__props.translateX}, ${__props.translateY})` : null
4874
5311
  };
4875
5312
  });
4876
- const interpolators = {
4877
- cardinal,
4878
- catmullRom,
4879
- linear: curveLinear,
4880
- natural
4881
- };
4882
5313
  function parseLineType(linetype) {
4883
5314
  if (linetype == null) return null;
4884
5315
  if (Array.isArray(linetype)) return linetype.join(" ");
@@ -4892,12 +5323,12 @@ const _sfc_main$F = {
4892
5323
  return linetype.split("").map((v) => +("0x" + v)).join(" ");
4893
5324
  }
4894
5325
  return (_ctx, _cache) => {
4895
- return openBlock(), createElementBlock("path", normalizeProps(guardReactiveProps(binds.value)), null, 16);
5326
+ return openBlock(), createElementBlock("line", normalizeProps(guardReactiveProps(binds.value)), null, 16);
4896
5327
  };
4897
5328
  }
4898
5329
  };
4899
5330
  const _sfc_main$E = {
4900
- __name: "CoreSvgCurve",
5331
+ __name: "CoreSvgBoxplot",
4901
5332
  props: {
4902
5333
  extendX: { type: Number, default: 0 },
4903
5334
  extendY: { type: Number, default: 0 },
@@ -4905,14 +5336,30 @@ const _sfc_main$E = {
4905
5336
  coord2pos: Function,
4906
5337
  layout: Object
4907
5338
  },
4908
- emits: ["click", "contextmenu", "pointerover", "pointerout", "pointerenter", "pointerleave", "pointermove", "pointerdown", "pointerup", "wheel"],
5339
+ emits: ["click", "contextmenu", "singleclick", "pointerover", "pointerout", "pointerenter", "pointerleave", "pointermove", "pointerdown", "pointerup", "wheel"],
4909
5340
  setup(__props, { emit: __emit }) {
5341
+ let events = ["click", "contextmenu", "singleclick", "pointerover", "pointerout", "pointerenter", "pointerleave", "pointermove", "pointerdown", "pointerup", "wheel"];
4910
5342
  const emit = __emit;
4911
5343
  const binds = computed(() => {
4912
5344
  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;
4913
5345
  return __props.data.map((group) => group.map(({
4914
- points,
4915
- fill = "none",
5346
+ x: x2,
5347
+ xmin,
5348
+ xmax,
5349
+ y: y2,
5350
+ ymin,
5351
+ ymax,
5352
+ lwisker,
5353
+ Q1,
5354
+ median,
5355
+ Q3,
5356
+ uwisker,
5357
+ outliers,
5358
+ $xmin,
5359
+ $xmax,
5360
+ $ymin,
5361
+ $ymax,
5362
+ fill = "white",
4916
5363
  color = "black",
4917
5364
  linewidth,
4918
5365
  linetype,
@@ -4921,37 +5368,123 @@ const _sfc_main$E = {
4921
5368
  "translate-y": translateY = 0,
4922
5369
  $raw
4923
5370
  }) => {
4924
- points = points.map((p) => (({ h: x2, v: y2 }) => ({ x: x2, y: y2 }))(__props.coord2pos(p)));
4925
- if (points.every((p) => p.x < xlim_min) || points.every((p) => p.x > xlim_max) || points.every((p) => p.y < ylim_min) || points.every((p) => p.y > ylim_max)) return null;
4926
- let result = {
4927
- points,
4928
- fill,
4929
- color,
4930
- linetype,
4931
- linewidth,
4932
- alpha,
4933
- translateX,
4934
- translateY,
4935
- onClick: (e) => emit("click", e, $raw),
4936
- onContextmenu: (e) => emit("contextmenu", e, $raw),
4937
- onPointerover: (e) => emit("pointerover", e, $raw),
4938
- onPointerout: (e) => emit("pointerout", e, $raw),
4939
- onPointerenter: (e) => emit("pointerenter", e, $raw),
4940
- onPointerleave: (e) => emit("pointerleave", e, $raw),
4941
- onPointerdown: (e) => emit("pointerdown", e, $raw),
4942
- onPointerup: (e) => emit("pointerup", e, $raw),
4943
- onPointermove: (e) => emit("pointermove", e, $raw),
4944
- onWheel: (e) => emit("wheel", e, $raw)
5371
+ const { hmin: x1, hmax: x22, vmin: y1, vmax: y22 } = __props.coord2pos({ xmin: $xmin, xmax: $xmax, ymin: $ymin, ymax: $ymax });
5372
+ if (x1 < xlim_min && x22 < xlim_min || x1 > xlim_max && x22 > xlim_max || y1 < ylim_min && y22 < ylim_min || y1 > ylim_max && y22 > ylim_max) return null;
5373
+ 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 });
5374
+ const { h: lx1, v: ly1 } = __props.coord2pos(x2 == null ? { y: y2, x: lwisker } : { x: x2, y: lwisker });
5375
+ const { h: lx2, v: ly2 } = __props.coord2pos(x2 == null ? { y: y2, x: uwisker } : { x: x2, y: uwisker });
5376
+ const { h: mx1, v: my1 } = __props.coord2pos(x2 == null ? { y: ymin, x: median } : { x: xmin, y: median });
5377
+ const { h: mx2, v: my2 } = __props.coord2pos(x2 == null ? { y: ymax, x: median } : { x: xmax, y: median });
5378
+ 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 });
5379
+ 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 });
5380
+ 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 });
5381
+ 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 });
5382
+ let vbinds = {
5383
+ rect: {
5384
+ x: (rx1 + rx2) / 2,
5385
+ width: rx2 - rx1,
5386
+ y: (ry1 + ry2) / 2,
5387
+ height: ry2 - ry1,
5388
+ fill,
5389
+ color,
5390
+ linetype,
5391
+ linewidth,
5392
+ alpha,
5393
+ translateX,
5394
+ translateY
5395
+ },
5396
+ line: {
5397
+ x1: lx1,
5398
+ y1: ly1,
5399
+ x2: lx2,
5400
+ y2: ly2,
5401
+ color,
5402
+ linetype,
5403
+ linewidth,
5404
+ alpha,
5405
+ translateX,
5406
+ translateY
5407
+ },
5408
+ midline: {
5409
+ x1: mx1,
5410
+ y1: my1,
5411
+ x2: mx2,
5412
+ y2: my2,
5413
+ color,
5414
+ linetype,
5415
+ linewidth: (linewidth ?? 1) * 2,
5416
+ alpha,
5417
+ translateX,
5418
+ translateY
5419
+ },
5420
+ uwisker: {
5421
+ x1: uwx1,
5422
+ y1: uwy1,
5423
+ x2: uwx2,
5424
+ y2: uwy2,
5425
+ color,
5426
+ linetype,
5427
+ linewidth,
5428
+ alpha,
5429
+ translateX,
5430
+ translateY
5431
+ },
5432
+ lwisker: {
5433
+ x1: lwx1,
5434
+ y1: lwy1,
5435
+ x2: lwx2,
5436
+ y2: lwy2,
5437
+ color,
5438
+ linetype,
5439
+ linewidth,
5440
+ alpha,
5441
+ translateX,
5442
+ translateY
5443
+ },
5444
+ outliers: outliers?.map(({ x: x3, y: y3, $raw: $raw2 }) => {
5445
+ const { h: cx, v: cy } = __props.coord2pos({ x: x3, y: y3 });
5446
+ let vbind = {
5447
+ x: cx,
5448
+ y: cy,
5449
+ shape: "circle",
5450
+ size: 4,
5451
+ color,
5452
+ alpha,
5453
+ translateX,
5454
+ translateY
5455
+ };
5456
+ let von2 = Object.fromEntries(
5457
+ events.map((evt) => [evt, (e) => emit(evt, e, $raw2)])
5458
+ );
5459
+ return [vbind, von2];
5460
+ })
4945
5461
  };
4946
- return result;
5462
+ let von = Object.fromEntries(
5463
+ events.map((evt) => [evt, (e) => emit(evt, Object.assign(e, { _vhandled: true }), $raw)])
5464
+ );
5465
+ return [vbinds, von];
4947
5466
  }).filter((x2) => x2 != null));
4948
5467
  });
4949
5468
  return (_ctx, _cache) => {
4950
5469
  return openBlock(), createElementBlock("g", null, [
4951
5470
  (openBlock(true), createElementBlock(Fragment, null, renderList(binds.value, (group) => {
4952
5471
  return openBlock(), createElementBlock("g", null, [
4953
- (openBlock(true), createElementBlock(Fragment, null, renderList(group, (item) => {
4954
- return openBlock(), createBlock(_sfc_main$F, mergeProps({ ref_for: true }, item), null, 16);
5472
+ (openBlock(true), createElementBlock(Fragment, null, renderList(group, ([vbinds, von]) => {
5473
+ return openBlock(), createElementBlock("g", null, [
5474
+ createVNode(_sfc_main$F, mergeProps({ ref_for: true }, vbinds.line), null, 16),
5475
+ _cache[0] || (_cache[0] = createTextVNode()),
5476
+ createVNode(_sfc_main$H, mergeProps({ ref_for: true }, vbinds.rect, toHandlers(von)), null, 16),
5477
+ _cache[1] || (_cache[1] = createTextVNode()),
5478
+ createVNode(_sfc_main$F, mergeProps({ ref_for: true }, vbinds.midline), null, 16),
5479
+ _cache[2] || (_cache[2] = createTextVNode()),
5480
+ createVNode(_sfc_main$F, mergeProps({ ref_for: true }, vbinds.uwisker), null, 16),
5481
+ _cache[3] || (_cache[3] = createTextVNode()),
5482
+ createVNode(_sfc_main$F, mergeProps({ ref_for: true }, vbinds.lwisker), null, 16),
5483
+ _cache[4] || (_cache[4] = createTextVNode()),
5484
+ (openBlock(true), createElementBlock(Fragment, null, renderList(vbinds.outliers, ([vbind, von2]) => {
5485
+ return openBlock(), createBlock(_sfc_main$G, mergeProps({ ref_for: true }, vbind, toHandlers(von2)), null, 16);
5486
+ }), 256))
5487
+ ]);
4955
5488
  }), 256))
4956
5489
  ]);
4957
5490
  }), 256))
@@ -4960,12 +5493,11 @@ const _sfc_main$E = {
4960
5493
  }
4961
5494
  };
4962
5495
  const _sfc_main$D = {
4963
- __name: "CoreLine",
5496
+ __name: "CoreCurve",
4964
5497
  props: {
4965
- x1: { type: Number, default: 0 },
4966
- y1: { type: Number, default: 0 },
4967
- x2: { type: Number, default: 0 },
4968
- y2: { type: Number, default: 0 },
5498
+ points: { type: Array, default: () => [] },
5499
+ interpolate: { default: "natural" },
5500
+ fill: { type: String, default: "none" },
4969
5501
  color: String,
4970
5502
  stroke: String,
4971
5503
  linewidth: Number,
@@ -4976,18 +5508,23 @@ const _sfc_main$D = {
4976
5508
  },
4977
5509
  setup(__props) {
4978
5510
  const binds = computed(() => {
5511
+ let interpolatorFn = interpolators[__props.interpolate] ?? natural;
4979
5512
  return {
4980
- x1: __props.x1,
4981
- x2: __props.x2,
4982
- y1: __props.y1,
4983
- y2: __props.y2,
4984
- stroke: __props.color,
5513
+ d: line().curve(interpolatorFn)(__props.points.map((p) => [p.x, p.y])),
5514
+ fill: __props.fill || null,
5515
+ stroke: __props.color || null,
4985
5516
  "stroke-width": __props.linewidth,
4986
- "stroke-opacity": __props.alpha,
5517
+ "stroke-opacity": __props.alpha == 1 ? null : __props.alpha,
4987
5518
  "stroke-dasharray": parseLineType(__props.linetype),
4988
5519
  transform: __props.translateX || __props.translateY ? `translate(${__props.translateX}, ${__props.translateY})` : null
4989
5520
  };
4990
5521
  });
5522
+ const interpolators = {
5523
+ cardinal,
5524
+ catmullRom,
5525
+ linear: curveLinear,
5526
+ natural
5527
+ };
4991
5528
  function parseLineType(linetype) {
4992
5529
  if (linetype == null) return null;
4993
5530
  if (Array.isArray(linetype)) return linetype.join(" ");
@@ -5001,11 +5538,70 @@ const _sfc_main$D = {
5001
5538
  return linetype.split("").map((v) => +("0x" + v)).join(" ");
5002
5539
  }
5003
5540
  return (_ctx, _cache) => {
5004
- return openBlock(), createElementBlock("line", normalizeProps(guardReactiveProps(binds.value)), null, 16);
5541
+ return openBlock(), createElementBlock("path", normalizeProps(guardReactiveProps(binds.value)), null, 16);
5005
5542
  };
5006
5543
  }
5007
5544
  };
5008
5545
  const _sfc_main$C = {
5546
+ __name: "CoreSvgCurve",
5547
+ props: {
5548
+ extendX: { type: Number, default: 0 },
5549
+ extendY: { type: Number, default: 0 },
5550
+ data: Object,
5551
+ coord2pos: Function,
5552
+ layout: Object
5553
+ },
5554
+ emits: ["click", "contextmenu", "singleclick", "pointerover", "pointerout", "pointerenter", "pointerleave", "pointermove", "pointerdown", "pointerup", "wheel"],
5555
+ setup(__props, { emit: __emit }) {
5556
+ let events = ["click", "contextmenu", "singleclick", "pointerover", "pointerout", "pointerenter", "pointerleave", "pointermove", "pointerdown", "pointerup", "wheel"];
5557
+ const emit = __emit;
5558
+ const binds = computed(() => {
5559
+ 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;
5560
+ return __props.data.map((group) => group.map(({
5561
+ points,
5562
+ fill = "none",
5563
+ color = "black",
5564
+ linewidth,
5565
+ linetype,
5566
+ alpha,
5567
+ "translate-x": translateX = 0,
5568
+ "translate-y": translateY = 0,
5569
+ $raw,
5570
+ interpolate
5571
+ }) => {
5572
+ points = points.map((p) => (({ h: x2, v: y2 }) => ({ x: x2, y: y2 }))(__props.coord2pos(p)));
5573
+ if (points.every((p) => p.x < xlim_min) || points.every((p) => p.x > xlim_max) || points.every((p) => p.y < ylim_min) || points.every((p) => p.y > ylim_max)) return null;
5574
+ let vbind = {
5575
+ points,
5576
+ fill,
5577
+ color,
5578
+ linetype,
5579
+ linewidth,
5580
+ alpha,
5581
+ translateX,
5582
+ translateY,
5583
+ interpolate
5584
+ };
5585
+ let von = Object.fromEntries(
5586
+ events.map((evt) => [evt, (e) => emit(evt, Object.assign(e, { _vhandled: true }), $raw)])
5587
+ );
5588
+ return [vbind, von];
5589
+ }).filter((x2) => x2 != null));
5590
+ });
5591
+ return (_ctx, _cache) => {
5592
+ return openBlock(), createElementBlock("g", null, [
5593
+ (openBlock(true), createElementBlock(Fragment, null, renderList(binds.value, (group) => {
5594
+ return openBlock(), createElementBlock("g", null, [
5595
+ (openBlock(true), createElementBlock(Fragment, null, renderList(group, ([vbind, von]) => {
5596
+ return openBlock(), createBlock(_sfc_main$D, mergeProps({ ref_for: true }, vbind, toHandlers(von)), null, 16);
5597
+ }), 256))
5598
+ ]);
5599
+ }), 256))
5600
+ ]);
5601
+ };
5602
+ }
5603
+ };
5604
+ const _sfc_main$B = {
5009
5605
  __name: "CoreSvgLine",
5010
5606
  props: {
5011
5607
  extendX: { type: Number, default: 0 },
@@ -5014,8 +5610,9 @@ const _sfc_main$C = {
5014
5610
  coord2pos: Function,
5015
5611
  layout: Object
5016
5612
  },
5017
- emits: ["click", "contextmenu", "pointerover", "pointerout", "pointerenter", "pointerleave", "pointermove", "pointerdown", "pointerup", "wheel"],
5613
+ emits: ["click", "contextmenu", "singleclick", "pointerover", "pointerout", "pointerenter", "pointerleave", "pointermove", "pointerdown", "pointerup", "wheel"],
5018
5614
  setup(__props, { emit: __emit }) {
5615
+ let events = ["click", "contextmenu", "singleclick", "pointerover", "pointerout", "pointerenter", "pointerleave", "pointermove", "pointerdown", "pointerup", "wheel"];
5019
5616
  const emit = __emit;
5020
5617
  const binds = computed(() => {
5021
5618
  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;
@@ -5035,7 +5632,7 @@ const _sfc_main$C = {
5035
5632
  const { h: x1, v: y1 } = __props.coord2pos({ x: x2, y: y2 });
5036
5633
  const { h: x22, v: y22 } = __props.coord2pos({ x: xend, y: yend });
5037
5634
  if (x1 < xlim_min && x22 < xlim_min || x1 > xlim_max && x22 > xlim_max || y1 < ylim_min && y22 < ylim_min || y1 > ylim_max && y22 > ylim_max) return null;
5038
- let result = {
5635
+ let vbind = {
5039
5636
  x1,
5040
5637
  x2: x22,
5041
5638
  y1,
@@ -5045,27 +5642,20 @@ const _sfc_main$C = {
5045
5642
  linewidth,
5046
5643
  alpha,
5047
5644
  translateX,
5048
- translateY,
5049
- onClick: (e) => emit("click", e, $raw),
5050
- onContextmenu: (e) => emit("contextmenu", e, $raw),
5051
- onPointerover: (e) => emit("pointerover", e, $raw),
5052
- onPointerout: (e) => emit("pointerout", e, $raw),
5053
- onPointerenter: (e) => emit("pointerenter", e, $raw),
5054
- onPointerleave: (e) => emit("pointerleave", e, $raw),
5055
- onPointerdown: (e) => emit("pointerdown", e, $raw),
5056
- onPointerup: (e) => emit("pointerup", e, $raw),
5057
- onPointermove: (e) => emit("pointermove", e, $raw),
5058
- onWheel: (e) => emit("wheel", e, $raw)
5645
+ translateY
5059
5646
  };
5060
- return result;
5647
+ let von = Object.fromEntries(
5648
+ events.map((evt) => [evt, (e) => emit(evt, Object.assign(e, { _vhandled: true }), $raw)])
5649
+ );
5650
+ return [vbind, von];
5061
5651
  }).filter((x2) => x2 != null));
5062
5652
  });
5063
5653
  return (_ctx, _cache) => {
5064
5654
  return openBlock(), createElementBlock("g", null, [
5065
5655
  (openBlock(true), createElementBlock(Fragment, null, renderList(binds.value, (group) => {
5066
5656
  return openBlock(), createElementBlock("g", null, [
5067
- (openBlock(true), createElementBlock(Fragment, null, renderList(group, (item) => {
5068
- return openBlock(), createBlock(_sfc_main$D, mergeProps({ ref_for: true }, item), null, 16);
5657
+ (openBlock(true), createElementBlock(Fragment, null, renderList(group, ([vbind, von]) => {
5658
+ return openBlock(), createBlock(_sfc_main$F, mergeProps({ ref_for: true }, vbind, toHandlers(von)), null, 16);
5069
5659
  }), 256))
5070
5660
  ]);
5071
5661
  }), 256))
@@ -5073,66 +5663,6 @@ const _sfc_main$C = {
5073
5663
  };
5074
5664
  }
5075
5665
  };
5076
- const _sfc_main$B = {
5077
- __name: "CorePoint",
5078
- props: {
5079
- x: { type: Number, default: 0 },
5080
- y: { type: Number, default: 0 },
5081
- shape: String,
5082
- size: { type: Number, default: 6 },
5083
- color: String,
5084
- stroke: String,
5085
- linewidth: Number,
5086
- linetype: String,
5087
- alpha: { type: Number, default: 1 },
5088
- angle: { type: Number, default: 0 },
5089
- translateX: { type: Number, default: 0 },
5090
- translateY: { type: Number, default: 0 }
5091
- },
5092
- setup(__props) {
5093
- const paths = {
5094
- square: "M-0.5-0.5H0.5V0.5H-0.5Z",
5095
- triangle: "M0-0.667L0.577,0.333L-0.577,0.333Z",
5096
- diamond: "M0-0.707L0.707,0L0,0.707L-0.707,0Z",
5097
- plus: "M-0.1-0.5V-0.1H-0.5V0.1H-0.1V0.5H0.1V0.1H0.5V-0.1H0.1V-0.5H-0.1Z",
5098
- cross: "M-0.283-0.424L-0.424-0.283L-0.141,0L-0.424,0.283L-0.283,0.424L0,0.141L0.283,0.424L0.424,0.283L0.141,0L0.424,-0.283L0.283,-0.424L0,-0.141Z"
5099
- };
5100
- const binds = computed(() => {
5101
- let d = __props.shape?.startsWith?.("path:") ? __props.shape?.slice?.(5) : paths[__props.shape];
5102
- let result = {
5103
- fill: __props.color,
5104
- "fill-opacity": __props.alpha,
5105
- stroke: __props.stroke,
5106
- "stroke-width": __props.linewidth,
5107
- "stroke-opacity": __props.alpha,
5108
- "stroke-dasharray": parseLineType(__props.linetype)
5109
- };
5110
- if (d != null) {
5111
- let transform = `translate(${__props.x + __props.translateX},${__props.y + __props.translateY}) scale(${__props.size}) rotate(${__props.angle})`;
5112
- Object.assign(result, { d, transform });
5113
- } else {
5114
- let transform = __props.translateX || __props.translateY ? `translate(${__props.translateX}, ${__props.translateY})` : null;
5115
- Object.assign(result, { cx: __props.x, cy: __props.y, r: __props.size / 2, transform });
5116
- }
5117
- return result;
5118
- });
5119
- function parseLineType(linetype) {
5120
- if (linetype == null) return null;
5121
- if (Array.isArray(linetype)) return linetype.join(" ");
5122
- if (linetype === "solid") return null;
5123
- if (linetype === "dashed") return "4 4";
5124
- if (linetype === "dotted") return "1 3";
5125
- if (linetype === "dotdash") return "1 3 4 3";
5126
- if (linetype === "longdash") return "8 4";
5127
- if (linetype === "twodash") return "2 2 6 2";
5128
- if (linetype.includes(" ")) return linetype;
5129
- return linetype.split("").map((v) => +("0x" + v)).join(" ");
5130
- }
5131
- return (_ctx, _cache) => {
5132
- return binds.value.d ? (openBlock(), createElementBlock("path", normalizeProps(mergeProps({ key: 0 }, binds.value)), null, 16)) : (openBlock(), createElementBlock("circle", normalizeProps(mergeProps({ key: 1 }, binds.value)), null, 16));
5133
- };
5134
- }
5135
- };
5136
5666
  const _sfc_main$A = {
5137
5667
  __name: "CoreSvgPoint",
5138
5668
  props: {
@@ -5142,8 +5672,9 @@ const _sfc_main$A = {
5142
5672
  coord2pos: Function,
5143
5673
  layout: Object
5144
5674
  },
5145
- emits: ["click", "contextmenu", "pointerover", "pointerout", "pointerenter", "pointerleave", "pointermove", "pointerdown", "pointerup", "wheel"],
5675
+ emits: ["click", "contextmenu", "singleclick", "pointerover", "pointerout", "pointerenter", "pointerleave", "pointermove", "pointerdown", "pointerup", "wheel"],
5146
5676
  setup(__props, { emit: __emit }) {
5677
+ let events = ["click", "contextmenu", "singleclick", "pointerover", "pointerout", "pointerenter", "pointerleave", "pointermove", "pointerdown", "pointerup", "wheel"];
5147
5678
  const emit = __emit;
5148
5679
  const binds = computed(() => {
5149
5680
  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;
@@ -5164,7 +5695,7 @@ const _sfc_main$A = {
5164
5695
  }) => {
5165
5696
  const { h: cx, v: cy } = __props.coord2pos({ x: x2, y: y2 });
5166
5697
  if (cx < xlim_min || cx > xlim_max || cy < ylim_min || cy > ylim_max) return null;
5167
- let result = {
5698
+ let vbind = {
5168
5699
  x: cx,
5169
5700
  y: cy,
5170
5701
  shape,
@@ -5176,27 +5707,20 @@ const _sfc_main$A = {
5176
5707
  alpha,
5177
5708
  angle,
5178
5709
  translateX,
5179
- translateY,
5180
- onClick: (e) => emit("click", e, $raw),
5181
- onContextmenu: (e) => emit("contextmenu", e, $raw),
5182
- onPointerover: (e) => emit("pointerover", e, $raw),
5183
- onPointerout: (e) => emit("pointerout", e, $raw),
5184
- onPointerenter: (e) => emit("pointerenter", e, $raw),
5185
- onPointerleave: (e) => emit("pointerleave", e, $raw),
5186
- onPointerdown: (e) => emit("pointerdown", e, $raw),
5187
- onPointerup: (e) => emit("pointerup", e, $raw),
5188
- onPointermove: (e) => emit("pointermove", e, $raw),
5189
- onWheel: (e) => emit("wheel", e, $raw)
5710
+ translateY
5190
5711
  };
5191
- return result;
5712
+ let von = Object.fromEntries(
5713
+ events.map((evt) => [evt, (e) => emit(evt, Object.assign(e, { _vhandled: true }), $raw)])
5714
+ );
5715
+ return [vbind, von];
5192
5716
  }).filter((x2) => x2 != null));
5193
5717
  });
5194
5718
  return (_ctx, _cache) => {
5195
5719
  return openBlock(), createElementBlock("g", null, [
5196
5720
  (openBlock(true), createElementBlock(Fragment, null, renderList(binds.value, (group) => {
5197
5721
  return openBlock(), createElementBlock("g", null, [
5198
- (openBlock(true), createElementBlock(Fragment, null, renderList(group, (item) => {
5199
- return openBlock(), createBlock(_sfc_main$B, mergeProps({ ref_for: true }, item), null, 16);
5722
+ (openBlock(true), createElementBlock(Fragment, null, renderList(group, ([vbind, von]) => {
5723
+ return openBlock(), createBlock(_sfc_main$G, mergeProps({ ref_for: true }, vbind, toHandlers(von)), null, 16);
5200
5724
  }), 256))
5201
5725
  ]);
5202
5726
  }), 256))
@@ -5220,11 +5744,11 @@ const _sfc_main$z = {
5220
5744
  const binds = computed(() => {
5221
5745
  return {
5222
5746
  points: __props.points.map((p) => `${p.x},${p.y}`).join(" "),
5223
- fill: __props.fill,
5224
- "fill-opacity": __props.alpha,
5225
- stroke: __props.color,
5747
+ fill: __props.fill || null,
5748
+ "fill-opacity": __props.alpha == 1 ? null : __props.alpha,
5749
+ stroke: __props.color || null,
5226
5750
  "stroke-width": __props.linewidth,
5227
- "stroke-opacity": __props.alpha,
5751
+ "stroke-opacity": __props.alpha == 1 ? null : __props.alpha,
5228
5752
  "stroke-dasharray": parseLineType(__props.linetype),
5229
5753
  transform: __props.translateX || __props.translateY ? `translate(${__props.translateX}, ${__props.translateY})` : null
5230
5754
  };
@@ -5255,8 +5779,9 @@ const _sfc_main$y = {
5255
5779
  coord2pos: Function,
5256
5780
  layout: Object
5257
5781
  },
5258
- emits: ["click", "contextmenu", "pointerover", "pointerout", "pointerenter", "pointerleave", "pointermove", "pointerdown", "pointerup", "wheel"],
5782
+ emits: ["click", "contextmenu", "singleclick", "pointerover", "pointerout", "pointerenter", "pointerleave", "pointermove", "pointerdown", "pointerup", "wheel"],
5259
5783
  setup(__props, { emit: __emit }) {
5784
+ let events = ["click", "contextmenu", "singleclick", "pointerover", "pointerout", "pointerenter", "pointerleave", "pointermove", "pointerdown", "pointerup", "wheel"];
5260
5785
  const emit = __emit;
5261
5786
  const binds = computed(() => {
5262
5787
  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;
@@ -5273,7 +5798,7 @@ const _sfc_main$y = {
5273
5798
  }) => {
5274
5799
  points = points.map((p) => (({ h: x2, v: y2 }) => ({ x: x2, y: y2 }))(__props.coord2pos(p)));
5275
5800
  if (points.every((p) => p.x < xlim_min) || points.every((p) => p.x > xlim_max) || points.every((p) => p.y < ylim_min) || points.every((p) => p.y > ylim_max)) return null;
5276
- let result = {
5801
+ let vbind = {
5277
5802
  points,
5278
5803
  fill,
5279
5804
  color,
@@ -5281,27 +5806,20 @@ const _sfc_main$y = {
5281
5806
  linetype,
5282
5807
  alpha,
5283
5808
  translateX,
5284
- translateY,
5285
- onClick: (e) => emit("click", e, $raw),
5286
- onContextmenu: (e) => emit("contextmenu", e, $raw),
5287
- onPointerover: (e) => emit("pointerover", e, $raw),
5288
- onPointerout: (e) => emit("pointerout", e, $raw),
5289
- onPointerenter: (e) => emit("pointerenter", e, $raw),
5290
- onPointerleave: (e) => emit("pointerleave", e, $raw),
5291
- onPointerdown: (e) => emit("pointerdown", e, $raw),
5292
- onPointerup: (e) => emit("pointerup", e, $raw),
5293
- onPointermove: (e) => emit("pointermove", e, $raw),
5294
- onWheel: (e) => emit("wheel", e, $raw)
5809
+ translateY
5295
5810
  };
5296
- return result;
5811
+ let von = Object.fromEntries(
5812
+ events.map((evt) => [evt, (e) => emit(evt, Object.assign(e, { _vhandled: true }), $raw)])
5813
+ );
5814
+ return [vbind, von];
5297
5815
  }).filter((x2) => x2 != null));
5298
5816
  });
5299
5817
  return (_ctx, _cache) => {
5300
5818
  return openBlock(), createElementBlock("g", null, [
5301
5819
  (openBlock(true), createElementBlock(Fragment, null, renderList(binds.value, (group) => {
5302
5820
  return openBlock(), createElementBlock("g", null, [
5303
- (openBlock(true), createElementBlock(Fragment, null, renderList(group, (item) => {
5304
- return openBlock(), createBlock(_sfc_main$z, mergeProps({ ref_for: true }, item), null, 16);
5821
+ (openBlock(true), createElementBlock(Fragment, null, renderList(group, ([vbind, von]) => {
5822
+ return openBlock(), createBlock(_sfc_main$z, mergeProps({ ref_for: true }, vbind, toHandlers(von)), null, 16);
5305
5823
  }), 256))
5306
5824
  ]);
5307
5825
  }), 256))
@@ -5310,54 +5828,6 @@ const _sfc_main$y = {
5310
5828
  }
5311
5829
  };
5312
5830
  const _sfc_main$x = {
5313
- __name: "CoreTile",
5314
- props: {
5315
- x: { type: Number, default: 0 },
5316
- y: { type: Number, default: 0 },
5317
- width: { type: Number, default: 0 },
5318
- height: { type: Number, default: 0 },
5319
- fill: String,
5320
- color: String,
5321
- linewidth: Number,
5322
- linetype: String,
5323
- alpha: { type: Number, default: 1 },
5324
- translateX: { type: Number, default: 0 },
5325
- translateY: { type: Number, default: 0 }
5326
- },
5327
- setup(__props) {
5328
- const binds = computed(() => {
5329
- return {
5330
- x: __props.x - __props.width / 2,
5331
- y: __props.y - __props.height / 2,
5332
- width: __props.width,
5333
- height: __props.height,
5334
- fill: __props.fill,
5335
- "fill-opacity": __props.alpha,
5336
- stroke: __props.color,
5337
- "stroke-width": __props.linewidth,
5338
- "stroke-opacity": __props.alpha,
5339
- "stroke-dasharray": parseLineType(__props.linetype),
5340
- transform: __props.translateX || __props.translateY ? `translate(${__props.translateX}, ${__props.translateY})` : null
5341
- };
5342
- });
5343
- function parseLineType(linetype) {
5344
- if (linetype == null) return null;
5345
- if (Array.isArray(linetype)) return linetype.join(" ");
5346
- if (linetype === "solid") return null;
5347
- if (linetype === "dashed") return "4 4";
5348
- if (linetype === "dotted") return "1 3";
5349
- if (linetype === "dotdash") return "1 3 4 3";
5350
- if (linetype === "longdash") return "8 4";
5351
- if (linetype === "twodash") return "2 2 6 2";
5352
- if (linetype.includes(" ")) return linetype;
5353
- return linetype.split("").map((v) => +("0x" + v)).join(" ");
5354
- }
5355
- return (_ctx, _cache) => {
5356
- return openBlock(), createElementBlock("rect", normalizeProps(guardReactiveProps(binds.value)), null, 16);
5357
- };
5358
- }
5359
- };
5360
- const _sfc_main$w = {
5361
5831
  __name: "CoreSvgRect",
5362
5832
  props: {
5363
5833
  extendX: { type: Number, default: 0 },
@@ -5366,8 +5836,9 @@ const _sfc_main$w = {
5366
5836
  coord2pos: Function,
5367
5837
  layout: Object
5368
5838
  },
5369
- emits: ["click", "contextmenu", "pointerover", "pointerout", "pointerenter", "pointerleave", "pointermove", "pointerdown", "pointerup", "wheel"],
5839
+ emits: ["click", "contextmenu", "singleclick", "pointerover", "pointerout", "pointerenter", "pointerleave", "pointermove", "pointerdown", "pointerup", "wheel"],
5370
5840
  setup(__props, { emit: __emit }) {
5841
+ let events = ["click", "contextmenu", "singleclick", "pointerover", "pointerout", "pointerenter", "pointerleave", "pointermove", "pointerdown", "pointerup", "wheel"];
5371
5842
  const emit = __emit;
5372
5843
  const binds = computed(() => {
5373
5844
  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;
@@ -5387,7 +5858,7 @@ const _sfc_main$w = {
5387
5858
  }) => {
5388
5859
  const { hmin: x1, hmax: x2, vmin: y1, vmax: y2 } = __props.coord2pos({ xmin, xmax, ymin, ymax });
5389
5860
  if (x1 < xlim_min && x2 < xlim_min || x1 > xlim_max && x2 > xlim_max || y1 < ylim_min && y2 < ylim_min || y1 > ylim_max && y2 > ylim_max) return null;
5390
- let result = {
5861
+ let vbind = {
5391
5862
  x: (x1 + x2) / 2,
5392
5863
  width: x2 - x1,
5393
5864
  y: (y1 + y2) / 2,
@@ -5398,27 +5869,20 @@ const _sfc_main$w = {
5398
5869
  linewidth,
5399
5870
  alpha,
5400
5871
  translateX,
5401
- translateY,
5402
- onClick: (e) => emit("click", e, $raw),
5403
- onContextmenu: (e) => emit("contextmenu", e, $raw),
5404
- onPointerover: (e) => emit("pointerover", e, $raw),
5405
- onPointerout: (e) => emit("pointerout", e, $raw),
5406
- onPointerenter: (e) => emit("pointerenter", e, $raw),
5407
- onPointerleave: (e) => emit("pointerleave", e, $raw),
5408
- onPointerdown: (e) => emit("pointerdown", e, $raw),
5409
- onPointerup: (e) => emit("pointerup", e, $raw),
5410
- onPointermove: (e) => emit("pointermove", e, $raw),
5411
- onWheel: (e) => emit("wheel", e, $raw)
5872
+ translateY
5412
5873
  };
5413
- return result;
5874
+ let von = Object.fromEntries(
5875
+ events.map((evt) => [evt, (e) => emit(evt, Object.assign(e, { _vhandled: true }), $raw)])
5876
+ );
5877
+ return [vbind, von];
5414
5878
  }).filter((x2) => x2 != null));
5415
5879
  });
5416
5880
  return (_ctx, _cache) => {
5417
5881
  return openBlock(), createElementBlock("g", null, [
5418
5882
  (openBlock(true), createElementBlock(Fragment, null, renderList(binds.value, (group) => {
5419
5883
  return openBlock(), createElementBlock("g", null, [
5420
- (openBlock(true), createElementBlock(Fragment, null, renderList(group, (item) => {
5421
- return openBlock(), createBlock(_sfc_main$x, mergeProps({ ref_for: true }, item), null, 16);
5884
+ (openBlock(true), createElementBlock(Fragment, null, renderList(group, ([vbind, von]) => {
5885
+ return openBlock(), createBlock(_sfc_main$H, mergeProps({ ref_for: true }, vbind, toHandlers(von)), null, 16);
5422
5886
  }), 256))
5423
5887
  ]);
5424
5888
  }), 256))
@@ -5426,7 +5890,7 @@ const _sfc_main$w = {
5426
5890
  };
5427
5891
  }
5428
5892
  };
5429
- const _sfc_main$v = {
5893
+ const _sfc_main$w = {
5430
5894
  __name: "CoreSvgText",
5431
5895
  props: {
5432
5896
  extendX: { type: Number, default: 0 },
@@ -5435,8 +5899,9 @@ const _sfc_main$v = {
5435
5899
  coord2pos: Function,
5436
5900
  layout: Object
5437
5901
  },
5438
- emits: ["click", "contextmenu", "pointerover", "pointerout", "pointerenter", "pointerleave", "pointermove", "pointerdown", "pointerup", "wheel"],
5902
+ emits: ["click", "contextmenu", "singleclick", "pointerover", "pointerout", "pointerenter", "pointerleave", "pointermove", "pointerdown", "pointerup", "wheel"],
5439
5903
  setup(__props, { emit: __emit }) {
5904
+ let events = ["click", "contextmenu", "singleclick", "pointerover", "pointerout", "pointerenter", "pointerleave", "pointermove", "pointerdown", "pointerup", "wheel"];
5440
5905
  const emit = __emit;
5441
5906
  const binds = computed(() => {
5442
5907
  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;
@@ -5444,7 +5909,7 @@ const _sfc_main$v = {
5444
5909
  x: x2,
5445
5910
  y: y2,
5446
5911
  size = 4,
5447
- label = "",
5912
+ label,
5448
5913
  title,
5449
5914
  color,
5450
5915
  stroke,
@@ -5461,6 +5926,7 @@ const _sfc_main$v = {
5461
5926
  "text-length": textLength,
5462
5927
  $raw
5463
5928
  }) => {
5929
+ if (label == null) return null;
5464
5930
  const { h: tx, v: ty } = __props.coord2pos({ x: x2, y: y2 });
5465
5931
  if (tx < xlim_min || tx > xlim_max || ty < ylim_min || ty > ylim_max) return null;
5466
5932
  if (typeof textLength == "object") {
@@ -5468,7 +5934,7 @@ const _sfc_main$v = {
5468
5934
  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 });
5469
5935
  textLength = Math.hypot(h1 - h2 || 0, v1 - v2 || 0);
5470
5936
  }
5471
- let result = {
5937
+ let vbind = {
5472
5938
  x: tx,
5473
5939
  y: ty,
5474
5940
  text: String(label),
@@ -5486,27 +5952,20 @@ const _sfc_main$v = {
5486
5952
  anchorY,
5487
5953
  dockX,
5488
5954
  dockY,
5489
- textLength,
5490
- onClick: (e) => emit("click", e, $raw),
5491
- onContextmenu: (e) => emit("contextmenu", e, $raw),
5492
- onPointerover: (e) => emit("pointerover", e, $raw),
5493
- onPointerout: (e) => emit("pointerout", e, $raw),
5494
- onPointerenter: (e) => emit("pointerenter", e, $raw),
5495
- onPointerleave: (e) => emit("pointerleave", e, $raw),
5496
- onPointerdown: (e) => emit("pointerdown", e, $raw),
5497
- onPointerup: (e) => emit("pointerup", e, $raw),
5498
- onPointermove: (e) => emit("pointermove", e, $raw),
5499
- onWheel: (e) => emit("wheel", e, $raw)
5955
+ textLength
5500
5956
  };
5501
- return result;
5502
- }).filter((x2) => x2?.text != null));
5957
+ let von = Object.fromEntries(
5958
+ events.map((evt) => [evt, (e) => emit(evt, Object.assign(e, { _vhandled: true }), $raw)])
5959
+ );
5960
+ return [vbind, von];
5961
+ }).filter((x2) => x2 != null));
5503
5962
  });
5504
5963
  return (_ctx, _cache) => {
5505
5964
  return openBlock(), createElementBlock("g", null, [
5506
5965
  (openBlock(true), createElementBlock(Fragment, null, renderList(binds.value, (group) => {
5507
5966
  return openBlock(), createElementBlock("g", null, [
5508
- (openBlock(true), createElementBlock(Fragment, null, renderList(group, (item) => {
5509
- return openBlock(), createBlock(_sfc_main$T, mergeProps({ ref_for: true }, item), null, 16);
5967
+ (openBlock(true), createElementBlock(Fragment, null, renderList(group, ([vbind, von]) => {
5968
+ return openBlock(), createBlock(_sfc_main$W, mergeProps({ ref_for: true }, vbind, toHandlers(von)), null, 16);
5510
5969
  }), 256))
5511
5970
  ]);
5512
5971
  }), 256))
@@ -5514,7 +5973,7 @@ const _sfc_main$v = {
5514
5973
  };
5515
5974
  }
5516
5975
  };
5517
- const _sfc_main$u = {
5976
+ const _sfc_main$v = {
5518
5977
  __name: "CoreSvgTextsegment",
5519
5978
  props: {
5520
5979
  extendX: { type: Number, default: 0 },
@@ -5523,8 +5982,9 @@ const _sfc_main$u = {
5523
5982
  coord2pos: Function,
5524
5983
  layout: Object
5525
5984
  },
5526
- emits: ["click", "contextmenu", "pointerover", "pointerout", "pointerenter", "pointerleave", "pointermove", "pointerdown", "pointerup", "wheel"],
5985
+ emits: ["click", "contextmenu", "singleclick", "pointerover", "pointerout", "pointerenter", "pointerleave", "pointermove", "pointerdown", "pointerup", "wheel"],
5527
5986
  setup(__props, { emit: __emit }) {
5987
+ let events = ["click", "contextmenu", "singleclick", "pointerover", "pointerout", "pointerenter", "pointerleave", "pointermove", "pointerdown", "pointerup", "wheel"];
5528
5988
  const emit = __emit;
5529
5989
  const binds = computed(() => {
5530
5990
  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;
@@ -5534,7 +5994,7 @@ const _sfc_main$u = {
5534
5994
  y: y2,
5535
5995
  yend,
5536
5996
  size = 4,
5537
- label = "",
5997
+ label,
5538
5998
  title,
5539
5999
  color,
5540
6000
  stroke,
@@ -5546,12 +6006,13 @@ const _sfc_main$u = {
5546
6006
  "text-length": textLength,
5547
6007
  $raw
5548
6008
  }) => {
6009
+ if (label == null) return null;
5549
6010
  const { h: x1, v: y1 } = __props.coord2pos({ x: x2, y: y2 });
5550
6011
  const { h: x22, v: y22 } = __props.coord2pos({ x: xend, y: yend });
5551
6012
  if (x1 < xlim_min && x22 < xlim_min || x1 > xlim_max && x22 > xlim_max || y1 < ylim_min && y22 < ylim_min || y1 > ylim_max && y22 > ylim_max) return null;
5552
6013
  let parts = splitLabel(String(label));
5553
6014
  let dx = (xend - x2) / (parts.length - 1 || 1), dy = (yend - y2) / (parts.length - 1 || 1);
5554
- let content = parts.map((v, i) => {
6015
+ let content = parts.map((label2, i) => {
5555
6016
  let $x = x2 + i * dx, $y = y2 + i * dy;
5556
6017
  const { h: tx, v: ty } = __props.coord2pos({ x: $x, y: $y });
5557
6018
  if (typeof textLength == "object") {
@@ -5559,21 +6020,17 @@ const _sfc_main$u = {
5559
6020
  let { h: h1, v: v1 } = __props.coord2pos({ x: $x + lx / 2, y: $y + ly / 2 }), { h: h2, v: v2 } = __props.coord2pos({ x: $x - lx / 2, y: $y - ly / 2 });
5560
6021
  textLength = Math.hypot(h1 - h2 || 0, v1 - v2 || 0);
5561
6022
  }
5562
- return {
5563
- bind: {
5564
- x: tx,
5565
- y: ty,
5566
- "text-anchor": "middle",
5567
- "alignment-baseline": "central",
5568
- textLength,
5569
- lengthAdjust: textLength ? "spacingAndGlyphs" : null
5570
- },
5571
- label: v
6023
+ let vbind2 = {
6024
+ x: tx,
6025
+ y: ty,
6026
+ "text-anchor": "middle",
6027
+ "alignment-baseline": "central",
6028
+ textLength,
6029
+ lengthAdjust: textLength ? "spacingAndGlyphs" : null
5572
6030
  };
6031
+ return [vbind2, label2];
5573
6032
  });
5574
- let result = {
5575
- content,
5576
- title: String(title ?? label),
6033
+ let vbind = {
5577
6034
  fill: color,
5578
6035
  "font-size": size * 4,
5579
6036
  stroke,
@@ -5581,19 +6038,12 @@ const _sfc_main$u = {
5581
6038
  "stroke-dasharray": linetype,
5582
6039
  "fill-opacity": alpha,
5583
6040
  "stroke-opacity": alpha,
5584
- transform: translateX || translateY ? `translate(${translateX}, ${translateY})` : null,
5585
- onClick: (e) => emit("click", e, $raw),
5586
- onContextmenu: (e) => emit("contextmenu", e, $raw),
5587
- onPointerover: (e) => emit("pointerover", e, $raw),
5588
- onPointerout: (e) => emit("pointerout", e, $raw),
5589
- onPointerenter: (e) => emit("pointerenter", e, $raw),
5590
- onPointerleave: (e) => emit("pointerleave", e, $raw),
5591
- onPointerdown: (e) => emit("pointerdown", e, $raw),
5592
- onPointerup: (e) => emit("pointerup", e, $raw),
5593
- onPointermove: (e) => emit("pointermove", e, $raw),
5594
- onWheel: (e) => emit("wheel", e, $raw)
6041
+ transform: translateX || translateY ? `translate(${translateX}, ${translateY})` : null
5595
6042
  };
5596
- return result;
6043
+ let von = Object.fromEntries(
6044
+ events.map((evt) => [evt, (e) => emit(evt, Object.assign(e, { _vhandled: true }), $raw)])
6045
+ );
6046
+ return [vbind, von, content, String(title ?? label)];
5597
6047
  }).filter((x2) => x2 != null));
5598
6048
  });
5599
6049
  function splitLabel(label) {
@@ -5614,15 +6064,16 @@ const _sfc_main$u = {
5614
6064
  return openBlock(), createElementBlock("g", null, [
5615
6065
  (openBlock(true), createElementBlock(Fragment, null, renderList(binds.value, (group) => {
5616
6066
  return openBlock(), createElementBlock("g", null, [
5617
- (openBlock(true), createElementBlock(Fragment, null, renderList(group, (item) => {
5618
- return openBlock(), createElementBlock("text", mergeProps({ ref_for: true }, { ...item, content: null, title: null }), [
5619
- createElementVNode("title", null, toDisplayString(item.title), 1),
5620
- (openBlock(true), createElementBlock(Fragment, null, renderList(item.content, (span) => {
6067
+ (openBlock(true), createElementBlock(Fragment, null, renderList(group, ([vbind, von, content, title]) => {
6068
+ return openBlock(), createElementBlock("text", mergeProps({ ref_for: true }, vbind, toHandlers(von, true)), [
6069
+ createElementVNode("title", null, toDisplayString(title), 1),
6070
+ _cache[0] || (_cache[0] = createTextVNode()),
6071
+ (openBlock(true), createElementBlock(Fragment, null, renderList(content, ([vbind2, label]) => {
5621
6072
  return openBlock(), createElementBlock(Fragment, null, [
5622
- span.label ? (openBlock(), createElementBlock("tspan", mergeProps({
6073
+ label ? (openBlock(), createElementBlock("tspan", mergeProps({
5623
6074
  key: 0,
5624
6075
  ref_for: true
5625
- }, span.bind), toDisplayString(span.label), 17)) : createCommentVNode("", true)
6076
+ }, vbind2), toDisplayString(label), 17)) : createCommentVNode("", true)
5626
6077
  ], 64);
5627
6078
  }), 256))
5628
6079
  ], 16);
@@ -5635,37 +6086,41 @@ const _sfc_main$u = {
5635
6086
  };
5636
6087
  const svg = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
5637
6088
  __proto__: null,
5638
- blank: _sfc_main$G,
5639
- curve: _sfc_main$E,
5640
- line: _sfc_main$C,
6089
+ blank: _sfc_main$I,
6090
+ boxplot: _sfc_main$E,
6091
+ curve: _sfc_main$C,
6092
+ line: _sfc_main$B,
5641
6093
  point: _sfc_main$A,
5642
6094
  polygon: _sfc_main$y,
5643
- rect: _sfc_main$w,
5644
- stick: _sfc_main$C,
5645
- text: _sfc_main$v,
5646
- textsegment: _sfc_main$u,
5647
- tile: _sfc_main$w
6095
+ rect: _sfc_main$x,
6096
+ stick: _sfc_main$B,
6097
+ text: _sfc_main$w,
6098
+ textsegment: _sfc_main$v,
6099
+ tile: _sfc_main$x
5648
6100
  }, Symbol.toStringTag, { value: "Module" }));
5649
- const _sfc_main$t = {
6101
+ const _sfc_main$u = {
5650
6102
  __name: "CoreLayer",
5651
6103
  props: {
5652
6104
  data: Object,
5653
6105
  geom: String,
5654
- render: { type: String, default: "auto" }
6106
+ render: String,
6107
+ defaultRender: { type: String, default: "auto" }
5655
6108
  },
5656
6109
  setup(__props, { expose: __expose }) {
5657
6110
  const geoms = { svg, canvas };
5658
6111
  const rend = computed(() => {
5659
- if (__props.render == "auto") {
6112
+ let render = __props.render ?? __props.defaultRender;
6113
+ if (render == "auto") {
5660
6114
  let n_data = __props.data.map((d) => d.length).reduce((a, b) => a + b, 0);
5661
6115
  return n_data > 1e3 ? "canvas" : "svg";
5662
6116
  }
5663
- if (geoms[__props.render][__props.geom] != null) return __props.render;
6117
+ if (geoms[render][__props.geom] != null) return render;
5664
6118
  return "svg";
5665
6119
  });
5666
6120
  const layer = useTemplateRef("layer");
5667
- const style = computed(() => rend.value == "canvas" ? "pointer-events:none;" : "");
6121
+ const style = computed(() => rend.value == "canvas" ? "pointer-events: none;" : "");
5668
6122
  __expose({
6123
+ render: rend,
5669
6124
  dispatchEvent: (e) => layer.value?.dispatchEvent?.(e)
5670
6125
  });
5671
6126
  return (_ctx, _cache) => {
@@ -5683,7 +6138,7 @@ const _hoisted_1$4 = {
5683
6138
  class: "vvplot-interactive"
5684
6139
  };
5685
6140
  const _hoisted_2$3 = ["onPointerdown"];
5686
- const _sfc_main$s = {
6141
+ const _sfc_main$t = {
5687
6142
  __name: "CoreSelection",
5688
6143
  props: /* @__PURE__ */ mergeModels({
5689
6144
  coord2pos: Function,
@@ -5729,9 +6184,9 @@ const _sfc_main$s = {
5729
6184
  y: vmin,
5730
6185
  width,
5731
6186
  height,
5732
- fill: __props.theme?.background ?? "#00000020",
6187
+ fill: __props.theme?.background ?? "transparent",
5733
6188
  "fill-opacity": __props.theme?.opacity,
5734
- stroke: __props.theme?.line_color ?? "transparent",
6189
+ stroke: __props.theme?.line_color ?? "none",
5735
6190
  "stroke-width": __props.theme?.line_width,
5736
6191
  "stroke-opacity": __props.theme?.opacity,
5737
6192
  style: config.move ? "cursor:move;" : "pointer-events:none;"
@@ -5854,7 +6309,7 @@ const _sfc_main$s = {
5854
6309
  const _hoisted_1$3 = ["height", "width"];
5855
6310
  const _hoisted_2$2 = ["y1", "y2"];
5856
6311
  const _hoisted_3$2 = ["y"];
5857
- const _sfc_main$r = {
6312
+ const _sfc_main$s = {
5858
6313
  __name: "CoreGuideGradientbar",
5859
6314
  props: {
5860
6315
  scales: Array,
@@ -5894,7 +6349,7 @@ const _sfc_main$r = {
5894
6349
  ref: "svg"
5895
6350
  }, [
5896
6351
  (openBlock(true), createElementBlock(Fragment, null, renderList(gradient_values.value, (v, i) => {
5897
- return openBlock(), createBlock(_sfc_main$x, mergeProps({
6352
+ return openBlock(), createBlock(_sfc_main$H, mergeProps({
5898
6353
  width: 10,
5899
6354
  height: 3.1,
5900
6355
  x: 10,
@@ -5902,6 +6357,7 @@ const _sfc_main$r = {
5902
6357
  alpha: __props.appearance.alpha
5903
6358
  }, { ref_for: true }, v), null, 16, ["y", "alpha"]);
5904
6359
  }), 256)),
6360
+ _cache[1] || (_cache[1] = createTextVNode()),
5905
6361
  (openBlock(true), createElementBlock(Fragment, null, renderList(guide_breaks.value, (v, i) => {
5906
6362
  return openBlock(), createElementBlock("g", null, [
5907
6363
  createElementVNode("line", {
@@ -5911,6 +6367,7 @@ const _sfc_main$r = {
5911
6367
  y2: 10 + (1 - v.position) * 90,
5912
6368
  stroke: "black"
5913
6369
  }, null, 8, _hoisted_2$2),
6370
+ _cache[0] || (_cache[0] = createTextVNode()),
5914
6371
  createElementVNode("text", {
5915
6372
  x: "20",
5916
6373
  y: 10 + (1 - v.position) * 90,
@@ -5924,12 +6381,12 @@ const _sfc_main$r = {
5924
6381
  };
5925
6382
  const element = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
5926
6383
  __proto__: null,
5927
- curve: _sfc_main$F,
5928
- line: _sfc_main$D,
5929
- point: _sfc_main$B,
6384
+ curve: _sfc_main$D,
6385
+ line: _sfc_main$F,
6386
+ point: _sfc_main$G,
5930
6387
  polygon: _sfc_main$z,
5931
- text: _sfc_main$T,
5932
- tile: _sfc_main$x
6388
+ text: _sfc_main$W,
6389
+ tile: _sfc_main$H
5933
6390
  }, Symbol.toStringTag, { value: "Module" }));
5934
6391
  const _hoisted_1$2 = ["height", "width"];
5935
6392
  const _hoisted_2$1 = ["transform"];
@@ -5939,7 +6396,7 @@ const _hoisted_4$1 = {
5939
6396
  y: "10",
5940
6397
  "alignment-baseline": "central"
5941
6398
  };
5942
- const _sfc_main$q = {
6399
+ const _sfc_main$r = {
5943
6400
  __name: "CoreGuideLegendkey",
5944
6401
  props: {
5945
6402
  scales: Array,
@@ -5993,6 +6450,7 @@ const _sfc_main$q = {
5993
6450
  return openBlock(), createBlock(resolveDynamicComponent(element[geom]), mergeProps({ ref_for: true }, { ...bind, ...v.bind }), null, 16);
5994
6451
  }), 256))
5995
6452
  ]),
6453
+ _cache[0] || (_cache[0] = createTextVNode()),
5996
6454
  createElementVNode("text", _hoisted_4$1, toDisplayString(v.label), 1)
5997
6455
  ], 8, _hoisted_2$1);
5998
6456
  }), 256))
@@ -6000,7 +6458,7 @@ const _sfc_main$q = {
6000
6458
  };
6001
6459
  }
6002
6460
  };
6003
- const _sfc_main$p = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
6461
+ const _sfc_main$q = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
6004
6462
  __name: "CoreGuide",
6005
6463
  props: {
6006
6464
  scales: Array,
@@ -6008,8 +6466,8 @@ const _sfc_main$p = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
6008
6466
  },
6009
6467
  setup(__props) {
6010
6468
  const guide = {
6011
- legendkey: _sfc_main$q,
6012
- gradientbar: _sfc_main$r
6469
+ legendkey: _sfc_main$r,
6470
+ gradientbar: _sfc_main$s
6013
6471
  };
6014
6472
  const title = computed(() => {
6015
6473
  return __props.scales.map(([s]) => s.title).find((v) => v != null);
@@ -6031,28 +6489,29 @@ const _sfc_main$p = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
6031
6489
  let result = { scales: __props.scales.map(([s]) => s) };
6032
6490
  if (__props.type == "legendkey") {
6033
6491
  result.appearances = {
6034
- text: obj_merge(__props.scales.flatMap(([s, a]) => [a.text])),
6035
- line: obj_merge(__props.scales.flatMap(([s, a]) => [a.line, a.linerange, a.curve])),
6036
- point: obj_merge(__props.scales.flatMap(([s, a]) => [a.point])),
6037
- tile: obj_merge(__props.scales.flatMap(([s, a]) => [a.rect, a.tile, a.polygon]))
6492
+ text: obj_merge(...__props.scales.flatMap(([s, a]) => [a.text])),
6493
+ line: obj_merge(...__props.scales.flatMap(([s, a]) => [a.line, a.linerange, a.curve])),
6494
+ point: obj_merge(...__props.scales.flatMap(([s, a]) => [a.point])),
6495
+ tile: obj_merge(...__props.scales.flatMap(([s, a]) => [a.rect, a.tile, a.polygon]))
6038
6496
  };
6039
6497
  } else if (__props.type == "gradientbar") {
6040
6498
  let max = __props.scales.map(([s]) => s.limits?.max).filter((v) => v != null).reduce((a, b) => Math.min(a, b), Infinity);
6041
6499
  let min = __props.scales.map(([s]) => s.limits?.min).filter((v) => v != null).reduce((a, b) => Math.max(a, b), -Infinity);
6042
6500
  result.limits = { min, max };
6043
- result.appearance = obj_merge(__props.scales.flatMap(([s, a]) => Object.values(a)));
6501
+ result.appearance = obj_merge(...__props.scales.flatMap(([s, a]) => Object.values(a)));
6044
6502
  }
6045
6503
  return result;
6046
6504
  });
6047
6505
  return (_ctx, _cache) => {
6048
6506
  return openBlock(), createElementBlock(Fragment, null, [
6049
6507
  createElementVNode("span", null, toDisplayString(title.value), 1),
6508
+ _cache[0] || (_cache[0] = createTextVNode()),
6050
6509
  (openBlock(), createBlock(resolveDynamicComponent(guide[__props.type]), mergeProps(binds.value, { breaks: breaks.value }), null, 16, ["breaks"]))
6051
6510
  ], 64);
6052
6511
  };
6053
6512
  }
6054
6513
  });
6055
- const _sfc_main$o = {
6514
+ const _sfc_main$p = {
6056
6515
  __name: "CoreLegend",
6057
6516
  props: {
6058
6517
  theme: { type: Object, default: () => ({}) },
@@ -6060,7 +6519,10 @@ const _sfc_main$o = {
6060
6519
  },
6061
6520
  setup(__props) {
6062
6521
  const guides = computed(() => {
6063
- let scale_fns = Array.from(__props.scales.keys());
6522
+ let guide_scales = new Map(
6523
+ Array.from(__props.scales).filter(([fn]) => fn.legend !== false)
6524
+ );
6525
+ let scale_fns = Array.from(guide_scales.keys());
6064
6526
  let keys = scale_fns.map((s) => s.key);
6065
6527
  let j = 1;
6066
6528
  for (let i in keys) {
@@ -6069,7 +6531,7 @@ const _sfc_main$o = {
6069
6531
  }
6070
6532
  let types = scale_fns.map((s) => getGuideType(s));
6071
6533
  let groups = interaction(keys, types);
6072
- return Map.groupBy(__props.scales, (s, i) => groups.categories[groups[i]]);
6534
+ return Map.groupBy(guide_scales, (s, i) => groups.categories[groups[i]]);
6073
6535
  });
6074
6536
  function getGuideType(scale) {
6075
6537
  if (scale == null) return null;
@@ -6085,7 +6547,7 @@ const _sfc_main$o = {
6085
6547
  style: normalizeStyle({ gap: __props.theme.spacing + "px" })
6086
6548
  }, [
6087
6549
  (openBlock(true), createElementBlock(Fragment, null, renderList(guides.value, ([[key, type], scales]) => {
6088
- return openBlock(), createBlock(_sfc_main$p, {
6550
+ return openBlock(), createBlock(_sfc_main$q, {
6089
6551
  key,
6090
6552
  type,
6091
6553
  scales
@@ -6103,12 +6565,11 @@ const _hoisted_5 = ["transform", "clip-path"];
6103
6565
  const _hoisted_6 = ["transform"];
6104
6566
  const _hoisted_7 = ["clip-path"];
6105
6567
  const _hoisted_8 = { key: 1 };
6106
- const _sfc_main$n = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
6568
+ const _sfc_main$o = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
6107
6569
  __name: "CorePlot",
6108
6570
  props: /* @__PURE__ */ mergeModels({
6109
6571
  schema: Object,
6110
6572
  layers: Array,
6111
- range: Object,
6112
6573
  minRange: Object,
6113
6574
  expandAdd: Object,
6114
6575
  flip: Boolean,
@@ -6120,6 +6581,7 @@ const _sfc_main$n = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
6120
6581
  scales: Object,
6121
6582
  axes: { type: Array, default: () => [] },
6122
6583
  theme: Object,
6584
+ render: String,
6123
6585
  clip: Boolean,
6124
6586
  action: { type: Array, default: () => [] },
6125
6587
  selections: { type: Array, default: () => [] },
@@ -6163,24 +6625,26 @@ const _sfc_main$n = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
6163
6625
  selectionPreview.value = modelValue;
6164
6626
  selectionPreviewTheme.value = theme;
6165
6627
  }
6628
+ const _selectionPreviewTheme = computed(() => Object.assign({}, __props.theme?.selection, selectionPreviewTheme.value));
6166
6629
  function onselectend() {
6167
6630
  selectionPreview.value = {};
6168
6631
  }
6169
6632
  const transition = useModel(__props, "transition");
6170
6633
  const svgRef = useTemplateRef("svg");
6171
6634
  const layers = useTemplateRef("layers");
6172
- const { width, height } = useElementSize(svgRef);
6635
+ const width = ref(0), height = ref(0);
6636
+ useResizeObserver(svgRef, (entries) => {
6637
+ let { width: w, height: h } = entries[0].contentRect;
6638
+ width.value = w;
6639
+ height.value = h;
6640
+ });
6173
6641
  const gplot = computed(() => new GPlot(__props.schema, props.layers));
6174
6642
  const vplot = computed(() => {
6175
- return gplot.value.useScales(__props.scales, __props.levels).useCoordLevels(__props.coordLevels).render(
6176
- range,
6177
- __props.expandAdd,
6178
- props.minRange
6179
- );
6643
+ return gplot.value.useScales(__props.scales, __props.levels).useCoordLevels(__props.coordLevels).render(range, __props.expandAdd, props.minRange);
6180
6644
  });
6181
6645
  const panel = reactiveComputed(() => {
6182
- let padding = Object.fromEntries(["left", "right", "top", "bottom"].map((p) => [p, __props.paddings[p] ? __props.theme.plot.padding[p] || 0 : 0]));
6183
- let l = __props.theme.plot.margin.left + padding.left, r = __props.theme.plot.margin.right + padding.right, t = __props.theme.plot.margin.top + padding.top, b = __props.theme.plot.margin.bottom + padding.bottom;
6646
+ let padding = Object.fromEntries(["left", "right", "top", "bottom"].map((p) => [p, __props.paddings[p] && __props.theme.plot.padding[p] || 0]));
6647
+ let l = +__props.theme.plot.margin.left + padding.left, r = +__props.theme.plot.margin.right + padding.right, t = +__props.theme.plot.margin.top + padding.top, b = +__props.theme.plot.margin.bottom + padding.bottom;
6184
6648
  if (t + b > height.value) {
6185
6649
  t = height.value * (t / (t + b));
6186
6650
  b = height.value - t;
@@ -6367,10 +6831,10 @@ const _sfc_main$n = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
6367
6831
  }
6368
6832
  function getPadding({ min: $min, max: $max } = {}, { min: mmin = 0, max: mmax = 0 } = {}) {
6369
6833
  let $interval = $max - $min;
6370
- let min = +$min - mmin * $interval, max = +$max + mmax * $interval, interval2 = max - min;
6834
+ let min = +$min - mmin * $interval, max = +$max + mmax * $interval, interval = max - min;
6371
6835
  return {
6372
- min: interval2 == 0 ? 0 : ($min - min) / interval2,
6373
- max: interval2 == 0 ? 0 : (max - $max) / interval2
6836
+ min: interval == 0 ? 0 : ($min - min) / interval,
6837
+ max: interval == 0 ? 0 : (max - $max) / interval
6374
6838
  };
6375
6839
  }
6376
6840
  function getCoord(event) {
@@ -6383,10 +6847,34 @@ const _sfc_main$n = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
6383
6847
  let rect = svgRef.value.getBoundingClientRect();
6384
6848
  return event.clientX > rect.left + panel.l && event.clientX < rect.right - panel.r && event.clientY > rect.top + panel.t && event.clientY < rect.bottom - panel.b;
6385
6849
  }
6850
+ function dispatchPointerEvent(e) {
6851
+ if (!layers.value || e._vhandled || !isInPlot(e)) return e;
6852
+ let canvasLayers = Array.from(layers.value).filter((l) => l.render == "canvas");
6853
+ if (!canvasLayers.length) return e;
6854
+ let options = {};
6855
+ for (let key in e) options[key] = e[key];
6856
+ options.bubbles = false;
6857
+ let event = new PointerEvent(e.type, options);
6858
+ for (let key of Object.keys(e)) {
6859
+ let prop = Object.getOwnPropertyDescriptor(event, key);
6860
+ if (prop && !prop.writable && !prop.set) continue;
6861
+ event[key] = e[key];
6862
+ }
6863
+ for (let i = layers.value.length - 1; i >= 0; i--)
6864
+ if (layers.value[i].dispatchEvent(event) === false) e.preventDefault();
6865
+ for (let key of Object.keys(event)) {
6866
+ let prop = Object.getOwnPropertyDescriptor(event, key);
6867
+ if (prop && !prop.writable && !prop.set) continue;
6868
+ e[key] = event[key];
6869
+ }
6870
+ return event._vhandled ? event : e;
6871
+ }
6386
6872
  let moveTimer, movementX = 0, movementY = 0;
6387
6873
  function svgPointerdown(e) {
6388
- let coord = getCoord(e);
6389
- emit("pointerdown", e, coord);
6874
+ let evt = dispatchPointerEvent(e), coord = getCoord(e);
6875
+ emit("pointerdown", evt, coord);
6876
+ if (evt.defaultPrevented) e.preventDefault();
6877
+ if (props.clip && !isInPlot(e)) return;
6390
6878
  let svg2 = e.currentTarget;
6391
6879
  let pointerMoved = false;
6392
6880
  function detectMove(ev) {
@@ -6399,16 +6887,10 @@ const _sfc_main$n = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
6399
6887
  e.target.addEventListener("pointerup", function(ev) {
6400
6888
  e.target.removeEventListener("pointermove", detectMove);
6401
6889
  if (!pointerMoved) {
6402
- let coord2 = getCoord(ev);
6403
- emit("singleclick", new PointerEvent("singleclick", ev), coord2);
6404
- if (isInPlot(e) && layers.value) {
6405
- if (ev.button == 0) {
6406
- layers.value.forEach((layer) => layer.dispatchEvent(new PointerEvent("click", ev)));
6407
- }
6408
- }
6890
+ let event = new PointerEvent("singleclick", ev);
6891
+ ev.target.dispatchEvent(event);
6409
6892
  }
6410
6893
  }, { once: true });
6411
- if (props.clip && !isInPlot(e)) return;
6412
6894
  let sel = props.selections.find((s) => ["buttons", "ctrlKey", "shiftKey", "altKey", "metaKey"].every((k) => s[k] == e[k]));
6413
6895
  if (sel) {
6414
6896
  let { x: x2 = false, y: y2 = false, "min-range-x": mrx = 0, "min-range-y": mry = 0 } = sel;
@@ -6416,8 +6898,8 @@ const _sfc_main$n = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
6416
6898
  svg2.style.userSelect = "none";
6417
6899
  let xboundary = (({ xmin: min, xmax: max }) => ({ min, max }))(sel), yboundary = (({ ymin: min, ymax: max }) => ({ min, max }))(sel);
6418
6900
  e.target.onpointermove = (ev) => {
6901
+ if (!x2 && !y2 || !pointerMoved) return;
6419
6902
  let coordMove = getCoord(ev);
6420
- if (!x2 && !y2) return;
6421
6903
  let res = {};
6422
6904
  if (x2) {
6423
6905
  let xstart = oob_squish_any(coord.x, xboundary), xend = oob_squish_any(oob_squish_any(coordMove.x, coordMove.x > xstart ? { min: plus(xstart, mrx) } : { max: plus(xstart, -mrx) }), xboundary);
@@ -6473,12 +6955,12 @@ const _sfc_main$n = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
6473
6955
  }
6474
6956
  }
6475
6957
  if (!pointerMoved && sel.dismissible !== false) {
6476
- if (ev.defaultPrevented || ev.handled) return;
6958
+ if (ev.defaultPrevented) return;
6477
6959
  let model = sel.modelValue;
6478
6960
  if (sel.dismissible !== true && ["xmin", "xmax", "ymin", "ymax"].every((k) => model?.[k] == null)) return;
6479
6961
  let res = {}, event = new PointerEvent("select", e);
6480
6962
  sel["onUpdate:modelValue"]?.(res);
6481
- if (!emitEvent(sel["onCancel"], dropNull(res), event)) {
6963
+ if (!emitEvent(sel["onDismiss"], dropNull(res), event)) {
6482
6964
  emit("select", dropNull(res), event);
6483
6965
  }
6484
6966
  }
@@ -6524,8 +7006,9 @@ const _sfc_main$n = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
6524
7006
  }
6525
7007
  let wheelDelta = 0, wheelTimer;
6526
7008
  function svgWheel(e) {
6527
- let coord = getCoord(e);
6528
- emit("wheel", e, coord);
7009
+ let evt = dispatchPointerEvent(e), coord = getCoord(e);
7010
+ emit("wheel", evt, coord);
7011
+ if (evt.defaultPrevented) e.preventDefault();
6529
7012
  if (props.clip && !isInPlot(e)) return;
6530
7013
  let act = props.action.find((a) => ["zoom", "nudge"].includes(a.action) && ["ctrlKey", "shiftKey", "altKey", "metaKey"].every((k) => a[k] == e[k]));
6531
7014
  if (!act || !act.x && !act.y) return;
@@ -6601,18 +7084,22 @@ const _sfc_main$n = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
6601
7084
  if (!dh && !dv && sh == 1 && sv == 1) transition.value = null;
6602
7085
  }, { deep: true });
6603
7086
  function applyTransform(act, event) {
6604
- if (!Object.keys(dropNull(rangePreview) ?? {}).length) return;
6605
- if (!emitEvent(act.emit, rangePreview, event)) {
6606
- emit(act.action, rangePreview, event);
7087
+ let coord = dropNull(rangePreview) ?? {};
7088
+ if (!Object.keys(coord).length) return;
7089
+ let e = new PointerEvent(event.type, event);
7090
+ if (!emitEvent(act.emit, coord, e)) {
7091
+ emit(act.action, coord, e);
6607
7092
  }
6608
- changerange(rangePreview);
7093
+ changerange(coord);
6609
7094
  let xmin, xmax, ymin, ymax;
6610
7095
  Object.assign(rangePreview, { xmin, xmax, ymin, ymax });
6611
7096
  }
6612
7097
  const svgVOn = {
6613
7098
  pointerdown: svgPointerdown,
6614
7099
  pointerup(e) {
6615
- emit("pointerup", e, getCoord(e));
7100
+ let evt = dispatchPointerEvent(e), coord = getCoord(e);
7101
+ emit("pointerup", evt, coord);
7102
+ if (evt.defaultPrevented) e.preventDefault();
6616
7103
  },
6617
7104
  pointerover(e) {
6618
7105
  emit("pointerover", e, getCoord(e));
@@ -6626,17 +7113,26 @@ const _sfc_main$n = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
6626
7113
  pointerleave(e) {
6627
7114
  emit("pointerleave", e, getCoord(e));
6628
7115
  },
6629
- dblclick(e) {
6630
- emit("dblclick", e, getCoord(e));
6631
- },
6632
7116
  click(e) {
6633
- emit("click", e, getCoord(e));
7117
+ emit("click", dispatchPointerEvent(e), getCoord(e));
6634
7118
  },
6635
7119
  contextmenu(e) {
6636
- emit("contextmenu", e, getCoord(e));
7120
+ let evt = dispatchPointerEvent(e), coord = getCoord(e);
7121
+ emit("contextmenu", evt, coord);
7122
+ if (evt.defaultPrevented) e.preventDefault();
7123
+ },
7124
+ singleclick(e) {
7125
+ emit("singleclick", dispatchPointerEvent(e), getCoord(e));
7126
+ },
7127
+ dblclick(e) {
7128
+ let evt = dispatchPointerEvent(e), coord = getCoord(e);
7129
+ emit("dblclick", evt, coord);
7130
+ if (evt.defaultPrevented) e.preventDefault();
6637
7131
  },
6638
7132
  pointermove(e) {
6639
- emit("pointermove", e, getCoord(e));
7133
+ let evt = dispatchPointerEvent(e), coord = getCoord(e);
7134
+ emit("pointermove", evt, coord);
7135
+ if (evt.defaultPrevented) e.preventDefault();
6640
7136
  },
6641
7137
  wheel: svgWheel
6642
7138
  };
@@ -6666,11 +7162,12 @@ const _sfc_main$n = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
6666
7162
  coord,
6667
7163
  breaks,
6668
7164
  labels,
7165
+ titles,
6669
7166
  minorBreaks,
6670
7167
  ...etc
6671
7168
  }) => ({
6672
7169
  coord,
6673
- axis: new GAxis(coordScales[coord], { breaks, labels, minorBreaks }),
7170
+ axis: new GAxis(coordScales[coord], { breaks, labels, titles, minorBreaks }),
6674
7171
  etc
6675
7172
  }));
6676
7173
  });
@@ -6745,6 +7242,7 @@ const _sfc_main$n = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
6745
7242
  }, null, 8, _hoisted_2)
6746
7243
  ], 8, _hoisted_1$1)
6747
7244
  ]),
7245
+ _cache[6] || (_cache[6] = createTextVNode()),
6748
7246
  __props.theme.plot.background ? (openBlock(), createElementBlock("rect", {
6749
7247
  key: 0,
6750
7248
  transform: `translate(${unref(panel).left}, ${unref(panel).top})`,
@@ -6752,17 +7250,20 @@ const _sfc_main$n = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
6752
7250
  height: unref(panel).height,
6753
7251
  fill: __props.theme.plot.background
6754
7252
  }, null, 8, _hoisted_3)) : createCommentVNode("", true),
7253
+ _cache[7] || (_cache[7] = createTextVNode()),
6755
7254
  createElementVNode("g", {
6756
- transform: `translate(${unref(panel).left}, ${unref(panel).top})`
7255
+ transform: `translate(${unref(panel).left}, ${unref(panel).top})`,
7256
+ style: { "pointer-events": "none" }
6757
7257
  }, [
6758
- __props.theme.grid.h ? (openBlock(), createBlock(_sfc_main$P, mergeProps({ key: 0 }, gridBreaks.value.h, {
7258
+ __props.theme.grid.h ? (openBlock(), createBlock(_sfc_main$S, mergeProps({ key: 0 }, gridBreaks.value.h, {
6759
7259
  layout: unref(innerRect),
6760
7260
  theme: __props.theme.grid.h,
6761
7261
  activeTransform: activeTransform.value,
6762
7262
  coord2pos,
6763
7263
  transition: transition.value
6764
7264
  }), null, 16, ["layout", "theme", "activeTransform", "transition"])) : createCommentVNode("", true),
6765
- __props.theme.grid.v ? (openBlock(), createBlock(_sfc_main$O, mergeProps({ key: 1 }, gridBreaks.value.v, {
7265
+ _cache[2] || (_cache[2] = createTextVNode()),
7266
+ __props.theme.grid.v ? (openBlock(), createBlock(_sfc_main$R, mergeProps({ key: 1 }, gridBreaks.value.v, {
6766
7267
  layout: unref(innerRect),
6767
7268
  theme: __props.theme.grid.v,
6768
7269
  activeTransform: activeTransform.value,
@@ -6770,6 +7271,7 @@ const _sfc_main$n = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
6770
7271
  transition: transition.value
6771
7272
  }), null, 16, ["layout", "theme", "activeTransform", "transition"])) : createCommentVNode("", true)
6772
7273
  ], 8, _hoisted_4),
7274
+ _cache[8] || (_cache[8] = createTextVNode()),
6773
7275
  createElementVNode("g", {
6774
7276
  transform: `translate(${unref(panel).left}, ${unref(panel).top})`,
6775
7277
  "clip-path": props.clip ? `url(#${unref(vid)}-plot-clip)` : null
@@ -6778,7 +7280,7 @@ const _sfc_main$n = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
6778
7280
  style: { transition: transition.value }
6779
7281
  }), [
6780
7282
  (openBlock(true), createElementBlock(Fragment, null, renderList(vplot.value.layers, (layer) => {
6781
- return openBlock(), createBlock(_sfc_main$t, mergeProps({
7283
+ return openBlock(), createBlock(_sfc_main$u, mergeProps({
6782
7284
  ref_for: true,
6783
7285
  ref_key: "layers",
6784
7286
  ref: layers,
@@ -6786,11 +7288,13 @@ const _sfc_main$n = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
6786
7288
  }, { ref_for: true }, layer.vBind, {
6787
7289
  layout: unref(innerRect),
6788
7290
  geom: layer.geom,
6789
- coord2pos
6790
- }), null, 16, ["data", "layout", "geom"]);
7291
+ coord2pos,
7292
+ "default-render": props.render
7293
+ }), null, 16, ["data", "layout", "geom", "default-render"]);
6791
7294
  }), 256)),
7295
+ _cache[3] || (_cache[3] = createTextVNode()),
6792
7296
  (openBlock(true), createElementBlock(Fragment, null, renderList(props.selections, (sel) => {
6793
- return openBlock(), createBlock(_sfc_main$s, mergeProps({
7297
+ return openBlock(), createBlock(_sfc_main$t, mergeProps({
6794
7298
  coord2pos,
6795
7299
  pos2coord,
6796
7300
  layout: unref(innerRect),
@@ -6798,31 +7302,34 @@ const _sfc_main$n = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
6798
7302
  onSelectend: onselectend
6799
7303
  }, { ref_for: true }, sel, { flip: __props.flip }), null, 16, ["layout", "flip"]);
6800
7304
  }), 256)),
6801
- createVNode(_sfc_main$s, {
7305
+ _cache[4] || (_cache[4] = createTextVNode()),
7306
+ createVNode(_sfc_main$t, {
6802
7307
  coord2pos,
6803
7308
  pos2coord,
6804
7309
  layout: unref(innerRect),
6805
7310
  modelValue: selectionPreview.value,
6806
- theme: selectionPreviewTheme.value,
7311
+ theme: _selectionPreviewTheme.value,
6807
7312
  flip: __props.flip
6808
7313
  }, null, 8, ["layout", "modelValue", "theme", "flip"])
6809
7314
  ], 16)
6810
7315
  ], 8, _hoisted_5),
7316
+ _cache[9] || (_cache[9] = createTextVNode()),
6811
7317
  createElementVNode("g", {
6812
7318
  transform: `translate(${unref(panel).left}, ${unref(panel).top})`
6813
7319
  }, [
6814
7320
  (openBlock(true), createElementBlock(Fragment, null, renderList(axes.value.filter((a) => typeof a.bind.position !== "number"), (axis) => {
6815
- return openBlock(), createBlock(_sfc_main$Q, mergeProps({ ref_for: true }, axis.bind, toHandlers(axis.on), {
7321
+ return openBlock(), createBlock(_sfc_main$T, mergeProps({ ref_for: true }, axis.bind, toHandlers(axis.on), {
6816
7322
  transition: transition.value,
6817
7323
  "onUpdate:transition": _cache[0] || (_cache[0] = ($event) => transition.value = $event),
6818
7324
  activeTransform: activeTransform.value
6819
7325
  }), null, 16, ["transition", "activeTransform"]);
6820
7326
  }), 256)),
7327
+ _cache[5] || (_cache[5] = createTextVNode()),
6821
7328
  createElementVNode("g", {
6822
7329
  "clip-path": props.clip ? `url(#${unref(vid)}-plot-clip)` : null
6823
7330
  }, [
6824
7331
  (openBlock(true), createElementBlock(Fragment, null, renderList(axes.value.filter((a) => typeof a.bind.position === "number"), (axis) => {
6825
- return openBlock(), createBlock(_sfc_main$Q, mergeProps({ ref_for: true }, axis.bind, toHandlers(axis.on), {
7332
+ return openBlock(), createBlock(_sfc_main$T, mergeProps({ ref_for: true }, axis.bind, toHandlers(axis.on), {
6826
7333
  transition: transition.value,
6827
7334
  "onUpdate:transition": _cache[1] || (_cache[1] = ($event) => transition.value = $event),
6828
7335
  activeTransform: activeTransform.value
@@ -6830,12 +7337,13 @@ const _sfc_main$n = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
6830
7337
  }), 256))
6831
7338
  ], 8, _hoisted_7)
6832
7339
  ], 8, _hoisted_6),
7340
+ _cache[10] || (_cache[10] = createTextVNode()),
6833
7341
  props.legendTeleport ? (openBlock(), createElementBlock("foreignObject", _hoisted_8, [
6834
7342
  (openBlock(), createBlock(Teleport, {
6835
7343
  defer: "",
6836
7344
  to: props.legendTeleport
6837
7345
  }, [
6838
- createVNode(_sfc_main$o, {
7346
+ createVNode(_sfc_main$p, {
6839
7347
  scales: vplot.value?.scales,
6840
7348
  theme: __props.theme.legend
6841
7349
  }, null, 8, ["scales", "theme"])
@@ -6845,24 +7353,31 @@ const _sfc_main$n = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
6845
7353
  };
6846
7354
  }
6847
7355
  });
6848
- const _sfc_main$m = {
7356
+ const _sfc_main$n = {
6849
7357
  $_type: "action",
6850
7358
  $_props: {}
6851
7359
  };
6852
- const _sfc_main$l = {
7360
+ const _sfc_main$m = {
6853
7361
  $_type: "layer"
6854
7362
  };
6855
- const _sfc_main$k = {
7363
+ const _sfc_main$l = {
6856
7364
  $_props: {
6857
7365
  geom: "tile",
6858
7366
  stat: "bar"
6859
7367
  },
6860
7368
  $_type: "layer"
6861
7369
  };
6862
- const _sfc_main$j = {
7370
+ const _sfc_main$k = {
6863
7371
  $_props: {
6864
7372
  geom: "blank",
6865
- stat: "blank"
7373
+ stat: "identity"
7374
+ },
7375
+ $_type: "layer"
7376
+ };
7377
+ const _sfc_main$j = {
7378
+ $_props: {
7379
+ geom: "boxplot",
7380
+ stat: "boxplot"
6866
7381
  },
6867
7382
  $_type: "layer"
6868
7383
  };
@@ -6969,9 +7484,10 @@ const _sfc_main$5 = {
6969
7484
  };
6970
7485
  const geom_components = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
6971
7486
  __proto__: null,
6972
- VVGeom: _sfc_main$l,
6973
- VVGeomBar: _sfc_main$k,
6974
- VVGeomBlank: _sfc_main$j,
7487
+ VVGeom: _sfc_main$m,
7488
+ VVGeomBar: _sfc_main$l,
7489
+ VVGeomBlank: _sfc_main$k,
7490
+ VVGeomBoxplot: _sfc_main$j,
6975
7491
  VVGeomCurve: _sfc_main$i,
6976
7492
  VVGeomDensity: _sfc_main$h,
6977
7493
  VVGeomHistogram: _sfc_main$g,
@@ -7026,6 +7542,7 @@ const _sfc_main$1 = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
7026
7542
  theme: [Object, Array],
7027
7543
  action: [Object, Array],
7028
7544
  reverse: Object,
7545
+ render: String,
7029
7546
  flip: Boolean,
7030
7547
  clip: { type: Boolean, default: true },
7031
7548
  resize: null,
@@ -7047,8 +7564,18 @@ const _sfc_main$1 = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
7047
7564
  const components = {
7048
7565
  ...geom_components,
7049
7566
  ...axis_components,
7050
- VVAction: _sfc_main$m,
7051
- VVSelection: _sfc_main$m
7567
+ VVAction: _sfc_main$n,
7568
+ VVSelection: _sfc_main$n
7569
+ };
7570
+ const opponents = {
7571
+ x: "y",
7572
+ y: "x",
7573
+ h: "v",
7574
+ v: "h",
7575
+ top: "bottom",
7576
+ bottom: "top",
7577
+ left: "right",
7578
+ right: "left"
7052
7579
  };
7053
7580
  function _isPropTruthy(v) {
7054
7581
  if (v == null) return v;
@@ -7236,11 +7763,6 @@ const _sfc_main$1 = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
7236
7763
  let max = primaryAxisConfig.max[ori] ?? __props.range?.[ori + "max"];
7237
7764
  result[ori + "min"] = isFinite(min) && !Number.isNaN(min) ? min : null;
7238
7765
  result[ori + "max"] = isFinite(max) && !Number.isNaN(max) ? max : null;
7239
- let level = coordLevels.value[ori];
7240
- if (level != null) {
7241
- result[ori + "min"] = (result[ori + "min"] ?? 0) - 0.5;
7242
- result[ori + "max"] = (result[ori + "max"] ?? level.length ?? Math.max(Object.values(level))) - 0.5;
7243
- }
7244
7766
  }
7245
7767
  return result;
7246
7768
  });
@@ -7291,7 +7813,7 @@ const _sfc_main$1 = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
7291
7813
  if (newRange?.ymax !== oldRange?.ymax)
7292
7814
  rangePreview.ymax = newRange.ymax;
7293
7815
  }, { immediate: true });
7294
- watch(() => range, (newRange, oldRange) => {
7816
+ watch(() => ({ ...range }), (newRange, oldRange) => {
7295
7817
  for (let key in rangeUpdate) {
7296
7818
  rangeUpdate[key]?.(newRange[key]);
7297
7819
  }
@@ -7326,14 +7848,13 @@ const _sfc_main$1 = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
7326
7848
  else if (typeof y2 == "number") y2 = { min: y2, max: y2 };
7327
7849
  return { x: x2, y: y2 };
7328
7850
  });
7329
- const reverse = computed(() => ({
7851
+ const reverse = reactiveComputed(() => ({
7330
7852
  x: _isPropTruthy(primaryAxisConfig.reverse.x) ?? __props.reverse?.x ?? false,
7331
7853
  y: _isPropTruthy(primaryAxisConfig.reverse.y) ?? __props.reverse?.y ?? false
7332
7854
  }));
7333
7855
  const buttonsMap = { left: 1, right: 2, middle: 4, X1: 8, X2: 16 };
7334
7856
  const axes = computed(() => {
7335
7857
  let ori = __props.flip ? { x: "v", y: "h" } : { x: "h", y: "v" };
7336
- let defaultPos = __props.flip ? { x: "left", y: "bottom" } : { x: "bottom", y: "left" };
7337
7858
  let allAxes = vaxis.value.map((c) => ({ ...c.type.$_props, ...c.props, $_children: c.children })).concat(__props.axes ?? []);
7338
7859
  if (allAxes.every((ax) => ax?.coord != "x")) allAxes.push({ coord: "x" });
7339
7860
  if (allAxes.every((ax) => ax?.coord != "y")) allAxes.push({ coord: "y" });
@@ -7343,6 +7864,7 @@ const _sfc_main$1 = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
7343
7864
  title,
7344
7865
  breaks,
7345
7866
  labels,
7867
+ titles,
7346
7868
  "minor-breaks": minorBreaks,
7347
7869
  "show-grid": showGrid,
7348
7870
  theme: $$theme = [],
@@ -7364,7 +7886,14 @@ const _sfc_main$1 = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
7364
7886
  ...etc
7365
7887
  }) => {
7366
7888
  let orientation = ori[coord];
7367
- position = position ?? defaultPos[coord];
7889
+ position = position ?? "start";
7890
+ if (position == "start") {
7891
+ position = { h: "bottom", v: "left" }[orientation];
7892
+ if (reverse[opponents[coord]]) position = opponents[position];
7893
+ } else if (position == "end") {
7894
+ position = { h: "top", v: "right" }[orientation];
7895
+ if (reverse[opponents[coord]]) position = opponents[position];
7896
+ }
7368
7897
  let action2 = Object.values($_children ?? {}).filter((s) => typeof s == "function").flatMap((s) => expandFragment(s())).map((c) => ({ ...c.type.$_props, ...c.props })).concat($$action ?? []).flatMap((props) => {
7369
7898
  let res = [];
7370
7899
  for (let a of ["move", "nudge", "zoom", "rescale"]) {
@@ -7393,6 +7922,7 @@ const _sfc_main$1 = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
7393
7922
  title,
7394
7923
  breaks,
7395
7924
  labels,
7925
+ titles,
7396
7926
  minorBreaks,
7397
7927
  showGrid: _isPropTruthy(showGrid) ?? position !== "none",
7398
7928
  extend: extend2 ?? primaryAxisConfig.extend[coord],
@@ -7474,13 +8004,13 @@ const _sfc_main$1 = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
7474
8004
  return {
7475
8005
  move: Boolean(_isPropTruthy(move)),
7476
8006
  dismissible: dismissible == void 0 ? void 0 : dismissible !== false,
7477
- resize: resize !== false,
8007
+ resize: Boolean(_isPropTruthy(resize)),
7478
8008
  x: xy || Boolean(_isPropTruthy(x2)),
7479
8009
  y: xy || Boolean(_isPropTruthy(y2)),
7480
- xmin,
7481
- xmax,
7482
- ymin,
7483
- ymax,
8010
+ xmin: xmin ?? actionBoundary?.x?.min,
8011
+ xmax: xmax ?? actionBoundary?.x?.max,
8012
+ ymin: ymin ?? actionBoundary?.y?.min,
8013
+ ymax: ymax ?? actionBoundary?.y?.max,
7484
8014
  ctrlKey: Boolean(_isPropTruthy(ctrl)),
7485
8015
  shiftKey: Boolean(_isPropTruthy(shift)),
7486
8016
  altKey: Boolean(_isPropTruthy(alt)),
@@ -7500,18 +8030,20 @@ const _sfc_main$1 = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
7500
8030
  const height = useModel(__props, "height");
7501
8031
  onMounted(() => {
7502
8032
  watch(width, (v) => {
7503
- wrapperRef.value.style.width = str_c(v, "px");
8033
+ wrapperRef.value.style.width = str_c(v, "px") ?? null;
7504
8034
  }, { immediate: true });
7505
8035
  watch(height, (v) => {
7506
- wrapperRef.value.style.height = str_c(v, "px");
8036
+ wrapperRef.value.style.height = str_c(v, "px") ?? null;
7507
8037
  }, { immediate: true });
7508
8038
  });
7509
- const { width: w, height: h } = useElementSize(plotRef);
7510
- watch([w, h], ([w2, h2], [ow, oh]) => {
7511
- if (wrapperRef.value.style.width) width.value = w2;
7512
- if (wrapperRef.value.style.height) height.value = h2;
7513
- if ((w2 > 0 || h2 > 0) && (ow > 0 || oh > 0))
7514
- emit("resize", { width: w2, height: h2 }, { width: ow, height: oh });
8039
+ let oldSize = { width: 0, height: 0 };
8040
+ useResizeObserver(plotRef, (e) => {
8041
+ let { width: w, height: h } = e[0].contentRect;
8042
+ if (wrapperRef.value.style.width) width.value = w;
8043
+ if (wrapperRef.value.style.height) height.value = h;
8044
+ if ((w > 0 || h > 0) && (oldSize.width > 0 || oldSize.height > 0))
8045
+ emit("resize", { width: w, height: h }, oldSize);
8046
+ oldSize = { width: w, height: h };
7515
8047
  });
7516
8048
  const panelStyle = computed(() => {
7517
8049
  return {
@@ -7534,6 +8066,9 @@ const _sfc_main$1 = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
7534
8066
  return style;
7535
8067
  });
7536
8068
  __expose({
8069
+ get svg() {
8070
+ return plotRef.value.svg;
8071
+ },
7537
8072
  serialize() {
7538
8073
  return serializeSVG(plotRef.value.svg);
7539
8074
  }
@@ -7544,7 +8079,7 @@ const _sfc_main$1 = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
7544
8079
  class: "vvplot",
7545
8080
  style: wrapperStyle.value
7546
8081
  }, vBind.value.wrapper), [
7547
- createVNode(_sfc_main$n, mergeProps({
8082
+ createVNode(_sfc_main$o, mergeProps({
7548
8083
  ref: "plot",
7549
8084
  paddings,
7550
8085
  schema: schema.value,
@@ -7552,7 +8087,7 @@ const _sfc_main$1 = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
7552
8087
  "min-range": minRange.value,
7553
8088
  "expand-add": expandAdd.value,
7554
8089
  "expand-mult": expandMult.value,
7555
- reverse: reverse.value,
8090
+ reverse: unref(reverse),
7556
8091
  flip: __props.flip,
7557
8092
  "coord-levels": coordLevels.value,
7558
8093
  levels: levels.value,
@@ -7563,15 +8098,17 @@ const _sfc_main$1 = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
7563
8098
  transition: transition.value,
7564
8099
  "onUpdate:transition": _cache[0] || (_cache[0] = ($event) => transition.value = $event)
7565
8100
  }, vBind.value.plot, {
7566
- selectionPreview: selectionPreview.value,
8101
+ "selection-preview": selectionPreview.value,
7567
8102
  "onUpdate:selectionPreview": _cache[1] || (_cache[1] = ($event) => selectionPreview.value = $event),
7568
- selectionPreviewTheme: selectionPreviewTheme.value,
8103
+ "selection-preview-theme": selectionPreviewTheme.value,
7569
8104
  "onUpdate:selectionPreviewTheme": _cache[2] || (_cache[2] = ($event) => selectionPreviewTheme.value = $event),
7570
8105
  action: action.value,
7571
8106
  clip: __props.clip,
8107
+ render: __props.render,
7572
8108
  legendTeleport: __props.legendTeleport,
7573
8109
  onSelect: _cache[3] || (_cache[3] = (d, e) => emit("select", d, e))
7574
- }), null, 16, ["paddings", "schema", "layers", "min-range", "expand-add", "expand-mult", "reverse", "flip", "coord-levels", "levels", "scales", "axes", "theme", "selections", "transition", "selectionPreview", "selectionPreviewTheme", "action", "clip", "legendTeleport"]),
8110
+ }), null, 16, ["paddings", "schema", "layers", "min-range", "expand-add", "expand-mult", "reverse", "flip", "coord-levels", "levels", "scales", "axes", "theme", "selections", "transition", "selection-preview", "selection-preview-theme", "action", "clip", "render", "legendTeleport"]),
8111
+ _cache[4] || (_cache[4] = createTextVNode()),
7575
8112
  createElementVNode("div", {
7576
8113
  class: "vvplot-panel-container",
7577
8114
  style: normalizeStyle(panelStyle.value)
@@ -7582,6 +8119,7 @@ const _sfc_main$1 = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
7582
8119
  }), 256))
7583
8120
  ])) : createCommentVNode("", true)
7584
8121
  ], 4),
8122
+ _cache[5] || (_cache[5] = createTextVNode()),
7585
8123
  (openBlock(true), createElementBlock(Fragment, null, renderList(vdom.value, (c) => {
7586
8124
  return openBlock(), createBlock(resolveDynamicComponent(c));
7587
8125
  }), 256))
@@ -7595,26 +8133,27 @@ const _sfc_main = {
7595
8133
  };
7596
8134
  export {
7597
8135
  _sfc_main$1 as _sfc_main,
7598
- _sfc_main$m as _sfc_main$1,
7599
- _sfc_main$h as _sfc_main$10,
7600
- _sfc_main$g as _sfc_main$11,
7601
- _sfc_main$f as _sfc_main$12,
7602
- _sfc_main$e as _sfc_main$13,
7603
- _sfc_main$d as _sfc_main$14,
7604
- _sfc_main$c as _sfc_main$15,
7605
- _sfc_main$b as _sfc_main$16,
7606
- _sfc_main$a as _sfc_main$17,
7607
- _sfc_main$9 as _sfc_main$18,
7608
- _sfc_main$8 as _sfc_main$19,
8136
+ _sfc_main$n as _sfc_main$1,
8137
+ _sfc_main$i as _sfc_main$10,
8138
+ _sfc_main$h as _sfc_main$11,
8139
+ _sfc_main$g as _sfc_main$12,
8140
+ _sfc_main$f as _sfc_main$13,
8141
+ _sfc_main$e as _sfc_main$14,
8142
+ _sfc_main$d as _sfc_main$15,
8143
+ _sfc_main$c as _sfc_main$16,
8144
+ _sfc_main$b as _sfc_main$17,
8145
+ _sfc_main$a as _sfc_main$18,
8146
+ _sfc_main$9 as _sfc_main$19,
7609
8147
  _sfc_main as _sfc_main$2,
7610
- _sfc_main$7 as _sfc_main$20,
7611
- _sfc_main$6 as _sfc_main$21,
7612
- _sfc_main$5 as _sfc_main$22,
8148
+ _sfc_main$8 as _sfc_main$20,
8149
+ _sfc_main$7 as _sfc_main$21,
8150
+ _sfc_main$6 as _sfc_main$22,
8151
+ _sfc_main$5 as _sfc_main$23,
7613
8152
  _sfc_main$4 as _sfc_main$3,
7614
8153
  _sfc_main$3 as _sfc_main$4,
7615
8154
  _sfc_main$2 as _sfc_main$5,
7616
- _sfc_main$l as _sfc_main$6,
7617
- _sfc_main$k as _sfc_main$7,
7618
- _sfc_main$j as _sfc_main$8,
7619
- _sfc_main$i as _sfc_main$9
8155
+ _sfc_main$m as _sfc_main$6,
8156
+ _sfc_main$l as _sfc_main$7,
8157
+ _sfc_main$k as _sfc_main$8,
8158
+ _sfc_main$j as _sfc_main$9
7620
8159
  };