Skip to content

Commit

Permalink
First pass PipelineGraph UI component
Browse files Browse the repository at this point in the history
Add PipelineGraph UI component using elkjs and vx.
It does not currently support user interaction (zoom, pan, click, etc.)
but this will come in future PRs.

Add storybook stories to cover the two main components:
- Node: represents a node in the graph (Task or Step)
- PipelineGraph: collection of Nodes + Links
  • Loading branch information
AlanGreene authored and tekton-robot committed Nov 13, 2019
1 parent cf7cbd4 commit bbab8b1
Show file tree
Hide file tree
Showing 9 changed files with 774 additions and 31 deletions.
104 changes: 73 additions & 31 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,12 @@
"@formatjs/intl-pluralrules": "^1.2.1",
"@tektoncd/dashboard-components": "file:./packages/components",
"@tektoncd/dashboard-utils": "file:./packages/utils",
"@vx/network": "0.0.192",
"carbon-components": "^10.6.1",
"carbon-components-react": "^7.6.1",
"core-js": "^3.0.1",
"d3-path": "^1.0.8",
"elkjs": "^0.5.1",
"es6-promise": "^4.2.6",
"history": "^4.9.0",
"isomorphic-fetch": "^2.2.1",
Expand Down
89 changes: 89 additions & 0 deletions packages/components/src/components/Graph/Graph.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
/*
Copyright 2019 The Tekton Authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

$edge-color: #979797;

.pipeline-graph {
#edge-arrow path {
fill: $edge-color;
stroke: $edge-color;
}

.vx-network-links path {
stroke: $edge-color;
marker-end: url(#edge-arrow);
}

rect {
fill: #F3F3F3;
stroke: #F3F3F3;
}
.Start, .End {
rect {
rx: 50%;
ry: 50%;
}
}
.Step {
rect {
fill: transparent;
stroke: transparent;
}
}
[data-status='error'] {
rect {
fill: #FFF0F1;
stroke: #FFF0F1;
}
&.Task text {
fill: #DA1E28;
font-weight: bold;
}
.chevron, .status-icon {
fill: #DA1E28;
}
}
[data-status='running'] {
rect {
fill: #EDF4FF;
stroke: #EDF4FF;
}
&.Task text {
fill: #282828;
font-weight: bold;
}
.status-icon {
stroke: #0062FF;
}
.chevron {
fill: #000000;
}
}
[data-status='success'] {
rect {
fill: #DAFBE4;
stroke: #DAFBE4;
}
&.Task text {
fill: #054719;
font-weight: bold;
}
.status-icon {
fill: #24A249;
}
.chevron {
fill: #0C5824;
}
}

}
Loading

0 comments on commit bbab8b1

Please sign in to comment.