<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <link rel="stylesheet" href="style.css" type="text/css"> <meta content="text/html; charset=iso-8859-1" http-equiv="Content-Type"> <link rel="Start" href="index.html"> <link rel="previous" href="Db.html"> <link rel="next" href="Monitor_sig.html"> <link rel="Up" href="index.html"> <link title="Index of types" rel=Appendix href="index_types.html"> <link title="Index of exceptions" rel=Appendix href="index_exceptions.html"> <link title="Index of values" rel=Appendix href="index_values.html"> <link title="Index of modules" rel=Appendix href="index_modules.html"> <link title="Index of module types" rel=Appendix href="index_module_types.html"> <link title="Binary" rel="Chapter" href="Binary.html"> <link title="Bproto" rel="Chapter" href="Bproto.html"> <link title="Db" rel="Chapter" href="Db.html"> <link title="Graph" rel="Chapter" href="Graph.html"> <link title="Monitor_sig" rel="Chapter" href="Monitor_sig.html"> <link title="Ocamlviz" rel="Chapter" href="Ocamlviz.html"> <link title="Ocamlviz_threads" rel="Chapter" href="Ocamlviz_threads.html"> <link title="Protocol" rel="Chapter" href="Protocol.html"> <link title="Timemap" rel="Chapter" href="Timemap.html"><title>Graph</title> </head> <body> <div class="navbar"><a href="Db.html">Previous</a> <a href="index.html">Up</a> <a href="Monitor_sig.html">Next</a> </div> <center><h1>Module <a href="type_Graph.html">Graph</a></h1></center> <br> <pre><span class="keyword">module</span> Graph: <code class="code">sig</code> <a href="Graph.html">..</a> <code class="code">end</code></pre>A module that builds a graph on a Lablgtk drawing area<br> <hr width="100%"> <br><code><span class="keyword">type</span> <a name="TYPEkind"></a><code class="type"></code>kind = </code><table class="typetable"> <tr> <td align="left" valign="top" > <code><span class="keyword">|</span></code></td> <td align="left" valign="top" > <code><span class="constructor">Undefined</span></code></td> </tr> <tr> <td align="left" valign="top" > <code><span class="keyword">|</span></code></td> <td align="left" valign="top" > <code><span class="constructor">Int</span></code></td> </tr> <tr> <td align="left" valign="top" > <code><span class="keyword">|</span></code></td> <td align="left" valign="top" > <code><span class="constructor">Float</span></code></td> </tr> <tr> <td align="left" valign="top" > <code><span class="keyword">|</span></code></td> <td align="left" valign="top" > <code><span class="constructor">Byte</span></code></td> </tr> <tr> <td align="left" valign="top" > <code><span class="keyword">|</span></code></td> <td align="left" valign="top" > <code><span class="constructor">Percentage</span></code></td> </tr></table> <div class="info"> The kind of the datas represented on the graph<br> </div> <br><code><span class="keyword">type</span> <a name="TYPEstyle"></a><code class="type"></code>style = </code><table class="typetable"> <tr> <td align="left" valign="top" > <code><span class="keyword">|</span></code></td> <td align="left" valign="top" > <code><span class="constructor">Full</span></code></td> </tr> <tr> <td align="left" valign="top" > <code><span class="keyword">|</span></code></td> <td align="left" valign="top" > <code><span class="constructor">Dashed</span></code></td> </tr> <tr> <td align="left" valign="top" > <code><span class="keyword">|</span></code></td> <td align="left" valign="top" > <code><span class="constructor">Empty</span></code></td> </tr></table> <div class="info"> The way a point is drawn on the graph<br> </div> <pre><span class="keyword">type</span> <a name="TYPEt"></a><code class="type"></code>t </pre> <div class="info"> The abstract type for a graph.<br> </div> <pre><span class="keyword">type</span> <a name="TYPEelt"></a><code class="type"></code>elt </pre> <div class="info"> The abstract type for a function of the graph.<br> </div> <pre><span class="keyword">val</span> <a name="VALcreate"></a>create : <code class="type">?width:int -><br> ?height:int -><br> ?timeout:int -><br> ?steps:int -><br> ?grid_divx:int -><br> ?grid_divy:int -><br> ?lborder:float -><br> ?rborder:float -><br> ?vborder:float -><br> ?xaxis:int -><br> ?yaxis:int -><br> ?packing:(GObj.widget -> unit) -> ?kind:<a href="Graph.html#TYPEkind">kind</a> -> unit -> <a href="Graph.html#TYPEt">t</a></code></pre><div class="info"> <code class="code">create ()</code> creates an empty graph that is a GMisc.drawing_area.<br> </div> <div class="param_info"><code class="code">width</code> : Widget's width</div> <div class="param_info"><code class="code">timeout</code> : Graph refresh period (in milliseconds).</div> <div class="param_info"><code class="code">steps</code> : The number of values displayed on the graph</div> <div class="param_info"><code class="code">grid_divx</code> : The number of divisions of the background along the X-axis</div> <div class="param_info"><code class="code">grid_divy</code> : The number of divisions of the background along the Y-axis</div> <div class="param_info"><code class="code">lborder</code> : The size of the left border of the widget</div> <div class="param_info"><code class="code">rborder</code> : The size of the right border of the widget</div> <div class="param_info"><code class="code">vborder</code> : The size of the two borders above and below the drawing area</div> <div class="param_info"><code class="code">xaxis</code> : The frequency of the X-axis legend (1 = always displayed, 2 = half displayed etc...)</div> <div class="param_info"><code class="code">yaxis</code> : The frequency of the Y-axis legend</div> <div class="param_info"><code class="code">packing</code> : The widget to which the graph is packed</div> <div class="param_info"><code class="code">kind</code> : The kind of the graph</div> <pre><span class="keyword">val</span> <a name="VALadd"></a>add : <code class="type"><a href="Graph.html#TYPEt">t</a> -><br> <a href="Protocol.html#TYPEtag">Protocol.tag</a> -><br> ?name:string -><br> (unit -> float * <a href="Graph.html#TYPEstyle">style</a>) -><br> <a href="Graph.html#TYPEkind">kind</a> -> float * float * float -> <a href="Graph.html#TYPEelt">elt</a></code></pre><div class="info"> <code class="code">add g tag n f k c</code> adds a function <code class="code">f</code> with name <code class="code">n</code> to the graph <code class="code">g</code> and returns it as an element of this graph. The function type of the graph is <code class="code">k</code>. The function will be displayed with the color <code class="code">c</code> which is a rgb color with the floating-point numbers spread from 0.0 to 1.0.<br> </div> <div class="param_info"><code class="code">name</code> : Function name</div> <pre><span class="keyword">val</span> <a name="VALremove"></a>remove : <code class="type"><a href="Graph.html#TYPEt">t</a> -> <a href="Graph.html#TYPEelt">elt</a> -> unit</code></pre><div class="info"> <code class="code">remove g f</code> removes the function <code class="code">f</code> from the graph <code class="code">g</code>.<br> </div> <pre><span class="keyword">val</span> <a name="VALset_visible"></a>set_visible : <code class="type"><a href="Graph.html#TYPEelt">elt</a> -> bool -> unit</code></pre><div class="info"> <code class="code">set_visible f b</code> displays the function f on the graph according to <code class="code">b</code>.<br> </div> <pre><span class="keyword">val</span> <a name="VALset_preferences"></a>set_preferences : <code class="type"><a href="Graph.html#TYPEt">t</a> -> step:int -> divx:int -> divy:int -> xaxis:int -> yaxis:int -> unit</code></pre><div class="info"> <code class="code">set_preferences g step divx divy xaxis yaxis ()</code> changes the value of these arguments in the graph <code class="code">g</code>.<br> </div> <div class="param_info"><code class="code">step</code> : The number of values displayed on the graph</div> <div class="param_info"><code class="code">divx</code> : The number of divisions of the background along the X-axis</div> <div class="param_info"><code class="code">divy</code> : The number of divisions of the background along the Y-axis</div> <div class="param_info"><code class="code">xaxis</code> : The frequency of the X-axis legend (1 = always displayed, 2 = half displayed etc...)</div> <div class="param_info"><code class="code">yaxis</code> : The frequency of the Y-axis legend</div> <pre><span class="keyword">val</span> <a name="VALset_color"></a>set_color : <code class="type"><a href="Graph.html#TYPEelt">elt</a> -> float * float * float -> unit</code></pre><div class="info"> <code class="code">set_color f c</code> sets the color <code class="code">c</code> used to display the function <code class="code">f</code>. <code class="code">c</code> is a rgb color with the floating-point numbers spread from 0.0 to 1.0.<br> </div> <pre><span class="keyword">val</span> <a name="VALget_color"></a>get_color : <code class="type"><a href="Graph.html#TYPEelt">elt</a> -> float * float * float</code></pre><div class="info"> <code class="code">get_color f</code> returns the current color used to display the function <code class="code">f</code>. The color is a rgb color with the floating-point numbers spread from 0.0 to 1.0.<br> </div> <pre><span class="keyword">val</span> <a name="VALget_nb_fct"></a>get_nb_fct : <code class="type"><a href="Graph.html#TYPEt">t</a> -> int</code></pre><div class="info"> <code class="code">get_nb_fct g</code> return the number of functions displayed on <code class="code">g</code>.<br> </div> <pre><span class="keyword">val</span> <a name="VALget_kind"></a>get_kind : <code class="type"><a href="Graph.html#TYPEt">t</a> -> <a href="Graph.html#TYPEkind">kind</a></code></pre><div class="info"> <code class="code">get_kind g</code> returns the kind of the graph <code class="code">g</code>.<br> </div> <pre><span class="keyword">val</span> <a name="VALstop"></a>stop : <code class="type"><a href="Graph.html#TYPEt">t</a> -> unit</code></pre><div class="info"> <code class="code">stop g</code> stops the timer inside the graph <code class="code">g</code>. This function is necessary to remove cleanly the graph <code class="code">g</code> from a graphical user interface.<br> </div> <pre><span class="keyword">val</span> <a name="VALresume"></a>resume : <code class="type"><a href="Graph.html#TYPEt">t</a> -> unit</code></pre><div class="info"> <code class="code">resume g</code> restarts the timer of the graph <code class="code">g</code> with its old period.<br> </div> <pre><span class="keyword">val</span> <a name="VALrestart"></a>restart : <code class="type"><a href="Graph.html#TYPEt">t</a> -> int -> unit</code></pre><div class="info"> <code class="code">restart g p</code> clears the graph <code class="code">g</code> and restarts the timer with the period <code class="code">p</code>.<br> </div> <pre><span class="keyword">val</span> <a name="VALclear"></a>clear : <code class="type"><a href="Graph.html#TYPEt">t</a> -> unit</code></pre><div class="info"> <code class="code">clear g</code> clears the graph.<br> </div> <pre><span class="keyword">val</span> <a name="VALset_timer"></a>set_timer : <code class="type"><a href="Graph.html#TYPEt">t</a> -> int -> unit</code></pre><div class="info"> <code class="code">set_timer g t</code> removes the timer inside <code class="code">g</code> and replaces it with a new timer whose new timer period will be <code class="code">t</code> (in milliseconds).<br> </div> <pre><span class="keyword">val</span> <a name="VALget_timer"></a>get_timer : <code class="type"><a href="Graph.html#TYPEt">t</a> -> GMain.Timeout.id option</code></pre><div class="info"> <code class="code">get_timer g</code> returns the timer inside <code class="code">g</code>.<br> </div> <pre><span class="keyword">val</span> <a name="VALget_period"></a>get_period : <code class="type"><a href="Graph.html#TYPEt">t</a> -> int</code></pre><div class="info"> <code class="code">get_period g</code> returns the value of the timer inside <code class="code">g</code> (in milliseconds).<br> </div> <pre><span class="keyword">val</span> <a name="VALget_steps"></a>get_steps : <code class="type"><a href="Graph.html#TYPEt">t</a> -> int</code></pre><div class="info"> <code class="code">get_steps g</code> returns the number of values that are displayed in the graph <code class="code">g</code> for each function.<br> </div> <pre><span class="keyword">val</span> <a name="VALget_gridx"></a>get_gridx : <code class="type"><a href="Graph.html#TYPEt">t</a> -> int</code></pre><div class="info"> <code class="code">get_gridx g</code> returns the number of divisions of the background along the X-axis on the graph <code class="code">g</code>.<br> </div> <pre><span class="keyword">val</span> <a name="VALget_gridy"></a>get_gridy : <code class="type"><a href="Graph.html#TYPEt">t</a> -> int</code></pre><div class="info"> <code class="code">get_gridy g</code> returns the number of divisions of the background along the Y-axis on the graph <code class="code">g</code>.<br> </div> <pre><span class="keyword">val</span> <a name="VALget_xaxis"></a>get_xaxis : <code class="type"><a href="Graph.html#TYPEt">t</a> -> int</code></pre><div class="info"> <code class="code">get_xaxis g</code> returns the frequency of the X-axis legend of the graph <code class="code">g</code> (1 = always displayed, 2 = half displayed etc...)<br> </div> <pre><span class="keyword">val</span> <a name="VALget_yaxis"></a>get_yaxis : <code class="type"><a href="Graph.html#TYPEt">t</a> -> int</code></pre><div class="info"> <code class="code">get_yaxis g</code> returns the frequency of the Y-axis legend of the graph <code class="code">g</code> (1 = always displayed, 2 = half displayed etc...)<br> </div> </body></html>