This is a simple overview of how to demonstrate why Gsharp is worth its price in 20
minutes. It is loosely based on the Gsharp Tutorial.
There are some additional notes if you are demonstrating to somebody who is familiar with
It is recommended that you run through the demonstration before presenting it! Please
let us know if you think we have missed anything.
- Start Gsharp in $UNIDIR/example/Gsharp.
While it initialises describe the three key
reasons why Gsharp is worth the money. Power, Speed and Flexibility:
- Power. It uses the UNIRAS graphics - the best in the business.
Developed over hundreds of man years, they are stable, bursting with functionality and
producing graphics of the highest quality on hundreds of devices.
- Speed. It is extremely easy to use - graphics can be made in the
fraction of a time it would take to program them. With powerful but simple tools even the
simplest user can make powerful graphics. Scripts to recreate your graphics can be created
with one click.
- Flexibility. Gsharp works equally with end-users or application
developers. The script language allows you to fully control Gsharp, to run in batch-mode,
to run on a web server or to produce new applications which run on VMS, UNIX and Windows
without modification.
Gsharp is this good because of our years of experience in this field and our high
regard for our customers enhancements. Gsharp does what you want, in the way that you want
because that's what you've asked for.
- Gsharp's Objects
Graphics in Gsharp are made up of objects, such as a viewport, a
graph or a title. You can create these by clicking on each object's icon on the Object
Toolbar.
Click on the Viewport Icon in the Object Toolbar
Demonstrate how the viewport can be resized or moved using the mouse. Wherever
possible we have allowed the user to interact using the mouse. Some objects such as notes
can also be rotated. Leave the viewport filling most of the canvas.
Double-click on the viewport. Each object has many resources
associated with it - such as it's position, it's colour and it's name. These can all be
modified by using the resource editor.
Change the background colour of the viewport and the frame width.
Objects that have been set are "toggled".
Unset the frame width toggle. Unsetting the toggle returns the
resource to it's default value. Type in a frame with of 0.1. Click
on OK.
- The Browser
As we create more objects it is useful to have an overview of them.
Click on the Browser icon in the Command Toolbar
With the viewport still selected click on the Title icon in the Object Toolbar.
Specify the title text. The small hand indicates that this resource must
be set. Click on OK. Notice how the browser is updated
with the new object. Drag the title to the left side just above the viewport.
Titles can be left, centre or right justified. Vertical position is unrestricted.
Demonstrate how objects can be selected in either the browser or the canvas.
- The DataManager
Click on the DataManager icon in the Command Toolbar.
The DataManager can be used to read data, to manipulate data and to save data.
Click on the Open Icon. Gsharp can read ASCII files, binary files, AVS
fields, data from databases, using the GSL functions fopen() and fread(). User's can even
link in their own C or FORTRAN readers (and data operators) into Gsharp.
Read in trends1.dat. Gsharp is intelligent enough to use the column
headings a dataset names. chg_1, labels and wei_1 appear in the WORK folder. In the
DataManager you can see whether they are floats(F) or strings(S), their size (22) and
their min and max values.
Highlight these three datasets and then click on the Edit icon. In the
Data Editor users can look at or modify values. Click on Cancel.
On the command line type xpos = cos(wei_1). New datasets can be
created using any sort of expression. Gsharp includes built-in functions for performing
interpolations, Fourier transforms, reshaping, filtering, projecting, statistics and many
other operations on your data. Functions can also be created in the script language to
implement any other algorithms. If you wish popup the functions browser to display
the list of built-in functions.
xpos[1] = 0.5. Gsharp can work on whole datasets at a time or
individual values.
Pop-down the DataManager.
- Creating Graphs
Select the viewport and then click on the Graph icon of the
Object Toolbar. Set the Graph Type to be bar. A number of new
resources appear which are appropriate to this graph type. There are so many resources
that can be used for configuring a graph that they are separated into bundles which can be
selected by clicking on the tags in the top of the folder.
Click on the [...] button next to Y data and select chg_1. Y data is
the only resource that must be set. We could also specify the size, colour and x position
of each of the bars.
Click on OK. A graph appears on the canvas. The limits are
automatically scaled to match the data used to draw the graph. The graph object is also
added to the canvas together with some automatically created objects such as the axes.
- Refining the Plot
In the browser enable Y axis 2. This can be done
from the MB3 menu over the icon.
Edit the domain object. In the switches bundle turn off all 4
tickmark resources.
Set the 1st 2D Y Axis ticklines to be behind. Click on OK. The axis
system has hundreds of resources which can be configured. There are also date/time axis,
logarithmic axes, polar axes and user-defined axes.
- Data Probing
With the bar graph selected shift-MB1 on one of the bars.
The data probe window appears showing the location of the click and the data value of the
bar.
Click on other bars and see the values change. More complex graph
types show more data. It is also possible to show your own data, or to perform actions
such as create new graphs or to access databases based on the cursor location.
Cancel the data probe window.
- Duplicating Graphs
Now that we have created the plot we want, we would like to make
another for our other dataset wei_1.
Resize the viewport so that fills the top half of the canvas.
In the browser, hold down the Ctrl key and then drag the viewport icon using
MB2 onto the page icon. This creates another viewport exactly the same as the
first. The position is also exactly the same which is why we can't see two viewports. In
the canvas, drag the selected viewport using MB1 to the bottom half of the canvas.
Double click on the lower title and change it.
Double click on the lower bar graph and set Y data to be wei_1
As well as copying chunks of the browser you can also move them. Using MB2
(without Ctrl) drag a graph into the domain of the other graph. The plot is
repainted with one plot containing two graphs and the other none. Move the graph
back to its original domain.
- Gsharp Script Language (GSL)
Once you have finished your plot it is a simple matter to
save your work as a script.
From the Command Toolbar click on the ScriptBuilder icon. The
ScriptBuilder appears.
From the Tools menu of the ScriptBuilder choose Generate GSL. The
commands to read your data and to create your plot appear. If you look through the code
you will see that for each object you have created there is a create command. The create
command creates the object and sets the resources that you set interactively.
In the call to create page_1.viewport_1 modify XuNbackgroundColor to be 19.
From the File Menu of the ScriptBuilder choose Run. Gsharp is reset, your data is
read and then your plot is created, this time with viewport_1 having a background colour
of 19.
Users can either work interactively or they can program in the script builder. You
don't need to spend time learning the basics of GSL as Gsharp can create it for you. GSL
also includes flow control and functions with parameters and local variables so users can
easily create scripts to create their commonly used graph types.
GSL scripts can also be used in batch mode to create hardcopy without any user
interaction. Once you have created your script you could for example run it every morning
to make a PostScript plot of the previous night's model run.
There are additional sections on interpolation, 2D and 3D contours and
colour handling if you want a 30 minute demonstration
- More complex examples
We have created only the simplest of plots, but it is also
possible to make far more complex plots.
From the File Menu of the main window choose Open. Set the File Type to GSL
Script. Load the following files: flight.gsl, helicopter.gsl and then vorticity.gsl.
These are examples of more complex charting and contour plots. Read further examples if
you wish.
- GUI Objects
With the latest version of Gsharp it also possible to configure the
interface using GSL. The following objects have been added: menu, button, icon, canvas,
dialog, bulletin and more. The objects are created using the same syntax as for Graphical
objects.
Paste the following code into the ScriptBuilder
create Menu gsharp_1.menubar.New;
create Button gsharp_1.menubar.New.Reset
( XuNguiLabel = "Another Reset",
XuNguiCallback = "GuiViewReset"
);
The call-back resource specifies the function that should be called when the object is
selected. This function can be written in GSL or can be one of the built-in functions such
as GuiViewReset.
From the Options menu of the ScriptBuilder turn off Reset before Run and the
choose Run from the File Menu. A new menu called New will appear in Gsharp.
Choose the Another Reset option from the New menu. The canvas is
reset.
- Gsharp Application Seat (GsharpApp)
As well as adding to or modifying the standard
interface of Gsharp it is also possible to create completely new applications using
GsharpApp. GsharpApp costs only a third of the normal Gsharp price but includes all parts
of the Gsharp Professional Edition apart from the tools (ScriptBuilder, DataManager,
Browser and Resource Editors). We also provide a GsharpApp for Windows (for a fifth of the
normal Gsharp price) so it is possible to run your GSL application on UNIX, VMS and
Windows without modification.
GsharpApp gives you so much for free (data import/export/manipulation, graphics, print
control, canvas interaction) and the interface is so easy to define that you can
concentrate your programming efforts on configuring the graphics to your needs. It is
possible for an end-user to create a small graphical applications in GSL in a fraction of
the time it would take a seasoned motif programmer to create the whole thing in Motif.
Many of our customer are now writing their old Toolmaster applications using the
GsharpApp seat giving faster program development and instant platform independence.
Companies who did not have the resources to create project specific applications for
their employees are now using the GsharpApp to create these applications and have
increased their employees productivity ten fold.
Quit Gsharp and try the following example of a Gsharp Application:
GsharpApp $UNIDIR/example/GsharpApp/ocean_temp/ocean_temp.gsa
- Gsharp Web Edition (GsharpWE)
Gsharp can of course be used to create plots off-line
which can be added to your web server, but it is also possible to use the Gsharp Web
Edition to create plots based on the input of a Web form. You could, for example, create a
form where users can select what data they would like to look at and how they would like
to see it. GsharpWE will then use these selections to create the plot. Rather than having
to create all the various combinations that you think customers would like to look at, you
create what they need when they ask for it - Graph on Demand.
It is also possible to create image-maps using GsharpWE. This can be used to allow
users to click on a Gsharp plot and then be presented with another plot showing the
underlying data of the bar or point they clicked on - Information drill-down.
There are examples of both techniques at http://www.iavsc.org/GsharpWE/