Data visualisation
Charts are where Social Explorer earns trust. A chart should answer a question, say how it knows, and be readable by everyone.
Sentiment
Sentiment runs blue (positive) through grey (neutral) to orange (negative). Red and green are deliberately not used: they are the pair most often confused in colour blindness, and in a tool about news and politics they also carry unwanted meaning (red as danger or "bad", green as approval).
#0072b2#56b4e9#98a2ae#e69f00#d55e00| Level | Token | Hex | Tailwind |
|---|---|---|---|
| Very positive | --se-sentiment-very-positive | #0072b2 | sentiment-very-positive |
| Positive | --se-sentiment-positive | #56b4e9 | sentiment-positive |
| Neutral | --se-sentiment-neutral | #98a2ae | sentiment-neutral |
| Negative | --se-sentiment-negative | #e69f00 | sentiment-negative |
| Very negative | --se-sentiment-very-negative | #d55e00 | sentiment-very-negative |
In code, always get sentiment colours from getSentimentColor() in $lib/utils/colorUtils. It is the single source for charts and badges; do not write sentiment hex values into a page. Any other colour a chart, canvas or SVG needs (axis ink, series, status, a network's own colour) comes from CHART, CATEGORICAL and DIVERGING in $lib/utils/chartColors, which hold the brand tokens as hex. A test fails if a page writes a hex colour, or colours sentiment with green and red classes.
Rules
- Always pair colour with a label or icon. Direct labels beat legends.
- Badge text is ink 900 on a tint of the sentiment colour, so the label keeps full contrast.
- Large figures may use
sentiment-very-positiveorsentiment-very-negativeas text (both pass 3:1 at 24 px bold or larger); smaller text stays ink. - Order is always positive to negative, left to right or top to bottom.
Categorical series
For series that are not sentiment (platforms, topics, languages) use the colour-blind-safe Okabe-Ito set, in this order:
#0072b2
#e69f00
#009e73
#cc79a7
#56b4e9
#d55e00
#f0e442
#0f1926
- Four or fewer series read best. Beyond six, group the tail into "Other".
- Do not use platform brand colours (Telegram blue, YouTube red). They clash with each other and with the sentiment scale.
- Do not reuse a sentiment colour for a non-sentiment series on the same page.
Sequential and diverging
- Sequential (counts, density): the primary ramp, 100 to 700, light for low and dark for high.
- Diverging (change, correlation): blue
#0072b2to near-white#f1f4f8to orange#d55e00, centred on zero. A correlation matrix is symmetric with 1 on the diagonal, and says what is correlated.
Chart rules
- The title states the finding or the question, for example "Negative posts about transit rose after 12 October", not "Sentiment chart".
- Say how many. Show the sample size ("n = 1,500 posts") and the date range on the chart or beside it.
- Axes have labels and units. A "Percentage" axis plots percentages. Bars start at zero.
- Time runs left to right, oldest to newest.
- No truncated labels. If a label does not fit, use a table or a horizontal layout, not "N…".
- Show the uncertainty. Confidence below a threshold is marked, and the page says what the confidence means and which model produced it.
- Gaps are gaps. Missing data is drawn as a gap, never as a zero.
- Interactive means linked. Clicking a bar, segment, topic or hashtag opens the posts behind it.
- Text alternative. Every chart has a descriptive title and a data table available on demand.
- Test it. Check the chart in greyscale and with a colour-blindness simulator before shipping.
In code
Charts use ECharts through initChart() in $lib/utils/echarts, which applies the social-explorer theme: Atkinson Hyperlegible Next for all text, ink for axes and grid, and the categorical order above. Set per-series colours only for sentiment (use getSentimentColor) or when a series has a meaning of its own.