Skip to content

Commit

Permalink
Data
Browse files Browse the repository at this point in the history
  • Loading branch information
joewood committed Jan 18, 2022
1 parent 39cc1a3 commit 98d3dcf
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 27 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ node_modules
/.pnp
.pnp.js
/graph/lib
/graph3d/lib
/example/build
# testing
/coverage
Expand Down
54 changes: 27 additions & 27 deletions packages/example/src/data.ts
Original file line number Diff line number Diff line change
@@ -1,36 +1,36 @@
import { GraphEdge } from "@diagrams/graph";

const nodeTree = {
Network: {
children: [
"Data Network",
"Voice Network",
"Internet Connectivity",
"Virtual Private Network",
"Domain Services",
"Load Balancing",
],
},
Compute: {
children: ["Physical Compute", "Virtual Compute & Containers", "Compute on Demand"],
},
Data: {
children: ["Database", "Distributed Cache", "Data Warehouse"],
},
Network: {
children: [
"Data Network",
"Voice Network",
"Internet Connectivity",
"Virtual Private Network",
"Domain Services",
"Load Balancing",
],
},
Compute: {
children: ["Physical Compute", "Virtual Compute & Containers", "Compute on Demand"],
},
Data: {
children: ["Database", "Distributed Cache", "Data Warehouse"],
},
} as { [index: string]: { children: string[] } };

export const nodes = Object.keys(nodeTree).reduce(
(p, parent) => [
...p,
{ name: parent, level: 2, parent: null },
...nodeTree[parent].children.map((child) => ({ name: child, parent, level: 1 })),
],
[] as any[]
(p, parent) => [
...p,
{ name: parent, parent: null },
...nodeTree[parent].children.map((child) => ({ name: child, parent })),
],
[] as any[]
);

export const edges : GraphEdge[] = [
{ from: "Compute on Demand", to: "Virtual Compute & Containers", label: "Uses" },
{ from: "Virtual Compute & Containers", to: "Physical Compute", label: "Uses" },
{ from: "Database", to: "Virtual Compute & Containers", label: "Uses" },
{ from: "Database", to: "Load Balancing", label: "Uses" },
export const edges: GraphEdge[] = [
{ from: "Compute on Demand", to: "Virtual Compute & Containers", label: "Uses" },
{ from: "Virtual Compute & Containers", to: "Physical Compute", label: "Uses" },
{ from: "Database", to: "Virtual Compute & Containers", label: "Uses" },
{ from: "Database", to: "Load Balancing", label: "Uses" },
];

0 comments on commit 98d3dcf

Please sign in to comment.