erblast / parcats

htmlwidget that creates plotly parallel categories diagrams from easyalluvial plots.
https://erblast.github.io/parcats/
Other
25 stars 3 forks source link

extend/customize hoverinfo #13

Open MichelMoser opened 2 years ago

MichelMoser commented 2 years ago

Dear @erblast,

I really enjoy your packages and am currently trying to extend some hover options (which you already started).

image

As i am still new to plotly, i am currently stuck with some questions and was wondering if you could point me to the respective code junks where they are to solve.

As shown above, i extended hovertemplate but would like to populate it with other data like "count". I could not find "count" being initiated in the repo. Could you point me to it so i could extend it to other data variables?
Or is this coded in the plotly.js?

Of course, all code will be pushed to your repo if you agree to. Thank you, michel

erblast commented 2 years ago

Hello,

looks like you are up to a good start, so far parcats does not create the hover text directly everything is done by plotly.js in this file. parcats only collects the hoveron and the hoverinfo parameters and passes them on. So the counts and probabilities are calculated by the java script. I dont know if you can manage to reference them when you provide the template.

I am happy to receive a pull request when you can get this to work.

All the best

MichelMoser commented 2 years ago

Hi,

Thank you, that helps a lot. Time to finally dive into js then :)

erblast commented 2 years ago

Just a hint maybe you know this already but if you go to the plotly.js documentation you can load any of the example plots on a platform called code pen and manipulate them using java code interactively. I don't know java but I used this together with the documentation to figure out how the code in java should look like for the plot that I want and then see how I need to construct the parameters in R to send to Java.

MichelMoser commented 2 years ago

Great, thank you for the hint.