User Interface operations
Table of Contents
ui_panel
ui_panel(header, content)
Renders a container with a fixed header followed by some scrollable content.
Examples:
ui_panel("Header", "content")
ui_panel(
"Header",
ui_accordion(
list(
ui_accordion_item("Item 1", "some content") ,
ui_accordion_item("Item 2", "some content")
),
)
)
To make your panels discoverable in the Perspective view, you will need to set the Info Panel UI option in the Schema Editor to your custom formula that contains your ui_panel
.
To discover these panels on Spans, make sure to also change the Selectable type for Conductors from Strain Section to Span.
ui_accordion_item
ui_accordion_item(header, content, [ sort_value: string ])
Renders a single item in an accordion represented by a header, followed by some content.
Takes an optional [sort_value]
, to be used with the ui_accordion
sort direction.
Examples:
ui_accordion_item("Item 1", “some content”)
ui_accordion_item(
"Item 1",
ui_properties_table(
make_props(
"Label", label,
"Notes", notes,
),
),
sort_value: "1"
)
ui_accordion
ui_accordion(list|tuple(accordion_item), [ sort: "asc" | "desc" ])
Renders a vertically stacked list of headers that reveal or hide associated sections of content.
Takes a list of accordion items built with `ui_accordion_item`.
Optionally takes a [sort] direction to sort accordion items by their `sort_value`.
Examples:
ui_accordion(
list(
ui_accordion_item("Item 1", “some content”) ,
ui_accordion_item("Item 2", "some content")
),
)
ui_accordion(
list(
ui_accordion_item("Item 1", "some content"), sort_value: "1") ,
ui_accordion_item("Item 2", "some content", sort_value: "2")
),
sort: "desc",
)
ui_properties_table
ui_properties_table(properties, [ filter_empty: true | false ])
Renders a key-value properties object (built using make_props) in a table.
Takes an optional [filter_empty] argument to omit properties with empty values, defaults to false.
Examples:
ui_properties_table(
make_props(
"Label", label,
"Notes", notes,
),
)
ui_properties_table(
make_props(
"Label", label,
"Notes", notes,
),
filter_empty: true
)
ui_action
ui_action(content, action)
Renders an action link which launches the given action when clicked.
Example:
ui_action("View poles report", launch_report(“Poles"))
launch_report
launch_report(report_name, {filter_matches:properties})
An action which locates or opens the report with the given [report_name] in the current workspace.
Can be used as an argument to ui elements like ui_link
.
Optionally takes a key-value properties object of [filter_matches]
to apply to the report
Example:
launch_report("Report Name", filter_matches: make_props("property_name", property_name),)
returns a UI action that can be used as an argument in ui_action
.