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

Custom orientation being overridden #56

Open
jjsiman opened this issue Apr 2, 2019 · 3 comments
Open

Custom orientation being overridden #56

jjsiman opened this issue Apr 2, 2019 · 3 comments

Comments

@jjsiman
Copy link

jjsiman commented Apr 2, 2019

Not sure if I am not understanding the code properly or made my own mistake, but when I try to add a custom orientation into the note it has no effect. Basically what I want to do is have an annotation with a connector that is angled down and text above the horizontal line. Looking at the repo I see line 1480 of d3-annotation.js:

if (lineType === "vertical") orientation = "leftRight";else if (lineType === "horizontal") orientation = "topBottom";

It seems to me that custom orientation could be getting ignored because of lineType. Please correct me if I'm wrong!

@susielu
Copy link
Owner

susielu commented Apr 7, 2019

@jjsiman yes this is correct. In general I would have to say that the combination of orientation / lineType / align overall is overly confusing in its current form but yes orientation is overridden if you have a lineType. What is the desired behavior you're looking for?

Have you tried opening the options pane to play around with some of the options?
image

@jjsiman
Copy link
Author

jjsiman commented Apr 8, 2019

@susielu Thanks for the response! I wasn't able to get my desired behavior with the options, but essentially I was trying to have a callout elbow that is angled down with the text above the horizontal line. I've attached a quick sketch.
IMG_1997

@susielu
Copy link
Owner

susielu commented May 10, 2019

Ah thanks for posting this example, yes unfortunately I think the annotation tries to "helpfully" move the text to the bottom below the line if you callout is under the point you're interested.

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

No branches or pull requests

2 participants