Take Two: Packers, Time and Google Groups
Ero Carrera (ero) <erocarreragmailcom> Friday, November 30 2007 00:03.00 CST


I just had to do it... This morning I read about chronoscope in a post in the Google Code Blog and I could not help myself from wanting to tinker with it.

I wrote a Mathematica function to export a time-series of the format (timestamp, value) into the dataset format used by chronoscope.


Epoch[date_] :=
  ToString[AbsoluteTime[DateList[ToString[date]]] -
  AbsoluteTime[DateList["1970"]]];

ChronoscopeJsExport = Function[ {datasetName, id, label, axis, data},
  jsData = datasetName

  " = {
Id: ""
ToString[id]
"",
"
"domain: ["

  StringJoin[ Riffle[ Map[ Epoch, data[[All, 1]] ], ", "] ]

  "],
"
"range: ["

  StringJoin[
    Riffle[ Map[ ToString, data[[All, 2]] ], ", "] ]
"],
"

  "label: ""
ToString[label]
"",
"

  "axis: ""
ToString[axis]
""
};";
  jsData
];



And ran it through the packer time-series I harvested from Google Groups. Then I picked some widget demo code  and put it all together in a mash-up. The results of the quick hack are here... much nicer to visualize than in the previous post. (and its interactive!)
  • Use the mouse-wheel to zoom
  • Drag the plot left/right to browse around different date ranges
  • You can pick any packer and the data will be plotted against the previously selected one