Loading ...
Sorry, an error occurred while loading the content.
 

on-the-fly graphs on the web *without* data files

Expand Messages
  • jfazo@sbcglobal.net
    Hi, I would like to use ploticus to generate graphs for a website using data from our Oracle database. The only way I can think to do this is to select my
    Message 1 of 7 , Jun 7, 2006
      Hi,

      I would like to use ploticus to generate graphs for a website using
      data from our Oracle database. The only way I can think to do this is
      to select my data from the db, write it to a temp file and then call
      ploticus via the web passing the temp filename as a parameterized
      variable. Does this make sense? Is there a way to do this without the
      temp file generation?

      Thanks,
      Joni
    • Stephen C. Grubb
      Joni, either that or if you have a command line utility that dumps out oracle data you can invoke that #proc getdata command: oradump .... I believe this goes
      Message 2 of 7 , Jun 8, 2006
        Joni,

        either that or if you have a command line utility that dumps out oracle
        data you can invoke that

        #proc getdata
        command: oradump ....

        I believe this goes via a pipe without creating a temp file

        In my experience temp files aren't that bad performance-wise

        What do you use to invoke ploticus from the web? Just curious.

        Steve



        On Wed, 7 Jun 2006, jfazo@... wrote:

        > Hi,
        >
        > I would like to use ploticus to generate graphs for a website using
        > data from our Oracle database. The only way I can think to do this is
        > to select my data from the db, write it to a temp file and then call
        > ploticus via the web passing the temp filename as a parameterized
        > variable. Does this make sense? Is there a way to do this without the
        > temp file generation?
        >
        > Thanks,
        > Joni
        >
        >
        >
        >
        >
        >
        >


        Stephen C. Grubb scg@... x-6633
        Scientific Software Engineer, The Jackson Laboratory
        600 Main Street Bar Harbor, Maine 04609 USA
      • jfazo@sbcglobal.net
        I am using Perl to access ploticus from the web. I ended up using a temp file and it working out just fine. Thanks, Joni
        Message 3 of 7 , Jun 20, 2006
          I am using Perl to access ploticus from the web. I ended up using a
          temp file and it working out just fine.

          Thanks,
          Joni

          --- In ploticus@yahoogroups.com, "Stephen C. Grubb" <scg@...> wrote:
          >
          >
          > Joni,
          >
          > either that or if you have a command line utility that dumps out oracle
          > data you can invoke that
          >
          > #proc getdata
          > command: oradump ....
          >
          > I believe this goes via a pipe without creating a temp file
          >
          > In my experience temp files aren't that bad performance-wise
          >
          > What do you use to invoke ploticus from the web? Just curious.
          >
          > Steve
          >
          >
          >
          > On Wed, 7 Jun 2006, jfazo@... wrote:
          >
          > > Hi,
          > >
          > > I would like to use ploticus to generate graphs for a website using
          > > data from our Oracle database. The only way I can think to do this is
          > > to select my data from the db, write it to a temp file and then call
          > > ploticus via the web passing the temp filename as a parameterized
          > > variable. Does this make sense? Is there a way to do this without the
          > > temp file generation?
          > >
          > > Thanks,
          > > Joni
          > >
          > >
          > >
          > >
          > >
          > >
          > >
          >
          >
          > Stephen C. Grubb scg@... x-6633
          > Scientific Software Engineer, The Jackson Laboratory
          > 600 Main Street Bar Harbor, Maine 04609 USA
          >
        • Tim Butler
          ... Yes, but it depends on how you implement your server side scripts. I think it s worth avoiding tmp file cleanup. I use perl CGI for a simple tool that does
          Message 4 of 7 , Jun 23, 2006
            --- In ploticus@yahoogroups.com, "jfazo@..." <jfazo@...> wrote:
            > Is there a way to do this without the
            > temp file generation?

            Yes, but it depends on how you implement your server side scripts.
            I think it's worth avoiding tmp file cleanup.

            I use perl CGI for a simple tool that does this. (ploticus
            input shortened below.)

            #!/bin/perl -w

            use IPC::Open2;
            use IO::Handle;
            use CGI ':standard';
            use CGI::Carp qw(warningsToBrowser fatalsToBrowser carpout);
            use strict;

            # < do DB stuff to get data in array @data >

            my ($read_fh, $write_fh) = (IO::Handle->new(), IO::Handle->new());
            open2($read_fh, $write_fh, "/usr/local/bin/pl -png -stdin -o stdout");

            $write_fh->print('
            #proc page
            #proc getdata
            #intrailer

            <pl input snipped> '
            join("\n",@data),"\n");

            $write_fh->close();

            my $image='';
            {
            binmode $read_fh;
            local $/;
            $image = <$read_fh>;
            }

            print "Pragma: no-cache\n";
            print "Content-type: image/png\n\n";
            print $image;

            $read_fh->close();
          • jfazo@sbcglobal.net
            That worked great! I modified your code to expect the script filename as parameter to pl and the data through stdin.... Thanks! Joni
            Message 5 of 7 , Jul 18, 2006
              That worked great!

              I modified your code to expect the script filename as parameter to pl
              and the data through stdin....

              Thanks!
              Joni

              --- In ploticus@yahoogroups.com, "Tim Butler" <butler_tim@...> wrote:
              >
              > --- In ploticus@yahoogroups.com, "jfazo@" <jfazo@> wrote:
              > > Is there a way to do this without the
              > > temp file generation?
              >
              > Yes, but it depends on how you implement your server side scripts.
              > I think it's worth avoiding tmp file cleanup.
              >
              > I use perl CGI for a simple tool that does this. (ploticus
              > input shortened below.)
              >
              > #!/bin/perl -w
              >
              > use IPC::Open2;
              > use IO::Handle;
              > use CGI ':standard';
              > use CGI::Carp qw(warningsToBrowser fatalsToBrowser carpout);
              > use strict;
              >
              > # < do DB stuff to get data in array @data >
              >
              > my ($read_fh, $write_fh) = (IO::Handle->new(), IO::Handle->new());
              > open2($read_fh, $write_fh, "/usr/local/bin/pl -png -stdin -o stdout");
              >
              > $write_fh->print('
              > #proc page
              > #proc getdata
              > #intrailer
              >
              > <pl input snipped> '
              > join("\n",@data),"\n");
              >
              > $write_fh->close();
              >
              > my $image='';
              > {
              > binmode $read_fh;
              > local $/;
              > $image = <$read_fh>;
              > }
              >
              > print "Pragma: no-cache\n";
              > print "Content-type: image/png\n\n";
              > print $image;
              >
              > $read_fh->close();
              >
            • jfazo@sbcglobal.net
              Hi, Now I have a request to add clickmaplabels to my generated images. Any tips on how to do this without temp files for data? Would I have to execute
              Message 6 of 7 , Aug 8, 2006
                Hi,

                Now I have a request to add clickmaplabels to my generated images.
                Any tips on how to do this without temp files for data? Would I have
                to execute ploticus 2x? Once to generate map and once for image?

                Thanks,
                Joni

                --- In ploticus@yahoogroups.com, "Tim Butler" <butler_tim@...> wrote:
                >
                > --- In ploticus@yahoogroups.com, "jfazo@" <jfazo@> wrote:
                > > Is there a way to do this without the
                > > temp file generation?
                >
                > Yes, but it depends on how you implement your server side scripts.
                > I think it's worth avoiding tmp file cleanup.
                >
                > I use perl CGI for a simple tool that does this. (ploticus
                > input shortened below.)
                >
                > #!/bin/perl -w
                >
                > use IPC::Open2;
                > use IO::Handle;
                > use CGI ':standard';
                > use CGI::Carp qw(warningsToBrowser fatalsToBrowser carpout);
                > use strict;
                >
                > # < do DB stuff to get data in array @data >
                >
                > my ($read_fh, $write_fh) = (IO::Handle->new(), IO::Handle->new());
                > open2($read_fh, $write_fh, "/usr/local/bin/pl -png -stdin -o stdout");
                >
                > $write_fh->print('
                > #proc page
                > #proc getdata
                > #intrailer
                >
                > <pl input snipped> '
                > join("\n",@data),"\n");
                >
                > $write_fh->close();
                >
                > my $image='';
                > {
                > binmode $read_fh;
                > local $/;
                > $image = <$read_fh>;
                > }
                >
                > print "Pragma: no-cache\n";
                > print "Content-type: image/png\n\n";
                > print $image;
                >
                > $read_fh->close();
                >
              • Stephen C. Grubb
                Joni, to get clickmap labels you need to specify -csmap the mapping info (in html) is written to stdout by default. you can redirect to a file by specifying
                Message 7 of 7 , Aug 17, 2006
                  Joni,

                  to get clickmap labels you need to specify -csmap

                  the mapping info (in html) is written to stdout by default.

                  you can redirect to a file by specifying -mapfile foo

                  I don't work with your type of environment so I can't say much more....

                  Steve


                  On Tue, 8 Aug 2006, jfazo@... wrote:

                  > Hi,
                  >
                  > Now I have a request to add clickmaplabels to my generated images.
                  > Any tips on how to do this without temp files for data? Would I have
                  > to execute ploticus 2x? Once to generate map and once for image?
                  >
                  > Thanks,
                  > Joni
                  >
                  > --- In ploticus@yahoogroups.com, "Tim Butler" <butler_tim@...> wrote:
                  > >
                  > > --- In ploticus@yahoogroups.com, "jfazo@" <jfazo@> wrote:
                  > > > Is there a way to do this without the
                  > > > temp file generation?
                  > >
                  > > Yes, but it depends on how you implement your server side scripts.
                  > > I think it's worth avoiding tmp file cleanup.
                  > >
                  > > I use perl CGI for a simple tool that does this. (ploticus
                  > > input shortened below.)
                  > >
                  > > #!/bin/perl -w
                  > >
                  > > use IPC::Open2;
                  > > use IO::Handle;
                  > > use CGI ':standard';
                  > > use CGI::Carp qw(warningsToBrowser fatalsToBrowser carpout);
                  > > use strict;
                  > >
                  > > # < do DB stuff to get data in array @data >
                  > >
                  > > my ($read_fh, $write_fh) = (IO::Handle->new(), IO::Handle->new());
                  > > open2($read_fh, $write_fh, "/usr/local/bin/pl -png -stdin -o stdout");
                  > >
                  > > $write_fh->print('
                  > > #proc page
                  > > #proc getdata
                  > > #intrailer
                  > >
                  > > <pl input snipped> '
                  > > join("\n",@data),"\n");
                  > >
                  > > $write_fh->close();
                  > >
                  > > my $image='';
                  > > {
                  > > binmode $read_fh;
                  > > local $/;
                  > > $image = <$read_fh>;
                  > > }
                  > >
                  > > print "Pragma: no-cache\n";
                  > > print "Content-type: image/png\n\n";
                  > > print $image;
                  > >
                  > > $read_fh->close();
                  > >
                  >
                  >
                  >
                  >
                  >
                  >
                  >
                  >
                  >


                  Stephen C. Grubb scg@... x-6633
                  Scientific Software Engineer, The Jackson Laboratory
                  600 Main Street Bar Harbor, Maine 04609 USA
                Your message has been successfully submitted and would be delivered to recipients shortly.