nx10 / httpgd

Asynchronous http server graphics device for R.
https://nx10.github.io/httpgd
GNU General Public License v2.0
377 stars 19 forks source link

Add description to renderers-API #81

Closed ManuelHentschel closed 2 years ago

ManuelHentschel commented 2 years ago

Would it be feasible to include a short description in the data returned by /renderers? E.g. the Renderer column from here. This could be useful as hover/description in an Export plot as... dialogue.

nx10 commented 2 years ago

Yes I was also thinking about this, but I think we should keep localization in mind for the implementation. Ideally all user-visible strings in the client (and server messages) should be translatable in the future.

ManuelHentschel commented 2 years ago

There are Accept-Language headers etc. for this in http, do these also work with websockets?

nx10 commented 2 years ago

I have added the descr field containing the english renderer descriptions. e274c350755cdd6bbc5e85f53c533ffb94efe188 Feel free to suggest changes to the descriptions. I have just copied the values from the API docs for now. hgd_renderers() will now return a data.frame in R instead of nested lists.

I experimented with localization a couple of days ago, but implementation will not be as trivial as I anticipated, so I opened #84 to revisit this at a later date.

ManuelHentschel commented 2 years ago

In a similar vein, would it make sense to add a suggested filename extension to each renderer? This could be used e.g. to suggest a file name in an Export plot as... dialogue

nx10 commented 2 years ago

You might have missed this, the file extensions are already available in the ext field.