Class SankeyDataset
- java.lang.Object
-
- org.pepstock.charba.client.commons.NativeObjectContainer
-
- org.pepstock.charba.client.commons.AbstractNode
-
- org.pepstock.charba.client.data.Dataset
-
- org.pepstock.charba.client.sankey.SankeyDataset
-
- All Implemented Interfaces:
HasCallbackScope
,HasDataset
,IsDefaultAnimationContainer
,IsDefaultAnimationTransition
,HasAnimationOptions
public final class SankeyDataset extends Dataset
Sankey charts are a type of flow diagram in which the width of the arrows is proportional to the flow rate.
Sankey diagrams emphasize the major transfers or flows within a system.
They help locate the most important contributions to a flow.
They often show conserved quantities within defined system boundaries.- Author:
- Andrea "Stock" Stocchero
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SankeyDataset.DataPointFactory
Factory to create a sankey data point from a native object, used for array container lists.-
Nested classes/interfaces inherited from class org.pepstock.charba.client.data.Dataset
Dataset.CanvasObjectProperty, Dataset.CommonProperty
-
-
Field Summary
Fields Modifier and Type Field Description static SankeyDataset.DataPointFactory
DATAPOINTS_FACTORY
Factory to createSankeyDataPoint
s.static String
DEFAULT_BORDER_COLOR
Default element border color,HtmlColor.BLACK
.static int
DEFAULT_BORDER_WIDTH
Default element border width, 1.static String
DEFAULT_COLOR
Default element color,HtmlColor.BLACK
.static String
DEFAULT_COLOR_FROM
Default starting color,HtmlColor.RED
.static String
DEFAULT_COLOR_TO
Default ending color,HtmlColor.GREEN
.static int
DEFAULT_NODE_WIDTH
Default element width, 10.-
Fields inherited from class org.pepstock.charba.client.data.Dataset
DEFAULT_HIDDEN, DEFAULT_NORMALIZED, DEFAULT_PARSING
-
-
Constructor Summary
Constructors Constructor Description SankeyDataset()
Creates a data set.
It uses the global options has default.SankeyDataset(IsDefaultOptions defaultValues)
Creates a data set setting the defaults value.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IsColor
getBorderColor()
Returns the border color of the sankey elements.String
getBorderColorAsString()
Returns the border color of the sankey elements.int
getBorderWidth()
Returns the width of the border in pixels of sankey elements.double
getClip()
Returns alwaysUndefined.DOUBLE
because is always disabled.Clip
getClipAsObject()
Returns alwaysClip
instance withUndefined.DOUBLE
because is always disabled.IsColor
getColor()
Returns the font color of the sankey elements.String
getColorAsString()
Returns the font color of the sankey elements.List<IsColor>
getColorFrom()
Returns the starting color of the flow between sankey elements.List<String>
getColorFromAsString()
Returns the starting color of the flow between sankey elements.ColorCallback<DatasetContext>
getColorFromCallback()
Returns the color "from" callback, if set, otherwisenull
.ColorMode
getColorMode()
Returns the color mode between sankey elements.ColorModeCallback
getColorModeCallback()
Returns the color mode callback, if set, otherwisenull
.List<IsColor>
getColorTo()
Returns the ending color of the flow between sankey elements.List<String>
getColorToAsString()
Returns the ending color of the flow between sankey elements.ColorCallback<DatasetContext>
getColorToCallback()
Returns the color "to" callback, if set, otherwisenull
.Column
getColumn()
Returns the map for assigning the start or ending position to the sankey elements.List<Double>
getData(boolean binding)
Throws an exception because not available.List<SankeyDataPoint>
getDataPoints()
Returns the sankey data property of a dataset for a chart is specified as an array of sankey data pointsList<SankeyDataPoint>
getDataPoints(boolean binding)
Returns the sankey data property of a dataset for a chart is specified as an array of sankey data pointsIsFont
getFont()
Returns the font object.FontCallback<DatasetContext>
getFontCallback()
Returns the font callback, if set, otherwisenull
.Labels
getLabels()
Returns the map for labeling the sankey elements.int
getNodeWidth()
Returns the width of sankey elements.double
getPadding()
Returns the padding between the top of the node and the first label to draw, when multiple lines for labels are set, in pixels.PaddingCallback
getPaddingCallback()
Returns the padding callback, if set, otherwisenull
.Priority
getPriority()
Returns the map for assigning a priority to the sankey elements.Size
getSize()
ReturnsSize.MIN
if flow overlap is preferred.SizeCallback
getSizeCallback()
Returns the size callback, if set, otherwisenull
.void
setBorderColor(String borderColor)
Sets the border color of the sankey elements.void
setBorderColor(IsColor borderColor)
Sets the border color of the sankey elements.void
setBorderWidth(int borderWidth)
Sets the width of the border in pixels of sankey elements.void
setClip(boolean clip)
Sets how to clip relative to the chart area.
Iffalse
allows overflow, otherwisetrue
clips that many pixels inside the chart area.void
setClip(double clip)
Sets how to clip relative to the chart area.
This is ignored in order to disable clipping.void
setClip(Clip clip)
Sets how to clip relative to the chart area.
This is ignored in order to disable clipping.void
setColor(String color)
Sets the font color of the sankey elements.void
setColor(IsColor color)
Sets the font color of the sankey elements.void
setColorFrom(String... colors)
Sets the starting color of the flow between sankey elements.void
setColorFrom(ColorCallback<DatasetContext> colorCallback)
Sets the color "from" callback.void
setColorFrom(NativeCallback colorCallback)
Sets the color "from" callback.void
setColorFrom(IsColor... colors)
Sets the starting color of the flow between sankey elements.void
setColorMode(NativeCallback colorModeCallback)
Sets the color mode callback.void
setColorMode(ColorModeCallback colorModeCallback)
Sets the color mode callback.void
setColorMode(ColorMode colorMode)
Sets the color mode between sankey elements.void
setColorTo(String... colors)
Sets the ending color of the flow between sankey elements.void
setColorTo(ColorCallback<DatasetContext> colorCallback)
Sets the color "to" callback.void
setColorTo(NativeCallback colorCallback)
Sets the color "to" callback.void
setColorTo(IsColor... colors)
Sets the ending color of the flow between sankey elements.void
setColumn(Column column)
Sets the map for assigning the start or ending position to the sankey elements.void
setData(double... values)
Throws an exception because not available.void
setData(List<Double> values)
Throws an exception because not available.void
setDataPoints(List<SankeyDataPoint> datapoints)
Sets the data property of a data set for a chart is specified as an array of data points.void
setDataPoints(SankeyDataPoint... datapoints)
Sets the data property of a data set for a chart is specified as an array of data points.void
setFont(FontCallback<DatasetContext> fontCallback)
Sets the font callback.void
setFont(NativeCallback fontCallback)
Sets the font callback.void
setLabels(Labels labels)
Sets the map for labeling the sankey elements.void
setNodeWidth(int nodeWidth)
Sets the width of sankey elements.void
setPadding(double padding)
Sets the padding between the top of the node and the first label to draw, when multiple lines for labels are set, in pixels.void
setPadding(NativeCallback paddingCallback)
Sets the padding callback.void
setPadding(PaddingCallback paddingCallback)
Sets the padding callback.void
setParsing(boolean parsing)
Sets how to parse the data set.
This is ignored because it must alwasy set totrue
.void
setPriority(Priority priority)
Sets the map for assigning a priority to the sankey elements.void
setSize(NativeCallback sizeCallback)
Sets the size callback.void
setSize(SizeCallback sizeCallback)
Sets the size callback.void
setSize(Size size)
SetsSize.MIN
if flow overlap is preferred.-
Methods inherited from class org.pepstock.charba.client.data.Dataset
createContext, getAnimationContainer, getBackgroundColorCallback, getBorderColorCallback, getData, getDataCount, getDataset, getDataType, getDefaultBackgroundColorAsString, getDefaultBorderColorAsString, getDefaultBorderWidth, getDefaultHoverBackgroundColorAsString, getDefaultHoverBorderColorAsString, getDefaultHoverBorderWidth, getDefaultValues, getHoverBackgroundColorCallback, getHoverBorderColorCallback, getId, getLabel, getOptions, getOptions, getScope, getType, getTypedDataset, hasOptions, invokeColorCallback, isClip, isHidden, isNormalized, isParsing, removeOptions, setBackgroundColor, setBackgroundColor, setBorderColor, setBorderColor, setHidden, setHoverBackgroundColor, setHoverBackgroundColor, setHoverBorderColor, setHoverBorderColor, setLabel, setNormalized, setOptions, setOptions
-
Methods inherited from class org.pepstock.charba.client.commons.AbstractNode
checkAndAddToParent, getChildKey, getParentNode, getRootNode, retrieveRoot, setArrayValueAndAddToParent, setArrayValueAndAddToParent, setArrayValueAndAddToParent, setElementAndAddToParent, setInternalCallbackToModel, setInternalCallbackToModel, 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, 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
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.pepstock.charba.client.options.HasAnimationOptions
getAnimation, getAnimations, getTransitions, isAnimationEnabled, setAnimationEnabled
-
-
-
-
Field Detail
-
DATAPOINTS_FACTORY
public static final SankeyDataset.DataPointFactory DATAPOINTS_FACTORY
Factory to createSankeyDataPoint
s.
-
DEFAULT_COLOR_FROM
public static final String DEFAULT_COLOR_FROM
Default starting color,HtmlColor.RED
.
-
DEFAULT_COLOR_TO
public static final String DEFAULT_COLOR_TO
Default ending color,HtmlColor.GREEN
.
-
DEFAULT_COLOR
public static final String DEFAULT_COLOR
Default element color,HtmlColor.BLACK
.
-
DEFAULT_BORDER_COLOR
public static final String DEFAULT_BORDER_COLOR
Default element border color,HtmlColor.BLACK
.
-
DEFAULT_BORDER_WIDTH
public static final int DEFAULT_BORDER_WIDTH
Default element border width, 1.- See Also:
- Constant Field Values
-
DEFAULT_NODE_WIDTH
public static final int DEFAULT_NODE_WIDTH
Default element width, 10.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
SankeyDataset
public SankeyDataset()
Creates a data set.
It uses the global options has default.
-
SankeyDataset
public SankeyDataset(IsDefaultOptions defaultValues)
Creates a data set setting the defaults value.- Parameters:
defaultValues
- default options
-
-
Method Detail
-
getFont
public IsFont getFont()
Returns the font object.- Returns:
- the font object.
-
setLabels
public void setLabels(Labels labels)
Sets the map for labeling the sankey elements.- Parameters:
labels
- the map for labeling the sankey elements
-
getLabels
public Labels getLabels()
Returns the map for labeling the sankey elements.- Returns:
- the map for labeling the sankey elements
-
setPriority
public void setPriority(Priority priority)
Sets the map for assigning a priority to the sankey elements.- Parameters:
priority
- the map for assigning a priority to the sankey elements
-
getPriority
public Priority getPriority()
Returns the map for assigning a priority to the sankey elements.- Returns:
- the map for assigning a priority to the sankey elements
-
setColumn
public void setColumn(Column column)
Sets the map for assigning the start or ending position to the sankey elements.- Parameters:
column
- the map for assigning the start or ending position to the sankey elements
-
getColumn
public Column getColumn()
Returns the map for assigning the start or ending position to the sankey elements.- Returns:
- the map for assigning the start or ending position to the sankey elements
-
setDataPoints
public void setDataPoints(SankeyDataPoint... datapoints)
Sets the data property of a data set for a chart is specified as an array of data points.- Parameters:
datapoints
- an array of data points
-
setDataPoints
public void setDataPoints(List<SankeyDataPoint> datapoints)
Sets the data property of a data set for a chart is specified as an array of data points.- Parameters:
datapoints
- a list of data points
-
getDataPoints
public List<SankeyDataPoint> getDataPoints()
Returns the sankey data property of a dataset for a chart is specified as an array of sankey data points- Returns:
- a list of sankey data points or an empty list of data points.
-
getDataPoints
public List<SankeyDataPoint> getDataPoints(boolean binding)
Returns the sankey data property of a dataset for a chart is specified as an array of sankey data points- Parameters:
binding
- iftrue
binds the new array list in the container- Returns:
- a list of sankey data points or an empty list of data points
-
setSize
public void setSize(Size size)
SetsSize.MIN
if flow overlap is preferred.- Parameters:
size
-Size.MIN
if flow overlap is preferred
-
getSize
public Size getSize()
ReturnsSize.MIN
if flow overlap is preferred.- Returns:
Size.MIN
if flow overlap is preferred
-
setColorMode
public void setColorMode(ColorMode colorMode)
Sets the color mode between sankey elements.- Parameters:
colorMode
- the color mode between sankey elements
-
getColorMode
public ColorMode getColorMode()
Returns the color mode between sankey elements.- Returns:
- the color mode between sankey elements
-
setColorFrom
public void setColorFrom(IsColor... colors)
Sets the starting color of the flow between sankey elements.- Parameters:
colors
- the starting color of the flow between sankey elements
-
setColorFrom
public void setColorFrom(String... colors)
Sets the starting color of the flow between sankey elements.- Parameters:
colors
- the starting color of the flow between sankey elements
-
getColorFromAsString
public List<String> getColorFromAsString()
Returns the starting color of the flow between sankey elements.- Returns:
- list of the starting color of the flow between sankey elements
-
getColorFrom
public List<IsColor> getColorFrom()
Returns the starting color of the flow between sankey elements.- Returns:
- list of the starting color of the flow between sankey elements
-
setColorTo
public void setColorTo(IsColor... colors)
Sets the ending color of the flow between sankey elements.- Parameters:
colors
- the ending color of the flow between sankey elements
-
setColorTo
public void setColorTo(String... colors)
Sets the ending color of the flow between sankey elements.- Parameters:
colors
- the ending color of the flow between sankey elements
-
getColorToAsString
public List<String> getColorToAsString()
Returns the ending color of the flow between sankey elements.- Returns:
- list of the ending color of the flow between sankey elements
-
getColorTo
public List<IsColor> getColorTo()
Returns the ending color of the flow between sankey elements.- Returns:
- list of the ending color of the flow between sankey elements
-
setBorderColor
public void setBorderColor(IsColor borderColor)
Sets the border color of the sankey elements.- Parameters:
borderColor
- the border color of the sankey elements
-
setBorderColor
public void setBorderColor(String borderColor)
Sets the border color of the sankey elements.- Parameters:
borderColor
- the border color of the sankey elements
-
getBorderColorAsString
public String getBorderColorAsString()
Returns the border color of the sankey elements.- Returns:
- the border color of the sankey elements
-
getBorderColor
public IsColor getBorderColor()
Returns the border color of the sankey elements.- Returns:
- list of the border color of the sankey elements
-
setColor
public void setColor(IsColor color)
Sets the font color of the sankey elements.- Parameters:
color
- the font color of the sankey elements
-
setColor
public void setColor(String color)
Sets the font color of the sankey elements.- Parameters:
color
- the font color of the sankey elements
-
getColorAsString
public String getColorAsString()
Returns the font color of the sankey elements.- Returns:
- the font color of the sankey elements
-
getColor
public IsColor getColor()
Returns the font color of the sankey elements.- Returns:
- the font color of the sankey elements
-
setBorderWidth
public void setBorderWidth(int borderWidth)
Sets the width of the border in pixels of sankey elements.- Parameters:
borderWidth
- the width of the border in pixels of sankey elements
-
getBorderWidth
public int getBorderWidth()
Returns the width of the border in pixels of sankey elements.- Returns:
- the width of the border in pixels of sankey elements
-
setNodeWidth
public void setNodeWidth(int nodeWidth)
Sets the width of sankey elements.- Parameters:
nodeWidth
- the width of sankey elements
-
getNodeWidth
public int getNodeWidth()
Returns the width of sankey elements.- Returns:
- the width of sankey elements
-
setPadding
public void setPadding(double padding)
Sets the padding between the top of the node and the first label to draw, when multiple lines for labels are set, in pixels.- Parameters:
padding
- the padding between the top of the node and the first label to draw, when multiple lines for labels are set, in pixels
-
getPadding
public double getPadding()
Returns the padding between the top of the node and the first label to draw, when multiple lines for labels are set, in pixels.- Returns:
- the padding between the top of the node and the first label to draw, when multiple lines for labels are set, in pixels.
-
getColorFromCallback
public ColorCallback<DatasetContext> getColorFromCallback()
Returns the color "from" callback, if set, otherwisenull
.- Returns:
- the color "from" callback, if set, otherwise
null
.
-
setColorFrom
public void setColorFrom(ColorCallback<DatasetContext> colorCallback)
Sets the color "from" callback.- Parameters:
colorCallback
- the color "from" callback.
-
setColorFrom
public void setColorFrom(NativeCallback colorCallback)
Sets the color "from" callback.- Parameters:
colorCallback
- the color "from" callback.
-
getColorToCallback
public ColorCallback<DatasetContext> getColorToCallback()
Returns the color "to" callback, if set, otherwisenull
.- Returns:
- the color "to" callback, if set, otherwise
null
.
-
setColorTo
public void setColorTo(ColorCallback<DatasetContext> colorCallback)
Sets the color "to" callback.- Parameters:
colorCallback
- the color "to" callback.
-
setColorTo
public void setColorTo(NativeCallback colorCallback)
Sets the color "to" callback.- Parameters:
colorCallback
- the color "to" callback.
-
getColorModeCallback
public ColorModeCallback getColorModeCallback()
Returns the color mode callback, if set, otherwisenull
.- Returns:
- the color mode callback, if set, otherwise
null
.
-
setColorMode
public void setColorMode(ColorModeCallback colorModeCallback)
Sets the color mode callback.- Parameters:
colorModeCallback
- the color mode callback.
-
setColorMode
public void setColorMode(NativeCallback colorModeCallback)
Sets the color mode callback.- Parameters:
colorModeCallback
- the color mode callback.
-
getSizeCallback
public SizeCallback getSizeCallback()
Returns the size callback, if set, otherwisenull
.- Returns:
- the size callback, if set, otherwise
null
.
-
setSize
public void setSize(SizeCallback sizeCallback)
Sets the size callback.- Parameters:
sizeCallback
- the size callback.
-
setSize
public void setSize(NativeCallback sizeCallback)
Sets the size callback.- Parameters:
sizeCallback
- the size callback.
-
getPaddingCallback
public PaddingCallback getPaddingCallback()
Returns the padding callback, if set, otherwisenull
.- Returns:
- the padding callback, if set, otherwise
null
.
-
setPadding
public void setPadding(PaddingCallback paddingCallback)
Sets the padding callback.- Parameters:
paddingCallback
- the padding callback.
-
setPadding
public void setPadding(NativeCallback paddingCallback)
Sets the padding callback.- Parameters:
paddingCallback
- the padding callback.
-
getFontCallback
public FontCallback<DatasetContext> getFontCallback()
Returns the font callback, if set, otherwisenull
.- Returns:
- the font callback, if set, otherwise
null
.
-
setFont
public void setFont(FontCallback<DatasetContext> fontCallback)
Sets the font callback.- Parameters:
fontCallback
- the font callback.
-
setFont
public void setFont(NativeCallback fontCallback)
Sets the font callback.- Parameters:
fontCallback
- the font callback.
-
setParsing
public void setParsing(boolean parsing)
Sets how to parse the data set.
This is ignored because it must alwasy set totrue
.- Overrides:
setParsing
in classDataset
- Parameters:
parsing
- how to parse the data set.
This is ignored because it must alwasy set totrue
.
-
setClip
public void setClip(boolean clip)
Sets how to clip relative to the chart area.
Iffalse
allows overflow, otherwisetrue
clips that many pixels inside the chart area.
-
setClip
public void setClip(double clip)
Sets how to clip relative to the chart area.
This is ignored in order to disable clipping.
-
setClip
public void setClip(Clip clip)
Sets how to clip relative to the chart area.
This is ignored in order to disable clipping.
-
getClip
public double getClip()
Returns alwaysUndefined.DOUBLE
because is always disabled.- Overrides:
getClip
in classDataset
- Returns:
- returns always
Undefined.DOUBLE
because is always disabled.
-
getClipAsObject
public Clip getClipAsObject()
Returns alwaysClip
instance withUndefined.DOUBLE
because is always disabled.- Overrides:
getClipAsObject
in classDataset
- Returns:
- always
Clip
instance withUndefined.DOUBLE
because is always disabled.
-
setData
public void setData(double... values)
Throws an exception because not available.
-
-