Class EChartsGraphSeries

java.lang.Object
com.oorian.echarts.options.EChartsSeries
com.oorian.echarts.options.EChartsGraphSeries
All Implemented Interfaces:
com.oorian.json.Jsonable

public class EChartsGraphSeries extends EChartsSeries
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
  • Constructor Details

    • EChartsGraphSeries

      public EChartsGraphSeries()
      Constructs a new EChartsGraphSeries with type set to "graph".
  • Method Details

    • addNode

      public void addNode(String name, Number value)
      Adds a node to the graph.
      Parameters:
      name - the node name
      value - the node value (optional, can be null)
    • addNode

      public void addNode(String name, Number value, int category)
      Adds a node with category to the graph.
      Parameters:
      name - the node name
      value - the node value
      category - the category index
    • addNode

      public void addNode(String name, Number value, Number x, Number y)
      Adds a node with position to the graph.
      Parameters:
      name - the node name
      value - the node value
      x - the x position
      y - the y position
    • addLink

      public void addLink(String source, String target)
      Adds a link between two nodes.
      Parameters:
      source - the source node name
      target - the target node name
    • addLink

      public void addLink(String source, String target, Number value)
      Adds a link with value between two nodes.
      Parameters:
      source - the source node name
      target - the target node name
      value - the link value (for edge weight)
    • addCategory

      public void addCategory(String name)
      Adds a category for node grouping.
      Parameters:
      name - the category name
    • setLayout

      public void setLayout(String layout)
      Sets the layout algorithm for the graph.
      Parameters:
      layout - the layout type ('none', 'circular', or 'force')
    • setCircular

      public void setCircular(Boolean circular)
      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

      public EChartsGraphSeries configureForce(Number repulsion, Number edgeLength)
      Creates and configures the force layout.
      Parameters:
      repulsion - the repulsion force between nodes
      edgeLength - the length of edges
      Returns:
      this series for chaining
    • setRoam

      public void setRoam(Boolean roam)
      Sets whether roaming (panning/zooming) is enabled.
      Parameters:
      roam - true to enable roaming
    • setNodeScaleRatio

      public void setNodeScaleRatio(Number nodeScaleRatio)
      Sets the scale ratio when zooming.
      Parameters:
      nodeScaleRatio - the scale ratio
    • setDraggable

      public void setDraggable(Boolean draggable)
      Sets whether nodes are draggable.
      Parameters:
      draggable - true to enable dragging
    • setEdgeSymbol

      public void setEdgeSymbol(String edgeSymbol)
      Sets the edge symbols.
      Parameters:
      edgeSymbol - the edge symbol configuration
    • setEdgeSymbolSize

      public void setEdgeSymbolSize(Number startSize, Number endSize)
      Sets the edge symbol size.
      Parameters:
      startSize - the size at the start of the edge
      endSize - the size at the end of the edge
    • setCursor

      public void setCursor(String cursor)
      Sets the cursor style.
      Parameters:
      cursor - the cursor style
    • setItemStyle

      public void setItemStyle(EChartsItemStyle itemStyle)
      Sets the item style configuration for nodes.
      Parameters:
      itemStyle - the item style configuration
    • setLineStyle

      public void setLineStyle(EChartsLineStyle lineStyle)
      Sets the line style configuration for edges.
      Parameters:
      lineStyle - the line style configuration
    • setEmphasis

      public void setEmphasis(EChartsEmphasis emphasis)
      Sets the emphasis configuration for highlighted elements.
      Parameters:
      emphasis - the emphasis configuration
    • setLabel

      public void setLabel(EChartsLabel label)
      Sets the label configuration for nodes.
      Parameters:
      label - the label configuration
    • setEdgeLabel

      public void setEdgeLabel(EChartsLabel edgeLabel)
      Sets the label configuration for edges.
      Parameters:
      edgeLabel - the edge label configuration
    • getLayout

      public String getLayout()
      Gets the layout type.
      Returns:
      the layout type
    • getCircular

      public Boolean 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

      public Boolean getRoam()
      Gets the roam setting.
      Returns:
      true if roaming is enabled
    • getNodeScaleRatio

      public Number getNodeScaleRatio()
      Gets the node scale ratio.
      Returns:
      the scale ratio
    • getDraggable

      public Boolean getDraggable()
      Gets the draggable setting.
      Returns:
      true if nodes are draggable
    • getEdgeSymbol

      public String 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

      public String getCursor()
      Gets the cursor style.
      Returns:
      the cursor style
    • getItemStyle

      public EChartsItemStyle getItemStyle()
      Gets the item style configuration.
      Returns:
      the item style configuration
    • getLineStyle

      public EChartsLineStyle getLineStyle()
      Gets the line style configuration.
      Returns:
      the line style configuration
    • getEmphasis

      public EChartsEmphasis getEmphasis()
      Gets the emphasis configuration.
      Returns:
      the emphasis configuration
    • getLabel

      public EChartsLabel getLabel()
      Gets the label configuration.
      Returns:
      the label configuration
    • getEdgeLabel

      public EChartsLabel 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

      public List<com.oorian.json.JsonObject> getLinks()
      Gets the links.
      Returns:
      the links list
    • initSpecificFromJson

      protected void initSpecificFromJson(com.oorian.json.JsonObject obj)
      Description copied from class: EChartsSeries
      Initializes series-specific properties from a JSON object.

      Subclasses must implement this method to handle their specific properties.

      Specified by:
      initSpecificFromJson in class EChartsSeries
      Parameters:
      obj - the JSON object containing series properties
    • addSpecificToJson

      protected void addSpecificToJson(com.oorian.json.JsonObject obj)
      Description copied from class: EChartsSeries
      Adds series-specific properties to a JSON object.

      Subclasses must implement this method to serialize their specific properties.

      Specified by:
      addSpecificToJson in class EChartsSeries
      Parameters:
      obj - the JSON object to add properties to