Package com.oorian.echarts.options
Class EChartsGraphSeries
java.lang.Object
com.oorian.echarts.options.EChartsSeries
com.oorian.echarts.options.EChartsGraphSeries
- All Implemented Interfaces:
com.oorian.json.Jsonable
Represents a graph series configuration for ECharts graph/network charts.
Extends EChartsSeries to provide graph-specific options for node-link relationship visualization.
Graph charts are useful for displaying:
- Social networks
- Knowledge graphs
- Dependency relationships
- Any node-link data structures
- Author:
- Oorian
-
Field Summary
Fields inherited from class com.oorian.echarts.options.EChartsSeries
data, name, type -
Constructor Summary
ConstructorsConstructorDescriptionConstructs a new EChartsGraphSeries with type set to "graph". -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCategory(String name) Adds a category for node grouping.voidAdds a link between two nodes.voidAdds a link with value between two nodes.voidAdds a node to the graph.voidAdds a node with category to the graph.voidAdds a node with position to the graph.protected voidaddSpecificToJson(com.oorian.json.JsonObject obj) Adds series-specific properties to a JSON object.configureForce(Number repulsion, Number edgeLength) Creates and configures the force layout.com.oorian.json.JsonArrayGets the categories.Gets the circular setting.Gets the cursor style.Gets the draggable setting.Gets the edge label configuration.Gets the edge symbol.com.oorian.json.JsonArrayGets the edge symbol size.Gets the emphasis configuration.com.oorian.json.JsonObjectgetForce()Gets the force configuration.Gets the item style configuration.getLabel()Gets the label configuration.Gets the layout type.Gets the line style configuration.List<com.oorian.json.JsonObject> getLinks()Gets the links.Gets the node scale ratio.getRoam()Gets the roam setting.protected voidinitSpecificFromJson(com.oorian.json.JsonObject obj) Initializes series-specific properties from a JSON object.voidsetCircular(Boolean circular) Sets whether to use circular layout.voidSets the cursor style.voidsetDraggable(Boolean draggable) Sets whether nodes are draggable.voidsetEdgeLabel(EChartsLabel edgeLabel) Sets the label configuration for edges.voidsetEdgeSymbol(String edgeSymbol) Sets the edge symbols.voidsetEdgeSymbolSize(Number startSize, Number endSize) Sets the edge symbol size.voidsetEmphasis(EChartsEmphasis emphasis) Sets the emphasis configuration for highlighted elements.voidsetForce(com.oorian.json.JsonObject force) Sets the force layout configuration.voidsetItemStyle(EChartsItemStyle itemStyle) Sets the item style configuration for nodes.voidsetLabel(EChartsLabel label) Sets the label configuration for nodes.voidSets the layout algorithm for the graph.voidsetLineStyle(EChartsLineStyle lineStyle) Sets the line style configuration for edges.voidsetNodeScaleRatio(Number nodeScaleRatio) Sets the scale ratio when zooming.voidSets whether roaming (panning/zooming) is enabled.Methods inherited from class com.oorian.echarts.options.EChartsSeries
addData, getData, getName, getType, initFromJson, parseDataArray, setData, setName, setType, toJsonString, toJsonValueMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.oorian.json.Jsonable
initFromJson, initFromJson
-
Constructor Details
-
EChartsGraphSeries
public EChartsGraphSeries()Constructs a new EChartsGraphSeries with type set to "graph".
-
-
Method Details
-
addNode
Adds a node to the graph.- Parameters:
name- the node namevalue- the node value (optional, can be null)
-
addNode
Adds a node with category to the graph.- Parameters:
name- the node namevalue- the node valuecategory- the category index
-
addNode
Adds a node with position to the graph.- Parameters:
name- the node namevalue- the node valuex- the x positiony- the y position
-
addLink
Adds a link between two nodes.- Parameters:
source- the source node nametarget- the target node name
-
addLink
Adds a link with value between two nodes.- Parameters:
source- the source node nametarget- the target node namevalue- the link value (for edge weight)
-
addCategory
Adds a category for node grouping.- Parameters:
name- the category name
-
setLayout
Sets the layout algorithm for the graph.- Parameters:
layout- the layout type ('none', 'circular', or 'force')
-
setCircular
Sets whether to use circular layout.- Parameters:
circular- true for circular layout
-
setForce
public void setForce(com.oorian.json.JsonObject force) Sets the force layout configuration.- Parameters:
force- the force configuration object
-
configureForce
Creates and configures the force layout.- Parameters:
repulsion- the repulsion force between nodesedgeLength- the length of edges- Returns:
- this series for chaining
-
setRoam
Sets whether roaming (panning/zooming) is enabled.- Parameters:
roam- true to enable roaming
-
setNodeScaleRatio
Sets the scale ratio when zooming.- Parameters:
nodeScaleRatio- the scale ratio
-
setDraggable
Sets whether nodes are draggable.- Parameters:
draggable- true to enable dragging
-
setEdgeSymbol
Sets the edge symbols.- Parameters:
edgeSymbol- the edge symbol configuration
-
setEdgeSymbolSize
Sets the edge symbol size.- Parameters:
startSize- the size at the start of the edgeendSize- the size at the end of the edge
-
setCursor
Sets the cursor style.- Parameters:
cursor- the cursor style
-
setItemStyle
Sets the item style configuration for nodes.- Parameters:
itemStyle- the item style configuration
-
setLineStyle
Sets the line style configuration for edges.- Parameters:
lineStyle- the line style configuration
-
setEmphasis
Sets the emphasis configuration for highlighted elements.- Parameters:
emphasis- the emphasis configuration
-
setLabel
Sets the label configuration for nodes.- Parameters:
label- the label configuration
-
setEdgeLabel
Sets the label configuration for edges.- Parameters:
edgeLabel- the edge label configuration
-
getLayout
Gets the layout type.- Returns:
- the layout type
-
getCircular
Gets the circular setting.- Returns:
- true if circular layout is enabled
-
getForce
public com.oorian.json.JsonObject getForce()Gets the force configuration.- Returns:
- the force configuration
-
getRoam
Gets the roam setting.- Returns:
- true if roaming is enabled
-
getNodeScaleRatio
Gets the node scale ratio.- Returns:
- the scale ratio
-
getDraggable
Gets the draggable setting.- Returns:
- true if nodes are draggable
-
getEdgeSymbol
Gets the edge symbol.- Returns:
- the edge symbol
-
getEdgeSymbolSize
public com.oorian.json.JsonArray getEdgeSymbolSize()Gets the edge symbol size.- Returns:
- the edge symbol size array
-
getCursor
Gets the cursor style.- Returns:
- the cursor style
-
getItemStyle
Gets the item style configuration.- Returns:
- the item style configuration
-
getLineStyle
Gets the line style configuration.- Returns:
- the line style configuration
-
getEmphasis
Gets the emphasis configuration.- Returns:
- the emphasis configuration
-
getLabel
Gets the label configuration.- Returns:
- the label configuration
-
getEdgeLabel
Gets the edge label configuration.- Returns:
- the edge label configuration
-
getCategories
public com.oorian.json.JsonArray getCategories()Gets the categories.- Returns:
- the categories array
-
getLinks
Gets the links.- Returns:
- the links list
-
initSpecificFromJson
protected void initSpecificFromJson(com.oorian.json.JsonObject obj) Description copied from class:EChartsSeriesInitializes series-specific properties from a JSON object.Subclasses must implement this method to handle their specific properties.
- Specified by:
initSpecificFromJsonin classEChartsSeries- Parameters:
obj- the JSON object containing series properties
-
addSpecificToJson
protected void addSpecificToJson(com.oorian.json.JsonObject obj) Description copied from class:EChartsSeriesAdds series-specific properties to a JSON object.Subclasses must implement this method to serialize their specific properties.
- Specified by:
addSpecificToJsonin classEChartsSeries- Parameters:
obj- the JSON object to add properties to
-