vvplot 0.4.4 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import { computed, isRef, reactive, unref, getCurrentScope, onScopeDispose, watch, getCurrentInstance, hasInjectionContext, inject, toValue, shallowRef, readonly, watchEffect, onMounted, useTemplateRef, nextTick, openBlock, createElementBlock, mergeProps, renderSlot, toDisplayString, createCommentVNode, createTextVNode, Fragment, renderList, normalizeStyle, createElementVNode, createBlock, toHandlers, normalizeProps, resolveDynamicComponent, guardReactiveProps, createVNode, useModel, createPropsRestProxy, mergeModels, ref, useId, Teleport, useSlots, useAttrs, provide } from "vue";
1
+ import { computed, isRef, reactive, unref, getCurrentScope, onScopeDispose, watch, getCurrentInstance, hasInjectionContext, inject, toValue, shallowRef, readonly, watchEffect, onMounted, Fragment, useTemplateRef, nextTick, openBlock, createElementBlock, mergeProps, renderSlot, toDisplayString, createCommentVNode, createTextVNode, renderList, createBlock, toHandlers, normalizeStyle, createVNode, createElementVNode, normalizeProps, resolveDynamicComponent, guardReactiveProps, useModel, createPropsRestProxy, mergeModels, ref, useId, Teleport, useSlots, useAttrs, provide, withCtx } from "vue";
2
2
  function tryOnScopeDispose(fn) {
3
3
  if (getCurrentScope()) {
4
4
  onScopeDispose(fn);
@@ -242,8 +242,16 @@ function useResizeObserver(target2, callback, options = {}) {
242
242
  stop
243
243
  };
244
244
  }
245
+ // @__NO_SIDE_EFFECTS__
246
+ function makeMap(str) {
247
+ const map2 = /* @__PURE__ */ Object.create(null);
248
+ for (const key of str.split(",")) map2[key] = 1;
249
+ return (val) => val in map2;
250
+ }
245
251
  const NO = () => false;
246
252
  const extend$1 = Object.assign;
253
+ const SVG_TAGS = "svg,animate,animateMotion,animateTransform,circle,clipPath,color-profile,defs,desc,discard,ellipse,feBlend,feColorMatrix,feComponentTransfer,feComposite,feConvolveMatrix,feDiffuseLighting,feDisplacementMap,feDistantLight,feDropShadow,feFlood,feFuncA,feFuncB,feFuncG,feFuncR,feGaussianBlur,feImage,feMerge,feMergeNode,feMorphology,feOffset,fePointLight,feSpecularLighting,feSpotLight,feTile,feTurbulence,filter,foreignObject,g,hatch,hatchpath,image,line,linearGradient,marker,mask,mesh,meshgradient,meshpatch,meshrow,metadata,mpath,path,pattern,polygon,polyline,radialGradient,rect,set,solidcolor,stop,switch,symbol,text,textPath,title,tspan,unknown,use,view";
254
+ const isSVGTag = /* @__PURE__ */ makeMap(SVG_TAGS);
247
255
  const TELEPORT = /* @__PURE__ */ Symbol(``);
248
256
  const SUSPENSE = /* @__PURE__ */ Symbol(``);
249
257
  const KEEP_ALIVE = /* @__PURE__ */ Symbol(``);
@@ -1407,7 +1415,7 @@ const tokenizer = new Tokenizer(stack, {
1407
1415
  }
1408
1416
  },
1409
1417
  oncdata(start2, end) {
1410
- if (stack[0].ns !== 0) {
1418
+ if ((stack[0] ? stack[0].ns : currentOptions.ns) !== 0) {
1411
1419
  onText(getSlice(start2, end), start2, end);
1412
1420
  } else {
1413
1421
  emitError(1, start2 - 9);
@@ -1796,6 +1804,20 @@ function baseParse(input, options) {
1796
1804
  new RegExp(
1797
1805
  "\\b" + "arguments,await,break,case,catch,class,const,continue,debugger,default,delete,do,else,export,extends,finally,for,function,if,import,let,new,return,super,switch,throw,try,var,void,while,with,yield".split(",").join("\\b|\\b") + "\\b"
1798
1806
  );
1807
+ function expandFragment(componentList) {
1808
+ if (componentList == null) return [];
1809
+ return componentList.flatMap((layer) => {
1810
+ if (layer.type == Fragment) {
1811
+ return expandFragment(layer.children);
1812
+ } else if (layer.type == "template") {
1813
+ return expandFragment(layer.children).map((c) => {
1814
+ c.props = { ...c.props, ...layer.props };
1815
+ return c;
1816
+ });
1817
+ }
1818
+ return layer;
1819
+ });
1820
+ }
1799
1821
  class AsisString extends String {
1800
1822
  static #cache = /* @__PURE__ */ new Map();
1801
1823
  constructor(str) {
@@ -1818,7 +1840,7 @@ class AsisNumber extends Number {
1818
1840
  AsisNumber.#cache.set(n, this);
1819
1841
  }
1820
1842
  }
1821
- class Asis extends String {
1843
+ class Asis {
1822
1844
  static #cache = /* @__PURE__ */ new Map();
1823
1845
  constructor(value) {
1824
1846
  if (typeof value === "string" || value instanceof String) {
@@ -1862,7 +1884,7 @@ class EnumLevel extends Array {
1862
1884
  static from(x2) {
1863
1885
  if (x2 instanceof this) return x2;
1864
1886
  if (x2[Symbol.iterator]) {
1865
- let lvl = unique(Array.from(x2).filter((x3) => !(x3 instanceof Asis)).map((x3) => String(x3))).sort((a, b) => compare(a, b, { numeric: true }));
1887
+ let lvl = unique(Array.from(x2).filter((x3) => !(x3 instanceof Asis) && x3 != null).map((x3) => String(x3))).sort((a, b) => compare(a, b, { numeric: true }));
1866
1888
  return new this(...lvl);
1867
1889
  } else if (typeof x2 === "object") {
1868
1890
  let lvl = Object.keys(x2).map((x3) => String(x3)).sort((a, b) => compare(x2[a], x2[b]));
@@ -1916,6 +1938,9 @@ class EnumLevel extends Array {
1916
1938
  function is_continuous(x2) {
1917
1939
  return typeof x2 === "number" || x2 instanceof Number || x2 instanceof Date;
1918
1940
  }
1941
+ function is_categorical(v) {
1942
+ return typeof v === "string" || typeof v === "boolean" || typeof v === "symbol" || typeof v === "object" && v !== null && typeof v.valueOf() !== "number" && typeof v.valueOf() !== "bigint";
1943
+ }
1919
1944
  function plus$1(a, b = 0) {
1920
1945
  if (b == 0 || a == null) return a;
1921
1946
  if (a instanceof Date) return new a.constructor(+a + b);
@@ -1977,7 +2002,7 @@ const vecutils = {
1977
2002
  let length = values[0].length;
1978
2003
  if (values.some((v) => v.length != length))
1979
2004
  throw new Error("Arrays must have the same length");
1980
- return Array.from({ length }, (_, i) => values.reduce((s, a) => +a[i] + s, nums));
2005
+ return Array.from({ length }, (_, i) => values.reduce((s, a) => +(a[i] ?? 0) + s, nums));
1981
2006
  },
1982
2007
  /* vectorized opposite of numbers */
1983
2008
  opposite(value) {
@@ -2020,8 +2045,7 @@ function obj_merge(...arr) {
2020
2045
  if (arr.length == 0) return null;
2021
2046
  return arr.reduce((a, c) => {
2022
2047
  for (let k in c) {
2023
- if (c[k] === null) delete a[k];
2024
- if (c[k] != void 0) a[k] = c[k];
2048
+ if (c[k] !== void 0) a[k] = c[k];
2025
2049
  }
2026
2050
  return a;
2027
2051
  }, {});
@@ -2031,11 +2055,12 @@ function str_c(...args) {
2031
2055
  if (args.some((x2) => x2 === null)) return null;
2032
2056
  return args.join("");
2033
2057
  }
2034
- function unique(arr, mapper = null) {
2058
+ function unique(arr, key = null, priority = null) {
2035
2059
  let map2 = /* @__PURE__ */ new Map();
2036
2060
  for (let i in arr) {
2037
- let key = mapper ? mapper(arr[i]) : arr[i];
2038
- if (!map2.has(key)) map2.set(key, arr[i]);
2061
+ let k = key ? key(arr[i]) : arr[i];
2062
+ if (!map2.has(k)) map2.set(k, arr[i]);
2063
+ else if (priority) map2.set(k, priority(map2.get(k), arr[i]));
2039
2064
  }
2040
2065
  return Array.from(map2.values());
2041
2066
  }
@@ -2204,7 +2229,7 @@ function serializeSVG(svgElement, { unit: unit2 = "mm" } = {}) {
2204
2229
  img.setAttribute("height", foreignElement.getAttribute("height"));
2205
2230
  foreignClone.parentNode.replaceChild(img, foreignClone);
2206
2231
  }
2207
- for (let node of svgClone.querySelectorAll(".vvplot-interactive")) node.remove();
2232
+ for (let node of svgClone.querySelectorAll(".vvplot-interactive,foreignObject")) node.remove();
2208
2233
  removeComments(svgClone);
2209
2234
  svgClone.setAttribute("xmlns", "http://www.w3.org/2000/svg");
2210
2235
  svgClone.setAttribute("xmlns:xlink", "http://www.w3.org/1999/xlink");
@@ -2222,7 +2247,9 @@ const theme_base = {
2222
2247
  tick_width: 1,
2223
2248
  tick_length: 5,
2224
2249
  label_size: 12,
2225
- title_size: 18
2250
+ title_size: 18,
2251
+ grid_width: 1,
2252
+ grid_width_major: 2
2226
2253
  },
2227
2254
  axis_h: {
2228
2255
  title_offset: 20
@@ -2247,10 +2274,6 @@ const theme_base = {
2247
2274
  tick_position: "bottom",
2248
2275
  title_position: "bottom"
2249
2276
  },
2250
- grid: {
2251
- line_width: 1,
2252
- line_width_major: 2
2253
- },
2254
2277
  plot: {
2255
2278
  margin: 20,
2256
2279
  padding_h: 50,
@@ -2268,10 +2291,8 @@ const theme_default = {
2268
2291
  line_color: "black",
2269
2292
  tick_color: "black",
2270
2293
  label_color: "black",
2271
- title_color: "black"
2272
- },
2273
- grid: {
2274
- line_color: "#eeeeee"
2294
+ title_color: "black",
2295
+ grid_color: "#eeeeee"
2275
2296
  }
2276
2297
  };
2277
2298
  const theme_light = {
@@ -2279,20 +2300,16 @@ const theme_light = {
2279
2300
  line_color: "gray",
2280
2301
  tick_color: "gray",
2281
2302
  label_color: "gray",
2282
- title_color: "gray"
2283
- },
2284
- grid: {
2285
- line_color: "#eeeeee"
2303
+ title_color: "gray",
2304
+ grid_color: "#eeeeee"
2286
2305
  }
2287
2306
  };
2288
2307
  const theme_gray = {
2289
2308
  axis: {
2290
2309
  tick_color: "black",
2291
2310
  label_color: "black",
2292
- title_color: "black"
2293
- },
2294
- grid: {
2295
- line_color: "white"
2311
+ title_color: "black",
2312
+ grid_color: "white"
2296
2313
  },
2297
2314
  plot: {
2298
2315
  background: "#eeeeee"
@@ -2302,10 +2319,8 @@ const theme_dark = {
2302
2319
  axis: {
2303
2320
  tick_color: "#333333",
2304
2321
  label_color: "#555555",
2305
- title_color: "black"
2306
- },
2307
- grid: {
2308
- line_color: "#666666"
2322
+ title_color: "black",
2323
+ grid_color: "#666666"
2309
2324
  },
2310
2325
  plot: {
2311
2326
  background: "#888888"
@@ -2316,12 +2331,10 @@ const theme_linedraw = {
2316
2331
  line_color: "black",
2317
2332
  tick_color: "black",
2318
2333
  label_color: "black",
2319
- title_color: "black"
2320
- },
2321
- grid: {
2322
- line_color: "black",
2323
- line_width_major: 1,
2324
- line_width_minor: 0.5
2334
+ title_color: "black",
2335
+ grid_color: "black",
2336
+ grid_width: 0.5,
2337
+ grid_width_major: 1
2325
2338
  }
2326
2339
  };
2327
2340
  const theme_classic = {
@@ -2330,12 +2343,10 @@ const theme_classic = {
2330
2343
  tick_color: "black",
2331
2344
  label_color: "black",
2332
2345
  title_color: "black"
2333
- },
2334
- grid: null
2346
+ }
2335
2347
  };
2336
2348
  const theme_void = {
2337
- axis: null,
2338
- grid: null
2349
+ axis: null
2339
2350
  };
2340
2351
  function themeMerge(...themes) {
2341
2352
  return themes.reduce((acc, t) => {
@@ -2355,10 +2366,6 @@ function themePreprocess(theme2, flip = false) {
2355
2366
  axis_v,
2356
2367
  axis_x,
2357
2368
  axis_y,
2358
- grid_h,
2359
- grid_v,
2360
- grid_x,
2361
- grid_y,
2362
2369
  plot: {
2363
2370
  margin_x,
2364
2371
  margin_y,
@@ -2375,8 +2382,6 @@ function themePreprocess(theme2, flip = false) {
2375
2382
  if (flip) {
2376
2383
  axis_h = obj_merge(axis_h, axis_y);
2377
2384
  axis_v = obj_merge(axis_v, axis_x);
2378
- grid_h = obj_merge(grid_h, grid_x);
2379
- grid_v = obj_merge(grid_v, grid_y);
2380
2385
  plot.margin_h = margin_y === void 0 ? margin_h : margin_y;
2381
2386
  plot.margin_v = margin_x === void 0 ? margin_v : margin_x;
2382
2387
  plot.padding_h = padding_y === void 0 ? padding_h : padding_y;
@@ -2384,8 +2389,6 @@ function themePreprocess(theme2, flip = false) {
2384
2389
  } else {
2385
2390
  axis_h = obj_merge(axis_h, axis_x);
2386
2391
  axis_v = obj_merge(axis_v, axis_y);
2387
- grid_h = obj_merge(grid_h, grid_y);
2388
- grid_v = obj_merge(grid_v, grid_x);
2389
2392
  plot.margin_h = margin_x === void 0 ? margin_h : margin_x;
2390
2393
  plot.margin_v = margin_y === void 0 ? margin_v : margin_y;
2391
2394
  plot.padding_h = padding_x === void 0 ? padding_h : padding_x;
@@ -2394,21 +2397,11 @@ function themePreprocess(theme2, flip = false) {
2394
2397
  return {
2395
2398
  axis_h,
2396
2399
  axis_v,
2397
- grid_h,
2398
- grid_v,
2399
2400
  plot,
2400
2401
  ...rest
2401
2402
  };
2402
2403
  }
2403
2404
  function themeBuild(theme2) {
2404
- function _grid_build(grid_theme) {
2405
- return {
2406
- line_color_major: ["line_color", "line_color_major"].map((k) => grid_theme?.[k]).findLast((x2) => x2 !== void 0),
2407
- line_color_minor: ["line_color", "line_color_minor"].map((k) => grid_theme?.[k]).findLast((x2) => x2 !== void 0),
2408
- line_width_major: ["line_width", "line_width_major"].map((k) => grid_theme?.[k]).findLast((x2) => x2 !== void 0),
2409
- line_width_minor: ["line_width", "line_width_minor"].map((k) => grid_theme?.[k]).findLast((x2) => x2 !== void 0)
2410
- };
2411
- }
2412
2405
  return {
2413
2406
  axis: {
2414
2407
  h: obj_merge(...["axis", "axis_h"].map((k) => theme2?.[k])),
@@ -2426,10 +2419,6 @@ function themeBuild(theme2) {
2426
2419
  ...["axis", "axis_h", "axis_bottom"].map((k) => theme2?.[k])
2427
2420
  )
2428
2421
  },
2429
- grid: {
2430
- h: _grid_build(obj_merge(...["grid", "grid_h"].map((k) => theme2?.[k]))),
2431
- v: _grid_build(obj_merge(...["grid", "grid_v"].map((k) => theme2?.[k])))
2432
- },
2433
2422
  plot: {
2434
2423
  margin: {
2435
2424
  left: ["margin", "margin_h", "margin_left"].map((k) => theme2?.plot?.[k]).findLast((x2) => x2 !== void 0) ?? 0,
@@ -2507,7 +2496,7 @@ const boxplot$1 = {
2507
2496
  y2,
2508
2497
  ds.outliers ?? [],
2509
2498
  xnudge
2510
- ), $xmin = psum$a(ds.xmin, xnudge), $xmax = psum$a(ds.xmax, xnudge);
2499
+ ), $xmin = psum$a(ds.min, xnudge), $xmax = psum$a(ds.max, xnudge);
2511
2500
  return {
2512
2501
  y: y2,
2513
2502
  ymin,
@@ -2775,7 +2764,7 @@ const vvgeom = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProper
2775
2764
  textsegment: textsegment$1,
2776
2765
  tile: tile$1
2777
2766
  }, Symbol.toStringTag, { value: "Module" }));
2778
- const bar = Object.assign(function(data) {
2767
+ const bar = Object.assign(function(data, { position = "stack", width = 1, height = 1 }) {
2779
2768
  if (data.x != null && data.y != null)
2780
2769
  throw new Error(`"StatBar" only supports "x" or "y", not both`);
2781
2770
  let values = data.x ?? data.y;
@@ -2790,25 +2779,52 @@ const bar = Object.assign(function(data) {
2790
2779
  let $raw = Array.from(groups.values()), cates = Array.from(groups.keys());
2791
2780
  let result = {
2792
2781
  $raw,
2793
- count: $raw.map((x2) => x2.length),
2794
- $group: cates.map((x2) => x2.group),
2795
- value: cates.map((x2) => x2.value)
2782
+ $group: cates.map((x2) => x2.group)
2796
2783
  };
2797
2784
  for (let key of keys) {
2798
2785
  result[key] = cates.map((x2) => x2.group).map((i) => group.categories[i][key]);
2799
2786
  }
2800
2787
  if (data.x) {
2801
- return (({ value, count, ...etc }) => ({ x: value, y: count.map((x2) => x2 / 2), height: count, ...etc }))(result);
2788
+ result.x = cates.map((v) => v.value);
2789
+ result.height = $raw.map((v) => v.length);
2790
+ } else {
2791
+ result.y = cates.map((v) => v.value);
2792
+ result.width = $raw.map((v) => v.length);
2793
+ }
2794
+ if (position == "dodge") {
2795
+ if (data.x) {
2796
+ result.y = result.height.map((v) => v / 2);
2797
+ result.width = cates.map((_, i) => width / group.categories.length);
2798
+ result.xnudge = result.$group.map((v, i) => (result.xnudge?.[i] ?? 0) + ((v + 0.5) / group.categories.length - 0.5) * width);
2799
+ } else {
2800
+ result.x = result.width.map((v) => v / 2);
2801
+ result.height = cates.map((_, i) => height / group.categories.length);
2802
+ result.ynudge = result.$group.map((v, i) => (result.ynudge?.[i] ?? 0) + ((v + 0.5) / group.categories.length - 0.5) * height);
2803
+ }
2802
2804
  } else {
2803
- return (({ value, count, ...etc }) => ({ y: value, x: count.map((x2) => x2 / 2), width: count, ...etc }))(result);
2805
+ let tmp = Object.fromEntries(Array.from(new Set(values)).map((v) => [v, 0]));
2806
+ let offset = cates.map((_) => 0);
2807
+ let indices = cates.map((cate, i) => [cate, i]).sort(([{ group: a }], [{ group: b }]) => a - b);
2808
+ for (let [cate, i] of indices) {
2809
+ offset[i] = tmp[cate.value];
2810
+ tmp[cate.value] += $raw[i].length;
2811
+ }
2812
+ if (data.x) {
2813
+ result.y = result.height.map((v, i) => offset[i] + v / 2);
2814
+ result.width = cates.map((_) => width);
2815
+ } else {
2816
+ result.x = result.width.map((v, i) => offset[i] + v / 2);
2817
+ result.height = cates.map((_) => height);
2818
+ }
2804
2819
  }
2820
+ return result;
2805
2821
  }, { core_attrs: ["x", "y", "xnudge", "ynudge"] });
2806
2822
  const boxplot = Object.assign(function(data, {}) {
2807
2823
  let missingAes = ["x", "y"].filter((a) => data[a] == null);
2808
2824
  if (missingAes.length > 0)
2809
2825
  throw new Error(`Missing aesthetics for "StatBoxplot": "${missingAes.join('", "')}"`);
2810
- let isXdiscrete = data.x.some((x2) => typeof x2 !== "number");
2811
- let isYdiscrete = data.y.some((y2) => typeof y2 !== "number");
2826
+ let isXdiscrete = data.x.some(is_categorical);
2827
+ let isYdiscrete = data.y.some(is_categorical);
2812
2828
  if (isXdiscrete && isYdiscrete)
2813
2829
  throw new Error(`Both "x" and "y" are discrete, "StatBoxplot" requires one continuous and one discrete aesthetic`);
2814
2830
  if (!isXdiscrete && !isYdiscrete)
@@ -6792,9 +6808,6 @@ function object_map(obj, expr) {
6792
6808
  if (obj == null) return {};
6793
6809
  return Object.fromEntries(Object.entries(obj).map(([k, v]) => [k, expr(k, v)]));
6794
6810
  }
6795
- function is_categorical(v) {
6796
- return typeof v === "string" || typeof v === "boolean" || typeof v === "symbol" || typeof v === "object" && v !== null && typeof v.valueOf() !== "number" && typeof v.valueOf() !== "bigint";
6797
- }
6798
6811
  class GLayer {
6799
6812
  /**
6800
6813
  * Create a graphic layer from schema
@@ -7185,42 +7198,39 @@ class GAxis {
7185
7198
  this.titles = titles ?? vvlabel.asis();
7186
7199
  this.minorBreaks = minorBreaks ?? breaks ?? scale.minorBreaks ?? scale.breaks;
7187
7200
  }
7188
- getBindings({ range: range2, expandMult } = {}) {
7201
+ getBreaks({ range: range2, expandMult, breakSlot } = {}) {
7189
7202
  let majorBreaks = this.breaks, minorBreaks = this.minorBreaks, labels = this.labels, titles = this.titles;
7190
7203
  let min = range2?.min ?? this?.range?.min, max = range2?.max ?? this?.range?.max, interval2 = max - min || 0;
7191
7204
  min = min == null ? min : plus$1(min, -(expandMult?.min ?? 0) * interval2);
7192
7205
  max = max == null ? max : plus$1(max, +(expandMult?.max ?? 0) * interval2);
7193
- function normalizeBreaks(val) {
7194
- if (val.position != null) return val;
7195
- return { position: val };
7196
- }
7197
7206
  if (typeof majorBreaks == "function") majorBreaks = majorBreaks({ min, max });
7198
- majorBreaks = Array.isArray(majorBreaks) ? majorBreaks.map(normalizeBreaks) : [];
7199
- let breaks = majorBreaks.map((x2) => x2.position);
7200
- if (typeof minorBreaks == "function") minorBreaks = minorBreaks({ min, max, minor: true });
7201
- minorBreaks = Array.isArray(minorBreaks) ? minorBreaks.map(normalizeBreaks) : [];
7202
- if (typeof labels === "function") labels = breaks.map(labels);
7207
+ if (!Array.isArray(majorBreaks)) majorBreaks = [];
7208
+ if (typeof labels === "function") labels = majorBreaks.map(labels);
7203
7209
  if (!Array.isArray(labels)) {
7204
7210
  labels = [];
7205
- } else if (labels.length != breaks.length) {
7211
+ } else if (labels.length != majorBreaks.length) {
7206
7212
  throw new Error("Length of labels must be the same as breaks");
7207
7213
  }
7208
- if (typeof titles === "function") titles = breaks.map(titles);
7214
+ if (typeof titles === "function") titles = majorBreaks.map(titles);
7209
7215
  if (!Array.isArray(titles)) {
7210
7216
  titles = [];
7211
- } else if (titles.length != breaks.length) {
7217
+ } else if (titles.length != majorBreaks.length) {
7212
7218
  throw new Error("Length of titles must be the same as breaks");
7213
7219
  }
7214
- return {
7215
- majorBreaks,
7216
- minorBreaks,
7217
- ticks: breaks.map((position, i) => ({ position, label: labels[i], title: titles[i] }))
7218
- };
7220
+ if (typeof minorBreaks == "function") minorBreaks = minorBreaks({ min, max, minor: true });
7221
+ if (!Array.isArray(minorBreaks)) minorBreaks = [];
7222
+ majorBreaks = majorBreaks.map((value, i) => ({ type: "major", value, label: labels[i], title: titles[i] }));
7223
+ minorBreaks = minorBreaks.map((x2) => ({ type: "minor", value: x2 }));
7224
+ let breaks = majorBreaks.concat(minorBreaks);
7225
+ if (breakSlot instanceof Function) {
7226
+ breaks = expandFragment(breakSlot({ breaks, majorBreaks, minorBreaks, min, max })).filter((c) => c.type.$_type == "axis-break").map((c) => ({ ...c.type.$_props, ...c.props }));
7227
+ }
7228
+ return breaks;
7219
7229
  }
7220
7230
  }
7221
7231
  const _hoisted_1$e = ["font-size"];
7222
7232
  const _hoisted_2$8 = { key: 0 };
7223
- const _sfc_main$13 = {
7233
+ const _sfc_main$15 = {
7224
7234
  __name: "CoreText",
7225
7235
  props: {
7226
7236
  x: { type: Number, default: 0 },
@@ -7305,7 +7315,7 @@ const _sfc_main$13 = {
7305
7315
  }), [
7306
7316
  renderSlot(_ctx.$slots, "default", {}, () => [
7307
7317
  __props.title ? (openBlock(), createElementBlock("title", _hoisted_2$8, toDisplayString(__props.title), 1)) : createCommentVNode("", true),
7308
- createTextVNode(" " + toDisplayString(__props.text.replace(/ /g, " ")), 1)
7318
+ createTextVNode(" " + toDisplayString(__props.text?.replace(/ /g, " ")), 1)
7309
7319
  ])
7310
7320
  ], 16, _hoisted_1$e);
7311
7321
  };
@@ -7746,16 +7756,16 @@ var hasRequiredDecode;
7746
7756
  function requireDecode() {
7747
7757
  if (hasRequiredDecode) return decode;
7748
7758
  hasRequiredDecode = 1;
7749
- (function(exports$1) {
7759
+ (function(exports) {
7750
7760
  var __importDefault = decode && decode.__importDefault || function(mod) {
7751
7761
  return mod && mod.__esModule ? mod : { "default": mod };
7752
7762
  };
7753
- Object.defineProperty(exports$1, "__esModule", { value: true });
7754
- exports$1.decodeXML = exports$1.decodeHTMLStrict = exports$1.decodeHTML = exports$1.determineBranch = exports$1.JUMP_OFFSET_BASE = exports$1.BinTrieFlags = exports$1.xmlDecodeTree = exports$1.htmlDecodeTree = void 0;
7763
+ Object.defineProperty(exports, "__esModule", { value: true });
7764
+ exports.decodeXML = exports.decodeHTMLStrict = exports.decodeHTML = exports.determineBranch = exports.JUMP_OFFSET_BASE = exports.BinTrieFlags = exports.xmlDecodeTree = exports.htmlDecodeTree = void 0;
7755
7765
  var decode_data_html_1 = __importDefault(/* @__PURE__ */ requireDecodeDataHtml());
7756
- exports$1.htmlDecodeTree = decode_data_html_1.default;
7766
+ exports.htmlDecodeTree = decode_data_html_1.default;
7757
7767
  var decode_data_xml_1 = __importDefault(/* @__PURE__ */ requireDecodeDataXml());
7758
- exports$1.xmlDecodeTree = decode_data_xml_1.default;
7768
+ exports.xmlDecodeTree = decode_data_xml_1.default;
7759
7769
  var decode_codepoint_1 = __importDefault(/* @__PURE__ */ requireDecode_codepoint());
7760
7770
  var BinTrieFlags;
7761
7771
  (function(BinTrieFlags2) {
@@ -7763,8 +7773,8 @@ function requireDecode() {
7763
7773
  BinTrieFlags2[BinTrieFlags2["BRANCH_LENGTH"] = 32512] = "BRANCH_LENGTH";
7764
7774
  BinTrieFlags2[BinTrieFlags2["MULTI_BYTE"] = 128] = "MULTI_BYTE";
7765
7775
  BinTrieFlags2[BinTrieFlags2["JUMP_TABLE"] = 127] = "JUMP_TABLE";
7766
- })(BinTrieFlags = exports$1.BinTrieFlags || (exports$1.BinTrieFlags = {}));
7767
- exports$1.JUMP_OFFSET_BASE = 48 - 1;
7776
+ })(BinTrieFlags = exports.BinTrieFlags || (exports.BinTrieFlags = {}));
7777
+ exports.JUMP_OFFSET_BASE = 48 - 1;
7768
7778
  function getDecoder(decodeTree) {
7769
7779
  return function decodeHTMLBinary(str, strict) {
7770
7780
  var ret = "";
@@ -7837,7 +7847,7 @@ function requireDecode() {
7837
7847
  }
7838
7848
  var jumpOffset = current & BinTrieFlags.JUMP_TABLE;
7839
7849
  if (jumpOffset) {
7840
- var value = char - exports$1.JUMP_OFFSET_BASE - jumpOffset;
7850
+ var value = char - exports.JUMP_OFFSET_BASE - jumpOffset;
7841
7851
  return value < 0 || value > branchCount ? -1 : decodeTree[nodeIdx + value] - 1;
7842
7852
  }
7843
7853
  var lo = nodeIdx;
@@ -7855,21 +7865,21 @@ function requireDecode() {
7855
7865
  }
7856
7866
  return -1;
7857
7867
  }
7858
- exports$1.determineBranch = determineBranch;
7868
+ exports.determineBranch = determineBranch;
7859
7869
  var htmlDecoder = getDecoder(decode_data_html_1.default);
7860
7870
  var xmlDecoder = getDecoder(decode_data_xml_1.default);
7861
7871
  function decodeHTML(str) {
7862
7872
  return htmlDecoder(str, false);
7863
7873
  }
7864
- exports$1.decodeHTML = decodeHTML;
7874
+ exports.decodeHTML = decodeHTML;
7865
7875
  function decodeHTMLStrict(str) {
7866
7876
  return htmlDecoder(str, true);
7867
7877
  }
7868
- exports$1.decodeHTMLStrict = decodeHTMLStrict;
7878
+ exports.decodeHTMLStrict = decodeHTMLStrict;
7869
7879
  function decodeXML(str) {
7870
7880
  return xmlDecoder(str, true);
7871
7881
  }
7872
- exports$1.decodeXML = decodeXML;
7882
+ exports.decodeXML = decodeXML;
7873
7883
  })(decode);
7874
7884
  return decode;
7875
7885
  }
@@ -12141,17 +12151,17 @@ var hasRequiredEncodeTrie;
12141
12151
  function requireEncodeTrie() {
12142
12152
  if (hasRequiredEncodeTrie) return encodeTrie;
12143
12153
  hasRequiredEncodeTrie = 1;
12144
- (function(exports$1) {
12154
+ (function(exports) {
12145
12155
  var __importDefault = encodeTrie && encodeTrie.__importDefault || function(mod) {
12146
12156
  return mod && mod.__esModule ? mod : { "default": mod };
12147
12157
  };
12148
- Object.defineProperty(exports$1, "__esModule", { value: true });
12149
- exports$1.getTrie = exports$1.encodeHTMLTrieRe = exports$1.getCodePoint = void 0;
12158
+ Object.defineProperty(exports, "__esModule", { value: true });
12159
+ exports.getTrie = exports.encodeHTMLTrieRe = exports.getCodePoint = void 0;
12150
12160
  var entities_json_1 = __importDefault(require$$2);
12151
12161
  function isHighSurrugate(c) {
12152
12162
  return (c & 64512) === 55296;
12153
12163
  }
12154
- exports$1.getCodePoint = // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
12164
+ exports.getCodePoint = // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
12155
12165
  String.prototype.codePointAt != null ? function(str, index2) {
12156
12166
  return str.codePointAt(index2);
12157
12167
  } : (
@@ -12183,13 +12193,13 @@ function requireEncodeTrie() {
12183
12193
  ret += str.substring(lastIdx, i) + next2.value;
12184
12194
  lastIdx = i + 1;
12185
12195
  } else {
12186
- ret += str.substring(lastIdx, i) + "&#x" + exports$1.getCodePoint(str, i).toString(16) + ";";
12196
+ ret += str.substring(lastIdx, i) + "&#x" + exports.getCodePoint(str, i).toString(16) + ";";
12187
12197
  lastIdx = regExp.lastIndex += Number(isHighSurrugate(char));
12188
12198
  }
12189
12199
  }
12190
12200
  return ret + str.substr(lastIdx);
12191
12201
  }
12192
- exports$1.encodeHTMLTrieRe = encodeHTMLTrieRe;
12202
+ exports.encodeHTMLTrieRe = encodeHTMLTrieRe;
12193
12203
  function getTrie(map2) {
12194
12204
  var _a, _b, _c, _d;
12195
12205
  var trie2 = /* @__PURE__ */ new Map();
@@ -12209,7 +12219,7 @@ function requireEncodeTrie() {
12209
12219
  }
12210
12220
  return trie2;
12211
12221
  }
12212
- exports$1.getTrie = getTrie;
12222
+ exports.getTrie = getTrie;
12213
12223
  })(encodeTrie);
12214
12224
  return encodeTrie;
12215
12225
  }
@@ -12304,27 +12314,27 @@ var hasRequiredLib;
12304
12314
  function requireLib() {
12305
12315
  if (hasRequiredLib) return lib;
12306
12316
  hasRequiredLib = 1;
12307
- (function(exports$1) {
12308
- Object.defineProperty(exports$1, "__esModule", { value: true });
12309
- exports$1.decodeXMLStrict = exports$1.decodeHTML5Strict = exports$1.decodeHTML4Strict = exports$1.decodeHTML5 = exports$1.decodeHTML4 = exports$1.decodeHTMLStrict = exports$1.decodeHTML = exports$1.decodeXML = exports$1.encodeHTML5 = exports$1.encodeHTML4 = exports$1.escapeUTF8 = exports$1.escape = exports$1.encodeNonAsciiHTML = exports$1.encodeHTML = exports$1.encodeXML = exports$1.encode = exports$1.decodeStrict = exports$1.decode = exports$1.EncodingMode = exports$1.DecodingMode = exports$1.EntityLevel = void 0;
12317
+ (function(exports) {
12318
+ Object.defineProperty(exports, "__esModule", { value: true });
12319
+ exports.decodeXMLStrict = exports.decodeHTML5Strict = exports.decodeHTML4Strict = exports.decodeHTML5 = exports.decodeHTML4 = exports.decodeHTMLStrict = exports.decodeHTML = exports.decodeXML = exports.encodeHTML5 = exports.encodeHTML4 = exports.escapeUTF8 = exports.escape = exports.encodeNonAsciiHTML = exports.encodeHTML = exports.encodeXML = exports.encode = exports.decodeStrict = exports.decode = exports.EncodingMode = exports.DecodingMode = exports.EntityLevel = void 0;
12310
12320
  var decode_1 = /* @__PURE__ */ requireDecode();
12311
12321
  var encode_12 = /* @__PURE__ */ requireEncode();
12312
12322
  var EntityLevel;
12313
12323
  (function(EntityLevel2) {
12314
12324
  EntityLevel2[EntityLevel2["XML"] = 0] = "XML";
12315
12325
  EntityLevel2[EntityLevel2["HTML"] = 1] = "HTML";
12316
- })(EntityLevel = exports$1.EntityLevel || (exports$1.EntityLevel = {}));
12326
+ })(EntityLevel = exports.EntityLevel || (exports.EntityLevel = {}));
12317
12327
  var DecodingMode;
12318
12328
  (function(DecodingMode2) {
12319
12329
  DecodingMode2[DecodingMode2["Legacy"] = 0] = "Legacy";
12320
12330
  DecodingMode2[DecodingMode2["Strict"] = 1] = "Strict";
12321
- })(DecodingMode = exports$1.DecodingMode || (exports$1.DecodingMode = {}));
12331
+ })(DecodingMode = exports.DecodingMode || (exports.DecodingMode = {}));
12322
12332
  var EncodingMode;
12323
12333
  (function(EncodingMode2) {
12324
12334
  EncodingMode2[EncodingMode2["UTF8"] = 0] = "UTF8";
12325
12335
  EncodingMode2[EncodingMode2["ASCII"] = 1] = "ASCII";
12326
12336
  EncodingMode2[EncodingMode2["Extensive"] = 2] = "Extensive";
12327
- })(EncodingMode = exports$1.EncodingMode || (exports$1.EncodingMode = {}));
12337
+ })(EncodingMode = exports.EncodingMode || (exports.EncodingMode = {}));
12328
12338
  function decode2(data, options) {
12329
12339
  if (options === void 0) {
12330
12340
  options = EntityLevel.XML;
@@ -12338,7 +12348,7 @@ function requireLib() {
12338
12348
  }
12339
12349
  return decode_1.decodeXML(data);
12340
12350
  }
12341
- exports$1.decode = decode2;
12351
+ exports.decode = decode2;
12342
12352
  function decodeStrict(data, options) {
12343
12353
  if (options === void 0) {
12344
12354
  options = EntityLevel.XML;
@@ -12352,7 +12362,7 @@ function requireLib() {
12352
12362
  }
12353
12363
  return decode_1.decodeXML(data);
12354
12364
  }
12355
- exports$1.decodeStrict = decodeStrict;
12365
+ exports.decodeStrict = decodeStrict;
12356
12366
  function encode2(data, options) {
12357
12367
  if (options === void 0) {
12358
12368
  options = EntityLevel.XML;
@@ -12368,52 +12378,52 @@ function requireLib() {
12368
12378
  }
12369
12379
  return encode_12.encodeXML(data);
12370
12380
  }
12371
- exports$1.encode = encode2;
12381
+ exports.encode = encode2;
12372
12382
  var encode_2 = /* @__PURE__ */ requireEncode();
12373
- Object.defineProperty(exports$1, "encodeXML", { enumerable: true, get: function() {
12383
+ Object.defineProperty(exports, "encodeXML", { enumerable: true, get: function() {
12374
12384
  return encode_2.encodeXML;
12375
12385
  } });
12376
- Object.defineProperty(exports$1, "encodeHTML", { enumerable: true, get: function() {
12386
+ Object.defineProperty(exports, "encodeHTML", { enumerable: true, get: function() {
12377
12387
  return encode_2.encodeHTML;
12378
12388
  } });
12379
- Object.defineProperty(exports$1, "encodeNonAsciiHTML", { enumerable: true, get: function() {
12389
+ Object.defineProperty(exports, "encodeNonAsciiHTML", { enumerable: true, get: function() {
12380
12390
  return encode_2.encodeNonAsciiHTML;
12381
12391
  } });
12382
- Object.defineProperty(exports$1, "escape", { enumerable: true, get: function() {
12392
+ Object.defineProperty(exports, "escape", { enumerable: true, get: function() {
12383
12393
  return encode_2.escape;
12384
12394
  } });
12385
- Object.defineProperty(exports$1, "escapeUTF8", { enumerable: true, get: function() {
12395
+ Object.defineProperty(exports, "escapeUTF8", { enumerable: true, get: function() {
12386
12396
  return encode_2.escapeUTF8;
12387
12397
  } });
12388
- Object.defineProperty(exports$1, "encodeHTML4", { enumerable: true, get: function() {
12398
+ Object.defineProperty(exports, "encodeHTML4", { enumerable: true, get: function() {
12389
12399
  return encode_2.encodeHTML;
12390
12400
  } });
12391
- Object.defineProperty(exports$1, "encodeHTML5", { enumerable: true, get: function() {
12401
+ Object.defineProperty(exports, "encodeHTML5", { enumerable: true, get: function() {
12392
12402
  return encode_2.encodeHTML;
12393
12403
  } });
12394
12404
  var decode_2 = /* @__PURE__ */ requireDecode();
12395
- Object.defineProperty(exports$1, "decodeXML", { enumerable: true, get: function() {
12405
+ Object.defineProperty(exports, "decodeXML", { enumerable: true, get: function() {
12396
12406
  return decode_2.decodeXML;
12397
12407
  } });
12398
- Object.defineProperty(exports$1, "decodeHTML", { enumerable: true, get: function() {
12408
+ Object.defineProperty(exports, "decodeHTML", { enumerable: true, get: function() {
12399
12409
  return decode_2.decodeHTML;
12400
12410
  } });
12401
- Object.defineProperty(exports$1, "decodeHTMLStrict", { enumerable: true, get: function() {
12411
+ Object.defineProperty(exports, "decodeHTMLStrict", { enumerable: true, get: function() {
12402
12412
  return decode_2.decodeHTMLStrict;
12403
12413
  } });
12404
- Object.defineProperty(exports$1, "decodeHTML4", { enumerable: true, get: function() {
12414
+ Object.defineProperty(exports, "decodeHTML4", { enumerable: true, get: function() {
12405
12415
  return decode_2.decodeHTML;
12406
12416
  } });
12407
- Object.defineProperty(exports$1, "decodeHTML5", { enumerable: true, get: function() {
12417
+ Object.defineProperty(exports, "decodeHTML5", { enumerable: true, get: function() {
12408
12418
  return decode_2.decodeHTML;
12409
12419
  } });
12410
- Object.defineProperty(exports$1, "decodeHTML4Strict", { enumerable: true, get: function() {
12420
+ Object.defineProperty(exports, "decodeHTML4Strict", { enumerable: true, get: function() {
12411
12421
  return decode_2.decodeHTMLStrict;
12412
12422
  } });
12413
- Object.defineProperty(exports$1, "decodeHTML5Strict", { enumerable: true, get: function() {
12423
+ Object.defineProperty(exports, "decodeHTML5Strict", { enumerable: true, get: function() {
12414
12424
  return decode_2.decodeHTMLStrict;
12415
12425
  } });
12416
- Object.defineProperty(exports$1, "decodeXMLStrict", { enumerable: true, get: function() {
12426
+ Object.defineProperty(exports, "decodeXMLStrict", { enumerable: true, get: function() {
12417
12427
  return decode_2.decodeXML;
12418
12428
  } });
12419
12429
  })(lib);
@@ -14471,7 +14481,7 @@ XmlRenderer.prototype.tag = tag;
14471
14481
  XmlRenderer.prototype.esc = escapeXml;
14472
14482
  const _hoisted_1$d = ["text-anchor", "font-size"];
14473
14483
  const _hoisted_2$7 = { key: 0 };
14474
- const _sfc_main$12 = {
14484
+ const _sfc_main$14 = {
14475
14485
  __name: "CoreMarkdown",
14476
14486
  props: {
14477
14487
  x: { type: Number, default: 0 },
@@ -14618,6 +14628,72 @@ const _sfc_main$12 = {
14618
14628
  };
14619
14629
  }
14620
14630
  };
14631
+ const _sfc_main$13 = {
14632
+ __name: "CoreAxisLabel",
14633
+ props: {
14634
+ type: String,
14635
+ value: null,
14636
+ getPosition: Function
14637
+ },
14638
+ emits: [
14639
+ "click",
14640
+ "dblclick",
14641
+ "contextmenu",
14642
+ "pointerdown",
14643
+ "pointerup",
14644
+ "pointerover",
14645
+ "pointerout",
14646
+ "pointerenter",
14647
+ "pointerleave",
14648
+ "pointermove",
14649
+ "wheel",
14650
+ "singleclick"
14651
+ ],
14652
+ setup(__props, { emit: __emit }) {
14653
+ const emit = __emit;
14654
+ const vOn = {
14655
+ pointerdown(e) {
14656
+ emit("pointerdown", e, __props.getPosition(e), __props.value);
14657
+ },
14658
+ pointerup(e) {
14659
+ emit("pointerup", e, __props.getPosition(e), __props.value);
14660
+ },
14661
+ pointerover(e) {
14662
+ emit("pointerover", e, __props.getPosition(e), __props.value);
14663
+ },
14664
+ pointerout(e) {
14665
+ emit("pointerout", e, __props.getPosition(e), __props.value);
14666
+ },
14667
+ pointerenter(e) {
14668
+ emit("pointerenter", e, __props.getPosition(e), __props.value);
14669
+ },
14670
+ pointerleave(e) {
14671
+ emit("pointerleave", e, __props.getPosition(e), __props.value);
14672
+ },
14673
+ dblclick(e) {
14674
+ emit("dblclick", e, __props.getPosition(e), __props.value);
14675
+ },
14676
+ click(e) {
14677
+ emit("click", e, __props.getPosition(e), __props.value);
14678
+ },
14679
+ singleclick(e) {
14680
+ emit("singleclick", e, __props.getPosition(e), __props.value);
14681
+ },
14682
+ contextmenu(e) {
14683
+ emit("contextmenu", e, __props.getPosition(e), __props.value);
14684
+ },
14685
+ pointermove(e) {
14686
+ emit("pointermove", e, __props.getPosition(e), __props.value);
14687
+ },
14688
+ wheel(e) {
14689
+ emit("wheel", e, __props.getPosition(e), __props.value);
14690
+ }
14691
+ };
14692
+ return (_ctx, _cache) => {
14693
+ return __props.type == "markdown" ? (openBlock(), createBlock(_sfc_main$14, mergeProps({ key: 0 }, toHandlers(vOn)), null, 16)) : (openBlock(), createBlock(_sfc_main$15, mergeProps({ key: 1 }, toHandlers(vOn)), null, 16));
14694
+ };
14695
+ }
14696
+ };
14621
14697
  const _hoisted_1$c = ["transform"];
14622
14698
  const _hoisted_2$6 = ["x2"];
14623
14699
  const _hoisted_3$4 = {
@@ -14626,12 +14702,12 @@ const _hoisted_3$4 = {
14626
14702
  };
14627
14703
  const _hoisted_4$3 = ["width", "cursor"];
14628
14704
  const _hoisted_5$2 = {
14629
- key: 0,
14705
+ key: 1,
14630
14706
  class: "vvplot-interactive",
14631
14707
  fill: "transparent"
14632
14708
  };
14633
14709
  const _hoisted_6$2 = ["x"];
14634
- const _sfc_main$11 = {
14710
+ const _sfc_main$12 = {
14635
14711
  __name: "CoreAxisH",
14636
14712
  props: {
14637
14713
  coord: String,
@@ -14712,20 +14788,20 @@ const _sfc_main$11 = {
14712
14788
  const tickLines = computed(() => {
14713
14789
  let result = [];
14714
14790
  for (let tick of __props.ticks) {
14715
- if (typeof tick == "number") tick = { position: tick };
14716
- let pos = __props.coord2pos({ h: tick.position }).h;
14791
+ let { value, theme: $theme } = tick;
14792
+ let pos = __props.coord2pos({ h: value }).h;
14717
14793
  let tsl = pos * (__props.activeTransform.scaleH - 1) + __props.activeTransform.translateH;
14718
- let position = pos + __props.layout.l;
14719
- if (position + tsl < 0 || position + tsl > width.value) continue;
14720
- let offset = (__props.theme.tick_position == "top" ? -1 : 1) * (tick.length ?? __props.theme.tick_length);
14794
+ pos += __props.layout.l;
14795
+ if (pos + tsl < 0 || pos + tsl > width.value) continue;
14796
+ let offset = ($theme.tick_position == "top" ? -1 : 1) * $theme.tick_length;
14721
14797
  result.push({
14722
- key: "line-" + tick.position,
14798
+ key: "line-" + value,
14723
14799
  y1: 0,
14724
14800
  y2: offset,
14725
- x1: position,
14726
- x2: position,
14727
- "stroke": tick.color ?? __props.theme.tick_color,
14728
- "stroke-width": tick.width ?? __props.theme.tick_width,
14801
+ x1: pos,
14802
+ x2: pos,
14803
+ "stroke": $theme.tick_color,
14804
+ "stroke-width": $theme.tick_width,
14729
14805
  transform: tsl ? `translate(${tsl},0)` : null,
14730
14806
  style: { transition: __props.transition }
14731
14807
  });
@@ -14733,43 +14809,45 @@ const _sfc_main$11 = {
14733
14809
  return result.filter((t) => t.stroke != null).sort((a, b) => a.x1 - b.x1);
14734
14810
  });
14735
14811
  const tickTexts = computed(() => {
14736
- let isTop = (__props.theme.label_position ?? __props.theme.tick_position) == "top";
14737
14812
  let result = [];
14738
14813
  for (let tick of __props.ticks) {
14739
- if (typeof tick == "number") tick = { position: tick, label: tick };
14740
- let pos = __props.coord2pos({ h: tick.position }).h;
14814
+ let { type, value, label, title, theme: $theme, ...etc } = tick;
14815
+ let isTop = ($theme.label_position ?? $theme.tick_position) == "top";
14816
+ let pos = __props.coord2pos({ h: value }).h;
14741
14817
  let tsl = pos * (__props.activeTransform.scaleH - 1) + __props.activeTransform.translateH;
14742
- let position = pos + __props.layout.l;
14743
- if (position + tsl < 0 || position + tsl > width.value) continue;
14744
- let offset = (isTop ? -1 : 1) * (__props.theme.label_offset ?? tick.length ?? __props.theme.tick_length);
14818
+ pos += __props.layout.l;
14819
+ if (pos + tsl < 0 || pos + tsl > width.value) continue;
14820
+ let offset = (isTop ? -1 : 1) * ($theme.label_offset ?? $theme.tick_length);
14745
14821
  let anchorX, anchorY, dockX, dockY;
14746
- if (__props.theme.label_anchor_x != null || __props.theme.label_anchor_y != null) {
14747
- anchorX = __props.theme.label_anchor_x ?? 0.5;
14748
- anchorY = __props.theme.label_anchor_y ?? (isTop ? 0 : 1);
14822
+ if ($theme.label_anchor_x != null || $theme.label_anchor_y != null) {
14823
+ anchorX = $theme.label_anchor_x ?? 0.5;
14824
+ anchorY = $theme.label_anchor_y ?? (isTop ? 0 : 1);
14749
14825
  } else {
14750
- dockX = __props.theme.label_dock_x ?? 0.5;
14751
- dockY = __props.theme.label_dock_y ?? (isTop ? 0 : 1);
14826
+ dockX = $theme.label_dock_x ?? 0.5;
14827
+ dockY = $theme.label_dock_y ?? (isTop ? 0 : 1);
14752
14828
  }
14753
14829
  result.push({
14754
14830
  wrapper: {
14755
- key: "text-" + tick.position,
14831
+ key: "text-" + value,
14756
14832
  transform: tsl ? `translate(${tsl},0)` : null,
14757
14833
  style: { transition: __props.transition }
14758
14834
  },
14759
14835
  text: {
14760
- x: position,
14836
+ x: pos,
14761
14837
  y: offset,
14762
- angle: __props.theme.label_angle,
14838
+ angle: $theme.label_angle,
14763
14839
  anchorX,
14764
14840
  anchorY,
14765
14841
  dockX,
14766
14842
  dockY,
14767
- text: tick.label,
14768
- title: tick.title ?? tick.label,
14769
- fontSize: tick.size ?? __props.theme.label_size,
14770
- fill: tick.color ?? __props.theme.label_color,
14843
+ type: $theme.label_type,
14844
+ text: label,
14845
+ title: title ?? label,
14846
+ fontSize: $theme.label_size,
14847
+ fill: $theme.label_color,
14771
14848
  "font-family": "sans-serif",
14772
- ...__props.theme.label_style
14849
+ value,
14850
+ ...etc
14773
14851
  }
14774
14852
  });
14775
14853
  }
@@ -14800,13 +14878,6 @@ const _sfc_main$11 = {
14800
14878
  }
14801
14879
  }
14802
14880
  e.target.addEventListener("pointermove", detectMove, { passive: true });
14803
- e.target.addEventListener("pointerup", function(ev) {
14804
- e.target.removeEventListener("pointermove", detectMove);
14805
- if (!pointerMoved) {
14806
- let position2 = getPosition(ev);
14807
- emit("singleclick", new PointerEvent("singleclick", ev), position2);
14808
- }
14809
- }, { once: true });
14810
14881
  let act = __props.action.find((a) => a.action == "move");
14811
14882
  if (!act) return;
14812
14883
  e.preventDefault();
@@ -14965,19 +15036,21 @@ const _sfc_main$11 = {
14965
15036
  pointerleave(e) {
14966
15037
  emit("pointerleave", e, getPosition(e));
14967
15038
  },
14968
- dblclick(e) {
14969
- emit("dblclick", e, getPosition(e));
14970
- },
14971
15039
  click(e) {
14972
15040
  emit("click", e, getPosition(e));
14973
15041
  },
15042
+ singleclick(e) {
15043
+ emit("singleclick", e, getPosition(e));
15044
+ },
15045
+ dblclick(e) {
15046
+ emit("dblclick", e, getPosition(e));
15047
+ },
14974
15048
  contextmenu(e) {
14975
15049
  emit("contextmenu", e, getPosition(e));
14976
15050
  },
14977
15051
  pointermove(e) {
14978
15052
  emit("pointermove", e, getPosition(e));
14979
15053
  },
14980
- pointerdown: axisMovePointerdown,
14981
15054
  wheel: axisWheel
14982
15055
  };
14983
15056
  return (_ctx, _cache) => {
@@ -14985,13 +15058,14 @@ const _sfc_main$11 = {
14985
15058
  transform: transform.value,
14986
15059
  style: normalizeStyle({ transition: __props.transition })
14987
15060
  }, [
14988
- createElementVNode("line", mergeProps({
15061
+ axisLine.value.stroke != null ? (openBlock(), createElementBlock("line", mergeProps({
15062
+ key: 0,
14989
15063
  ref: "i",
14990
15064
  x1: 0,
14991
15065
  x2: width.value,
14992
15066
  y1: 0,
14993
15067
  y2: 0
14994
- }, axisLine.value), null, 16, _hoisted_2$6),
15068
+ }, axisLine.value), null, 16, _hoisted_2$6)) : createCommentVNode("", true),
14995
15069
  _cache[1] || (_cache[1] = createTextVNode()),
14996
15070
  (openBlock(true), createElementBlock(Fragment, null, renderList(tickLines.value, (tick) => {
14997
15071
  return openBlock(), createElementBlock("line", mergeProps({ ref_for: true }, tick), null, 16);
@@ -14999,13 +15073,7 @@ const _sfc_main$11 = {
14999
15073
  _cache[2] || (_cache[2] = createTextVNode()),
15000
15074
  (openBlock(true), createElementBlock(Fragment, null, renderList(tickTexts.value, (tick) => {
15001
15075
  return openBlock(), createElementBlock("g", mergeProps({ ref_for: true }, tick.wrapper), [
15002
- __props.theme.label_type == "markdown" ? (openBlock(), createBlock(_sfc_main$12, mergeProps({
15003
- key: 0,
15004
- ref_for: true
15005
- }, tick.text), null, 16)) : (openBlock(), createBlock(_sfc_main$13, mergeProps({
15006
- key: 1,
15007
- ref_for: true
15008
- }, tick.text), null, 16))
15076
+ createVNode(_sfc_main$13, mergeProps({ ref_for: true }, tick.text, { getPosition }), null, 16)
15009
15077
  ], 16);
15010
15078
  }), 256)),
15011
15079
  _cache[3] || (_cache[3] = createTextVNode()),
@@ -15015,31 +15083,30 @@ const _sfc_main$11 = {
15015
15083
  height: 10,
15016
15084
  y: -5
15017
15085
  }, toHandlers(axisVOn, true), {
15086
+ onPointerdown: axisMovePointerdown,
15018
15087
  cursor: __props.action.some?.((a) => a.action == "move") ? "grab" : null
15019
15088
  }), null, 16, _hoisted_4$3)
15020
15089
  ]),
15021
15090
  _cache[4] || (_cache[4] = createTextVNode()),
15022
15091
  __props.action.some?.((a) => a.action == "rescale") ? (openBlock(), createElementBlock("g", _hoisted_5$2, [
15023
- createElementVNode("rect", {
15092
+ createElementVNode("rect", mergeProps({
15024
15093
  width: 20,
15025
15094
  height: 10,
15026
15095
  y: -5,
15027
- style: { "cursor": "ew-resize" },
15028
- onPointerdown: axisRescaleLeftPointerdown
15029
- }, null, 32),
15096
+ style: { "cursor": "ew-resize" }
15097
+ }, toHandlers(axisVOn, true), { onPointerdown: axisRescaleLeftPointerdown }), null, 16),
15030
15098
  _cache[0] || (_cache[0] = createTextVNode()),
15031
- createElementVNode("rect", {
15099
+ createElementVNode("rect", mergeProps({
15032
15100
  width: 20,
15033
15101
  height: 10,
15034
15102
  y: -5,
15035
15103
  x: width.value - 20,
15036
- style: { "cursor": "ew-resize" },
15037
- onPointerdown: axisRescaleRightPointerdown
15038
- }, null, 40, _hoisted_6$2)
15104
+ style: { "cursor": "ew-resize" }
15105
+ }, toHandlers(axisVOn, true), { onPointerdown: axisRescaleRightPointerdown }), null, 16, _hoisted_6$2)
15039
15106
  ])) : createCommentVNode("", true),
15040
15107
  _cache[5] || (_cache[5] = createTextVNode()),
15041
- axisTitle.value.text ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
15042
- __props.theme.title_type == "markdown" ? (openBlock(), createBlock(_sfc_main$12, normalizeProps(mergeProps({ key: 0 }, axisTitle.value)), null, 16)) : (openBlock(), createBlock(_sfc_main$13, normalizeProps(mergeProps({ key: 1 }, axisTitle.value)), null, 16))
15108
+ axisTitle.value.text ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
15109
+ __props.theme.title_type == "markdown" ? (openBlock(), createBlock(_sfc_main$14, normalizeProps(mergeProps({ key: 0 }, axisTitle.value)), null, 16)) : (openBlock(), createBlock(_sfc_main$15, normalizeProps(mergeProps({ key: 1 }, axisTitle.value)), null, 16))
15043
15110
  ], 64)) : createCommentVNode("", true)
15044
15111
  ], 12, _hoisted_1$c);
15045
15112
  };
@@ -15053,12 +15120,12 @@ const _hoisted_3$3 = {
15053
15120
  };
15054
15121
  const _hoisted_4$2 = ["height", "cursor"];
15055
15122
  const _hoisted_5$1 = {
15056
- key: 0,
15123
+ key: 1,
15057
15124
  class: "vvplot-interactive",
15058
15125
  fill: "transparent"
15059
15126
  };
15060
15127
  const _hoisted_6$1 = ["y"];
15061
- const _sfc_main$10 = {
15128
+ const _sfc_main$11 = {
15062
15129
  __name: "CoreAxisV",
15063
15130
  props: {
15064
15131
  coord: String,
@@ -15139,20 +15206,20 @@ const _sfc_main$10 = {
15139
15206
  const tickLines = computed(() => {
15140
15207
  let result = [];
15141
15208
  for (let tick of __props.ticks) {
15142
- if (typeof tick == "number") tick = { position: tick };
15143
- let pos = __props.coord2pos({ v: tick.position }).v;
15209
+ let { value, theme: $theme } = tick;
15210
+ let pos = __props.coord2pos({ v: value }).v;
15144
15211
  let tsl = pos * (__props.activeTransform.scaleV - 1) + __props.activeTransform.translateV;
15145
- let position = pos + __props.layout.t;
15146
- if (position + tsl < 0 || position + tsl > height.value) continue;
15147
- let offset = (__props.theme.tick_position == "right" ? 1 : -1) * (tick.length ?? __props.theme.tick_length);
15212
+ pos += __props.layout.t;
15213
+ if (pos + tsl < 0 || pos + tsl > height.value) continue;
15214
+ let offset = ($theme.tick_position == "right" ? 1 : -1) * $theme.tick_length;
15148
15215
  result.push({
15149
- key: "line-" + tick.position,
15150
- y1: position,
15151
- y2: position,
15216
+ key: "line-" + tick.value,
15217
+ y1: pos,
15218
+ y2: pos,
15152
15219
  x1: 0,
15153
15220
  x2: offset,
15154
- "stroke": tick.color ?? __props.theme.tick_color,
15155
- "stroke-width": tick.width ?? __props.theme.tick_width,
15221
+ "stroke": tick.color ?? $theme.tick_color,
15222
+ "stroke-width": tick.width ?? $theme.tick_width,
15156
15223
  transform: tsl ? `translate(0,${tsl})` : null,
15157
15224
  style: { transition: __props.transition }
15158
15225
  });
@@ -15160,43 +15227,45 @@ const _sfc_main$10 = {
15160
15227
  return result.filter((t) => t.stroke != null).sort((a, b) => a.y1 - b.y1);
15161
15228
  });
15162
15229
  const tickTexts = computed(() => {
15163
- let isRight = (__props.theme.label_position ?? __props.theme.tick_position) == "right";
15164
15230
  let result = [];
15165
15231
  for (let tick of __props.ticks) {
15166
- if (typeof tick == "number") tick = { position: tick };
15167
- let pos = __props.coord2pos({ v: tick.position }).v;
15232
+ let { type, value, label, title, theme: $theme, ...etc } = tick;
15233
+ let isRight = ($theme.label_position ?? $theme.tick_position) == "right";
15234
+ let pos = __props.coord2pos({ v: value }).v;
15168
15235
  let tsl = pos * (__props.activeTransform.scaleV - 1) + __props.activeTransform.translateV;
15169
- let position = pos + __props.layout.t;
15170
- if (position + tsl < 0 || position + tsl > height.value) continue;
15171
- let offset = (isRight ? 1 : -1) * ((__props.theme.label_offset ?? tick.length ?? __props.theme.tick_length) + 3);
15236
+ pos += __props.layout.t;
15237
+ if (pos + tsl < 0 || pos + tsl > height.value) continue;
15238
+ let offset = (isRight ? 1 : -1) * (($theme.label_offset ?? $theme.tick_length) + 3);
15172
15239
  let anchorX, anchorY, dockX, dockY;
15173
- if (__props.theme.label_anchor_x != null || __props.theme.label_anchor_y != null) {
15174
- anchorX = __props.theme.label_anchor_x ?? (isRight ? 0 : 1);
15175
- anchorY = __props.theme.label_anchor_y ?? 0.5;
15240
+ if ($theme.label_anchor_x != null || $theme.label_anchor_y != null) {
15241
+ anchorX = $theme.label_anchor_x ?? (isRight ? 0 : 1);
15242
+ anchorY = $theme.label_anchor_y ?? 0.5;
15176
15243
  } else {
15177
- dockX = __props.theme.label_dock_x ?? (isRight ? 0 : 1);
15178
- dockY = __props.theme.label_dock_y ?? 0.5;
15244
+ dockX = $theme.label_dock_x ?? (isRight ? 0 : 1);
15245
+ dockY = $theme.label_dock_y ?? 0.5;
15179
15246
  }
15180
15247
  result.push({
15181
15248
  wrapper: {
15182
- key: "text-" + tick.position,
15249
+ key: "text-" + value,
15183
15250
  transform: tsl ? `translate(0,${tsl})` : null,
15184
15251
  style: { transition: __props.transition }
15185
15252
  },
15186
15253
  text: {
15187
- y: position,
15254
+ y: pos,
15188
15255
  x: offset,
15189
- angle: __props.theme.label_angle,
15256
+ angle: $theme.label_angle,
15190
15257
  anchorX,
15191
15258
  anchorY,
15192
15259
  dockX,
15193
15260
  dockY,
15194
- text: tick.label,
15195
- title: tick.title ?? tick.label,
15196
- fontSize: tick.size ?? __props.theme.label_size,
15197
- fill: tick.color ?? __props.theme.label_color,
15261
+ type: $theme.label_type,
15262
+ text: label,
15263
+ title: title ?? label,
15264
+ fontSize: $theme.label_size,
15265
+ fill: $theme.label_color,
15198
15266
  "font-family": "sans-serif",
15199
- ...__props.theme.label_style
15267
+ value,
15268
+ ...etc
15200
15269
  }
15201
15270
  });
15202
15271
  }
@@ -15227,13 +15296,6 @@ const _sfc_main$10 = {
15227
15296
  }
15228
15297
  }
15229
15298
  e.target.addEventListener("pointermove", detectMove, { passive: true });
15230
- e.target.addEventListener("pointerup", function(ev) {
15231
- e.target.removeEventListener("pointermove", detectMove);
15232
- if (!pointerMoved) {
15233
- let position2 = getPosition(ev);
15234
- emit("singleclick", new PointerEvent("singleclick", ev), position2);
15235
- }
15236
- }, { once: true });
15237
15299
  let act = __props.action.find((a) => a.action == "move");
15238
15300
  if (!act) return;
15239
15301
  e.preventDefault();
@@ -15392,19 +15454,21 @@ const _sfc_main$10 = {
15392
15454
  pointerleave(e) {
15393
15455
  emit("pointerleave", e, getPosition(e));
15394
15456
  },
15395
- dblclick(e) {
15396
- emit("dblclick", e, getPosition(e));
15397
- },
15398
15457
  click(e) {
15399
15458
  emit("click", e, getPosition(e));
15400
15459
  },
15460
+ singleclick(e) {
15461
+ emit("singleclick", e, getPosition(e));
15462
+ },
15463
+ dblclick(e) {
15464
+ emit("dblclick", e, getPosition(e));
15465
+ },
15401
15466
  contextmenu(e) {
15402
15467
  emit("contextmenu", e, getPosition(e));
15403
15468
  },
15404
15469
  pointermove(e) {
15405
15470
  emit("pointermove", e, getPosition(e));
15406
15471
  },
15407
- pointerdown: axisMovePointerdown,
15408
15472
  wheel: axisWheel
15409
15473
  };
15410
15474
  return (_ctx, _cache) => {
@@ -15412,13 +15476,14 @@ const _sfc_main$10 = {
15412
15476
  transform: transform.value,
15413
15477
  style: normalizeStyle({ transition: __props.transition })
15414
15478
  }, [
15415
- createElementVNode("line", mergeProps({
15479
+ axisLine.value.stroke != null ? (openBlock(), createElementBlock("line", mergeProps({
15480
+ key: 0,
15416
15481
  ref: "i",
15417
15482
  x1: 0,
15418
15483
  x2: 0,
15419
15484
  y1: 0,
15420
15485
  y2: height.value
15421
- }, axisLine.value), null, 16, _hoisted_2$5),
15486
+ }, axisLine.value), null, 16, _hoisted_2$5)) : createCommentVNode("", true),
15422
15487
  _cache[1] || (_cache[1] = createTextVNode()),
15423
15488
  (openBlock(true), createElementBlock(Fragment, null, renderList(tickLines.value, (tick) => {
15424
15489
  return openBlock(), createElementBlock("line", mergeProps({ ref_for: true }, tick), null, 16);
@@ -15426,13 +15491,7 @@ const _sfc_main$10 = {
15426
15491
  _cache[2] || (_cache[2] = createTextVNode()),
15427
15492
  (openBlock(true), createElementBlock(Fragment, null, renderList(tickTexts.value, (tick) => {
15428
15493
  return openBlock(), createElementBlock("g", mergeProps({ ref_for: true }, tick.wrapper), [
15429
- __props.theme.label_type == "markdown" ? (openBlock(), createBlock(_sfc_main$12, mergeProps({
15430
- key: 0,
15431
- ref_for: true
15432
- }, tick.text), null, 16)) : (openBlock(), createBlock(_sfc_main$13, mergeProps({
15433
- key: 1,
15434
- ref_for: true
15435
- }, tick.text), null, 16))
15494
+ createVNode(_sfc_main$13, mergeProps({ ref_for: true }, tick.text, { getPosition }), null, 16)
15436
15495
  ], 16);
15437
15496
  }), 256)),
15438
15497
  _cache[3] || (_cache[3] = createTextVNode()),
@@ -15442,37 +15501,36 @@ const _sfc_main$10 = {
15442
15501
  height: height.value,
15443
15502
  x: -5
15444
15503
  }, toHandlers(axisVOn, true), {
15504
+ onPointerdown: axisMovePointerdown,
15445
15505
  cursor: __props.action.some?.((a) => a.action == "move") ? "grab" : null
15446
15506
  }), null, 16, _hoisted_4$2)
15447
15507
  ]),
15448
15508
  _cache[4] || (_cache[4] = createTextVNode()),
15449
15509
  __props.action.some?.((a) => a.action == "rescale") ? (openBlock(), createElementBlock("g", _hoisted_5$1, [
15450
- createElementVNode("rect", {
15510
+ createElementVNode("rect", mergeProps({
15451
15511
  width: 10,
15452
15512
  height: 20,
15453
15513
  x: -5,
15454
- style: { "cursor": "ns-resize" },
15455
- onPointerdown: axisRescaleTopPointerdown
15456
- }, null, 32),
15514
+ style: { "cursor": "ns-resize" }
15515
+ }, toHandlers(axisVOn, true), { onPointerdown: axisRescaleTopPointerdown }), null, 16),
15457
15516
  _cache[0] || (_cache[0] = createTextVNode()),
15458
- createElementVNode("rect", {
15517
+ createElementVNode("rect", mergeProps({
15459
15518
  width: 10,
15460
15519
  height: 20,
15461
15520
  x: -5,
15462
15521
  y: height.value - 20,
15463
- style: { "cursor": "ns-resize" },
15464
- onPointerdown: axisRescaleBottomPointerdown
15465
- }, null, 40, _hoisted_6$1)
15522
+ style: { "cursor": "ns-resize" }
15523
+ }, toHandlers(axisVOn, true), { onPointerdown: axisRescaleBottomPointerdown }), null, 16, _hoisted_6$1)
15466
15524
  ])) : createCommentVNode("", true),
15467
15525
  _cache[5] || (_cache[5] = createTextVNode()),
15468
- axisTitle.value.text ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
15469
- __props.theme.title_type == "markdown" ? (openBlock(), createBlock(_sfc_main$12, normalizeProps(mergeProps({ key: 0 }, axisTitle.value)), null, 16)) : (openBlock(), createBlock(_sfc_main$13, normalizeProps(mergeProps({ key: 1 }, axisTitle.value)), null, 16))
15526
+ axisTitle.value.text ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
15527
+ __props.theme.title_type == "markdown" ? (openBlock(), createBlock(_sfc_main$14, normalizeProps(mergeProps({ key: 0 }, axisTitle.value)), null, 16)) : (openBlock(), createBlock(_sfc_main$15, normalizeProps(mergeProps({ key: 1 }, axisTitle.value)), null, 16))
15470
15528
  ], 64)) : createCommentVNode("", true)
15471
15529
  ], 12, _hoisted_1$b);
15472
15530
  };
15473
15531
  }
15474
15532
  };
15475
- const _sfc_main$$ = {
15533
+ const _sfc_main$10 = {
15476
15534
  __name: "CoreAxis",
15477
15535
  props: {
15478
15536
  theme: { type: Object, default: () => ({}) },
@@ -15481,8 +15539,8 @@ const _sfc_main$$ = {
15481
15539
  },
15482
15540
  setup(__props) {
15483
15541
  const axis = {
15484
- h: _sfc_main$11,
15485
- v: _sfc_main$10
15542
+ h: _sfc_main$12,
15543
+ v: _sfc_main$11
15486
15544
  };
15487
15545
  return (_ctx, _cache) => {
15488
15546
  return __props.position != "none" ? (openBlock(), createBlock(resolveDynamicComponent(axis[__props.orientation]), {
@@ -15493,15 +15551,13 @@ const _sfc_main$$ = {
15493
15551
  };
15494
15552
  }
15495
15553
  };
15496
- const _sfc_main$_ = {
15554
+ const _sfc_main$$ = {
15497
15555
  __name: "CoreGridH",
15498
15556
  props: {
15499
- majorBreaks: { type: Array, default: () => [] },
15500
- minorBreaks: { type: Array, default: () => [] },
15557
+ breaks: { type: Array, default: () => [] },
15501
15558
  coord2pos: Function,
15502
15559
  pos2coord: Function,
15503
15560
  layout: Object,
15504
- theme: { type: Object, default: () => ({}) },
15505
15561
  action: { type: Object, default: () => ({}) },
15506
15562
  activeTransform: Object,
15507
15563
  transition: String
@@ -15511,20 +15567,21 @@ const _sfc_main$_ = {
15511
15567
  const height = computed(() => __props.layout.height + __props.layout.t + __props.layout.b);
15512
15568
  const majorLines = computed(() => {
15513
15569
  let result = [];
15514
- for (let line2 of __props.majorBreaks) {
15515
- let pos = __props.coord2pos({ v: line2.position }).v;
15570
+ for (let b of __props.breaks) {
15571
+ if (b.type != "major") continue;
15572
+ let pos = __props.coord2pos({ v: b.value }).v;
15516
15573
  if (isNaN(pos)) continue;
15517
15574
  let tsl = pos * (__props.activeTransform.scaleV - 1) + __props.activeTransform.translateV;
15518
- let position = pos + __props.layout.t;
15519
- if (position + tsl < 0 || position + tsl > height.value) continue;
15575
+ pos += __props.layout.t;
15576
+ if (pos + tsl < 0 || pos + tsl > height.value) continue;
15520
15577
  result.push({
15521
- key: "major-" + line2.position,
15578
+ key: "major-" + b.value,
15522
15579
  x1: 0,
15523
15580
  x2: width.value,
15524
- y1: position,
15525
- y2: position,
15526
- "stroke": line2.color ?? __props.theme.line_color_major,
15527
- "stroke-width": line2.width ?? __props.theme.line_width_major ?? 0,
15581
+ y1: pos,
15582
+ y2: pos,
15583
+ "stroke": b.theme.grid_color_major,
15584
+ "stroke-width": b.theme.grid_width_major ?? 0,
15528
15585
  transform: tsl ? `translate(0,${tsl})` : null,
15529
15586
  style: { transition: __props.transition }
15530
15587
  });
@@ -15533,21 +15590,21 @@ const _sfc_main$_ = {
15533
15590
  });
15534
15591
  const minorLines = computed(() => {
15535
15592
  let result = [];
15536
- for (let line2 of __props.minorBreaks) {
15537
- if (__props.majorBreaks.some((ml) => ml.position == line2.position)) continue;
15538
- let pos = __props.coord2pos({ v: line2.position }).v;
15593
+ for (let b of __props.breaks) {
15594
+ if (b.type != "minor") continue;
15595
+ let pos = __props.coord2pos({ v: b.value }).v;
15539
15596
  if (isNaN(pos)) continue;
15540
15597
  let tsl = pos * (__props.activeTransform.scaleV - 1) + __props.activeTransform.translateV;
15541
- let position = pos + __props.layout.t;
15542
- if (position + tsl < 0 || position + tsl > height.value) continue;
15598
+ pos += __props.layout.t;
15599
+ if (pos + tsl < 0 || pos + tsl > height.value) continue;
15543
15600
  result.push({
15544
- key: "minor-" + line2.position,
15601
+ key: "minor-" + b.value,
15545
15602
  x1: 0,
15546
15603
  x2: width.value,
15547
- y1: position,
15548
- y2: position,
15549
- "stroke": line2.color ?? __props.theme.line_color_minor,
15550
- "stroke-width": line2.width ?? __props.theme.line_width_minor ?? 0,
15604
+ y1: pos,
15605
+ y2: pos,
15606
+ "stroke": b.theme.grid_color_minor,
15607
+ "stroke-width": b.theme.grid_width_minor ?? 0,
15551
15608
  transform: tsl ? `translate(0,${tsl})` : null,
15552
15609
  style: { transition: __props.transition }
15553
15610
  });
@@ -15566,15 +15623,13 @@ const _sfc_main$_ = {
15566
15623
  };
15567
15624
  }
15568
15625
  };
15569
- const _sfc_main$Z = {
15626
+ const _sfc_main$_ = {
15570
15627
  __name: "CoreGridV",
15571
15628
  props: {
15572
- majorBreaks: { type: Array, default: () => [] },
15573
- minorBreaks: { type: Array, default: () => [] },
15629
+ breaks: { type: Array, default: () => [] },
15574
15630
  coord2pos: Function,
15575
15631
  pos2coord: Function,
15576
15632
  layout: Object,
15577
- theme: { type: Object, default: () => ({}) },
15578
15633
  action: { type: Object, default: () => ({}) },
15579
15634
  activeTransform: Object,
15580
15635
  transition: String
@@ -15584,20 +15639,21 @@ const _sfc_main$Z = {
15584
15639
  const height = computed(() => __props.layout.height + __props.layout.t + __props.layout.b);
15585
15640
  const majorLines = computed(() => {
15586
15641
  let result = [];
15587
- for (let line2 of __props.majorBreaks) {
15588
- let pos = __props.coord2pos({ h: line2.position }).h;
15642
+ for (let b of __props.breaks) {
15643
+ if (b.type != "major") continue;
15644
+ let pos = __props.coord2pos({ h: b.value }).h;
15589
15645
  if (isNaN(pos)) continue;
15590
15646
  let tsl = pos * (__props.activeTransform.scaleH - 1) + __props.activeTransform.translateH;
15591
- let position = pos + __props.layout.l;
15592
- if (position + tsl < 0 || position + tsl > width.value) continue;
15647
+ pos += __props.layout.l;
15648
+ if (pos + tsl < 0 || pos + tsl > width.value) continue;
15593
15649
  result.push({
15594
- key: "major-" + line2.position,
15650
+ key: "major-" + b.value,
15595
15651
  y1: 0,
15596
15652
  y2: height.value,
15597
- x1: position,
15598
- x2: position,
15599
- "stroke": line2.color ?? __props.theme.line_color_major,
15600
- "stroke-width": line2.width ?? __props.theme.line_width_major ?? 0,
15653
+ x1: pos,
15654
+ x2: pos,
15655
+ "stroke": b.theme.grid_color_major,
15656
+ "stroke-width": b.theme.grid_width_major ?? 0,
15601
15657
  transform: tsl ? `translate(${tsl},0)` : null,
15602
15658
  style: { transition: __props.transition }
15603
15659
  });
@@ -15606,21 +15662,21 @@ const _sfc_main$Z = {
15606
15662
  });
15607
15663
  const minorLines = computed(() => {
15608
15664
  let result = [];
15609
- for (let line2 of __props.minorBreaks) {
15610
- if (__props.majorBreaks.some((ml) => ml.position == line2.position)) continue;
15611
- let pos = __props.coord2pos({ h: line2.position }).h;
15665
+ for (let b of __props.breaks) {
15666
+ if (b.type != "minor") continue;
15667
+ let pos = __props.coord2pos({ h: b.value }).h;
15612
15668
  if (isNaN(pos)) continue;
15613
15669
  let tsl = pos * (__props.activeTransform.scaleH - 1) + __props.activeTransform.translateH;
15614
- let position = pos + __props.layout.l;
15615
- if (position + tsl < 0 || position + tsl > width.value) continue;
15670
+ pos += __props.layout.l;
15671
+ if (pos + tsl < 0 || pos + tsl > width.value) continue;
15616
15672
  result.push({
15617
- key: "minor-" + line2.position,
15673
+ key: "minor-" + b.value,
15618
15674
  y1: 0,
15619
15675
  y2: height.value,
15620
- x1: position,
15621
- x2: position,
15622
- "stroke": line2.color ?? __props.theme.line_color_minor,
15623
- "stroke-width": line2.width ?? __props.theme.line_width_minor ?? 0,
15676
+ x1: pos,
15677
+ x2: pos,
15678
+ "stroke": b.theme.grid_color_minor,
15679
+ "stroke-width": b.theme.grid_width_minor ?? 0,
15624
15680
  transform: tsl ? `translate(${tsl},0)` : null,
15625
15681
  style: { transition: __props.transition }
15626
15682
  });
@@ -15639,7 +15695,7 @@ const _sfc_main$Z = {
15639
15695
  };
15640
15696
  }
15641
15697
  };
15642
- const _sfc_main$Y = {
15698
+ const _sfc_main$Z = {
15643
15699
  __name: "CoreCanvasBoxplot",
15644
15700
  props: {
15645
15701
  extendX: { type: Number, default: 0 },
@@ -15786,7 +15842,7 @@ const _sfc_main$Y = {
15786
15842
  };
15787
15843
  }
15788
15844
  };
15789
- const _sfc_main$X = {
15845
+ const _sfc_main$Y = {
15790
15846
  __name: "CoreCanvasCurve",
15791
15847
  props: {
15792
15848
  extendX: { type: Number, default: 0 },
@@ -15892,7 +15948,7 @@ const _sfc_main$X = {
15892
15948
  };
15893
15949
  }
15894
15950
  };
15895
- const _sfc_main$W = {
15951
+ const _sfc_main$X = {
15896
15952
  __name: "CoreCanvasEllipse",
15897
15953
  props: {
15898
15954
  extendX: { type: Number, default: 0 },
@@ -15944,14 +16000,14 @@ const _sfc_main$W = {
15944
16000
  } of group) {
15945
16001
  let dx = Math.sqrt(C / (A * C - B * B)), dy = Math.sqrt(A / (A * C - B * B));
15946
16002
  const { h: ch, v: cv } = __props.coord2pos({ x: cx, y: cy });
15947
- let { hmin, hmax, vmin, vmax } = __props.coord2pos({ xmin: cx - dx, xmax: cx + dx, ymin: cy - dy, ymax: cy + dy });
15948
- let scaleX = (hmax - hmin) / (2 * dx), scaleY = (vmax - vmin) / (2 * dy);
16003
+ let { h: h1, v: v1 } = __props.coord2pos({ x: cx - dx, y: cy - dy }), { h: h2, v: v2 } = __props.coord2pos({ x: cx + dx, y: cy + dy });
16004
+ let scaleX = (h2 - h1) / (2 * dx), scaleY = (v2 - v1) / (2 * dy);
15949
16005
  A /= scaleX * scaleX;
15950
16006
  B /= scaleX * scaleY;
15951
16007
  C /= scaleY * scaleY;
15952
16008
  const tr = A + C, det = A * C - B * B;
15953
16009
  const disc = Math.sqrt(Math.max(0, tr * tr / 4 - det));
15954
- let rx2 = 1 / Math.sqrt(tr / 2 + disc), ry = 1 / Math.sqrt(tr / 2 - disc), angle2 = -Math.atan2(2 * B, A - C) / 2;
16010
+ let rx2 = 1 / Math.sqrt(tr / 2 + disc), ry = 1 / Math.sqrt(tr / 2 - disc), angle2 = Math.atan2(2 * B, A - C) / 2;
15955
16011
  const path2d = new Path2D();
15956
16012
  path2d.ellipse(ch + translateX, cv + translateY, rx2, ry, angle2, 0, 2 * Math.PI);
15957
16013
  _path_data.set(path2d, $raw);
@@ -15997,7 +16053,7 @@ const _sfc_main$W = {
15997
16053
  };
15998
16054
  }
15999
16055
  };
16000
- const _sfc_main$V = {
16056
+ const _sfc_main$W = {
16001
16057
  __name: "CoreCanvasLine",
16002
16058
  props: {
16003
16059
  extendX: { type: Number, default: 0 },
@@ -16090,7 +16146,7 @@ const _sfc_main$V = {
16090
16146
  };
16091
16147
  }
16092
16148
  };
16093
- const _sfc_main$U = {
16149
+ const _sfc_main$V = {
16094
16150
  __name: "CoreCanvasPoint",
16095
16151
  props: {
16096
16152
  extendX: { type: Number, default: 0 },
@@ -16110,7 +16166,8 @@ const _sfc_main$U = {
16110
16166
  diamond: (s) => `M0-${s * 0.707}L${s * 0.707},0L0,${s * 0.707}L-${s * 0.707},0Z`,
16111
16167
  square: (s) => `M-${s / 2}-${s / 2}H${s / 2}V${s / 2}H-${s / 2}Z`,
16112
16168
  plus: (s) => `M-${s / 10}-${s / 2}V-${s / 10}H-${s / 2}V${s / 10}H-${s / 10}V${s / 2}H${s / 10}V${s / 10}H${s / 2}V-${s / 10}H${s / 10}V-${s / 2}H-${s / 10}Z`,
16113
- corss: (s) => `M-${s * 0.283}-${s * 0.424}L-${s * 0.424}-${s * 0.283}L-${s * 0.141},0L-${s * 0.424},${s * 0.283}L-${s * 0.283},${s * 0.424}L0,${s * 0.141}L${s * 0.283},${s * 0.424}L${s * 0.424},${s * 0.283}L${s * 0.141},0L${s * 0.424},-${s * 0.283}L${s * 0.283},-${s * 0.424}L0,-${s * 0.141}Z`
16169
+ cross: (s) => `M-${s * 0.283}-${s * 0.424}L-${s * 0.424}-${s * 0.283}L-${s * 0.141},0L-${s * 0.424},${s * 0.283}L-${s * 0.283},${s * 0.424}L0,${s * 0.141}L${s * 0.283},${s * 0.424}L${s * 0.424},${s * 0.283}L${s * 0.141},0L${s * 0.424},-${s * 0.283}L${s * 0.283},-${s * 0.424}L0,-${s * 0.141}Z`,
16170
+ arrowhead: (s) => `M0,0L${s},${-s * 0.38}V${s * 0.38}Z`
16114
16171
  };
16115
16172
  const vBind = computed(() => ({
16116
16173
  width: __props.layout.fullWidth * (1 + __props.extendX * 2),
@@ -16144,19 +16201,25 @@ const _sfc_main$U = {
16144
16201
  alpha: alpha2,
16145
16202
  "translate-x": translateX = 0,
16146
16203
  "translate-y": translateY = 0,
16204
+ angle: angle2 = 0,
16147
16205
  $raw
16148
16206
  } of group) {
16149
16207
  const { h: cx, v: cy } = __props.coord2pos({ x: x2, y: y2 });
16208
+ if (typeof angle2 == "object") {
16209
+ let { dx = 0, dy = 0 } = angle2;
16210
+ let { h, v } = __props.coord2pos({ x: x2 + dx, y: y2 + dy });
16211
+ angle2 = Math.atan2(v - cy, h - cx) * 180 / Math.PI;
16212
+ }
16150
16213
  const path2d = new Path2D();
16151
16214
  if (String(shape).startsWith("path:")) {
16152
16215
  path2d.addPath(
16153
16216
  new Path2D(shape.slice(5)),
16154
- new DOMMatrix().translateSelf(cx + translateX, cy + translateY)
16217
+ new DOMMatrix().translateSelf(cx + translateX, cy + translateY).rotate(angle2)
16155
16218
  );
16156
16219
  } else if (shape in paths) {
16157
16220
  path2d.addPath(
16158
16221
  new Path2D(paths[shape](size)),
16159
- new DOMMatrix().translate(cx + translateX, cy + translateY)
16222
+ new DOMMatrix().translate(cx + translateX, cy + translateY).rotate(angle2)
16160
16223
  );
16161
16224
  } else {
16162
16225
  path2d.arc(cx + translateX, cy + translateY, size / 2, 0, Math.PI * 2);
@@ -16205,7 +16268,7 @@ const _sfc_main$U = {
16205
16268
  };
16206
16269
  }
16207
16270
  };
16208
- const _sfc_main$T = {
16271
+ const _sfc_main$U = {
16209
16272
  __name: "CoreCanvasPolygon",
16210
16273
  props: {
16211
16274
  extendX: { type: Number, default: 0 },
@@ -16302,7 +16365,7 @@ const _sfc_main$T = {
16302
16365
  };
16303
16366
  }
16304
16367
  };
16305
- const _sfc_main$S = {
16368
+ const _sfc_main$T = {
16306
16369
  __name: "CoreCanvasRect",
16307
16370
  props: {
16308
16371
  extendX: { type: Number, default: 0 },
@@ -16397,7 +16460,7 @@ const _sfc_main$S = {
16397
16460
  };
16398
16461
  }
16399
16462
  };
16400
- const _sfc_main$R = {
16463
+ const _sfc_main$S = {
16401
16464
  __name: "CoreCanvasText",
16402
16465
  props: {
16403
16466
  extendX: { type: Number, default: 0 },
@@ -16471,6 +16534,11 @@ const _sfc_main$R = {
16471
16534
  } else if (textLength != null) {
16472
16535
  width = textLength;
16473
16536
  }
16537
+ if (typeof angle2 == "object") {
16538
+ let { dx = 0, dy = 0 } = angle2;
16539
+ let { h, v } = __props.coord2pos({ x: x2 + dx, y: y2 + dy });
16540
+ angle2 = Math.atan2(v - ty, h - tx) * 180 / Math.PI;
16541
+ }
16474
16542
  if (dockX != null || dockY != null) {
16475
16543
  let alnX = { left: 0, center: 0.5, right: 1 }[dockX] ?? +(dockX ?? 0.5), alnY = { bottom: 0, center: 0.5, top: 1 }[dockY] ?? +(dockY ?? 0.5);
16476
16544
  if (isNaN(alnX)) alnX = 0.5;
@@ -16527,7 +16595,7 @@ const _sfc_main$R = {
16527
16595
  };
16528
16596
  }
16529
16597
  };
16530
- const _sfc_main$Q = {
16598
+ const _sfc_main$R = {
16531
16599
  __name: "CoreCanvasTextsegment",
16532
16600
  props: {
16533
16601
  extendX: { type: Number, default: 0 },
@@ -16701,19 +16769,19 @@ const _sfc_main$Q = {
16701
16769
  };
16702
16770
  const canvas = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
16703
16771
  __proto__: null,
16704
- boxplot: _sfc_main$Y,
16705
- curve: _sfc_main$X,
16706
- ellipse: _sfc_main$W,
16707
- line: _sfc_main$V,
16708
- point: _sfc_main$U,
16709
- polygon: _sfc_main$T,
16710
- rect: _sfc_main$S,
16711
- stick: _sfc_main$V,
16712
- text: _sfc_main$R,
16713
- textsegment: _sfc_main$Q,
16714
- tile: _sfc_main$S
16772
+ boxplot: _sfc_main$Z,
16773
+ curve: _sfc_main$Y,
16774
+ ellipse: _sfc_main$X,
16775
+ line: _sfc_main$W,
16776
+ point: _sfc_main$V,
16777
+ polygon: _sfc_main$U,
16778
+ rect: _sfc_main$T,
16779
+ stick: _sfc_main$W,
16780
+ text: _sfc_main$S,
16781
+ textsegment: _sfc_main$R,
16782
+ tile: _sfc_main$T
16715
16783
  }, Symbol.toStringTag, { value: "Module" }));
16716
- const _sfc_main$P = {
16784
+ const _sfc_main$Q = {
16717
16785
  __name: "CoreSvgBlank",
16718
16786
  props: {
16719
16787
  extendX: { type: Number, default: 0 },
@@ -16733,7 +16801,7 @@ const _sfc_main$P = {
16733
16801
  }
16734
16802
  };
16735
16803
  const _hoisted_1$a = { key: 0 };
16736
- const _sfc_main$O = {
16804
+ const _sfc_main$P = {
16737
16805
  __name: "CoreTile",
16738
16806
  props: {
16739
16807
  x: { type: Number, default: 0 },
@@ -16775,7 +16843,7 @@ const _sfc_main$O = {
16775
16843
  };
16776
16844
  const _hoisted_1$9 = { key: 0 };
16777
16845
  const _hoisted_2$4 = { key: 0 };
16778
- const _sfc_main$N = {
16846
+ const _sfc_main$O = {
16779
16847
  __name: "CorePoint",
16780
16848
  props: {
16781
16849
  x: { type: Number, default: 0 },
@@ -16784,7 +16852,7 @@ const _sfc_main$N = {
16784
16852
  size: { type: Number, default: 6 },
16785
16853
  color: String,
16786
16854
  stroke: String,
16787
- linewidth: Number,
16855
+ linewidth: { type: Number, default: 1 },
16788
16856
  linetype: String,
16789
16857
  alpha: { type: Number, default: 1 },
16790
16858
  title: String,
@@ -16799,7 +16867,8 @@ const _sfc_main$N = {
16799
16867
  triangle: "M0-0.667L0.577,0.333L-0.577,0.333Z",
16800
16868
  diamond: "M0-0.707L0.707,0L0,0.707L-0.707,0Z",
16801
16869
  plus: "M-0.1-0.5V-0.1H-0.5V0.1H-0.1V0.5H0.1V0.1H0.5V-0.1H0.1V-0.5H-0.1Z",
16802
- 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"
16870
+ 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",
16871
+ arrowhead: "M0,0L1,0.38V-0.38Z"
16803
16872
  };
16804
16873
  const binds = computed(() => {
16805
16874
  let d = __props.shape?.startsWith?.("path:") ? __props.shape?.slice?.(5) : paths[__props.shape];
@@ -16808,7 +16877,6 @@ const _sfc_main$N = {
16808
16877
  fill: __props.color || null,
16809
16878
  "fill-opacity": __props.alpha == 1 ? null : __props.alpha,
16810
16879
  stroke: __props.stroke || null,
16811
- "stroke-width": __props.linewidth,
16812
16880
  "stroke-opacity": __props.alpha == 1 ? null : __props.alpha,
16813
16881
  "stroke-dasharray": parseLinetype(__props.linetype).join(" ") || null
16814
16882
  };
@@ -16817,10 +16885,10 @@ const _sfc_main$N = {
16817
16885
  if (tslX !== 0 || tslY !== 0) transform.push(`translate(${tslX},${tslY})`);
16818
16886
  if (__props.size != 1) transform.push(`scale(${__props.size})`);
16819
16887
  if (__props.angle) transform.push(`rotate(${__props.angle})`);
16820
- Object.assign(result, { d, transform: transform.join(" ") || null });
16888
+ Object.assign(result, { d, transform: transform.join(" ") || null, "stroke-width": __props.linewidth / __props.size });
16821
16889
  } else {
16822
16890
  let transform = __props.translateX || __props.translateY ? `translate(${__props.translateX}, ${__props.translateY})` : null;
16823
- Object.assign(result, { cx: __props.x, cy: __props.y, r: __props.size / 2, transform });
16891
+ Object.assign(result, { cx: __props.x, cy: __props.y, r: __props.size / 2, transform, "stroke-width": __props.linewidth });
16824
16892
  }
16825
16893
  return result;
16826
16894
  });
@@ -16834,7 +16902,7 @@ const _sfc_main$N = {
16834
16902
  }
16835
16903
  };
16836
16904
  const _hoisted_1$8 = { key: 0 };
16837
- const _sfc_main$M = {
16905
+ const _sfc_main$N = {
16838
16906
  __name: "CoreLine",
16839
16907
  props: {
16840
16908
  x1: { type: Number, default: 0 },
@@ -16872,7 +16940,7 @@ const _sfc_main$M = {
16872
16940
  };
16873
16941
  }
16874
16942
  };
16875
- const _sfc_main$L = {
16943
+ const _sfc_main$M = {
16876
16944
  __name: "CoreSvgBoxplot",
16877
16945
  props: {
16878
16946
  extendX: { type: Number, default: 0 },
@@ -17035,18 +17103,18 @@ const _sfc_main$L = {
17035
17103
  return openBlock(), createElementBlock("g", mergeProps({ ref_for: true }, { class: __props.groupClass, style: __props.groupStyle }), [
17036
17104
  (openBlock(true), createElementBlock(Fragment, null, renderList(group, ([vbinds, von]) => {
17037
17105
  return openBlock(), createElementBlock("g", null, [
17038
- createVNode(_sfc_main$M, mergeProps({ ref_for: true }, vbinds.line), null, 16),
17106
+ createVNode(_sfc_main$N, mergeProps({ ref_for: true }, vbinds.line), null, 16),
17039
17107
  _cache[0] || (_cache[0] = createTextVNode()),
17040
- createVNode(_sfc_main$O, mergeProps({ ref_for: true }, vbinds.rect, toHandlers(von)), null, 16),
17108
+ createVNode(_sfc_main$P, mergeProps({ ref_for: true }, vbinds.rect, toHandlers(von)), null, 16),
17041
17109
  _cache[1] || (_cache[1] = createTextVNode()),
17042
- createVNode(_sfc_main$M, mergeProps({ ref_for: true }, vbinds.midline), null, 16),
17110
+ createVNode(_sfc_main$N, mergeProps({ ref_for: true }, vbinds.midline), null, 16),
17043
17111
  _cache[2] || (_cache[2] = createTextVNode()),
17044
- createVNode(_sfc_main$M, mergeProps({ ref_for: true }, vbinds.uwisker), null, 16),
17112
+ createVNode(_sfc_main$N, mergeProps({ ref_for: true }, vbinds.uwisker), null, 16),
17045
17113
  _cache[3] || (_cache[3] = createTextVNode()),
17046
- createVNode(_sfc_main$M, mergeProps({ ref_for: true }, vbinds.lwisker), null, 16),
17114
+ createVNode(_sfc_main$N, mergeProps({ ref_for: true }, vbinds.lwisker), null, 16),
17047
17115
  _cache[4] || (_cache[4] = createTextVNode()),
17048
17116
  (openBlock(true), createElementBlock(Fragment, null, renderList(vbinds.outliers, ([vbind, von2]) => {
17049
- return openBlock(), createBlock(_sfc_main$N, mergeProps({ ref_for: true }, vbind, toHandlers(von2)), null, 16);
17117
+ return openBlock(), createBlock(_sfc_main$O, mergeProps({ ref_for: true }, vbind, toHandlers(von2)), null, 16);
17050
17118
  }), 256))
17051
17119
  ]);
17052
17120
  }), 256))
@@ -17057,7 +17125,7 @@ const _sfc_main$L = {
17057
17125
  }
17058
17126
  };
17059
17127
  const _hoisted_1$7 = { key: 0 };
17060
- const _sfc_main$K = {
17128
+ const _sfc_main$L = {
17061
17129
  __name: "CoreCurve",
17062
17130
  props: {
17063
17131
  points: { type: Array, default: () => [] },
@@ -17100,7 +17168,7 @@ const _sfc_main$K = {
17100
17168
  };
17101
17169
  }
17102
17170
  };
17103
- const _sfc_main$J = {
17171
+ const _sfc_main$K = {
17104
17172
  __name: "CoreSvgCurve",
17105
17173
  props: {
17106
17174
  extendX: { type: Number, default: 0 },
@@ -17128,6 +17196,8 @@ const _sfc_main$J = {
17128
17196
  title,
17129
17197
  "translate-x": translateX = 0,
17130
17198
  "translate-y": translateY = 0,
17199
+ "marker-start": markerStart,
17200
+ "marker-end": markerEnd,
17131
17201
  class: className,
17132
17202
  style,
17133
17203
  $raw,
@@ -17145,6 +17215,8 @@ const _sfc_main$J = {
17145
17215
  title,
17146
17216
  translateX,
17147
17217
  translateY,
17218
+ "marker-start": markerStart,
17219
+ "marker-end": markerEnd,
17148
17220
  class: className,
17149
17221
  style,
17150
17222
  interpolate: interpolate2
@@ -17160,7 +17232,7 @@ const _sfc_main$J = {
17160
17232
  (openBlock(true), createElementBlock(Fragment, null, renderList(binds.value, (group) => {
17161
17233
  return openBlock(), createElementBlock("g", mergeProps({ ref_for: true }, { class: __props.groupClass, style: __props.groupStyle }), [
17162
17234
  (openBlock(true), createElementBlock(Fragment, null, renderList(group, ([vbind, von]) => {
17163
- return openBlock(), createBlock(_sfc_main$K, mergeProps({ ref_for: true }, vbind, toHandlers(von)), null, 16);
17235
+ return openBlock(), createBlock(_sfc_main$L, mergeProps({ ref_for: true }, vbind, toHandlers(von)), null, 16);
17164
17236
  }), 256))
17165
17237
  ], 16);
17166
17238
  }), 256))
@@ -17169,7 +17241,7 @@ const _sfc_main$J = {
17169
17241
  }
17170
17242
  };
17171
17243
  const _hoisted_1$6 = { key: 0 };
17172
- const _sfc_main$I = {
17244
+ const _sfc_main$J = {
17173
17245
  __name: "CoreEllipse",
17174
17246
  props: {
17175
17247
  cx: { type: Number, default: 0 },
@@ -17214,7 +17286,7 @@ const _sfc_main$I = {
17214
17286
  };
17215
17287
  }
17216
17288
  };
17217
- const _sfc_main$H = {
17289
+ const _sfc_main$I = {
17218
17290
  __name: "CoreSvgEllipse",
17219
17291
  props: {
17220
17292
  extendX: { type: Number, default: 0 },
@@ -17252,9 +17324,9 @@ const _sfc_main$H = {
17252
17324
  }) => {
17253
17325
  let dx = Math.sqrt(C / (A * C - B * B)), dy = Math.sqrt(A / (A * C - B * B));
17254
17326
  const { h: ch, v: cv } = __props.coord2pos({ x: cx, y: cy });
17255
- let { hmin, hmax, vmin, vmax } = __props.coord2pos({ xmin: cx - dx, xmax: cx + dx, ymin: cy - dy, ymax: cy + dy });
17256
- if (hmax < xlim_min || hmin > xlim_max || vmax < ylim_min || vmin > ylim_max) return null;
17257
- let scaleX = (hmax - hmin) / (2 * dx), scaleY = (vmax - vmin) / (2 * dy);
17327
+ let { h: h1, v: v1 } = __props.coord2pos({ x: cx - dx, y: cy - dy }), { h: h2, v: v2 } = __props.coord2pos({ x: cx + dx, y: cy + dy });
17328
+ if (h1 < xlim_min && h2 < xlim_min || h2 > xlim_max && h1 > xlim_max || v1 < ylim_min && v2 < ylim_min || v2 > ylim_max && v1 > ylim_max) return null;
17329
+ let scaleX = (h2 - h1) / (2 * dx), scaleY = (v2 - v1) / (2 * dy);
17258
17330
  A /= scaleX * scaleX;
17259
17331
  B /= scaleX * scaleY;
17260
17332
  C /= scaleY * scaleY;
@@ -17265,7 +17337,7 @@ const _sfc_main$H = {
17265
17337
  cy: cv,
17266
17338
  rx: 1 / Math.sqrt(tr / 2 + disc) || 0,
17267
17339
  ry: 1 / Math.sqrt(tr / 2 - disc) || 0,
17268
- angle: -Math.atan2(2 * B, A - C) / 2 * 180 / Math.PI || 0,
17340
+ angle: Math.atan2(2 * B, A - C) / 2 * 180 / Math.PI || 0,
17269
17341
  fill,
17270
17342
  color: color2,
17271
17343
  linetype,
@@ -17288,7 +17360,7 @@ const _sfc_main$H = {
17288
17360
  (openBlock(true), createElementBlock(Fragment, null, renderList(binds.value, (group) => {
17289
17361
  return openBlock(), createElementBlock("g", mergeProps({ ref_for: true }, { class: __props.groupClass, style: __props.groupStyle }), [
17290
17362
  (openBlock(true), createElementBlock(Fragment, null, renderList(group, ([vbind, von]) => {
17291
- return openBlock(), createBlock(_sfc_main$I, mergeProps({ ref_for: true }, vbind, toHandlers(von)), null, 16);
17363
+ return openBlock(), createBlock(_sfc_main$J, mergeProps({ ref_for: true }, vbind, toHandlers(von)), null, 16);
17292
17364
  }), 256))
17293
17365
  ], 16);
17294
17366
  }), 256))
@@ -17296,7 +17368,7 @@ const _sfc_main$H = {
17296
17368
  };
17297
17369
  }
17298
17370
  };
17299
- const _sfc_main$G = {
17371
+ const _sfc_main$H = {
17300
17372
  __name: "CoreSvgLine",
17301
17373
  props: {
17302
17374
  extendX: { type: Number, default: 0 },
@@ -17326,6 +17398,8 @@ const _sfc_main$G = {
17326
17398
  title,
17327
17399
  "translate-x": translateX = 0,
17328
17400
  "translate-y": translateY = 0,
17401
+ "marker-start": markerStart,
17402
+ "marker-end": markerEnd,
17329
17403
  class: className,
17330
17404
  style,
17331
17405
  $raw
@@ -17345,6 +17419,8 @@ const _sfc_main$G = {
17345
17419
  title,
17346
17420
  translateX,
17347
17421
  translateY,
17422
+ "marker-start": markerStart,
17423
+ "marker-end": markerEnd,
17348
17424
  class: className,
17349
17425
  style
17350
17426
  };
@@ -17359,7 +17435,7 @@ const _sfc_main$G = {
17359
17435
  (openBlock(true), createElementBlock(Fragment, null, renderList(binds.value, (group) => {
17360
17436
  return openBlock(), createElementBlock("g", mergeProps({ ref_for: true }, { class: __props.groupClass, style: __props.groupStyle }), [
17361
17437
  (openBlock(true), createElementBlock(Fragment, null, renderList(group, ([vbind, von]) => {
17362
- return openBlock(), createBlock(_sfc_main$M, mergeProps({ ref_for: true }, vbind, toHandlers(von)), null, 16);
17438
+ return openBlock(), createBlock(_sfc_main$N, mergeProps({ ref_for: true }, vbind, toHandlers(von)), null, 16);
17363
17439
  }), 256))
17364
17440
  ], 16);
17365
17441
  }), 256))
@@ -17367,7 +17443,7 @@ const _sfc_main$G = {
17367
17443
  };
17368
17444
  }
17369
17445
  };
17370
- const _sfc_main$F = {
17446
+ const _sfc_main$G = {
17371
17447
  __name: "CoreSvgMarkdown",
17372
17448
  props: {
17373
17449
  extendX: { type: Number, default: 0 },
@@ -17418,6 +17494,11 @@ const _sfc_main$F = {
17418
17494
  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 });
17419
17495
  textLength = Math.hypot(h1 - h2 || 0, v1 - v2 || 0);
17420
17496
  }
17497
+ if (typeof angle2 == "object") {
17498
+ let { dx = 0, dy = 0 } = angle2;
17499
+ let { h, v } = __props.coord2pos({ x: x2 + dx, y: y2 + dy });
17500
+ angle2 = Math.atan2(v - ty, h - tx) * 180 / Math.PI;
17501
+ }
17421
17502
  let vbind = {
17422
17503
  x: tx,
17423
17504
  y: ty,
@@ -17453,7 +17534,7 @@ const _sfc_main$F = {
17453
17534
  (openBlock(true), createElementBlock(Fragment, null, renderList(binds.value, (group) => {
17454
17535
  return openBlock(), createElementBlock("g", mergeProps({ ref_for: true }, { class: __props.groupClass, style: __props.groupStyle }), [
17455
17536
  (openBlock(true), createElementBlock(Fragment, null, renderList(group, ([vbind, von]) => {
17456
- return openBlock(), createBlock(_sfc_main$12, mergeProps({ ref_for: true }, vbind, toHandlers(von)), null, 16);
17537
+ return openBlock(), createBlock(_sfc_main$14, mergeProps({ ref_for: true }, vbind, toHandlers(von)), null, 16);
17457
17538
  }), 256))
17458
17539
  ], 16);
17459
17540
  }), 256))
@@ -17461,7 +17542,7 @@ const _sfc_main$F = {
17461
17542
  };
17462
17543
  }
17463
17544
  };
17464
- const _sfc_main$E = {
17545
+ const _sfc_main$F = {
17465
17546
  __name: "CoreSvgMarkdownsegment",
17466
17547
  props: {
17467
17548
  extendX: { type: Number, default: 0 },
@@ -17494,6 +17575,8 @@ const _sfc_main$E = {
17494
17575
  alpha: alpha2,
17495
17576
  "translate-x": translateX = 0,
17496
17577
  "translate-y": translateY = 0,
17578
+ "anchor-x": anchorX,
17579
+ "anchor-y": anchorY = 0.5,
17497
17580
  "font-family": fontFamily = "sans-serif",
17498
17581
  "text-align": textAlign = "start",
17499
17582
  inset = 0,
@@ -17507,140 +17590,72 @@ const _sfc_main$E = {
17507
17590
  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;
17508
17591
  let radian = Math.atan2(y22 - y1, x22 - x1);
17509
17592
  let vbind = {
17510
- color: color2 || null,
17511
- fill: color2 || null,
17512
- "fill-opacity": alpha2 == 1 ? null : alpha2,
17513
- "font-size": size * 4,
17514
- stroke: stroke || null,
17515
- "stroke-width": linewidth,
17516
- "stroke-dasharray": parseLinetype(linetype).join(" ") || null,
17517
- "stroke-opacity": alpha2 == 1 ? null : alpha2,
17518
- "font-family": fontFamily,
17593
+ text: String(label),
17594
+ title: String(title ?? label),
17595
+ color: color2,
17596
+ alpha: alpha2,
17597
+ size,
17598
+ stroke,
17599
+ linewidth,
17600
+ linetype,
17601
+ fontFamily,
17519
17602
  class: className,
17520
17603
  style
17521
17604
  };
17522
17605
  let von = Object.fromEntries(
17523
17606
  events.map((evt) => [evt, (e) => emit(evt, Object.assign(e, { _vhandled: true }), __props.getCoord(e), $raw)])
17524
17607
  );
17525
- let tx, ty, content = parseMarkdownInline(String(label));
17608
+ let tx, ty;
17526
17609
  switch (textAlign) {
17527
17610
  case "stretch":
17528
17611
  tx = (x1 + x22) / 2;
17529
17612
  ty = (y1 + y22) / 2;
17530
- vbind["text-anchor"] = "middle";
17613
+ anchorX = 0.5;
17531
17614
  vbind.textLength = Math.hypot(x22 - x1 || 0, y22 - y1 || 0);
17532
- vbind.lengthAdjust = "spacingAndGlyphs";
17533
17615
  break;
17534
17616
  case "center":
17535
17617
  tx = (x1 + x22) / 2;
17536
17618
  ty = (y1 + y22) / 2;
17537
- vbind["text-anchor"] = "middle";
17619
+ anchorX ??= 0.5;
17538
17620
  break;
17539
17621
  case "pre":
17540
17622
  tx = x1;
17541
17623
  ty = y1;
17542
17624
  translateX -= Math.cos(radian) * inset;
17543
17625
  translateY -= Math.sin(radian) * inset;
17544
- vbind["text-anchor"] = "end";
17626
+ anchorX ??= 1;
17545
17627
  break;
17546
17628
  case "end":
17547
17629
  tx = x22;
17548
17630
  ty = y22;
17549
17631
  translateX -= Math.cos(radian) * inset;
17550
17632
  translateY -= Math.sin(radian) * inset;
17551
- vbind["text-anchor"] = "end";
17633
+ anchorX ??= 1;
17552
17634
  break;
17553
17635
  case "post":
17554
17636
  tx = x22;
17555
17637
  ty = y22;
17556
17638
  translateX += Math.cos(radian) * inset;
17557
17639
  translateY += Math.sin(radian) * inset;
17558
- vbind["text-anchor"] = "start";
17640
+ anchorX ??= 0;
17559
17641
  break;
17560
17642
  default:
17561
17643
  tx = x1;
17562
17644
  ty = y1;
17563
17645
  translateX += Math.cos(radian) * inset;
17564
17646
  translateY += Math.sin(radian) * inset;
17565
- vbind["text-anchor"] = "start";
17647
+ anchorX ??= 0;
17566
17648
  }
17567
- let transform = [];
17568
- if (translateX || translateY) transform.push(`translate(${translateX}, ${translateY})`);
17569
- if (radian) transform.push(`rotate(${radian * 180 / Math.PI})`);
17570
- Object.assign(vbind, {
17571
- x: tx,
17572
- y: ty,
17573
- "dominant-baseline": "central",
17574
- "transform-origin": `${tx} ${ty}`,
17575
- transform: transform.join(" ") || null
17576
- });
17577
- return [vbind, von, content, String(title ?? String(label).replace(/\x01|\x02/g, ""))];
17649
+ Object.assign(vbind, { x: tx, y: ty, translateX, translateY, anchorX, anchorY, angle: radian * 180 / Math.PI });
17650
+ return [vbind, von];
17578
17651
  }).filter((x2) => x2 != null));
17579
17652
  });
17580
- const parser = new Parser();
17581
- function parseMarkdownInline(markdown2) {
17582
- const walker = parser.parse(markdown2).walker();
17583
- const fragments = [];
17584
- let stack2 = [], scales = [1], offset = 0;
17585
- let ev;
17586
- while (ev = walker.next()) {
17587
- let { node: { type, literal }, entering } = ev;
17588
- let scale = scales.at(-1);
17589
- if (entering) {
17590
- if (type === "text" || type === "code") {
17591
- const vbind = Object.assign({
17592
- dy: str_c(offset || null, "em")
17593
- }, ...stack2, {
17594
- "font-family": type === "code" ? "monospace" : null,
17595
- "font-size": scale === 1 ? null : `${scale}em`
17596
- });
17597
- offset = 0;
17598
- fragments.push({ text: literal, vbind });
17599
- } else if (type === "strong") {
17600
- stack2.push({ "font-weight": "bold" });
17601
- } else if (type === "emph") {
17602
- stack2.push({ "font-style": "italic" });
17603
- } else if (type === "softbreak" || type === "paragraph") {
17604
- fragments.push({ text: " " });
17605
- } else if (type === "html_inline") {
17606
- const tag2 = literal;
17607
- if (tag2.includes("color=")) {
17608
- const fill = tag2.match(/color=(['"])(.*?)\1/i)?.[2] ?? tag2.match(/color=(\S*)/)?.[1];
17609
- if (fill) stack2.push({ fill });
17610
- } else if (tag2.includes("</font>")) {
17611
- stack2.pop();
17612
- } else if (tag2.includes("<sup>")) {
17613
- offset -= 0.4 * scale;
17614
- scales.push(scale * 0.7);
17615
- } else if (tag2.includes("</sup>")) {
17616
- offset += 0.4 * scales.at(-1);
17617
- scales.pop();
17618
- } else if (tag2.includes("<sub>")) {
17619
- offset += 0.25 * scale;
17620
- scales.push(scale * 0.7);
17621
- } else if (tag2.includes("</sub>")) {
17622
- offset -= 0.25 * scales.at(-1);
17623
- scales.pop();
17624
- }
17625
- }
17626
- } else {
17627
- if (["strong", "emph"].includes(type)) stack2.pop();
17628
- }
17629
- }
17630
- return fragments;
17631
- }
17632
17653
  return (_ctx, _cache) => {
17633
17654
  return openBlock(), createElementBlock("g", null, [
17634
17655
  (openBlock(true), createElementBlock(Fragment, null, renderList(binds.value, (group) => {
17635
17656
  return openBlock(), createElementBlock("g", mergeProps({ ref_for: true }, { class: __props.groupClass, style: __props.groupStyle }), [
17636
- (openBlock(true), createElementBlock(Fragment, null, renderList(group, ([vbind, von, textFragments, title]) => {
17637
- return openBlock(), createElementBlock("text", mergeProps({ ref_for: true }, vbind, toHandlers(von, true)), [
17638
- createElementVNode("title", null, toDisplayString(title), 1),
17639
- _cache[0] || (_cache[0] = createTextVNode()),
17640
- (openBlock(true), createElementBlock(Fragment, null, renderList(textFragments, (tspan) => {
17641
- return openBlock(), createElementBlock("tspan", mergeProps({ ref_for: true }, tspan.vbind), toDisplayString(tspan.text), 17);
17642
- }), 256))
17643
- ], 16);
17657
+ (openBlock(true), createElementBlock(Fragment, null, renderList(group, ([vbind, von]) => {
17658
+ return openBlock(), createBlock(_sfc_main$14, mergeProps({ ref_for: true }, vbind, toHandlers(von)), null, 16);
17644
17659
  }), 256))
17645
17660
  ], 16);
17646
17661
  }), 256))
@@ -17648,7 +17663,7 @@ const _sfc_main$E = {
17648
17663
  };
17649
17664
  }
17650
17665
  };
17651
- const _sfc_main$D = {
17666
+ const _sfc_main$E = {
17652
17667
  __name: "CoreSvgPoint",
17653
17668
  props: {
17654
17669
  extendX: { type: Number, default: 0 },
@@ -17686,6 +17701,11 @@ const _sfc_main$D = {
17686
17701
  }) => {
17687
17702
  const { h: cx, v: cy } = __props.coord2pos({ x: x2, y: y2 });
17688
17703
  if (cx < xlim_min || cx > xlim_max || cy < ylim_min || cy > ylim_max) return null;
17704
+ if (typeof angle2 == "object") {
17705
+ let { dx = 0, dy = 0 } = angle2;
17706
+ let { h, v } = __props.coord2pos({ x: x2 + dx, y: y2 + dy });
17707
+ angle2 = Math.atan2(v - cy, h - cx) * 180 / Math.PI;
17708
+ }
17689
17709
  let vbind = {
17690
17710
  x: cx,
17691
17711
  y: cy,
@@ -17714,7 +17734,7 @@ const _sfc_main$D = {
17714
17734
  (openBlock(true), createElementBlock(Fragment, null, renderList(binds.value, (group) => {
17715
17735
  return openBlock(), createElementBlock("g", mergeProps({ ref_for: true }, { class: __props.groupClass, style: __props.groupStyle }), [
17716
17736
  (openBlock(true), createElementBlock(Fragment, null, renderList(group, ([vbind, von]) => {
17717
- return openBlock(), createBlock(_sfc_main$N, mergeProps({ ref_for: true }, vbind, toHandlers(von)), null, 16);
17737
+ return openBlock(), createBlock(_sfc_main$O, mergeProps({ ref_for: true }, vbind, toHandlers(von)), null, 16);
17718
17738
  }), 256))
17719
17739
  ], 16);
17720
17740
  }), 256))
@@ -17723,7 +17743,7 @@ const _sfc_main$D = {
17723
17743
  }
17724
17744
  };
17725
17745
  const _hoisted_1$5 = { key: 0 };
17726
- const _sfc_main$C = {
17746
+ const _sfc_main$D = {
17727
17747
  __name: "CorePolygon",
17728
17748
  props: {
17729
17749
  points: { type: Array, default: () => [] },
@@ -17757,7 +17777,7 @@ const _sfc_main$C = {
17757
17777
  };
17758
17778
  }
17759
17779
  };
17760
- const _sfc_main$B = {
17780
+ const _sfc_main$C = {
17761
17781
  __name: "CoreSvgPolygon",
17762
17782
  props: {
17763
17783
  extendX: { type: Number, default: 0 },
@@ -17785,6 +17805,9 @@ const _sfc_main$B = {
17785
17805
  title,
17786
17806
  "translate-x": translateX = 0,
17787
17807
  "translate-y": translateY = 0,
17808
+ "marker-start": markerStart,
17809
+ "marker-mid": markerMid,
17810
+ "marker-end": markerEnd,
17788
17811
  class: className,
17789
17812
  style,
17790
17813
  $raw
@@ -17801,6 +17824,9 @@ const _sfc_main$B = {
17801
17824
  title,
17802
17825
  translateX,
17803
17826
  translateY,
17827
+ "marker-start": markerStart,
17828
+ "marker-mid": markerMid,
17829
+ "marker-end": markerEnd,
17804
17830
  class: className,
17805
17831
  style
17806
17832
  };
@@ -17815,7 +17841,7 @@ const _sfc_main$B = {
17815
17841
  (openBlock(true), createElementBlock(Fragment, null, renderList(binds.value, (group) => {
17816
17842
  return openBlock(), createElementBlock("g", mergeProps({ ref_for: true }, { class: __props.groupClass, style: __props.groupStyle }), [
17817
17843
  (openBlock(true), createElementBlock(Fragment, null, renderList(group, ([vbind, von]) => {
17818
- return openBlock(), createBlock(_sfc_main$C, mergeProps({ ref_for: true }, vbind, toHandlers(von)), null, 16);
17844
+ return openBlock(), createBlock(_sfc_main$D, mergeProps({ ref_for: true }, vbind, toHandlers(von)), null, 16);
17819
17845
  }), 256))
17820
17846
  ], 16);
17821
17847
  }), 256))
@@ -17823,7 +17849,7 @@ const _sfc_main$B = {
17823
17849
  };
17824
17850
  }
17825
17851
  };
17826
- const _sfc_main$A = {
17852
+ const _sfc_main$B = {
17827
17853
  __name: "CoreSvgRect",
17828
17854
  props: {
17829
17855
  extendX: { type: Number, default: 0 },
@@ -17887,7 +17913,7 @@ const _sfc_main$A = {
17887
17913
  (openBlock(true), createElementBlock(Fragment, null, renderList(binds.value, (group) => {
17888
17914
  return openBlock(), createElementBlock("g", mergeProps({ ref_for: true }, { class: __props.groupClass, style: __props.groupStyle }), [
17889
17915
  (openBlock(true), createElementBlock(Fragment, null, renderList(group, ([vbind, von]) => {
17890
- return openBlock(), createBlock(_sfc_main$O, mergeProps({ ref_for: true }, vbind, toHandlers(von)), null, 16);
17916
+ return openBlock(), createBlock(_sfc_main$P, mergeProps({ ref_for: true }, vbind, toHandlers(von)), null, 16);
17891
17917
  }), 256))
17892
17918
  ], 16);
17893
17919
  }), 256))
@@ -17895,7 +17921,7 @@ const _sfc_main$A = {
17895
17921
  };
17896
17922
  }
17897
17923
  };
17898
- const _sfc_main$z = {
17924
+ const _sfc_main$A = {
17899
17925
  __name: "CoreSvgText",
17900
17926
  props: {
17901
17927
  extendX: { type: Number, default: 0 },
@@ -17946,6 +17972,11 @@ const _sfc_main$z = {
17946
17972
  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 });
17947
17973
  textLength = Math.hypot(h1 - h2 || 0, v1 - v2 || 0);
17948
17974
  }
17975
+ if (typeof angle2 == "object") {
17976
+ let { dx = 0, dy = 0 } = angle2;
17977
+ let { h, v } = __props.coord2pos({ x: x2 + dx, y: y2 + dy });
17978
+ angle2 = Math.atan2(v - ty, h - tx) * 180 / Math.PI;
17979
+ }
17949
17980
  let vbind = {
17950
17981
  x: tx,
17951
17982
  y: ty,
@@ -17981,7 +18012,7 @@ const _sfc_main$z = {
17981
18012
  (openBlock(true), createElementBlock(Fragment, null, renderList(binds.value, (group) => {
17982
18013
  return openBlock(), createElementBlock("g", mergeProps({ ref_for: true }, { class: __props.groupClass, style: __props.groupStyle }), [
17983
18014
  (openBlock(true), createElementBlock(Fragment, null, renderList(group, ([vbind, von]) => {
17984
- return openBlock(), createBlock(_sfc_main$13, mergeProps({ ref_for: true }, vbind, toHandlers(von)), null, 16);
18015
+ return openBlock(), createBlock(_sfc_main$15, mergeProps({ ref_for: true }, vbind, toHandlers(von)), null, 16);
17985
18016
  }), 256))
17986
18017
  ], 16);
17987
18018
  }), 256))
@@ -17989,7 +18020,7 @@ const _sfc_main$z = {
17989
18020
  };
17990
18021
  }
17991
18022
  };
17992
- const _sfc_main$y = {
18023
+ const _sfc_main$z = {
17993
18024
  __name: "CoreSvgTextsegment",
17994
18025
  props: {
17995
18026
  extendX: { type: Number, default: 0 },
@@ -18168,22 +18199,22 @@ const _sfc_main$y = {
18168
18199
  };
18169
18200
  const svg = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
18170
18201
  __proto__: null,
18171
- blank: _sfc_main$P,
18172
- boxplot: _sfc_main$L,
18173
- curve: _sfc_main$J,
18174
- ellipse: _sfc_main$H,
18175
- line: _sfc_main$G,
18176
- markdown: _sfc_main$F,
18177
- markdownsegment: _sfc_main$E,
18178
- point: _sfc_main$D,
18179
- polygon: _sfc_main$B,
18180
- rect: _sfc_main$A,
18181
- stick: _sfc_main$G,
18182
- text: _sfc_main$z,
18183
- textsegment: _sfc_main$y,
18184
- tile: _sfc_main$A
18202
+ blank: _sfc_main$Q,
18203
+ boxplot: _sfc_main$M,
18204
+ curve: _sfc_main$K,
18205
+ ellipse: _sfc_main$I,
18206
+ line: _sfc_main$H,
18207
+ markdown: _sfc_main$G,
18208
+ markdownsegment: _sfc_main$F,
18209
+ point: _sfc_main$E,
18210
+ polygon: _sfc_main$C,
18211
+ rect: _sfc_main$B,
18212
+ stick: _sfc_main$H,
18213
+ text: _sfc_main$A,
18214
+ textsegment: _sfc_main$z,
18215
+ tile: _sfc_main$B
18185
18216
  }, Symbol.toStringTag, { value: "Module" }));
18186
- const _sfc_main$x = {
18217
+ const _sfc_main$y = {
18187
18218
  __name: "CoreLayer",
18188
18219
  props: {
18189
18220
  data: Object,
@@ -18224,7 +18255,7 @@ const _sfc_main$x = {
18224
18255
  };
18225
18256
  const _hoisted_1$4 = { key: 0 };
18226
18257
  const _hoisted_2$3 = ["onPointerdown"];
18227
- const _sfc_main$w = {
18258
+ const _sfc_main$x = {
18228
18259
  __name: "CoreSelection",
18229
18260
  props: /* @__PURE__ */ mergeModels({
18230
18261
  coord2pos: Function,
@@ -18324,7 +18355,7 @@ const _sfc_main$w = {
18324
18355
  if (pos.hmax == null) hmax += linewidth / 2;
18325
18356
  if (pos.vmin == null) vmin -= linewidth / 2;
18326
18357
  if (pos.vmax == null) vmax += linewidth / 2;
18327
- let width = hmax - hmin, height = vmax - vmin;
18358
+ let width = Math.max(0, hmax - hmin), height = Math.max(0, vmax - vmin);
18328
18359
  return {
18329
18360
  x: hmin,
18330
18361
  y: vmin,
@@ -18343,7 +18374,7 @@ const _sfc_main$w = {
18343
18374
  if (!position.value || translating.value) return null;
18344
18375
  let size = 10;
18345
18376
  let { hmin, hmax, vmin, vmax, pos } = position.value;
18346
- let width = hmax - hmin, height = vmax - vmin;
18377
+ let width = Math.max(0, hmax - hmin), height = Math.max(0, vmax - vmin);
18347
18378
  let binds = {};
18348
18379
  if (config.move) binds.tblr = {
18349
18380
  x: hmin,
@@ -18481,7 +18512,7 @@ const _sfc_main$w = {
18481
18512
  const _hoisted_1$3 = ["height", "width"];
18482
18513
  const _hoisted_2$2 = ["y1", "y2"];
18483
18514
  const _hoisted_3$2 = ["y"];
18484
- const _sfc_main$v = {
18515
+ const _sfc_main$w = {
18485
18516
  __name: "CoreGuideGradientbar",
18486
18517
  props: {
18487
18518
  scales: Array,
@@ -18521,7 +18552,7 @@ const _sfc_main$v = {
18521
18552
  ref: "svg"
18522
18553
  }, [
18523
18554
  (openBlock(true), createElementBlock(Fragment, null, renderList(gradient_values.value, (v, i) => {
18524
- return openBlock(), createBlock(_sfc_main$O, mergeProps({
18555
+ return openBlock(), createBlock(_sfc_main$P, mergeProps({
18525
18556
  width: 10,
18526
18557
  height: 3.1,
18527
18558
  x: 10,
@@ -18553,12 +18584,12 @@ const _sfc_main$v = {
18553
18584
  };
18554
18585
  const element = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
18555
18586
  __proto__: null,
18556
- curve: _sfc_main$K,
18557
- line: _sfc_main$M,
18558
- point: _sfc_main$N,
18559
- polygon: _sfc_main$C,
18560
- text: _sfc_main$13,
18561
- tile: _sfc_main$O
18587
+ curve: _sfc_main$L,
18588
+ line: _sfc_main$N,
18589
+ point: _sfc_main$O,
18590
+ polygon: _sfc_main$D,
18591
+ text: _sfc_main$15,
18592
+ tile: _sfc_main$P
18562
18593
  }, Symbol.toStringTag, { value: "Module" }));
18563
18594
  const _hoisted_1$2 = ["height", "width"];
18564
18595
  const _hoisted_2$1 = ["transform"];
@@ -18568,7 +18599,7 @@ const _hoisted_4$1 = {
18568
18599
  y: "10",
18569
18600
  "alignment-baseline": "central"
18570
18601
  };
18571
- const _sfc_main$u = {
18602
+ const _sfc_main$v = {
18572
18603
  __name: "CoreGuideLegendkey",
18573
18604
  props: {
18574
18605
  scales: Array,
@@ -18635,7 +18666,7 @@ const _sfc_main$u = {
18635
18666
  };
18636
18667
  }
18637
18668
  };
18638
- const _sfc_main$t = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
18669
+ const _sfc_main$u = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
18639
18670
  __name: "CoreGuide",
18640
18671
  props: {
18641
18672
  scales: Array,
@@ -18643,8 +18674,8 @@ const _sfc_main$t = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
18643
18674
  },
18644
18675
  setup(__props) {
18645
18676
  const guide = {
18646
- legendkey: _sfc_main$u,
18647
- gradientbar: _sfc_main$v
18677
+ legendkey: _sfc_main$v,
18678
+ gradientbar: _sfc_main$w
18648
18679
  };
18649
18680
  const title = computed(() => {
18650
18681
  return __props.scales.reduce((v, [s]) => v ?? s.title, null) ?? __props.scales.reduce((v, [s]) => v ?? s._title, null);
@@ -18688,7 +18719,7 @@ const _sfc_main$t = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
18688
18719
  };
18689
18720
  }
18690
18721
  });
18691
- const _sfc_main$s = {
18722
+ const _sfc_main$t = {
18692
18723
  __name: "CoreLegend",
18693
18724
  props: {
18694
18725
  theme: { type: Object, default: () => ({}) },
@@ -18722,7 +18753,7 @@ const _sfc_main$s = {
18722
18753
  style: normalizeStyle({ gap: __props.theme.spacing + "px" })
18723
18754
  }, [
18724
18755
  (openBlock(true), createElementBlock(Fragment, null, renderList(guides.value, ([[key, type], scales]) => {
18725
- return openBlock(), createBlock(_sfc_main$t, {
18756
+ return openBlock(), createBlock(_sfc_main$u, {
18726
18757
  key,
18727
18758
  type,
18728
18759
  scales
@@ -18740,7 +18771,7 @@ const _hoisted_5 = ["transform", "clip-path"];
18740
18771
  const _hoisted_6 = ["transform"];
18741
18772
  const _hoisted_7 = ["clip-path"];
18742
18773
  const _hoisted_8 = { key: 1 };
18743
- const _sfc_main$r = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
18774
+ const _sfc_main$s = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
18744
18775
  __name: "CorePlot",
18745
18776
  props: /* @__PURE__ */ mergeModels({
18746
18777
  schema: Object,
@@ -19353,37 +19384,39 @@ const _sfc_main$r = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
19353
19384
  etc
19354
19385
  }));
19355
19386
  });
19387
+ function grid_theme_normalize(theme2) {
19388
+ let {
19389
+ grid_color,
19390
+ grid_color_major = grid_color,
19391
+ grid_color_minor = grid_color,
19392
+ grid_width,
19393
+ grid_width_major = grid_width,
19394
+ grid_width_minor = grid_width,
19395
+ ...result
19396
+ } = theme2;
19397
+ if (grid_color_major) result.grid_color_major = grid_color_major;
19398
+ if (grid_color_minor) result.grid_color_minor = grid_color_minor;
19399
+ if (grid_width_major) result.grid_width_major = grid_width_major;
19400
+ if (grid_width_minor) result.grid_width_minor = grid_width_minor;
19401
+ return result;
19402
+ }
19356
19403
  const vaxes = computed(() => gaxes.value.map(({ coord, axis, etc }) => {
19357
- let { majorBreaks, minorBreaks, ticks: ticks2 } = axis.getBindings({
19358
- range: axisRange[coord],
19359
- expandMult: __props.expandMult[coord]
19360
- });
19361
- let { showGrid, orientation, ...bind } = etc;
19362
- return {
19363
- majorBreaks,
19364
- minorBreaks,
19365
- ticks: ticks2,
19366
- showGrid,
19367
- coord,
19368
- orientation,
19369
- bind
19370
- };
19404
+ let { showGrid, breakSlot, orientation, ...bind } = etc;
19405
+ let gtheme = grid_theme_normalize(__props.theme.axis[orientation] ?? {}), atheme = grid_theme_normalize(bind.theme);
19406
+ let breaks = axis.getBreaks({ range: axisRange[coord], expandMult: __props.expandMult[coord], breakSlot });
19407
+ for (let b of breaks)
19408
+ b.theme = Object.assign({}, gtheme, atheme, grid_theme_normalize(b.theme ?? {}));
19409
+ return { breaks, showGrid, coord, orientation, bind };
19371
19410
  }));
19372
19411
  const gridBreaks = computed(() => {
19373
19412
  let hAxes = vaxes.value.filter((a) => a.showGrid && a.orientation == "v"), vAxes = vaxes.value.filter((a) => a.showGrid && a.orientation == "h");
19374
19413
  return {
19375
- h: {
19376
- majorBreaks: unique(hAxes.flatMap((a) => a.majorBreaks), (x2) => x2.position),
19377
- minorBreaks: unique(hAxes.flatMap((a) => a.minorBreaks), (x2) => x2.position)
19378
- },
19379
- v: {
19380
- majorBreaks: unique(vAxes.flatMap((a) => a.majorBreaks), (x2) => x2.position),
19381
- minorBreaks: unique(vAxes.flatMap((a) => a.minorBreaks), (x2) => x2.position)
19382
- }
19414
+ h: unique(hAxes.flatMap((a) => a.breaks), (x2) => x2.value, (a, b) => [a, b].find((x2) => x2.type == "major") ?? a),
19415
+ v: unique(vAxes.flatMap((a) => a.breaks), (x2) => x2.value, (a, b) => [a, b].find((x2) => x2.type == "major") ?? a)
19383
19416
  };
19384
19417
  });
19385
19418
  const axes = computed(() => {
19386
- return vaxes.value.map(({ orientation, coord, bind, ticks: ticks2 }) => {
19419
+ return vaxes.value.map(({ orientation, coord, bind, breaks }) => {
19387
19420
  let {
19388
19421
  onMove: move = (...args) => emit("move", ...args),
19389
19422
  onZoom: zoom = (...args) => emit("zoom", ...args),
@@ -19396,7 +19429,7 @@ const _sfc_main$r = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
19396
19429
  bind: {
19397
19430
  coord,
19398
19431
  orientation,
19399
- ticks: ticks2,
19432
+ ticks: breaks.filter((x2) => x2.type == "major"),
19400
19433
  layout: innerRect,
19401
19434
  coord2pos,
19402
19435
  pos2coord,
@@ -19437,21 +19470,21 @@ const _sfc_main$r = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
19437
19470
  transform: `translate(${unref(panel).left}, ${unref(panel).top})`,
19438
19471
  style: { "pointer-events": "none" }
19439
19472
  }, [
19440
- __props.theme.grid.h ? (openBlock(), createBlock(_sfc_main$_, mergeProps({ key: 0 }, gridBreaks.value.h, {
19473
+ createVNode(_sfc_main$$, {
19474
+ breaks: gridBreaks.value.h,
19441
19475
  layout: unref(innerRect),
19442
- theme: __props.theme.grid.h,
19443
19476
  activeTransform: activeTransform.value,
19444
19477
  coord2pos,
19445
19478
  transition: transition.value
19446
- }), null, 16, ["layout", "theme", "activeTransform", "transition"])) : createCommentVNode("", true),
19479
+ }, null, 8, ["breaks", "layout", "activeTransform", "transition"]),
19447
19480
  _cache[2] || (_cache[2] = createTextVNode()),
19448
- __props.theme.grid.v ? (openBlock(), createBlock(_sfc_main$Z, mergeProps({ key: 1 }, gridBreaks.value.v, {
19481
+ createVNode(_sfc_main$_, {
19482
+ breaks: gridBreaks.value.v,
19449
19483
  layout: unref(innerRect),
19450
- theme: __props.theme.grid.v,
19451
19484
  activeTransform: activeTransform.value,
19452
19485
  coord2pos,
19453
19486
  transition: transition.value
19454
- }), null, 16, ["layout", "theme", "activeTransform", "transition"])) : createCommentVNode("", true)
19487
+ }, null, 8, ["breaks", "layout", "activeTransform", "transition"])
19455
19488
  ], 8, _hoisted_4),
19456
19489
  _cache[8] || (_cache[8] = createTextVNode()),
19457
19490
  createElementVNode("g", {
@@ -19462,7 +19495,7 @@ const _sfc_main$r = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
19462
19495
  style: { transition: transition.value }
19463
19496
  }), [
19464
19497
  (openBlock(true), createElementBlock(Fragment, null, renderList(vplot.value.layers, (layer) => {
19465
- return openBlock(), createBlock(_sfc_main$x, mergeProps({
19498
+ return openBlock(), createBlock(_sfc_main$y, mergeProps({
19466
19499
  ref_for: true,
19467
19500
  ref_key: "layers",
19468
19501
  ref: layers,
@@ -19479,7 +19512,7 @@ const _sfc_main$r = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
19479
19512
  ], 16),
19480
19513
  _cache[3] || (_cache[3] = createTextVNode()),
19481
19514
  (openBlock(true), createElementBlock(Fragment, null, renderList(props.selections, (sel) => {
19482
- return openBlock(), createBlock(_sfc_main$w, mergeProps({
19515
+ return openBlock(), createBlock(_sfc_main$x, mergeProps({
19483
19516
  coord2pos,
19484
19517
  pos2coord,
19485
19518
  layout: unref(innerRect),
@@ -19490,7 +19523,7 @@ const _sfc_main$r = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
19490
19523
  }, { ref_for: true }, sel, { flip: __props.flip }), null, 16, ["layout", "transition", "activeTransform", "flip"]);
19491
19524
  }), 256)),
19492
19525
  _cache[4] || (_cache[4] = createTextVNode()),
19493
- createVNode(_sfc_main$w, {
19526
+ createVNode(_sfc_main$x, {
19494
19527
  coord2pos,
19495
19528
  pos2coord,
19496
19529
  layout: unref(innerRect),
@@ -19506,7 +19539,7 @@ const _sfc_main$r = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
19506
19539
  transform: `translate(${unref(panel).left}, ${unref(panel).top})`
19507
19540
  }, [
19508
19541
  (openBlock(true), createElementBlock(Fragment, null, renderList(axes.value.filter((a) => typeof a.bind.position !== "number"), (axis) => {
19509
- return openBlock(), createBlock(_sfc_main$$, mergeProps({ ref_for: true }, axis.bind, toHandlers(axis.on), {
19542
+ return openBlock(), createBlock(_sfc_main$10, mergeProps({ ref_for: true }, axis.bind, toHandlers(axis.on), {
19510
19543
  transition: transition.value,
19511
19544
  "onUpdate:transition": _cache[0] || (_cache[0] = ($event) => transition.value = $event),
19512
19545
  activeTransform: activeTransform.value
@@ -19517,7 +19550,7 @@ const _sfc_main$r = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
19517
19550
  "clip-path": props.clip ? `url(#${unref(vid)}-plot-clip)` : null
19518
19551
  }, [
19519
19552
  (openBlock(true), createElementBlock(Fragment, null, renderList(axes.value.filter((a) => typeof a.bind.position === "number"), (axis) => {
19520
- return openBlock(), createBlock(_sfc_main$$, mergeProps({ ref_for: true }, axis.bind, toHandlers(axis.on), {
19553
+ return openBlock(), createBlock(_sfc_main$10, mergeProps({ ref_for: true }, axis.bind, toHandlers(axis.on), {
19521
19554
  transition: transition.value,
19522
19555
  "onUpdate:transition": _cache[1] || (_cache[1] = ($event) => transition.value = $event),
19523
19556
  activeTransform: activeTransform.value
@@ -19526,12 +19559,14 @@ const _sfc_main$r = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
19526
19559
  ], 8, _hoisted_7)
19527
19560
  ], 8, _hoisted_6),
19528
19561
  _cache[10] || (_cache[10] = createTextVNode()),
19562
+ renderSlot(_ctx.$slots, "default"),
19563
+ _cache[11] || (_cache[11] = createTextVNode()),
19529
19564
  props.legendTeleport ? (openBlock(), createElementBlock("foreignObject", _hoisted_8, [
19530
19565
  (openBlock(), createBlock(Teleport, {
19531
19566
  defer: "",
19532
19567
  to: props.legendTeleport
19533
19568
  }, [
19534
- createVNode(_sfc_main$s, {
19569
+ createVNode(_sfc_main$t, {
19535
19570
  scales: vplot.value?.scales,
19536
19571
  theme: __props.theme.legend
19537
19572
  }, null, 8, ["scales", "theme"])
@@ -19541,35 +19576,36 @@ const _sfc_main$r = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
19541
19576
  };
19542
19577
  }
19543
19578
  });
19544
- const _sfc_main$q = {
19579
+ const _sfc_main$r = {
19545
19580
  $_type: "action",
19546
19581
  $_props: {}
19547
19582
  };
19548
- const _sfc_main$p = {
19583
+ const _sfc_main$q = {
19549
19584
  $_type: "layer"
19550
19585
  };
19551
- const _sfc_main$o = {
19586
+ const _sfc_main$p = {
19552
19587
  $_props: {
19553
19588
  geom: "tile",
19554
19589
  stat: "bar"
19555
19590
  },
19556
- $_type: "layer"
19591
+ $_type: "layer",
19592
+ $_argnames: ["width", "height", "position"]
19557
19593
  };
19558
- const _sfc_main$n = {
19594
+ const _sfc_main$o = {
19559
19595
  $_props: {
19560
19596
  geom: "blank",
19561
19597
  stat: "identity"
19562
19598
  },
19563
19599
  $_type: "layer"
19564
19600
  };
19565
- const _sfc_main$m = {
19601
+ const _sfc_main$n = {
19566
19602
  $_props: {
19567
19603
  geom: "boxplot",
19568
19604
  stat: "boxplot"
19569
19605
  },
19570
19606
  $_type: "layer"
19571
19607
  };
19572
- const _sfc_main$l = {
19608
+ const _sfc_main$m = {
19573
19609
  $_props: {
19574
19610
  geom: "curve",
19575
19611
  stat: "curve"
@@ -19577,7 +19613,7 @@ const _sfc_main$l = {
19577
19613
  $_type: "layer",
19578
19614
  $_attrnames: ["interpolate"]
19579
19615
  };
19580
- const _sfc_main$k = {
19616
+ const _sfc_main$l = {
19581
19617
  $_props: {
19582
19618
  geom: "curve",
19583
19619
  stat: "density"
@@ -19585,7 +19621,7 @@ const _sfc_main$k = {
19585
19621
  $_type: "layer",
19586
19622
  $_argnames: ["n", "kernel"]
19587
19623
  };
19588
- const _sfc_main$j = {
19624
+ const _sfc_main$k = {
19589
19625
  $_props: {
19590
19626
  geom: "ellipse",
19591
19627
  stat: "ellipse"
@@ -19593,7 +19629,7 @@ const _sfc_main$j = {
19593
19629
  $_type: "layer",
19594
19630
  $_argnames: ["CI"]
19595
19631
  };
19596
- const _sfc_main$i = {
19632
+ const _sfc_main$j = {
19597
19633
  $_props: {
19598
19634
  geom: "rect",
19599
19635
  stat: "histogram"
@@ -19601,7 +19637,7 @@ const _sfc_main$i = {
19601
19637
  $_type: "layer",
19602
19638
  $_argnames: ["bins", "binwidth", "breaks"]
19603
19639
  };
19604
- const _sfc_main$h = {
19640
+ const _sfc_main$i = {
19605
19641
  $_props: {
19606
19642
  geom: "line",
19607
19643
  stat: "line"
@@ -19609,84 +19645,84 @@ const _sfc_main$h = {
19609
19645
  $_type: "layer",
19610
19646
  $_argnames: ["orientation"]
19611
19647
  };
19612
- const _sfc_main$g = {
19648
+ const _sfc_main$h = {
19613
19649
  $_props: {
19614
19650
  geom: "line",
19615
19651
  stat: "linerange"
19616
19652
  },
19617
19653
  $_type: "layer"
19618
19654
  };
19619
- const _sfc_main$f = {
19655
+ const _sfc_main$g = {
19620
19656
  $_props: {
19621
19657
  geom: "markdown",
19622
19658
  stat: "text"
19623
19659
  },
19624
19660
  $_type: "layer"
19625
19661
  };
19626
- const _sfc_main$e = {
19662
+ const _sfc_main$f = {
19627
19663
  $_props: {
19628
19664
  geom: "markdownsegment",
19629
19665
  stat: "textsegment"
19630
19666
  },
19631
19667
  $_type: "layer"
19632
19668
  };
19633
- const _sfc_main$d = {
19669
+ const _sfc_main$e = {
19634
19670
  $_props: {
19635
19671
  geom: "line",
19636
19672
  stat: "path"
19637
19673
  },
19638
19674
  $_type: "layer"
19639
19675
  };
19640
- const _sfc_main$c = {
19676
+ const _sfc_main$d = {
19641
19677
  $_props: {
19642
19678
  geom: "point",
19643
19679
  stat: "point"
19644
19680
  },
19645
19681
  $_type: "layer"
19646
19682
  };
19647
- const _sfc_main$b = {
19683
+ const _sfc_main$c = {
19648
19684
  $_props: {
19649
19685
  geom: "polygon",
19650
19686
  stat: "polygon"
19651
19687
  },
19652
19688
  $_type: "layer"
19653
19689
  };
19654
- const _sfc_main$a = {
19690
+ const _sfc_main$b = {
19655
19691
  $_props: {
19656
19692
  geom: "rect",
19657
19693
  stat: "rect"
19658
19694
  },
19659
19695
  $_type: "layer"
19660
19696
  };
19661
- const _sfc_main$9 = {
19697
+ const _sfc_main$a = {
19662
19698
  $_props: {
19663
19699
  geom: "line",
19664
19700
  stat: "segment"
19665
19701
  },
19666
19702
  $_type: "layer"
19667
19703
  };
19668
- const _sfc_main$8 = {
19704
+ const _sfc_main$9 = {
19669
19705
  $_props: {
19670
19706
  geom: "stick",
19671
19707
  stat: "stick"
19672
19708
  },
19673
19709
  $_type: "layer"
19674
19710
  };
19675
- const _sfc_main$7 = {
19711
+ const _sfc_main$8 = {
19676
19712
  $_props: {
19677
19713
  geom: "text",
19678
19714
  stat: "text"
19679
19715
  },
19680
19716
  $_type: "layer"
19681
19717
  };
19682
- const _sfc_main$6 = {
19718
+ const _sfc_main$7 = {
19683
19719
  $_props: {
19684
19720
  geom: "textsegment",
19685
19721
  stat: "textsegment"
19686
19722
  },
19687
19723
  $_type: "layer"
19688
19724
  };
19689
- const _sfc_main$5 = {
19725
+ const _sfc_main$6 = {
19690
19726
  $_props: {
19691
19727
  geom: "tile",
19692
19728
  stat: "tile"
@@ -19695,45 +19731,50 @@ const _sfc_main$5 = {
19695
19731
  };
19696
19732
  const geom_components = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
19697
19733
  __proto__: null,
19698
- VVGeom: _sfc_main$p,
19699
- VVGeomBar: _sfc_main$o,
19700
- VVGeomBlank: _sfc_main$n,
19701
- VVGeomBoxplot: _sfc_main$m,
19702
- VVGeomCurve: _sfc_main$l,
19703
- VVGeomDensity: _sfc_main$k,
19704
- VVGeomEllipse: _sfc_main$j,
19705
- VVGeomHistogram: _sfc_main$i,
19706
- VVGeomLine: _sfc_main$h,
19707
- VVGeomLinerange: _sfc_main$g,
19708
- VVGeomMarkdown: _sfc_main$f,
19709
- VVGeomMarkdownsegment: _sfc_main$e,
19710
- VVGeomPath: _sfc_main$d,
19711
- VVGeomPoint: _sfc_main$c,
19712
- VVGeomPolygon: _sfc_main$b,
19713
- VVGeomRect: _sfc_main$a,
19714
- VVGeomSegment: _sfc_main$9,
19715
- VVGeomStick: _sfc_main$8,
19716
- VVGeomText: _sfc_main$7,
19717
- VVGeomTextsegment: _sfc_main$6,
19718
- VVGeomTile: _sfc_main$5
19734
+ VVGeom: _sfc_main$q,
19735
+ VVGeomBar: _sfc_main$p,
19736
+ VVGeomBlank: _sfc_main$o,
19737
+ VVGeomBoxplot: _sfc_main$n,
19738
+ VVGeomCurve: _sfc_main$m,
19739
+ VVGeomDensity: _sfc_main$l,
19740
+ VVGeomEllipse: _sfc_main$k,
19741
+ VVGeomHistogram: _sfc_main$j,
19742
+ VVGeomLine: _sfc_main$i,
19743
+ VVGeomLinerange: _sfc_main$h,
19744
+ VVGeomMarkdown: _sfc_main$g,
19745
+ VVGeomMarkdownsegment: _sfc_main$f,
19746
+ VVGeomPath: _sfc_main$e,
19747
+ VVGeomPoint: _sfc_main$d,
19748
+ VVGeomPolygon: _sfc_main$c,
19749
+ VVGeomRect: _sfc_main$b,
19750
+ VVGeomSegment: _sfc_main$a,
19751
+ VVGeomStick: _sfc_main$9,
19752
+ VVGeomText: _sfc_main$8,
19753
+ VVGeomTextsegment: _sfc_main$7,
19754
+ VVGeomTile: _sfc_main$6
19719
19755
  }, Symbol.toStringTag, { value: "Module" }));
19720
- const _sfc_main$4 = {
19756
+ const _sfc_main$5 = {
19721
19757
  $_type: "axis",
19722
19758
  $_props: {}
19723
19759
  };
19724
- const _sfc_main$3 = {
19760
+ const _sfc_main$4 = {
19725
19761
  $_type: "axis",
19726
19762
  $_props: { coord: "x" }
19727
19763
  };
19728
- const _sfc_main$2 = {
19764
+ const _sfc_main$3 = {
19729
19765
  $_type: "axis",
19730
19766
  $_props: { coord: "y" }
19731
19767
  };
19768
+ const _sfc_main$2 = {
19769
+ $_type: "axis-break",
19770
+ $_props: { type: "major" }
19771
+ };
19732
19772
  const axis_components = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
19733
19773
  __proto__: null,
19734
- VVAxis: _sfc_main$4,
19735
- VVAxisX: _sfc_main$3,
19736
- VVAxisY: _sfc_main$2
19774
+ VVAxis: _sfc_main$5,
19775
+ VVAxisBreak: _sfc_main$2,
19776
+ VVAxisX: _sfc_main$4,
19777
+ VVAxisY: _sfc_main$3
19737
19778
  }, Symbol.toStringTag, { value: "Module" }));
19738
19779
  const _hoisted_1 = {
19739
19780
  key: 0,
@@ -19780,8 +19821,8 @@ const _sfc_main$1 = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
19780
19821
  const components = {
19781
19822
  ...geom_components,
19782
19823
  ...axis_components,
19783
- VVAction: _sfc_main$q,
19784
- VVSelection: _sfc_main$q
19824
+ VVAction: _sfc_main$r,
19825
+ VVSelection: _sfc_main$r
19785
19826
  };
19786
19827
  const opponents = {
19787
19828
  x: "y",
@@ -19801,20 +19842,6 @@ const _sfc_main$1 = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
19801
19842
  const selectionPreview = useModel(__props, "selectionPreview");
19802
19843
  const selectionPreviewTheme = useModel(__props, "selectionPreviewTheme");
19803
19844
  const transition = useModel(__props, "transition");
19804
- function expandFragment(componentList) {
19805
- if (componentList == null) return [];
19806
- return componentList.flatMap((layer) => {
19807
- if (layer.type == Fragment) {
19808
- return expandFragment(layer.children);
19809
- } else if (layer.type == "template") {
19810
- return expandFragment(layer.children).map((c) => {
19811
- c.props = { ...c.props, ...layer.props };
19812
- return c;
19813
- });
19814
- }
19815
- return layer;
19816
- });
19817
- }
19818
19845
  function resolveComponent(ast2) {
19819
19846
  let result = {
19820
19847
  props: Object.fromEntries(ast2.props.map((p) => {
@@ -19862,6 +19889,8 @@ const _sfc_main$1 = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
19862
19889
  const vaction = computed(() => Object.values(vnodes.action).flat());
19863
19890
  const vselection = computed(() => Object.values(vnodes.selection).flat());
19864
19891
  const vdom = computed(() => Object.keys(vnodes.dom).flatMap((k) => k == "panel" ? [] : vnodes.dom[k]));
19892
+ const vdom_svg = computed(() => vdom.value.filter((v) => isSVGTag(v.type)));
19893
+ const vdom_etc = computed(() => vdom.value.filter((v) => !isSVGTag(v.type)));
19865
19894
  const vBind = computed(() => {
19866
19895
  let plot = {};
19867
19896
  let wrapper = {};
@@ -20082,7 +20111,7 @@ const _sfc_main$1 = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
20082
20111
  const buttonsMap = { left: 1, right: 2, middle: 4, X1: 8, X2: 16 };
20083
20112
  const axes = computed(() => {
20084
20113
  let ori = __props.flip ? { x: "v", y: "h" } : { x: "h", y: "v" };
20085
- let allAxes = vaxis.value.map((c) => ({ ...c.type.$_props, ...c.props, $_children: c.children })).concat(__props.axes ?? []);
20114
+ let allAxes = vaxis.value.map((c) => ({ ...c.type.$_props, ...c.props, $_children: c.children ?? {} })).concat(__props.axes ?? []);
20086
20115
  if (allAxes.every((ax) => ax?.coord != "x")) allAxes.push({ coord: "x" });
20087
20116
  if (allAxes.every((ax) => ax?.coord != "y")) allAxes.push({ coord: "y" });
20088
20117
  return allAxes.map(({
@@ -20109,7 +20138,7 @@ const _sfc_main$1 = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
20109
20138
  max,
20110
20139
  "onUpdate:min": oum,
20111
20140
  "onUpdate:max": ouM,
20112
- $_children,
20141
+ $_children = {},
20113
20142
  ...etc
20114
20143
  }) => {
20115
20144
  let orientation = ori[coord];
@@ -20121,7 +20150,8 @@ const _sfc_main$1 = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
20121
20150
  position = { h: "top", v: "right" }[orientation];
20122
20151
  if (reverse[opponents[coord]]) position = opponents[position];
20123
20152
  }
20124
- 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) => {
20153
+ let breakSlot = $_children.breaks;
20154
+ let action2 = Object.keys($_children).filter((k) => typeof $_children[k] == "function" && k != "breaks").flatMap((k) => expandFragment($_children[k]())).map((c) => ({ ...c.type.$_props, ...c.props })).concat($$action ?? []).flatMap((props) => {
20125
20155
  let res = [];
20126
20156
  for (let a of ["move", "nudge", "zoom", "rescale"]) {
20127
20157
  let act = props[a];
@@ -20151,6 +20181,7 @@ const _sfc_main$1 = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
20151
20181
  labels,
20152
20182
  titles,
20153
20183
  minorBreaks,
20184
+ breakSlot,
20154
20185
  showGrid: _isPropTruthy(showGrid) ?? position !== "none",
20155
20186
  extend: extend2 ?? primaryAxisConfig.extend[coord],
20156
20187
  theme: Object.assign({}, ...[theme2.value?.axis?.[position] ?? theme2.value?.axis?.[orientation]].concat($$theme)),
@@ -20308,7 +20339,7 @@ const _sfc_main$1 = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
20308
20339
  class: "vvplot",
20309
20340
  style: wrapperStyle.value
20310
20341
  }, vBind.value.wrapper), [
20311
- createVNode(_sfc_main$r, mergeProps({
20342
+ createVNode(_sfc_main$s, mergeProps({
20312
20343
  ref: "plot",
20313
20344
  paddings,
20314
20345
  schema: schema.value,
@@ -20337,7 +20368,14 @@ const _sfc_main$1 = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
20337
20368
  dpi: __props.dpi ?? 96 * unref(pixelRatio),
20338
20369
  legendTeleport: __props.legendTeleport,
20339
20370
  onSelect: _cache[3] || (_cache[3] = (d, e) => emit("select", d, e))
20340
- }), 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", "dpi", "legendTeleport"]),
20371
+ }), {
20372
+ default: withCtx(() => [
20373
+ (openBlock(true), createElementBlock(Fragment, null, renderList(vdom_svg.value, (c) => {
20374
+ return openBlock(), createBlock(resolveDynamicComponent(c));
20375
+ }), 256))
20376
+ ]),
20377
+ _: 1
20378
+ }, 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", "dpi", "legendTeleport"]),
20341
20379
  _cache[4] || (_cache[4] = createTextVNode()),
20342
20380
  createElementVNode("div", {
20343
20381
  class: "vvplot-panel-container",
@@ -20350,7 +20388,7 @@ const _sfc_main$1 = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
20350
20388
  ])) : createCommentVNode("", true)
20351
20389
  ], 4),
20352
20390
  _cache[5] || (_cache[5] = createTextVNode()),
20353
- (openBlock(true), createElementBlock(Fragment, null, renderList(vdom.value, (c) => {
20391
+ (openBlock(true), createElementBlock(Fragment, null, renderList(vdom_etc.value, (c) => {
20354
20392
  return openBlock(), createBlock(resolveDynamicComponent(c));
20355
20393
  }), 256))
20356
20394
  ], 16);
@@ -20363,67 +20401,71 @@ const _sfc_main = {
20363
20401
  };
20364
20402
  const index = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
20365
20403
  __proto__: null,
20366
- VVAction: _sfc_main$q,
20367
- VVAxis: _sfc_main$4,
20368
- VVAxisX: _sfc_main$3,
20369
- VVAxisY: _sfc_main$2,
20370
- VVGeom: _sfc_main$p,
20371
- VVGeomBar: _sfc_main$o,
20372
- VVGeomBlank: _sfc_main$n,
20373
- VVGeomBoxplot: _sfc_main$m,
20374
- VVGeomCurve: _sfc_main$l,
20375
- VVGeomDensity: _sfc_main$k,
20376
- VVGeomEllipse: _sfc_main$j,
20377
- VVGeomHistogram: _sfc_main$i,
20378
- VVGeomLine: _sfc_main$h,
20379
- VVGeomLinerange: _sfc_main$g,
20380
- VVGeomMarkdown: _sfc_main$f,
20381
- VVGeomMarkdownsegment: _sfc_main$e,
20382
- VVGeomPath: _sfc_main$d,
20383
- VVGeomPoint: _sfc_main$c,
20384
- VVGeomPolygon: _sfc_main$b,
20385
- VVGeomRect: _sfc_main$a,
20386
- VVGeomSegment: _sfc_main$9,
20387
- VVGeomStick: _sfc_main$8,
20388
- VVGeomText: _sfc_main$7,
20389
- VVGeomTextsegment: _sfc_main$6,
20390
- VVGeomTile: _sfc_main$5,
20404
+ VVAction: _sfc_main$r,
20405
+ VVAxis: _sfc_main$5,
20406
+ VVAxisBreak: _sfc_main$2,
20407
+ VVAxisX: _sfc_main$4,
20408
+ VVAxisY: _sfc_main$3,
20409
+ VVGeom: _sfc_main$q,
20410
+ VVGeomBar: _sfc_main$p,
20411
+ VVGeomBlank: _sfc_main$o,
20412
+ VVGeomBoxplot: _sfc_main$n,
20413
+ VVGeomCurve: _sfc_main$m,
20414
+ VVGeomDensity: _sfc_main$l,
20415
+ VVGeomEllipse: _sfc_main$k,
20416
+ VVGeomHistogram: _sfc_main$j,
20417
+ VVGeomLine: _sfc_main$i,
20418
+ VVGeomLinerange: _sfc_main$h,
20419
+ VVGeomMarkdown: _sfc_main$g,
20420
+ VVGeomMarkdownsegment: _sfc_main$f,
20421
+ VVGeomPath: _sfc_main$e,
20422
+ VVGeomPoint: _sfc_main$d,
20423
+ VVGeomPolygon: _sfc_main$c,
20424
+ VVGeomRect: _sfc_main$b,
20425
+ VVGeomSegment: _sfc_main$a,
20426
+ VVGeomStick: _sfc_main$9,
20427
+ VVGeomText: _sfc_main$8,
20428
+ VVGeomTextsegment: _sfc_main$7,
20429
+ VVGeomTile: _sfc_main$6,
20391
20430
  VVPlot: _sfc_main$1,
20392
20431
  VVSelection: _sfc_main
20393
20432
  }, Symbol.toStringTag, { value: "Module" }));
20394
20433
  export {
20395
- _sfc_main$q as VVAction,
20396
- _sfc_main$4 as VVAxis,
20397
- _sfc_main$3 as VVAxisX,
20398
- _sfc_main$2 as VVAxisY,
20399
- _sfc_main$p as VVGeom,
20400
- _sfc_main$o as VVGeomBar,
20401
- _sfc_main$n as VVGeomBlank,
20402
- _sfc_main$m as VVGeomBoxplot,
20403
- _sfc_main$l as VVGeomCurve,
20404
- _sfc_main$k as VVGeomDensity,
20405
- _sfc_main$j as VVGeomEllipse,
20406
- _sfc_main$i as VVGeomHistogram,
20407
- _sfc_main$h as VVGeomLine,
20408
- _sfc_main$g as VVGeomLinerange,
20409
- _sfc_main$f as VVGeomMarkdown,
20410
- _sfc_main$e as VVGeomMarkdownsegment,
20411
- _sfc_main$d as VVGeomPath,
20412
- _sfc_main$c as VVGeomPoint,
20413
- _sfc_main$b as VVGeomPolygon,
20414
- _sfc_main$a as VVGeomRect,
20415
- _sfc_main$9 as VVGeomSegment,
20416
- _sfc_main$8 as VVGeomStick,
20417
- _sfc_main$7 as VVGeomText,
20418
- _sfc_main$6 as VVGeomTextsegment,
20419
- _sfc_main$5 as VVGeomTile,
20434
+ _sfc_main$r as VVAction,
20435
+ _sfc_main$5 as VVAxis,
20436
+ _sfc_main$2 as VVAxisBreak,
20437
+ _sfc_main$4 as VVAxisX,
20438
+ _sfc_main$3 as VVAxisY,
20439
+ _sfc_main$q as VVGeom,
20440
+ _sfc_main$p as VVGeomBar,
20441
+ _sfc_main$o as VVGeomBlank,
20442
+ _sfc_main$n as VVGeomBoxplot,
20443
+ _sfc_main$m as VVGeomCurve,
20444
+ _sfc_main$l as VVGeomDensity,
20445
+ _sfc_main$k as VVGeomEllipse,
20446
+ _sfc_main$j as VVGeomHistogram,
20447
+ _sfc_main$i as VVGeomLine,
20448
+ _sfc_main$h as VVGeomLinerange,
20449
+ _sfc_main$g as VVGeomMarkdown,
20450
+ _sfc_main$f as VVGeomMarkdownsegment,
20451
+ _sfc_main$e as VVGeomPath,
20452
+ _sfc_main$d as VVGeomPoint,
20453
+ _sfc_main$c as VVGeomPolygon,
20454
+ _sfc_main$b as VVGeomRect,
20455
+ _sfc_main$a as VVGeomSegment,
20456
+ _sfc_main$9 as VVGeomStick,
20457
+ _sfc_main$8 as VVGeomText,
20458
+ _sfc_main$7 as VVGeomTextsegment,
20459
+ _sfc_main$6 as VVGeomTile,
20420
20460
  _sfc_main$1 as VVPlot,
20421
20461
  _sfc_main as VVSelection,
20422
20462
  index as components,
20423
20463
  number_cut,
20424
20464
  oob,
20425
20465
  vvbreak,
20466
+ vvgeom,
20426
20467
  vvlabel,
20427
20468
  vvscale,
20469
+ vvstat,
20428
20470
  theme as vvtheme
20429
20471
  };