@rnacanvas/app-object 3.0.1 → 3.3.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,41 @@
1
+ import type { Drawing } from '@rnacanvas/draw';
2
+ import type { HorizontalScrollbar, VerticalScrollbar } from '@rnacanvas/scrollbars';
3
+ type Point = {
4
+ x: number;
5
+ y: number;
6
+ };
7
+ /**
8
+ * Represents the user's view of a target drawing.
9
+ */
10
+ export declare class DrawingView {
11
+ private targetDrawing;
12
+ private horizontalScrollbar;
13
+ private verticalScrollbar;
14
+ /**
15
+ * Horizontal and vertical scrollbars are expected to match the target drawing perfectly.
16
+ *
17
+ * For instance, shifting the horizontal scrollbar all the way to the left
18
+ * should correspond with the leftmost boundary of the target drawing,
19
+ * shifting the vertical scrollbar all the way down
20
+ * should correspond with the bottommost boundary of the target drawing, etc.
21
+ *
22
+ * There should be no extra space surrounding the target drawing that can be scrolled to.
23
+ *
24
+ * @param targetDrawing
25
+ * @param horizontalScrollbar The horizontal scrollbar for the target drawing.
26
+ * @param verticalScrollbar The vertical scrollbar for the target drawing.
27
+ */
28
+ constructor(targetDrawing: Drawing, horizontalScrollbar: HorizontalScrollbar, verticalScrollbar: VerticalScrollbar);
29
+ /**
30
+ * Returns the center point of the user's view of the target drawing in drawing coordinates
31
+ * (i.e., in the coordinate system of the target drawing).
32
+ */
33
+ get centerPoint(): Point;
34
+ set centerPoint(centerPoint: Point);
35
+ /**
36
+ * Fits the user's view of the target drawing to its content.
37
+ */
38
+ fitToContent(): void;
39
+ }
40
+ export {};
41
+ //# sourceMappingURL=DrawingView.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DrawingView.d.ts","sourceRoot":"","sources":["../src/DrawingView.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAE/C,OAAO,KAAK,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAEpF,KAAK,KAAK,GAAG;IACX,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAEF;;GAEG;AACH,qBAAa,WAAW;IACtB,OAAO,CAAC,aAAa,CAAU;IAE/B,OAAO,CAAC,mBAAmB,CAAsB;IAEjD,OAAO,CAAC,iBAAiB,CAAoB;IAE7C;;;;;;;;;;;;;OAaG;gBACS,aAAa,EAAE,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,iBAAiB;IAMlH;;;OAGG;IACH,IAAI,WAAW,IAAI,KAAK,CAKvB;IAED,IAAI,WAAW,CAAC,WAAW,EAPR,KAOQ,EAG1B;IAED;;OAEG;IACH,YAAY,IAAI,IAAI;CAiBrB"}
@@ -1,5 +1,7 @@
1
1
  import { Drawing } from '@rnacanvas/draw';
2
+ import { HorizontalScrollbar, VerticalScrollbar } from '@rnacanvas/scrollbars';
2
3
  import { Scrollbars } from '@rnacanvas/scrollbars';
4
+ import { DrawingView } from './DrawingView';
3
5
  /**
4
6
  * An RNAcanvas app object that can be included as a component of a web page / app.
5
7
  */
@@ -22,10 +24,22 @@ export declare class RNAcanvas {
22
24
  * The 2D nucleic acid structure drawing of the app object.
23
25
  */
24
26
  readonly drawing: Drawing;
27
+ /**
28
+ * The horizontal scrollbar for the drawing.
29
+ */
30
+ readonly horizontalDrawingScrollbar: HorizontalScrollbar;
31
+ /**
32
+ * The vertical scrollbar for the drawing.
33
+ */
34
+ readonly verticalDrawingScrollbar: VerticalScrollbar;
25
35
  /**
26
36
  * The scrollbars controlling the user's view of the drawing.
27
37
  */
28
38
  readonly drawingScrollbars: Scrollbars;
39
+ /**
40
+ * The user's view of the drawing.
41
+ */
42
+ readonly drawingView: DrawingView;
29
43
  constructor();
30
44
  /**
31
45
  * Appends the DOM node of the app object to the given container node.
@@ -37,5 +51,9 @@ export declare class RNAcanvas {
37
51
  * (Has no effect if the DOM node of the app object had no parent container node to begin with.)
38
52
  */
39
53
  remove(): void;
54
+ /**
55
+ * The CSS style declaration for the actual DOM node of the app object.
56
+ */
57
+ get style(): CSSStyleDeclaration;
40
58
  }
41
59
  //# sourceMappingURL=RNAcanvas.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"RNAcanvas.d.ts","sourceRoot":"","sources":["../src/RNAcanvas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAE1C,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD;;GAEG;AACH,qBAAa,SAAS;IACpB;;;;OAIG;IACH,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC;IAE9B;;;;;;OAMG;IACH,OAAO,CAAC,WAAW,CAAiB;IAEpC;;OAEG;IACH,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAE1B;;OAEG;IACH,QAAQ,CAAC,iBAAiB,EAAE,UAAU,CAAC;;IAuBvC;;OAEG;IACH,QAAQ,CAAC,SAAS,EAAE,IAAI,GAAG,IAAI;IAI/B;;;;OAIG;IACH,MAAM,IAAI,IAAI;CAGf"}
1
+ {"version":3,"file":"RNAcanvas.d.ts","sourceRoot":"","sources":["../src/RNAcanvas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAE1C,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE/E,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C;;GAEG;AACH,qBAAa,SAAS;IACpB;;;;OAIG;IACH,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC;IAE9B;;;;;;OAMG;IACH,OAAO,CAAC,WAAW,CAAiB;IAEpC;;OAEG;IACH,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAE1B;;OAEG;IACH,QAAQ,CAAC,0BAA0B,EAAE,mBAAmB,CAAC;IAEzD;;OAEG;IACH,QAAQ,CAAC,wBAAwB,EAAE,iBAAiB,CAAC;IAErD;;OAEG;IACH,QAAQ,CAAC,iBAAiB,EAAE,UAAU,CAAC;IAEvC;;OAEG;IACH,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC;;IA4BlC;;OAEG;IACH,QAAQ,CAAC,SAAS,EAAE,IAAI,GAAG,IAAI;IAI/B;;;;OAIG;IACH,MAAM,IAAI,IAAI;IAId;;OAEG;IACH,IAAI,KAAK,wBAER;CACF"}