March 29, 2012

Bible Visualization

Last year I compiled a collection of interesting visualizations of narrative text.  In searching for such visualizations I happened across many that focused on the Bible - enough for a separate blog post; this one.

BibleViz
Chris Harrison has produced a set of three Bible visualizations.  The first is an arc diagram that visualizes cross-references between books of the Bible.  The bar chart at the base of the diagram represents the number of verses in each book.  The arcs represent cross-references between books with arc height and colour encoding the distance between the pairs of books connected by the arcs.

Arc diagram visualizing cross-references between books of the Bible

Chris also visualized the "social network" of people and places mentioned in the Bible.  A graph was formed with people and places as nodes, and edges between pairs of nodes (people/places) mentioned in the same verse.  A clustering algorithm was used to layout the nodes.  Labels are scaled according to the number of connections they have.

Social network of people and places mentioned in the Bible

Chris also visualized where in the Bible each person or place is mentioned.  The full text of the bible is overlaid with labels for each person or place name.  Lines connect each name label to the positions in the text where the name is mentioned.  The labels are scaled according to the number of mentions, and positioned at the average point of their mentions.

Distribution of references to
people and places in the Bible


OpenBible
Inspired by Chris Harrison's work, OpenBible has also produced a similar arc diagram visualizing cross-references between books of the Bible.

Arc diagram visualization of biblical cross-references

OpenBible also provides an interactive tool for visualizing biblical cross-references.  At the highest-level the cross-references are visualized using a matrix.

A matrix visualization of cross-references between books of the Bible

You can click on the matrix to drill-down to a verse-by-verse visualization of the cross-references between a pair of books.

Visualisation of the cross-references between Genesis and Revelations

OpenBible also has two visualizations of the "ups and downs" in the Bible.  Sentiment analysis was used to determine the mood (positive or negative) of each verse.  These sentiment scores were then smoothed (150-verse moving average) to provide a more coherent result, and then plotted radially with red and black depicting negative (down) and positive (up) sentiment, respectively.

Sentiment analysis of the Bible.

The same analysis has been applied with less smoothing (5-verse moving average) and laid out vertically as a set of sparklines to show the changing mood within each book.

Sentiment analysis of each book of the Bible.

Gospel Spectrum
Ahn Dang produced a visualization of the narrative of Jesus' life as described in the Gospels of Matthew, Mark, Luke and John.  A simple bar chart is used to plot the narrative with a bar for each event in the story of Jesus' life.  Bar length and brightness denote the number of verses and gospels, respectively, describing each event.  For example, the long bright blue bar to the right indicates that 56 verses describe "Peter's denial", and is mentioned in all four gospels.

Gospel Spectrum for all four gospels combined.
As well as the combined view, the gospels can be visualized individually, using a distinct colour for each.

Gospel Spectrum showing each gospel with a distinct colour

Similar Diversity
Designers Philipp Steinweber and Andreas Koller produced an infographic focused on not just the Bible but also the holy books of four other religions: Buddhism, Hinduism, Islam and Judaism.  Their visualization was derived from text analysis in order to avoid bias on the part of the designers.  As the project's title suggests the visualizations are meant to show the similarities and differences between the holy texts.

The graphic comprises several different data visualizations.  The arc diagram shown below visualizes the 41 most frequent characters (arranged alphabetically).  Names (and arcs) are scaled according to frequency with which characters are mentioned; the coloured arc above each name shows the relative frequency for each holy book, e.g. Allah appears only in the Qur'an.

Below each character is a bar chart that visualizes each character's "activities" (determined from adjacent verbs in the text).  These are coloured according to their relative frequency in each holy book and, scaled (height) by total number of occurrences.  The activity vectors are used to calculate similarity between pairs of characters.  This similarity is visualized by the grey arcs connecting characters.  The weight and thickness of the arcs encodes the similarity coefficient.

Arc diagram of leading characters


Bible vs. Qur'an
Pitch Interactive focused on comparing the Bible with the Qur'an on the basis of word frequency.  Enter a keyword and verses containing it are highlighted in the Old & New Testaments of the Bible and in the Qur'an.  You can opt for exact matches and the inclusion of synonyms.

Word frequency visualization for the Bible and the Qur'an

Exegesis
Kushal Dave used Google to count the number of times each verse in the Bible is quoted on the Web.  He then created Exegesis to visualize these counts.  Each verse is represented by a bar.  Darker bars represent verses that are quoted more often.  The visualization allows you to search for particular phrases and words.  The image below shows the visualization with verses highlighted if they contain the word "Satan".


Exegesis visualization with verses containing "Satan" highlighted.


Many Eyes
There are many Bible visualizations on IBM's Many Eyes.  One of Many Eyes' unique visualizations is the Phrase Net, which I've used below to visualize usage of the phrase "x begat y", that is, the "patriarchy" in the Old Testament (click on the visualization to interact with it - requires Java).


If you're aware of any other visaulizations of the Bible or other holy books then please leave a comment below.

March 8, 2012

D3 Lap Charts

A while ago I blogged about lap charts; I compared the static charts used by the FIA to visualize Formula 1 Grand Prix races, with an interactive "stack flow" created using Impure to visualize rankings of the world's most populous cities.  I concluded that the stack flow's interactivity improved the ability to make sense of such charts.

To put this to the test I've created an interactive lap-chart using D3.js.  It visualizes the Australian 2010 Formula 1 Grand Prix.  The interactive version allows you to highlight a driver's race by positioning your mouse cursor over his name or lap trace.  If you don't have a modern browser (Firefox, Chrome, Opera, Safari or IE + Chrome Frame) then you can refer to the images shown below.

Australian 2010 Formula 1 Grand Prix Lap Chart implemented in D3.js
Highlighting Felipe Massa's race


It's much easier to make sense of the interactive lap chart compared with the static chart used by the FIA.  However, there's still room for improvement.  Around laps 8, 9 and 10 most of the drivers make a pit stop.  This results in many brief but significant changes in race position.  Even with interaction it's a bit messy.  This could be improved by adding interactive zooming, e.g. click on a lap and it (and neighbouring laps) will expand horizontally making it easier to see the rapid changes that occur over the space of a few laps.  Something for version 2.0 perhaps.

The visualization is shared using a Creative Commons license, and the source-code is available on GitHub.  You can use the visualization with your own race data.  Simply place it in a JSON object file and refer to it from the code.

The JSON object is an associative array with values for
  • lapCount: the total number of race laps
  • laps: the lap data for each driver, which is an associative array with values for
    • name: driver's name
    • placings: placing at the end of each lap completed (first value is grid position)
    • accident: lap(s) on which an accident occurred
    • pitstops: lap(s) on which the driver pitted
    • mechanical: lap(s) on which mechanical failure occurred
  • lapped: the race positions that were lapped by the lead driver (-1 indicates none)
  • safety: the laps on which the safety car was deployed