@rnacanvas/draw.bonds.curved 1.0.4 → 1.2.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.
- package/README.md +21 -0
- package/dist/CurvedBond.d.ts +12 -0
- package/dist/CurvedBond.d.ts.map +1 -0
- package/dist/Nucleobase.d.ts +3 -0
- package/dist/Nucleobase.d.ts.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/README.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Installation
|
|
2
|
+
|
|
3
|
+
With `npm`:
|
|
4
|
+
|
|
5
|
+
```
|
|
6
|
+
npm install @rnacanvas/draw.bonds.curved
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
# Usage
|
|
10
|
+
|
|
11
|
+
All exports of this package can be accessed as named imports.
|
|
12
|
+
|
|
13
|
+
```javascript
|
|
14
|
+
// an example import
|
|
15
|
+
import { CurvedBond } from '@rnacanvas/draw.bonds.curved';
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## `class CurvedBond`
|
|
19
|
+
|
|
20
|
+
A bond that can have one or more curves in it
|
|
21
|
+
(often used for tertiary bonds in drawings).
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Nucleobase } from './Nucleobase';
|
|
2
|
+
export declare class CurvedBond {
|
|
3
|
+
readonly domNode: SVGPathElement;
|
|
4
|
+
readonly base1: Nucleobase;
|
|
5
|
+
readonly base2: Nucleobase;
|
|
6
|
+
/**
|
|
7
|
+
* Creates and returns a new curved bond between the two bases.
|
|
8
|
+
*/
|
|
9
|
+
static between(base1: Nucleobase, base2: Nucleobase): CurvedBond;
|
|
10
|
+
constructor(domNode: SVGPathElement, base1: Nucleobase, base2: Nucleobase);
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=CurvedBond.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CurvedBond.d.ts","sourceRoot":"","sources":["../src/CurvedBond.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAI/C,qBAAa,UAAU;IA4BT,QAAQ,CAAC,OAAO,EAAE,cAAc;IAAE,QAAQ,CAAC,KAAK,EAAE,UAAU;IAAE,QAAQ,CAAC,KAAK,EAAE,UAAU;IA3BpG;;OAEG;IACH,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,GAAG,UAAU;gBAwB3C,OAAO,EAAE,cAAc,EAAW,KAAK,EAAE,UAAU,EAAW,KAAK,EAAE,UAAU;CACrG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Nucleobase.d.ts","sourceRoot":"","sources":["../src/Nucleobase.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,UAAU;CAAG"}
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
|
|
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"}
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e
|
|
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.bonds.curved"]=e():t["draw.bonds.curved"]=e()}(this,()=>(()=>{"use strict";var t={d:(e,o)=>{for(var r in o)t.o(o,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:o[r]})},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,{CurvedBond:()=>i});const o={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let r;const n=new Uint8Array(16),s=[];for(let t=0;t<256;++t)s.push((t+256).toString(16).slice(1));function d(t,e,o){const d=(t=t||{}).random??t.rng?.()??function(){if(!r){if("undefined"==typeof crypto||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");r=crypto.getRandomValues.bind(crypto)}return r(n)}();if(d.length<16)throw new Error("Random bytes length must be >= 16");if(d[6]=15&d[6]|64,d[8]=63&d[8]|128,e){if((o=o||0)<0||o+16>e.length)throw new RangeError(`UUID byte range ${o}:${o+15} is out of buffer bounds`);for(let t=0;t<16;++t)e[o+t]=d[t];return e}return function(t,e=0){return(s[t[e+0]]+s[t[e+1]]+s[t[e+2]]+s[t[e+3]]+"-"+s[t[e+4]]+s[t[e+5]]+"-"+s[t[e+6]]+s[t[e+7]]+"-"+s[t[e+8]]+s[t[e+9]]+"-"+s[t[e+10]]+s[t[e+11]]+s[t[e+12]]+s[t[e+13]]+s[t[e+14]]+s[t[e+15]]).toLowerCase()}(d)}class i{static between(t,e){let r=document.createElementNS("http://www.w3.org/2000/svg","path");return r.id="id-"+(!o.randomUUID||s||n?d(n,s,u):o.randomUUID()),r.setAttribute("stroke","black"),r.setAttribute("stroke-width","1.5"),r.setAttribute("stroke-opacity","1"),r.setAttribute("stroke-dasharray",""),r.setAttribute("stroke-linecap",""),r.setAttribute("stroke-linejoin",""),r.setAttribute("fill","none"),new i(r,t,e);var n,s,u}constructor(t,e,o){this.domNode=t,this.base1=e,this.base2=o}}return e})());
|