@visuallyjs/browser-ui 1.1.3 → 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.
Files changed (30) hide show
  1. package/css/visuallyjs.css +22 -1
  2. package/js/visuallyjs.browser-ui.cjs.js +53 -53
  3. package/js/visuallyjs.browser-ui.esm.js +53 -53
  4. package/package.json +1 -1
  5. package/types/browser-ui/auto-pan-handler.d.ts +36 -0
  6. package/types/browser-ui/browser-visuallyjs-instance.d.ts +8 -2
  7. package/types/browser-ui/connector-editors/editor-base.d.ts +4 -1
  8. package/types/browser-ui/css-constants.d.ts +16 -0
  9. package/types/browser-ui/edge-handler-base.d.ts +1 -1
  10. package/types/browser-ui/edge-input-handler.d.ts +2 -0
  11. package/types/browser-ui/edge-relocate-handler.d.ts +2 -2
  12. package/types/browser-ui/element-drag-handler-2.d.ts +12 -0
  13. package/types/browser-ui/plugins/browser-ui-plugin.d.ts +2 -2
  14. package/types/browser-ui/surface-renderer/diagrams/definitions.d.ts +1 -1
  15. package/types/browser-ui/surface-renderer/plugins/lasso/lasso-plugin.d.ts +6 -0
  16. package/types/browser-ui/surface-renderer/plugins/lasso/lasso.d.ts +21 -3
  17. package/types/browser-ui/surface-renderer/plugins/miniview/miniview-plugin.d.ts +15 -7
  18. package/types/browser-ui/surface-renderer/surface.d.ts +8 -3
  19. package/types/charts/sankey/sankey.d.ts +1 -1
  20. package/types/core/event-constants.d.ts +29 -0
  21. package/types/core/geom.d.ts +32 -2
  22. package/types/core/layout/circular/circular-layout.d.ts +6 -1
  23. package/types/core/selection.d.ts +6 -2
  24. package/types/core/toolkit.d.ts +6 -0
  25. package/types/test-support/test-support.d.ts +10 -5
  26. package/types/ui/core/core-events.d.ts +2 -2
  27. package/types/ui/core/core.d.ts +8 -0
  28. package/types/ui/core/definitions.d.ts +6 -0
  29. package/types/ui/core/event-constants.d.ts +16 -0
  30. package/types/version.d.ts +1 -1
@@ -1,4 +1,4 @@
1
- import { EVENT_DESTROY, EVENT_EDGE_GEOMETRY, EVENT_EDGE_REMOVED, EVENT_GROUP_MOVE, EVENT_GROUP_MOVE_END, EVENT_GROUP_MOVE_START, EVENT_GROUP_REMOVED, EVENT_NODE_MOVE, EVENT_NODE_MOVE_ABORT, EVENT_NODE_MOVE_END, EVENT_NODE_MOVE_START, EVENT_NODE_REMOVED } from "../../core";
1
+ import { EVENT_DESTROY, EVENT_EDGE_GEOMETRY, EVENT_EDGE_REMOVED, EVENT_GROUP_MOVE, EVENT_GROUP_MOVE_END, EVENT_GROUP_MOVE_START, EVENT_GROUP_REMOVED, EVENT_INTERNAL_EDGE_REDRAW, EVENT_NODE_MOVE, EVENT_NODE_MOVE_ABORT, EVENT_NODE_MOVE_END, EVENT_NODE_MOVE_START, EVENT_NODE_REMOVED } from "../../core";
2
2
  import { EVENT_GROUP_COLLAPSE, EVENT_GROUP_EXPAND, EVENT_INTERNAL_CONNECTION, EVENT_RENDER_END, EVENT_RENDER_START, EVENT_ZOOM, EVENT_AFTER_LAYOUT_REFRESH, //EVENT_CONNECTION_MOUSEOVER,
3
3
  EVENT_GROUP_RELAYOUT, EVENT_GROUP_RENDERED, EVENT_INTERNAL_VERTEX_UPDATED, EVENT_NODE_RENDERED, EVENT_NODE_VISIBILITY, EVENT_PLUGIN_ADDED, EVENT_RELAYOUT, EVENT_PLUGIN_REMOVED, EVENT_ADHOC_LAYOUT, EVENT_INTERNAL_ELEMENT_REPAINTED } from "./event-constants";
4
4
  /**
@@ -6,4 +6,4 @@ EVENT_GROUP_RELAYOUT, EVENT_GROUP_RENDERED, EVENT_INTERNAL_VERTEX_UPDATED, EVENT
6
6
  * @group Events
7
7
  * @category UI Events
8
8
  */
