The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.


Hypatia - A Data Visualization API


version 0.029


        use strict;
        use warnings;
        use Hypatia;
        my $hypatia=Hypatia->new({
                query=>"select DATE(time_of_sale) as date,sum(revenue) as daily_revenue
                from widget_sales
                group by DATE(time_of_sale)"
  #grabs data from the query and puts it into a Chart::Clicker line graph
  my $cc=$hypatia->chart;
  #Since $cc is a Chart::Clicker object, we can now do whatever we want to it.
  $cc->title->text("Total Daily Revenue for Widget Sales");


For reporting and analysis of data, it's often useful to have charts and graphs of various kinds: line graphs, bar charts, histograms, etc. Of course, CPAN has modules for data visualization--in fact, there are quite a few of them, each with different features and wildly different syntaxes. The aim of Hypatia is to provide a layer between DBI and these data visualization modules, so that one can get a basic, "no-frills" chart with as little knowledge of the syntax of the particular data visualization package as possible.

Currently, the only bindings that are supported are:

Chart::Clicker (via Hypatia::Chart::Clicker)
GraphViz2 (via Hypatia::GraphViz2)

However, support for other data visualization modules will be supported (see the "TODO" section below).


This distribution makes use of DBI, but isn't an extension of DBI, and hence doesn't belong in the DBIx::* namespace. It also isn't an extension of, eg, Chart::Clicker, and thus shouldn't be in the Chartx::Clicker namespace (or should that be Chart::Clickerx? Chart::xClicker? Bah!).

So, instead, this distribution is named after the first female mathematician of historical note and a mathematician and one of the librarians of the Great Library of Alexandria


Although I've put a considerable amount of thought into the API, this software should considered to be in alpha status. The API may change, although if it does, I'll do what I can to preserve backwards compatibility.


  • Expand the API to other data visualization packages.

  • Add unit tests and more attributes to Hypatia::GraphViz2.

  • Allow the loading of options via configuration files (initially XML or ini; the only thing making this difficult for JSON is that queries usually take more than one line, and JSON doesn't support multi-line strings).

  • Finish up some more of the options in Hypatia::Chart::Clicker, and include some default "prettification" options that adds a reasonable amount of padding, fudging, etc.



This string attribute represents the general name of the data visualization API that you wish to use. For right now, the only supported value is Chart::Clicker.


This string attribute represents the type of graph that you want:


I'd like to thank the following people for suggestions in making this distribution better. Any (constructive) criticism and feedback is welcome (jack at jackmaney dot com or jackmaney at gmail dot com).

1. Cory Watson (aka gphat) for suggestions that greatly streamlined the API.
2. David Precious for the idea of passing an active database handle into a Hypatia::DBI object, instead of requiring the connection parameters.
3. Ron Savage for updating GraphViz2 in order to make unit tests easier.


Jack Maney <>


This software is copyright (c) 2012 by Jack Maney.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.