Skip to content

Commit

Permalink
fix one facet display
Browse files Browse the repository at this point in the history
  • Loading branch information
wkw307 committed Nov 20, 2019
1 parent b7225f9 commit 5b16670
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions src/facet-tree-ng.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,18 +170,18 @@ export function buildTree(data: TreeData, dom: HTMLElement): Tree {
*/
if (firstLayerNumber === 1) {
result.branches.push({
x: width / 2 - 8,
y: height * 0.618,
width: 16,
height: height * 0.382,
x: width / 2 - 16,
y: height * 0.5,
width: 32,
height: height * 0.5 - 40,
color: palettes[0][ColorNo],
facetId: data.children[0].facetId,
facetName: data.children[0].facetName,
});
result.leaves.push({
cx: width / 2,
cy: height * 0.382,
r: 12,
r: 20,
color: palettes[0][ColorNo],
});
result.foldBranches.push({
Expand All @@ -203,6 +203,14 @@ export function buildTree(data: TreeData, dom: HTMLElement): Tree {
result.leaves[0].r)
);
}

result.texts.push({
x: result.branches[0].x + 32 / 2 - 30 / 2,
y: result.branches[0].y + 8,
text: result.branches[0].facetName,
fontSize: 30
});

return result;
}

Expand Down

0 comments on commit 5b16670

Please sign in to comment.