tycho-components 0.2.0-SNAPSHOT-3 → 0.2.0-SNAPSHOT-5
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/TreeView/TreeView.js +8 -3
- package/dist/TreeView/cytoscape/CytoscapeStylesheet.d.ts +2 -2
- package/dist/TreeView/cytoscape/CytoscapeStylesheet.js +2 -2
- package/dist/TreeView/cytoscape/SyntreesCytoscape.d.ts +9 -2
- package/dist/TreeView/cytoscape/SyntreesCytoscape.js +4 -3
- package/package.json +3 -3
|
@@ -20,10 +20,15 @@ export default function TreeView({ struct, expression, onExpand, selector = 'can
|
|
|
20
20
|
if (!struct)
|
|
21
21
|
return;
|
|
22
22
|
const tree = new CytoscapeTreeConverter().execute(struct, showInfo);
|
|
23
|
-
tree
|
|
24
|
-
SyntreesCytoscape.init(
|
|
25
|
-
|
|
23
|
+
if (tree) {
|
|
24
|
+
SyntreesCytoscape.init({
|
|
25
|
+
selector,
|
|
26
|
+
tree,
|
|
27
|
+
onReady: (thisCy) => {
|
|
28
|
+
setCy(thisCy);
|
|
29
|
+
},
|
|
26
30
|
});
|
|
31
|
+
}
|
|
27
32
|
};
|
|
28
33
|
const downloadPsd = () => {
|
|
29
34
|
if (!expression)
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const
|
|
2
|
-
export default
|
|
1
|
+
declare const defaultStylesheet: Array<cytoscape.StylesheetCSS>;
|
|
2
|
+
export default defaultStylesheet;
|
|
@@ -1,6 +1,13 @@
|
|
|
1
|
-
import { Core } from 'cytoscape';
|
|
1
|
+
import cytoscape, { Core } from 'cytoscape';
|
|
2
2
|
import { CytoscapeTree } from '../../configs/types/Tree';
|
|
3
|
+
type Props = {
|
|
4
|
+
selector: string;
|
|
5
|
+
tree: CytoscapeTree;
|
|
6
|
+
stylesheet?: cytoscape.StylesheetCSS[];
|
|
7
|
+
dagre?: boolean;
|
|
8
|
+
onReady?: (cy: Core) => void;
|
|
9
|
+
};
|
|
3
10
|
declare const SyntreesCytoscape: {
|
|
4
|
-
init: (selector
|
|
11
|
+
init: ({ selector, tree, dagre, stylesheet, onReady, }: Props) => Core;
|
|
5
12
|
};
|
|
6
13
|
export default SyntreesCytoscape;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import cytoscape from 'cytoscape';
|
|
2
|
-
import
|
|
3
|
-
const init = (selector, tree, onReady) => {
|
|
2
|
+
import defaultStylesheet from './CytoscapeStylesheet';
|
|
3
|
+
const init = ({ selector, tree, dagre = false, stylesheet = defaultStylesheet, onReady, }) => {
|
|
4
4
|
destroy(selector);
|
|
5
5
|
const cy = cytoscape({
|
|
6
6
|
container: document.getElementById(selector),
|
|
@@ -28,12 +28,13 @@ const init = (selector, tree, onReady) => {
|
|
|
28
28
|
textureOnViewport: false,
|
|
29
29
|
motionBlur: false,
|
|
30
30
|
motionBlurOpacity: 0.2,
|
|
31
|
-
wheelSensitivity:
|
|
31
|
+
wheelSensitivity: 1.5,
|
|
32
32
|
pixelRatio: 1,
|
|
33
33
|
});
|
|
34
34
|
cy.ready(() => {
|
|
35
35
|
cy.fit();
|
|
36
36
|
cy.center();
|
|
37
|
+
dagre && cy.layout({ name: 'dagre' }).run();
|
|
37
38
|
onReady && onReady(cy);
|
|
38
39
|
});
|
|
39
40
|
return cy;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tycho-components",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.2.0-SNAPSHOT-
|
|
4
|
+
"version": "0.2.0-SNAPSHOT-5",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"exports": {
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"@tanstack/react-table": "^8.20.6",
|
|
24
24
|
"axios": "^1.7.7",
|
|
25
25
|
"classnames": "^2.5.1",
|
|
26
|
-
"cytoscape": "^3.
|
|
26
|
+
"cytoscape": "^3.28.1",
|
|
27
27
|
"date-fns": "^2.29.1",
|
|
28
28
|
"date-fns-tz": "^1.3.6",
|
|
29
29
|
"file-saver": "^2.0.5",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"@storybook/react": "^7.5.3",
|
|
65
65
|
"@storybook/react-vite": "^7.5.3",
|
|
66
66
|
"@storybook/testing-library": "^0.2.2",
|
|
67
|
-
"@types/cytoscape": "^3.19.
|
|
67
|
+
"@types/cytoscape": "^3.19.15",
|
|
68
68
|
"@types/file-saver": "^2.0.5",
|
|
69
69
|
"@types/js-cookie": "^3.0.6",
|
|
70
70
|
"@types/react": "^18.2.0",
|