# Diff view

> Use a diff view to show how a text changed between two versions: what was kept, cut and added, word by word.

- Data type: Words and text (`text`)
- Pro · not released yet: its code is not available; try it on its page, or use a free chart of the same data type (`text`)
- Example: **Lincoln's signed Gettysburg Address keeps 200 of his first draft's 237 words exactly** (The Nicolay draft against the Bliss copy, compared word by word, punctuation included)
- How to read it: Struck-through words were in the first draft only; highlighted words are new in the signed copy; the strip above maps every word in reading order.
- Phone: Not recommended for mobile (On a phone the chart isn't the main thing on screen (checked by eye)) · Video formats: none passed; closest 9:16

## Use it when
- two versions of the same text are compared
- where the changes fall matters as much as how many
- the text is short enough to read in full (up to a few pages)

## Avoid it when
- the texts are different works (use word frequencies)
- only the size of change matters (use a single number or bar)
- the text is very long (summarise changes by section)

## Fields (data.json)
- `before.name, after.name` (category): the two versions
- `before.note, after.note` (text): what each version is
- `before.text, after.text` (text): the full text of each version

## Interactions, motion, sound
- hover or tap a change to read the before and after
- switch between the two versions or both with changes marked
- Motion: The kept words appear first; then each change fades in, in reading order.
- Sound: A pop on hover, higher for additions. 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": "diff-view",
  "title": "Lincoln's signed Gettysburg Address keeps 200 of his first draft's 237 words exactly",
  "subtitle": "The Nicolay draft against the Bliss copy, compared word by word, punctuation included",
  "data": "/charts/diff-view.data.json"
}
```

## Source
Gettysburg Address (Nicolay draft) and Gettysburg Address (Bliss copy), Wikisource, transcribing the manuscripts held by the Library of Congress and the White House (Public domain), retrieved 2026-12-01: https://en.wikisource.org/wiki/Gettysburg_Address_(Bliss_copy)

Note: Words are compared exactly, so a change of capital letter or punctuation counts as a change. The diff is a longest-common-subsequence match, one of several reasonable alignments.

Live: /charts/diff-view · Manifest: /charts/diff-view.json · Tags: text, diff, revision, editing, history, speech, Lincoln, before and after
