A blog about things that interest me, politics, news, media, architecture, development, environment, local history, secularism, web, dublin ireland, tara

Contact me at expectationlost@gmail.com

Saturday 27 February 2010

Irish Dail TDs, members of Ireland's parliament information exhibited, mapped, charted, listed and editable.

This screen shot shows how I have used Simile Exhibit Widget to display Ireland's 166 Dáil TD's, members of Ireland's parliament, information exhibited, mapped, charted, listed and editable.Using information I gathered on this google spreadsheet and having geo-coded their constituency_offices_address' and used that constituency spreadsheet as basis to show information about them on a map of Ireland on top of polygons of Dáil constituencies.

Made with Exhibit from MIT which...

Exhibit enables you to create html pages with dynamic exhibits of data collections without resorting to complex database and server-side technologies. The collections can be searched and browsed using faceted browsing. Assorted views are provided including Timelines, tiles, maps, and more.

I have been very impressed with MIT exhibit, there is a whole suite of systems for displaying large amounts of data simply and lightly. Though its a fair few years old and isn't being updated any more I wasn't sure whether it was worth pursuing and using to create my Irish Politics displays but I haven't seem anything as impressive and easy to adapt for a copy and paste coder like me. Looking around for visualisations, faceted search (which is usually associated with semantic web) and mapping systems, I haven't seen any better. The original creator of Exhibit David Huynh has gone on to work on freebase which hopes to automatically gather and similarly display data,(mainly from wikipedia). Try Dipty for timelines by themselves also. It helps to be able to run it off MIT servers, running it all of your system takes a little bit of changing of calls within the scripts.

Still to do
I need to reduce the heaviness of the page, by removing script from the main html page and putting it in includes, and seeing how to reduce calls by putting the whole system on my host rather then calling to the MIT.

Corrections, for instance do you know where in the town the constituency office is?, go to maps.google.com centre over it then take the latitude and longitude from the link, double check by pasting those coorindates back into the google maps search and then change in the TD spreadsheet and leave a comment on the cell too.

Im looking for medium detail file of polygon data of Dáil Constituencies. In KML or geojson format. I have just gotten an Irish counties KML and traced the maps available with the difference between the counties and constituencies. The .json files is only 1.5mb with each of the 42 constituencies polygon being around a 1000 coordinates, but this is too much and causes a slow script warning in IE.

You can use exhibit with in a semantic mediawiki install, or simpler table wibbit version. You can embed exhibit and timelines in wordpress using Datapress or Drupal once you converted some data to static json file. .json file example with Babel.

The best part of Exhibit is using faceted sidebar menus to display lots of categories of data and combinations of data. And being able to call that from google spreadsheets which you can leave open for editing and correction.

You can pick out any element or facet of the info from the list on the left, click on map or sliders, deselect it by un-checking on the sidebar list or use your browser's back button. You click on any icon to get an info bubble on that TD. You can zoom into the map by clicking on the constituencies map on the right or turn off the constituency polygons below, you can click any of the panels at the top to show, charts and voting maps, look at list of information on the TDs or see all the data on them.

I have made panels showing

Irish TDs • Dublin • Percent Vote • Expenses vs. Votes • Parties • FF TDs • FG TDs • Labour TDs • GP TDs • SF TDs • Ind TDs • Constituencies • Votes • expenses • Donations • Donors • Elections • Travel Details • TD Details • Contact • Position • All Data
which you can combine with the sliders
Terms - Age - Distance from Dail - Percent Vote - Gender

can you think of any more ways to display the data?

Exhibit
MIT Exhibit
I modified the Presidents Births and Death example of which you can see it's simple JSON file. You can use MIT's Babel to convert your data to JSON or XML (create live XML with editgrid.com) or any exhibit friendly form.

I rearranged my information into this google doc file with {labels} so that the Exhibit script can read it as JSON. How to make an exhibit from data fed directly from a Google Spreadsheet You copy code from the examples and Exhibit wiki and add panels that are coded like this

 ex:role="exhibit-view"   id="map1"  ex:collectionID="bothcollection2"  
   ex:viewClass="Exhibit.MapView"
   ex:label="Irish TDs"
   ex:eventlabel=".td"
   ex:size="large"
   ex:zoom="7"
   ex:mapHeight="600"
   ex:center="53.45,-8.0"
   ex:overviewControl="true"
   ex:showSummary="true"
   ex:latlng=".latlng"
   ex:polygon=".constpoly"
   ex:pin="false"
   ex:borderOpacity="1.0"
   ex:borderWidth="1"
   ex:borderColor="purple"
   ex:opacity="0.0"
   ex:showToolbox="false"
   ex:icon=".imageURL"
    
   
