-
Notifications
You must be signed in to change notification settings - Fork 142
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
Graph view hides resources with default zoom #2390
Conversation
0a14ba0
to
acab07b
Compare
Add a loading text message to display while the graph is rendering.
Rework D3Graph props and types.
acab07b
to
f85f642
Compare
…and back. Move graph utility functions to utils and add tests for them. Fix version keys in the footer.
605fe60
to
4c64dc4
Compare
aca653d
to
28acf2d
Compare
@ozamosi @joshri checked it, it's ready for testing. It was a rare positive issue: now, after the latest improvements, the graph loads much faster (comparing to the previous initial zoom fix which caused flickering), so there was no loading text displayed and I had thought smth. was wrong. Now there is just no delay before the root node is rendered, but I still kept the loading text for systems with lower performance. Please let me know if you still see the loading text. Please use the graphs from the repo in the issue #2312 description for testing, those graphs are really wide. And please check the font size at the initial and final zoom is not too small. |
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.
-
A small graph shows up properly.
-
Looking at a big graph centers on the source.
-
The default size gives you a reasonable text size
-
I can zoom out pretty much as far as I can reasonably distinguish letters.
-
When I zoom on a centered graph, the graph indeed moves sideways. This is a documented limitation and tracked separately.
ui/lib/__tests__/utils.test.ts
Outdated
it("calculates zoom ratio", () => { | ||
expect( | ||
Math.abs(calculateZoomRatio(0) - 0.013333333333333334) | ||
).toBeLessThanOrEqual(floatDiff); |
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.
Another way to express this is using https://jestjs.io/docs/expect#tobeclosetonumber-numdigits - it reads well to me because it lets you put the actual and the expected values on opposite "sides" - but this works too.
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.
Thanks, good to know! Will refactor the tests with it now.
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.
Refactored the tests with toBeCloseTo
.
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.
👏 genius 👏
@joshri thanks, that's more like survival skills. 😅 |
Closes #2312
translate
instead of the SVGviewBox
attribute.