-
Notifications
You must be signed in to change notification settings - Fork 113
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
Add data layers #129
Add data layers #129
Conversation
This reverts commit 3a0085f.
There are a few features that I've added for testing, which will be removed before merging
Fixes bug in sidebar storage
Plus add missing buttons to app proptypes
Use a branch on a fork owned by a team-member, so we have more control and have more assurance that it won't be deleted
src/selectors/layout.test.js
Outdated
expect(getZoomPosition(mockState.lorem)).toEqual(defaultZoom); | ||
}); | ||
|
||
it('returns default values if graph width/height is infinite (i.e. when no nodes are visible)', () => { |
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.
If it's a straightforward change, I think using 0
width for an empty graph might be clearer than Infinity
?
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.
Infinity
is coming from Dagre: It's returned when the graph has 0 nodes/edges. This happens when you disable all the nodes.
I could just avoid running Dagre layout at all and return undefined
when nodes.length === 0
? I'd just have to add some extra checks on the functions that receive the output. What do you reckon?
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.
update: have done it. See 78dbf90
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.
Ah well if you agree that it seems more natural, I think it would be nice to catch that Infinity
early on if it's a small change, either like you say or swap it with 0
at source?
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.
Agreed. Done!
Also improve animals mock data tags
Description
Development notes
This is a really big PR - sorry about that!
The layered rankings depends on being able to set
ranker: "none"
, a feature in Dagre that currently only exists on a PR that has been open since June last year. To get this to work we'll either need to fork Dagre or see if we can get the PR resurrected and merged. Else, we'll need to switch to a new DAG layout engine or write our own. In the short term, I've mirrored the branch from the PR on my own GitHub account and linked to it in package.json, so that we at least have ownership of it and can be sure that it won't be deleted or altered.Tasks
QA notes
There's a new test dataset called 'layers.mock.js'. To see layers in action, add
?data=layers
to the URL.You can toggle them on/off with this button:
You can see the layer bands by hovering over them. Note that they're not shown when hovering over a node - @GabrielComymQB is this okay?
Checklist
RELEASE.md
fileLegal notice
I acknowledge and agree that, by checking this box and clicking "Submit Pull Request":
I submit this contribution under the Apache 2.0 license and represent that I am entitled to do so on behalf of myself, my employer, or relevant third parties, as applicable.
I certify that (a) this contribution is my original creation and / or (b) to the extent it is not my original creation, I am authorised to submit this contribution on behalf of the original creator(s) or their licensees.
I certify that the use of this contribution as authorised by the Apache 2.0 license does not violate the intellectual property rights of anyone else.