Open jrowen opened 8 years ago
Attributes are really fickle creatures, especially when you lug them around in objects. There are several R functions that don't pass attributes through. So, the better solution to your problem is to handle the unboxing on the javascript side, which should be really easy.
Would it also be possible to use the preRenderHook
to serialize the widget data manually? We call jsonlite::toJSON
with json_verbatim=TRUE
, so any data we find in there that has already been through jsonlite::toJSON
should be untouched if sent through again.
Thanks for the additional suggestions. In this case, I was able to use as.list
to force the JSON to always be rendered as a list.
I'm following the instructions here to override the
toJSON
arguments, but the override params are not being used. I can confirm that the TOJSON_ARGS attr is set on the params list passed tohtmlwidgets::createWidget
, but it is NULL when checked inhtmlwidgets::toJSON
.