Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.graphics.apps.gnuplot > #1564

Re: CGI Question

From sfeam <sfeam@users.sourceforge.net>
Newsgroups comp.graphics.apps.gnuplot
Subject Re: CGI Question
Followup-To comp.graphics.apps.gnuplot
Date 2012-12-31 12:38 -0800
Organization gnuplot development team
Message-ID <kbst4d$7kl$1@dont-email.me> (permalink)
References <zN6dneyLzP8dvULNnZ2dnUVZ_radnZ2d@earthlink.com> <sPCdnc_4SYP_FHzNnZ2dnUVZ_qidnZ2d@earthlink.com>

Followups directed to: comp.graphics.apps.gnuplot

Show all headers | View raw


E.D.G. wrote:

> "E.D.G." <edgrsprj@ix.netcom.com> wrote in message
> news:zN6dneyLzP8dvULNnZ2dnUVZ_radnZ2d@earthlink.com...
> 
> Posted by E.D.G. on December 31, 2012
> 
>        This post is a continuation of a CGI programming discussion that I
> started on the Perl Newsgroup a few days ago.
> 
>        - The first part of this post has to do with Internet Server CGI
> programs that can create picture files such as PNG files.

I have been using cgi + gnuplot to produce analysis pages with embedded PNG
images for many years.  Perl works fine, though I've also used other 
languages for the same purpose.  I'm actually moving away from PNG, however,
since newer gnuplot versions allow you to embed mouseable plots using SVG
or the HTML5 canvas element.

You are welcome to have a look at one of my perl+gnuplot driven servers at
  http://www.bmsc.washington.edu/parvati/
It's a very field-specific application that I won't even try to explain here.
But it does show that you can create and display plots generated by uploading
data from a large file or via a pointer to data in an external public data base.
Hit the "Sample Output" icon, or use the accession code 3CHB to pull the input
data directly from the Protein Data Bank. The pre-cooked output uses PNG;
if you re-calculate you will get a mixture of SVG and PNG.

[snip]
> There are modules that make it possible for Perl programs to interact
> with Gnuplot.  But from what I have seen, data still need to be sent to
> Gnuplot through files or some type of "pipe."  And I am not sure if this
> would work on an Internet Server computer.

Of course it works.  Why wouldn't it?

As to using a tailored Perl module to interface to gnuplot, IMHO this is 
a worse option than just talking to gnuplot directly.  If you rely on 
someone else's Perl module then you are limiting yourself to the subset,
possible a small subset, of gnuplot capabilities that are supported by that
module.  I can pretty much guarantee that no such perl module will keep up
with all of the possible gnuplot options.  In contrast, it is trivially easy
to open a pipe from perl to gnuplot and send any gnuplot command you like.

On the other hand, you need to take care in sandboxing the script + data + 
support programs so that malicious or careless input to the web server does 
not corrupt anything beyond the requested plot output.  
That's a non-trivial requirement, and gnuplot may not be your
best choice from this perspective.  A tailored Perl module sitting in 
between might or might not ameliorate this concern.

	happy gnuplotting (and also Happy New Year)

		Ethan


