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
CartesianLinearAxisorCartesianTimeAxisorCartesianTimeSeriesAxis
- Author:
- Andrea "Stock" Stocchero
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DecimationAlgorithmgetAlgorithm()Returns the algorithm used by the plugin.doublegetSamples()If theDecimationAlgorithm.LTTBalgorithm is used, this is the number of samples in the output data set.
Defaults to the canvas width to pick 1 sample per pixel.doublegetThreshold()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.booleanisEnabled()Returnstrueif decimation are enabled.voidsetAlgorithm(DecimationAlgorithm algorithm)Sets the algorithm used by the plugin.voidsetEnabled(boolean enabled)Setstrueif decimation are enabled.voidsetSamples(double samples)If theDecimationAlgorithm.LTTBalgorithm is used, this is the number of samples in the output data set.
Defaults to the canvas width to pick 1 sample per pixel.voidsetThreshold(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, setValueAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent
-
Methods inherited from class org.pepstock.charba.client.commons.NativeObjectContainer
checkAndGetColor, 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, setValue, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, toJSON, type
-
-
-
-
Method Detail
-
setEnabled
public void setEnabled(boolean enabled)
Setstrueif decimation are enabled.- Parameters:
enabled-trueif decimation are enabled.
-
isEnabled
public boolean isEnabled()
Returnstrueif decimation are enabled.- Specified by:
isEnabledin interfaceIsDefaultDecimation- Returns:
trueif 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:
getAlgorithmin interfaceIsDefaultDecimation- Returns:
- the algorithm used by the plugin
-
setSamples
public void setSamples(double samples)
If theDecimationAlgorithm.LTTBalgorithm 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.LTTBalgorithm 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:
getSamplesin 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:
getThresholdin interfaceIsDefaultDecimation- Returns:
- the number of samples in the current axis range is above this value, the decimation will be triggered
-
-