@ocelescope/resources 0.0.0 → 0.1.2
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/LICENSE +661 -0
- package/README.md +19 -18
- package/dist/index.d.ts +33 -11
- package/dist/index.js +1709 -504
- package/package.json +18 -16
- package/dist/Cytoscape-BpEZfi09.js +0 -110
- package/dist/CytoscapeContext-DrvVpY9-.js +0 -10
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ocelescope/resources",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.1.2",
|
|
5
5
|
"description": "Ocelescope resources: helpers and UI components for rendering and exporting data.",
|
|
6
6
|
"author": "Görkem-Emre Öztürk <goerkem.oeztuerk@rwth-aachen.de>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -27,36 +27,38 @@
|
|
|
27
27
|
"access": "public"
|
|
28
28
|
},
|
|
29
29
|
"peerDependencies": {
|
|
30
|
+
"@floating-ui/react": "^0.27.18",
|
|
30
31
|
"@hpcc-js/wasm-graphviz": "^1.21.0",
|
|
31
|
-
"@mantine/core": "^
|
|
32
|
-
"
|
|
32
|
+
"@mantine/core": "^9.4.0",
|
|
33
|
+
"@xyflow/react": "^12.10.1",
|
|
33
34
|
"dayjs": "^1.11.19",
|
|
35
|
+
"elkjs": "^0.11.0",
|
|
34
36
|
"file-saver": "^2.0.5",
|
|
35
37
|
"lodash": "^4.17.23",
|
|
36
|
-
"lucide-react": "^0.
|
|
37
|
-
"mantine-datatable": "^
|
|
38
|
-
"next": "16.1.6",
|
|
38
|
+
"lucide-react": "^1.0.0",
|
|
39
|
+
"mantine-datatable": "^9.3.1",
|
|
40
|
+
"next": "^16.1.6",
|
|
39
41
|
"react": "^19.2.0",
|
|
40
|
-
"react-cytoscapejs": "^2.0.0",
|
|
41
42
|
"react-dom": "^19.2.0",
|
|
42
|
-
"react-plotly.js": "^
|
|
43
|
-
"react-zoom-pan-pinch": "^
|
|
44
|
-
"@
|
|
45
|
-
"@ocelescope/api-base": "0.0.0"
|
|
43
|
+
"react-plotly.js": "^4.0.0",
|
|
44
|
+
"react-zoom-pan-pinch": "^4.0.0",
|
|
45
|
+
"@ocelescope/api-base": "^0.1.0"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
|
-
"@
|
|
48
|
+
"@tsdown/css": "^0.22.0",
|
|
49
49
|
"@types/file-saver": "^2.0.7",
|
|
50
50
|
"@types/lodash": "^4.17.23",
|
|
51
51
|
"@types/node": "^25.0.3",
|
|
52
52
|
"@types/react": "^19.2.7",
|
|
53
|
-
"@types/react-cytoscapejs": "^1.2.6",
|
|
54
53
|
"@types/react-dom": "^19.2.3",
|
|
55
|
-
"
|
|
56
|
-
"
|
|
57
|
-
"tsdown": "^0.18.1",
|
|
54
|
+
"bumpp": "^11.0.0",
|
|
55
|
+
"tsdown": "^0.22.0",
|
|
58
56
|
"typescript": "^5.9.3"
|
|
59
57
|
},
|
|
58
|
+
"dependencies": {
|
|
59
|
+
"html-to-image": "1.11.13",
|
|
60
|
+
"jspdf": "^4.2.1"
|
|
61
|
+
},
|
|
60
62
|
"scripts": {
|
|
61
63
|
"build": "tsdown",
|
|
62
64
|
"dev": "tsdown --watch",
|
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
import { t as CytoscapeContext } from "./CytoscapeContext-DrvVpY9-.js";
|
|
2
|
-
import { useEffect, useRef } from "react";
|
|
3
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
-
import CytoscapeComponent from "react-cytoscapejs";
|
|
5
|
-
|
|
6
|
-
//#region src/components/Cytoscape/Cytoscape.tsx
|
|
7
|
-
const CytoscapeGraph = ({ children, ...props }) => {
|
|
8
|
-
const cytoscapeRef = useRef(null);
|
|
9
|
-
useEffect(() => {
|
|
10
|
-
const cy = cytoscapeRef.current;
|
|
11
|
-
if (!cy) return;
|
|
12
|
-
const handleResize = () => {
|
|
13
|
-
cy.fit();
|
|
14
|
-
};
|
|
15
|
-
cy.on("resize", handleResize);
|
|
16
|
-
return () => {
|
|
17
|
-
cy.removeListener("resize", handleResize);
|
|
18
|
-
};
|
|
19
|
-
}, []);
|
|
20
|
-
const nodeStyles = [{
|
|
21
|
-
selector: "node",
|
|
22
|
-
css: {
|
|
23
|
-
"font-size": 14,
|
|
24
|
-
shape: "data(shape)",
|
|
25
|
-
label: "data(label)",
|
|
26
|
-
"text-valign": "data(label_pos)",
|
|
27
|
-
"text-halign": "center",
|
|
28
|
-
width: "data(width)",
|
|
29
|
-
height: "data(height)",
|
|
30
|
-
"background-color": "data(color)"
|
|
31
|
-
}
|
|
32
|
-
}, {
|
|
33
|
-
selector: "node[border_color]",
|
|
34
|
-
css: {
|
|
35
|
-
"border-width": 2,
|
|
36
|
-
"border-color": "data(border_color)",
|
|
37
|
-
"border-style": "solid"
|
|
38
|
-
}
|
|
39
|
-
}];
|
|
40
|
-
const edgeStyles = [
|
|
41
|
-
{
|
|
42
|
-
selector: "edge",
|
|
43
|
-
css: {
|
|
44
|
-
"line-color": "data(color)",
|
|
45
|
-
"target-arrow-color": "data(color)",
|
|
46
|
-
"source-arrow-color": "data(color)",
|
|
47
|
-
"arrow-scale": 1.5,
|
|
48
|
-
"curve-style": "bezier",
|
|
49
|
-
"font-size": 12,
|
|
50
|
-
"text-background-opacity": 1,
|
|
51
|
-
"text-background-shape": "roundrectangle",
|
|
52
|
-
"text-background-padding": "3px",
|
|
53
|
-
"text-background-color": "#888"
|
|
54
|
-
}
|
|
55
|
-
},
|
|
56
|
-
{
|
|
57
|
-
selector: "edge[color]",
|
|
58
|
-
css: { "text-background-color": "data(color)" }
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
selector: "edge[label]",
|
|
62
|
-
css: {
|
|
63
|
-
label: "data(label)",
|
|
64
|
-
"text-rotation": "autorotate"
|
|
65
|
-
}
|
|
66
|
-
},
|
|
67
|
-
{
|
|
68
|
-
selector: "edge[start_label]",
|
|
69
|
-
css: {
|
|
70
|
-
"source-label": "data(start_label)",
|
|
71
|
-
"source-text-rotation": "autorotate",
|
|
72
|
-
"source-text-offset": 20
|
|
73
|
-
}
|
|
74
|
-
},
|
|
75
|
-
{
|
|
76
|
-
selector: "edge[end_label]",
|
|
77
|
-
css: {
|
|
78
|
-
"target-label": "data(end_label)",
|
|
79
|
-
"target-text-rotation": "autorotate",
|
|
80
|
-
"target-text-offset": 20
|
|
81
|
-
}
|
|
82
|
-
},
|
|
83
|
-
{
|
|
84
|
-
selector: "edge[start_arrow]",
|
|
85
|
-
css: { "source-arrow-shape": "data(start_arrow)" }
|
|
86
|
-
},
|
|
87
|
-
{
|
|
88
|
-
selector: "edge[end_arrow]",
|
|
89
|
-
css: { "target-arrow-shape": "data(end_arrow)" }
|
|
90
|
-
}
|
|
91
|
-
];
|
|
92
|
-
return /* @__PURE__ */ jsxs(CytoscapeContext.Provider, {
|
|
93
|
-
value: { cy: cytoscapeRef },
|
|
94
|
-
children: [/* @__PURE__ */ jsx(CytoscapeComponent, {
|
|
95
|
-
style: {
|
|
96
|
-
width: "100%",
|
|
97
|
-
height: "100%"
|
|
98
|
-
},
|
|
99
|
-
stylesheet: [...nodeStyles, ...edgeStyles],
|
|
100
|
-
cy: (cy) => {
|
|
101
|
-
cytoscapeRef.current = cy;
|
|
102
|
-
},
|
|
103
|
-
...props
|
|
104
|
-
}), children]
|
|
105
|
-
});
|
|
106
|
-
};
|
|
107
|
-
var Cytoscape_default = CytoscapeGraph;
|
|
108
|
-
|
|
109
|
-
//#endregion
|
|
110
|
-
export { Cytoscape_default as default };
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { createContext, useContext } from "react";
|
|
2
|
-
|
|
3
|
-
//#region src/components/Cytoscape/CytoscapeContext.tsx
|
|
4
|
-
const CytoscapeContext = createContext(void 0);
|
|
5
|
-
const useCytoscapeContext = () => {
|
|
6
|
-
return useContext(CytoscapeContext);
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
//#endregion
|
|
10
|
-
export { useCytoscapeContext as n, CytoscapeContext as t };
|