-
Notifications
You must be signed in to change notification settings - Fork 0
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
DasAnnotation anchorType=plot, other annotation clean up #47
Comments
Also I'd like for there to be a way to specify how tight the margins are around the text. It looks like it's roughtly 1em right now, but sometimes I'd like to have no margin at all. |
(Item 7) The "point at" mouse module included within the annotations would adjust the anchorOffsets, incorrectly. The pointAt point is different that the xrange and yrange which position the annotation, and the two should not be coupled. |
(Item 8) "move annotation" adjusts anchorOffsets, but does not consider splitAnchorType. |
(Item 9) "move annotation" has a sign error in Y when anchorPosition is OutsideNE. All branches of adjustAnchorOffset should be reviewed. This script is useful: from org.das2.graph import AnchorPosition
i=0
for v in AnchorPosition.values():
annotation( i, anchorPosition=v, text=str(v) )
i=i+1 |
Item 8 was not a bug. There is no special consideration needed. |
type works like canvas but is clipped by the plot bounds.
to see if annotation could point to data from outside the plot.
(7 and 12) I've always found the DATA mode for positioning strange, and I think I've finally figured out why. When "showArrow" was on, it would use the pointAt position to locate, and the xrange,yrange box otherwise. I'm correcting this, but I'm this will likely break existing products. It's always a good idea to favor the simpler code, and this is the simpler solution (and it removes about 12 lines of code). |
getAnchorBounds to just return the xrange,yrange box. This is simpler and consistent with documentation I see in several places.
I found that with splitAnchor type and verticalAnchorType=CANVAS, the anchor would still be clipped. This is fixed. |
#92 where GrannyTextRenderer doesn't clip painters properly. |
DasAnnotation has always had three modes to anchor (position) the annotation: canvas, plot, and data. I think the original idea was that "data" was going to allow anchoring to data, where the bounds of the data were going to be used to position the data. This never happened, and a simple bounding box (xrange = 20 to 25; yrange = 40 to 45) is allowed and Autoplot scripts are used to identify the data bounds. The "plot" mode was going to anchor to axes, but is never used because this is what the data position does. (Canvas just anchors to a row and column, or null values are just the entire canvas.) Further complicating things, we later added a verticalAnchorType which allows the two dimensions to be independently controlled.
I'd like for the "plot" to be made useful, where inside anchorPositions will clip using the plot clip, and outside anchorPositions will clip using reasonable boundaries so that adjacent plots are not affected. (Item 1)
There is additional cleanup which is needed, such as an improved GUI to control it, which Autoplot could use. (It has a quick one I threw together, but I don't think it's very effective.) (Item 2)
One still cannot rotate annotations, and this is an obvious feature that is overdue (Item 3). The properties "url" and "scale" should be deprecated since painters can be used for images (Item 4). "<img>" tags were supposed to be supported as well, but that's a different ticket (Item 5).
Last, there needs to be a clean document describing annotation use (Item 6).
See #21, and Autoplot ticket https://sourceforge.net/p/autoplot/bugs/1696/ .
The text was updated successfully, but these errors were encountered: