-
-
Notifications
You must be signed in to change notification settings - Fork 122
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 timestamp to events, update positions on drag, and add clearOnUnhover
prop.
#195
Conversation
…ents on drag, and timestamp to tapNodeData and tapEdgeData
cy.on('position', 'node', (event) => { | ||
if (typeof this.props.setProps === 'function') { | ||
this.props.setProps({ | ||
elements: this.props.elements.map((item) => |
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.
@Farkites Does this actually update the position of the elements? It looks like this would trigger a prop update with the new timestamp, but still using the old position of the elements.
But generally this feels cleaner -- so an approach like this is on the right track I think.
Looking into this a bit this AM.
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.
OK I have an idea... it looks like ele.json()
might give us something close to what we want... how about something like
this.props.setProps({
elements: cy.elements('').map((item) => item.json()),
});
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.
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.
This approach works with:
this.props.setProps({
elements: cy.elements('').map((item) => {
return {
data: item.json().data,
position: item.json().position,
};
}),
});
Although it introduces position: {x: 0, y:0}
for edges...
Co-authored-by: Alex Johnson <alex@plot.ly>
Co-authored-by: Alex Johnson <alex@plot.ly>
@Farkites I just finished a final review over everything except the tests -- looks great!!! 🥇 |
@Farkites I was able to run all the Selenium tests locally! I used a different command to run the tests than what's listed in the CONTRIBUTING.md, I'd recommend getting rid of this bit:
and replacing it with
|
@alexcjohnson @Farkites This looks completely ready to me aside from the lingering Percy test issues... I am approving!
It seems like maybe it's failing to finalize because the
|
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.
🥳
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.
💃 Nice work!
About
elements
property when elements are modified in the Cytoscape UItapNodeData
andtapEdgeData
properties such that they trigger a callback on every tap, even if the data itself has not changedmouseoverNodeData
andmouseoverEdgeData
properties such that they trigger a callback on every mouseover, even if the data itself has not changedThis PR adds timestamps to some properties so they trigger callbacks every time the cytoscape events happen, adds property
clearOnUnhover
to configure the behaviour ofmouseOver
callbacks, and updatesposition
of elements when they are dragged with the mouse.Description of changes
Added
clearOnUnhover
propertytapNodeData
andtapEdgeData
propertiesmouseoverNodeData
andmouseoverEdgeData
propertieselements
positions when nodes are draggedPre-Merge checklist
npm run build:all
.Reference Issues
Closes #[issue number]
Other comments