-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
adding example for multiple disconnected lines #2215
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
Conversation
@felixniemeyer Thanks a lot for taking the time to submit this example! It's always awesome to see community members submitting pull requests. I only have a few minor comments. First, can you please update your PR so that the example you added has all the code needed to execute it? In our experience, users find it frustrating to not be able to copy/paste entire examples through the use of techniques like Second, can you please provide a screenshot of what the example figure created by your example looks like and explain a little more the motivation behind it? I am having a hard time seeing what you mean by "multiple disconnected lines" when I am looking at the figure in my development environment. Thanks again! |
@jdamiba I think the use case here is that if you have one trace per segment your figure will render more slowly than if you have a single trace of (here interrupted) lines. @felixniemeyer thanks for your contribution? Would you have the time to address @jdamiba 's comments about having a standalone code cell? |
doc/python/lines-on-maps.md
Outdated
@@ -111,6 +111,33 @@ fig.update_layout( | |||
|
|||
fig.show() | |||
``` | |||
### High performance US Flight Paths Map | |||
If you can relinquish having individual styles for the flight paths (e.g. opacity), you can put multiple paths into one trace, which makes the map render much faster. |
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.
About the wording I'm hesitating between faster
and much faster
here... Do you have orders of magnitude for the two solutions?
Thanks for your feedback everybody. @jdamiba @emmanuelle Creating one trace for each line results in: Creating only 4 traces in total and adding multiple lines to them results in: -- Here are two people, for whom the "multiple lines in a trace" was the solution to their performance issues: Another use case (besides performance improvement) for this feature of using "None" in the coordinates arrays to start multiple lines within the same trace may arise in combination with drawing a legend: |
Thank you @felixniemeyer for the update and the benchmark. I just left a last suggestion to improve performance even more :-). |
@felixniemeyer did you have the time to look at my suggestion? I'd love to merge this cool example! |
@felixniemeyer I merged my suggestion to your branch so that we can merge the PR, I hope you don't mind. Thank you very much for the PR! |
I found this feature very helpful for plotting large networks with many many edges.
I think it might be valuable for others who stumble across this article, too.