plantuml / plantuml

Generate diagrams from textual description
https://plantuml.com
Other
9.66k stars 878 forks source link

Wrong component is highlighted on hover for svginteractive #1713

Closed rubikscuber closed 3 weeks ago

rubikscuber commented 1 month ago

Describe the bug Hovering does not work as expected for this diagram:

@startuml test
!pragma svginteractive true
component rcm {
    class scf
    class sc
    sc->scf
}
class r
class cs
r -> cs
cs->scf
sc->r
@enduml

If class r is clicked - everything is highlighted correctly, but if class r is simply hovered, the scf class is highlighted instead of the direct neighbour sc.

The bug only occurs on hover for some of the components

related to #910

To Reproduce Steps to reproduce the behavior:

  1. Render diagram as svg
  2. open in browser
  3. hover over class r
  4. See error

Expected behavior Only neighbours and the respective links should be highlighted

Screenshots

interacive_hover_bug

Desktop: Browser: firefox, chrome, edge

kirchsth commented 1 month ago

I think it has the same problem which I found, but maybe you want to check if following issue contains a possible solution for you. https://forum.plantuml.net/18112/is-possible-add-border-based-svg-interactive-mode-like-below BR Helmut

rubikscuber commented 1 month ago

I am not sure about the problem you described, but I think the one I listed could be solved by making the xpath stricter in this file svg/onmouseinteractivefooter.js (line 19 and 23)

so I suggest using [id=elem_${N2}] instead of [id^=elem_${N2}]