Skip to content
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

Fix needle plot domain annotations and add textangle prop #565

Merged
merged 7 commits into from
Jul 26, 2021

Conversation

HammadTheOne
Copy link
Contributor

@HammadTheOne HammadTheOne commented Jul 15, 2021

Closes #546
Closes #517

About

  • I am closing an issue
  • I am adding a feature to an existing component, or improving an existing feature

Description of changes

This PR reduces the XSPAN_RATIO for the NeedlePlot component so that domain annotations are more regularly aligned to the domains they belong to, and only aligned right when the domain length is short enough for it to be appropriate.

This should make for a more consistent annotation scheme. This PR also exposes the textangle prop to allow the domain annotation orientation to be rotated relative to the horizontal axis.

@alexcjohnson Do you have any thoughts on the ANGLE_OFFSET calculation? It's intended to increase the distance between the domain divider and the annotation as the text is angled more sharply, but I'm curious if there's a better method of doing so rather than using ratios.

image

@HammadTheOne
Copy link
Contributor Author

With bd53eef I added a slightly modified version of the filterEventData function found in dcc.Graph to enable clickData and selectData.

image

Only remaining problem I'm seeing now is when selecting points with selectData, I encounter an error where this.gd is undefined, when the same reference works for clickData. I'll dig a little bit more to find out the source of this behaviour.

@HammadTheOne HammadTheOne merged commit 3f1df2f into master Jul 26, 2021
@HammadTheOne HammadTheOne deleted the fix-needle-plot branch August 11, 2021 05:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Labels of domains in needle plot are misplaced Have NeedlePlot update selectedData
1 participant