...calling the named columns from the google spreadsheets.

Description of how I made the government travel exhibit.

I have used more of the Exhibit extensions, with more maps, bar charts, scatter plots, polygons, and more sliders, gradients and icons,.. copying these example exhibits

and after a lot of searching through the simile mailing list.

Information
I have geo-coded the constituency_offices_address' of the 166 TDs and used that as basis to show information about them on map of Ireland with polygons of constituencies.

Polygons
Adding polygons was major extension from my previous exhibit you can use this version exhibit babel to help you convert kml and other formats to geojson. I adapted the creator David Huynh's election 2008 example and polylines example.
The coder behind werelate.org has created some extensions exhibit pedi maps to make connection icons on the map.

Timelines
I've created a time line of when the currents TDs were first elected. The time line extension is part of its own Simile timeline system which can get more info on how to use on its wiki. Although its not easy to show the times TDs didn't get elected and then returned a following election. (to stop and start the timeline on the same line with the same person). So for the moment it does not show that and goes straight first election to most recent.

Collections and Types
I had to change to having multiple collections in this exhibit to call the types and collections 166 TDS in one spreadsheet and 42 constituency polygons and associated info in another spreadsheet. Thankfully David Huynh provided the code to call from one the other or both collections in the mailing list. I'm not sure if can write code to add a third one (partys).

The Data
Google doc JSON TD editable spreadsheet.
Google doc JSON Constituency editable spreadsheet.
Google doc JSON Party editable spreadsheet.

Sources Constituency Profiles
TDs info from Oireachtas.ie
Wikipedia
electionsireland
Oireacthas.ie 2007 Results
SIPO
The Story

20 TDs example of information

Information categories most of which you can select in any combination.

json categoryexplanation
{label}don't edit
{td}don't edit
{person}person
{type}type
{constituencyofficeaddress}constituency office address
{street}street
{city}city
{county}county
{co}county code
{party}party
{tdconstituency}td constituency
{donations}donations
{seat}seat
{electorate}electorate
{validvote}validvote
{firstprefvotes}firstprefvotes
{percentcalcvote}percentcalcvote
{percentvote}percentvote
{partyvote}partyvote
{expenses}expenses
{party}party
{donorlatlng}donorlatlng
{labourlatlng}if you replace latlng replace this
{fflatlng}if you replace latlng replace this
{fglatlng}if you replace latlng replace this
{gplatlng}if you replace latlng replace this
{sflatlng}if you replace latlng replace this
{indlatlng}if you replace latlng replace this
{distance}distance
{lat}if you replace latlng replace this
{lng}if you replace latlng replace this
{latlng}constituency office coorindate approx
{LHlatlng}Leinster House latlng
{distanceC}distance from leinster house
{constlatlng}center of constituency
{zoom}zoom to constituency
{nicestartdate}nicestartdate first elected
{start}start first elected
{election}year election
{latestStart}latestStart
{earliestEnd}earliestEnd
{now}now
{terms}terms
{yearsofservice}yearsofservice
{event}event
{constphone}constphone
{end}end
{imageURL}imageURL
{partywebsite}party website
{email}email
{website}personal website
{electiontype}election type
{istd}istd
{wikiurl}wikiurl
{age}age
{gender}gender
{gov}gov
{position}position
{spokepersonissue}spokepers on issue
{committee}committee

Constituencies

json categoryexplanation
{id}don't edit
{label}don't edit
{type}don't edit
{seats}seats
{population2006}population2006
{electorate}electorate
{validvote}validvote
{partyvote}partyvote
{opac}opac
{labour-vote}labour-vote
{ff-vote}ff-vote
{fg-vote}fg-vote
{sf-vote}sf-vote
{gp-vote}gp-vote
{pd-vote}pd-vote
{ind-vote}ind-vote
{tdsofc}tds of consituency
{constlat}constlat
{constlng}constlng
{constlatlng}constlatlng
{area}area
{ctagrade}ctagrade
{ctaaallowance}ctaaallowance
{zoom}zoom
{election}election
{wikiURL}wikiURL
{lastelectiontype}lastelectiontype
{constituency2}constituency2
{constituencyprofile}constituencyprofile
{vote-for}vote-for
{vote-forts}vote-forts

Parties
Number of TDs
Vote percentage by party
party vote
party
swing
logoURL
tds of party
party url
partywikiURL

To do Make a CSS highlighting image map
Automatically geocode the donors for each TD
Search doesn't work
make it easier to edit, ie. add wiki backend