joyceworks / flowchart-vue

Flowchart & designer component for Vue.js.
MIT License
345 stars 75 forks source link

Drawing a polygon #42

Closed kilgaloon closed 2 years ago

kilgaloon commented 3 years ago

I want to draw a diamond with following code:

let body = g.append("polygon");
  body.attr("class", "body")
  body.attr("cx", node.x + node.width / 2);
  body.attr("cy", node.y + node.height / 2);
  body.attr("rx", node.width / 2);
  body.attr("ry", node.height / 2);
  body.style("fill", "white");
  body.style("stroke-width", "1px");
  body.attr("points", "69.445,125 125,28.774 180.556,125 125,221.227");
  body.classed(node.type, true);
  body.attr("stroke", borderColor);

This will draw diamond as expected, but the issue here is that now polygon is fixed on and is not affected by drag event. Even, connector dots appear away from the polygon. When I click on polygon and start the drag event, connector dots move but the polygon is not moving.

Am I missing something here?

iamppz commented 3 years ago

Polygon is positioned by its points attribute, maybe you can wrap it with a SVG element.

github-actions[bot] commented 2 years ago

Stale issue message