-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
support for top-down scalefactor #153
Conversation
…orks a little bit
let topdownScaleFactor = 1 | ||
if ((element.parent as any).properties == undefined || (element.parent as any).properties['org.eclipse.elk.topdown.scaleFactor'] == undefined) { | ||
topdownScaleFactor = 1 | ||
} else { | ||
topdownScaleFactor = (element.parent as any).properties['org.eclipse.elk.topdown.scaleFactor'] | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the scale factor already is 1, so just inverting the condition would make an else clause unnecessary. Or, why not write this as a one-liner with a fallback like this: const topdownScaleFactor = (element.parent as any).?properties['org.eclipse.elk.topdown.scaleFactor'] ?? 1
And: is this any
cast necessary?
(multiple occurances of this in this PR)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good suggestion for simplifying the code, I'll have to check the any cast
@@ -369,6 +386,7 @@ export class DepthMap { | |||
*/ | |||
computeDetailLevel(region: Region, viewport: Viewport, relativeThreshold: number, scaleThreshold: number): DetailLevel { | |||
if (!this.isInBounds(region, viewport)) { | |||
console.log(region.boundingRectangle.id + " out of bounds") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
debug log or message important for the user?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this was for debugging and will be removed
change == to ===
please the prettier
really please the prettier
corresponding server side PR kieler/KLighD#173 but doesn't rely on it to not break things