Closed draben closed 3 years ago
There are now two new arguments to robservable
:
json_args
which allows to customize TOJSON_ARGS
parameters (by default list(dataframe = "rows")
)json_func
which allows to provide a custom R function for JSON serialization. It is passed to htmlwidgets
via its TOJSON_FUNC
parameterI'm not really able to test the second one as I don't really have a use case, but feel free to send your feedback.
Thanks for your useful suggestion.
Holy cow, that was fast! Thank you. I will report any issues I discover, but am closing the issue.
Feature request: htmlwidgets allows the user to override the use of jsonlite by supplying their own R->JSON serialization function. Would it be possible to expose this ability through robservable? See here.
Use case: Currently data frames are serialized into arrays of objects. Excellent. Many of the D3 team's visualization examples have data objects that have which are arrays of objects with additional attributes attached (e.g., [ {data1}...{data2} ] with a columns array attribute). Standard use of jsonlite prevents direct construction of such an object, but a simple user-defined function could do the trick. Passing such a user-defined function would prevent the need to fork visualizations by enabling their direct use.