Skip to content

Commit 4183f4c

Browse files
committed
WIP launch view
1 parent 816e27f commit 4183f4c

File tree

3 files changed

+60
-23
lines changed

3 files changed

+60
-23
lines changed

src/assets/base.css

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,25 @@
2323
--vt-c-text-dark-1: var(--vt-c-white);
2424
--vt-c-text-dark-2: rgba(235, 235, 235, 0.64);
2525

26+
/* #00bd7e */
2627
--vt-c-text-green: hsla(160, 100%, 37%, 1);
2728
--vt-c-green-shadow: hsla(160, 100%, 37%, 0.2);
2829

29-
--vt-c-text-orange: hsla(50, 88%, 55%, 1);
30-
--vt-c-orange-shadow: hsla(50, 88%, 55%, 0.35);
30+
/* #ffd79a */
31+
--vt-c-text-orange: hsla(36, 100%, 80%, 1);
32+
--vt-c-orange-shadow: hsla(36, 100%, 80%, 0.2);
33+
34+
/* #f6f294 */
35+
--vt-c-text-yellow: hsla(58, 84%, 77%, 1);
36+
--vt-c-yellow-shadow: hsla(58, 84%, 77%, 0.2);
37+
38+
/* #dcadd6 */
39+
--vt-c-text-violet: hsla(308, 40%, 77%, 1);
40+
--vt-c-violet-shadow: hsla(308, 40%, 77%, 0.2);
41+
42+
/* #7fafe3 */
43+
--vt-c-text-blue: hsla(211, 64%, 69%, 1);
44+
--vt-c-blue-shadow: hsla(211, 64%, 69%, 0.2);
3145
}
3246

3347
/* semantic color variables for this project */
@@ -48,6 +62,15 @@
4862
--color-orange: var(--vt-c-text-orange);
4963
--color-orange-hover: var(--vt-c-orange-shadow);
5064

65+
--color-yellow: var(--vt-c-text-yellow);
66+
--color-yellow-hover: var(--vt-c-yellow-shadow);
67+
68+
--color-violet: var(--vt-c-text-violet);
69+
--color-violet-hover: var(--vt-c-violet-shadow);
70+
71+
--color-blue: var(--vt-c-text-blue);
72+
--color-blue-hover: var(--vt-c-blue-shadow);
73+
5174
--section-gap: 160px;
5275
}
5376

