Test data source: Add random node radius for nodegraph (#75381)

This commit is contained in:
Andrej Ocenas 2023-10-12 18:33:18 +02:00 committed by GitHub
parent c4ac4eb41b
commit 9d8be05cce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -139,6 +139,8 @@ export function generateRandomNodes(count = 10) {
nodeFields.arc__errors.values.push(node.error);
const rnd = Math.random();
nodeFields[NodeGraphDataFrameFieldNames.icon].values.push(rnd > 0.9 ? 'database' : rnd < 0.1 ? 'cloud' : '');
nodeFields[NodeGraphDataFrameFieldNames.nodeRadius].values.push(rnd > 0.5 ? 30 : 40);
for (const edge of node.edges) {
const id = `${node.id}--${edge}`;
// We can have duplicate edges when we added some more by random