# Class MatrixGangerFactory

java.lang.Object
uk.ac.starlink.ttools.plot2.geom.MatrixGangerFactory

All Implemented Interfaces:
  `GangerFactory<PlaneSurfaceFactory.Profile, PlaneAspect>`

public class MatrixGangerFactory extends Object implements GangerFactory<PlaneSurfaceFactory.Profile, PlaneAspect>
GangerFactory for use with a square matrix of Plane plots. Histogram-like plots are expected on the diagonal, and scatter-plot like plots on the off-diagonal cells.

Since:
  1 Jun 2023
Author:
  Mark Taylor

## Field Summary

Fields
Modifier and Type
Field
Description
`static final IntegerConfigKey`
`CELLGAP_KEY`
Config key for gap between matrix cells.
`static final ConfigKey<MatrixFormat>`
`FORMAT_KEY`
Config key for matrix format.
`static final MatrixGangerFactory`
`INSTANCE`
Sole instance.
`static final int`
`MAX_NCOORD_GUI`
Maximum number of coords offered by NCOORD_KEY Specifier.
`static final IntegerConfigKey`
`NCOORD_KEY`
Config key for number of input coordinates.
`static final BooleanConfigKey`
`SQUARES_KEY`
Config key for whether cells are constrained to be square.

## Method Summary

Modifier and Type
Method
Description
`Ganger<PlaneSurfaceFactory.Profile, PlaneAspect>`
`createGanger(Padding padding, ConfigMap config, GangContext context)`
Creates a ganger.
`ConfigKey<?>[]`
`getGangerKeys()`
Returns the configuration keys that can be used to configure the gangers produced by this factory.
`MatrixShape`
`getShape(ConfigMap config, Plotter<?>[] plotters)`
Returns the matrix shape that this factory will use given a set of plot types and a configuration map.
`boolean`
`hasIndependentZones()`
Indicates whether this ganger factory has zones that can be created according to the details of the plot and controlled independently by user request.
`static MatrixGangerFactory`
`instance()`
Returns the sole instance of this class.

### Methods inherited from class Object

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

## Field Details

### NCOORD_KEY

public static final IntegerConfigKey NCOORD_KEY
Config key for number of input coordinates.

### FORMAT_KEY

public static final ConfigKey<MatrixFormat> FORMAT_KEY
Config key for matrix format.

### SQUARES_KEY

public static final BooleanConfigKey SQUARES_KEY
Config key for whether cells are constrained to be square.

### CELLGAP_KEY

public static final IntegerConfigKey CELLGAP_KEY
Config key for gap between matrix cells.

### MAX_NCOORD_GUI

public static final int MAX_NCOORD_GUI
Maximum number of coords offered by NCOORD_KEY Specifier.

See Also:
  - Constant Field Values

### INSTANCE

public static final MatrixGangerFactory INSTANCE
Sole instance. @see `instance()`.

## Method Details

### hasIndependentZones

public boolean hasIndependentZones()
Description copied from interface: `GangerFactory`
Indicates whether this ganger factory has zones that can be created according to the details of the plot and controlled independently by user request.

Specified by:
  `hasIndependentZones` in interface `GangerFactory<PlaneSurfaceFactory.Profile, PlaneAspect>`
Returns:
  true iff zones can be manipulated explicitly by the user

### getGangerKeys

public ConfigKey<?>[] getGangerKeys()
Description copied from interface: `GangerFactory`
Returns the configuration keys that can be used to configure the gangers produced by this factory.

Specified by:
  `getGangerKeys` in interface `GangerFactory<PlaneSurfaceFactory.Profile, PlaneAspect>`
Returns:
  ganger configuration keys

### createGanger

public Ganger<PlaneSurfaceFactory.Profile, PlaneAspect> createGanger(Padding padding, ConfigMap config, GangContext context)
Description copied from interface: `GangerFactory`
Creates a ganger.

Specified by:
  `createGanger` in interface `GangerFactory<PlaneSurfaceFactory.Profile, PlaneAspect>`
Parameters:
  `padding` - required padding around plot area
  `config` - configuration map that may contain keys from getGangerKeys
  `context` - additional context required for ganger creation
Returns:
  new ganger

### getShape

public MatrixShape getShape(ConfigMap config, Plotter<?>[] plotters)
Returns the matrix shape that this factory will use given a set of plot types and a configuration map.

Parameters:
  `config` - config map
  `plotters` - plotters generating plots on the matrix
Returns:
  matrix shape

### instance

public static MatrixGangerFactory instance()
Returns the sole instance of this class.

Returns:
  factory instance