# Class CombineArrayPlotter<S extends CombineArrayPlotter.CombineArrayStyle>

java.lang.Object
uk.ac.starlink.ttools.plot2.layer.AbstractPlotter<S>
uk.ac.starlink.ttools.plot2.layer.CombineArrayPlotter<S>

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

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`static class`
`CombineArrayPlotter.CombineArrayStyle`
Partial Style implementation for use with this class.

## Field Summary

Fields
Modifier and Type
Field
Description
`static final ConfigKey<Combiner>`
`XCOMBINER_KEY`
Configuration key for X coordinate combination mode.
`static final ReportKey<double[]>`
`XS_REPKEY`
Report key for combined X array values.
`static final ConfigKey<Combiner>`
`YCOMBINER_KEY`
Configuration key for Y coordinate combination mode.
`static final ReportKey<double[]>`
`YS_REPKEY`
Report key for combined Y array values.

## Constructor Summary

Constructors
Modifier
Constructor
Description
`protected`
`CombineArrayPlotter(String name, Icon icon)`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`PlotLayer`
`createLayer(DataGeom geom, DataSpec dataSpec, CombineArrayPlotter.CombineArrayStyle style)`
Creates a PlotLayer based on the given geometry, data and style.
`Object`
`getRangeStyleKey(S style)`
The AbstractPlotter implementation returns null.

### Methods inherited from class AbstractPlotter

`getCoordGroup, getPlotterIcon, getPlotterName, hasReports`

### Methods inherited from class Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface Plotter

`createStyle, getPlotterDescription, getStyleKeys`

## Field Details

### 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 Details

### CombineArrayPlotter

protected CombineArrayPlotter(String name, Icon icon)
Constructor.

Parameters:
  `name` - plotter name
  `icon` - plotter icon

## Method Details

### 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(ConfigMap)`.

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

The `pointDataGeom` parameter is only used if the `CoordGroup.getBasicPositionCount()` or `CoordGroup.getExtraPositionCount()` method from this plotter's CoordGroup return 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
  `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

### getRangeStyleKey

public Object getRangeStyleKey(S style)
Description copied from class: `AbstractPlotter`
The AbstractPlotter implementation returns null.

Specified by:
  `getRangeStyleKey` in interface `Plotter<S extends CombineArrayPlotter.CombineArrayStyle>`
Overrides:
  `getRangeStyleKey` in class `AbstractPlotter<S extends CombineArrayPlotter.CombineArrayStyle>`
Parameters:
  `style` - plot style to assess
Returns:
  opaque object with equality semantics, or null if axis range is not a function of style