HTMLGraph

Edges Configuration

    
const element = document.getElementById('canvas');

const canvas = new CanvasBuilder()
  .setElement(element)
  .setDefaults({
    edges: {
      shape: {
        type: "bezier",
        color: "#000",
        hasTargetArrow: true,
      },
      priority: "incremental",
    },
  })
  .build();

  

EdgesConfig Fields

NameTypeDescriptionRequiredDefault
shapeShapeConfigDefault edge shape configurationno{}
priorityPriorityDefault edge priorityno0

ShapeConfig Options

NameConfigurationExample
BezierBezierShape{ type: "bezier" }
StraightStraightShape{ type: "straight" }
HorizontalHorizontalShape{ type: "horizontal" }
VerticalVerticalShape{ type: "vertical" }
CustomCustomShape() => new CustomEdgeShape()

Priority Options

TypeDescriptionExample
numberEach edge is assigned a constant Z-index5
"incremental"Each subsequent edge receives an incremented Z-index"incremental"
functionZ-index is determined by a specified function() => 10 + i++;