delph-in / delphin-viz

JavaScript visualizations of various DELPH-IN structures.

Home Page:http://delph-in.github.io/delphin-viz/demo/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Highlight when hovering variable on mrs.js doesn't have memory

yfaria opened this issue · comments

I am implementing a web page that is built upon mrs.js for reimplementing the WSI interface (https://github.com/own-pt/wql/tree/demo/flask-demo).
I need to highlight the matches that are relative to the pattern that matched and I still want to keep the highlighting of all variables of same name when hovering the variable name. The problem is that the code of the event mouseleave is harcoded to put every variable highlighted to black, overwriting my highlight of the matches. I can create a new event listener to solve this problem, but wouldn't it the be better if the code natively had this support to place the old color instead of always putting the same color?

That sounds like a useful improvement. Note that mrs.js and dmrs.js were developed separately by different people. I wrote dmrs.js so that hovering on a node highlights it and things it's connected to (similar to how mrs.js works), but also you can click a node to make the highlighting persistent. Clicking another node highlights that one instead. To clear highlighting, you click on the highlighted node again, but it's not obvious that it's been cleared until you move the cursor away from the node.

I think such a system for mrs.js sounds useful and I think we would accept a pull request that accomplishes that. Or you may have some better idea, which would also be welcome.

Thank you @goodmami, @yfaria is working with me. We will make our best to contribute to this repo considering the changes we may need for our use case (wsi interface)