Active filtering provides a way to filter connection targets when a drag begins. Try dragging a connection from one node to another - when you start to drag, the available targets are filtered.
How is it configured?
Active filtering is configured via a plugin for the Surface renderer in the Toolkit. When an activeFiltering plugin is set on a Surface and a beforeConnect function is supplied to the Toolkit's constructor, that function is called before a new connection is dragged, for every possible target for the current source. Whenever the beforeConnect method returns false, the corresponding target object (a node, group or port) is disabled, and the user will not be able to drop the connection onto it.
In this demonstration, each node contains a set of entries which each contain the name of two types of animal. Entries are deemed connectable if one or more animals from the source entry are matched in a given target. Disabled vertices have a data-jtk-enabledattribute written onto them with a value of false, allowing you to easily control their appearance via CSS.
What layout is used in this demo?
We use the Toolkit's ForceDirected layout in this demonstration. A Force directed layout is a layout in which the edges between vertices are thought of as springs, where the existence of an edge between two vertices has the effect of drawing them closer together.
When the user clicks 'Add a node', a new vertex is added and the layout is re-run. Note though that the position of vertices that have already been processed by the layout is unchanged. You can instruct the force directed layout to recompute every position but from a UX standpoint it's generally a better experience to only run the layout in an incremental fashion, so that is what the Toolkit does by default.
Fully featured flowchart builder for you to use as a base for your own apps. Includes support for custom shapes, edge routing, node resizing, and SVG/PNG/JPG export. Angular, Vue 2, Vue 3, React and Svelte versions available.
Includes support for tables, views, multiple columns types, and column relationships. Easily extensible. Angular, Vue 2, Vue 3 and React versions available.
Use the Toolkit to build a chatbot flow, with actions, messages, input and choices. Angular, Vue 2, Vue 3, React and Svelte versions available.
The Toolkit makes it simple to build interactive org charts. This starter app uses the classic org chart layout and provides an inspector from which the user can navigate around. Angular, Vue 2, Vue 3 and React versions available.
Simple mindmap builder, highlighting several advanced features the Toolkit offers, such as custom layouts, parsers and exporters
Learn about how the Toolkit lets you work with groups nested to an arbitrary level, with full drag and drop support.
Leverage the Toolkit's underlying Directed Graph to visualize paths between elements.
This app is designed to give you a basic starter app from which you can build your own, without any of the bells and whistles included in our other starter apps.
Fully featured image processor using HTML canvas for you to use as a base for your own apps. Angular, Vue 2, Vue 3, React and Svelte versions available.
Use popups and the Toolkit's ability to dynamically render selections to provide neighbourhood contextual information for some selected element
Filter drag targets as your users start to drag new connections using the ActiveFiltering plugin.
An adaptable connector that consists of a series of segments, with the option to smooth to a set of Bezier splines
The classic organization chart layout, with support for horizontal/vertical axis and a number of different alignment options
A playground for testing the various layouts that the Toolkit offers - Hierarchy, Force Directed, Circular, Balloon and more.
Use the Toolkit's ability to render a dynamically collapsible and expandable hierarchy.