eladr
eladr

Reputation: 385

How can i specify different shapes in ngx-graph template?

All

Is there any way to draw other shapes than rectangle? circle, polygon, my own symbol?

Also i am looking for a way to write a sentence next to the shape, besides the text inside it.

Thanks

Upvotes: 0

Views: 1531

Answers (1)

Noufal Wayn
Noufal Wayn

Reputation: 114

You can use the following code for creating circle instead of rectangle.

   <ngx-graph> <ng-template #nodeTemplate let-node> <svg:circle    [attr.r]="node.width/2" [attr.cx]="node.width/2"    [attr.cy]="node.width/2" [attr.fill]="node.options.color" />     <svg:text alignment-baseline="central" [attr.x]="10"    [attr.y]="node.height / 2">node-label</svg:text> </ng-template>  </ngx-graph>

Upvotes: 1

Related Questions