eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'GnuplotGraphView':

Home

Documentation
www.exept.de
Everywhere
for:
[back]

Class: GnuplotGraphView


Inheritance:

   Object
   |
   +--GraphicsMedium
      |
      +--DisplaySurface
         |
         +--SimpleView
            |
            +--View
               |
               +--ImageView
                  |
                  +--GnuplotGraphView

Package:
stx:libwidg2
Category:
Views-Graphs
Version:
rev: 1.28 date: 2023/07/06 14:35:35
user: cg
file: GnuplotGraphView.st directory: libwidg2
module: stx stc-classLibrary: libwidg2

Description:


displays the graph of the data (in model) using a gnuplot script
Now also shown in the collection-inspector tab.


[instance variables:]

[class variables:]

copyright

COPYRIGHT (c) 2018 by eXept Software AG All Rights Reserved This software is furnished under a license and may be used only in accordance with the terms of that license and with the inclusion of the above copyright notice. This software may not be provided or otherwise made available to, or used by, any other person. No title to or ownership of the software is hereby transferred.

Class protocol:

defaults
o  defaultScript
return a default initial gnuplot script

o  defaultScriptForDots
a default initial gnuplot script to show a dots diagram

o  defaultScriptForHistogram
a default initial gnuplot script to show a histogram

o  defaultScriptForLines
a default initial gnuplot script to show a line diagram

o  gnuplotCommand
self gnuplotCommand

o  gnuplotCommand: aCommandString
self gnuplotCommand:'gnuplot'

menu specs
o  middleButtonMenuExtraSlice
This resource specification was automatically generated
by the MenuEditor of ST/X.

Usage example(s):

     MenuEditor new openOnClass:GnuplotGraphView andSelector:#middleButtonMenuExtraSlice
     (Menu new fromLiteralArrayEncoding:(GnuplotGraphView middleButtonMenuExtraSlice)) startUp


Instance protocol:

accessing
o  adjust: layoutSymbol
(comment from inherited method)
set the adjust (how the image is displayed);
currently, support #topLeft, #center, #fitBig, #fitSmall and #fit:
#topLeft - image is displayed as usual
#center - image is shown centered
#fitBig - big images are shrunk to make it fit the view
#fitSmall - small images are magnified to make it fit the view,
#fit - all images are magnified to fit the view
#topLeftNoZoom - image is displayed as usual, and magnification is reset
#smoothFitBig - fitBig with smoothing
#smoothFitSmall - fitSmall with smoothing
#smoothFit - fit with smoothing

o  data

o  data: aVector
Modified (format): / 04-06-2022 / 16:17:06 / cg

o  gnuplotCommand
self basicNew gnuplotCommand

o  gnuplotCommand: something

o  hasNoScript

o  hasScript

o  magnificationFactor: aNumber
(comment from inherited method)
explicitMagnificationFactor ~= aNumber

o  maxX

o  maxX: anInteger

o  minX

o  minX: anInteger

o  script

o  script: something

o  title

o  title: something

o  xAxisMax: maxX

o  xAxisMin: minX

aspects
o  formatHolder

defaults
o  defaultScript

drawing
o  generateDataFileIn: aDirectory
the format of data expected by gnuplot depends on the type of plot:
regular plot: a number of values (each in a separate line)
multiCol plots: a number of lines, each containing a row
here, handle common situations;
however, if the data does not match, the program should have prepared the
data into a string and present it as such.
Strings will be sent as-is to the file

o  generateImage
generates the magnifiedImage right away

self new
script:(GnuplotGraphView defaultScript);
data:(RandomGenerator new next:50);
open

o  generateMagnifiedImage
super generateMagnifiedImage.

o  image
if a fallback is shown, fetch the image from that one

o  redrawX: x y: y width: w height: h
name:' sqrt(x) '.

o  showWarning

o  sizeChanged: how from: oldExtentOrNil
my view has changed the size (not the contents)

o  updateImageAfterSizeChange
(comment from inherited method)
self clear.

menu
o  smoothFitBigMenuItemVisible

o  smoothingMenuItemVisible

menu actions
o  formatChanged

o  menuChangeRange

o  menuUpdate

mvc
o  updateFromModel
the model changes, set my image


Examples:


Notice that everything between [exBegin] and [exEnd] is extracted by the html-doc generator to create nicely formatted and clickable executable examples in the generated html-doc. (see the browsers class-documentation menu items for more) trying the widget as standAlone view (with a fix script):
   GnuplotGraphView new 
       script:(GnuplotGraphView defaultScript);
       model:(ValueHolder with:(Random new next:100));
       adjust:#smoothFit;
       extent:400@300;
       open
trying the widget as standAlone view (with no fix script):
   GnuplotGraphView new 
       model:(ValueHolder with:(Random new next:100));
       adjust:#smoothFit;
       extent:300@200;
       open
embedded in another view:
   |top v|

   top := StandardSystemView new.
   top extent:300@300.
   v := GnuplotGraphView new.  
   v data:(Random new next:100).
   v origin:0.0@0.0 corner:1.0@1.0.
   top add:v.
   top open
embed scrollabe in another view:
   |top v|

   top := StandardSystemView new.
   top extent:300@300.
   v := HVScrollableView for:GnuplotGraphView.  
   v data:(Random new next:100).
   v origin:0.0@0.0 corner:1.0@1.0.
   top add:v.
   top open
use as inspect tab:
   (Random new next:100) inspect.


ST/X 7.7.0.0; WebServer 1.702 at 20f6060372b9.unknown:8081; Mon, 18 Nov 2024 06:46:20 GMT