plotly / dash-cytoscape

Interactive network visualization in Python and Dash, powered by Cytoscape.js
https://dash.plot.ly/cytoscape
MIT License
587 stars 120 forks source link

Add timestamp to events, update positions on drag, and add `clearOnUnhover` prop. #195

Closed Farkites closed 9 months ago

Farkites commented 10 months ago

About

- [x] Update `elements` property when elements are modified in the Cytoscape UI - [x] Add timestamp to `tapNodeData` and `tapEdgeData` properties such that they trigger a callback on every tap, even if the data itself has not changed - [x] Add timestamp to `mouseoverNodeData` and `mouseoverEdgeData` properties such that they trigger a callback on every mouseover, even if the data itself has not changed - [x] Update documentation - [x] Update tests This PR adds timestamps to some properties so they trigger callbacks every time the cytoscape events happen, adds property `clearOnUnhover` to configure the behaviour of `mouseOver` callbacks, and updates `position` of elements when they are dragged with the mouse. ## Description of changes

Added

Pre-Merge checklist

Reference Issues

Closes #[issue number]

Other comments

emilykl commented 9 months ago

@Farkites I just finished a final review over everything except the tests -- looks great!!! 🥇

emilykl commented 9 months ago

@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:

Run the following tests:
python -m unittest tests.test_callbacks
python -m unittest tests.test_interactions
python -m unittest tests.test_usage

and replacing it with

Install ChromeDriver following the instructions [here (Mac)](https://www.kenst.com/2015/03/installing-chromedriver-on-mac-osx/) or [here (Windows)](http://jonathansoma.com/lede/foundations-2018/classes/selenium/selenium-windows-install/). You must install the version of ChromeDriver that matches your Chrome version.

Run the tests using the following command:
pytest --headless
emilykl commented 9 months ago

@alexcjohnson @Farkites This looks completely ready to me aside from the lingering Percy test issues... I am approving!