@ts4nfdi/terminology-service-suite 6.1.1 → 6.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.
- package/dist/app/types.d.ts +11 -10
- package/dist/components/widgets/GraphViewWidget/GraphConfigs.d.ts +78 -0
- package/dist/components/widgets/GraphViewWidget/GraphViewWidget.stories.d.ts +6 -2
- package/dist/components/widgets/GraphViewWidget/GraphViewWidgetStories.d.ts +37 -2
- package/dist/components/widgets/GraphViewWidget/types.d.ts +19 -0
- package/dist/components/widgets/GraphViewWidget/utils.d.ts +6 -0
- package/dist/esm/index.es.js +2717 -2552
- package/dist/esm/index.es.js.map +1 -1
- package/dist/stories/storyArgs.d.ts +4 -0
- package/package.json +2 -1
package/dist/app/types.d.ts
CHANGED
|
@@ -498,6 +498,10 @@ export type MetadataCompactProps = Partial<Omit<EuiCardProps, "layout">> & ApiOb
|
|
|
498
498
|
};
|
|
499
499
|
export type TermDepictionWidgetProps = ApiObj & ForcedIriObj & ForcedOntologyIdObj & UseLegacyObj;
|
|
500
500
|
export type GraphViewWidgetProps = ApiObj & ForcedIriObj & ForcedOntologyIdObj & CssClassNameObj & {
|
|
501
|
+
/**
|
|
502
|
+
* The target iri. used in the hierarchy mode to compare two terms in one graph.
|
|
503
|
+
*/
|
|
504
|
+
targetIri?: string;
|
|
501
505
|
/**
|
|
502
506
|
* When true, the graph will show the tree hierarchy for the target node in form of a graph.
|
|
503
507
|
*/
|
|
@@ -519,20 +523,17 @@ export type OlsGraphNode = {
|
|
|
519
523
|
/**
|
|
520
524
|
* Used in the GraphView widget for rendering a graph's node
|
|
521
525
|
*/
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
};
|
|
526
|
+
iri?: string;
|
|
527
|
+
label?: string;
|
|
528
|
+
level?: number;
|
|
526
529
|
};
|
|
527
530
|
export type OlsGraphEdge = {
|
|
528
531
|
/**
|
|
529
532
|
* Used in the GraphView widget for rendering a graph's edge
|
|
530
533
|
*/
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
target?: string;
|
|
536
|
-
};
|
|
534
|
+
uri?: string;
|
|
535
|
+
label?: string;
|
|
536
|
+
source?: string;
|
|
537
|
+
target?: string;
|
|
537
538
|
};
|
|
538
539
|
export {};
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { OlsGraphNode, OlsGraphEdge } from '../../../app/types';
|
|
2
|
+
export declare const hierarchicalConfig: {
|
|
3
|
+
enabled: boolean;
|
|
4
|
+
direction: string;
|
|
5
|
+
sortMethod: string;
|
|
6
|
+
};
|
|
7
|
+
export declare const graphNetworkConfig: {
|
|
8
|
+
/**
|
|
9
|
+
* for more options have a look at: https://visjs.github.io/vis-network/docs/network/#options
|
|
10
|
+
*/
|
|
11
|
+
autoResize: boolean;
|
|
12
|
+
height: string;
|
|
13
|
+
width: string;
|
|
14
|
+
locale: string;
|
|
15
|
+
layout: {
|
|
16
|
+
randomSeed: number;
|
|
17
|
+
improvedLayout: boolean;
|
|
18
|
+
clusterThreshold: number;
|
|
19
|
+
hierarchical: {
|
|
20
|
+
enabled: boolean;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
physics: {
|
|
24
|
+
enabled: boolean;
|
|
25
|
+
barnesHut: {
|
|
26
|
+
gravitationalConstant: number;
|
|
27
|
+
centralGravity: number;
|
|
28
|
+
springLength: number;
|
|
29
|
+
springConstant: number;
|
|
30
|
+
damping: number;
|
|
31
|
+
avoidOverlap: number;
|
|
32
|
+
};
|
|
33
|
+
hierarchicalRepulsion: {
|
|
34
|
+
damping: number;
|
|
35
|
+
avoidOverlap: number;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
interaction: {
|
|
39
|
+
dragNodes: boolean;
|
|
40
|
+
dragView: boolean;
|
|
41
|
+
zoomView: boolean;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
export declare class GraphNode {
|
|
45
|
+
id?: string;
|
|
46
|
+
color: {
|
|
47
|
+
background: string;
|
|
48
|
+
highlight: {
|
|
49
|
+
border: string;
|
|
50
|
+
background: string;
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
shape: string;
|
|
54
|
+
font: {
|
|
55
|
+
color: string;
|
|
56
|
+
};
|
|
57
|
+
label?: string;
|
|
58
|
+
constructor(node: OlsGraphNode, bgColor?: string, color?: string);
|
|
59
|
+
}
|
|
60
|
+
export declare class GraphEdge {
|
|
61
|
+
id?: string;
|
|
62
|
+
from?: string;
|
|
63
|
+
to?: string;
|
|
64
|
+
label?: string;
|
|
65
|
+
arrows?: {
|
|
66
|
+
to?: boolean;
|
|
67
|
+
};
|
|
68
|
+
width?: number;
|
|
69
|
+
color?: {
|
|
70
|
+
color?: string;
|
|
71
|
+
highlight?: string;
|
|
72
|
+
};
|
|
73
|
+
font?: {
|
|
74
|
+
size?: number;
|
|
75
|
+
};
|
|
76
|
+
dashes?: boolean;
|
|
77
|
+
constructor(edge: OlsGraphEdge, edgeLabel?: string);
|
|
78
|
+
}
|
|
@@ -19,13 +19,17 @@ declare const meta: {
|
|
|
19
19
|
iri: string;
|
|
20
20
|
ontologyId: string;
|
|
21
21
|
rootWalk: boolean;
|
|
22
|
+
hierarchy: boolean;
|
|
22
23
|
};
|
|
23
24
|
};
|
|
24
25
|
export default meta;
|
|
25
26
|
type Story = StoryObj<typeof meta>;
|
|
26
|
-
export declare const
|
|
27
|
-
export declare const
|
|
27
|
+
export declare const ChebiIon: Story;
|
|
28
|
+
export declare const ChebiIonComparison: Story;
|
|
29
|
+
export declare const ChebiIonRootWalk: Story;
|
|
28
30
|
export declare const ChebiWater: Story;
|
|
29
31
|
export declare const ChebiWaterRootWalk: Story;
|
|
30
32
|
export declare const ChebiCaffeineHierarchy: Story;
|
|
31
33
|
export declare const WithOnNodeDoubleClickCallback: Story;
|
|
34
|
+
export declare const ChebiCaffeineHierarchyWithComparison: Story;
|
|
35
|
+
export declare const ChebiIonAndIonRadicalWithComparison: Story;
|
|
@@ -6,30 +6,47 @@ export declare const GraphViewWidgetStoryArgs: {
|
|
|
6
6
|
iri: string;
|
|
7
7
|
ontologyId: string;
|
|
8
8
|
rootWalk: boolean;
|
|
9
|
+
hierarchy: boolean;
|
|
10
|
+
};
|
|
11
|
+
export declare const ChebiIonArgs: {
|
|
12
|
+
api: string;
|
|
13
|
+
iri: string;
|
|
14
|
+
ontologyId: string;
|
|
15
|
+
rootWalk: boolean;
|
|
16
|
+
hierarchy: boolean;
|
|
17
|
+
targetIri: string;
|
|
9
18
|
};
|
|
10
|
-
export declare const
|
|
19
|
+
export declare const ChebiIonComparisonArgs: {
|
|
11
20
|
api: string;
|
|
12
21
|
iri: string;
|
|
22
|
+
targetIri: string;
|
|
13
23
|
ontologyId: string;
|
|
14
24
|
rootWalk: boolean;
|
|
25
|
+
hierarchy: boolean;
|
|
15
26
|
};
|
|
16
|
-
export declare const
|
|
27
|
+
export declare const ChebiIonRootWalkArgs: {
|
|
17
28
|
api: string;
|
|
18
29
|
iri: string;
|
|
19
30
|
ontologyId: string;
|
|
20
31
|
rootWalk: boolean;
|
|
32
|
+
hierarchy: boolean;
|
|
33
|
+
targetIri: string;
|
|
21
34
|
};
|
|
22
35
|
export declare const ChebiWaterArgs: {
|
|
23
36
|
api: string;
|
|
24
37
|
iri: string;
|
|
25
38
|
ontologyId: string;
|
|
26
39
|
rootWalk: boolean;
|
|
40
|
+
hierarchy: boolean;
|
|
41
|
+
targetIri: string;
|
|
27
42
|
};
|
|
28
43
|
export declare const ChebiWaterRootWalkArgs: {
|
|
29
44
|
api: string;
|
|
30
45
|
iri: string;
|
|
31
46
|
ontologyId: string;
|
|
32
47
|
rootWalk: boolean;
|
|
48
|
+
hierarchy: boolean;
|
|
49
|
+
targetIri: string;
|
|
33
50
|
};
|
|
34
51
|
export declare const ChebiCaffeineHierarchyArgs: {
|
|
35
52
|
api: string;
|
|
@@ -37,6 +54,7 @@ export declare const ChebiCaffeineHierarchyArgs: {
|
|
|
37
54
|
ontologyId: string;
|
|
38
55
|
rootWalk: boolean;
|
|
39
56
|
hierarchy: boolean;
|
|
57
|
+
targetIri: string;
|
|
40
58
|
};
|
|
41
59
|
export declare const WithOnNodeDoubleClickCallbackArgs: {
|
|
42
60
|
api: string;
|
|
@@ -45,6 +63,23 @@ export declare const WithOnNodeDoubleClickCallbackArgs: {
|
|
|
45
63
|
rootWalk: boolean;
|
|
46
64
|
hierarchy: boolean;
|
|
47
65
|
onNodeClick: (iri: string) => void;
|
|
66
|
+
targetIri: string;
|
|
67
|
+
};
|
|
68
|
+
export declare const ChebiCaffeineHierarchyWithComparisonArgs: {
|
|
69
|
+
api: string;
|
|
70
|
+
iri: string;
|
|
71
|
+
targetIri: string;
|
|
72
|
+
ontologyId: string;
|
|
73
|
+
rootWalk: boolean;
|
|
74
|
+
hierarchy: boolean;
|
|
75
|
+
};
|
|
76
|
+
export declare const ChebiIonAndIonRadicalWithComparisonArgs: {
|
|
77
|
+
api: string;
|
|
78
|
+
iri: string;
|
|
79
|
+
targetIri: string;
|
|
80
|
+
ontologyId: string;
|
|
81
|
+
rootWalk: boolean;
|
|
82
|
+
hierarchy: boolean;
|
|
48
83
|
};
|
|
49
84
|
export declare const commonGraphViewWidgetPlay: ({ canvasElement, }: {
|
|
50
85
|
canvasElement: HTMLElement;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { JSTreeNode } from '../../../utils/olsApiTypes';
|
|
2
|
+
import { OlsGraphNode } from '../../../app';
|
|
3
|
+
export type GraphFetchData = {
|
|
4
|
+
treeData: JSTreeNode[];
|
|
5
|
+
termRelations?: VisGraphData;
|
|
6
|
+
targetTreeData?: JSTreeNode[];
|
|
7
|
+
targetTermRelations?: VisGraphData;
|
|
8
|
+
};
|
|
9
|
+
export type VisGraphData = {
|
|
10
|
+
nodes: OlsGraphNode[];
|
|
11
|
+
edges: any[];
|
|
12
|
+
};
|
|
13
|
+
export type GraphFetchFunctionInput = {
|
|
14
|
+
api: string;
|
|
15
|
+
ontologyId: string;
|
|
16
|
+
iri: string;
|
|
17
|
+
targetIri?: string;
|
|
18
|
+
dbClicked?: boolean;
|
|
19
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { GraphFetchData, GraphFetchFunctionInput } from './types';
|
|
2
|
+
import { JSTreeNode } from '../../../utils/olsApiTypes';
|
|
3
|
+
export declare function fetchRootWalkModeData(props: GraphFetchFunctionInput): Promise<GraphFetchData>;
|
|
4
|
+
export declare function fetchHierarchyModeData(props: GraphFetchFunctionInput): Promise<GraphFetchData>;
|
|
5
|
+
export declare function fetchNormalModeData(props: GraphFetchFunctionInput): Promise<GraphFetchData>;
|
|
6
|
+
export declare function convertFlatListToTreeStructure(listOfJsTreeNodes: JSTreeNode[]): JSTreeNode[];
|