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_: { [key: string]: any }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
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) => anycallback function (called after the draggable is moved)
Optional
onclickstart_callback: () => anycallback 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) => anycallback function (called after the draggable is moved)
Optional
onclickstart_callback: () => anycallback function (called at the start of the drag)
Move a draggable to a container
name of the draggable
name of the container
Register a callback function when a draggable is dropped outside of a container
callback function
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
reorder the tabindex of the containers
alias for dnd_initial_draw
Get the content size of a container
Get the data of the drag and drop objects with the format:
{container:string, content:string[]}[]
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) => anyCreate 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) => anycallback function that will be called when the locator is moved
Optional
callback_rightclick: (locator_name: string) => anycallback function that will be called when the locator is right clicked
WARNING: deprecated
use locator_initial_draw
instead
Set whether the content of the container should be sorted or not
Set the data of the drag and drop objects with the format:
{container:string, content:string[]}[]
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