9
- export type CoreUIEvent = typeof EVENT_NODE_MOVE_END | typeof EVENT_NODE_MOVE | typeof EVENT_NODE_MOVE_START | typeof EVENT_NODE_MOVE_ABORT | typeof EVENT_RENDER_START | typeof EVENT_GROUP_REMOVED | typeof EVENT_GROUP_MOVE | typeof EVENT_GROUP_MOVE_END | typeof EVENT_GROUP_MOVE_START | typeof EVENT_RENDER_END | typeof EVENT_DESTROY | typeof EVENT_RELAYOUT | typeof EVENT_GROUP_COLLAPSE | typeof EVENT_AFTER_LAYOUT_REFRESH | typeof EVENT_GROUP_EXPAND | typeof EVENT_NODE_VISIBILITY | typeof EVENT_GROUP_RENDERED | typeof EVENT_NODE_REMOVED | typeof EVENT_INTERNAL_VERTEX_UPDATED | typeof EVENT_INTERNAL_CONNECTION | typeof EVENT_INTERNAL_ELEMENT_REPAINTED | typeof EVENT_NODE_RENDERED | typeof EVENT_EDGE_REMOVED | typeof EVENT_ZOOM | typeof EVENT_GROUP_RELAYOUT | typeof EVENT_PLUGIN_ADDED | typeof EVENT_PLUGIN_REMOVED | typeof EVENT_EDGE_GEOMETRY | typeof EVENT_ADHOC_LAYOUT;
9
+ export type CoreUIEvent = typeof EVENT_NODE_MOVE_END | typeof EVENT_NODE_MOVE | typeof EVENT_NODE_MOVE_START | typeof EVENT_NODE_MOVE_ABORT | typeof EVENT_RENDER_START | typeof EVENT_GROUP_REMOVED | typeof EVENT_GROUP_MOVE | typeof EVENT_GROUP_MOVE_END | typeof EVENT_GROUP_MOVE_START | typeof EVENT_RENDER_END | typeof EVENT_DESTROY | typeof EVENT_RELAYOUT | typeof EVENT_GROUP_COLLAPSE | typeof EVENT_AFTER_LAYOUT_REFRESH | typeof EVENT_GROUP_EXPAND | typeof EVENT_NODE_VISIBILITY | typeof EVENT_GROUP_RENDERED | typeof EVENT_NODE_REMOVED | typeof EVENT_INTERNAL_VERTEX_UPDATED | typeof EVENT_INTERNAL_CONNECTION | typeof EVENT_INTERNAL_ELEMENT_REPAINTED | typeof EVENT_INTERNAL_EDGE_REDRAW | typeof EVENT_NODE_RENDERED | typeof EVENT_EDGE_REMOVED | typeof EVENT_ZOOM | typeof EVENT_GROUP_RELAYOUT | typeof EVENT_PLUGIN_ADDED | typeof EVENT_PLUGIN_REMOVED | typeof EVENT_EDGE_GEOMETRY | typeof EVENT_ADHOC_LAYOUT;
@@ -893,6 +893,7 @@ export declare abstract class UICore<EL, EVT = CoreUIEvent> extends OptimisticEv
893
893
  */
894
894
  $paintConnection(connection: Connection<EL>, params?: {
895
895
  timestamp?: string;
896
+ fireEvent?: boolean;
896
897
  }): void;
897
898
  /**
898
899
  * Adds an overlay to the given component, repainting the UI as necessary.
@@ -1134,6 +1135,13 @@ export declare abstract class UICore<EL, EVT = CoreUIEvent> extends OptimisticEv
1134
1135
  * @internal
1135
1136
  */
1136
1137
  abstract $setElementRotation(el: EL, r: number): void;
1138
+ /**
1139
+ * Sets the viewport element's rotation in the UI. DOES NOT change the viewport's data.The details of this are specific to the concrete subclass.
1140
+ * @param el
1141
+ * @param r
1142
+ * @internal
1143
+ */
1144
+ abstract $setVisibleElementRotation(vel: ViewportElement<EL>, r: number): void;
1137
1145
  /**
1138
1146
  * Gets the position and size of the given element relative to the window origin, _in page coordinates_. This method abstracts the `getBoundingClientRect()` method in the browser UI renderer.
1139
1147
  * @param el Element to get position for
@@ -84,6 +84,7 @@ export interface DragHandler2<E> {
84
84
  priority?: number;
85
85
  constrainFunction: ConstrainFunction<E, any>;
86
86
  usesPageCoordinates?: boolean;
87
+ destroy?: () => void;
87
88
  }
88
89
  /**
89
90
  * Defines a function that will be invoked prior to a vertex being dragged. Returning false from this function will abort the vertex drag.
@@ -316,6 +317,11 @@ interface EnclosedOrIntersectingVerticesOptions {
316
317
  * If true, ignore groups that are children of groups
317
318
  */
318
319
  dontIncludeNestedGroups?: boolean;
320
+ /**
321
+ * Optional final filter to apply to the discovered list
322
+ * @param n
323
+ */
324
+ filter?: (n: Node | Group) => boolean;
319
325
  }
320
326
  /**
321
327
  * Options for a find intersecting vertices call
@@ -463,6 +463,22 @@ export declare const EVENT_CANVAS_DBLCLICK = "canvasDblClick";
463
463
  * @internal
464
464
  */
465
465
  export declare const EVENT_EDGE_REDRAW = "edge:redraw";
466
+ /**
467
+ * Fired by the Lasso plugin when the lasso selection begins, providing its initial canvas position and size.
468
+ * @group Events
469
+ * @category UI Events
470
+ * @constant
471
+ * @event
472
+ */
473
+ export declare const EVENT_LASSO_START = "start";
474
+ /**
475
+ * Fired by the Lasso plugin continuously as the lasso selection updates, providing its current canvas position and size.
476
+ * @group Events
477
+ * @category UI Events
478
+ * @constant
479
+ * @event
480
+ */
481
+ export declare const EVENT_LASSO_UPDATE = "lasso:update";
466
482
  /**
467
483
  * Fired at the end of a lasso operation.
468
484
  * @group Events
@@ -1 +1 @@
1
- export declare const VERSION = "1.1.3";
1
+ export declare const VERSION = "1.2.0";