Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Help needed: Using circle instead of rect #44

Closed
panpan0000 opened this issue Dec 15, 2017 · 2 comments
Closed

Help needed: Using circle instead of rect #44

panpan0000 opened this issue Dec 15, 2017 · 2 comments

Comments

@panpan0000
Copy link

Using circle instead of rect

[ ] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[*] support request => Please do not submit support request here

Current behavior
currently, the sample use <svg:rect> which works well.
but if I want to use customized icon or circle.
I can't align the lines with the circle center...
image

Expected behavior
how to make the lines always connected with the circle center ?

@isaacplmann
Copy link
Contributor

try this:

        <ng-template #nodeTemplate let-node>
          <svg:g class="node" ngx-tooltip [tooltipPlacement]="'top'" [tooltipType]="'tooltip'" [tooltipTitle]="node.label">
            <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>
          </svg:g>
        </ng-template>

Not perfect, but it gets you closer.

screen shot 2017-12-15 at 10 16 27 am

@panpan0000
Copy link
Author

Yes. @isaacplmann .
although after drag the ball , the line doesn't not points to the center of balls. but anyhow , it's good at the beginning .
thank you.
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants