but the Tk's inability to accept an image in raw binary makes that a non-starter. Forcing me to convert the raw image into base64, so that it can convert it back is just symptomatic of the whole architecture.

Move up to Gtk2. ;-)

Perl/Gtk2 will accept binary data for images, and the DrawingArea widget has alot more flexibility than GD, in terms of setting up axis, and fonts, since it uses Cairo

As a matter of fact, there is a module Gtk2::Ex::Graph::GD. Also consider if you are using Firefox, IT itself uses Gtk2 based widgets, so why deal with javascript and all that mess? Just write your own app. :-) Sample code in the readmore

#!/usr/bin/perl use strict; use warnings; use Gtk2::Ex::Graph::GD; use GD::Graph::Data; use Gtk2 -init; use Glib qw /TRUE FALSE/; use Data::Dumper; my $graph = Gtk2::Ex::Graph::GD->new(500, 300, 'bars'); # All the properties set here go straight into the GD::Graph::* object + created inside. # Therefore, any property acceptable to the GD::Graph::* object can be + passed through here $graph->set ( title => 'Mice, Fish and Lobsters', x_labels_vertical => TRUE, bar_spacing => 1, shadowclr => 'dred', transparent => 0, # cumulate => TRUE, type => ['lisen', 'bars', 'bars'], ); my @legend_keys = ('Field Mice Population', 'Fish Population', 'Lobste +r Growth in millions'); $graph->set_legend(@legend_keys); my $data = GD::Graph::Data->new([ [ 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,], [ 1, 2, 5, 8, 3, 4.5, 1, 3, 4], [1.4, 4, 15, 6, 13, 1.5, 11, 3, 4], [11.4, 14, 22, 16, 1.3, 15, 1, 13, 14], ]) or die GD::Graph::Data->error; $graph->signal_connect ('mouse-over' => sub { #print Dumper @_; } ); $graph->signal_connect ('clicked' => sub { print Dumper @_; } ); # This actually returns an eventbox instead of an image. # But you don't <really> care either way, do you ? my $image = $graph->get_image($data); my $window = Gtk2::Window->new; $window->signal_connect(destroy => sub { Gtk2->main_quit; }); $window->set_default_size(700, 500); $window->add($image); $window->show_all; Gtk2->main;

I'm not really a human, but I play one on earth.
Old Perl Programmer Haiku ................... flash japh

In reply to Re: The browser as a (simple) window manager. by zentara
in thread The browser as a (simple) window manager. (Updated) by BrowserUk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.