abcjs icon indicating copy to clipboard operation
abcjs copied to clipboard

Connection between SVG elements and the code

Open francoisschwarzentruber opened this issue 1 year ago • 2 comments

Hello,

as I see, click listener https://paulrosen.github.io/abcjs/visual/click-listener.html is rather powerful! When you click on an element, you obtain some information in the parameters abcelem and analysis. But it is limited to clicks.

What I may need is a function getInfo(svgElement) which returns an object containing the information given in abcelem and analysis. If such a function would exist, we could:

  • implement a behavior when the user hovers/enters/leave an element and not only when the user is clicking

We may also imagine the other way around. getSVGElement(positionInTheCode) which returns the SVG element that corresponds to the position in the code.

What do you think?

francoisschwarzentruber avatar May 24 '24 08:05 francoisschwarzentruber

There is an internal array of elements that probably does what you want. I think I can make that public without complications. I hope to have a small update at the end of next week.

Thanks for the suggestion.

paulrosen avatar Jun 03 '24 00:06 paulrosen

Will be fixed in 6.4.0

paulrosen avatar Jun 10 '24 16:06 paulrosen