Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

To create a motion chart, the data must be populated in a data structure (as stated by Google public data explorer  and copied below, the complete dataset can be found here ):

Code Block
<?xml version="1.0" encoding="UTF-8"?>
<dspl xmlns="http://schemas.google.com/dspl/2010"
    xmlns:geo="http://www.google.com/publicdata/dataset/google/geo"
    xmlns:geo_usa="http://www.google.com/publicdata/dataset/google/geo/us"
    xmlns:time="http://www.google.com/publicdata/dataset/google/time"
    xmlns:quantity="http://www.google.com/publicdata/dataset/google/quantity"
    xmlns:entity="http://www.google.com/publicdata/dataset/google/entity">

  <import namespace="http://www.google.com/publicdata/dataset/google/time"/>
  <import namespace="http://www.google.com/publicdata/dataset/google/quantity"/>
  <import namespace="http://www.google.com/publicdata/dataset/google/entity"/>
  <import namespace="http://www.google.com/publicdata/dataset/google/geo"/>

  <info>
    <name>
      <value>Pinger Visual Landscape</value>
    </name>
    <description>
      <value>Some very interesting statistics about countries and their connectivity</value>
    </description>
    <url>
      <value>http://www-iepm.slac.stanford.edu/pinger/</value>
    </url>
  </info>

  <provider>
    <name>
      <value>Pinger</value>
    </name>
    <url>
      <value>http://www-iepm.slac.stanford.edu/pinger/</value>
    </url>
  </provider>

  <topics>
    <topic id="geography">
      <info>
        <name><value>Geography</value></name>
      </info>
    </topic>
    <topic id="population_indicators">
      <info>
          <name><value>Population indicators</value></name>
        </info>
    </topic>

    <topic id="pinger">
      <info>
        <name><value>Pinger Metrics</value></name>
      </info>
    </topic>
    <topic id="ipdv_indicators">
      <info>
          <name><value>Inter Packet Delay Variation</value></name>
        </info>
    </topic>
    <topic id="minimum_rtt_indicators">
      <info>
          <name><value>Minimum Round Trip Time</value></name>
        </info>
    </topic>
	.
        .
        .
        .
        .
  </topics>

  <concepts>
    <!-- As noted in the tutorial, this concept should extend quantity:amount.-->


    <concept id="population">
      <info>
        <name>
          <value>Population</value>
        </name>
        <description>
          <value>Size of the resident population.</value>
        </description>
      </info>
      <topic ref="population_indicators"/>
      <type ref="integer"/>
    </concept>

	<concept id="ipdv">
      <info>
        <name>
          <value>ipdv</value>
        </name>
        <description>
          <value>Inter Packet Delay Variation</value>
        </description>
      </info>
      <topic ref="ipdv_indicators"/>
      <type ref="float"/>
    </concept>
	.
        . 
        .
        .
        .

    <!-- This country concept is defined for educational purposes only. A country
    concept exists in the Google geo dataset. See:

    http://code.google.com/apis/publicdata/docs/canonical/geo.html -->
	<concept id="region" extends="geo:location">
      <info>
        <name>
          <value>Regions</value>
        </name>
        <description>
          <value>My list of Regions</value>
        </description>
      </info>
      <type ref="string"/>
      <property id="name">
        <info>
          <name><value xml:lang="en">Regions</value></name>
          <description>
            <value xml:lang="en">The official name of the region</value>
          </description>
        </info>
        <type ref="string"/>
      </property>
      <table ref="region_table"/>
    </concept>

    <concept id="country" extends="geo:location">
      <info>
        <name>
          <value>Country</value>
        </name>
        <description>
          <value>My list of countries</value>
        </description>
      </info>
      <type ref="string"/>
      <property id="name">
        <info>
          <name><value xml:lang="en">Country name</value></name>
          <description>
            <value xml:lang="en">The official name of the country</value>
          </description>
        </info>
        <type ref="string"/>
      </property>
	  <property concept="region">
	  <info>
		<name><value xml:lang="en">Regions</value></name>
        </info>
      </property>
      <table ref="countries_table"/>
    </concept>


    <concept id="unemployment_rate" extends="quantity:rate">
      <info>
        <name>
          <value>unemployment rate</value>
        </name>
        <description>
          <value>The percent of the labor force that is unemployed, not seasonally
            adjusted.</value>
        </description>
        <url><value>http://www.bls.gov/cps/cps_htgm.htm</value></url>
      </info>
      <topic ref="population_indicators"/>
      <type ref="float"/>
      <attribute id="is_percentage">
        <type ref="boolean"/>
        <value>true</value>
      </attribute>
    </concept>

  </concepts>

  <slices>
