Class Decimation
- java.lang.Object
-
- org.pepstock.charba.client.commons.NativeObjectContainer
-
- org.pepstock.charba.client.commons.AbstractNode
-
- org.pepstock.charba.client.options.AbstractModel<Plugins,IsDefaultDecimation>
-
- org.pepstock.charba.client.options.Decimation
-
- All Implemented Interfaces:
IsDefaultDecimation
public final class Decimation extends AbstractModel<Plugins,IsDefaultDecimation> implements IsDefaultDecimation
The decimation plugin can be used with line charts to automatically decimate data at the start of the chart life cycle.
To use the decimation plugin, the following requirements must be met:
- the data set must have an
IndexAxis.X
- the data set must be a
LineDataset
- the X axis for the data set must be either a
CartesianLinearAxis
orCartesianTimeAxis
orCartesianTimeSeriesAxis
- Author:
- Andrea "Stock" Stocchero
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DecimationAlgorithm
getAlgorithm()
Returns the algorithm used by the plugin.double
getSamples()
If theDecimationAlgorithm.LTTB
algorithm is used, this is the number of samples in the output data set.
Defaults to the canvas width to pick 1 sample per pixel.double
getThreshold()
If the number of samples in the current axis range is above this value, the decimation will be triggered.
Defaults to 4 times the canvas width.
The number of point after decimation can be higher than the threshold value.boolean
isEnabled()
Returnstrue
if decimation are enabled.void
setAlgorithm(DecimationAlgorithm algorithm)
Sets the algorithm used by the plugin.void
setEnabled(boolean enabled)
Setstrue
if decimation are enabled.void
setSamples(double samples)
If theDecimationAlgorithm.LTTB
algorithm is used, this is the number of samples in the output data set.
Defaults to the canvas width to pick 1 sample per pixel.void
setThreshold(double threshold)
If the number of samples in the current axis range is above this value, the decimation will be triggered.
Defaults to 4 times the canvas width.
The number of point after decimation can be higher than the threshold value.-
Methods inherited from class org.pepstock.charba.client.options.AbstractModel
getDefaultValues, getParent, loadPadding, setCallbackToModel, setCallbackToModel, setEventToModel
-
Methods inherited from class org.pepstock.charba.client.commons.AbstractNode
checkAndAddToParent, getChildKey, getParentNode, getRootNode, getUpdateListener, retrieveRoot, setArrayValueAndAddToParent, setArrayValueAndAddToParent, setArrayValueAndAddToParent, setElementAndAddToParent, setInternalCallbackToModel, setInternalCallbackToModel, setUpdateListener, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent
-
Methods inherited from class org.pepstock.charba.client.commons.NativeObjectContainer
checkDefaultValuesArgument, empty, getArrayValue, getElement, getIncrementalId, getNativeChart, getNativeEvent, getNativeObject, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValueForMultipleKeyTypes, getValueForMultipleKeyTypes, getValueForMultipleKeyTypes, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, has, has, isType, keys, loadNativeObject, remove, remove, setArrayValue, setArrayValue, setArrayValue, setElement, setEmptyValue, setNewIncrementalId, setNewIncrementalId, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, toJSON, type
-
-
-
-
Method Detail
-
setEnabled
public void setEnabled(boolean enabled)
Setstrue
if decimation are enabled.- Parameters:
enabled
-true
if decimation are enabled.
-
isEnabled
public boolean isEnabled()
Returnstrue
if decimation are enabled.- Specified by:
isEnabled
in interfaceIsDefaultDecimation
- Returns:
true
if decimation are enabled.
-
setAlgorithm
public void setAlgorithm(DecimationAlgorithm algorithm)
Sets the algorithm used by the plugin.- Parameters:
algorithm
- the algorithm used by the plugin
-
getAlgorithm
public DecimationAlgorithm getAlgorithm()
Returns the algorithm used by the plugin.- Specified by:
getAlgorithm
in interfaceIsDefaultDecimation
- Returns:
- the algorithm used by the plugin
-
setSamples
public void setSamples(double samples)
If theDecimationAlgorithm.LTTB
algorithm is used, this is the number of samples in the output data set.
Defaults to the canvas width to pick 1 sample per pixel.- Parameters:
samples
- the number of samples in the output data set
-
getSamples
public double getSamples()
If theDecimationAlgorithm.LTTB
algorithm is used, this is the number of samples in the output data set.
Defaults to the canvas width to pick 1 sample per pixel.- Specified by:
getSamples
in interfaceIsDefaultDecimation
- Returns:
- the number of samples in the output data set
-
setThreshold
public void setThreshold(double threshold)
If the number of samples in the current axis range is above this value, the decimation will be triggered.
Defaults to 4 times the canvas width.
The number of point after decimation can be higher than the threshold value.- Parameters:
threshold
- the number of samples in the current axis range is above this value, the decimation will be triggered
-
getThreshold
public double getThreshold()
If the number of samples in the current axis range is above this value, the decimation will be triggered.
Defaults to 4 times the canvas width.
The number of point after decimation can be higher than the threshold value.- Specified by:
getThreshold
in interfaceIsDefaultDecimation
- Returns:
- the number of samples in the current axis range is above this value, the decimation will be triggered
-
-