Vector FIeld

UI Object that displays a vector field. The vectors are draw in a normal coordinate system with the y-axis pointing upwards and the x-axis to the right.

the vectorfield object
Example Vector Field View

A vector field can also be displayed on top of a grid as in the example below that uses arrows scaled by 0.8 and a stroke_width of 4. This example exploits that a vector with value (0, 0) is not drawn and that objects on top of other objects autmoatically becomes transparent.

vectorfield on top of a grid
Vector Field on a Grid

Example XML definition

  <object
    class="VectorField" 
    module="MY_MODULE" 
    source="MY_OUTPUT" 
    x="0" 
    y="0"
  />

Attributes

Attribute Description Default
class must be "VectorField"  
x placement of the object  
y placement of the object  
w width of the object 1
h height of the object 1
x_module name of the module to be visualized as a set of arrows  
x_source name of the output with the x part of the direction  
y_module name of the module to be visualized as a set of arrows  
y_source name of the output with the y part of the direction  
stroke_width stroke_width of the arrow 2
circle_color color of the circle draw behind the arrows "none"
scale scaling of the arrows 1
title title of the object module.source
Attributes without default values must be specified except where described above.

Author

Christian Balkenius
Lund University Cognitive Science
christian.balkenius@lucs.lu.se

Files

VectorField.js