-
Notifications
You must be signed in to change notification settings - Fork 605
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
topology improvements: layers, bounds #5003
topology improvements: layers, bounds #5003
Conversation
@@ -65,6 +65,7 @@ const graphModel: Model = { | |||
id: 'g1', | |||
type: 'graph', | |||
layout: COLA_LAYOUT, | |||
layers: ['bottom', 'groups', 'groups2', 'default', 'top'], |
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.
Could use constants from topology for most.
@@ -145,7 +145,7 @@ const TopologyViewComponent: React.FC<TopologyViewComponentProps> = ({ vis }) => | |||
id="collapse-blue" | |||
label="Collapse Blue" | |||
isChecked={collapseBlue} | |||
onChange={setCollapseBlue} | |||
onChange={(checked) => setCollapseBlue(checked)} |
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.
why these changes?
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.
Warnings were logged in the console because onChange
actually has 2 params and the state functions only accept 1.
28cf3a8
to
350b1f8
Compare
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.
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: christianvogt, jeff-phillips-18 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Fixes
https://issues.redhat.com/browse/ODC-2187
This PR addresses two topology improvements:
The reason for splitting bounds into 2 objects is because of how mobx works for optimizing react renders. If a node only needs the height and width but uses bounds, then anytime the position changes, the node will need to be re-rendered. This happens a lot on drag move of a node. By switching to two separate objects. The parent ElementWrapper component will re-render when position changes and only the node will re-render when the dimensions change.
Layers was a simple fix by adding a
layers: string[]
array to theGraph
model object. This initializes the layers and removes the hard coded layers to become the default in case no layers are provided.Browser conformance:
/assign @jeff-phillips-18