logo

X6

  • Tutorials
  • API
  • Examples
  • Q&A
  • Change Log
  • XFlow
  • Productsantv logo arrow
  • 2.x
  • Graph
    • Graph
    • Grid
    • Background
    • Panning
    • Mousewheel
    • Viewport Transformation
    • Coordinate Systems
  • Element
    • Cell
    • Node
    • Edge
    • Labels
    • Arrow
    • Element Attributes
    • Interaction
  • MVC
    • Model
    • View
  • Extension
    • Node Tools
    • Edge Tools
    • Routing
    • Connector
    • Node Anchor
    • Edge Anchor
    • Connection Point
    • Port Layout Algorithm
    • Port Label Layout
    • Attributes
    • Highlighter
    • Filter

Graph

Next
Grid

Resource

Ant Design
Galacea Effects
Umi-React Application Framework
Dumi-Component doc generator
ahooks-React Hooks Library
WeaveFox-AI Coding Assistant

Community

Ant Financial Experience Tech
seeconfSEE Conf-Experience Tech Conference
weavefoxWeaveFox-AI Developer Community

Help

GitHub
StackOverflow

more productsMore Productions

Ant DesignAnt Design-Enterprise UI design language
yuqueYuque-Knowledge creation and Sharing tool
EggEgg-Enterprise-class Node development framework
kitchenKitchen-Sketch Tool set
GalaceanGalacean-Interactive solution
weavefoxWeaveFox-AI Coding Assistant
© Copyright 2025 Ant Group Co., Ltd..备案号:京ICP备15032932号-38

Loading...

Configuration

new Graph(options: Options)
OptionTypeRequiredDescriptionDefault Value
containerHTMLElement✓The container of the canvas.
widthnumberThe width of the canvas, defaults to the container width.-
heightnumberThe height of the canvas, defaults to the container height.-
scaling{ min?: number, max?: number }The minimum and maximum zoom levels of the canvas.{ min: 0.01, max: 16 }
autoResizeboolean | Element | DocumentWhether to listen to container size changes and automatically update the canvas size.false
panningboolean | PanningManager.OptionsWhether the canvas can be panned, defaults to disabled.false
mousewheelboolean | MouseWheel.OptionsWhether the mouse wheel can zoom, defaults to disabled.false
gridboolean | number | GridManager.OptionsThe grid, defaults to a 10px grid but does not draw the grid background.false
backgroundfalse | BackgroundManager.OptionsThe background, defaults to not drawing the background.false
translatingTranslating.OptionsRestricts node movement. After a node is moved, automatically offset when it overlaps with other nodes.{ restrict: false, autoOffset: true }
embeddingboolean | Embedding.OptionsWhether to enable nested nodes, defaults to disabled.false
connectingConnecting.OptionsThe connection options.{ snap: false, ... }
highlightingHighlighting.OptionsThe highlighting options.{...}
interactingInteracting.OptionsCustomizes the interaction behavior of nodes and edges.{ edgeLabelMovable: false }
magnetThresholdnumber | onleaveThe number of times the mouse can move before triggering a connection, or set to onleave to trigger a connection when the mouse leaves an element.0
moveThresholdnumberThe number of times the mouse can move before triggering a mousemove event.0
clickThresholdnumberWhen the mouse moves more than the specified number of times, the mouse click event will not be triggered.0
preventDefaultContextMenubooleanWhether to disable the browser's default right-click menu.true
preventDefaultBlankActionbooleanWhether to disable the default mouse behavior when clicking on a blank area of the canvas.true
asyncbooleanWhether to render asynchronously.true
virtualbooleanWhether to only render the visible area of the canvas.false
onPortRendered(args: OnPortRenderedArgs) => voidThe callback triggered when a port is rendered.-
onEdgeLabelRendered(args: OnEdgeLabelRenderedArgs) => voidThe callback triggered when an edge label is rendered.-
createCellView(cell: Cell) => CellView | null | undefinedCustomizes the view of a cell.-