-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Add quiver trace type for vector field visualization #7584
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
base: master
Are you sure you want to change the base?
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 |
feea298 to
f3ae9e2
Compare
60ca5c5 to
a008dab
Compare
|
Pardon the delay, @emilykl, i was finally able to make time to clean this up. I removed some of my recent comments/questions because they were noise around me understanding how to work with the Thanks again for all your help with this PR! Excited for next steps. |
|
Hi @degzhaus ! I'm aiming to give this another review by the end of the week. Sorry for the delay in getting back to you — looking forward to it! Thanks for your work so far. |
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. |
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