-
-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* minimally working tree layout * add some new aggregation utils * format * add comment * refactor how building the full tree works * fix type errors * merge duplicate monoliths and manually connect balancers to monoliths * better balancer node positioning * fix monolith trees overlapping * adjust radius of clients * fix tree placement for monoliths with no rooms * hook up event bus to tree display * add attributes for source and target node ids for links * format * fix zoom conflicting with other panels * add text to nodes in tree * make TreeDisplay remember current zoom position across rerenders * add tree panel in provisioned dashboard * format
- Loading branch information
Showing
7 changed files
with
538 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
packages/ott-vis-panel/src/components/TreeDisplay.spec.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import * as d3 from "d3"; | ||
import { sizeOfTree } from "./TreeDisplay"; | ||
|
||
describe("TreeDisplay", () => { | ||
it("should find the size of any d3 tree", () => { | ||
interface FooTree { | ||
name: string; | ||
children: FooTree[]; | ||
} | ||
const tree: FooTree = { | ||
name: "root", | ||
children: [ | ||
{ | ||
name: "child1", | ||
children: [ | ||
{ | ||
name: "child1.1", | ||
children: [], | ||
}, | ||
], | ||
}, | ||
{ | ||
name: "child2", | ||
children: [], | ||
}, | ||
], | ||
}; | ||
const treeLayout = d3.tree<any>().nodeSize([10, 10]); | ||
const root = d3.hierarchy(tree); | ||
treeLayout(root); | ||
const [width, height] = sizeOfTree(root); | ||
expect(width).toBeGreaterThan(0); | ||
expect(height).toBeGreaterThan(0); | ||
}); | ||
}); |
Oops, something went wrong.