the div that contains the control elements
Optional
diagram_outer_svg: SVGSVGElementthe svg element that contains the diagram * only needed if you want to use the locator
Optional
inp_object_: { the object that contains the variables * only needed if you want to use custom input object
the div that contains the control elements
Optional
diagram_the svg element that contains the diagram * only needed if you want to use the locator
Create a toggle button
name of the button
diagram of the button when it is on
diagram of the button when it is off
initial state of the button
Optional
callback: ((name: string, state: boolean) => any)callback function when the button state is changed
id of the object
list of classes of the object
diagram of the object
the svg element of the object
Create a custom interactive object
id of the object
list of classes of the object
diagram of the object
the
Create a drag and drop container
name of the container
diagram of the container
Optional
capacity: numbercapacity of the container (default is 1)
Optional
config: dnd_container_configconfiguration of the container positioning
the configuration is an object with the following format:
{type:"horizontal-uniform"}
, {type:"vertical-uniform"}
, {type:"grid", value:[number, number]}
{type:"horizontal", padding:number}
, {type:"vertical", padding:number}
{type:"flex-row", padding:number, vertical_alignment:VerticalAlignment, horizontal_alignment:HorizontalAlignment}
you can also add custom region box for the target by adding custom_region_box: [Vector2, Vector2]
in the config
you can also add a sorting function for the target by adding sorting_function: (a: string, b: string) => number
Create a drag and drop draggable
name of the draggable
diagram of the draggable
Optional
container_diagram: Diagramdiagram of the container, if not provided, a container will be created automatically
Optional
callback: ((name: string, pos: Vector2) => any)callback function (called after the draggable is moved)
Optional
onclickstart_callback: (() => any)callback function (called at the start of the drag)
Create a drag and drop draggable that is positioned into an existing container
name of the draggable
diagram of the draggable
name of the container
Optional
callback: ((name: string, container: string) => any)callback function (called after the draggable is moved)
Optional
onclickstart_callback: (() => any)callback function (called at the start of the drag)
Register a validation function when a draggable is moved to a container If the function return false, the draggable will not be moved
validation function
Create a locator Locator is a draggable object that contain 2D coordinate information
name of the variable
initial value
radius of the locator draggable object
color of the locator
Optional
track_diagram: Diagramif provided, the locator will snap to the closest point on the diagram
Optional
callback: ((locator_name: string, position: Vector2) => any)Create a locator with custom diagram object
name of the variable
initial value
diagram of the locator
Optional
track_diagram: Diagramif provided, the locator will snap to the closest point on the diagram
if true, the locator will blink
Optional
callback: ((locator_name: string, position: Vector2) => any)callback function that will be called when the locator is moved
Optional
callback_rightclick: ((locator_name: string) => any)callback function that will be called when the locator is right clicked
Create a slider
name of the variable
minimum value
maximum value
initial value
step size
time of the animation in milliseconds
function to format the display of the value
Object that controls the interactivity of the diagram