> 
>        - The second part of this post is a somewhat philosophical computer
> programming discussion that is intended for the people who are developing
> the Perl and Gnuplot languages.
> 
>        At the moment I am using ActiveState Perl (both older and newer
> versions), an older version of Gnuplot, and Xampp on my Windows XP and
> Vista
> PCs.  And I can create and run Perl language CGI programs on my Internet
> Server.
> 
>         On my PC, Perl sends Gnuplot plot information through files, and
> command information through Windows pipes.  Those pipes don't appear to be
> very good for sharing large blocks of plotting data.  Things tend to get
> lost.  But they are great for sending relatively small numbers of commands
> to Gnuplot.
> 
> CGI PICTURE FILE QUESTIONS
> 
>        After preparing for this for quite a few years I am now finally
> starting to create Perl programs for use as CGI programs that will run at
> my
> Web sites.  The first one that should be running within a few days will be
> a relatively simple variation of Matt Wright's Perl language WWWBoard
> program. It was selected largely because I was able to get it to run with
> the Xampp computer program that makes it possible for a Windows PC to look
> like an Internet Server and respond when an html file SUBMIT button is
> pressed for example.
> 
> Question:  What graphics program will work with Perl on an Internet Server
> computer and allow Perl to draw picture files such as charts with a PNG
> extension and store them at the site?
> 
>        If Gnuplot will run on an Internet Server and work with Perl then
> that might take care of the matter.  However, after visiting some Web
> sites and doing some reading on the subject I was not able to determine if
> this is actually possible.
> 
> Question:  If Gnuplot can be used for Internet Server applications, then
> can anyone point to a Web site where a discussion of that subject can be
> found that would be understandable to an intermediate level programmer?
> 
> Question:  If Gnuplot is not recommended for use with Perl for Internet
> Server CGI file work, then what graphics program should be used?
> 
>        The following is an indirect URL for the type of picture file work
> that is planned.  And I am not sending people to that Freewebs site to get
> points.  Indirect addresses like that are being used in part in the hopes
> of keeping as much spam mail etc. as possible away from E-mail addresses
> listed on my actual science research Web sites.
> 
> http://www.freewebs.com/eq-forecasting/Demo-Program.html
> 
> 
> PHILOSOPHICAL PROGRAMMING DISCUSSION FOR PERL AND GNUPLOT DEVELOPERS
> 
>       This first part of the following discussion is intended to be
> humorous, not some type of scientific fact.  It has been my experience
> that if that humor statement is not added, some people who might be
> speaking English as a second or third language could get confused.
> 
>        When the Great Rain finally ended and his Arc neared land, Noah
> assembled all of the Arc animals on the top deck and said to them,
> 
> "Evolve or Perish!"
> 
>        Unfortunately, the dinosaurs had been out partying the night
>        before.
> They missed the lecture.  And now they can be found only in Natural
> History museums and paleontological digs.
> 
>        Some time ago ago I asked the ActiveState people if they would be
> interested in developing a version of Gnuplot that could be used as a
> downloadable module for Perl and enable Perl programs to use the
> sophisticated Gnuplot chart drawing resources.
> 
>        If I remember correctly, they stated that they would rather focus
>        on
> developing chart creation resources for their downloadable version of
> Python.
> 
>        What I have recommended in my posts in the past is that some
> combination of Perl and Gnuplot language development personnel create a
> module version of Gnuplot that can be downloaded and used with Perl.  It
> is my understanding that they are both written using one of the C
> languages.
> So such a module development effort shouldn't be too difficult.  And
> Gnuplot commands in the Perl programs could begin with "gnu" as in
> "gnuprint" to keep them from conflicting with similar Perl commands.
> 
>        There are modules that make it possible for Perl programs to
>        interact
> with Gnuplot.  But from what I have seen, data still need to be sent to
> Gnuplot through files or some type of "pipe."  And I am not sure if this
> would work on an Internet Server computer.
> 
>        Some of the advantages of having a Perl module version of Gnuplot
> might be the following:
> 
>        - This could greatly enhance Perl's chart drawing capabilities.
> 
>        - It could greatly enhance Gnuplot's array manipulation and perhaps
> its string manipulation capabilities.
> 
>        - Both Perl and Gnuplot would become more attractive to prospective
> users because of their increased power.  And they would both become less
> likely to eventually join the dinosaurs in some museum.
> 
> Happy Holiday Season to all,
> 
> E.D.G.

Back to comp.graphics.apps.gnuplot | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Re: CGI Question "E.D.G." <edgrsprj@ix.netcom.com> - 2012-12-31 06:47 -0600
  Re: CGI Question sfeam <sfeam@users.sourceforge.net> - 2012-12-31 12:38 -0800
    Re: CGI Question "E.D.G." <edgrsprj@ix.netcom.com> - 2013-01-01 09:16 -0600
    Re: CGI Question "E.D.G." <edgrsprj@ix.netcom.com> - 2013-01-01 23:21 -0600

csiph-web