# Linear or log

> Use a linear-or-log toggle for exponential growth: the log scale shows the steady rate, the linear scale shows the size.

- Data type: Values over time (`time`)
- Free (MIT): install with `npx chartreuse add log-line`, or registry item `/r/log-line.json`
- Example: **Transistors on a chip doubled about every two years for fifty years** (Transistors per microprocessor, largest chips of each year, 1971 to 2021)
- How to read it: On the log scale each gridline is 100 times the one below, so steady doubling is a straight line; switch to linear to feel the size.
- Phone: Not recommended for mobile (On a phone labels are hard to read or overlap (checked by eye)) · Video formats: 16:9 (best 16:9)

## Use it when
- values grow by a steady percentage (doubling, compounding, epidemics)
- values span several orders of magnitude
- readers may misread a log axis without the comparison

## Avoid it when
- values include zero or negatives (no log)
- the range is narrow
- the audience needs only the absolute size (use linear alone)

## Fields (data.json)
- `year` (year): the year the chip was released
- `transistors` (number, unit "transistors", format compact): transistors on the largest microprocessor of that year

Units are the example's: with your own data, set each number field's `unit` and `format` (percent, count, decimal, currency, compact) in the meta you pass to mount, or `chartreuse render --unit field=text --format field=count`. Scales and labels follow your data.

## Interactions, motion, sound
- buttons switch between log and linear scale
- hover or tap a dot to read the count and the trend's value
- Motion: The line draws on through fifty years, then the doubling trend fades in; switching scale bends the line between straight and hockey stick.
- Sound: A whoosh when the scale changes; a pop pitched by order of magnitude on hover. Quiet while it draws and between steps; mute it from its card. (sound is off until the viewer turns it on)

## Example spec
```json
{
  "chart": "log-line",
  "title": "Transistors on a chip doubled about every two years for fifty years",
  "subtitle": "Transistors per microprocessor, largest chips of each year, 1971 to 2021",
  "data": "/charts/log-line.data.json"
}
```

## Source
Transistors per microprocessor, Our World in Data (Karl Rupp, Microprocessor Trend Data) (CC BY 4.0), retrieved 2026-12-01: https://ourworldindata.org/grapher/transistors-per-microprocessor

Note: The doubling time is a least-squares fit to these points, computed in the chart: about 2.0 years.

Live: /charts/log-line · Manifest: /charts/log-line.json · Tags: log scale, exponential, Moore's law, technology, chips, growth
