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

Is this supposed to be interactive? #157

Open
a-tal opened this issue Jan 30, 2023 · 2 comments
Open

Is this supposed to be interactive? #157

a-tal opened this issue Jan 30, 2023 · 2 comments

Comments

@a-tal
Copy link

a-tal commented Jan 30, 2023

If this is just meant to be an image generator, feel free to ignore me, works as advertised then.

As you probably already know, in the interactive example (https://ecomfe.github.io/echarts-wordcloud/example/optionKeywords.html), it fails to recognize any hover events on elements that are nested inside the letters of others (such as the small "shape", "polyline" or "tiled" in e's of "series").

@Ovilia
Copy link
Member

Ovilia commented Feb 1, 2023

I think this is probably because it detected the mouse is hovering the bigger text so it doesn't check others. This is probably not easy to do because currect collision detectiong is based on the AABB bounding box of the text. If we wish to detect the extract bounding box, we need to read the pixels of the canvas and it should have noticable performance problem.

@a-tal
Copy link
Author

a-tal commented Feb 2, 2023

I think it's because the hovered element is drawn last. it should stay in the initial draw order (biggest first), and not reorder based on hover status. I think then the mouse detection would just work as it should, no pixel detection nessesary.

to see this in action, it becomes super obvious when you add something like: textStyle: { backgroundColor: this.randomColor() } to each of your data items.

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