src/components/launch/DependencyGraph.vue

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@ function onSelectNode(node: GraphNodeDatum | null): void {
6060
}
6161
6262
function groupColors(group: string): string {
63-
if (group === LaunchActionType.ARG) return 'limegreen'
64-
if (group === LaunchActionType.NODE) return 'dodgerblue'
65-
if (group === LaunchActionType.INCLUDE) return 'chocolate'
63+
if (group === LaunchActionType.ARG) return '#f6f294'
64+
if (group === LaunchActionType.NODE) return '#00bd7e'
65+
if (group === LaunchActionType.INCLUDE) return '#7fafe3'
6666
return 'gray'
6767
}
6868
@@ -71,6 +71,9 @@ function buildModelElement(): SVGElement {
7171
// const color = d3.scaleOrdinal(d3.schemeCategory10)
7272
const color = groupColors
7373
74+
const nodeStrokeColor = (d: GraphNodeDatum): string => color(d.group)
75+
const nodeFillColor = (d: GraphNodeDatum): string => (d.dark ? 'var(--color-background)' : '#666')
76+
7477
// The force simulation mutates links and nodes, so create a copy
7578
// so that re-evaluating this cell produces the same result.
7679
const links = props.model.links.map((d) => ({ ...d }))
@@ -118,13 +121,14 @@ function buildModelElement(): SVGElement {
118121
.attr('orient', 'auto')
119122
.append('path')
120123
.attr('d', 'M0,-3L6,0L0,3')
121-
.style('stroke', '#999')
122-
.style('fill', '#999')
124+
.style('stroke', 'var(--color-text)')
125+
.style('stroke-opacity', 0.6)
126+
.style('fill', 'var(--color-text)')
123127
124128
// Add a line for each link
125129
const link = svg
126130
.append('g')
127-
.attr('stroke', '#999')
131+
.attr('stroke', 'var(--color-text)')
128132
.attr('stroke-opacity', 0.6)
129133
.selectAll('line')
130134
.data(links)
@@ -135,14 +139,14 @@ function buildModelElement(): SVGElement {
135139
// Add a circle for each node
136140
const node = svg
137141
.append('g')
138-
.attr('stroke-width', 1.5)
142+
.attr('stroke-width', 2)
139143
.selectAll<SVGCircleElement, GraphNodeDatum>('circle')
140144
.data(nodes)
141145
.join('circle')
142146
.attr('r', (d) => (d.level || 0) * 5 + 10)
143-
.attr('stroke', (d) => (d.dark ? '#999' : '#fff'))
147+
.attr('stroke', nodeStrokeColor) // (d.dark ? '#333' : color(d.group))
144148
.attr('stroke-dasharray', (d) => (!d.condition ? '' : '2 1'))
145-
.attr('fill', (d) => color(d.group))
149+
.attr('fill', nodeFillColor)
146150
147151
node.append('title').text((d) => d.name || d.id)
148152
@@ -163,12 +167,10 @@ function buildModelElement(): SVGElement {
163167
if (k === i) {
164168
return
165169
}
166-
d3.select<SVGCircleElement, GraphNodeDatum>(node.nodes()[k]).attr('fill', (d) =>
167-
color(d.group),
168-
)
170+
d3.select<SVGCircleElement, GraphNodeDatum>(node.nodes()[k]).attr('fill', nodeFillColor(prev))
169171
}
170172
onSelectNode(datum)
171-
d3.select(el).attr('fill', '#c9c9c9')
173+
d3.select(el).attr('fill', nodeStrokeColor(datum))
172174
}
173175
174176
node.on('click', (e /*, d*/) => {
@@ -185,9 +187,7 @@ function buildModelElement(): SVGElement {
185187
const prev = selectedNode.value
186188
if (prev != null) {
187189
const k = prev.index!
188-
d3.select<SVGCircleElement, GraphNodeDatum>(node.nodes()[k]).attr('fill', (d) =>
189-
color(d.group),
190-
)
190+
d3.select<SVGCircleElement, GraphNodeDatum>(node.nodes()[k]).attr('fill', nodeFillColor(prev))
191191
onSelectNode(null)
192192
}
193193
})

src/components/launch/LaunchActionList.vue

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ function onSelectAction(action: LaunchAction): void {
3636
}"
3737
@click="onSelectAction(action)"
3838
>
39-
<span class="tag">{{ action.type }}</span>
39+
<span class="tag" :class="`type-${action.type}`">{{ action.type.toUpperCase() }}</span>
4040
{{ action.name }}
4141
<span v-if="currentDependencies.has(action.id)">(dep)</span>
4242
</li>
@@ -54,10 +54,9 @@ function onSelectAction(action: LaunchAction): void {
5454
font-family: monospace;
5555
overflow: auto;
5656
white-space: nowrap;
57-
line-height: 1.25;
5857
display: flex;
5958
flex-direction: column;
60-
gap: 0.5rem;
59+
gap: 0.25rem;
6160
margin: 0.5rem 0 0.5rem 0.5rem;
6261
}
6362
@@ -83,8 +82,23 @@ function onSelectAction(action: LaunchAction): void {
8382
.launch-action-list > li > .tag {
8483
border-radius: 0.25em;
8584
border: 1px solid var(--color-text);
86-
font-variant-caps: all-small-caps;
87-
font-size: 1rem;
85+
/* font-variant-caps: all-petite-caps;
86+
font-size: 1rem;*/
8887
padding: 0 0.25em;
8988
}
89+
90+
.launch-action-list > li > .tag.type-arg {
91+
border: 1px solid var(--color-yellow);
92+
color: var(--color-yellow);
93+
}
94+
95+
.launch-action-list > li > .tag.type-node {
96+
border: 1px solid var(--color-green);
97+
color: var(--color-green);
98+
}
99+
100+
.launch-action-list > li > .tag.type-include {
101+
border: 1px solid var(--color-blue);
102+
color: var(--color-blue);
103+
}
90104
</style>

0 commit comments

Comments
 (0)