Jump to main content - accesskey 2

Data Art project sponsors

Data Art with BBC Backstage

Guardian NewsTraces

  • Traces of news headlines with Chavez and Venezuela in BBC Americas News Traces of natural disasters in World news

This version of the NewsTraces project uses the Guardian Open Platform. We're using the Guardian because the Open Platform has an easy to use API. Enter a search and select the time period you�re interested in. Relevant stories are displayed chronologically showing the pattern of the search term�s history with salient events showing up as peaks.

By default the search is under the 'World' section. You can select an alternative section or 'All' sections from the dropdown. Clicking on the individual news blocks will link through to the relevant Guardian article.

Launch guardian newstraces //

Searches with large numbers of results such as 'Obama' or 'Blair' will take a long time to load, so we suggest you refine the search in a number of ways. Either pick a more specific search term such as 'Obama healthcare', limit the time period by changing the 'starting' and 'ending' dates, or pick the specific section you're in, e.g. 'Politics'.

 

  • Cameron & Clegg
    Cameron & Clegg
  • Global warming now climate change
    Global warming now climate change
  • Rise & fall of social networks
    Rise & fall of social networks
  • The rise of Rooney
    The rise of Rooney

How it was Built //

The project was adapted from the initial BBC version, and uses the Guardian Open Platform API. See the getting started guide here:
www.guardian.co.uk/open-platform/getting-started

To make it simpler and more readable the source code is a pared down from the online version. The main Actionscript file is called news_traces_01_guardian_sc.as

Get the code here:
news_traces_01_guardian.zip

Getting the data

Data is retrieved by querying the Open Platform API. The best way to find out how it works is to experiment with the explorer API:
http://explorer.content.guardianapis.com

The query string is constructed in function queryAPI, where parameters including the search term, the news section, and the begin and end dates are specified. Multiple requests are needed to get the result pages for each search term. Callback function completeHandler manages the download process, first getting the total results per search term when the _loadState is RESULT_METADATA, and each page for the search terms when its RESULT_CONTENT.

Results, in JSON format, are processed and added to the visualisation timeline in function parseJson.

Visualisation

To maximise screen estate the visualisation layout adapts to the pixel resolution available. The layout function first finds the largest bounding size available with a lower threshold of _minBounds. Chorological bars are drawn composed of blocks of individual news items. By default each bar represents 3 month. Change this by setting _monthsPerBar in init.

The colours for the search terms can be set at the top of the script in _boxCols.