@visuallyjs/browser-ui 1.1.1 → 1.1.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@visuallyjs/browser-ui",
3
- "version": "1.1.1",
3
+ "version": "1.1.3",
4
4
  "license": "Commercial",
5
5
  "main": "js/visuallyjs.browser-ui.cjs.js",
6
6
  "module": "js/visuallyjs.browser-ui.esm.js",
@@ -277,3 +277,8 @@ export declare const chebyshevDistance: (x1: number, y1: number, x2: number, y2:
277
277
  * @internal
278
278
  */
279
279
  export declare const octileDistance: (x1: number, y1: number, x2: number, y2: number) => number;
280
+ /**
281
+ * Clamps the given angle to lie inside the range 0 - 360
282
+ * @param rangle
283
+ */
284
+ export declare function clampAngle(angle: number): number;
@@ -418,7 +418,7 @@ export declare abstract class VisuallyJsModel extends OptimisticEventGenerator i
418
418
  edgeFactory: ObjectFactory;
419
419
  portFactory: ObjectFactory;
420
420
  groupFactory: ObjectFactory;
421
- portSeparator: string;
421
+ get portSeparator(): string;
422
422
  undoRedo: UndoRedoManager;
423
423
  private _graphParams;
424
424
  beforeConnect: BeforeConnectInterceptor;
@@ -92,9 +92,9 @@ export interface LabelOverlayOptions extends OverlayOptions {
92
92
  */
93
93
  font?: FontSpec;
94
94
  /**
95
- * If true, the label can be rotated to match the gradient of the connector at that location at which it is positioned.
95
+ * Sets whether the label can be rotated to match the gradient of the connector at that location at which it is positioned. If you supply boolean true here, the label will be made rotatable in "legible" mode, in which VisuallyJs ensures that the label is always easy to read, by avoiding rotating the text so that it is upside down or other awkward to read. You can set "strict" mode, which will rotate the label to the appropriate angle regardless of whether or not it will make the label difficult to read.
96
96
  */
97
- rotatable?: boolean;
97
+ rotatable?: boolean | "legible" | "strict" | null;
98
98
  }
99
99
  /**
100
100
  * An overlay specified by name and options.
@@ -12,9 +12,9 @@ import { BrowserUI } from "../../../browser-ui";
12
12
  export interface CustomOverlayOptions<EL> extends OverlayOptions {
13
13
  create: (c: Connection<EL>, edge: Edge, instance: BrowserUI, model: VisuallyJsModel) => EL;
14
14
  /**
15
- * If true, the label can be rotated to match the gradient of the connector at that location at which it is positioned.
15
+ * Sets whether the overlay can be rotated to match the gradient of the connector at that location at which it is positioned. If you supply boolean true here, the overlay will be made rotatable in "legible" mode, in which VisuallyJs ensures that the overlay is always mostly 'upright, by avoiding rotating it so that it is upside down or other awkward to read. You can set "strict" mode, which will rotate the overlay to the appropriate angle regardless of whether or not it will make any text on it difficult to read.
16
16
  */
17
- rotatable?: boolean;
17
+ rotatable?: boolean | "strict" | "legible" | null;
18
18
  }
19
19
  /**
20
20
  * A custom overlay allows you to create the element that will be used to represent the overlay.
@@ -24,7 +24,7 @@ export interface CustomOverlayOptions<EL> extends OverlayOptions {
24
24
  export interface CustomOverlay<EL> extends Overlay<EL> {
25
25
  create: (c: Connection<EL>, edge: Edge, instance: BrowserUI, model: VisuallyJsModel) => EL;
26
26
  isSimpleShape: boolean;
27
- rotatable: boolean;
27
+ rotatable: boolean | "strict" | "legible" | null;
28
28
  }
29
29
  /**
30
30
  * Custom overlay type.
@@ -42,7 +42,7 @@ export declare class CustomOverlayImpl<EL> extends Overlay<EL> implements Custom
42
42
  */
43
43
  create: (c: Connection<EL>, edge: Edge, instance: BrowserUI, model: VisuallyJsModel) => EL;
44
44
  isSimpleShape: boolean;
45
- rotatable: boolean;
45
+ rotatable: boolean | "strict" | "legible" | null;
46
46
  constructor(instance: UICore<EL>, connection: Connection<EL>, p: CustomOverlayOptions<EL>);
47
47
  type: string;
48
48
  updateFrom(d: any, context: ObjectData): void;
@@ -16,7 +16,7 @@ export declare class LabelOverlay<EL> extends Overlay<EL> {
16
16
  static type: string;
17
17
  type: string;
18
18
  useHTMLElement: boolean;
19
- rotatable: boolean;
19
+ rotatable: boolean | string;
20
20
  font: FontSpec;
21
21
  constructor(instance: UICore<EL>, connection: Connection<EL>, p: LabelOverlayOptions);
22
22
  isSimpleShape: boolean;
@@ -40,7 +40,7 @@ export interface ConnectParams<E> {
40
40
  /**
41
41
  * When true, the label will be rotated so that it is at the same angle as the slope of the connector at the point at which the label is located.
42
42
  */
43
- labelsRotatable?: boolean;
43
+ labelsRotatable?: boolean | "strict" | "legible" | null;
44
44
  /**
45
45
  * Spec for the connector used to paint the connection.
46
46
  */
@@ -80,9 +80,9 @@ export interface EdgeMapping extends BaseViewObjectMapping, LineStyle {
80
80
  */
81
81
  labelFont?: FontSpec;
82
82
  /**
83
- * When true, the label will be rotated so that it is at the same angle as the slope of the connector at the point at which the label is located.
83
+ * Sets whether the label can be rotated to match the gradient of the connector at that location at which it is positioned. If you supply boolean true here, the label will be made rotatable in "legible" mode, in which VisuallyJs ensures that the label is always easy to read, by avoiding rotating the text so that it is upside down or other awkward to read. You can set "strict" mode, which will rotate the label to the appropriate angle regardless of whether or not it will make the label difficult to read.
84
84
  */
85
- labelsRotatable?: boolean;
85
+ labelsRotatable?: boolean | "strict" | "legible" | null;
86
86
  /**
87
87
  * Optional width of the edge's outline. Defaults to 0.
88
88
  */
@@ -1 +1 @@
1
- export declare const VERSION = "1.1.1";
1
+ export declare const VERSION = "1.1.3";