XD-DENG / ECharts2Shiny

To insert interactive charts from ECharts into R Shiny applications (在R Shiny app中插入ECharts可交互图形)
https://CRAN.R-project.org/package=ECharts2Shiny
GNU General Public License v2.0
130 stars 47 forks source link

renderTreeMap doesn't accept JSON as data #64

Closed damilolah closed 3 years ago

damilolah commented 3 years ago

Hi,

Thanks for your work. According to the documentation, renderTreeMap should accept JSON data, however it doesn't. Even the examples used a JSON look alike: the keys have no quotes. How can I convert my JSON data whose keys have quotes to have no quotes like the one required by renderTreeMap?

damilolah commented 3 years ago

I resolved this using regex to remove all double quotes. It appears that renderTreeMap accepts only JSON formats with single quote keys labels and/or values labels. E.g. gsub("\"", "\'", json_data)

XD-DENG commented 3 years ago

Thanks @damilolah .

Sorry I only noticed the notification just now, and happy to know you have resolved it! And appreciate adding your solution here so it may be helpful for other people as well.