<slice id="countries_slice">
    <dimension concept="country"/>
    <dimension concept="time:year"/>
    <metric concept="population"/>
	<metric concept="average_rtt"/>
    <metric concept="ipdv"/>
    <metric concept="minimum_rtt"/>
    <metric concept="MOS"/>
    <metric concept="nthroughput"/>
    <metric concept="throughput"/>
    <metric concept="unreachability"/>
	<metric concept="packet_loss"/>
	<metric concept="internetusers"/>
    <table ref="countries_slice_population_table"/>
  </slice>


  </slices>

  <tables>
    <table id="countries_table">
      <column id="country" type="string"/>
      <column id="name" type="string"/>
      <column id="latitude" type="float"/>
      <column id="longitude" type="float"/>
	  <column id="region" type="string"/>
      <data>
        <file format="csv" encoding="utf-8">countries.csv</file>
      </data>
    </table>

 <table id="region_table">
      <column id="region" type="string" />
      <column id="name" type="string" />
      <column id="latitude" type="float" />
      <column id="longitude" type="float" />

<data>
  <file format="csv" encoding="utf-8">countries-regions.csv</file>
  </data>
  </table>

    <table id="countries_slice_population_table">
      <column id="country" type="string"/>
      <column id="year" type="date" format="yyyy"/>
      <column id="population" type="integer"/>
	  <column id="average_rtt" type="float"/>
      <column id="ipdv" type="float"/>
      <column id="minimum_rtt" type="float"/>
      <column id="MOS" type="float"/>
      <column id="nthroughput" type="float"/>
      <column id="throughput" type="float"/>
      <column id="unreachability" type="float"/>
	  <column id="packet_loss" type="float"/>
	  <column id="internetusers" type="float"/>
      <data>
        <file format="csv" encoding="utf-8">file.csv</file>
      </data>
    </table>


</tables>


</dspl>

...

  • The column headings in the first line of the data file must exactly match the concept id and the property id of the concept with which the data is associated (though order may vary).
  • Each row must have exactly the same number of elements as the number of properties on the concept (even if the value is empty).
  • Each value for the concept's id field (here, the country code) must be unique and non-empty (an empty field is one with zero or only whitespace characters).
  • Values for properties that reference other concepts must either be empty or be a valid value of the referenced concept.
  • Values that contain the comma character must be represented without comma; for example 23,400 must be represented as 23400.

The complete folder that was uploaded to Google Explorer is available here.

Relevant Files

The scripts and files are placed at /afs/slac.stanford.edu/package/pinger/explorer . Two scripts have to be run for generating the data file in the format required by the google data explorer. First script is generate-metric-files-for-explorer.pl . This script takes metric values from prmout folder (http://www-iepm.slac.stanford.edu/pinger/prmout/ AKA /afs/slac/g/www/www-iepm/pinger//prmout, you can use ls -lt /afs/slac/g/www/www-iepm/pinger//prmout/ | grep SLAC | grep allyear | more to find the latest relevant files) and transposes the data such that years are now incremented vertically and not horizontally. The files generated by generate-metric-files-for-explorer.pl  are then given as an input to the script generate-alldata-for-pinger-data-explorer.pl,  which outputs the data for all the metrics altogether in one file named file.csv. This file is in the format as required by the google data explorer.

...