package external; import java.util.Arrays; import java.util.List; import java.util.logging.Logger; import org.python.core.Py; import org.python.core.PyInteger; import org.python.core.PyObject; import org.python.core.PyString; import org.autoplot.ScriptContext; import org.autoplot.dom.Annotation; import org.autoplot.dom.Application; import org.autoplot.dom.DomNode; import org.autoplot.dom.DomUtil; import org.autoplot.dom.Plot; import org.autoplot.jythonsupport.JythonOps; import org.das2.graph.AnchorPosition; import org.das2.graph.AnchorType; import org.das2.graph.BorderType; import org.das2.qds.ops.Ops; import org.python.core.PyJavaInstance; import org.python.core.PyList; /** * new implementation of the plot command allows for keywords in the * Jython environment. *
* @see https://autoplot.org/help.annotationCommand * @author jbf */ public class AnnotationCommand extends PyObject { private static final Logger logger= org.das2.util.LoggerManager.getLogger("autoplot"); public static final PyString __doc__ = new PyString("{@code * annotation( 0, 'Anno1' ) * annotation( 1, 'Anno2', textColor='darkBlue', anchorPosition='NW' ) * plot( 'vap+cdaweb:ds=OMNI2_H0_MRG1HR&id=DST1800&timerange=Oct+2016' ) * annotation( 2, 'Anno3', anchorType='DATA',pointAt='2016-10-14T07:51Z,-100', xrange='2016-10-20T00:00/PT30S', yrange='-150 to -100', * anchorPosition='OutsideNE', anchorOffset='' ) *}
text | The message, allowing Granny codes |
textColor | text color\n |
background | background color\n |
foreground | foreground color\n |
fontSize | size relative to parent (1.2em) or in pts (8pt)\n |
borderType | draw a border around the annotation text none,rectangle,rounded_rectangle . |
anchorBorderType | draw a border around the anchor box. |
anchorPosition | One of NE,NW,SE,SW, N,E,W,S, outsideN,outsideNNW |
anchorOffset | position relative to the anchor, like '1em,1em' |
anchorType | PLOT means relative to the plot. DATA means relative to xrange and yrange |
xrange, yrange | anchor box when using data anchor |
plotId | ID of the plot containing axes. This will set the anchorType to CANVAS, unless xrange or yrange is set. |
pointAt | comma separated X and Y to point the annotation arrow at. |
pointAtX | X value to point the arrow at or to anchor the annotation. |
pointAtX | Y value to point the arrow at or to anchor the annotation. |
rowId | ID of the row containing for positioning this annotation, sets anchorType=CANVAS (See dom.plots[0].rowId) |
columnId | ID of the column containing for positioning this annotation, sets anchorType=CANVAS |