PPTX.jl
PPTX.jl copied to clipboard
Tables with colors
Note: this is mostly a brainstorm with myself.
I recently saw many colleagues automatically create tables with colors from scripts.
For example, coloring the background of a table element red or green based the value of a number in the table element. Managers love those kind of quick overviews. And of course change the font color (at least to black or white depending on the background color).
Stuff such as this:
There's all these other configurations, like border colors. But let's start with something simple, such as the background color.
Main trouble is how to make this a bit user friendly. My only guess right now would be to make a table/dataframe/matrix object where the elements are not just strings, but TextBox, or TableElement types or something, with lots of properties that you can change. That would give full flexibility per table element at least.
(May have to combine this with easier TextBox/TextBody configuration, font/alignment/etc. Maybe consider to use the same API as Makie.Text?)
(We could also add like a formatter function to the PPTX.Table, to style each element based on the content, see PrettyTables.jl for example. Maybe Term.jl has some good ideas as well.)
What if PrettyTables.jl had an XML backend ..
What if PrettyTables.jl had an XML backend ..
Interesting idea :) But actually it would be a PPTX backend, because there is no standard way to define a table in XML. So I wonder if there would be any benefit to add that code to PrettyTables.jl instead of here.
v0.10.0 has these features, I added an example to the docs on how to generate the table in the original post.