A module which implemnts a WSF Component for displaying and editing graphs.object WsfGraph WsfComponent
object WsfGraph WsfComponent
The function which returns the node list. This is set by the constructor to its first argument.
The (relative or absolute) URL to the directory in which the images used by this component can be found. This are the files 'images/wsf_graph_*' in the SPL sources.
Per default, nodes can be moved to any position. It is possible to use a raster to align the nodes. If you want that, set this variable to the size of the raster (e.g. 10 is a good value).
Additional HTML text to be inserted in the HTML header of the iframe.
Additional HTML text to be inserted at the end of the HTML text in the iframe.
Additional attributes to be added in the <iframe> tag. Usually this is something like 'style="width:100%; height:100%"'.
var WsfGraph.scroll_x, scroll_y;
Some changes require a reload of the iframe. The current scroll position is then preserved using this attributes. It is also possible to adjust this values when setting the 'dirty' variable to '1'.
The main method for the iframe. This is called whenever the iframe content is reloaded and prints the new content of the iframe.
method WsfGraph.init(_get_list, _ibase);
The Constructor. The parameters are copied to the get_list and ibase variables. The first parameter must be a function pointer. This function, when called, must return an array of objects implementing the WsfGraphNode interface. This objects describe the entire graph and also provide callbacks to react on user events.
The node objects used by WsfGraph must implement this interface. Some of the methods in this interface are optional.
This method returns the position and size of the node in pixel. The return value must be a hash with the keys 'x' and 'y' for the x- and y-coordinate of the left upper corner (0,0 is the left upper corner of the drawing area) and 'w' and 'h' for the width and height.
method WsfGraphNode.set_xy(x, y);
When a node is moved or clicked, this callback is called. The new x- and y-coordinates are passed as parameters.
This method returns an array with the IDs of the nodes this node has connections to. The IDs must correspond with the keys in the array returned by WsfGraph.get_list.
This callback is called when one of the connections of the node are clicked. The ID (see get_links) of the target node of the connection is passed as parameter. This method is optional. WsfGraph will not try to call it when is is not declared.
This method must return the background color for this node. The return value is a string in the usual HTML color '#RRGGBB' format. This method is optional. WsfGraph will not try to call it when it is not declared.
This method must return the HTML content for this node. Usually this is just a label text, but it can any HTML code. This method is optional. WsfGraph will not try to call it when it is not declared.
|Generated by SPLDOC.||http://www.clifford.at/spl/|