Open ADBond opened 1 year ago
A thought that occurred while looking at #1578
[!NOTE] Just while I'm testing out the new alert blockquote feature, I wonder if the colour issue could be addressed by adding a property to the linker that toggles required accessibility adjustments. So something like
linker.accessible_charts = True
can be set and the charts contain something likeif linker.accessible_charts: chart_def[...][...]["color"]["scale"] = diverging_colours_accessible else: chart_def[...][...]["color"]["scale"] = diverging_colours_default
Where the colour scales (and likewise any other formatting) can be stored centrally and imported
Given the vast array of charts, it's difficult to ensure consistency of style across the board, whether performing one-off changes or more crucially when attempting to provide multiple options to users.
Aside from the color scheme, various formatting choices can and probably should be standardised, with or without additional options:
linker.profile_columns(text_size = "large")
or a global linker.text_size = "large"
)match_probability
and diverging scale for match_weight
)
linker.match_weights_chart(monochrome=True)
)linker.dark_mode=True
)Good pair programming use case
There is such a thing as a vega lite theme. I wonder whether it could be used to blanket apply some styles. (I've never tried it)
https://github.com/vega/vega-themes
https://observablehq.com/@vega/vega-themes-demo
A demo of using a custom theme with altair is shown here:
theme
defined here
import altair as alt
from ... import theme
alt.themes.register('splink_theme', theme)
alt.themes.enable('splink_theme')
Is your proposal related to a problem?
Quite a few of our charts are using red-green scales, which is not great for colourblindness accessibility.
Describe the solution you'd like
Charts using other, more accessible, schemes that still convey the relevant information clearly - e.g. viridis (see https://github.com/moj-analytical-services/splink/issues/1437#issuecomment-1634924919), brewer,
Might also be nice to have a few options - a sensible default, maybe a couple of other options, and perhaps the option for custom user-specified schemes.
Describe alternatives you've considered
Additional context
Loosely related: #642.