mages / googleVis

Interface between R and the Google Chart Tools
https://mages.github.io/googleVis/
358 stars 156 forks source link

gvisOrgChart idvar with value and formatted value #87

Closed dunhampa closed 4 years ago

dunhampa commented 4 years ago

I am having trouble implementing an idvar column when trying to have a formatted and unformatted value as indicated by gvisOrgChart documentation

gvisOrgChart documentation:

[in idvar] This is shown on the node. You can specify a formatted value to show on the chart instead, but the unformatted value is still used as the ID.

This seems to be taken from the google API to bind: https://google-developers.appspot.com/chart/interactive/docs/gallery/orgchart

Based on the google documentation I tried some obvious encoding schemes:

Per google spec:

 OrgTb$df$Name[2]<-"[{v:'Mike', f:'Mike<div style=\"color:red; font-style:italic\">President</div>'}]"

Best guess:

 OrgTb$df$Name[2]<-data.frame(v='Jennifer Doe', f='Mike<div style=\"color:red; font-style:italic\">President</div>')

Is this supported?

mages commented 4 years ago

Unfortunately, I don't think this is doable with the googleVis interface.

dunhampa commented 4 years ago

Thanks for clarification. Love the package!