How to use the @antv/x6.Geometry function in @antv/x6

To help you get started, we’ve selected a few @antv/x6 examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github antvis / x6 / examples / x6-example-drawio / src / pages / graph / sidebar-data.ts View on Github external
verticalAlign: 'top',
        childLayout: 'stackLayout',
        horizontal: true,
        startSize: 26,
        horizontalStack: 0,
        resizeParent: true,
        resizeParentMax: 0,
        resizeLast: 0,
        collapsible: 1,
        marginBottom: 0,
      },
    }

    const cell = new Cell(
      'Classname',
      new Geometry(0, 0, data.width, data.height),
      data.style,
    )

    cell.asNode(true)
    // cell.insertChild(field.clone())
    // cell.insertChild(divider.clone())

    return {
      data,
      render: getRendererForCells([cell]),
    }
  })
github antvis / x6 / examples / x6-example-drawio / src / pages / graph / format-cell.tsx View on Github external
updateSize(w: number, h: number) {
    const geom = new Geometry(this.state.x, this.state.y, w, h)
    this.executeCommand('updateGeometry', geom)
    this.setState({ w, h })
  }
github antvis / x6 / examples / x6-example-drawio / src / pages / graph / format-cell.tsx View on Github external
onLeftChanged = (x: number) => {
    if (x != null) {
      this.setState({ x })
      this.executeCommand(
        'updateGeometry',
        new Geometry(x, this.state.y, this.state.w, this.state.h),
      )
    }
  }
github antvis / x6 / examples / x6-example-drawio / src / pages / graph / format-cell.tsx View on Github external
onTopChanged = (y: number) => {
    if (y != null) {
      this.setState({ y })
      this.executeCommand(
        'updateGeometry',
        new Geometry(this.state.x, y, this.state.w, this.state.h),
      )
    }
  }