Contributor - Datatips
Datatips are labels tagging a point of a curve or a node of a surface in 3D.
Properties
.z_component="on"|"off" is poor. It could be replaced with a .disp_components="xyz" property, deciding which coordinates must be displayed in the datatip. In 2D view, the default would be "xy". In 3D view, the default would be "xyz". etc.
Most of datatips properties have quite bad names. What about renaming them (with warnobsoleting them). See the rational and suggestions #13312
- Context menu: a configuration GUI shall be proposed, in order to set default values for all datatips parameters, including the label-formating function when it is a macro.
- It is not possible to tune the orientation of labels (just their position wrt their anchor). When datatiping the tips and dips of a curve, it is usually preferable to do it with vertical or tilted labels, in order to avoid labels overlapping. A new .orientation property [in trigonometrical degrees] could be implemented. Alternatively, using a LaTeX \rotatebox{} instruction could be tested and documented as a workaround.
Interactive actions
- Presently, a datatype can't be detached from its node (with a link to it) to be placed away (e.g. out of the viewport, or on the top, etc) to not mask parts of the plot. This feature could be implemented. proposal:
- the color of the link should be the color set for the frame of the datatip box
- when moving the node of a detached datatip, the label position shall not move.
- the reference coordinates of the box corner/pivot shall be settable through a new .xyz_tip_pos property:
- when .xyz_tip_pos==[], the datatip is attached to its anchor
- when .xyz_tip_pos is a 3-components vector, it gives the coordinates of the reference point of the label box (its "pivot") This feature will as well allow users to align all their datatips say at the top, bottom or side of the plotting area in a very soft and convenient way.
Datatips can't be displayed only on-the-fly. They would be more used in such a mode. See the report #13794
A polyline.datatips_display_mode property with value in "always" | "onclick" | "on-the-fly" could be implemented.
Labels display
This part might be implemented by writing a default function in Scilab language. Then, Scilab's renderer should be able to use it whenever it is required.
- Polar axes: When the plot is rendered in polar coordinates (polar in 2D view, or spherical in 3D view), the label shall display the three polar coordinates instead of the raw X,Y[,Z] ones:
- 2D view: radius R = sqrt(x²+y²) angle A = atand(y,x)
- 3D view: radius R = sqrt(x²+y²+z²) longitude Axy = atand(y,x) latitude Az = atand(z/R) This behavior should be performed when the gca().userdata attribute is a structure with the field .frame_type == "polar"
Such a flag is expected through the report #6602. It shall be implemented in this way if creating it as a true new gca() property can't be done.
The default format of labels shall be better tuned. It shall take into account the full range of the coordinates of the parent curve (or the zoomed range whether the plot is zoomed when the datatip is set). For the whole curve, let's set Dx=(max(x)-min(x)), Dy=(max(y)-min(y)), Dz=(max(z)-min(z))
- In 2D or 3D bi/tri-linear scales: the number of displayed digits shall be 3 in addition of the number of digits of the "integer part" of the range. For instance, if the whole curve (or its zoomed part) ranges
- with x in [-5, 10], the default label must be displayed as s#.## (where s is the sign).
- with x in [1.001, 1.002], the default label must be displayed as 1.00###
- etc (please ask for details if needed)
- In 2D polar or 3D spherical frames:
the format for the radius R shall follow the same adaptative rule (it is always>0)
- Angles shall be displayed in the [0, 360[° range, with 1 decimal figure.
- When 1, 2 or 3 directions is/are in logarithmic scale: think about the best way to get clever labels, with a clever number of digits
- In 2D or 3D bi/tri-linear scales: the number of displayed digits shall be 3 in addition of the number of digits of the "integer part" of the range. For instance, if the whole curve (or its zoomed part) ranges