Open kan-qi opened 6 years ago
We can certainly insert javascript file to svg. But the svg created by R is not well structured. There are no identifier to find specific item in SVG. When it comes to a graph with multiple component like distirbution graph it is hard to code a general function. If we change a bit in graph structure we may have to change javascript code completely. R doesn't put texts as text nodes rather it uses path tag and places glphy symbols.
Okay. I see. Any external library that can help with parsing svg exported from R. Or you have some suggestions to deal with this situation. Thanks!
I am not sure if there any libraries available as such.. I would rather try to create SVG in the client side so that we can have better hold of the graph getting generated. We can try to check if there are any ways to generate structured SVG in R. One of the major problem current R svg is it doesn't use character, it draws the character which makes difficult to find what text it is. By text what I mean is number_of_paths (axis name) what you have in graph.
Okay. I see. Then let us continue to work on this issue. Any way, we need to explore a method of solving this issue. Thanks for the info.
Javascript object injection on the svg graphs generated from R: