format code

This commit is contained in:
nora 2022-03-26 15:46:43 +01:00
parent f1bded7192
commit 9855defeae

View file

@ -37,7 +37,7 @@ const graphConfig = {
shapeId: '#empty', // relates to the type property of a node shapeId: '#empty', // relates to the type property of a node
shape: ( shape: (
<symbol viewBox="0 0 100 100" id="empty" key="0"> <symbol viewBox="0 0 100 100" id="empty" key="0">
<circle cx='50' cy='50' r='45'/> <circle cx="50" cy="50" r="45" />
</symbol> </symbol>
), ),
}, },
@ -47,7 +47,7 @@ const graphConfig = {
shapeId: '#empty', // relates to the type property of a node shapeId: '#empty', // relates to the type property of a node
shape: ( shape: (
<symbol viewBox="0 0 100 100" id="empty" key="0"> <symbol viewBox="0 0 100 100" id="empty" key="0">
<circle cx='50' cy='50' r='45'/> <circle cx="50" cy="50" r="45" />
</symbol> </symbol>
), ),
}, },
@ -63,20 +63,20 @@ type Props = {
const SPACE = 200; const SPACE = 200;
const EntityGraph = ({ data }: Props) => { const EntityGraph = ({ data }: Props) => {
const queueTotal = data.queues.length * SPACE / 2; const queueTotal = (data.queues.length * SPACE) / 2;
const queues = data.queues.map((q, i) => ({ const queues = data.queues.map((q, i) => ({
id: q.name, id: q.name,
title: q.name, title: q.name,
y: 300, y: 300,
x: (i * SPACE) - queueTotal, x: i * SPACE - queueTotal,
type: 'queue', type: 'queue',
})); }));
const exchTotal = data.exchanges.length * SPACE / 2; const exchTotal = (data.exchanges.length * SPACE) / 2;
const exchanges = data.exchanges.map((e, i) => ({ const exchanges = data.exchanges.map((e, i) => ({
id: e.name, id: e.name,
title: e.name, title: e.name,
y: 0, y: 0,
x: (i * SPACE) - exchTotal, x: i * SPACE - exchTotal,
type: 'exchange', type: 'exchange',
})); }));
@ -88,7 +88,7 @@ const EntityGraph = ({ data }: Props) => {
source: b.queue, source: b.queue,
target: e.name, target: e.name,
label_to: `'${b.routingKey}'`, label_to: `'${b.routingKey}'`,
type: 'emptyEdge' type: 'emptyEdge',
})); }));
const nodeTypes = graphConfig.nodeTypes; const nodeTypes = graphConfig.nodeTypes;