Implementing

Implementing the flow view is pretty straight forward. You'll need to do an include of the script file as shown below.

<SCRIPT TYPE="text/javascript" SRC="/path/to/flow_view.js"></SCRIPT>

From here, you will be able to call the init function as shown below, this can be called anywhere and will immediately start the flowview. There are a few placeholders which we will explain afterward.

InitFlowView("variable_name", "canvas_id", 800, 600);

Placeholders
  • variablename - Name of the global variable which will be used to store the FlowView variable. This is required since during run-time <variablename>.main() will be called via setTimeout. This ensures that we are refreshing and updating properly. Updates are always done but drawing only occurs if an update occurred, see Advanced Configuration for more information.
  • canvas_id - The ID of the canvas element; please note that this element MUST exist before InitFlowView() is called; the function will NOT create the element for you!
  • 800 - Width of the canvas, this variable is actually not required if it is not included, the width from canvas.style.width is used.
  • 600 - Height of the canvas, this variable is actually not required if it is not included, the width from canvas.style.height is used.

Next we'll see how to add new elements below.

variable_name.add(new FlowViewElement("Title"));

Placeholders
  • variable_name - Global FlowView variable.
  • Title - Title to be used.

This will create the basic flow view system. Now we'll look at Basic Configuration to see how to draw or add images to to the inner window.

Last edited Dec 19, 2010 at 1:43 AM by Suroot, version 1

Comments

No comments yet.