mirror of
https://github.com/ansible/awx.git
synced 2026-03-27 05:45:02 -02:30
Use PF colors for nodes.
This commit is contained in:
@@ -141,7 +141,6 @@ function MeshGraph({ data }) {
|
|||||||
.attr('transform', `translate(${margin}, ${margin})`)
|
.attr('transform', `translate(${margin}, ${margin})`)
|
||||||
.call(zoom);
|
.call(zoom);
|
||||||
|
|
||||||
const color = d3.scaleOrdinal(d3.schemeCategory10);
|
|
||||||
const graph = data;
|
const graph = data;
|
||||||
|
|
||||||
const simulation = d3
|
const simulation = d3
|
||||||
@@ -215,7 +214,7 @@ function MeshGraph({ data }) {
|
|||||||
.attr('r', defaultRadius)
|
.attr('r', defaultRadius)
|
||||||
.attr('class', (d) => d.node_type)
|
.attr('class', (d) => d.node_type)
|
||||||
.attr('class', (d) => `id-${d.id}`)
|
.attr('class', (d) => `id-${d.id}`)
|
||||||
.attr('fill', (d) => color(d.node_type))
|
.attr('fill', (d) => renderNodeColor(d.node_type))
|
||||||
.attr('stroke', 'white');
|
.attr('stroke', 'white');
|
||||||
svg.call(expandGlow);
|
svg.call(expandGlow);
|
||||||
|
|
||||||
@@ -233,7 +232,7 @@ function MeshGraph({ data }) {
|
|||||||
.attr('cy', (d, i) => 50 + i * 25)
|
.attr('cy', (d, i) => 50 + i * 25)
|
||||||
.attr('r', defaultRadius)
|
.attr('r', defaultRadius)
|
||||||
.attr('class', (d) => d.node_type)
|
.attr('class', (d) => d.node_type)
|
||||||
.style('fill', (d) => color(d.node_type));
|
.style('fill', (d) => renderNodeColor(d.node_type));
|
||||||
|
|
||||||
// legend text
|
// legend text
|
||||||
svg
|
svg
|
||||||
@@ -319,6 +318,17 @@ function MeshGraph({ data }) {
|
|||||||
return colorKey[nodeState];
|
return colorKey[nodeState];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function renderNodeColor(nodeType) {
|
||||||
|
const colorKey = {
|
||||||
|
hop: '#C46100',
|
||||||
|
execution: '#F0AB00',
|
||||||
|
hybrid: '#0066CC',
|
||||||
|
control: '#005F60'
|
||||||
|
};
|
||||||
|
|
||||||
|
return colorKey[nodeType];
|
||||||
|
}
|
||||||
|
|
||||||
function highlightSiblings(n) {
|
function highlightSiblings(n) {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
svg.selectAll(`id-${n.id}`).attr('r', highlightRadius);
|
svg.selectAll(`id-${n.id}`).attr('r', highlightRadius);
|
||||||
|
|||||||
Reference in New Issue
Block a user