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

node image prevent to show node stroke #25

Closed
drAliRahnema opened this issue Dec 19, 2021 · 9 comments
Closed

node image prevent to show node stroke #25

drAliRahnema opened this issue Dec 19, 2021 · 9 comments

Comments

@drAliRahnema
Copy link

hii use image as node and then when i want to use storke for the same node it will be hide behind the image
how can i fix this issue

@drAliRahnema
Copy link
Author

hi i use image as node and then when i want to use stroke for the same node it will be hide behind the image
how can i fix this issue

@dash14
Copy link
Owner

dash14 commented Dec 19, 2021

Hi @MohandesaliRahnema,
I think it is possible to do this by inserting the circle that draws the node stroke after the image.
I changed the node image example to do so. I hope this is helpful.
https://dash14.github.io/v-network-graph/examples/appearance.html#custom-node

@drAliRahnema
Copy link
Author

drAliRahnema commented Dec 20, 2021 via email

@dash14
Copy link
Owner

dash14 commented Dec 20, 2021

1- how can i have two image on a node

As implemented in the example, the image is just an SVG <image> tag.
You can put as many as you want between <template #override-node="..."> ~ </template>.
The display position of the placed element can be adjusted with x and y. The coordinates of the center of the node are (0,0).

2- the event that return on node click has no attr offsetx and offset on event.target

There are no offset attributes in SVG Element, so try using getBoundingClientRect() or getBBox().

@drAliRahnema
Copy link
Author

drAliRahnema commented Dec 21, 2021 via email

@drAliRahnema
Copy link
Author

drAliRahnema commented Dec 21, 2021 via email

@dash14
Copy link
Owner

dash14 commented Dec 21, 2021

I can't see the image... I don't know how you are writing the code, so I'll guess.
Are you writing two <template template #override-node>?
This <template> is to replace a node, and can only be written once.
I think you want to use multiple tags (elements) to represent a node.
So please put two <image> inside one <template #override-node>.

@drAliRahnema
Copy link
Author

drAliRahnema commented Dec 27, 2021 via email

@dash14
Copy link
Owner

dash14 commented Jan 2, 2022

Thanks for your reply.
I'll close this issue for now.
If you have any other questions, please open a new issue.

@dash14 dash14 closed this as completed Jan 2, 2022
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