Skip to content

Renders as zero width #17

@AndrewRayCode

Description

@AndrewRayCode

When I render a graph following the readme, and put the graph in a dom node with a set width and height, the graph is rendered with 0 width and height:

<div style="width: 600px; height: 600px;">
<div class="pcui-element font-regular pcui-graph joint-paper joint-theme-default" style="background-color: rgb(32, 41, 43); width: 0px; height: 0px;">
...
</div>
</div>

If I manually expand the graph size manually in the chrome inspector, it shows the grid with mouse interactivity, however neither of the two nodes show up in the graph that i can find.

I'm doing this in React, but react isn't doing anything here, I'm following the readme:

useEffect(() => {
    const schema = {
      nodes: {
        0: {
          name: 'Hello',
          fill: 'red',
        },
        1: {
          name: 'World',
          fill: 'green',
        },
      },
      edges: {
        0: {
          from: [0], // this edge can connect nodes of type 0
          to: [1], // to nodes of type 1,
          stroke: 'blue',
        },
      },
    };

    const graph = new PcGraph(schema);
    if (graphRef.current) {
      graphRef.current.appendChild(graph.dom);
    }
  }, [graphRef]);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions