How to use the @antv/x6.Cell 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
shape: 'swimlane',
        align: 'center',
        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 / sidebar-data.ts View on Github external
label: '«interface»<br><b>Name</b>',
        tags: `${umlTags} interface object instance annotated annotation`,
        width: 110,
        height: 50,
        style: {
          shape: 'rectangle',
          htmlLabel: true,
        },
      },
    ].map(data =&gt; ({
      data,
      render: getRenderer(data),
    })),
  )

  const field = new Cell('+ field: type', new Geometry(0, 0, 100, 20), {
    fill: 'none',
    stroke: 'none',
    align: 'left',
    verticalAlign: 'top',
    spacingLeft: 4,
    spacingRight: 4,
    overflow: 'hidden',
    rotatable: false,
    portAnchor: 'eastwest',
  })
  field.asNode(true)

  const divider = new Cell('', new Geometry(0, 0, 40, 8), {
    shape: 'line',
    strokeWidth: 1,
    fill: 'none',
github antvis / x6 / examples / x6-example-drawio / src / pages / graph / sidebar-data.ts View on Github external
)

  const field = new Cell('+ field: type', new Geometry(0, 0, 100, 20), {
    fill: 'none',
    stroke: 'none',
    align: 'left',
    verticalAlign: 'top',
    spacingLeft: 4,
    spacingRight: 4,
    overflow: 'hidden',
    rotatable: false,
    portAnchor: 'eastwest',
  })
  field.asNode(true)

  const divider = new Cell('', new Geometry(0, 0, 40, 8), {
    shape: 'line',
    strokeWidth: 1,
    fill: 'none',
    align: 'left',
    verticalAlign: 'middle',
    spacingTop: -1,
    spacingLeft: 3,
    spacingRight: 3,
    rotatable: false,
    labelPosition: 'right',
    portAnchor: 'eastwest',
  })
  divider.asNode(true)

  const createItem = (fn: () => PaletteItem) => {
    items.push(fn())