@relation-graph/react 3.0.3 → 3.0.4
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 +1 -1
- package/relation-graph.js +9 -9
- package/relation-graph.mjs +1212 -1091
- package/relation-graph.umd.js +9 -9
- package/types/packages/platforms/react/src/relation-graph/src/core4react/RGCanvas.d.ts +1 -0
- package/types/packages/platforms/svelte/src/core4svelte/RelationGraphWithProvider.svelte.d.ts +1 -0
- package/types/packages/platforms/vue2/src/core4vue/editing/RGConnectTarget.vue.d.ts +9 -0
- package/types/packages/platforms/vue2/src/index.d.ts +9 -0
- package/types/packages/relation-graph-models/data/RGOptionsDataUtils.d.ts +0 -2
- package/types/packages/relation-graph-models/layouts/RGForceLayout.d.ts +1 -1
- package/types/packages/relation-graph-models/models/RelationGraphWith1View.d.ts +5 -0
- package/types/packages/relation-graph-models/models/RelationGraphWith2Data.d.ts +2 -0
- package/types/packages/relation-graph-models/models/RelationGraphWith6Effect.d.ts +2 -0
- package/types/packages/relation-graph-models/models/RelationGraphWith93Image.d.ts +2 -0
- package/types/packages/relation-graph-models/models/RelationGraphWith95Dom.d.ts +1 -0
- package/types/packages/relation-graph-models/models/RelationGraphWith99API.d.ts +1 -1
- package/types/packages/relation-graph-models/utils/line/RGPathGeneratorFor8.d.ts +2 -0
- package/types/packages/types.ts +12 -8
|
@@ -6,6 +6,7 @@ export interface RGCanvasProps {
|
|
|
6
6
|
lineSlot?: React.FC<RGLineSlotProps> | ((props: RGLineSlotProps) => React.ReactNode);
|
|
7
7
|
canvasPlugSlot?: React.FC | React.ReactNode;
|
|
8
8
|
canvasPlugAboveSlot?: React.ReactNode;
|
|
9
|
+
backgroundSlot?: React.ReactNode;
|
|
9
10
|
nodeExpandButtonSlot?: React.FC<RGNodeExpandHolderProps> | ((props: RGNodeExpandHolderProps) => React.ReactNode);
|
|
10
11
|
}
|
|
11
12
|
declare const RGCanvas: React.FC<RGCanvasProps>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { SvelteComponent as default } from 'svelte';
|
|
@@ -25,6 +25,10 @@ declare const _default: import('vue').DefineComponent<{
|
|
|
25
25
|
mustUseProp: boolean;
|
|
26
26
|
type: BooleanConstructor;
|
|
27
27
|
};
|
|
28
|
+
forSvg: {
|
|
29
|
+
mustUseProp: boolean;
|
|
30
|
+
type: BooleanConstructor;
|
|
31
|
+
};
|
|
28
32
|
disableDrag: {
|
|
29
33
|
mustUseProp: boolean;
|
|
30
34
|
type: BooleanConstructor;
|
|
@@ -64,6 +68,10 @@ declare const _default: import('vue').DefineComponent<{
|
|
|
64
68
|
mustUseProp: boolean;
|
|
65
69
|
type: BooleanConstructor;
|
|
66
70
|
};
|
|
71
|
+
forSvg: {
|
|
72
|
+
mustUseProp: boolean;
|
|
73
|
+
type: BooleanConstructor;
|
|
74
|
+
};
|
|
67
75
|
disableDrag: {
|
|
68
76
|
mustUseProp: boolean;
|
|
69
77
|
type: BooleanConstructor;
|
|
@@ -72,5 +80,6 @@ declare const _default: import('vue').DefineComponent<{
|
|
|
72
80
|
disableDrag: boolean;
|
|
73
81
|
junctionPoint: string;
|
|
74
82
|
disableDrop: boolean;
|
|
83
|
+
forSvg: boolean;
|
|
75
84
|
}>;
|
|
76
85
|
export default _default;
|
|
@@ -597,6 +597,10 @@ export declare const RGConnectTarget: import('vue').DefineComponent<{
|
|
|
597
597
|
mustUseProp: boolean;
|
|
598
598
|
type: BooleanConstructor;
|
|
599
599
|
};
|
|
600
|
+
forSvg: {
|
|
601
|
+
mustUseProp: boolean;
|
|
602
|
+
type: BooleanConstructor;
|
|
603
|
+
};
|
|
600
604
|
disableDrag: {
|
|
601
605
|
mustUseProp: boolean;
|
|
602
606
|
type: BooleanConstructor;
|
|
@@ -636,6 +640,10 @@ export declare const RGConnectTarget: import('vue').DefineComponent<{
|
|
|
636
640
|
mustUseProp: boolean;
|
|
637
641
|
type: BooleanConstructor;
|
|
638
642
|
};
|
|
643
|
+
forSvg: {
|
|
644
|
+
mustUseProp: boolean;
|
|
645
|
+
type: BooleanConstructor;
|
|
646
|
+
};
|
|
639
647
|
disableDrag: {
|
|
640
648
|
mustUseProp: boolean;
|
|
641
649
|
type: BooleanConstructor;
|
|
@@ -644,6 +652,7 @@ export declare const RGConnectTarget: import('vue').DefineComponent<{
|
|
|
644
652
|
disableDrag: boolean;
|
|
645
653
|
junctionPoint: string;
|
|
646
654
|
disableDrop: boolean;
|
|
655
|
+
forSvg: boolean;
|
|
647
656
|
}>;
|
|
648
657
|
export declare const RGEditingConnectPoints: import('vue').DefineComponent<{
|
|
649
658
|
mouseUpOnJunctionPoint: {
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { RGLayoutOptions, RGOptions, RGOptionsFull } from '../../types';
|
|
2
2
|
export declare const createDefaultConfig: (userOptions?: RGOptions) => RGOptionsFull;
|
|
3
|
-
export declare const applyDefaultOptionsByLayout: (thisLayout: RGLayoutOptions, _options: RGOptionsFull) => void;
|
|
4
3
|
export declare const appendDefaultOptions4Layout: (layoutOptions: RGLayoutOptions) => void;
|
|
5
4
|
declare const _default: {
|
|
6
5
|
createDefaultConfig: (userOptions?: Partial<import('../../types').RGOptionsInited>) => RGOptionsFull;
|
|
7
|
-
applyDefaultOptionsByLayout: (thisLayout: RGLayoutOptions, _options: RGOptionsFull) => void;
|
|
8
6
|
};
|
|
9
7
|
export default _default;
|
|
@@ -26,7 +26,7 @@ export declare class RGForceLayout extends RGBaseLayout {
|
|
|
26
26
|
private force_y_coefficient;
|
|
27
27
|
instanceId: string;
|
|
28
28
|
constructor(layoutOptions: RGForceLayoutOptions, graphOptions: RGOptionsFull, graphInstance: RelationGraphInstance);
|
|
29
|
-
updateOptions(layoutOptions: RGForceLayoutOptions): void;
|
|
29
|
+
updateOptions(layoutOptions: Partial<RGForceLayoutOptions>): void;
|
|
30
30
|
calcNodes: RGNode[];
|
|
31
31
|
placeNodes(calcNodes: RGNode[], rootNode?: RGNode): void;
|
|
32
32
|
protected getLevelR(levelDistanceArr: number[], level: number): number | undefined;
|
|
@@ -22,6 +22,7 @@ export declare class RelationGraphWith1View extends RelationGraphBase {
|
|
|
22
22
|
* @inner
|
|
23
23
|
*/
|
|
24
24
|
getLineTextContainer(line: RGLine): HTMLDivElement | undefined;
|
|
25
|
+
private viewBoundingClientRect;
|
|
25
26
|
/**
|
|
26
27
|
* Get the RelationGraph component DOM
|
|
27
28
|
* @return relationGraphDom:HTMLDivElement RelationGraph container DOM
|
|
@@ -49,6 +50,10 @@ export declare class RelationGraphWith1View extends RelationGraphBase {
|
|
|
49
50
|
x: number;
|
|
50
51
|
y: number;
|
|
51
52
|
};
|
|
53
|
+
getViewXyByClientXy(clientXY: RGCoordinate): {
|
|
54
|
+
x: number;
|
|
55
|
+
y: number;
|
|
56
|
+
};
|
|
52
57
|
/**
|
|
53
58
|
* Get the coordinates mapped on the "relation-graph Component viewport" from the canvas coordinates
|
|
54
59
|
* @param clientXY = {x: e.clientX, y: e.clientY}
|
|
@@ -36,6 +36,8 @@ export declare class RelationGraphWith2Data extends RelationGraphWith1View {
|
|
|
36
36
|
shouldRenderNodesRef?: any;
|
|
37
37
|
shouldRenderLinesRef?: any;
|
|
38
38
|
shouldRenderFakeLinesRef?: any;
|
|
39
|
+
textContainer4NormalRef?: any;
|
|
40
|
+
textContainer4FakeLineRef?: any;
|
|
39
41
|
};
|
|
40
42
|
/**
|
|
41
43
|
* @inner
|
|
@@ -32,6 +32,8 @@ export declare class RelationGraphWith6Effect extends RelationGraphWith5Zoom {
|
|
|
32
32
|
* @param nodes Optional, defaults to all nodes in the graph
|
|
33
33
|
*/
|
|
34
34
|
zoomToFit(nodes?: (RGNode | RGRectTarget)[]): void;
|
|
35
|
+
zoomToFitWithAnimation(nodes?: (RGNode | RGRectTarget)[]): Promise<void>;
|
|
36
|
+
moveToCenterWithAnimation(nodes?: (RGNode | RGRectTarget)[]): Promise<void>;
|
|
35
37
|
/**
|
|
36
38
|
* Enable node position animation
|
|
37
39
|
* - After enabling, when the node position changes, there will be a smooth transition animation effect.
|
|
@@ -29,8 +29,10 @@ export declare class RelationGraphWith93Image extends RelationGraphWith92MiniVie
|
|
|
29
29
|
*
|
|
30
30
|
*/
|
|
31
31
|
prepareForImageGeneration(): Promise<HTMLElement>;
|
|
32
|
+
private graphStatusBeforeImageGeneration;
|
|
32
33
|
/**
|
|
33
34
|
* After the image is generated, let relation-graph return to the previous state
|
|
34
35
|
*/
|
|
35
36
|
restoreAfterImageGeneration(): Promise<void>;
|
|
37
|
+
private moveItemsAndFitContent;
|
|
36
38
|
}
|
|
@@ -49,7 +49,7 @@ export declare class RelationGraphWith99API extends RelationGraphWith95Dom {
|
|
|
49
49
|
/**
|
|
50
50
|
* Get the currently selected line object in the graph
|
|
51
51
|
*/
|
|
52
|
-
getCheckedLine(): import('../../types').RGFakeLine | undefined;
|
|
52
|
+
getCheckedLine(): RGLine | import('../../types').RGFakeLine | undefined;
|
|
53
53
|
/**
|
|
54
54
|
* Get all selected nodes in the graph
|
|
55
55
|
*/
|
package/types/packages/types.ts
CHANGED
|
@@ -294,7 +294,7 @@ export type RGNode = Omit<JsonNode, 'children'> & RGRectTarget & {
|
|
|
294
294
|
* ```
|
|
295
295
|
*/
|
|
296
296
|
export type JsonLine = {
|
|
297
|
-
id
|
|
297
|
+
id: string
|
|
298
298
|
from: string
|
|
299
299
|
to: string
|
|
300
300
|
text?: string
|
|
@@ -346,8 +346,8 @@ export type JsonLine = {
|
|
|
346
346
|
*/
|
|
347
347
|
export type RGFakeLine = JsonLine & {
|
|
348
348
|
id: string;
|
|
349
|
-
fromType
|
|
350
|
-
toType
|
|
349
|
+
fromType: RGInnerConnectTargetType | string;
|
|
350
|
+
toType: RGInnerConnectTargetType | string;
|
|
351
351
|
}
|
|
352
352
|
/**
|
|
353
353
|
* Enhanced line type for runtime in relation-graph
|
|
@@ -401,7 +401,7 @@ export type RGJsonData = {
|
|
|
401
401
|
rootId?: string
|
|
402
402
|
nodes: JsonNode[]
|
|
403
403
|
lines: JsonLine[]
|
|
404
|
-
fakeLines?:
|
|
404
|
+
fakeLines?: JsonLine[]
|
|
405
405
|
};
|
|
406
406
|
/**
|
|
407
407
|
* RGGraphData is the internal data structure used by relation-graph to manage graph data
|
|
@@ -479,9 +479,10 @@ export type RGLayoutOptions4Alignment = {
|
|
|
479
479
|
export type RGLayoutOptionsCore = RGLayoutOptions4Alignment & {
|
|
480
480
|
layoutName: string;
|
|
481
481
|
layoutDirection?: 'h' | 'v';
|
|
482
|
-
fixedRootNode?: boolean
|
|
483
|
-
autoLayouting?: boolean
|
|
484
|
-
supportAutoLayout?: boolean
|
|
482
|
+
fixedRootNode?: boolean;
|
|
483
|
+
autoLayouting?: boolean;
|
|
484
|
+
supportAutoLayout?: boolean;
|
|
485
|
+
rotate?: number;
|
|
485
486
|
};
|
|
486
487
|
/**
|
|
487
488
|
* Force-directed layout options type
|
|
@@ -976,6 +977,7 @@ export interface RGConnectTargetProps {
|
|
|
976
977
|
onDragConnectStart?: (newLineTemplate?: JsonLineLike, event?: RGUserEvent) => void;
|
|
977
978
|
onDragConnectEnd?: RGLineConnectEventHandler; // default is true
|
|
978
979
|
className?: string;
|
|
980
|
+
forSvg?: boolean;
|
|
979
981
|
style?: Record<string, string | number | undefined>,
|
|
980
982
|
}
|
|
981
983
|
|
|
@@ -1109,7 +1111,9 @@ export type ReactiveDataStores = {
|
|
|
1109
1111
|
optionsRef?: any, // Store Vue reactive data
|
|
1110
1112
|
shouldRenderNodesRef?: any, // Store Vue reactive data
|
|
1111
1113
|
shouldRenderLinesRef?: any, // Store Vue reactive data
|
|
1112
|
-
shouldRenderFakeLinesRef?: any // Store Vue reactive data
|
|
1114
|
+
shouldRenderFakeLinesRef?: any, // Store Vue reactive data
|
|
1115
|
+
textContainer4NormalRef?:any,
|
|
1116
|
+
textContainer4FakeLineRef?:any
|
|
1113
1117
|
}
|
|
1114
1118
|
/**
|
|
1115
1119
|
* @inner
|