|
Class: GnuplotGraphView
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
displays the graph of the data (in model) using a gnuplot script
Now also shown in the collection-inspector tab.
[instance variables:]
[class variables:]
copyrightCOPYRIGHT (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.
defaults
-
defaultScript
-
return a default initial gnuplot script
-
defaultScriptForDots
-
a default initial gnuplot script to show a dots diagram
-
defaultScriptForHistogram
-
a default initial gnuplot script to show a histogram
-
defaultScriptForLines
-
a default initial gnuplot script to show a line diagram
-
gnuplotCommand
-
self gnuplotCommand
-
gnuplotCommand: aCommandString
-
self gnuplotCommand:'gnuplot'
menu specs
-
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
|
accessing
-
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
-
data
-
-
data: aVector
-
Modified (format): / 04-06-2022 / 16:17:06 / cg
-
gnuplotCommand
-
self basicNew gnuplotCommand
-
gnuplotCommand: something
-
-
hasNoScript
-
-
hasScript
-
-
magnificationFactor: aNumber
-
(comment from inherited method)
explicitMagnificationFactor ~= aNumber
-
maxX
-
-
maxX: anInteger
-
-
minX
-
-
minX: anInteger
-
-
script
-
-
script: something
-
-
title
-
-
title: something
-
-
xAxisMax: maxX
-
-
xAxisMin: minX
-
aspects
-
formatHolder
-
defaults
-
defaultScript
-
drawing
-
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
-
generateImage
-
generates the magnifiedImage right away
self new
script:(GnuplotGraphView defaultScript);
data:(RandomGenerator new next:50);
open
-
generateMagnifiedImage
-
super generateMagnifiedImage.
-
image
-
if a fallback is shown, fetch the image from that one
-
redrawX: x y: y width: w height: h
-
name:' sqrt(x) '.
-
showWarning
-
-
sizeChanged: how from: oldExtentOrNil
-
my view has changed the size (not the contents)
-
updateImageAfterSizeChange
-
(comment from inherited method)
self clear.
menu
-
smoothFitBigMenuItemVisible
-
-
smoothingMenuItemVisible
-
menu actions
-
formatChanged
-
-
menuChangeRange
-
-
menuUpdate
-
mvc
-
updateFromModel
-
the model changes, set my image
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.
|
|