• Stars
    star
    123
  • Rank 281,139 (Top 6 %)
  • Language
    JavaScript
  • License
    Mozilla Public Li...
  • Created over 7 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Tell the story behind the numbers.

StorylineJS is a tool to make it easy to tell the story behind time-series data.

ROADMAP

As of September, 2017, StorylineJS is considered ready for general use. We don't have an active roadmap for further development at this time. However, we'd love to hear from you about what works and what could be better. In general, the best way to reach us is through our online support system.

Trying it out

The easiest way to use StorylineJS is by creating embeds using the authoring tool at https://storyline.knightlab.com Hopefully you can just copy the embed code into your CMS and publish a storyline that easily. More instructions on actually using the tool are on that page.

If you're a more experienced developer, you can also include the StorylineJS and CSS in your web page and write a little javascript to instantiate the storyline and place it on your page. However, note that as of 30 September, 2020, this will be harder to do: Google is decommissioning the original API which allowed StorylineJS to read data from your Sheets documents. For somewhat complex technical reasons, the solution we implemented requires that Sheets documents be read through a proxy server. Knight Lab is not able to provide a general purpose proxy server; the one we have implemented only works with storylines built with our authoring tool and hosted on our systems.

If it's important to you to host a storyline without using our iframe embeds and you need more information about this, open a GitHub issue.

Roll your own

If you have the above working, you can go on to make your own configuration JSON file. If you put it in the same directory as your test HTML file, then the config_url can just be the filename, without the http part.

In addition to your configuration file, you'll need a CSV data file. At a minimum, the file must have two columns: one for dates or times, which should be unique (that is, there should only be one row for each date) and one for the value to be plotted on the chart for the corresponding date. You can have other columns, but they'll be ignored.

It may be easier to look at/copy from an existing data file (like the one mentioned above), but here are details about the format:

  • the file should be a JSON file. Remember that JSON is particular: all your strings must be quoted with double-quote characters, and you may not have a comma after the last property in an "object" (associative array). Try a JSON validator if you get errors.
  • At the "top level" of the JSON object, you will have three required "keys" and one optional key:
    • data: an object describing details about your data file
    • chart: an object with details about how your data is presented
    • cards: an array of objects, each of which annotates one data point
    • start_at_card (optional): a number indicating which of your cards should be shown first. The number is "zero-based," as is common in programming. The default (if you leave it out) is 0 (that is, your first card).

Here are more details about those:

data: an object with the following "keys," all required.

  • url: a string that is the URL to your CSV data file. No other formats are supported at this time. If a "relative" URL is used, it will be interpreted relative to the page hosting your storyline, which may not be the same as relative to your datafile. StorylineJS ignores all columns in the CSV data file except the date and data columns identified below.
  • datetime_column_name: a string that is the value in the first row of the column containing the dates for the X-coordinates of the chart. This is case-sensitive and white-space sensitive.
  • datetime_format: a string that tells StorylineJS how to interpret the value in your datetime_column. The format should be as specified with d3-time-format
  • data_column_name: a string that is the value in the first row of the column of your file which has the values to be used for the Y-coordinates of the chart. This is case-sensitive and white-space sensitive.

chart: an object with the following keys:

  • datetime_format: a string telling StorylineJS how to display dates, used mostly for the X-axis labels, but also used for cards if no display_date is specified. The format should be as specified with d3-time-format
  • y_axis_label (optional): Use this to indicate the units for the Y values in your chart. If this is left out, then data.data_column_name will be used.

cards: an array of objects, each with the following keys:

  • title: a brief "title" for the annotation.
  • text: the main paragraph of your annotation. Keep this under about 222 characters for optimal mobile presentation.
  • row_number: the row in your CSV file that this card explains. Note that if you're looking at your data in Excel or a text editor with line numbers, the correct value here will be 2 less than the row number your editor shows. This is because we start counting with 0 instead of 1, and because we don't count the header row. We know this is a pain. It's something we hope to change as StorylineJS evolves.
  • display_date (optional): if this is specified, it will be displayed in the "date" portion of your card. If it is left out, the date value for the appropriate data row will be formatted using chart.datetime_format (specified above). You might want to override the default if you want different formats for your axis than for your cards, or if your datapoints are years, for example, but you want to specify a specific month or date in that year.

DEVELOPING

If you're interested in working on this code, see DEVELOPING.md

More Repositories

1

TimelineJS

TimelineJS: A Storytelling Timeline built in JavaScript.
JavaScript
8,859
star
2

TimelineJS3

TimelineJS v3: A Storytelling Timeline built in JavaScript. http://timeline.knightlab.com
JavaScript
2,867
star
3

sql-mysteries

Inspired by @veltman's command-line mystery, use SQL to research clues and find out whodunit!
JavaScript
1,567
star
4

juxtapose

JuxtaposeJS is a JavaScript library for making before/after image sliders
JavaScript
811
star
5

