vvplot 0.7.1 → 0.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/chunk-GeomViolin.min.js +11 -11
- package/dist/chunk-base.js +3 -3
- package/dist/chunk-base.min.js +1 -1
- package/dist/chunk-components.js +744 -448
- package/dist/chunk-components.min.js +8 -8
- package/dist/chunk-utils.js +20 -15
- package/dist/chunk-utils.min.js +1 -1
- package/dist/chunk-utils2.js +9 -5
- package/dist/chunk-utils2.min.js +1 -1
- package/dist/components.d.ts +8 -3
- package/dist/components.esm.js +2 -2
- package/dist/components.esm.min.js +1 -1
- package/dist/utils.esm.js +3 -1
- package/dist/utils.esm.min.js +1 -1
- package/dist/vvplot.d.ts +214 -158
- package/dist/vvplot.esm.js +1 -1
- package/dist/vvplot.esm.min.js +1 -1
- package/dist/vvplot.global.js +933 -629
- package/dist/vvplot.global.min.js +25 -25
- package/package.json +2 -2
- package/dist/vvplot.css +0 -6
- package/dist/vvplot.global.css +0 -6
package/dist/chunk-utils.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { exportSVG, serializeSVG } from "./chunk-utils2.js";
|
|
1
2
|
// \0rolldown/runtime.js
|
|
2
3
|
var __create = Object.create;
|
|
3
4
|
var __defProp = Object.defineProperty;
|
|
@@ -14,22 +15,24 @@ var __esmMin = (fn, res, err) => () => {
|
|
|
14
15
|
}
|
|
15
16
|
};
|
|
16
17
|
var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod, mod.exports), cb = null), mod.exports);
|
|
17
|
-
var __exportAll = (all,
|
|
18
|
-
let target = {};
|
|
18
|
+
var __exportAll = (all, flags) => {
|
|
19
|
+
let target = Object.setPrototypeOf({}, null);
|
|
19
20
|
for (var name in all) __defProp(target, name, {
|
|
20
21
|
get: all[name],
|
|
21
22
|
enumerable: true
|
|
22
23
|
});
|
|
23
|
-
if (!
|
|
24
|
-
return target;
|
|
24
|
+
if (!(flags & 1)) __defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
25
|
+
return flags & 2 ? target : Object.preventExtensions(target);
|
|
25
26
|
};
|
|
26
27
|
var __copyProps = (to, from, except, desc) => {
|
|
27
|
-
if (from && typeof from === "object" || typeof from === "function")
|
|
28
|
-
key
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
28
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
29
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) {
|
|
30
|
+
desc = __getOwnPropDesc(from, key);
|
|
31
|
+
__defProp(to, key, {
|
|
32
|
+
get: desc && desc.get && !desc.configurable ? desc.get : () => from[key],
|
|
33
|
+
enumerable: !desc || desc.enumerable
|
|
34
|
+
});
|
|
35
|
+
}
|
|
33
36
|
}
|
|
34
37
|
return to;
|
|
35
38
|
};
|
|
@@ -45,6 +48,7 @@ var utils_exports = /* @__PURE__ */ __exportAll({
|
|
|
45
48
|
EnumLevel: () => EnumLevel,
|
|
46
49
|
categorize: () => categorize,
|
|
47
50
|
deepEqual: () => deepEqual,
|
|
51
|
+
exportSVG: () => exportSVG,
|
|
48
52
|
interaction: () => interaction,
|
|
49
53
|
intraaction: () => intraaction,
|
|
50
54
|
intrazip: () => intrazip,
|
|
@@ -56,6 +60,7 @@ var utils_exports = /* @__PURE__ */ __exportAll({
|
|
|
56
60
|
oob_squish_any: () => oob_squish_any,
|
|
57
61
|
oob_squish_infinite: () => oob_squish_infinite,
|
|
58
62
|
plus: () => plus,
|
|
63
|
+
serializeSVG: () => serializeSVG,
|
|
59
64
|
str_c: () => str_c,
|
|
60
65
|
unique: () => unique,
|
|
61
66
|
vecutils: () => vecutils
|
|
@@ -188,12 +193,12 @@ var numutils = {
|
|
|
188
193
|
min(arr, { na_rm = true, infinity_rm = true } = {}) {
|
|
189
194
|
if (na_rm) arr = arr.filter(is_continuous);
|
|
190
195
|
if (infinity_rm) arr = arr.filter((x) => isFinite(x));
|
|
191
|
-
return Array.from(arr).reduce((a, b) => a < b ? a : b,
|
|
196
|
+
return Array.from(arr).reduce((a, b) => a < b ? a : b, 1e400);
|
|
192
197
|
},
|
|
193
198
|
max(arr, { na_rm = true, infinity_rm = true } = {}) {
|
|
194
199
|
if (na_rm) arr = arr.filter(is_continuous);
|
|
195
200
|
if (infinity_rm) arr = arr.filter((x) => isFinite(x));
|
|
196
|
-
return Array.from(arr).reduce((a, b) => a > b ? a : b, -
|
|
201
|
+
return Array.from(arr).reduce((a, b) => a > b ? a : b, -1e400);
|
|
197
202
|
},
|
|
198
203
|
sum(arr, { na_rm = true, infinity_rm = true } = {}) {
|
|
199
204
|
if (na_rm) arr = arr.filter(is_continuous);
|
|
@@ -231,7 +236,7 @@ var numutils = {
|
|
|
231
236
|
if (na_rm) arr = arr.filter(is_continuous);
|
|
232
237
|
if (infinity_rm) arr = arr.filter((x) => isFinite(x));
|
|
233
238
|
if (arr.length == 0) return new Array(2);
|
|
234
|
-
let min = Array.from(arr).reduce((a, b) => a < b ? a : b,
|
|
239
|
+
let min = Array.from(arr).reduce((a, b) => a < b ? a : b, 1e400), max = Array.from(arr).reduce((a, b) => a > b ? a : b, -1e400);
|
|
235
240
|
return Object.assign([min, max], {
|
|
236
241
|
min,
|
|
237
242
|
max
|
|
@@ -372,8 +377,8 @@ function oob_squish_any(value, { min, max }) {
|
|
|
372
377
|
* @returns {number}
|
|
373
378
|
*/
|
|
374
379
|
function oob_squish_infinite(value, { min, max }) {
|
|
375
|
-
if (value == -
|
|
376
|
-
if (value ==
|
|
380
|
+
if (value == -1e400) return min;
|
|
381
|
+
if (value == 1e400) return max;
|
|
377
382
|
return value;
|
|
378
383
|
}
|
|
379
384
|
/**
|
package/dist/chunk-utils.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
import{i as e,s as t}from"./chunk-utils2.min.js";var n=Object.create,r=Object.defineProperty,i=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,o=Object.getPrototypeOf,s=Object.prototype.hasOwnProperty,c=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(e){throw n=[e],e}},l=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t,t.exports),e=null),t.exports),u=(e,t)=>{let n=Object.setPrototypeOf({},null);for(var i in e)r(n,i,{get:e[i],enumerable:!0});return t&1||r(n,Symbol.toStringTag,{value:`Module`}),t&2?n:Object.preventExtensions(n)},d=(e,t,n,o)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let c of a(t))!s.call(e,c)&&c!==n&&(o=i(t,c),r(e,c,{get:o&&o.get&&!o.configurable?o.get:()=>t[c],enumerable:!o||o.enumerable}));return e},f=(e,t,i)=>(i=e==null?{}:n(o(e)),d(t||!e||!e.__esModule||!s.call(e,`default`)?r(i,`default`,{value:e,enumerable:!0}):i,e)),p=e=>s.call(e,`module.exports`)?e[`module.exports`]:d(r({},`__esModule`,{value:!0}),e),m=/* @__PURE__ */ u({Asis:()=>_,EnumElement:()=>v,EnumLevel:()=>y,categorize:()=>N,deepEqual:()=>M,exportSVG:()=>e,interaction:()=>P,intraaction:()=>F,intrazip:()=>I,is_categorical:()=>x,is_continuous:()=>b,numutils:()=>C,obj_merge:()=>T,oob_censor:()=>k,oob_squish_any:()=>A,oob_squish_infinite:()=>j,plus:()=>S,serializeSVG:()=>t,str_c:()=>E,unique:()=>D,vecutils:()=>w}),h=class extends String{static#e=/* @__PURE__ */ new Map;constructor(e){let t=String(e);if(new.target.#e.has(t))return new.target.#e.get(t);super(t),new.target.#e.set(t,this)}},g=class extends Number{static#e=/* @__PURE__ */ new Map;constructor(e){let t=Number(e);if(new.target.#e.has(t))return new.target.#e.get(t);super(t),new.target.#e.set(t,this)}},_=class{constructor(e){if(typeof e==`string`||e instanceof String)return new h(e);if(typeof e==`number`||e instanceof Number)return new g(e);throw Error(`Unsupported type`)}static[Symbol.hasInstance](e){return e instanceof h||e instanceof g}},v=class{constructor(e,t,n){this.label=e,this.value=t,this.level=n}toString(){return this.label}valueOf(){return this.value}toJSON(){return this.label}},y=class extends Array{static from(e){if(e instanceof this)return e;if(e[Symbol.iterator]){let t=D(Array.from(e).filter(e=>!(e instanceof _)&&e!=null).map(e=>String(e))).sort((e,t)=>O(e,t,{numeric:!0}));return new this(...t)}if(typeof e==`object`){let t=Object.keys(e).map(e=>String(e)).sort((t,n)=>O(e[t],e[n]));return new this(...t)}throw Error(`Invalid level values: ${e}`)}static isEqual(e,t){if(e instanceof this&&t instanceof this)return e.length===t.length&&Array(e.length).fill().every((n,r)=>e[r].label===t[r].label)}constructor(...e){return e=e.map((e,t)=>new v(String(e),t)),e.forEach(t=>t.level=e),e.mapping=Object.fromEntries(e.map(e=>[e,e])),Object.setPrototypeOf(e,new.target.prototype),e}getItem(e){return typeof e==`number`||e instanceof Number?this[e]:this.mapping[e]}apply(e){let t=e.map(e=>e instanceof _?e:this.mapping[e]);return t.level=this,t}};function b(e){return typeof e==`number`||e instanceof Number||e instanceof Date}function x(e){return typeof e==`string`||typeof e==`boolean`||typeof e==`symbol`||typeof e==`object`&&!!e&&typeof e.valueOf()!=`number`&&typeof e.valueOf()!=`bigint`}function S(e,t=0){return t==0||e==null?e:e instanceof Date?new e.constructor(+e+t):+e+t}var C={min(e,{na_rm:t=!0,infinity_rm:n=!0}={}){return t&&(e=e.filter(b)),n&&(e=e.filter(e=>isFinite(e))),Array.from(e).reduce((e,t)=>e<t?e:t,1/0)},max(e,{na_rm:t=!0,infinity_rm:n=!0}={}){return t&&(e=e.filter(b)),n&&(e=e.filter(e=>isFinite(e))),Array.from(e).reduce((e,t)=>e>t?e:t,-1/0)},sum(e,{na_rm:t=!0,infinity_rm:n=!0}={}){return t&&(e=e.filter(b)),n&&(e=e.filter(e=>isFinite(e))),Array.from(e).reduce((e,t)=>e+t,0)},diff(e,{na_rm:t=!0,infinity_rm:n=!0}={}){return t&&(e=e.filter(b)),n&&(e=e.filter(e=>isFinite(e))),Array.from(e).slice(1).map((t,n)=>t-e[n])},mean(e,{na_rm:t=!0,infinity_rm:n=!0}={}){return t&&(e=e.filter(b)),n&&(e=e.filter(e=>isFinite(e))),e.length==0?NaN:Array.from(e).reduce((e,t)=>e+t,0)/e.length},sd(e,{na_rm:t=!0,infinity_rm:n=!0}={}){if(t&&(e=e.filter(b)),n&&(e=e.filter(e=>isFinite(e))),e.length<=1)return NaN;let r=Array.from(e).reduce((e,t)=>e+t,0)/e.length;return Math.sqrt(Array.from(e).reduce((e,t)=>e+(t-r)**2,0)/(e.length-1))},quantile(e,t,{na_rm:n=!0,infinity_rm:r=!0}={}){if(n&&(e=e.filter(b)),r&&(e=e.filter(e=>isFinite(e))),e.length==0)return NaN;e=Array.from(e).sort((e,t)=>e-t);let i=(e.length-1)*t,a=Math.floor(i),o=Math.ceil(i);return a==o?e[a]:e[a]*(o-i)+e[o]*(i-a)},extent(e,{na_rm:t=!0,infinity_rm:n=!0}={}){if(t&&(e=e.filter(b)),n&&(e=e.filter(e=>isFinite(e))),e.length==0)return[,,];let r=Array.from(e).reduce((e,t)=>e<t?e:t,1/0),i=Array.from(e).reduce((e,t)=>e>t?e:t,-1/0);return Object.assign([r,i],{min:r,max:i})}},w={coalesce(e,t){if(Array.isArray(t)){if(!Array.isArray(e)||e.length!=t.length)throw Error(`Value and defaultValue must be arrays of the same length`);return e.map((e,n)=>e??t[n])}return Array.isArray(e)?e.map(e=>e??t):e??t},sum(...e){if(e.some(e=>e==null))return null;if(e.some(e=>!Array.isArray(e)&&typeof e!=`number`))throw Error(`Arguments must be numbers or arrays`);let t=e.filter(e=>!Array.isArray(e)).reduce((e,t)=>+t+e,0);if(e=e.filter(e=>Array.isArray(e)),e.length==0)return[t];let n=e[0].length;if(e.some(e=>e.length!=n))throw Error(`Arrays must have the same length`);return Array.from({length:n},(n,r)=>e.reduce((e,t)=>+(t[r]??void 0)+e,t))},opposite(e){if(e==null)return null;if(!Array.isArray(e)&&typeof e!=`number`)throw Error(`Arguments must be numbers or arrays`);return Array.isArray(e)?e.map(e=>e==null?e:-e):-e},concat(...e){if(e.some(e=>e==null))return null;let t=e.filter(e=>Array.isArray(e));if(t.length==0)return[e.join(``)];if(e.some(e=>e.length==0))return[];let n=t[0].length;if(t.some(e=>e.length!=n))throw Error(`Arrays must have the same length`);return Array.from({length:n},(t,n)=>e.map(e=>Array.isArray(e)?e[n]:e).join(``))},apply(e,...t){if(t.some(e=>e==null))return null;let n=t.filter(e=>Array.isArray(e));if(n.length==0)return[e(...t)];if(t.some(e=>e.length==0))return[];let r=n[0].length;if(n.some(e=>e.length!=r))throw Error(`Arrays must have the same length`);return Array.from({length:r},(n,r)=>e(...t.map(e=>Array.isArray(e)?e[r]:e)))}};function T(...e){if(e=e.filter(e=>e!==void 0),e.length!=0)return e=e.slice(e.findIndex(e=>e==null)+1),e.length==0?null:e.reduce((e,t)=>{for(let n in t)t[n]!==void 0&&(e[n]=t[n]);return e},{})}function E(...e){if(!e.some(e=>e===void 0))return e.some(e=>e===null)?null:e.join(``)}function D(e,t=null,n=null){let r=/* @__PURE__ */ new Map;for(let i in e){let a=t?t(e[i]):e[i];r.has(a)?n&&r.set(a,n(r.get(a),e[i])):r.set(a,e[i])}return Array.from(r.values())}function O(e,t,{numeric:n=!1}={}){return typeof e!=`number`||typeof t!=`number`?String(e).localeCompare(String(t),void 0,{numeric:n}):e-t}function k(e,{min:t,max:n}){return e<t||e>n?NaN:e}function A(e,{min:t,max:n}){return e<t?t:e>n?n:e}function j(e,{min:t,max:n}){return e==-1/0?t:e==1/0?n:e}function M(e,t,n,r=0){if(r>25)throw Error(`deepEqual: maximum recursion depth exceeded`);if(n!=null&&typeof n!=`function`)throw Error(`comparer must be a function`);if(e===t)return!0;if(n!=null){let i=n(e,t,r);if(i===!0||i===!1||i instanceof Boolean)return!!i}if(typeof e!=`object`||typeof t!=`object`||e==null||t==null)return!1;let i=Object.keys(e),a=Object.keys(t);if(i.length!==a.length)return!1;for(let a of i)if(!M(e[a],t[a],n,r+1))return!1;return!0}function N(e,t){if(!Array.isArray(e))throw Error(`Argument must be an array`);let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=n.findIndex(e=>M(e,a,t));o===-1&&(n.push(a),o=n.length-1),r.push(o)}return r.categories=n,r}function P(...e){if(e.length==0)return null;let t=e.filter(e=>Array.isArray(e)).reduce((e,t)=>{if(Array.isArray(t)){if(e==null)return t.length;if(e!=t.length)throw Error(`Arrays must have the same length`)}return e},null)??0,n=[],r=[];for(let i=0;i<t;i++){let t=e.map(e=>Array.isArray(e)?e[i]:e),a=n.findIndex(e=>e.every((e,n)=>e===t[n]));a===-1&&(n.push(t),a=n.length-1),r.push(a)}return r.categories=n,r}function F(e){if(Object.keys(e).length==0)return null;let t=Object.values(e).filter(e=>Array.isArray(e)).reduce((e,t)=>{if(Array.isArray(t)){if(e==null)return t.length;if(e!=t.length)throw Error(`Arrays must have the same length`)}return e},null)??0,n=Object.keys(e),r=[],i=[];for(let a=0;a<t;a++){let t=Object.fromEntries(n.map(t=>[t,Array.isArray(e[t])?e[t][a]:e[t]])),o=r.findIndex(e=>n.every(n=>e[n]===t[n]));o===-1&&(r.push(t),o=r.length-1),i.push(o)}return i.categories=r,i}function I(e){if(Object.keys(e).length==0)return[];let t=Object.values(e).filter(e=>Array.isArray(e)).reduce((e,t)=>{if(Array.isArray(t)){if(e==null)return t.length;if(e!=t.length)throw Error(`Arrays must have the same length`)}return e},null)??0;return Array.from({length:t},(t,n)=>Object.fromEntries(Object.keys(e).map(t=>[t,Array.isArray(e[t])?e[t][n]:e[t]])))}export{u as C,c as S,f as T,E as _,M as a,w as b,I as c,C as d,T as f,S as g,j as h,N as i,x as l,A as m,v as n,P as o,k as p,y as r,F as s,_ as t,b as u,D as v,p as w,l as x,m as y};
|
package/dist/chunk-utils2.js
CHANGED
|
@@ -136,13 +136,17 @@ function normalizeSVG(svgElement) {
|
|
|
136
136
|
foreignClone.parentNode.replaceChild(img, foreignClone);
|
|
137
137
|
}
|
|
138
138
|
for (let node of svgClone.querySelectorAll(".vvplot-interactive,foreignObject")) node.remove();
|
|
139
|
+
let bbox = svgElement.getBoundingClientRect();
|
|
139
140
|
removeComments(svgClone);
|
|
140
141
|
svgClone.setAttribute("xmlns", "http://www.w3.org/2000/svg");
|
|
141
142
|
svgClone.setAttribute("xmlns:xlink", "http://www.w3.org/1999/xlink");
|
|
142
143
|
svgClone.setAttribute("version", "1.1");
|
|
143
144
|
svgClone.removeAttribute("width");
|
|
144
145
|
svgClone.removeAttribute("height");
|
|
145
|
-
svgClone.
|
|
146
|
+
svgClone.removeAttribute("x");
|
|
147
|
+
svgClone.removeAttribute("y");
|
|
148
|
+
svgClone.removeAttribute("transform");
|
|
149
|
+
svgClone.setAttribute("viewBox", `0 0 ${svgElement.scrollWidth || bbox.width} ${svgElement.scrollHeight || bbox.height}`);
|
|
146
150
|
return svgClone;
|
|
147
151
|
}
|
|
148
152
|
/**
|
|
@@ -156,8 +160,8 @@ function serializeSVG(svgElement, { unit = "mm" } = {}) {
|
|
|
156
160
|
if (!(svgElement instanceof SVGElement)) return null;
|
|
157
161
|
let svg = normalizeSVG(svgElement);
|
|
158
162
|
if (!unitInPx[unit]) unit = "";
|
|
159
|
-
svg.setAttribute("width",
|
|
160
|
-
svg.setAttribute("height",
|
|
163
|
+
svg.setAttribute("width", svg.viewBox.baseVal.width / unitInPx[unit] + unit);
|
|
164
|
+
svg.setAttribute("height", svg.viewBox.baseVal.height / unitInPx[unit] + unit);
|
|
161
165
|
return new XMLSerializer().serializeToString(svg);
|
|
162
166
|
}
|
|
163
167
|
/**
|
|
@@ -171,8 +175,8 @@ async function exportSVG(svgElement, { unit = "mm" } = {}) {
|
|
|
171
175
|
if (!(svgElement instanceof SVGElement)) return null;
|
|
172
176
|
let svg = normalizeSVG(svgElement);
|
|
173
177
|
if (!unitInPx[unit]) unit = "";
|
|
174
|
-
svg.setAttribute("width",
|
|
175
|
-
svg.setAttribute("height",
|
|
178
|
+
svg.setAttribute("width", svg.viewBox.baseVal.width / unitInPx[unit] + unit);
|
|
179
|
+
svg.setAttribute("height", svg.viewBox.baseVal.height / unitInPx[unit] + unit);
|
|
176
180
|
const cache = /* @__PURE__ */ new Map();
|
|
177
181
|
for (let el of svg.querySelectorAll("image")) {
|
|
178
182
|
let href = el.getAttribute("href") ?? el.getAttribute("xlink:href");
|
package/dist/chunk-utils2.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Fragment as e,computed as t}from"vue";function n(t){return t==null?[]:t.flatMap(t=>t.type==e?n(t.children):t.type==`template`?n(t.children).map(e=>(e.props={...e.props,...t.props},e)):t)}var r=/* @__PURE__ */ new WeakMap;function i(e){return t(()=>{let t=r.get(e);if(t)return t;let n={};for(let t in e)n[t]=e[t];n.bubbles=!1;let i=new PointerEvent(e.type,n);for(let t of Object.keys(e)){let n=Object.getOwnPropertyDescriptor(i,t);(!n||n.writable||n.set)&&(i[t]=e[t])}return r.set(e,i),i})}var a=[`click`,`contextmenu`,`singleclick`,`dblclick`,`pointerover`,`pointerout`,`pointerenter`,`pointerleave`,`pointermove`,`pointerdown`,`pointerup`,`wheel`];function o(e,...t){return Array.isArray(e)?(e=e.filter(e=>typeof e==`function`),e.length!==0&&(e.forEach(e=>e(...t)),!0)):typeof e==`function`&&(e(...t),!0)}function s(e){return e==null?[]:Array.isArray(e)?e:e===`solid`?[]:e===`dashed`?[4,4]:e===`dotted`?[1,3]:e===`dotdash`?[1,3,4,3]:e===`longdash`?[8,4]:e===`twodash`?[2,2,6,2]:e.includes(` `)?e.split(` `).map(e=>+e):e.split(``).map(e=>+(`0x`+e))}function c(e){return typeof e!=`object`||!e?e:Object.fromEntries(Object.entries(e).filter(([e,t])=>t!=null))}var l={"":1,px:1,in:96,cm:96/2.54,mm:96/25.4,pt:96/72,pc:16};function u(e){if(!(e instanceof SVGElement))return null;function t(e){let n=e.childNodes.length;for(;n--;){let r=e.childNodes[n];r.nodeType===Node.COMMENT_NODE?e.removeChild(r):r.nodeType===Node.ELEMENT_NODE&&(t(r),r.getAttribute(`style`)==``&&r.removeAttribute(`style`),r.getAttribute(`class`)==``&&r.removeAttribute(`class`))}}let n=e.cloneNode(!0),r=Array.from(e.querySelectorAll(`foreignObject`)),i=Array.from(n.querySelectorAll(`foreignObject`));for(let e=0;e<r.length;e++){let t=r[e],a=i[e],o=r[e].querySelector(`canvas`);if(!o)continue;let s=n.ownerDocument.createElementNS(`http://www.w3.org/2000/svg`,`image`);s.setAttribute(`href`,o.toDataURL()),s.setAttribute(`x`,t.getAttribute(`x`)),s.setAttribute(`y`,t.getAttribute(`y`)),s.setAttribute(`width`,t.getAttribute(`width`)),s.setAttribute(`height`,t.getAttribute(`height`)),a.parentNode.replaceChild(s,a)}for(let e of n.querySelectorAll(`.vvplot-interactive,foreignObject`))e.remove();return t(n),n.setAttribute(`xmlns`,`http://www.w3.org/2000/svg`),n.setAttribute(`xmlns:xlink`,`http://www.w3.org/1999/xlink`),n.setAttribute(`version`,`1.1`),n.removeAttribute(`width`),n.removeAttribute(`height`),n.setAttribute(`viewBox`,`0 0 ${e.scrollWidth} ${e.scrollHeight}`),n}function d(e,{unit:t=`mm`}={}){if(!(e instanceof SVGElement))return null;let n=u(e);return l[t]||(t=``),n.setAttribute(`width`,
|
|
1
|
+
import{Fragment as e,computed as t}from"vue";function n(t){return t==null?[]:t.flatMap(t=>t.type==e?n(t.children):t.type==`template`?n(t.children).map(e=>(e.props={...e.props,...t.props},e)):t)}var r=/* @__PURE__ */ new WeakMap;function i(e){return t(()=>{let t=r.get(e);if(t)return t;let n={};for(let t in e)n[t]=e[t];n.bubbles=!1;let i=new PointerEvent(e.type,n);for(let t of Object.keys(e)){let n=Object.getOwnPropertyDescriptor(i,t);(!n||n.writable||n.set)&&(i[t]=e[t])}return r.set(e,i),i})}var a=[`click`,`contextmenu`,`singleclick`,`dblclick`,`pointerover`,`pointerout`,`pointerenter`,`pointerleave`,`pointermove`,`pointerdown`,`pointerup`,`wheel`];function o(e,...t){return Array.isArray(e)?(e=e.filter(e=>typeof e==`function`),e.length!==0&&(e.forEach(e=>e(...t)),!0)):typeof e==`function`&&(e(...t),!0)}function s(e){return e==null?[]:Array.isArray(e)?e:e===`solid`?[]:e===`dashed`?[4,4]:e===`dotted`?[1,3]:e===`dotdash`?[1,3,4,3]:e===`longdash`?[8,4]:e===`twodash`?[2,2,6,2]:e.includes(` `)?e.split(` `).map(e=>+e):e.split(``).map(e=>+(`0x`+e))}function c(e){return typeof e!=`object`||!e?e:Object.fromEntries(Object.entries(e).filter(([e,t])=>t!=null))}var l={"":1,px:1,in:96,cm:96/2.54,mm:96/25.4,pt:96/72,pc:16};function u(e){if(!(e instanceof SVGElement))return null;function t(e){let n=e.childNodes.length;for(;n--;){let r=e.childNodes[n];r.nodeType===Node.COMMENT_NODE?e.removeChild(r):r.nodeType===Node.ELEMENT_NODE&&(t(r),r.getAttribute(`style`)==``&&r.removeAttribute(`style`),r.getAttribute(`class`)==``&&r.removeAttribute(`class`))}}let n=e.cloneNode(!0),r=Array.from(e.querySelectorAll(`foreignObject`)),i=Array.from(n.querySelectorAll(`foreignObject`));for(let e=0;e<r.length;e++){let t=r[e],a=i[e],o=r[e].querySelector(`canvas`);if(!o)continue;let s=n.ownerDocument.createElementNS(`http://www.w3.org/2000/svg`,`image`);s.setAttribute(`href`,o.toDataURL()),s.setAttribute(`x`,t.getAttribute(`x`)),s.setAttribute(`y`,t.getAttribute(`y`)),s.setAttribute(`width`,t.getAttribute(`width`)),s.setAttribute(`height`,t.getAttribute(`height`)),a.parentNode.replaceChild(s,a)}for(let e of n.querySelectorAll(`.vvplot-interactive,foreignObject`))e.remove();let a=e.getBoundingClientRect();return t(n),n.setAttribute(`xmlns`,`http://www.w3.org/2000/svg`),n.setAttribute(`xmlns:xlink`,`http://www.w3.org/1999/xlink`),n.setAttribute(`version`,`1.1`),n.removeAttribute(`width`),n.removeAttribute(`height`),n.removeAttribute(`x`),n.removeAttribute(`y`),n.removeAttribute(`transform`),n.setAttribute(`viewBox`,`0 0 ${e.scrollWidth||a.width} ${e.scrollHeight||a.height}`),n}function d(e,{unit:t=`mm`}={}){if(!(e instanceof SVGElement))return null;let n=u(e);return l[t]||(t=``),n.setAttribute(`width`,n.viewBox.baseVal.width/l[t]+t),n.setAttribute(`height`,n.viewBox.baseVal.height/l[t]+t),new XMLSerializer().serializeToString(n)}async function f(e,{unit:t=`mm`}={}){if(!(e instanceof SVGElement))return null;let n=u(e);l[t]||(t=``),n.setAttribute(`width`,n.viewBox.baseVal.width/l[t]+t),n.setAttribute(`height`,n.viewBox.baseVal.height/l[t]+t);let r=/* @__PURE__ */ new Map;for(let e of n.querySelectorAll(`image`)){let t=e.getAttribute(`href`)??e.getAttribute(`xlink:href`);if(!t.startsWith(`data:`)){try{let e=await fetch(t);if(!e.ok)throw Error(`Failed to fetch image: ${e.status}`);r.set(t,await blobToDataURL(await e.blob()))}catch(e){console.warn(`Failed to inline image ${t}: ${e.message}`)}r.has(t)&&e.setAttribute(`href`,r.get(t))}}return new XMLSerializer().serializeToString(n)}export{s as a,i as c,f as i,o as n,a as o,n as r,d as s,c as t};
|
package/dist/components.d.ts
CHANGED
|
@@ -38,10 +38,12 @@ ymax: any;
|
|
|
38
38
|
svg: any;
|
|
39
39
|
serialize(options: any): string;
|
|
40
40
|
export(options: any): Promise<string>;
|
|
41
|
-
serializeLegend(options: any):
|
|
41
|
+
serializeLegend(key: any, options: any): string;
|
|
42
|
+
exportLegend(key: any, options: any): Promise<string>;
|
|
42
43
|
$emit: (event: "rangechange" | "resize" | "select" | "update:range" | "update:rangePreview", ...args: any[]) => void;
|
|
43
44
|
flip: boolean;
|
|
44
45
|
clip: boolean;
|
|
46
|
+
overflow: string;
|
|
45
47
|
reverse?: Record<string, any> | undefined;
|
|
46
48
|
action?: Record<string, any> | unknown[] | undefined;
|
|
47
49
|
range?: Record<string, any> | undefined;
|
|
@@ -56,13 +58,13 @@ resize?: any;
|
|
|
56
58
|
minRange?: Record<string, any> | undefined;
|
|
57
59
|
expandAdd?: Record<string, any> | undefined;
|
|
58
60
|
axes?: Record<string, any> | unknown[] | undefined;
|
|
59
|
-
legendTeleport?: any;
|
|
60
61
|
aes?: Record<string, any> | undefined;
|
|
61
62
|
extend?: Record<string, any> | undefined;
|
|
62
63
|
rangePreview?: Record<string, any> | undefined;
|
|
63
64
|
$props: {
|
|
64
65
|
readonly flip?: boolean | undefined;
|
|
65
66
|
readonly clip?: boolean | undefined;
|
|
67
|
+
readonly overflow?: string | undefined;
|
|
66
68
|
readonly reverse?: Record<string, any> | undefined;
|
|
67
69
|
readonly action?: Record<string, any> | unknown[] | undefined;
|
|
68
70
|
readonly range?: Record<string, any> | undefined;
|
|
@@ -77,7 +79,6 @@ readonly resize?: any;
|
|
|
77
79
|
readonly minRange?: Record<string, any> | undefined;
|
|
78
80
|
readonly expandAdd?: Record<string, any> | undefined;
|
|
79
81
|
readonly axes?: Record<string, any> | unknown[] | undefined;
|
|
80
|
-
readonly legendTeleport?: any;
|
|
81
82
|
readonly aes?: Record<string, any> | undefined;
|
|
82
83
|
readonly extend?: Record<string, any> | undefined;
|
|
83
84
|
readonly rangePreview?: Record<string, any> | undefined;
|
|
@@ -148,6 +149,10 @@ export declare const VVGeomTile: DefineComponent< {}, {}, {}, {}, {}, Compone
|
|
|
148
149
|
|
|
149
150
|
export declare const VVGeomViolin: DefineComponent< {}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
|
|
150
151
|
|
|
152
|
+
export declare const VVGuide: DefineComponent< {}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
|
|
153
|
+
|
|
154
|
+
export declare const VVLegend: DefineComponent< {}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
|
|
155
|
+
|
|
151
156
|
export declare const VVPlot: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
152
157
|
|
|
153
158
|
export declare const VVSelection: DefineComponent< {}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
|
package/dist/components.esm.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { _sfc_main as _sfc_main$
|
|
1
|
+
import { _sfc_main as _sfc_main$31, _sfc_main$10 as _sfc_main$1, _sfc_main$2 as _sfc_main$29, _sfc_main$3 as _sfc_main$30, _sfc_main$4 as _sfc_main$5, _sfc_main$5 as _sfc_main$32, _sfc_main$6 as _sfc_main, _sfc_main$7 as _sfc_main$2, _sfc_main$8 as _sfc_main$4, _sfc_main$9 as _sfc_main$3 } from "./chunk-components.js";
|
|
2
2
|
import { _sfc_main as _sfc_main$28, _sfc_main$1 as _sfc_main$27, _sfc_main$10 as _sfc_main$18, _sfc_main$11 as _sfc_main$17, _sfc_main$12 as _sfc_main$16, _sfc_main$13 as _sfc_main$15, _sfc_main$14, _sfc_main$15 as _sfc_main$13, _sfc_main$16 as _sfc_main$12, _sfc_main$17 as _sfc_main$11, _sfc_main$18 as _sfc_main$10, _sfc_main$19 as _sfc_main$9, _sfc_main$2 as _sfc_main$26, _sfc_main$20 as _sfc_main$8, _sfc_main$21 as _sfc_main$7, _sfc_main$22 as _sfc_main$6, _sfc_main$3 as _sfc_main$25, _sfc_main$4 as _sfc_main$24, _sfc_main$5 as _sfc_main$23, _sfc_main$6 as _sfc_main$22, _sfc_main$7 as _sfc_main$21, _sfc_main$8 as _sfc_main$20, _sfc_main$9 as _sfc_main$19 } from "./chunk-GeomViolin.js";
|
|
3
|
-
export { _sfc_main as VVAction, _sfc_main$1 as VVAxis, _sfc_main$2 as VVAxisBreak, _sfc_main$3 as VVAxisX, _sfc_main$4 as VVAxisY, _sfc_main$5 as VVGeom, _sfc_main$6 as VVGeomBar, _sfc_main$7 as VVGeomBlank, _sfc_main$8 as VVGeomBoxplot, _sfc_main$9 as VVGeomCol, _sfc_main$10 as VVGeomCurve, _sfc_main$11 as VVGeomDensity, _sfc_main$12 as VVGeomEllipse, _sfc_main$13 as VVGeomHistogram, _sfc_main$14 as VVGeomLine, _sfc_main$15 as VVGeomLinerange, _sfc_main$16 as VVGeomMarkdown, _sfc_main$17 as VVGeomMarkdownsegment, _sfc_main$18 as VVGeomPath, _sfc_main$19 as VVGeomPoint, _sfc_main$20 as VVGeomPolygon, _sfc_main$21 as VVGeomRect, _sfc_main$22 as VVGeomSegment, _sfc_main$23 as VVGeomShape, _sfc_main$24 as VVGeomStick, _sfc_main$25 as VVGeomText, _sfc_main$26 as VVGeomTextsegment, _sfc_main$27 as VVGeomTile, _sfc_main$28 as VVGeomViolin, _sfc_main$29 as
|
|
3
|
+
export { _sfc_main as VVAction, _sfc_main$1 as VVAxis, _sfc_main$2 as VVAxisBreak, _sfc_main$3 as VVAxisX, _sfc_main$4 as VVAxisY, _sfc_main$5 as VVGeom, _sfc_main$6 as VVGeomBar, _sfc_main$7 as VVGeomBlank, _sfc_main$8 as VVGeomBoxplot, _sfc_main$9 as VVGeomCol, _sfc_main$10 as VVGeomCurve, _sfc_main$11 as VVGeomDensity, _sfc_main$12 as VVGeomEllipse, _sfc_main$13 as VVGeomHistogram, _sfc_main$14 as VVGeomLine, _sfc_main$15 as VVGeomLinerange, _sfc_main$16 as VVGeomMarkdown, _sfc_main$17 as VVGeomMarkdownsegment, _sfc_main$18 as VVGeomPath, _sfc_main$19 as VVGeomPoint, _sfc_main$20 as VVGeomPolygon, _sfc_main$21 as VVGeomRect, _sfc_main$22 as VVGeomSegment, _sfc_main$23 as VVGeomShape, _sfc_main$24 as VVGeomStick, _sfc_main$25 as VVGeomText, _sfc_main$26 as VVGeomTextsegment, _sfc_main$27 as VVGeomTile, _sfc_main$28 as VVGeomViolin, _sfc_main$29 as VVGuide, _sfc_main$30 as VVLegend, _sfc_main$31 as VVPlot, _sfc_main$32 as VVSelection };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{_ as e,d as t,f as n,g as r,h as i,l as a,m as o,n as s,p as c,u as l}from"./chunk-components.min.js";import{C as u,S as d,_ as f,a as p,b as m,c as h,d as g,f as _,g as v,h as y,i as b,l as x,m as S,n as C,o as w,p as T,r as E,s as D,t as O,u as k,v as A,x as j,y as M}from"./chunk-GeomViolin.min.js";export{c as VVAction,e as VVAxis,o as VVAxisBreak,r as VVAxisX,i as VVAxisY,t as VVGeom,u as VVGeomBar,d as VVGeomBlank,j as VVGeomBoxplot,m as VVGeomCol,M as VVGeomCurve,A as VVGeomDensity,f as VVGeomEllipse,v as VVGeomHistogram,y as VVGeomLine,S as VVGeomLinerange,T as VVGeomMarkdown,_ as VVGeomMarkdownsegment,g as VVGeomPath,k as VVGeomPoint,x as VVGeomPolygon,h as VVGeomRect,D as VVGeomSegment,w as VVGeomShape,p as VVGeomStick,b as VVGeomText,E as VVGeomTextsegment,C as VVGeomTile,O as VVGeomViolin,a as VVGuide,l as VVLegend,s as VVPlot,n as VVSelection};
|
package/dist/utils.esm.js
CHANGED
|
@@ -1 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
import { Asis, EnumElement, EnumLevel, categorize, deepEqual, interaction, intraaction, intrazip, is_categorical, is_continuous, numutils, obj_merge, oob_censor, oob_squish_any, oob_squish_infinite, plus, str_c, unique, vecutils } from "./chunk-utils.js";
|
|
2
|
+
import { exportSVG, serializeSVG } from "./chunk-utils2.js";
|
|
3
|
+
export { Asis, EnumElement, EnumLevel, categorize, deepEqual, exportSVG, interaction, intraaction, intrazip, is_categorical, is_continuous, numutils, obj_merge, oob_censor, oob_squish_any, oob_squish_infinite, plus, serializeSVG, str_c, unique, vecutils };
|
package/dist/utils.esm.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{_ as e,a as t,b as n,c as r,d as i,f as a,g as o,h as s,i as c,l,m as u,n as d,o as f,p,r as m,s as h,t as g,u as _,v}from"./chunk-utils.min.js";import{i as y,s as b}from"./chunk-utils2.min.js";export{g as Asis,d as EnumElement,m as EnumLevel,c as categorize,t as deepEqual,y as exportSVG,f as interaction,h as intraaction,r as intrazip,l as is_categorical,_ as is_continuous,i as numutils,a as obj_merge,p as oob_censor,u as oob_squish_any,s as oob_squish_infinite,o as plus,b as serializeSVG,e as str_c,v as unique,n as vecutils};
|