We're trying out a few ways of rendering svg's from R and svglite seems to create the nicest svg's by far.
But we use R as service and only ever return json from our scripts, which makes writing to disk and reading from it a unnecessary expensive task that needs clean up.
Defining either a ofstream or a std::stringstream at the top, based on whether a filename has been passed, should make this doable, without too much overhead.
Though I appreciate the code will need to be move a bit more to the c++ side of syntax.
I might have a go at this soon if you feel you would accept such a pull l request.
We're trying out a few ways of rendering svg's from R and svglite seems to create the nicest svg's by far.
But we use R as service and only ever return json from our scripts, which makes writing to disk and reading from it a unnecessary expensive task that needs clean up.
Defining either a ofstream or a std::stringstream at the top, based on whether a filename has been passed, should make this doable, without too much overhead. Though I appreciate the code will need to be move a bit more to the c++ side of syntax.
I might have a go at this soon if you feel you would accept such a pull l request.