-
Notifications
You must be signed in to change notification settings - Fork 15
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
Dash section #38
base: master
Are you sure you want to change the base?
Dash section #38
Conversation
This comment has been minimized.
This comment has been minimized.
Great @dy Much better now: https://github.com/plotly/plotly.js/compare/dima-dash-lines |
cc @alexcjohnson any thoughts on Dima's fix here? |
Very interesting strategy @dy, I like it! I think 8 patterns is a good compromise between join mismatches and dash pattern misalignment. But I'd make sure we have exact horizontal & vertical patterns, since those are very common cases and we don't want to bias viewers into thinking a horizontal line is slightly tilted |
@dy is there any reason why the conflict has not been solved? This is a good idea and would fix plotly problems with dashed/dotted lines. |
This PR resolves plotly/plotly.js#2946 and #13. The technique is straight: a segment direction is snapped to one of possible dash pattern directions, by default 8. That gives the following solutions:
3 patterns:
4 patterns:
5 patterns:
6 patterns:
7 patterns:
8 patterns (default):
9 patterns:
10 patterns:
12 patterns:
16 patterns:
20 patterns:
40 patterns:
No snapping:
That is still imperfect - pattern is broken at some joins, but that number of broken joins is reduced from every segment to sufficiently different segments.