@html-graph/html-graph 3.12.0 → 3.13.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 +1 -1
- package/dist/html-graph.d.ts +27 -20
- package/dist/html-graph.js +408 -418
- package/dist/html-graph.umd.cjs +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
### Graph visualization library that enables nodes customization using HTML
|
|
6
6
|
|
|
7
7
|
<a target="_blank" href="https://html-graph.github.io/use-cases/advanced-demo/">
|
|
8
|
-
|
|
8
|
+
<img width="100%" src="https://raw.githubusercontent.com/html-graph/html-graph/master/media/full-demo.gif"/>
|
|
9
9
|
</a>
|
|
10
10
|
|
|
11
11
|
Instead of connecting nodes directly, this library utilizes the concept of ports,
|
package/dist/html-graph.d.ts
CHANGED
|
@@ -101,7 +101,7 @@ export declare class Canvas {
|
|
|
101
101
|
private readonly graphStore;
|
|
102
102
|
private readonly viewportStore;
|
|
103
103
|
private readonly htmlView;
|
|
104
|
-
private readonly
|
|
104
|
+
private readonly params;
|
|
105
105
|
/**
|
|
106
106
|
* provides api for accessing model of rendered graph
|
|
107
107
|
*/
|
|
@@ -134,7 +134,7 @@ export declare class Canvas {
|
|
|
134
134
|
/**
|
|
135
135
|
* @deprecated access element directly instead
|
|
136
136
|
*/
|
|
137
|
-
element: HTMLElement, graphStore: GraphStore, viewportStore: ViewportStore, htmlView: HtmlView,
|
|
137
|
+
element: HTMLElement, graphStore: GraphStore, viewportStore: ViewportStore, htmlView: HtmlView, params: CanvasParams);
|
|
138
138
|
/**
|
|
139
139
|
* adds new node
|
|
140
140
|
*/
|
|
@@ -298,6 +298,20 @@ export declare interface CanvasDefaults {
|
|
|
298
298
|
};
|
|
299
299
|
}
|
|
300
300
|
|
|
301
|
+
declare interface CanvasParams {
|
|
302
|
+
readonly nodes: {
|
|
303
|
+
readonly centerFn: CenterFn;
|
|
304
|
+
readonly priorityFn: PriorityFn;
|
|
305
|
+
};
|
|
306
|
+
readonly ports: {
|
|
307
|
+
readonly direction: number;
|
|
308
|
+
};
|
|
309
|
+
readonly edges: {
|
|
310
|
+
readonly shapeFactory: EdgeShapeFactory;
|
|
311
|
+
readonly priorityFn: PriorityFn;
|
|
312
|
+
};
|
|
313
|
+
}
|
|
314
|
+
|
|
301
315
|
export declare type CenterFn = (width: number, height: number) => Point;
|
|
302
316
|
|
|
303
317
|
declare interface ConnectablePortsConfig {
|
|
@@ -324,20 +338,6 @@ declare type ConstantPriority = number;
|
|
|
324
338
|
|
|
325
339
|
declare type CustomPriority = PriorityFn;
|
|
326
340
|
|
|
327
|
-
declare interface Defaults {
|
|
328
|
-
readonly nodes: {
|
|
329
|
-
readonly centerFn: CenterFn;
|
|
330
|
-
readonly priorityFn: PriorityFn;
|
|
331
|
-
};
|
|
332
|
-
readonly ports: {
|
|
333
|
-
readonly direction: number;
|
|
334
|
-
};
|
|
335
|
-
readonly edges: {
|
|
336
|
-
readonly shapeFactory: EdgeShapeFactory;
|
|
337
|
-
readonly priorityFn: PriorityFn;
|
|
338
|
-
};
|
|
339
|
-
}
|
|
340
|
-
|
|
341
341
|
export declare interface DirectEdgeParams {
|
|
342
342
|
readonly color?: string | undefined;
|
|
343
343
|
readonly width?: number | undefined;
|
|
@@ -395,7 +395,7 @@ export { DraggableNodesConfig }
|
|
|
395
395
|
|
|
396
396
|
declare interface EdgePath {
|
|
397
397
|
readonly path: string;
|
|
398
|
-
readonly
|
|
398
|
+
readonly midpoint: Point;
|
|
399
399
|
}
|
|
400
400
|
|
|
401
401
|
declare type EdgePathFactory = (sourceDirection: Point, targetDirection: Point, to: Point, flipX: number, flipY: number) => EdgePath;
|
|
@@ -696,18 +696,25 @@ export declare interface MarkPortRequest {
|
|
|
696
696
|
readonly direction?: number;
|
|
697
697
|
}
|
|
698
698
|
|
|
699
|
-
|
|
699
|
+
declare class MidpointEdgeShape implements StructuredEdgeShape {
|
|
700
700
|
private readonly baseShape;
|
|
701
|
-
readonly
|
|
701
|
+
readonly midpointElement: SVGElement;
|
|
702
702
|
readonly group: SVGGElement;
|
|
703
703
|
readonly line: SVGPathElement;
|
|
704
704
|
readonly sourceArrow: SVGPathElement | null;
|
|
705
705
|
readonly targetArrow: SVGPathElement | null;
|
|
706
706
|
readonly onAfterRender: EventHandler<StructuredEdgeRenderModel>;
|
|
707
707
|
readonly svg: SVGSVGElement;
|
|
708
|
-
|
|
708
|
+
/**
|
|
709
|
+
* @deprecated
|
|
710
|
+
* use midpointElement instead
|
|
711
|
+
*/
|
|
712
|
+
readonly medianElement: SVGElement;
|
|
713
|
+
constructor(baseShape: StructuredEdgeShape, midpointElement: SVGElement);
|
|
709
714
|
render(params: EdgeRenderParams): void;
|
|
710
715
|
}
|
|
716
|
+
export { MidpointEdgeShape as MedianEdgeShape }
|
|
717
|
+
export { MidpointEdgeShape }
|
|
711
718
|
|
|
712
719
|
export declare type MouseEventVerifier = (event: MouseEvent) => boolean;
|
|
713
720
|
|