Heatmap table / conditionnal formatting showcased how it’s even possible to generate a ‘heatmap’ in Typst. This is very impressive, although I’m looking for something a lot simpler.
This is the data I would like to colour-code:
#show table.cell.where(y: 0): strong
#table(columns: 3, table.header("name","size","chunk_count"),"TypingRaceSimulator_Spec.md","21199","48","Typist.java", "4716","11","TypingRace.java","8177","19","README.md","1498","4")
For size, I need to:
- find min and max values between values in that column (in this case respectively
1498and21199) - Normalise the range to 0 (
1498) and 100 (21199) % - Generate a colour hue from a ‘rainbow’ spectrum from purple/cold (0%) to red/hot (100%)
For chunk_count, I need to do the same thing, only I’m comparing the proportions between each other (21199:48,4716:11,8177:19,1498:4), not the values themselves (48,11,19,4).
Do you have any suggestions as to how this could be achievable in Typst?
