@rnacanvas/draw.svg 1.3.0 → 1.4.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.
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as SVG from '@svgdotjs/svg.js';
|
|
2
|
+
/**
|
|
3
|
+
* The vertical scaling factor for a target SVG document
|
|
4
|
+
* going from the coordinate system of the SVG document (as determined by its view box)
|
|
5
|
+
* to the client coordinate system (i.e., the coordinate system used by methods such as `getBoundingClientRect`).
|
|
6
|
+
*/
|
|
7
|
+
export declare class VerticalClientScaling {
|
|
8
|
+
private targetSVGDoc;
|
|
9
|
+
constructor(targetSVGDoc: SVG.Svg);
|
|
10
|
+
/**
|
|
11
|
+
* Can possibly return a nonfinite value
|
|
12
|
+
* (e.g., if the target SVG document has a height of zero).
|
|
13
|
+
*/
|
|
14
|
+
get(): number;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=VerticalClientScaling.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VerticalClientScaling.d.ts","sourceRoot":"","sources":["../src/VerticalClientScaling.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,kBAAkB,CAAC;AAExC;;;;GAIG;AACH,qBAAa,qBAAqB;IACpB,OAAO,CAAC,YAAY;gBAAZ,YAAY,EAAE,GAAG,CAAC,GAAG;IAEzC;;;OAGG;IACH,GAAG,IAAI,MAAM;CAMd"}
|
package/dist/index.d.ts
CHANGED
|
@@ -4,4 +4,6 @@ import { Scaling } from './Scaling';
|
|
|
4
4
|
export { Scaling };
|
|
5
5
|
import { HorizontalClientScaling } from './HorizontalClientScaling';
|
|
6
6
|
export { HorizontalClientScaling };
|
|
7
|
+
import { VerticalClientScaling } from './VerticalClientScaling';
|
|
8
|
+
export { VerticalClientScaling };
|
|
7
9
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,CAAC;AAEtB,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,CAAC;AAEnB,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,uBAAuB,EAAE,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,CAAC;AAEtB,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,CAAC;AAEnB,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,uBAAuB,EAAE,CAAC;AAEnC,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,qBAAqB,EAAE,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports["draw.svg"]=e():t["draw.svg"]=e()}(this,(()=>(()=>{"use strict";var t={d:(e,o)=>{for(var
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports["draw.svg"]=e():t["draw.svg"]=e()}(this,(()=>(()=>{"use strict";var t={d:(e,o)=>{for(var n in o)t.o(o,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:o[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{HorizontalClientScaling:()=>p,Scaling:()=>d,VerticalClientScaling:()=>s,assignUUID:()=>a});const o={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let n;const r=new Uint8Array(16);function i(){if(!n&&(n="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!n))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return n(r)}const c=[];for(let t=0;t<256;++t)c.push((t+256).toString(16).slice(1));const u=function(t,e,n){if(o.randomUUID&&!e&&!t)return o.randomUUID();const r=(t=t||{}).random||(t.rng||i)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,e){n=n||0;for(let t=0;t<16;++t)e[n+t]=r[t];return e}return function(t,e=0){return c[t[e+0]]+c[t[e+1]]+c[t[e+2]]+c[t[e+3]]+"-"+c[t[e+4]]+c[t[e+5]]+"-"+c[t[e+6]]+c[t[e+7]]+"-"+c[t[e+8]]+c[t[e+9]]+"-"+c[t[e+10]]+c[t[e+11]]+c[t[e+12]]+c[t[e+13]]+c[t[e+14]]+c[t[e+15]]}(r)};function a(t){t.attr("id","uuid-"+u())}var d=function(){function t(t){this.targetSVGDoc=t}return t.prototype.set=function(t){var e=this.targetSVGDoc.viewbox();this.targetSVGDoc.attr({width:t*e.width+"px",height:t*e.height+"px"})},t}(),p=function(){function t(t){this.targetSVGDoc=t}return t.prototype.get=function(){var t=this.targetSVGDoc.node.getBoundingClientRect(),e=this.targetSVGDoc.viewbox();return t.width/e.width},t}(),s=function(){function t(t){this.targetSVGDoc=t}return t.prototype.get=function(){var t=this.targetSVGDoc.node.getBoundingClientRect(),e=this.targetSVGDoc.viewbox();return t.height/e.height},t}();return e})()));
|