Add quiver trace type for vector field visualization#7584
Add quiver trace type for vector field visualization#7584degzhaus wants to merge 15 commits intoplotly:masterfrom
Conversation
dfd3c81 to
9463b3f
Compare
|
Hello, I am new to this project and attempting to contribute my first PR. Unfortunately, I am struggling to get the build to pass. Specifically, the I tried running But still encountering the issue. Any insight would be greatly appreciated. Thank you! Edit: tagging a few recent commiters for visibility, thanks so much! (cc @camdecoster @alexshoe @emilykl) |
|
Hi @degzhaus, thank you for working on this contribution! As it stands currently, the devtools dashboard needs to be running in order for You can also download |
b07de7b to
a32678d
Compare
Thank you so much, @emilykl! That was very helpful and unblocked me.
Edit: @emilykl i figured it out! Pardon my flailing at last night. So exciting! I have a couple of tests to add and this will be ready for review. Thanks again for your insights and help! |
64cf31d to
02c37f5
Compare
|
@degzhaus Great news, glad you're unblocked! Thank you for your work on this. Quiver is a plot type we've gotten a lot of requests for. A few high-level comments on the API:
|
Amazing, thank you so much for taking a look and providing great guidance, Emily! Looking forward to spinning a cycle on this feedback. |
|
@degzhaus One more comment — it would be great to include colorscale attributes in |
60d1da9 to
a8f8381
Compare
69947b2 to
b93b445
Compare
|
Perhaps for future readers' clarity of understanding, @degzhaus , you could edit the description at the top of the PR to say:
in the two places it appears, so that the as-merged plot type appears there. |
b93b445 to
0252e03
Compare
Great catch, thank you so much, @gpdf ! Updated per your recommendation, and did a little review/revision based on changes made during the review process as well. |
Hey there, @emilykl, hope you're having a wonderful week! I rebased, cleaned up some code, and added some tests here: Thanks again for everything! |
|
I really appreciate all the effort in polishing, and very much look forward to using this. |
|
@emilykl Where are we on the trajectory toward getting this merged? I'm excited about being able to start using it. |
|
@emilykl Is there anything we can do on our end to support this? |
0252e03 to
51a2afc
Compare
|
Hi @degzhaus ! I sincerely apologize for the delay in the next round of review, and a big thank you for your patience. I'll be going through this PR again this afternoon. Thanks again for your work so far and for persevering with this one! |
51a2afc to
2b2d1c9
Compare
All good, @emilykl ! Thank you so much for the message. I just rebased and ensured tests are passing, so looking forward to the next steps of the review. Thanks again to you both, @emilykl @gpdf ! John |
Overview
This PR adds a new
quivertrace type to Plotly.js for visualizing 2D vector fields using arrows.Features
x,ycoordinates with direction/magnitude fromu,vcomponentsscaled(normalized),absolute, orrawvector lengths viasizemode/sizereftail,tip, orcenter/cm/middlecarray)line.*attributesarrowsizehovertemplate, point selectionx,y,u,v, andcarraysAPI
Screenshots
Examples taken from plotly.com/python/quiver-plots
Gist with example code
Basic Quiver Plot
With Colorscale
Testing
Files Changed
New files (
src/traces/quiver/)index.js- Trace module definitionattributes.js- Attribute schemadefaults.js- Default value handlingcalc.js- Data calculationplot.js- SVG renderingstyle.js- Stylinghover.js- Hover behaviorselect_points.js- Selection supportevent_data.js- Event data formattingformat_labels.js- Label formattingModified
lib/index.js&lib/index-strict.js- Build integrationTests
test/jasmine/tests/quiver_test.js- Unit teststest/image/mocks/quiver_*.json- 9 mock filestest/image/baselines/quiver_*.png- Baseline images