@linkdlab/funcnodes_react_flow 0.1.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/dist/frontend/datarenderer/images.d.ts +11 -0
- package/dist/frontend/datarenderer/images.js +13 -0
- package/dist/frontend/datarenderer/images.js.map +1 -0
- package/dist/frontend/datarenderer/index.d.ts +16 -0
- package/dist/frontend/datarenderer/index.js +26 -0
- package/dist/frontend/datarenderer/index.js.map +1 -0
- package/dist/frontend/datarenderer/plotly.d.ts +14 -0
- package/dist/frontend/datarenderer/plotly.js +53 -0
- package/dist/frontend/datarenderer/plotly.js.map +1 -0
- package/dist/frontend/dialog.d.ts +17 -0
- package/dist/frontend/dialog.js +26 -0
- package/dist/frontend/dialog.js.map +1 -0
- package/dist/frontend/edge.d.ts +5 -0
- package/dist/frontend/edge.js +40 -0
- package/dist/frontend/edge.js.map +1 -0
- package/dist/frontend/funcnodesreactflow/index.d.ts +6 -0
- package/dist/frontend/funcnodesreactflow/index.js +94 -0
- package/dist/frontend/funcnodesreactflow/index.js.map +1 -0
- package/dist/frontend/funcnodesreactflow/react_flow_layer.d.ts +5 -0
- package/dist/frontend/funcnodesreactflow/react_flow_layer.js +149 -0
- package/dist/frontend/funcnodesreactflow/react_flow_layer.js.map +1 -0
- package/dist/frontend/header/index.d.ts +4 -0
- package/dist/frontend/header/index.js +227 -0
- package/dist/frontend/header/index.js.map +1 -0
- package/{src/frontend/index.tsx → dist/frontend/index.d.ts} +0 -1
- package/dist/frontend/index.js +4 -0
- package/dist/frontend/index.js.map +1 -0
- package/dist/frontend/lib.d.ts +10 -0
- package/dist/frontend/lib.js +107 -0
- package/dist/frontend/lib.js.map +1 -0
- package/{src/frontend/node/index.tsx → dist/frontend/node/index.d.ts} +0 -1
- package/dist/frontend/node/index.js +3 -0
- package/dist/frontend/node/index.js.map +1 -0
- package/dist/frontend/node/io/default_input_renderer.d.ts +11 -0
- package/dist/frontend/node/io/default_input_renderer.js +235 -0
- package/dist/frontend/node/io/default_input_renderer.js.map +1 -0
- package/dist/frontend/node/io/default_output_render.d.ts +6 -0
- package/dist/frontend/node/io/default_output_render.js +23 -0
- package/dist/frontend/node/io/default_output_render.js.map +1 -0
- package/dist/frontend/node/io/handle_renderer.d.ts +6 -0
- package/dist/frontend/node/io/handle_renderer.js +70 -0
- package/dist/frontend/node/io/handle_renderer.js.map +1 -0
- package/{src/frontend/node/io/index.tsx → dist/frontend/node/io/index.d.ts} +0 -1
- package/dist/frontend/node/io/index.js +4 -0
- package/dist/frontend/node/io/index.js.map +1 -0
- package/dist/frontend/node/io/io.d.ts +16 -0
- package/dist/frontend/node/io/io.js +98 -0
- package/dist/frontend/node/io/io.js.map +1 -0
- package/dist/frontend/node/io/nodeinput.d.ts +6 -0
- package/dist/frontend/node/io/nodeinput.js +74 -0
- package/dist/frontend/node/io/nodeinput.js.map +1 -0
- package/dist/frontend/node/io/nodeoutput.d.ts +6 -0
- package/dist/frontend/node/io/nodeoutput.js +19 -0
- package/dist/frontend/node/io/nodeoutput.js.map +1 -0
- package/dist/frontend/node/node.d.ts +20 -0
- package/dist/frontend/node/node.js +118 -0
- package/dist/frontend/node/node.js.map +1 -0
- package/dist/frontend/utils/colorpicker.d.ts +19 -0
- package/dist/frontend/utils/colorpicker.js +209 -0
- package/dist/frontend/utils/colorpicker.js.map +1 -0
- package/dist/frontend/utils/jsondata.d.ts +6 -0
- package/dist/frontend/utils/jsondata.js +8 -0
- package/dist/frontend/utils/jsondata.js.map +1 -0
- package/dist/frontend/utils/table.d.ts +11 -0
- package/dist/frontend/utils/table.js +108 -0
- package/dist/frontend/utils/table.js.map +1 -0
- package/dist/funcnodes/funcnodesworker.d.ts +72 -0
- package/dist/funcnodes/funcnodesworker.js +532 -0
- package/dist/funcnodes/funcnodesworker.js.map +1 -0
- package/dist/funcnodes/index.js +5 -0
- package/dist/funcnodes/index.js.map +1 -0
- package/dist/funcnodes/websocketworker.d.ts +27 -0
- package/dist/funcnodes/websocketworker.js +224 -0
- package/dist/funcnodes/websocketworker.js.map +1 -0
- package/dist/funcnodes/workermanager.d.ts +32 -0
- package/dist/funcnodes/workermanager.js +241 -0
- package/dist/funcnodes/workermanager.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -0
- package/dist/states/edge.d.ts +7 -0
- package/dist/states/edge.js +6 -0
- package/dist/states/edge.js.map +1 -0
- package/dist/states/edge.t.d.ts +16 -0
- package/dist/states/edge.t.js +2 -0
- package/dist/states/edge.t.js.map +1 -0
- package/dist/states/fnrfzst.d.ts +10 -0
- package/dist/states/fnrfzst.js +378 -0
- package/dist/states/fnrfzst.js.map +1 -0
- package/dist/states/fnrfzst.t.d.ts +100 -0
- package/dist/states/fnrfzst.t.js +2 -0
- package/dist/states/fnrfzst.t.js.map +1 -0
- package/dist/states/index.d.ts +7 -0
- package/dist/states/index.js +6 -0
- package/dist/states/index.js.map +1 -0
- package/dist/states/lib.d.ts +3 -0
- package/dist/states/lib.js +14 -0
- package/dist/states/lib.js.map +1 -0
- package/dist/states/lib.t.d.ts +24 -0
- package/dist/states/lib.t.js +2 -0
- package/dist/states/lib.t.js.map +1 -0
- package/dist/states/node.d.ts +4 -0
- package/dist/states/node.js +43 -0
- package/dist/states/node.js.map +1 -0
- package/dist/states/node.t.d.ts +73 -0
- package/dist/states/node.t.js +2 -0
- package/dist/states/node.t.js.map +1 -0
- package/dist/states/nodeio.t.d.ts +67 -0
- package/dist/states/nodeio.t.js +2 -0
- package/dist/states/nodeio.t.js.map +1 -0
- package/dist/states/nodespace.d.ts +3 -0
- package/dist/states/nodespace.js +77 -0
- package/dist/states/nodespace.js.map +1 -0
- package/dist/states/nodespace.t.d.ts +16 -0
- package/dist/states/nodespace.t.js +2 -0
- package/dist/states/nodespace.t.js.map +1 -0
- package/dist/states/reactflow.d.ts +8 -0
- package/dist/states/reactflow.js +33 -0
- package/dist/states/reactflow.js.map +1 -0
- package/dist/states/reactflow.t.d.ts +11 -0
- package/dist/states/reactflow.t.js +2 -0
- package/dist/states/reactflow.t.js.map +1 -0
- package/dist/types/rendering.t.d.ts +10 -0
- package/dist/types/rendering.t.js +2 -0
- package/dist/types/rendering.t.js.map +1 -0
- package/dist/utils/index.d.ts +3 -0
- package/dist/utils/index.js +3 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/objects.d.ts +19 -0
- package/dist/utils/objects.js +118 -0
- package/dist/utils/objects.js.map +1 -0
- package/package.json +52 -21
- package/package copy.json +0 -63
- package/public/favicon.ico +0 -0
- package/public/index.html +0 -43
- package/public/logo192.png +0 -0
- package/public/logo512.png +0 -0
- package/public/manifest.json +0 -25
- package/public/robots.txt +0 -3
- package/public/worker_manager +0 -1
- package/src/App.css +0 -38
- package/src/App.test.tsx +0 -9
- package/src/App.tsx +0 -22
- package/src/frontend/datarenderer/images.tsx +0 -28
- package/src/frontend/datarenderer/index.tsx +0 -53
- package/src/frontend/datarenderer/plotly.tsx +0 -82
- package/src/frontend/dialog.scss +0 -88
- package/src/frontend/dialog.tsx +0 -70
- package/src/frontend/edge.scss +0 -15
- package/src/frontend/edge.tsx +0 -31
- package/src/frontend/funcnodesreactflow.scss +0 -63
- package/src/frontend/funcnodesreactflow.tsx +0 -283
- package/src/frontend/header/header.scss +0 -48
- package/src/frontend/header/index.tsx +0 -268
- package/src/frontend/layout/htmlelements.scss +0 -63
- package/src/frontend/lib.scss +0 -157
- package/src/frontend/lib.tsx +0 -198
- package/src/frontend/node/io/default_input_renderer.tsx +0 -327
- package/src/frontend/node/io/default_output_render.tsx +0 -26
- package/src/frontend/node/io/handle_renderer.tsx +0 -89
- package/src/frontend/node/io/io.scss +0 -91
- package/src/frontend/node/io/io.tsx +0 -114
- package/src/frontend/node/io/nodeinput.tsx +0 -125
- package/src/frontend/node/io/nodeoutput.tsx +0 -37
- package/src/frontend/node/node.scss +0 -265
- package/src/frontend/node/node.tsx +0 -208
- package/src/frontend/nodecontextmenu.scss +0 -18
- package/src/frontend/utils/colorpicker.scss +0 -37
- package/src/frontend/utils/colorpicker.tsx +0 -342
- package/src/frontend/utils/jsondata.tsx +0 -19
- package/src/frontend/utils/table.scss +0 -22
- package/src/frontend/utils/table.tsx +0 -159
- package/src/funcnodes/funcnodesworker.ts +0 -455
- package/src/funcnodes/websocketworker.ts +0 -153
- package/src/funcnodes/workermanager.ts +0 -229
- package/src/index.css +0 -13
- package/src/index.tsx +0 -19
- package/src/logo.svg +0 -1
- package/src/react-app-env.d.ts +0 -1
- package/src/reportWebVitals.ts +0 -15
- package/src/setupTests.ts +0 -5
- package/src/state/edge.ts +0 -35
- package/src/state/fnrfzst.ts +0 -440
- package/src/state/index.ts +0 -139
- package/src/state/lib.ts +0 -26
- package/src/state/node.ts +0 -118
- package/src/state/nodespace.ts +0 -151
- package/src/state/reactflow.ts +0 -65
- package/src/types/lib.d.ts +0 -16
- package/src/types/node.d.ts +0 -29
- package/src/types/nodeio.d.ts +0 -82
- package/src/types/worker.d.ts +0 -56
- package/tsconfig.json +0 -20
- /package/{src/funcnodes/index.ts → dist/funcnodes/index.d.ts} +0 -0
package/package copy.json
DELETED
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "funcnodes_react_flow",
|
|
3
|
-
"version": "0.1.0",
|
|
4
|
-
"private": true,
|
|
5
|
-
"dependencies": {
|
|
6
|
-
"@emotion/react": "^11.11.3",
|
|
7
|
-
"@emotion/styled": "^11.11.0",
|
|
8
|
-
"@mui/icons-material": "^5.15.10",
|
|
9
|
-
"@mui/material": "^5.15.10",
|
|
10
|
-
"@radix-ui/react-dialog": "^1.0.5",
|
|
11
|
-
"@radix-ui/react-popover": "^1.0.7",
|
|
12
|
-
"@radix-ui/react-tooltip": "^1.0.7",
|
|
13
|
-
"@testing-library/jest-dom": "^5.14.1",
|
|
14
|
-
"@testing-library/react": "^13.0.0",
|
|
15
|
-
"@testing-library/user-event": "^13.2.1",
|
|
16
|
-
"@types/color-convert": "^2.0.3",
|
|
17
|
-
"@types/jest": "^27.0.1",
|
|
18
|
-
"@types/node": "^16.7.13",
|
|
19
|
-
"@types/plotly.js": "^2.29.1",
|
|
20
|
-
"@types/react": "^18.0.0",
|
|
21
|
-
"@types/react-dom": "^18.0.0",
|
|
22
|
-
"@types/react-plotly.js": "^2.6.3",
|
|
23
|
-
"@types/uuid": "^9.0.8",
|
|
24
|
-
"color-convert": "^2.0.1",
|
|
25
|
-
"plotly.js": "^2.29.1",
|
|
26
|
-
"react": "^18.2.0",
|
|
27
|
-
"react-dom": "^18.2.0",
|
|
28
|
-
"react-json-view-lite": "^1.3.0",
|
|
29
|
-
"react-plotly.js": "^2.6.0",
|
|
30
|
-
"react-scripts": "5.0.1",
|
|
31
|
-
"reactflow": "^11.10.3",
|
|
32
|
-
"sass": "^1.70.0",
|
|
33
|
-
"scss": "^0.2.4",
|
|
34
|
-
"typescript": "^4.4.2",
|
|
35
|
-
"uuid": "^9.0.1",
|
|
36
|
-
"web-vitals": "^2.1.0",
|
|
37
|
-
"zustand": "^4.5.0"
|
|
38
|
-
},
|
|
39
|
-
"scripts": {
|
|
40
|
-
"start": "react-scripts start",
|
|
41
|
-
"build": "react-scripts build",
|
|
42
|
-
"test": "react-scripts test",
|
|
43
|
-
"eject": "react-scripts eject"
|
|
44
|
-
},
|
|
45
|
-
"eslintConfig": {
|
|
46
|
-
"extends": [
|
|
47
|
-
"react-app",
|
|
48
|
-
"react-app/jest"
|
|
49
|
-
]
|
|
50
|
-
},
|
|
51
|
-
"browserslist": {
|
|
52
|
-
"production": [
|
|
53
|
-
">0.2%",
|
|
54
|
-
"not dead",
|
|
55
|
-
"not op_mini all"
|
|
56
|
-
],
|
|
57
|
-
"development": [
|
|
58
|
-
"last 1 chrome version",
|
|
59
|
-
"last 1 firefox version",
|
|
60
|
-
"last 1 safari version"
|
|
61
|
-
]
|
|
62
|
-
}
|
|
63
|
-
}
|
package/public/favicon.ico
DELETED
|
Binary file
|
package/public/index.html
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="utf-8" />
|
|
5
|
-
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
|
|
6
|
-
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
7
|
-
<meta name="theme-color" content="#000000" />
|
|
8
|
-
<meta
|
|
9
|
-
name="description"
|
|
10
|
-
content="Web site created using create-react-app"
|
|
11
|
-
/>
|
|
12
|
-
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
|
|
13
|
-
<!--
|
|
14
|
-
manifest.json provides metadata used when your web app is installed on a
|
|
15
|
-
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
|
|
16
|
-
-->
|
|
17
|
-
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
|
|
18
|
-
<!--
|
|
19
|
-
Notice the use of %PUBLIC_URL% in the tags above.
|
|
20
|
-
It will be replaced with the URL of the `public` folder during the build.
|
|
21
|
-
Only files inside the `public` folder can be referenced from the HTML.
|
|
22
|
-
|
|
23
|
-
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
|
|
24
|
-
work correctly both with client-side routing and a non-root public URL.
|
|
25
|
-
Learn how to configure a non-root public URL by running `npm run build`.
|
|
26
|
-
-->
|
|
27
|
-
<title>FuncNodes</title>
|
|
28
|
-
</head>
|
|
29
|
-
<body>
|
|
30
|
-
<noscript>You need to enable JavaScript to run this app.</noscript>
|
|
31
|
-
<div id="root"></div>
|
|
32
|
-
<!--
|
|
33
|
-
This HTML file is a template.
|
|
34
|
-
If you open it directly in the browser, you will see an empty page.
|
|
35
|
-
|
|
36
|
-
You can add webfonts, meta tags, or analytics to this file.
|
|
37
|
-
The build step will place the bundled scripts into the <body> tag.
|
|
38
|
-
|
|
39
|
-
To begin the development, run `npm start` or `yarn start`.
|
|
40
|
-
To create a production bundle, use `npm run build` or `yarn build`.
|
|
41
|
-
-->
|
|
42
|
-
</body>
|
|
43
|
-
</html>
|
package/public/logo192.png
DELETED
|
Binary file
|
package/public/logo512.png
DELETED
|
Binary file
|
package/public/manifest.json
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"short_name": "React App",
|
|
3
|
-
"name": "Create React App Sample",
|
|
4
|
-
"icons": [
|
|
5
|
-
{
|
|
6
|
-
"src": "favicon.ico",
|
|
7
|
-
"sizes": "64x64 32x32 24x24 16x16",
|
|
8
|
-
"type": "image/x-icon"
|
|
9
|
-
},
|
|
10
|
-
{
|
|
11
|
-
"src": "logo192.png",
|
|
12
|
-
"type": "image/png",
|
|
13
|
-
"sizes": "192x192"
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
"src": "logo512.png",
|
|
17
|
-
"type": "image/png",
|
|
18
|
-
"sizes": "512x512"
|
|
19
|
-
}
|
|
20
|
-
],
|
|
21
|
-
"start_url": ".",
|
|
22
|
-
"display": "standalone",
|
|
23
|
-
"theme_color": "#000000",
|
|
24
|
-
"background_color": "#ffffff"
|
|
25
|
-
}
|
package/public/robots.txt
DELETED
package/public/worker_manager
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
ws://localhost:9380
|
package/src/App.css
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
.App {
|
|
2
|
-
text-align: center;
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
.App-logo {
|
|
6
|
-
height: 40vmin;
|
|
7
|
-
pointer-events: none;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
@media (prefers-reduced-motion: no-preference) {
|
|
11
|
-
.App-logo {
|
|
12
|
-
animation: App-logo-spin infinite 20s linear;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
.App-header {
|
|
17
|
-
background-color: #282c34;
|
|
18
|
-
min-height: 100vh;
|
|
19
|
-
display: flex;
|
|
20
|
-
flex-direction: column;
|
|
21
|
-
align-items: center;
|
|
22
|
-
justify-content: center;
|
|
23
|
-
font-size: calc(10px + 2vmin);
|
|
24
|
-
color: white;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
.App-link {
|
|
28
|
-
color: #61dafb;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
@keyframes App-logo-spin {
|
|
32
|
-
from {
|
|
33
|
-
transform: rotate(0deg);
|
|
34
|
-
}
|
|
35
|
-
to {
|
|
36
|
-
transform: rotate(360deg);
|
|
37
|
-
}
|
|
38
|
-
}
|
package/src/App.test.tsx
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { render, screen } from '@testing-library/react';
|
|
3
|
-
import App from './App';
|
|
4
|
-
|
|
5
|
-
test('renders learn react link', () => {
|
|
6
|
-
render(<App />);
|
|
7
|
-
const linkElement = screen.getByText(/learn react/i);
|
|
8
|
-
expect(linkElement).toBeInTheDocument();
|
|
9
|
-
});
|
package/src/App.tsx
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import "./App.css";
|
|
3
|
-
import "reactflow/dist/style.css";
|
|
4
|
-
import FuncnodesReactFlow from "./frontend";
|
|
5
|
-
|
|
6
|
-
function App() {
|
|
7
|
-
return (
|
|
8
|
-
<div
|
|
9
|
-
className="App"
|
|
10
|
-
style={{
|
|
11
|
-
height: "98vh",
|
|
12
|
-
width: "98vw",
|
|
13
|
-
marginLeft: "1vw",
|
|
14
|
-
marginTop: "1vh",
|
|
15
|
-
}}
|
|
16
|
-
>
|
|
17
|
-
<FuncnodesReactFlow></FuncnodesReactFlow>
|
|
18
|
-
</div>
|
|
19
|
-
);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export default App;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { BaseRenderOptions } from ".";
|
|
2
|
-
interface ImageRenderOptions extends BaseRenderOptions {
|
|
3
|
-
format?: "png" | "jpeg";
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
const Base64ImageRenderer = ({
|
|
7
|
-
value,
|
|
8
|
-
renderoptions,
|
|
9
|
-
}: {
|
|
10
|
-
value: string;
|
|
11
|
-
renderoptions?: ImageRenderOptions;
|
|
12
|
-
}) => {
|
|
13
|
-
if (renderoptions === undefined) renderoptions = {};
|
|
14
|
-
if (renderoptions.format === undefined) renderoptions.format = "jpeg";
|
|
15
|
-
|
|
16
|
-
return (
|
|
17
|
-
<img
|
|
18
|
-
src={"data:image/"+renderoptions.format+";base64," + value}
|
|
19
|
-
style={{
|
|
20
|
-
maxWidth: "100%",
|
|
21
|
-
maxHeight: "100%",
|
|
22
|
-
}}
|
|
23
|
-
/>
|
|
24
|
-
);
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
export { Base64ImageRenderer };
|
|
28
|
-
export type { ImageRenderOptions };
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { Base64ImageRenderer, ImageRenderOptions } from "./images";
|
|
2
|
-
import AnyPlot from "./plotly";
|
|
3
|
-
|
|
4
|
-
interface BaseRenderOptions {
|
|
5
|
-
type?: RenderType;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
interface StringRenderOptions extends BaseRenderOptions {
|
|
9
|
-
max_length?: number;
|
|
10
|
-
}
|
|
11
|
-
type RenderOptions =
|
|
12
|
-
| BaseRenderOptions
|
|
13
|
-
| ImageRenderOptions
|
|
14
|
-
| StringRenderOptions;
|
|
15
|
-
|
|
16
|
-
const StringRenderer = ({
|
|
17
|
-
value,
|
|
18
|
-
renderoptions,
|
|
19
|
-
}: {
|
|
20
|
-
value: any;
|
|
21
|
-
renderoptions?: StringRenderOptions;
|
|
22
|
-
}) => {
|
|
23
|
-
let string = JSON.stringify(value, null, 2);
|
|
24
|
-
const max_length = renderoptions?.max_length || 1000;
|
|
25
|
-
// shorten string if too long
|
|
26
|
-
if (string.length > max_length) {
|
|
27
|
-
string = string.substring(0, max_length) + "...";
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
return <>{string}</>;
|
|
31
|
-
};
|
|
32
|
-
const RENDERTYPES: {
|
|
33
|
-
[key: string]: ({
|
|
34
|
-
value,
|
|
35
|
-
renderoptions,
|
|
36
|
-
}: {
|
|
37
|
-
value: any;
|
|
38
|
-
renderoptions?: RenderOptions;
|
|
39
|
-
}) => JSX.Element;
|
|
40
|
-
} = {
|
|
41
|
-
image: Base64ImageRenderer,
|
|
42
|
-
string: StringRenderer,
|
|
43
|
-
str: StringRenderer,
|
|
44
|
-
plot: AnyPlot,
|
|
45
|
-
};
|
|
46
|
-
const get_rendertype = (rendertype: string) => {
|
|
47
|
-
const rt = RENDERTYPES[rendertype];
|
|
48
|
-
if (rt === undefined) return RENDERTYPES["string"];
|
|
49
|
-
return rt;
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
export default get_rendertype;
|
|
53
|
-
export type { RenderOptions, BaseRenderOptions };
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import Plot from "react-plotly.js";
|
|
2
|
-
import { BaseRenderOptions } from ".";
|
|
3
|
-
|
|
4
|
-
interface PlotlyRenderOptions extends BaseRenderOptions {
|
|
5
|
-
plottype?: "line" | "scatter" | "imshow";
|
|
6
|
-
layout?: any;
|
|
7
|
-
colorscale?: string;
|
|
8
|
-
}
|
|
9
|
-
const AnyPlot = ({
|
|
10
|
-
value,
|
|
11
|
-
renderoptions,
|
|
12
|
-
}: {
|
|
13
|
-
value: any;
|
|
14
|
-
renderoptions?: PlotlyRenderOptions;
|
|
15
|
-
}) => {
|
|
16
|
-
if (renderoptions === undefined) {
|
|
17
|
-
renderoptions = {};
|
|
18
|
-
}
|
|
19
|
-
if (value === undefined) {
|
|
20
|
-
return <></>;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
renderoptions.plottype = renderoptions.plottype || "line";
|
|
24
|
-
|
|
25
|
-
const data: Plotly.Data[] = [];
|
|
26
|
-
const layout: Partial<Plotly.Layout> = renderoptions.layout || {};
|
|
27
|
-
|
|
28
|
-
// tight layout
|
|
29
|
-
layout.margin = { t: 50, r: 50, l: 50, b: 50 };
|
|
30
|
-
|
|
31
|
-
if (renderoptions.plottype === "imshow") {
|
|
32
|
-
// check if value is a 2D array
|
|
33
|
-
if (!Array.isArray(value) || !Array.isArray(value[0])) {
|
|
34
|
-
console.error("imshow plottype requires a 2D array");
|
|
35
|
-
return <></>;
|
|
36
|
-
}
|
|
37
|
-
// if is 3data, aassume rgb
|
|
38
|
-
if (Array.isArray(value[0][0])) {
|
|
39
|
-
//check image colorchannel
|
|
40
|
-
if (renderoptions?.colorscale === "bgr") {
|
|
41
|
-
value = value.map((row: any) =>
|
|
42
|
-
row.map((pixel: any) => [pixel[2], pixel[1], pixel[0]])
|
|
43
|
-
);
|
|
44
|
-
}
|
|
45
|
-
data.push({
|
|
46
|
-
z: value,
|
|
47
|
-
type: "image",
|
|
48
|
-
colorscale: "rgb",
|
|
49
|
-
});
|
|
50
|
-
// disable axis
|
|
51
|
-
layout.xaxis = { visible: false };
|
|
52
|
-
layout.yaxis = { visible: false };
|
|
53
|
-
layout.margin = { t: 0, r: 0, l: 0, b: 0 };
|
|
54
|
-
} else {
|
|
55
|
-
data.push({
|
|
56
|
-
z: value,
|
|
57
|
-
type: "heatmap",
|
|
58
|
-
colorscale: renderoptions?.colorscale || "Viridis",
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
// auto resize
|
|
64
|
-
layout.autosize = true;
|
|
65
|
-
|
|
66
|
-
return (
|
|
67
|
-
<div
|
|
68
|
-
style={{ minWidth: 300, maxHeight: 300, maxWidth: 300, minHeight: 300 }}
|
|
69
|
-
>
|
|
70
|
-
<Plot
|
|
71
|
-
data={data}
|
|
72
|
-
layout={layout}
|
|
73
|
-
useResizeHandler={true}
|
|
74
|
-
style={{ width: "100%", height: "100%" }}
|
|
75
|
-
/>
|
|
76
|
-
</div>
|
|
77
|
-
);
|
|
78
|
-
};
|
|
79
|
-
|
|
80
|
-
export {};
|
|
81
|
-
export default AnyPlot;
|
|
82
|
-
export type { PlotlyRenderOptions };
|
package/src/frontend/dialog.scss
DELETED
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
.dialogoverlay {
|
|
2
|
-
background-color: rgba(0, 0, 0, 0.5);
|
|
3
|
-
position: fixed;
|
|
4
|
-
inset: 0;
|
|
5
|
-
animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1);
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
.dialogconent {
|
|
9
|
-
background-color: var(--funcnodesbackground1);
|
|
10
|
-
border-radius: 6px;
|
|
11
|
-
box-shadow: var(--funheadercolor) 0px 10px 38px -10px,
|
|
12
|
-
var(--funheadercolor) 0px 10px 20px -15px;
|
|
13
|
-
position: fixed;
|
|
14
|
-
top: 50%;
|
|
15
|
-
left: 50%;
|
|
16
|
-
transform: translate(-50%, -50%);
|
|
17
|
-
width: 90vw;
|
|
18
|
-
max-width: 85vh;
|
|
19
|
-
max-height: 85vh;
|
|
20
|
-
padding: 25px;
|
|
21
|
-
animation: contentShow 150ms cubic-bezier(0.16, 1, 0.3, 1);
|
|
22
|
-
color: var(--funcnodestextcolor1);
|
|
23
|
-
border: 1px solid var(--funheadercolor);
|
|
24
|
-
display: flex;
|
|
25
|
-
flex-direction: column;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
.dialogtitle {
|
|
29
|
-
margin: 0;
|
|
30
|
-
font-weight: 500;
|
|
31
|
-
color: var(--funheadercolor);
|
|
32
|
-
font-size: 17px;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
.dialogdescription {
|
|
36
|
-
margin: 10px 0 20px;
|
|
37
|
-
font-size: 15px;
|
|
38
|
-
line-height: 1.5;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
.dialogclosebutton {
|
|
42
|
-
border-radius: 100%;
|
|
43
|
-
height: 25px;
|
|
44
|
-
width: 25px;
|
|
45
|
-
display: inline-flex;
|
|
46
|
-
background-color: inherit;
|
|
47
|
-
align-items: center;
|
|
48
|
-
justify-content: center;
|
|
49
|
-
color: var(--funheadercolor);
|
|
50
|
-
position: absolute;
|
|
51
|
-
top: 10px;
|
|
52
|
-
right: 10px;
|
|
53
|
-
border: none;
|
|
54
|
-
|
|
55
|
-
&:hover {
|
|
56
|
-
background-color: var(--funheadercolor);
|
|
57
|
-
color: var(--funcnodesbackground1);
|
|
58
|
-
}
|
|
59
|
-
&:active {
|
|
60
|
-
background-color: var(--funheadercolor);
|
|
61
|
-
color: var(--funcnodestextcolor1);
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
.dialogsendbutton {
|
|
66
|
-
background-color: var(--funcnodesbackground1);
|
|
67
|
-
color: var(--funheadercolor);
|
|
68
|
-
border: 1px solid var(--funheadercolor);
|
|
69
|
-
border-radius: 99rem;
|
|
70
|
-
padding: 10px 20px;
|
|
71
|
-
cursor: pointer;
|
|
72
|
-
font-size: 15px;
|
|
73
|
-
margin-top: 20px;
|
|
74
|
-
|
|
75
|
-
&:hover {
|
|
76
|
-
background-color: var(--funheadercolor);
|
|
77
|
-
color: var(--funcnodesbackground1);
|
|
78
|
-
}
|
|
79
|
-
&:active {
|
|
80
|
-
background-color: var(--funheadercolor);
|
|
81
|
-
color: var(--funcnodestextcolor1);
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
.dialogchildren {
|
|
86
|
-
margin-top: 20px;
|
|
87
|
-
overflow: auto;
|
|
88
|
-
}
|
package/src/frontend/dialog.tsx
DELETED
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import * as Dialog from "@radix-ui/react-dialog";
|
|
2
|
-
import CloseIcon from "@mui/icons-material/Close";
|
|
3
|
-
import "./dialog.scss";
|
|
4
|
-
interface CustomDialogProps {
|
|
5
|
-
trigger?: React.ReactNode;
|
|
6
|
-
title?: string;
|
|
7
|
-
description?: string | React.ReactNode;
|
|
8
|
-
children: React.ReactNode;
|
|
9
|
-
closebutton?: boolean;
|
|
10
|
-
onOpenChange?: (open: boolean) => void;
|
|
11
|
-
buttons?: {
|
|
12
|
-
text: string;
|
|
13
|
-
onClick: () => void;
|
|
14
|
-
}[];
|
|
15
|
-
}
|
|
16
|
-
const CustomDialog = ({
|
|
17
|
-
trigger,
|
|
18
|
-
title,
|
|
19
|
-
description,
|
|
20
|
-
children,
|
|
21
|
-
closebutton = true,
|
|
22
|
-
onOpenChange,
|
|
23
|
-
|
|
24
|
-
buttons = [],
|
|
25
|
-
}: CustomDialogProps) => {
|
|
26
|
-
return (
|
|
27
|
-
<Dialog.Root onOpenChange={onOpenChange}>
|
|
28
|
-
{trigger && <Dialog.Trigger asChild>{trigger}</Dialog.Trigger>}
|
|
29
|
-
<Dialog.Portal>
|
|
30
|
-
<Dialog.Overlay className="dialogoverlay" />
|
|
31
|
-
<Dialog.Content className="dialogconent">
|
|
32
|
-
{title && (
|
|
33
|
-
<Dialog.Title className="dialogtitle">{title}</Dialog.Title>
|
|
34
|
-
)}
|
|
35
|
-
{description && (
|
|
36
|
-
<Dialog.Description className="dialogdescription">
|
|
37
|
-
{description}
|
|
38
|
-
</Dialog.Description>
|
|
39
|
-
)}
|
|
40
|
-
<div className="dialogchildren">{children}</div>
|
|
41
|
-
<div
|
|
42
|
-
style={{
|
|
43
|
-
display: "flex",
|
|
44
|
-
marginTop: 25,
|
|
45
|
-
justifyContent: "flex-end",
|
|
46
|
-
}}
|
|
47
|
-
>
|
|
48
|
-
{(buttons || []).map((button, index) => (
|
|
49
|
-
<Dialog.Close asChild key={index}>
|
|
50
|
-
<button className="dialogsendbutton" onClick={button.onClick}>
|
|
51
|
-
{button.text}
|
|
52
|
-
</button>
|
|
53
|
-
</Dialog.Close>
|
|
54
|
-
))}
|
|
55
|
-
</div>
|
|
56
|
-
{closebutton && (
|
|
57
|
-
<Dialog.Close asChild>
|
|
58
|
-
<button className="dialogclosebutton" aria-label="Close">
|
|
59
|
-
<CloseIcon />
|
|
60
|
-
</button>
|
|
61
|
-
</Dialog.Close>
|
|
62
|
-
)}
|
|
63
|
-
</Dialog.Content>
|
|
64
|
-
</Dialog.Portal>
|
|
65
|
-
</Dialog.Root>
|
|
66
|
-
);
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
export default CustomDialog;
|
|
70
|
-
export type { CustomDialogProps };
|
package/src/frontend/edge.scss
DELETED
package/src/frontend/edge.tsx
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { EdgeProps, getBezierPath, BaseEdge } from "reactflow";
|
|
2
|
-
import "./edge.scss";
|
|
3
|
-
|
|
4
|
-
const DefaultEdge = ({
|
|
5
|
-
id,
|
|
6
|
-
sourceX,
|
|
7
|
-
sourceY,
|
|
8
|
-
targetX,
|
|
9
|
-
targetY,
|
|
10
|
-
sourcePosition,
|
|
11
|
-
targetPosition,
|
|
12
|
-
data,
|
|
13
|
-
...props
|
|
14
|
-
}: EdgeProps) => {
|
|
15
|
-
const [edgePath, labelX, labelY] = getBezierPath({
|
|
16
|
-
sourceX,
|
|
17
|
-
sourceY,
|
|
18
|
-
sourcePosition,
|
|
19
|
-
targetX,
|
|
20
|
-
targetY,
|
|
21
|
-
targetPosition,
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
return (
|
|
25
|
-
<>
|
|
26
|
-
<BaseEdge id={id} path={edgePath} {...props} />
|
|
27
|
-
</>
|
|
28
|
-
);
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
export default DefaultEdge;
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
@import "./layout/htmlelements.scss";
|
|
2
|
-
:root {
|
|
3
|
-
--funheadercolor: #00d9ff; // Dark background color
|
|
4
|
-
--funcnodesbackground1: hsl(243, 26%, 13%); // Dark background color
|
|
5
|
-
--funcnodesbackground2: hsl(245, 22%, 22%); // Dark background color
|
|
6
|
-
--funcnodesbackground_light: hsl(240, 22%, 38%);
|
|
7
|
-
--containerboarderradius: 1rem;
|
|
8
|
-
--funcnodestextcolor1: #ffffff; // Dark background color
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
.funcnodesreactflowcontainer {
|
|
12
|
-
width: 100%;
|
|
13
|
-
height: 100%;
|
|
14
|
-
background-color: var(--funcnodesbackground1); // Dark background color
|
|
15
|
-
position: relative;
|
|
16
|
-
display: flex;
|
|
17
|
-
flex-direction: column;
|
|
18
|
-
color: var(--funcnodestextcolor1);
|
|
19
|
-
|
|
20
|
-
& * {
|
|
21
|
-
box-sizing: border-box;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
.funcnodesreactflowbody {
|
|
26
|
-
flex-grow: 1;
|
|
27
|
-
position: relative;
|
|
28
|
-
display: flex;
|
|
29
|
-
flex-direction: row;
|
|
30
|
-
overflow: hidden;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
.reactflowlayer {
|
|
34
|
-
flex-grow: 1;
|
|
35
|
-
position: relative;
|
|
36
|
-
overflow: hidden;
|
|
37
|
-
background-color: var(--funcnodesbackground2); // Dark background color
|
|
38
|
-
margin: 0.5rem;
|
|
39
|
-
border-radius: var(--containerboarderradius);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
.vscrollcontainer {
|
|
43
|
-
overflow-y: auto;
|
|
44
|
-
overflow-x: hidden;
|
|
45
|
-
flex-grow: 1;
|
|
46
|
-
padding: 0.5rem;
|
|
47
|
-
box-sizing: border-box;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
.workerselect {
|
|
51
|
-
max-width: 140px;
|
|
52
|
-
}
|
|
53
|
-
.workerselectoption {
|
|
54
|
-
&.selected {
|
|
55
|
-
color: var(--funcnodestextcolor1);
|
|
56
|
-
}
|
|
57
|
-
&.active {
|
|
58
|
-
color: green;
|
|
59
|
-
}
|
|
60
|
-
&.inactive {
|
|
61
|
-
color: red;
|
|
62
|
-
}
|
|
63
|
-
}
|