-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Add "arrowanchor" property to annotations #2164
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
Changes from 3 commits
f598c92
c4a0f1f
19a06c6
42138e7
191d5d2
8e75b74
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -72,9 +72,13 @@ module.exports = overrideAll({ | |
showarrow: annAtts.showarrow, | ||
arrowcolor: annAtts.arrowcolor, | ||
arrowhead: annAtts.arrowhead, | ||
startarrowhead: annAtts.startarrowhead, | ||
arrowside: annAtts.arrowside, | ||
arrowsize: annAtts.arrowsize, | ||
startarrowsize: annAtts.startarrowsize, | ||
arrowwidth: annAtts.arrowwidth, | ||
standoff: annAtts.standoff, | ||
startstandoff: annAtts.startstandoff, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does this really work in 3D or are these attributes there just to make the supply-default function not error out? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, it works fine There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Great. Would you mind adding an annotations item showing off the new attributes to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
||
hovertext: annAtts.hovertext, | ||
hoverlabel: annAtts.hoverlabel, | ||
captureevents: annAtts.captureevents, | ||
|
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.
and
should be inside this block as well - as they have no effect w/o start arrow.
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.
There was possibility to use
standoff
witharrowhead: 0
(no arrow) before my changes and I decided to keep this functionality for ‘startstandoff’ -> when we havearrowside: none
, we still can set both properties of standoff and see the result.Please just confirm that it is not expected behaviour and I will apply suggested changes.
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.
Ha good point. I think you have it right here.
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.
Right, so
(start)standoff
always needs to be coerced - but doesn'tstartarrowsize
go in here?Also if we have no
'end'
we don't needarrowhead
andarrowsize
do we?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.
Seems like @apalchys posted and deleted a comment, so maybe he noticed what I'm about to say... (incidentally, if that's the case, let me encourage you to edit comments, using
strikethroughif necessary, rather than deleting them, as it makes the conversation flow clearer)(start)arrowhead
and(start)arrowsize
are not needed logically when we're not showing a head on that end, so that's a warning sign that providing them could lead to bugs. Indeed, I think there is a subtle one: if you choose an arrowhead that has abackoff
(including the defaultarrowhead: 1
!backoff
is how much you need to move the end of the line backward so the arrowhead can point to the right place without the line jutting through it) but you don't show that arrowhead, you'll get an excessive standoff.options.arrowhead || 0
ensures an un-coercedarrowhead
is treated as no arrow, and we may needoptions.arrowsize || 0
(this value probably doesn't matter as long as it's numeric) to make the math well-defined.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.
sorry, I recognized that my answer is wrong right after I submit it. I will commit an update soon.
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.
Please check my commit - 191d5d2
Is it what you expected?
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.
Perfect, thanks! Looks like this tweaked one more test image (
gl2d_annotations
) but once that's fixed I think we're ready to go 🎉