TimelineJS-Wordpress-Plugin

A simple shortcode plugin to add the Timeline to Wordpress
JavaScript
207
star
6

soundcite

Making Inline Audio Easy and Seamless
HTML
193
star
7

StoryMapJS

Maps that tell stories.
JavaScript
162
star
8

SceneVR

A Tool for Creating Shareable, Embeddable WebVR Stories
JavaScript
39
star
9

twxplorer

HTML
35
star
10

Picture-Story

Bootstrap theme for photo layouts. For use in Medill photojournalism classes.
HTML
27
star
11

bonfire

Automated curation of tweeted content from your Twitterverse
Python
16
star
12

InstaTimeline

Collaborative Innovation Class Project
JavaScript
14
star
13

BootstrapPictureStory

Bootstrap theme for photo layouts. For use in Medill photojournalism classes.
CSS
12
star
14

how-we-work

A collection of "how we work" resources, including our code style manuals
JavaScript
10
star
15

SensorGrid

C++
10
star
16

SensorGridAPI

Web API and dashboard for SensorGrid
JavaScript
10
star
17

VRJournFieldGuide

A guide to learning about VR as it pertains to journalistic applications
HTML
9
star
18

socialvideo-prototype

Summer 2017 Student Project
JavaScript
9
star
19

soundcite-wordpress-plugin

Making it easier to use SoundciteJS with Wordpress
PHP
8
star
20

learncms

Learn.Knightlab.com CMS version
HTML
8
star
21

pullquote

Pullquote can instantly create a picture quote from any user selected text on a website.
JavaScript
8
star
22

VideoSliderJS

SND Makes project looking at making video more "webby"
JavaScript
7
star
23

frontend-buildkit

This is the basic starter kit for Knight Lab frontend projects
JavaScript
7
star
24

timeline-addon

Experimenting with a Google Docs add-on to manage TimelineJS spreadsheets
HTML
7
star
25

fablib

Package for Fabric deployments
Python
5
star
26

reveal.js-template

A template for creating Knight Lab-themed reveal.js slides.
JavaScript
5
star
27

neighborhood-buzz

Python
5
star
28

ComingUP

Collaborative Innovation Class Project
JavaScript
4
star
29

circlethething

tater
JavaScript
4
star
30

videojam

A new start for Project VideoJAM
JavaScript
4
star
31

blueline

An asset generator and style guide for Knight Lab websites
HTML
4
star
32

tapestry

A WordPress plugin for organizing posts into a narrative arc.
JavaScript
4
star
33

openlab.knightlab.com

HTML
4
star
34

learn-prototype

a (probably throw-away) place to start working out UX practices for the new learn.knightlab.com
HTML
4
star
35

fao-explorer

Tools to better understand the UN FAO API
JavaScript
4
star
36

untangled-research

A microsite organizing research on use of social network analysis in journalism. Read at untangled.knightlab.com
Python
4
star
37

device-lab-runbook

A quick guide to getting started with our devices!
HTML
3
star
38

TV-tools

Tools used by Knight Lab for broadcast television related projects
Arduino
3
star
39

MusicRecs

Collaborative Innovation Class Project
Python
3
star
40

django-project-template

Project template for creating Knight Lab Django projects. Use with the settings flag for django-admin.py startproject.
Python
3
star
41

piquote

JavaScript
3
star
42

oembed-server

A system to take oembed requests for KnightLab's embeddable tools.
HTML
3
star
43

Collective

A gamified experience about managing resources with augmented reality
C#
3
star
44

GPSKit

A collection of useful things we have learned about working with GPS hardware and data
Python
3
star
45

studio-documenters

Explorations for the Documenters.org project
Jupyter Notebook
3
star
46

iphone-exquisite-corpse

Let's just mess around with an iphone app to learn some more about XCode and app development
Swift
2
star
47

Class-2016F-MadCast

Podcast Discovery project in the Knight Lab class.
JavaScript
2
star
48

openlabhours

CSS
2
star
49

studio-talk-to-data

Initial work for Knight Lab W18 "Talking to Data" team
Python
1
star
50

chicago-justice

Chicago Justice Project
Python
1
star
51

TarbellGUI

Desktop application for managing your Tarbell
Python
1
star
52

git-deploy

Ansible based deployment script implemented as a git subcommand
Python
1
star
53

KnightLab_SDConfig

Read config files from the SD card of an Adalogger
C++
1
star
54

SensorGridRouter

LoRa routing for the SensorGrid project
C++
1
star
55

KnightLab_GPS

Timer interrupt setup for Adafruit GPS on Feather 32u4 and M0
C++
1
star
56

weatherbot

Code developed with Associated Press and El Vocero to automatically generate stories for weather emergencies.
Python
1
star
57

DisparityMap

Javascript based map showing racial disparity in Chicago.
JavaScript
1
star
58

scenevr-author

A web-based authoring tool for Scene VR
HTML
1
star