@rnacanvas/draw.bases.numberings 1.5.0 → 1.6.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.
@@ -4,6 +4,19 @@ export declare class BaseNumbering<B extends Nucleobase> {
4
4
  #private;
5
5
  readonly domNode: SVGTextElement;
6
6
  readonly owner: B;
7
+ static defaultValues: {
8
+ attributes: {
9
+ 'font-family': string;
10
+ 'font-size': string;
11
+ 'font-weight': string;
12
+ fill: string;
13
+ };
14
+ };
15
+ /**
16
+ * Creates and returns a new base numbering
17
+ * that numbers the given base the specified number.
18
+ */
19
+ static numbering<B extends Nucleobase>(b: B, n: number): BaseNumbering<B>;
7
20
  readonly centerPoint: CenterPoint;
8
21
  constructor(domNode: SVGTextElement, owner: B);
9
22
  get id(): string;
@@ -1 +1 @@
1
- {"version":3,"file":"BaseNumbering.d.ts","sourceRoot":"","sources":["../src/BaseNumbering.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAMvD,qBAAa,aAAa,CAAC,CAAC,SAAS,UAAU;;IAKjC,QAAQ,CAAC,OAAO,EAAE,cAAc;IAAE,QAAQ,CAAC,KAAK,EAAE,CAAC;IAJ/D,QAAQ,CAAC,WAAW,cAAC;gBAIA,OAAO,EAAE,cAAc,EAAW,KAAK,EAAE,CAAC;IAa/D,IAAI,EAAE,WAEL;IAED,IAAI,WAAW,kBAEd;IAED,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAInC,YAAY,CAAC,IAAI,EAAE,MAAM;IAIzB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI;IAI/C,aAAa,CAAC,UAAU,EAAE;QAAE,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,GAAG,IAAI;IAI3D,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAInC,IAAI,YAAY;;;;;MAsCf;CACF"}
1
+ {"version":3,"file":"BaseNumbering.d.ts","sourceRoot":"","sources":["../src/BaseNumbering.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAI/C,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAMvD,qBAAa,aAAa,CAAC,CAAC,SAAS,UAAU;;IAkCjC,QAAQ,CAAC,OAAO,EAAE,cAAc;IAAE,QAAQ,CAAC,KAAK,EAAE,CAAC;IAjC/D,MAAM,CAAC,aAAa;;;;;;;MAOlB;IAEF;;;OAGG;IACH,MAAM,CAAC,SAAS,CAAC,CAAC,SAAS,UAAU,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,GAAG,aAAa,CAAC,CAAC,CAAC;IAgBzE,QAAQ,CAAC,WAAW,cAAC;gBAIA,OAAO,EAAE,cAAc,EAAW,KAAK,EAAE,CAAC;IAa/D,IAAI,EAAE,WAEL;IAED,IAAI,WAAW,kBAEd;IAED,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAInC,YAAY,CAAC,IAAI,EAAE,MAAM;IAIzB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI;IAI/C,aAAa,CAAC,UAAU,EAAE;QAAE,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,GAAG,IAAI;IAI3D,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAInC,IAAI,YAAY;;;;;MAsCf;CACF"}
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.bases.numberings"]=e():t["draw.bases.numberings"]=e()}(this,(()=>(()=>{var t={731:function(t){var e;e=()=>(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[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,{CenterPoint:()=>c});var r,n,i,o,s,a=function(t,e,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(t,r):i?i.value=r:e.set(t,r),r},u=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class c{constructor(t){r.add(this),n.set(this,void 0),i.set(this,{move:[]}),o.set(this,void 0),a(this,n,t,"f"),a(this,o,new MutationObserver((()=>u(this,r,"m",s).call(this,"move"))),"f"),u(this,o,"f").observe(t,{attributes:!0,childList:!0,characterData:!0,subtree:!0})}get x(){let t=u(this,n,"f").getBBox();return t.x+t.width/2}set x(t){let e=this.x,r=[...u(this,n,"f").x.baseVal].map((t=>t.value));0!=r.length||r.push(0),r=r.map((r=>r+(t-e))),u(this,n,"f").setAttribute("x",r.join(", "))}get y(){let t=u(this,n,"f").getBBox();return t.y+t.height/2}set y(t){let e=this.y,r=[...u(this,n,"f").y.baseVal].map((t=>t.value));0!=r.length||r.push(0),r=r.map((r=>r+(t-e))),u(this,n,"f").setAttribute("y",r.join(", "))}addEventListener(t,e){u(this,i,"f")[t].push(e)}removeEventListener(t,e){u(this,i,"f")[t]=u(this,i,"f")[t].filter((t=>t!==e))}}return n=new WeakMap,i=new WeakMap,o=new WeakMap,r=new WeakSet,s=function(t){u(this,i,"f")[t].forEach((t=>t()))},e})(),t.exports=e()},725:function(t){t.exports=(()=>{var t={986:function(t){t.exports=(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[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={};function r(t){var e=0;return t.forEach((function(t){return e+=t})),e}function n(t){return r(t)/t.length}function i(t){t.sort((function(t,e){return t-e}))}t.r(e),t.d(e,{areWithin:()=>l,average:()=>n,degrees:()=>p,isBetweenExclusive:()=>d,isBetweenInclusive:()=>f,max:()=>c,mean:()=>n,median:()=>a,min:()=>u,radians:()=>m,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>h,sortedNumbers:()=>s,sortedNumbersAscending:()=>s,sortedNumbersDescending:()=>y,sum:()=>r});var o=function(t,e,r){if(r||2===arguments.length)for(var n,i=0,o=e.length;i<o;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||Array.prototype.slice.call(e))};function s(t){var e=o([],t,!0);return i(e),e}function a(t){if(0==t.length)return NaN;var e=s(t);if(e.length%2!=0)return e[Math.floor(e.length/2)];var r=e.length/2,i=r-1;return n([e[r],e[i]])}function u(t){if(0==t.length)return 1/0;var e=t[0];return t.slice(1).forEach((function(t){e=Math.min(e,t)})),e}function c(t){if(0==t.length)return-1/0;var e=t[0];return t.slice(1).forEach((function(t){e=Math.max(e,t)})),e}function f(t,e,r){return t>=e&&t<=r}function d(t,e,r){return t>e&&t<r}function l(t,e,r){return Math.abs(t-e)<=r}function h(t){i(t),t.reverse()}function y(t){var e=s(t);return e.reverse(),e}function p(t){return t*(180/Math.PI)}function m(t){return t*(Math.PI/180)}return e})()},854:function(t){t.exports=(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[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={};function r(t){return"number"==typeof t}function n(t){return r(t)&&Number.isFinite(t)}function i(t){return r(t)&&!Number.isFinite(t)}function o(t){return n(t)&&t>0}function s(t){return n(t)&&t>=0}function a(t){return"string"==typeof t}function u(t){return null==t}function c(t){return"object"==typeof t&&null!==t}function f(t){return Array.isArray(t)}return t.r(e),t.d(e,{isArray:()=>f,isFiniteNumber:()=>n,isNonFiniteNumber:()=>i,isNonNegativeFiniteNumber:()=>s,isNonNullObject:()=>c,isNullish:()=>u,isNumber:()=>r,isPositiveFiniteNumber:()=>o,isString:()=>a}),e})()},30:function(t){t.exports=(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[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={};function r(t){return Math.pow(Math.pow(t.x,2)+Math.pow(t.y,2),.5)}function n(t){return Math.atan2(t.y,t.x)}return t.r(e),t.d(e,{direction:()=>n,magnitude:()=>r}),e})()}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var o=e[n]={exports:{}};return t[n].call(o.exports,o,o.exports,r),o.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";r.r(n),r.d(n,{areWithin:()=>a,centroid:()=>h,deepCopy:()=>o,direction:()=>d,displaced:()=>c,displacement:()=>u,distance:()=>s,isFinitePoint:()=>i,isPoint:()=>e,midpoint:()=>y});var t=r(854);function e(e){return(0,t.isNonNullObject)(e)&&(0,t.isNumber)(e.x)&&(0,t.isNumber)(e.y)}function i(r){return e(r)&&(0,t.isFiniteNumber)(r.x)&&(0,t.isFiniteNumber)(r.y)}function o(t){return{x:t.x,y:t.y}}function s(t,e){var r=e.x-t.x,n=e.y-t.y;return Math.pow(Math.pow(r,2)+Math.pow(n,2),.5)}function a(t,e,r){return s(t,e)<=r}function u(t,e){return{x:e.x-t.x,y:e.y-t.y}}function c(t,e){return{x:t.x+e.x,y:t.y+e.y}}var f=r(30);function d(t,e){return(0,f.direction)(u(t,e))}var l=r(986);function h(t){return{x:(0,l.mean)(t.map((function(t){return t.x}))),y:(0,l.mean)(t.map((function(t){return t.y})))}}function y(t,e){return h([t,e])}})(),n})()},277:function(t){var e;e=()=>(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[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,{Vector:()=>r});class r{static matching(t){return new r(t.x,t.y)}constructor(t,e){this.x=t,this.y=e}[Symbol.iterator](){return[this.x,this.y].values()}get magnitude(){return Math.sqrt(Math.pow(this.x,2)+Math.pow(this.y,2))}set magnitude(t){let e=this.direction;this.x=t*Math.cos(e),this.y=t*Math.sin(e)}get direction(){return Math.atan2(this.y,this.x)}set direction(t){let e=this.magnitude;this.x=e*Math.cos(t),this.y=e*Math.sin(t)}}return e})(),t.exports=e()}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var o=e[n]={exports:{}};return t[n].call(o.exports,o,o.exports,r),o.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";r.r(n),r.d(n,{BaseNumbering:()=>c});var t,e,i,o=r(731),s=r(277),a=r(725),u=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class c{constructor(r,n){t.add(this),this.domNode=r,this.owner=n,e.set(this,void 0),this.centerPoint=new o.CenterPoint(r),function(t,e,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");"a"===n?i.call(t,r):i?i.value=r:e.set(t,r)}(this,e,s.Vector.matching((0,a.displacement)(n.centerPoint,this.centerPoint)),"f"),n.centerPoint.addEventListener("move",(()=>u(this,t,"m",i).call(this)))}get id(){return this.domNode.id}get textContent(){return this.domNode.textContent}hasAttribute(t){return this.domNode.hasAttribute(t)}getAttribute(t){return this.domNode.getAttribute(t)}setAttribute(t,e){this.domNode.setAttribute(t,e)}setAttributes(t){Object.entries(t).forEach((([t,e])=>this.setAttribute(t,e)))}removeAttribute(t){this.domNode.removeAttribute(t)}get displacement(){const r=()=>u(this,e,"f").x,n=r=>{u(this,e,"f").x=r,u(this,t,"m",i).call(this)},o=()=>u(this,e,"f").y,s=r=>{u(this,e,"f").y=r,u(this,t,"m",i).call(this)},a=()=>u(this,e,"f").magnitude,c=r=>{u(this,e,"f").magnitude=r,u(this,t,"m",i).call(this)},f=()=>u(this,e,"f").direction,d=r=>{u(this,e,"f").direction=r,u(this,t,"m",i).call(this)};return{get x(){return r()},set x(t){n(t)},get y(){return o()},set y(t){s(t)},get magnitude(){return a()},set magnitude(t){c(t)},get direction(){return f()},set direction(t){d(t)}}}}e=new WeakMap,t=new WeakSet,i=function(){this.centerPoint.x=this.owner.centerPoint.x+u(this,e,"f").x,this.centerPoint.y=this.owner.centerPoint.y+u(this,e,"f").y}})(),n})()));
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.bases.numberings"]=e():t["draw.bases.numberings"]=e()}(this,(()=>(()=>{var t={731:function(t){var e;e=()=>(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[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,{CenterPoint:()=>c});var r,n,i,o,s,a=function(t,e,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(t,r):i?i.value=r:e.set(t,r),r},u=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class c{constructor(t){r.add(this),n.set(this,void 0),i.set(this,{move:[]}),o.set(this,void 0),a(this,n,t,"f"),a(this,o,new MutationObserver((()=>u(this,r,"m",s).call(this,"move"))),"f"),u(this,o,"f").observe(t,{attributes:!0,childList:!0,characterData:!0,subtree:!0})}get x(){let t=u(this,n,"f").getBBox();return t.x+t.width/2}set x(t){let e=this.x,r=[...u(this,n,"f").x.baseVal].map((t=>t.value));0!=r.length||r.push(0),r=r.map((r=>r+(t-e))),u(this,n,"f").setAttribute("x",r.join(", "))}get y(){let t=u(this,n,"f").getBBox();return t.y+t.height/2}set y(t){let e=this.y,r=[...u(this,n,"f").y.baseVal].map((t=>t.value));0!=r.length||r.push(0),r=r.map((r=>r+(t-e))),u(this,n,"f").setAttribute("y",r.join(", "))}addEventListener(t,e){u(this,i,"f")[t].push(e)}removeEventListener(t,e){u(this,i,"f")[t]=u(this,i,"f")[t].filter((t=>t!==e))}}return n=new WeakMap,i=new WeakMap,o=new WeakMap,r=new WeakSet,s=function(t){u(this,i,"f")[t].forEach((t=>t()))},e})(),t.exports=e()},726:function(t){var e;e=()=>(()=>{var t={854:function(t){t.exports=(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[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={};function r(t){return"number"==typeof t}function n(t){return r(t)&&Number.isFinite(t)}function i(t){return r(t)&&!Number.isFinite(t)}function o(t){return n(t)&&t>0}function s(t){return n(t)&&t>=0}function a(t){return"string"==typeof t}function u(t){return null==t}function c(t){return"object"==typeof t&&null!==t}function l(t){return Array.isArray(t)}function h(t){return l(t)&&0==t.length}function f(t){return l(t)&&t.length>0}function d(t){return l(t)&&t.every(r)}function m(t){return d(t)&&t.length>0}function g(t){return l(t)&&t.every(n)}function p(t){return l(t)&&t.every(i)}function y(t){return l(t)&&t.every(a)}function b(t){return y(t)&&t.length>0}return t.r(e),t.d(e,{isArray:()=>l,isEmptyArray:()=>h,isFiniteNumber:()=>n,isFiniteNumbersArray:()=>g,isNonEmptyArray:()=>f,isNonEmptyNumbersArray:()=>m,isNonEmptyStringsArray:()=>b,isNonFiniteNumber:()=>i,isNonFiniteNumbersArray:()=>p,isNonNegativeFiniteNumber:()=>s,isNonNullObject:()=>c,isNullish:()=>u,isNumber:()=>r,isNumbersArray:()=>d,isPositiveFiniteNumber:()=>o,isString:()=>a,isStringsArray:()=>y}),e})()}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var o=e[n]={exports:{}};return t[n].call(o.exports,o,o.exports,r),o.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";function t(t,e){for(let[r,n]of Object.entries(e))t.setAttribute(r,n)}r.r(n),r.d(n,{CoordinateSystem:()=>h,HorizontalClientScaling:()=>d,InnerXML:()=>v,OuterXML:()=>x,Scaling:()=>f,VerticalClientScaling:()=>m,assignUUID:()=>l,bringToFront:()=>g,isSVGGraphicsElement:()=>N,isSVGGraphicsElementsArray:()=>C,sendToBack:()=>p,setAttributes:()=>t});const e={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};var i,o=new Uint8Array(16);function s(){if(!i&&!(i="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return i(o)}for(var a=[],u=0;u<256;++u)a.push((u+256).toString(16).slice(1));const c=function(t,r,n){if(e.randomUUID&&!r&&!t)return e.randomUUID();var i=(t=t||{}).random||(t.rng||s)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,r){n=n||0;for(var o=0;o<16;++o)r[n+o]=i[o];return r}return function(t,e=0){return(a[t[e+0]]+a[t[e+1]]+a[t[e+2]]+a[t[e+3]]+"-"+a[t[e+4]]+a[t[e+5]]+"-"+a[t[e+6]]+a[t[e+7]]+"-"+a[t[e+8]]+a[t[e+9]]+"-"+a[t[e+10]]+a[t[e+11]]+a[t[e+12]]+a[t[e+13]]+a[t[e+14]]+a[t[e+15]]).toLowerCase()}(i)};function l(t){t.id="uuid-"+c()}class h{constructor(t){this.targetSVGDoc=t}get width(){return this.targetSVGDoc.viewBox.baseVal.width}get height(){return this.targetSVGDoc.viewBox.baseVal.height}get minX(){return this.targetSVGDoc.viewBox.baseVal.x}get maxX(){return this.minX+this.width}get minY(){return this.targetSVGDoc.viewBox.baseVal.y}get maxY(){return this.minY+this.height}get horizontalScaling(){return this.targetSVGDoc.width.baseVal.value/this.width}get verticalScaling(){return this.targetSVGDoc.height.baseVal.value/this.height}setScaling(t){this.targetSVGDoc.setAttribute("width",""+t*this.width),this.targetSVGDoc.setAttribute("height",""+t*this.height)}get clientWidth(){return this.targetSVGDoc.getBoundingClientRect().width}get clientHeight(){return this.targetSVGDoc.getBoundingClientRect().height}get horizontalClientScaling(){return this.clientWidth/this.width}get verticalClientScaling(){return this.clientHeight/this.height}get minClientX(){return this.targetSVGDoc.getBoundingClientRect().x}get minClientY(){return this.targetSVGDoc.getBoundingClientRect().y}fromClientX(t){return this.minX+(t-this.minClientX)/this.horizontalClientScaling}fromClientY(t){return this.minY+(t-this.minClientY)/this.verticalClientScaling}fromClientCoordinates(t,e){return[this.fromClientX(t),this.fromClientY(e)]}fromClientPoint(t){return{x:this.fromClientX(t.x),y:this.fromClientY(t.y)}}toClientX(t){return this.minClientX+this.horizontalClientScaling*(t-this.minX)}toClientY(t){return this.minClientY+this.verticalClientScaling*(t-this.minY)}toClientCoordinates(t,e){return[this.toClientX(t),this.toClientY(e)]}toClientPoint(t){return{x:this.toClientX(t.x),y:this.toClientY(t.y)}}}class f{constructor(t){this.targetSVGDoc=t}set(t){let e=this.targetSVGDoc.viewBox.baseVal;this.targetSVGDoc.setAttribute("width",t*e.width+"px"),this.targetSVGDoc.setAttribute("height",t*e.height+"px")}}class d{constructor(t){this.targetSVGDoc=t}get(){let t=this.targetSVGDoc.getBoundingClientRect(),e=this.targetSVGDoc.viewBox.baseVal;return t.width/e.width}}class m{constructor(t){this.targetSVGDoc=t}get(){let t=this.targetSVGDoc.getBoundingClientRect(),e=this.targetSVGDoc.viewBox.baseVal;return t.height/e.height}}function g(t){let e=t.parentNode;e&&e.appendChild(t)}function p(t){let e=t.parentNode;e&&e.prepend(t)}var y,b=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class v{constructor(t){y.set(this,void 0),function(t,e,r){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,r)}(this,y,t)}toString(){return b(this,y,"f").innerHTML}set(t){b(this,y,"f").innerHTML=t}}y=new WeakMap;var w,S=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class x{constructor(t){w.set(this,void 0),function(t,e,r){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,r)}(this,w,t)}toString(){return S(this,w,"f").outerHTML}set(t){let e=document.createElementNS("http://www.w3.org/2000/svg","svg");if(e.style.height="0px",document.body.append(e),e.innerHTML=t,!e.firstElementChild)throw new Error("Outer XML must encode an SVG element.");if(e.childNodes.length>1)throw new Error("Outer XML cannot encode multiple DOM nodes.");if(e.firstElementChild.tagName.toLowerCase()!=S(this,w,"f").tagName.toLowerCase())throw new Error("Outer XML must specify an SVG element with the same tag name as the target SVG element.");[...S(this,w,"f").attributes].forEach((t=>S(this,w,"f").removeAttribute(t.name))),[...e.firstElementChild.attributes].forEach((t=>S(this,w,"f").setAttribute(t.name,t.value))),S(this,w,"f").innerHTML=e.firstElementChild.innerHTML,e.remove()}}function N(t){return t instanceof SVGGraphicsElement}w=new WeakMap;var P=r(854);function C(t){return(0,P.isArray)(t)&&t.every(N)}})(),n})(),t.exports=e()},725:function(t){t.exports=(()=>{var t={986:function(t){t.exports=(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[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={};function r(t){var e=0;return t.forEach((function(t){return e+=t})),e}function n(t){return r(t)/t.length}function i(t){t.sort((function(t,e){return t-e}))}t.r(e),t.d(e,{areWithin:()=>f,average:()=>n,degrees:()=>g,isBetweenExclusive:()=>h,isBetweenInclusive:()=>l,max:()=>c,mean:()=>n,median:()=>a,min:()=>u,radians:()=>p,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>d,sortedNumbers:()=>s,sortedNumbersAscending:()=>s,sortedNumbersDescending:()=>m,sum:()=>r});var o=function(t,e,r){if(r||2===arguments.length)for(var n,i=0,o=e.length;i<o;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||Array.prototype.slice.call(e))};function s(t){var e=o([],t,!0);return i(e),e}function a(t){if(0==t.length)return NaN;var e=s(t);if(e.length%2!=0)return e[Math.floor(e.length/2)];var r=e.length/2,i=r-1;return n([e[r],e[i]])}function u(t){if(0==t.length)return 1/0;var e=t[0];return t.slice(1).forEach((function(t){e=Math.min(e,t)})),e}function c(t){if(0==t.length)return-1/0;var e=t[0];return t.slice(1).forEach((function(t){e=Math.max(e,t)})),e}function l(t,e,r){return t>=e&&t<=r}function h(t,e,r){return t>e&&t<r}function f(t,e,r){return Math.abs(t-e)<=r}function d(t){i(t),t.reverse()}function m(t){var e=s(t);return e.reverse(),e}function g(t){return t*(180/Math.PI)}function p(t){return t*(Math.PI/180)}return e})()},854:function(t){t.exports=(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[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={};function r(t){return"number"==typeof t}function n(t){return r(t)&&Number.isFinite(t)}function i(t){return r(t)&&!Number.isFinite(t)}function o(t){return n(t)&&t>0}function s(t){return n(t)&&t>=0}function a(t){return"string"==typeof t}function u(t){return null==t}function c(t){return"object"==typeof t&&null!==t}function l(t){return Array.isArray(t)}return t.r(e),t.d(e,{isArray:()=>l,isFiniteNumber:()=>n,isNonFiniteNumber:()=>i,isNonNegativeFiniteNumber:()=>s,isNonNullObject:()=>c,isNullish:()=>u,isNumber:()=>r,isPositiveFiniteNumber:()=>o,isString:()=>a}),e})()},30:function(t){t.exports=(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[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={};function r(t){return Math.pow(Math.pow(t.x,2)+Math.pow(t.y,2),.5)}function n(t){return Math.atan2(t.y,t.x)}return t.r(e),t.d(e,{direction:()=>n,magnitude:()=>r}),e})()}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var o=e[n]={exports:{}};return t[n].call(o.exports,o,o.exports,r),o.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";r.r(n),r.d(n,{areWithin:()=>a,centroid:()=>d,deepCopy:()=>o,direction:()=>h,displaced:()=>c,displacement:()=>u,distance:()=>s,isFinitePoint:()=>i,isPoint:()=>e,midpoint:()=>m});var t=r(854);function e(e){return(0,t.isNonNullObject)(e)&&(0,t.isNumber)(e.x)&&(0,t.isNumber)(e.y)}function i(r){return e(r)&&(0,t.isFiniteNumber)(r.x)&&(0,t.isFiniteNumber)(r.y)}function o(t){return{x:t.x,y:t.y}}function s(t,e){var r=e.x-t.x,n=e.y-t.y;return Math.pow(Math.pow(r,2)+Math.pow(n,2),.5)}function a(t,e,r){return s(t,e)<=r}function u(t,e){return{x:e.x-t.x,y:e.y-t.y}}function c(t,e){return{x:t.x+e.x,y:t.y+e.y}}var l=r(30);function h(t,e){return(0,l.direction)(u(t,e))}var f=r(986);function d(t){return{x:(0,f.mean)(t.map((function(t){return t.x}))),y:(0,f.mean)(t.map((function(t){return t.y})))}}function m(t,e){return d([t,e])}})(),n})()},277:function(t){var e;e=()=>(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[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,{Vector:()=>r});class r{static matching(t){return new r(t.x,t.y)}constructor(t,e){this.x=t,this.y=e}[Symbol.iterator](){return[this.x,this.y].values()}get magnitude(){return Math.sqrt(Math.pow(this.x,2)+Math.pow(this.y,2))}set magnitude(t){let e=this.direction;this.x=t*Math.cos(e),this.y=t*Math.sin(e)}get direction(){return Math.atan2(this.y,this.x)}set direction(t){let e=this.magnitude;this.x=e*Math.cos(t),this.y=e*Math.sin(t)}}return e})(),t.exports=e()}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var o=e[n]={exports:{}};return t[n].call(o.exports,o,o.exports,r),o.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";r.r(n),r.d(n,{BaseNumbering:()=>l});var t,e,i,o=r(726),s=r(731),a=r(277),u=r(725),c=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class l{static numbering(t,e){let r=document.createElementNS("http://www.w3.org/2000/svg","text");(0,o.assignUUID)(r),r.textContent=`${e}`;let n=new l(r,t);return n.setAttributes(l.defaultValues.attributes),n.displacement.magnitude=0,n}constructor(r,n){t.add(this),this.domNode=r,this.owner=n,e.set(this,void 0),this.centerPoint=new s.CenterPoint(r),function(t,e,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");"a"===n?i.call(t,r):i?i.value=r:e.set(t,r)}(this,e,a.Vector.matching((0,u.displacement)(n.centerPoint,this.centerPoint)),"f"),n.centerPoint.addEventListener("move",(()=>c(this,t,"m",i).call(this)))}get id(){return this.domNode.id}get textContent(){return this.domNode.textContent}hasAttribute(t){return this.domNode.hasAttribute(t)}getAttribute(t){return this.domNode.getAttribute(t)}setAttribute(t,e){this.domNode.setAttribute(t,e)}setAttributes(t){Object.entries(t).forEach((([t,e])=>this.setAttribute(t,e)))}removeAttribute(t){this.domNode.removeAttribute(t)}get displacement(){const r=()=>c(this,e,"f").x,n=r=>{c(this,e,"f").x=r,c(this,t,"m",i).call(this)},o=()=>c(this,e,"f").y,s=r=>{c(this,e,"f").y=r,c(this,t,"m",i).call(this)},a=()=>c(this,e,"f").magnitude,u=r=>{c(this,e,"f").magnitude=r,c(this,t,"m",i).call(this)},l=()=>c(this,e,"f").direction,h=r=>{c(this,e,"f").direction=r,c(this,t,"m",i).call(this)};return{get x(){return r()},set x(t){n(t)},get y(){return o()},set y(t){s(t)},get magnitude(){return a()},set magnitude(t){u(t)},get direction(){return l()},set direction(t){h(t)}}}}e=new WeakMap,t=new WeakSet,i=function(){this.centerPoint.x=this.owner.centerPoint.x+c(this,e,"f").x,this.centerPoint.y=this.owner.centerPoint.y+c(this,e,"f").y},l.defaultValues={attributes:{"font-family":"Arial","font-size":"8","font-weight":"400",fill:"#808080"}}})(),n})()));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rnacanvas/draw.bases.numberings",
3
- "version": "1.5.0",
3
+ "version": "1.6.0",
4
4
  "description": "Number bases",
5
5
  "repository": {
6
6
  "type": "git",
@@ -26,6 +26,7 @@
26
26
  "webpack-cli": "^5.1.4"
27
27
  },
28
28
  "dependencies": {
29
+ "@rnacanvas/draw.svg": "^3.6.0",
29
30
  "@rnacanvas/draw.svg.text": "^1.3.0",
30
31
  "@rnacanvas/points": "^1.12.0",
31
32
  "@rnacanvas/vectors": "^1.4.1",