@rnacanvas/draw 7.0.0 → 7.1.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/dist/SchemaDrawer.d.ts +56 -0
- package/dist/SchemaDrawer.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 +5 -5
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { Drawing } from './Drawing';
|
|
2
|
+
/**
|
|
3
|
+
* How a schema should be formatted.
|
|
4
|
+
*/
|
|
5
|
+
type Schema = {
|
|
6
|
+
classes: SchemaClass[];
|
|
7
|
+
rnaComplexes: RNAComplex[];
|
|
8
|
+
};
|
|
9
|
+
type SchemaClass = {
|
|
10
|
+
name: string;
|
|
11
|
+
/**
|
|
12
|
+
* SVG attribute name/value mappings.
|
|
13
|
+
*/
|
|
14
|
+
[attributeName: string]: unknown;
|
|
15
|
+
};
|
|
16
|
+
type RNAComplex = {
|
|
17
|
+
rnaMolecules: RNAMolecule[];
|
|
18
|
+
};
|
|
19
|
+
type RNAMolecule = {
|
|
20
|
+
name: string;
|
|
21
|
+
sequence: Residue[];
|
|
22
|
+
basePairs: BasePair[];
|
|
23
|
+
};
|
|
24
|
+
type Residue = {
|
|
25
|
+
classes: string[];
|
|
26
|
+
residueName: string;
|
|
27
|
+
/**
|
|
28
|
+
* Center X coordinate.
|
|
29
|
+
*/
|
|
30
|
+
x: number;
|
|
31
|
+
/**
|
|
32
|
+
* Center Y coordinate.
|
|
33
|
+
*/
|
|
34
|
+
y: number;
|
|
35
|
+
};
|
|
36
|
+
type BasePair = {
|
|
37
|
+
classes: string[];
|
|
38
|
+
residueIndex1: number;
|
|
39
|
+
residueIndex2: number;
|
|
40
|
+
};
|
|
41
|
+
export declare class SchemaDrawer {
|
|
42
|
+
#private;
|
|
43
|
+
constructor(targetDrawing: Drawing);
|
|
44
|
+
/**
|
|
45
|
+
* Draws the nucleic acid structure drawing
|
|
46
|
+
* specified by the provided schema
|
|
47
|
+
* (on top of whatever is currently present in the target drawing).
|
|
48
|
+
*
|
|
49
|
+
* Note that if this method were to fail (i.e., were to throw),
|
|
50
|
+
* then it might leave the target drawing in a partially drawn state
|
|
51
|
+
* (e.g., with only part of the schema having been drawn).
|
|
52
|
+
*/
|
|
53
|
+
draw(schema: Schema): void | never;
|
|
54
|
+
}
|
|
55
|
+
export {};
|
|
56
|
+
//# sourceMappingURL=SchemaDrawer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SchemaDrawer.d.ts","sourceRoot":"","sources":["../src/SchemaDrawer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAMzC;;GAEG;AACH,KAAK,MAAM,GAAG;IACZ,OAAO,EAAE,WAAW,EAAE,CAAC;IAEvB,YAAY,EAAE,UAAU,EAAE,CAAC;CAC5B,CAAC;AAEF,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC;CAClC,CAAC;AAEF,KAAK,UAAU,GAAG;IAChB,YAAY,EAAE,WAAW,EAAE,CAAC;CAC7B,CAAC;AAEF,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IAEb,QAAQ,EAAE,OAAO,EAAE,CAAC;IAEpB,SAAS,EAAE,QAAQ,EAAE,CAAC;CACvB,CAAC;AAEF,KAAK,OAAO,GAAG;IACb,OAAO,EAAE,MAAM,EAAE,CAAC;IAElB,WAAW,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,CAAC,EAAE,MAAM,CAAC;IAEV;;OAEG;IACH,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAEF,KAAK,QAAQ,GAAG;IACd,OAAO,EAAE,MAAM,EAAE,CAAC;IAElB,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,qBAAa,YAAY;;gBAGX,aAAa,EAAE,OAAO;IAIlC;;;;;;;;OAQG;IACH,IAAI,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,KAAK;CAgDnC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -6,4 +6,6 @@ import { StraightBond } from '@rnacanvas/draw.bonds';
|
|
|
6
6
|
export { StraightBond };
|
|
7
7
|
import { DotBracketDrawer } from './DotBracketDrawer';
|
|
8
8
|
export { DotBracketDrawer };
|
|
9
|
+
import { SchemaDrawer } from './SchemaDrawer';
|
|
10
|
+
export { SchemaDrawer };
|
|
9
11
|
//# 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,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,CAAC;AAEnB,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,CAAC;AAEtB,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,CAAC;AAExB,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,CAAC;AAEnB,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,CAAC;AAEtB,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,CAAC;AAExB,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,CAAC;AAE5B,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,CAAC"}
|