@html-graph/html-graph 3.11.1 → 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 +28 -20
- package/dist/html-graph.js +507 -499
- 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,9 +298,24 @@ 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 {
|
|
318
|
+
readonly edgeShape?: EdgeShapeConfig;
|
|
304
319
|
readonly connectionTypeResolver?: ConnectionTypeResolver;
|
|
305
320
|
readonly connectionPreprocessor?: ConnectionPreprocessor;
|
|
306
321
|
readonly mouseDownEventVerifier?: MouseEventVerifier;
|
|
@@ -323,20 +338,6 @@ declare type ConstantPriority = number;
|
|
|
323
338
|
|
|
324
339
|
declare type CustomPriority = PriorityFn;
|
|
325
340
|
|
|
326
|
-
declare interface Defaults {
|
|
327
|
-
readonly nodes: {
|
|
328
|
-
readonly centerFn: CenterFn;
|
|
329
|
-
readonly priorityFn: PriorityFn;
|
|
330
|
-
};
|
|
331
|
-
readonly ports: {
|
|
332
|
-
readonly direction: number;
|
|
333
|
-
};
|
|
334
|
-
readonly edges: {
|
|
335
|
-
readonly shapeFactory: EdgeShapeFactory;
|
|
336
|
-
readonly priorityFn: PriorityFn;
|
|
337
|
-
};
|
|
338
|
-
}
|
|
339
|
-
|
|
340
341
|
export declare interface DirectEdgeParams {
|
|
341
342
|
readonly color?: string | undefined;
|
|
342
343
|
readonly width?: number | undefined;
|
|
@@ -394,7 +395,7 @@ export { DraggableNodesConfig }
|
|
|
394
395
|
|
|
395
396
|
declare interface EdgePath {
|
|
396
397
|
readonly path: string;
|
|
397
|
-
readonly
|
|
398
|
+
readonly midpoint: Point;
|
|
398
399
|
}
|
|
399
400
|
|
|
400
401
|
declare type EdgePathFactory = (sourceDirection: Point, targetDirection: Point, to: Point, flipX: number, flipY: number) => EdgePath;
|
|
@@ -695,18 +696,25 @@ export declare interface MarkPortRequest {
|
|
|
695
696
|
readonly direction?: number;
|
|
696
697
|
}
|
|
697
698
|
|
|
698
|
-
|
|
699
|
+
declare class MidpointEdgeShape implements StructuredEdgeShape {
|
|
699
700
|
private readonly baseShape;
|
|
700
|
-
readonly
|
|
701
|
+
readonly midpointElement: SVGElement;
|
|
701
702
|
readonly group: SVGGElement;
|
|
702
703
|
readonly line: SVGPathElement;
|
|
703
704
|
readonly sourceArrow: SVGPathElement | null;
|
|
704
705
|
readonly targetArrow: SVGPathElement | null;
|
|
705
706
|
readonly onAfterRender: EventHandler<StructuredEdgeRenderModel>;
|
|
706
707
|
readonly svg: SVGSVGElement;
|
|
707
|
-
|
|
708
|
+
/**
|
|
709
|
+
* @deprecated
|
|
710
|
+
* use midpointElement instead
|
|
711
|
+
*/
|
|
712
|
+
readonly medianElement: SVGElement;
|
|
713
|
+
constructor(baseShape: StructuredEdgeShape, midpointElement: SVGElement);
|
|
708
714
|
render(params: EdgeRenderParams): void;
|
|
709
715
|
}
|
|
716
|
+
export { MidpointEdgeShape as MedianEdgeShape }
|
|
717
|
+
export { MidpointEdgeShape }
|
|
710
718
|
|
|
711
719
|
export declare type MouseEventVerifier = (event: MouseEvent) => boolean;
|
|
712
720
|
|