Skip to content

Commit 329d78d

Browse files
authored
feat: new DAG visualizer (#239)
1 parent e90043b commit 329d78d

File tree

96 files changed

+5849
-739
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+5849
-739
lines changed

.babelrc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"presets": [
3+
"@babel/preset-env"
4+
],
5+
"plugins": [
6+
"@babel/plugin-proposal-class-properties"
7+
]
8+
}

.env

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
REACT_APP_BASE_API_URL="https://appserver.zenml.io/api/v1"
2-
REACT_APP_HUB_API_URL="https://hubapi.zenml.io"
1+
# REACT_APP_BASE_API_URL= https://felix.develaws.zenml.io/api/v1
2+
REACT_APP_BASE_API_URL= https://appserver.zenml.io/api/v1
33
REACT_APP_VERSION=$npm_package_version

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,4 +110,6 @@ build/
110110
# TernJS port file
111111
.tern-port
112112

113-
!.env
113+
!.env
114+
115+
build

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
"@types/dagre": "^0.7.48",
1717
"@types/jest": "^26.0.8",
1818
"@types/node": "^14.0.27",
19+
"@types/papaparse": "^5.3.7",
1920
"@types/react": "^16.9.44",
2021
"@types/react-datepicker": "^4.4.2",
2122
"@types/react-dom": "^16.9.8",
@@ -45,6 +46,7 @@
4546
"lottie-react": "^2.4.0",
4647
"moment": "^2.29.4",
4748
"node-sass": "^4.14.1",
49+
"papaparse": "^5.4.1",
4850
"query-string": "^6.13.1",
4951
"react": "^16.13.1",
5052
"react-bootstrap": "^1.3.0",

src/App.css

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,50 @@ html {
5555
padding-right: 0;
5656
}
5757

58+
/* reactflow */
59+
.react-flow__edge-path {
60+
stroke: #443E99;
61+
}
62+
63+
.react-flow__controls {
64+
border: none;
65+
display: flex;
66+
justify-content: center;
67+
align-items: center;
68+
flex-direction: column;
69+
filter: none;
70+
box-shadow: none;
71+
/* bottom: 10%; */
72+
/* left: 40px; */
73+
}
74+
75+
.react-flow__controls button :first-child {
76+
border: none;
77+
height: 55px;
78+
width: 55px;
79+
}
80+
81+
.react-flow__controls :nth-child(n) {
82+
border-radius: 100%;
83+
background-color: #fffffd;
84+
height: 35px;
85+
width: 35px;
86+
filter: drop-shadow(0px 0px 5px rgba(0, 0, 0, 0.08));
87+
margin: 5px;
88+
}
89+
90+
.react-flow__controls :nth-child(n) :first-child {
91+
border-radius: 0%;
92+
height: 35px;
93+
width: 35px;
94+
}
95+
96+
97+
.react-flow__zoom-in {
98+
background-color: #443E99;
99+
height: 100px;
100+
width: 100px;
101+
}
58102
a[class*='MenuItem'][class*='active'] .sidebar-fill path {
59103
stroke: transparent !important;
60104
fill: #e8a562 !important;

src/api/endpoints.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,15 @@ export const endpoints = {
7171
graphById: {
7272
get: (runId: TId): string => `/runs/${runId}/graph`,
7373
},
74+
artifact: {
75+
get: (exe_id: TId): string => `/artifacts/${exe_id}`,
76+
},
77+
artifactVisualization: {
78+
get: (id: TId): string => `/artifacts/${id}/visualize`,
79+
},
80+
step: {
81+
get: (exe_id: TId): string => `/steps/${exe_id}`,
82+
},
7483
all: (workspace: string): string => `/workspaces/${workspace}/runs`,
7584
get: (runId: TId): string => `/runs/${runId}`,
7685
},

src/api/fetchApi/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ export const fetchApiWithAuthRequest = ({
4545
headers?: any;
4646
}): Promise<any> => {
4747
const CancelToken = axios.CancelToken;
48-
4948
return axios({
5049
method: method || httpMethods.get,
5150
url,
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import { fetchApiWithAuthRequest } from '../fetchApi';
2+
import { endpoints } from '../endpoints';
3+
import { httpMethods } from '../constants';
4+
import { apiUrl } from '../apiUrl';
5+
6+
const getArtifactVisualization = async ({
7+
authenticationToken,
8+
id,
9+
}: {
10+
authenticationToken: string;
11+
id: TId;
12+
}): Promise<TOrganization> => {
13+
return fetchApiWithAuthRequest({
14+
url: apiUrl(endpoints.runs.artifactVisualization.get(id)),
15+
method: httpMethods.get,
16+
authenticationToken,
17+
});
18+
};
19+
20+
export default getArtifactVisualization;

src/api/runs/getRunDataApi.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import { fetchApiWithAuthRequest } from '../fetchApi';
2+
import { endpoints } from '../endpoints';
3+
import { httpMethods } from '../constants';
4+
import { apiUrl } from '../apiUrl';
5+
6+
const getArtifactDataApi = async ({
7+
authenticationToken,
8+
exe_id,
9+
}: {
10+
authenticationToken: string;
11+
exe_id: TId;
12+
}): Promise<TOrganization> => {
13+
return fetchApiWithAuthRequest({
14+
url: apiUrl(endpoints.runs.artifact.get(exe_id)),
15+
method: httpMethods.get,
16+
authenticationToken,
17+
});
18+
};
19+
20+
export default getArtifactDataApi;

src/api/runs/getStepDataApi.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import { fetchApiWithAuthRequest } from '../fetchApi';
2+
import { endpoints } from '../endpoints';
3+
import { httpMethods } from '../constants';
4+
import { apiUrl } from '../apiUrl';
5+
6+
const getStepDataApi = async ({
7+
authenticationToken,
8+
exe_id,
9+
}: {
10+
authenticationToken: string;
11+
exe_id: TId;
12+
}): Promise<TOrganization> => {
13+
return fetchApiWithAuthRequest({
14+
url: apiUrl(endpoints.runs.step.get(exe_id)),
15+
method: httpMethods.get,
16+
authenticationToken,
17+
});
18+
};
19+
20+
export default getStepDataApi;

0 commit comments

Comments
 (0)