Class CombineArrayPlotter<S extends CombineArrayPlotter.CombineArrayStyle>

  • All Implemented Interfaces:
    Plotter<S>
    Direct Known Subclasses:
    LineCombineArrayPlotter, MarkCombineArrayPlotter

    public abstract class CombineArrayPlotter<S extends CombineArrayPlotter.CombineArrayStyle>
    extends AbstractPlotter<S>
    Partial Plotter implementation for plot types that combine multiple all the array-valued X and Y coordinates in a data set, and make some plot from the resulting combination. Combination is typically a mean, but can be something else.

    This plotter is written to cope with blank values for one or other of the X/Y coordinates; if one is blank, it taken to indicate a sequence of values 0, 1, 2, ..., which is probably reasonable for a plot. At present, it will never be fed null values, since FloatingArrayCoord.X/Y are marked required, but if the input coordinates are changed to be optional at some point, it ought to work with that.

    Since:
    25 Jan 2022
    Author:
    Mark Taylor
    • Field Detail

      • XCOMBINER_KEY

        public static final ConfigKey<Combiner> XCOMBINER_KEY
        Configuration key for X coordinate combination mode.
      • YCOMBINER_KEY

        public static final ConfigKey<Combiner> YCOMBINER_KEY
        Configuration key for Y coordinate combination mode.
      • XS_REPKEY

        public static final ReportKey<double[]> XS_REPKEY
        Report key for combined X array values.
      • YS_REPKEY

        public static final ReportKey<double[]> YS_REPKEY
        Report key for combined Y array values.
    • Constructor Detail

      • CombineArrayPlotter

        protected CombineArrayPlotter​(java.lang.String name,
                                      javax.swing.Icon icon)
        Constructor.
        Parameters:
        name - plotter name
        icon - plotter icon
    • Method Detail

      • createLayer

        public PlotLayer createLayer​(DataGeom geom,
                                     DataSpec dataSpec,
                                     CombineArrayPlotter.CombineArrayStyle style)
        Description copied from interface: Plotter
        Creates a PlotLayer based on the given geometry, data and style.

        The style parameter is the result of a call to Plotter.createStyle(uk.ac.starlink.ttools.plot2.config.ConfigMap).

        The dataSpec parameter must contain the coordinates defined by this plotter's CoordGroup.

        The pointDataGeom parameter is only used if getCoordGroup(). getPositionCount returns a non-zero value, otherwise the plot does not have point positions.

        It is legal to supply null for any of the parameters; if insufficient data is supplied to generate a plot, then the method should return null.

        Creating a layer should be cheap; layers may be created and not used.

        Parameters:
        geom - indicates base position coordinates and their mapping to points in the data space; if non-null, the data geom's DataGeom.hasPosition() method will return true
        dataSpec - specifies the data required for the plot
        style - data style as obtained from createStyle
        Returns:
        new plot layer, or null if no drawing will take place