Skip to content

data_node_selector

Displays a list of the Data Node entities that can be selected.

Properties

Name Type Default Description
value(★) Union[DataNode,list[DataNode]]
dynamic

Bound to the selected DataNode or DataNodes, or None if there is none.

scenario Union[Scenario,list[Scenario]]
dynamic

If set, the selector will only show the data nodes owned by this scenario or any scenario in the list.

datanodes list[Union[DataNode,Scenario,Cycle]]
dynamic

The list of DataNodes, Scenarios, or Cycles to show.
All all DataNodes, Scenarios, and Cycles are shown if this is None.

multiple bool False

If True, the user can select multiple data nodes, therefore the value property can hold a list of DataNode objects.

filter Union[bool,str,taipy.gui_core.filters.DataNodeFilter,list[Union[str,taipy.gui_core.filters.DataNodeFilter]]] "*"

A list of DataNode property names to filter on.
If False, users cannot filter data nodes.

sort Union[bool,str,taipy.gui_core.filters.DataNodeFilter,list[Union[str,taipy.gui_core.filters.DataNodeFilter]]] "*"

A list of DataNode property names to sort on.
If False, do not allow sort.

show_search bool True

If False, prevents users from searching for data nodes by label.

show_pins bool True

If True, a pin is shown on each item of the selector and allows to restrict the number of displayed items.

display_cycles bool True

If False, the cycles are not shown in the selector.

show_primary_flag bool True

If False, the primary scenarios are not identified with specific visual hint.

on_change Union[str, Callable]

A function or the name of a function that is triggered when a data node is selected.
The parameters of that function are all optional:

  • state (State): the state instance.
  • var_name (str): the variable name.
  • value (DataNode): the selected data node.

height str "50vh"

The maximum height, in CSS units, of the control.

id str

The identifier that will be assigned to the rendered HTML component.

class_name str
dynamic

The list of CSS class names associated with the generated HTML Element.
These class names will be added to the default taipy_gui_core-data_node_selector.

(★)value is the default property for this visual element.

Details

The Data Node Selector control displays a tree-like structure listing all available data nodes. This visual element list all the available data nodes, potentially organizing them hierarchically based on their owning scenario (and cycle if display_cycles is set to True).

In an application where multiple data nodes have been created, some scoped at the scenario level, the selector might appear as follows:

The list of selectable data nodes

Data nodes are organized in their owning scenario and cycle, when relevant.
In this example, cleaned_dataset and initial_dataset are scoped at the Scope.GLOBAL level.
Expanding the 'My scenario' item (by clicking the icon) reveals data nodes scoped at Scope.SCENARIO.

When the user selects a data node, the on_change callback is triggered allowing the application to respond to the user's selection. The selected node's value is reflected in the control's value property.

At the top of the control, a toolbar provides additional functionality via a series of icons. These icons allow users to perform various actions:

Data Node Selector toolbar

Users can interact with the icons in the toolbar to perform various tasks:

  • : Opens a filter configuration dialog, allowing users to define filters that apply to the list of data nodes.
  • : Enables users to specify sorting preferences for organizing the data nodes in the list.
  • : Toggles the visibility of a text search box, which helps users locate specific data nodes quickly.

Filtering

The Filter functionality allows users to refine the list of data nodes by applying one or more criteria.

Opening the Filter dialog

When the user presses the icon (Filter), the following dialog appears:

Initialize filters

All the filters that are currently applied to the list of data nodes are shown. So far, the list is empty.

Creating a new filter

To create a new filter, the user must select a filtering criterion from the dropdown menu in the first field:

Filter criteria dialog

After selecting a criterion, the 'Action' dropdown updates with comparison options specific to the selected criterion.
The available comparisons depend on the type of the selected field:

  • Boolean: Options include "is" and "is not." The value field accepts True or False.
  • String: Options include "is," "is not," and "contains." The value field accepts a text value.
  • Number: Options include "equals," "does not equal," "is less than," "is less than or equal to," "is greater than or equal to" and "is greater than." The value field accepts a numerical value.
  • Date: Options include "is on," "is not on," "is before," "is on or before," "is on or after" and "is after." The value field accepts a date value.

To list all data nodes with labels containing the string "eva", the user would configure a filter as follows:

Create a new filter

To add this filter to the filters list, the user must press the icon (Check).
Multiple filters can be added as needed.

To close the filter configuration dialog, the user must click outside the dialog area.

Once filters are added, they are applied immediately. The filtered data node list appears as shown:

Filters applied

To remove a filter from the list, the user would open the filters dialog ( icon), locate the criterion that must be removed and delete it pressing the icon (Delete).

Sorting

The Data Node Selector sorts data nodes by default in alphabetically ascending order based on their labels. Grouping is applied according to their respective Cycle or Scenario, if applicable

Users can define custom sorting criteria to modify how data nodes are ordered. This process is similar to filtering and allows users to create a sequence of sorting rules applied in order of priority.

Each sorting criterion specifies:

  • The property of the data node to sort by (e.g., label, last edit date, etc.).
  • The order: either ascending or descending.

Consider the following initial list of data nodes displayed in the selector:

Initial data nodes list

When the user presses the icon (Sort), the sorting configuration dialog appears:

Sorting configuration dialog

The user can select a property from the dropdown and specify the sorting order: 'asc' (Ascending) or 'desc' (Descending).

In the following image, the user has selected the 'Label' property, and a descending sort:

Sort criterion configuration

After the sorting criterion is validated (pressing the icon), it is added to the sorting criteria list and the criterion is immediately applied to reorder the data nodes:

Data nodes sorted by their label

The user can then create additional sorting criteria (which are applied in sequence).
To remove a sorting rule, the user can select the button next to the criterion.

To exit the sorting dialog, click anywhere outside the dialog window.

Searching

The Search feature allows users to quickly locate data nodes by filtering the list based on text input.

When the user presses the icon (Search), a search box appears within the Data Node Selector interface:

Search box in the selector

If text is entered in the search box, the list dynamically updates to display only data nodes with labels containing the entered text:

Search active

To close the search box, the user must press the icon (Search off) in the toolbar.

Pinning

The Pinning feature allows users to focus on specific data nodes by "pinning" them.
Pinned data nodes can then be displayed exclusively by enabling the 'Pinned Only' switch. This feature is particularly useful when dealing with a large number of data nodes.

Assuming we are in the following situation:

Crowded Data Node Selector

If the user wants to focus only on the data node called initial_dataset and the data nodes from the scenario called 'Peter's', she can click the icon (Pin) next to these two items. Here is what the display would look like:

Data Node Selector with pinned items

Here is what the control looks like after the 'Pinned only' switch was set and the scenario item was expanded:

Filtering pinned data nodes

You can see that only the pinned data nodes are visible.

Note that the cycle item is not pinned because the other scenarios it contains are not, either.

  • If all data nodes for a scenario or cycle are pinned, the scenario or cycle item becomes itself pinned.
  • A scenario or cycle item appears not pinned if any of its data nodes remain unpinned.
  • Pinning a scenario item pins all its data nodes.
    Unpinning a scenario item unpins all its data nodes.
  • Pinning a cycle item pins all the data nodes across all its scenarios.
    Unpinning a cycle item unpins all the data nodes across all its scenarios.

Turn off the 'Pinned Only' switch to view the complete list of data nodes again.