Drag-and-drop interface to edit, dissect and-rearrange tree structures with arbitrary data sitting in their nodes.
Msg type annotation for the program.
Update method, with the global editor Config as its first argument.
A custom version of update, using a configuration.
A special update configuration object used in the custom updateWith method. It holds the following fields:
- `centerAt`: given the width and height of the canvas as float values, where should an activated node be centered. Defaults to `\width height -> ( width / 2, height / 2 )`The view, as a function of the Config, some custom html attributes for the container, and the Model.
Subscriptions responsible for obtaining animation frames used when animating a view centering. See example for usage.
Returns the current active node. Returns a tuple of Maybe item (as the node maybe a placeholder for a new node), as well as its coordinates on the screen. Use these coordinates to position an active node-related pop-up (see example).
Sets a new item at the active node. This may be adding a completely new item from scratch (in case the current node is a placeholder), or modifying an existing one. Typically, the modification is based off an original value provided by the activeNode method.
Delete the active node from a tree, including all of its children. If a placeholder is active, this method does nothing.
Model, used for type annotation.