mirror of
https://github.com/openziti/zrok.git
synced 2025-06-20 09:48:07 +02:00
tweaks, polish, and lint removal (#107)
This commit is contained in:
parent
1c2cfe710a
commit
cbae0d1d21
@ -17,7 +17,7 @@ const Network = (props) => {
|
|||||||
|
|
||||||
const paintNode = (node, ctx) => {
|
const paintNode = (node, ctx) => {
|
||||||
let nodeColor = "#636363";
|
let nodeColor = "#636363";
|
||||||
let textColor = "white";
|
let textColor = "#ccc";
|
||||||
switch(node.type) {
|
switch(node.type) {
|
||||||
case "environment":
|
case "environment":
|
||||||
nodeColor = "#444";
|
nodeColor = "#444";
|
||||||
@ -29,7 +29,7 @@ const Network = (props) => {
|
|||||||
|
|
||||||
ctx.textBaseline = "middle";
|
ctx.textBaseline = "middle";
|
||||||
ctx.textAlign = "center";
|
ctx.textAlign = "center";
|
||||||
ctx.font = "6px 'JetBrains Mono'";
|
ctx.font = "6px 'Russo One'";
|
||||||
let extents = ctx.measureText(node.label);
|
let extents = ctx.measureText(node.label);
|
||||||
let nodeWidth = extents.width + 10;
|
let nodeWidth = extents.width + 10;
|
||||||
|
|
||||||
@ -68,8 +68,6 @@ const Network = (props) => {
|
|||||||
nodeCanvasObject={paintNode}
|
nodeCanvasObject={paintNode}
|
||||||
backgroundColor={"#3b2693"}
|
backgroundColor={"#3b2693"}
|
||||||
cooldownTicks={300}
|
cooldownTicks={300}
|
||||||
d3VelocityDecay={0.3}
|
|
||||||
d3AlphaDecay={0.0128}
|
|
||||||
/>
|
/>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -82,7 +82,7 @@ export const mergeGraph = (oldGraph, user, newOverview) => {
|
|||||||
outputLinks.push(...newGraph.links.filter(newLink => !outputLinks.find(oldLink => oldLink.target === newLink.target && oldLink.source === newLink.source)));
|
outputLinks.push(...newGraph.links.filter(newLink => !outputLinks.find(oldLink => oldLink.target === newLink.target && oldLink.source === newLink.source)));
|
||||||
|
|
||||||
return {
|
return {
|
||||||
// we need a new outer object, to trigger react to refresh the view correctly.
|
// we need a new outer object, to trigger react to refresh the view.
|
||||||
nodes: sortNodes(outputNodes),
|
nodes: sortNodes(outputNodes),
|
||||||
links: outputLinks
|
links: outputLinks
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user