tycho-components 0.2.0-SNAPSHOT-2 → 0.2.0-SNAPSHOT-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/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 +3 -2
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- 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),
|
|
@@ -34,6 +34,7 @@ const init = (selector, tree, onReady) => {
|
|
|
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/dist/index.d.ts
CHANGED
|
@@ -50,6 +50,7 @@ export { default as Header } from './Header';
|
|
|
50
50
|
export { default as LanguageSelector } from './LanguageSelector';
|
|
51
51
|
export { default as Participants } from './Participants';
|
|
52
52
|
export { default as TreeView } from './TreeView';
|
|
53
|
+
export { default as SyntreesCytoscape } from './TreeView/cytoscape/SyntreesCytoscape';
|
|
53
54
|
export { default as VirtualKeyboard } from './VirtualKeyboard';
|
|
54
55
|
export { KeyboardCustomLayouts } from './VirtualKeyboard/KeyboardCustomLayout';
|
|
55
56
|
export type { KeyboardLayout } from './VirtualKeyboard/KeyboardCustomLayout';
|
package/dist/index.js
CHANGED
|
@@ -38,5 +38,6 @@ export { default as Header } from './Header';
|
|
|
38
38
|
export { default as LanguageSelector } from './LanguageSelector';
|
|
39
39
|
export { default as Participants } from './Participants';
|
|
40
40
|
export { default as TreeView } from './TreeView';
|
|
41
|
+
export { default as SyntreesCytoscape } from './TreeView/cytoscape/SyntreesCytoscape';
|
|
41
42
|
export { default as VirtualKeyboard } from './VirtualKeyboard';
|
|
42
43
|
export { KeyboardCustomLayouts } from './VirtualKeyboard/KeyboardCustomLayout';
|
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-4",
|
|
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",
|