JavaScript Interface to Ptplot

This is a sample JavaScript interface to Ptplot that allows the user to adjust various Ptplot parameters.

To bring up a sample plot, change the various settings and then click on the Plot button.

To get a description of the various fields, click on the name of field to get to the Help for the Ptplot page. See also the Limitations section below.


Width Height
Background Color
(Hex number #000000 - #111111)
Foreground Color
(Hex number #000000 - #111111)
URL Base
File to plot
Pxgraph Args
Title Text
Title Font Label Font
X Axis Label Y Axis Label
Bars Binary No Lines Ticks
Small Points Large Points ReverseVideo Display args


How it works

  1. The HTML file includes Ptplot.js which contains JavaScript code.
  2. When the Plot button is clicked, the JavaScript ptplot() function is passed the form.
  3. The ptplot() function generates HTML that reflects the settings in the form. The generated HTML includes the <APPLET tag.
  4. Since the PlotApplet class does not inherit from the Plot class, we have to update the pxgraphargs applet parameter with the data from the form. If we had more direct access to the public methods of the Plot class, then we could have a Plot on this page and modify the format on the fly.
    Note that the About button in the generated HTML implemented by having JavaScript call the getAppletInfo() public method.

Limitations

  • Since this is an applet, you can only plot data from the server. It might be possible to use the INPUT TYPE="FILE" HTML FORM element to submit files to be plotted.
  • Some of the datasets are binary datasets, so you must check the binary checkbox. In the File to plot select box below, all the files in the data/ directory are binary files.
  • The File to plot select box uses spaces as file separators. This allows us to plot graphs that consist of more than one dataset.
  • The Title Font and Label Font selectors should allow more than one style. Helvetica-BOLD-ITALIC-12 should be allowed.
  • The layout of the controls is rather ugly.
  • Resources

  • Netscape JavaScript Documentation
  • Netscape HTML Documentation

  • Up to the Example index - Back to a Plot of 10,000 binary points - Forward to a plot using error bars
    Copyright © 1997-1998 The Regents of the University of California. All rights reserved.
    Last updated: $Date: 1998/11/17 22:32:59 $ comments to: ptplot@eecs.berkeley.edu