Twitter timeline

Twitter activity visualised over a schedule, ideal for conferences

Updated 6 years ago by bespoke

How to use this template

A Flourish template for visualising the Twitter activity at a conference or other event. Created by @theduncanclark, @robinhouston and @daanlouter at (and initially for) #OpenVisConf. Unlike other Flourish templates, use of this template requires us to run the associated server on a hashtag. Contact hello@flourish.studio for more information.

This section documents API usage specific to this template, so for an introduction we suggest you refer to the generic API documentation instead.

template: _591

version: _12

Template data

There are three different formats in which you can supply data to this template. The most convenient for you to use likely depends on the source of your data, as described below.

1. Array of arrays, and a bindings object

You can supply arrays of arrays to opts.data, which might look like:

{
    data: {
        schedule: [
            [ "ScheduleColumn1Value1", "ScheduleColumn2Value1",
            [ "ScheduleColumn1Value2", "ScheduleColumn2Value2",
            [ "ScheduleColumn1Value3", "ScheduleColumn2Value3",
            ...
        ]
    }
}

where each array of arrays represents the rows in a data sheet.

To tell the API how the values from each column should be associated with the keys that the template is expecting, you must also supply an object attached to opts.bindings. (The meanings of the keys in the bindings object are documented below.) The minimal bindings you can supply for this template are as shown in this example:

{
    template: "_591",
    version: "_12",
    bindings: {
        schedule: {
            session_start: 0, // index of a column in your data
            session_end: 1, // index of a column in your data
            session_name: 2, // index of a column in your data
            speaker_name: 3, // index of a column in your data
            speaker_handle: 4, // index of a column in your data
        }
    },
    data: {
        schedule: [
            [ "ScheduleColumn1Value1", "ScheduleColumn2Value1",
            [ "ScheduleColumn1Value2", "ScheduleColumn2Value2",
            [ "ScheduleColumn1Value3", "ScheduleColumn2Value3",
            ...
        ]
    }
}

All possible bindings that you can supply are shown in this example:

{
    template: "_591",
    version: "_12",
    bindings: {
        schedule: {
            session_start: 0, // index of a column in your data
            session_end: 1, // index of a column in your data
            session_name: 2, // index of a column in your data
            speaker_name: 3, // index of a column in your data
            speaker_handle: 4, // index of a column in your data
        }
    },
    data: {
        schedule: [
            [ "ScheduleColumn1Value1", "ScheduleColumn2Value1",
            [ "ScheduleColumn1Value2", "ScheduleColumn2Value2",
            [ "ScheduleColumn1Value3", "ScheduleColumn2Value3",
            ...
        ]
    }
}

2. Array of objects with arbitrary keys, and a bindings object

This format is most likely useful when you have data from an external source, such as CSV data loaded from d3-dsv. You should supply this attached to the opts.data, which might look like:

{
        schedule: [
            { "ScheduleHeader1": ..., "ScheduleHeader2": ..., ... },
            { "ScheduleHeader1": ..., "ScheduleHeader2": ..., ... },
            { "ScheduleHeader1": ..., "ScheduleHeader2": ..., ... },
            ...
        ]
    }

... but with the keys being the column headers from your source data instead. You must also supply an object attached to opts.bindings. The minimal bindings you can supply for this template are as shown in this example:

{
    template: "_591",
    version: "_12",
    bindings: {
        schedule: {
            session_start: "ScheduleHeader1",
            session_end: "ScheduleHeader2",
            session_name: "ScheduleHeader3",
            speaker_name: "ScheduleHeader4",
            speaker_handle: "ScheduleHeader5",
        }
    },
    data: {
        schedule: [
            { "ScheduleHeader1": ..., "ScheduleHeader2": ..., ... },
            { "ScheduleHeader1": ..., "ScheduleHeader2": ..., ... },
            { "ScheduleHeader1": ..., "ScheduleHeader2": ..., ... },
            ...
        ]
    }
}

All possible bindings that you can supply are shown in this example:

{
    template: "_591",
    version: "_12",
    bindings: {
        schedule: {
            session_start: "ScheduleHeader1",
            session_end: "ScheduleHeader2",
            session_name: "ScheduleHeader3",
            speaker_name: "ScheduleHeader4",
            speaker_handle: "ScheduleHeader5",
        }
    },
    data: {
        schedule: [
            { "ScheduleHeader1": ..., "ScheduleHeader2": ..., ... },
            { "ScheduleHeader1": ..., "ScheduleHeader2": ..., ... },
            { "ScheduleHeader1": ..., "ScheduleHeader2": ..., ... },
            ...
        ]
    }
}

(As before, the keys containing "Header" would be replaced by column names from your data source.)

3. Array of objects with template-defined keys

There is an alternative format you can use, which is likely to be easier to use if your data is not from a spreadsheet source. With this alternative format you supply your data to the template as an array of objects, attached to opts.data, where the keys must be those used by the template, as documented below. In this case there is no need to supply a bindings object, since the key names are already those expected by the template. The required properties in the data object are as follows (scroll down for a description of what each property is):

{
    template: "_591",
    version: "_12",
    data: {
    schedule: [
        {
            session_start: ...,
            session_end: ...,
            session_name: ...,
            speaker_name: ...,
            speaker_handle: ...
        },
        ...
    ]
},
    ...
}

And the full list of all possible properties is as follows:

{
    template: "_591",
    version: "_12",
    data: {
    schedule: [
        {
            session_start: ...,
            session_end: ...,
            session_name: ...,
            speaker_name: ...,
            speaker_handle: ...
        },
        ...
    ]
},
    ...
}

Meanings of the template data keys:

  • schedule.session_start: session_start
  • schedule.session_end: session_end
  • schedule.session_name: session_name
  • schedule.speaker_name: speaker_name
  • schedule.speaker_handle: speaker_handle

Template settings

Options for opts.state.

Settings

socket_url string

Socket URL. This template requires our Twitter socket server to be running for a hashtag. Contact hello@flourish.studio for more information!. A web socket server that returns tweets for the appropriate hashtag. Contact support@flourish.studio if you're interested in having us set up a server for your event.

scale_factor number

Tweet scale.

px_per_hour number

Vertical spacing. In pixels per hour

circle_fill color

Circle fill.

automate_popup string

Automatatic popups.

Allowed values:

  • off (Off)
  • random (Random)
  • latest (Latest)

header_title string

Title.

header_subtitle string

Subtitle.

header_color color

Color.

header_align string

Alignment.

Allowed values:

  • left (fa-align-left)
  • center (fa-align-center)
  • right (fa-align-right)

header_margin number

Margin.

header_margin_advanced boolean

Advanced margin settings.

header_margin_top number

Top.

header_margin_right number

Right.

header_margin_bottom number

Bottom.

header_margin_left number

Left.