source: trunk/examples/objects/api/python/plot @ 1586

Last change on this file since 1586 was 1586, checked in by dkearney, 11 years ago

updating potential apis for c cpp and python. adding random() and diff()
functions to the rappture objects. objects should be able to generate a random
value for itself based on how it was configured. objects should be able to
compare itself with another object and tell us what the differences are.

File size: 7.7 KB
Line 
1Rappture.Plot
2
3constructors/destructors
4    Rappture.Plot([lib])
5    Rappture.Plot(o)
6
7methods
8    p.name([val])
9    p.path([val])
10    p.label([val])
11    p.desc([val])
12    p.hints([val])
13    p.color([val])
14    p.property(key[, val])
15    p.propremove(key)
16    p.add(x, y, fmt, name)
17    p.add(c, name)
18    p.count()
19    p.curve(name)
20    p.getNthCurve(n)
21
22    p.vvalue([...])
23    p.random()
24    p.diff(o)
25
26    p.configure(as, c)
27    p.dump(as, c)
28
29    p.outcome()
30
31    p.is()
32
33---------------------------------------
34Rappture.Plot([lib])
35    Purpose: construct a plot object
36    Input Arguments: at most 1
37        1. lib - Rappture library to associate this plot with
38    Return Value: a newly created, empty plot object
39    Notes: None
40    Code Example:
41
42Rappture.Plot(o)
43    Purpose: construct a plot object based on plot object o
44    Input Arguments: 1
45        1. o - plot object to copy
46    Return Value: a newly created plot object
47    Notes: None
48    Code Example:
49
50
51p.name([val])
52    Purpose: get/set the id name of the object
53    Input Arguments: at most 1
54        1. val - new id name
55    Return Value: the name of the object
56    Notes: if no name is set, None will be returned
57           the id name is used to identify this object from
58           all other objects and should be unique
59           val, if provided, is used to set the object name
60    Code Example:
61
62p.path([val])
63    Purpose: get/set the path of the object
64    Input Arguments: at most 1
65        1. val - new path
66    Return Value: path of the object
67    Notes: if no path is set, None will be returned
68           the path tells where this object sits in the
69           hierarchy of objects.
70           val, if provided, is used to set the object path
71    Code Example:
72
73p.label([val])
74    Purpose: get/set the label of the object
75    Input Arguments: at most 1
76        1. val - new label
77    Return Value: label of the object
78    Notes: if no label is set, None will be returned
79           the label is used by the graphical user interface.
80           val, if provided, is used to set the object label
81    Code Example:
82
83p.desc([val])
84    Purpose: get/set the description of the object
85    Input Arguments: at most 1
86        1. const char *val - new description
87    Return Value: description of the object
88    Notes: if no description is set, None will be returned
89           the description is used by the graphical user
90           interface to describe what type of data is being
91           requested and how the input is used.
92           val, if provided, is used to set the object description
93    Code Example:
94
95p.hints([val])
96    Purpose: get/set the hints of the object
97    Input Arguments: at most 1
98        1. val - new hints
99    Return Value: hints of the object
100    Notes: if no hints are set, None will be returned
101           the hints are used by the graphical user interface
102           val, if provided, is used to set the object hints
103    Code Example:
104
105p.color([val])
106    Purpose: get/set the color of the object
107    Input Arguments: at most 1
108        1. const char *val - new color
109    Return Value: color of the object
110    Notes: if no color is set, None will be returned
111           the color is used by the graphical user interface
112           val, if provided, is used to set the object color
113    Code Example:
114
115p.property(key[, val])
116    Purpose: get/set a generic property in the property database
117    Input Arguments: at most 2
118        1. const char *key - property name
119        2. const void *val - property value
120    Return Value: value of the property
121    Notes: A copy val is stored in the property database
122    Code Example:
123
124p.propremove(key)
125    Purpose: remove a property from the property database
126    Input Arguments: 1
127        1. key - property name
128    Return Value: value of the property
129    Notes: None
130    Code Example:
131
132p.add(x, y, fmt, name)
133    Purpose: add data for an xy curve to the plot
134    Input Arguments: 4
135        1. x - list/array representing the x axis
136        2. y - list/array representing the y axis
137        3. fmt - string format of the line
138        4. name - string id of the newly created curve
139    Return Value: Outcome object
140    Notes: format can be something like "g:o" to represent
141            green line, dotted line style, circle marker.
142            this follows matlab's formatting rules.
143    Code Example:
144
145p.add(c, name)
146    Purpose: add a Curve object to this Plot object
147    Input Arguments: 2
148        1. c - Curve object to add
149        2. name - id of the Curve object
150    Return Value: Outcome object
151    Notes: Curve object should not be deleted by user?
152    Code Example:
153
154p.count()
155    Purpose: retrieve the number of curves in this Plot object
156    Input Arguments: 0
157    Return Value: number of curves stored in the object
158    Notes: None
159    Code Example:
160
161p.curve(name)
162    Purpose: retrieve the curve with the id matching "name"
163    Input Arguments: 1
164        1. name - id to Curve to be retrieved
165    Return Value: Curve object matching "name" or None
166    Notes: None
167    Code Example:
168
169p.getNthCurve(n)
170    Purpose: return the n'th curve stored in the object
171    Input Arguments: 1
172        1. n - number of the curve to retrieve
173    Return Value: the n'th Curve object stored in
174                  the Plot object or None
175    Notes: None
176    Code Example:
177
178p.vvalue([...])
179    Purpose: return the value of the object after applying a
180             varying number of hints about how the value
181             should be configured
182    Input Arguments: variable numbber
183        1. variable number of hints
184    Return Value: value of the object
185    Notes: vvalue will parse out the recognisable hints from
186           va_list arg. Values stored in the object are
187           not changed. Hints should be of the form
188           hintKey=hintVal
189    Code Example:
190
191p.random();
192    Purpose: populate the object with a random value
193    Input Arguments: 0
194    Return Value: None
195    Notes: the current value of this object will be populated
196           with a random value that fits within the min and
197           max if they were specified.
198    Code Example:
199
200p.diff(o);
201    Purpose: return a list showing the differences between
202             this object and Rappture Object o
203    Input Arguments: 1
204        1. o - Rappture Object to diff against
205    Return Value: list of differences between objects
206    Notes: None
207    Code Example:
208
209p.configure(as, c)
210    Purpose: configure the object based on the data in "c".
211             use "as" to determine the type of data in "c".
212    Input Arguments: 2
213        1. as - type of data stored in "c".
214                valid values include:
215                    RPCONFIG_XML
216                    RPCONFIG_TREE
217        2. c - data to configure the object from.
218               if as is...     then c should be...
219               RPCONFIG_XML    const char *xmltext
220               RPCONFIG_TREE   RP_ParserXML *object
221    Return Value: None
222    Notes: object is configured based on values in "c"
223    Code Example:
224
225p.dump(as, c)
226    Purpose: dump the object values based to the object "c".
227             use "as" to determine how to dump the data.
228    Input Arguments: 2
229        1. as - type of data stored in "c".
230                valid values include:
231                    RPCONFIG_XML
232                    RPCONFIG_TREE
233        2. c - data to configure the object from.
234               if as is...     then c should be...
235               RPCONFIG_XML    ClientDataXml *object
236               RPCONFIG_TREE   RP_ParserXML *object
237    Return Value: None
238    Notes: None
239    Code Example:
240
241p.outcome()
242    Purpose: return the status of this object as an Outcome.
243    Input Arguments: 0
244    Return Value: status of the object as an Outcome
245    Notes: None
246    Code Example:
247
248p.is()
249    Purpose: return an integer tag describing the object.
250    Input Arguments: 0
251    Return Value: integer tag unique to all number objects
252    Notes: None
253    Code Example:
Note: See TracBrowser for help on using the repository browser.