in reply to Re: The browser as a (simple) window manager.
in thread The browser as a (simple) window manager. (Updated)
Could something like this -> Protovis meet your needs? Or be modified to do so? What strikes me is that you are asking for some local control over that which appears in the chart you are generating.
That is very interesting, but it's still not what I am looking for, for two reasons:
This point is subtle enough that I've apparently failed to convey what I mean by it. I'll attempt to correct this below.
By way of example, in Re: Picking the best points, I produced a plot to visualise the algorithm I was suggesting to the OP.
The command: 868223-plot -N=1000 -RETAIN=50 that generates that plot has two command line parameters: -N=nnnn -RETAIN=mm.
The first controls the number of values in the input set of points (the red plot); the latter, the number that are retained in the results set (the green plot).
Here are a sequence of images taken starting with the same input set of 100 points, and reducing to 95, 50 down to the final 20.
What I would like to be able to do is present a page in my browser that might look something like this
What I want to happen is for any changes made to either of the "Input dataset size" or " Output dataset size" dropdown controls, causes the plot to be redrawn using those parameters.
But, and here is the real motivation, if the "Replot at each step?" checkbox is checked, then the perl program regenerates the plot after each point is eliminated, effectively animating the reduction process on the screen.
You can see this type of animation (usually Java applets) used all across the web for exploring/explaining algorithms. For example, different types of sort algorithm. I want that possibility, but written in Perl, and within my own box. If it also worked across the web, that would be a bonus, but that is not my goal.
I'm looking for the ability to create simple, local GUI front-ends to perl programs, without having to structure my code around the GUI. Perl has all the tools I need to produce the visualisations, but no simple mechanism for a) displaying those images in real time; b) accepting input from the operator to control those visualisations.
The browser has those capabilities and is both ubiquitous and platform independant. And with the advent of AJAX, the "whole page refresh for each change" thing has gone away.
So, I'm looking to cut out the need for the webserver, by moving the browser/perl program communications into a black box that runs in a thread. In pseudo-code, the perl application's view of this becomes something like:
use Bui; my $html = do{ local $/; <DATA> }; my $Isize :shared = 100; my $Osize :shared = 20; my $step : shared = 0; my $img :shared; Bui->init( $html, \$Isize, \$Osize, \$step, \$img ); my $gd = GD->new( ... ); while( 1 ) { my @in = gendata( $Isize ); plotPoints( $gd, @in ); $img = $gd->png; while( @in > $Osize ) { my $discard = selectDiscard( @in ); splice @in, $discard, 1; if( $step ) { ## If the "Replot at each step?" checkbox is che +cked ## clear old plot $gd->drawRect( 0,0, $x, $y, white ); ## Plot points minus the discarded one plotpoints( @in ); ## Update the image; the next time the browser polls for +an update ## the revised image will be sent to the browser and be d +isplayed $img = $gd->png; } } ## clear old plot $gd->drawRect( 0,0, $x, $y, white ); ## Plot points minus the discarded one plotpoints( @in ); ## Update the image; the next time the browser polls for an update ## the revised image will be sent to the browser and be displayed $img = $gd->png; }
The BUI->init() call:
The main program just gets on with running the algorithm, with the full power of perl at its disposal, updating the image using whatever tools it desires to use, at whatever intervals are appropriate; and the BUI 'black box' takes care of all communication with the browser; which in turn takes care of all the display and interaction.
I hope that will clarify the problem I'm trying to solve and the idea I am presenting.
|
|---|