spgarbet / tangram

Table Grammar package for R
66 stars 3 forks source link

allowing graphs as table elements #47

Closed kkmann closed 5 years ago

kkmann commented 5 years ago

Hi Shawn,

wow, this has come a long way since I checked back last time! Congratulations on the amazing progress. I didn't really put much more effort into my take on descriptive tables (https://github.com/kkmann/describr), it is mostly hard coded and in a terrible (mostly working) state ;).

The idea that got me going in the first place was to allow graphs as 'intersection functions' as well so that you could have e.g. histograms or boxplots in your table (I personally feel that there are too many numbers floating around in most medical papers...).

The problem with graphics is obviously the choice of the back-end, but have you given that any thoughts? describer essentially just formats everything as a plot thus being more or less back-end independent.

Best,

Kevin

spgarbet commented 5 years ago

One of the back burner things is to be able to have a plot rendering output. Or have graphs as elements inside the plot. Frank Harrell does this in some of his packages, so I should be able to take some lessons learned from his efforts. What's given me pause so far is I've focused on text, latex, and html rendering. I do have some code that will plot histograms in text using unicode. The structure of tangram allows for rendering to multiple formats. A plot renderer is desirable. I'll look through your code and see how you did it.

kkmann commented 5 years ago

oh, but don't look too close - it is an ugly mess. I stopped developing it right after getting the prototype working. I am essentially drawing the table using grid graphics. The rationale for me using a plotting framework was that I wanted the tables and their formatting to be output independent (docx, PDF, HTML) I guess the only way of doing that is to go via graphics, otherwise u are always stuck with the least common set of styling commands. main problem was getting the content formatted to a given size - which u have to do by hand when using graphics. I did not give it a go, but latex + tikz backend for plotting seems to be a nice solution as well (although limited to PDF output).

the hardest part though is getting the grammar right and you seem to have that part covered.

spgarbet commented 5 years ago

I do accept pull requests.... Hint Hint.