-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e1765ad
commit a99edd1
Showing
4 changed files
with
31 additions
and
9 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,13 @@ function calculateFolderLabelPadding( | |
return padding_root + padding_folder * amountOfFoldersDepthOne + padding_folder * amountOfFolderDepthTwo | ||
} | ||
|
||
const HUGE_MAP = 15_000 | ||
const BIG_MAP = 10_000 | ||
|
||
const HUGE_MAP_FACTOR = 0.35 | ||
|
||
const BIG_MAP_FACTOR = 0.5 | ||
|
||
export function calculateTotalNodeArea( | ||
buildingAreasIncludingPadding: number[], | ||
hierarchyNode: HierarchyNode<CodeMapNode>, | ||
|
@@ -197,8 +204,8 @@ export function calculateTotalNodeArea( | |
* Step 12: | ||
*/ | ||
|
||
if (rootSide > 10_000) { | ||
factor = rootSide > 15_000 ? 0.35 : 0.5 | ||
if (rootSide > BIG_MAP) { | ||
factor = rootSide > HUGE_MAP ? HUGE_MAP_FACTOR : BIG_MAP_FACTOR | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
RomanenkoVladimir
Author
Member
|
||
rootSide = Math.max(rootWidthWithDefaultPadding * factor, Math.sqrt(totalNodeArea + shiftedFolderLabelPadding ** 2) * factor) | ||
} | ||
|
||
|
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
What about just calculating a maximum with an exact factor?