# histograms suck
what is an accessible histogram made out of a table? in this form AT have access to each entry and tactile navigation.
i use synthetic data which kinda makes a crumby demo, but the idea could be sound independent of data.
customize the style with pandas styler. do some weird shit so we have access to a string and numerical version of the value. `content` can't show a string and we can't math on a string so we need both. this is redundant, but lets stick to css.
1
customize the style with pandas styler. do some weird shit so we have access to a string and numerical version of the value.
content
can't show a string and we can't math on a string so we need both. this is redundant, but lets stick to css.
hist.T.map(lambdax:F"""<data style="--val: {x}">{x}</data>""").style.set_table_attributes("""class="hist v" """).set_caption("a vertical histogram of sythetic data to demostrate the technique.")
hist.map(lambdax:F"""<data style="--val: {x}">{x}</data>""").style.set_table_attributes("""class="hist h" """).set_caption("a horizontal histogram of sythetic data to demostrate the technique.")
hist.map(lambdax:F"""<data style="--val: {x}">{x}</data>""").style.set_table_attributes("""class="hist h" """).set_caption("a histogram of sythetic data to demostrate the technique.")
hist.sort_values(by="count",ascending=False).map(lambdax:F"""<data style="--val: {x}">{x}</data>""").style.set_table_attributes("""class="hist h" """).set_caption("a sorted vertical histogram of sythetic data to demostrate the technique.")
hist.sort_values(by="count",ascending=False).T.map(lambdax:F"""<data style="--val: {x}">{x}</data>""").style.set_table_attributes("""class="hist v" """).set_caption("a sorted vertical histogram of sythetic data to demostrate the technique.")