capturegraph.procedures.nodes.action.user_input
#
User Input Procedures#
Procedures that present user interface elements to collect data directly from users. All user input procedures require user interaction and pause workflow execution until the user provides the requested input.
Example
from capturegraph.procedures.nodes.action import UserInputString, UserInputBool
from capturegraph.procedures.nodes.automatic import ProcedureSequence
from capturegraph.procedures.nodes.filesystem import GetRootDirectory
def survey_procedure():
target = GetRootDirectory()
session = target.new_session("survey")
return ProcedureSequence(
label="Daily Survey",
procedures=[
session.new_file("notes").save(
UserInputString(label="How are you feeling today?")
),
session.new_file("satisfied").save(
UserInputBool(
label="Are you satisfied?",
true_text="Yes",
false_text="No"
)
),
]
)
UserInputBool
#
Prompts the user to select between true/false options.
Displays a boolean choice interface with customizable text for the true and false options. Useful for yes/no questions, feature toggles, or binary decisions in data collection workflows.
Attributes:
| Name | Type | Description |
|---|---|---|
true_text |
str
|
Text to display for the true option (default: "True"). |
false_text |
str
|
Text to display for the false option (default: "False"). |
Example
Source code in capturegraph-lib/capturegraph/procedures/nodes/action/user_input.py
UserInputNumber
#
Prompts the user to enter a numeric value.
Displays a number input interface with optional constraints for minimum/maximum values and step increments.
Attributes:
| Name | Type | Description |
|---|---|---|
min_value |
Optional[int | float]
|
Minimum allowed value (optional). |
max_value |
Optional[int | float]
|
Maximum allowed value (optional). |
step |
Optional[int | float]
|
Increment step for number picker (optional). |
Example
Source code in capturegraph-lib/capturegraph/procedures/nodes/action/user_input.py
UserInputString
#
Prompts the user to enter text input.
Displays a text input field where users can type free-form text. Useful for collecting names, descriptions, notes, or any other textual data during the procedure execution.
Source code in capturegraph-lib/capturegraph/procedures/nodes/action/user_input.py
UserInputSelectString
#
Prompts the user to select from a list of predefined text options.
Displays a dropdown or selection interface with customizable options. Useful for collecting specific values like categories, tags, or other predefined text inputs.
Attributes:
| Name | Type | Description |
|---|---|---|
options |
list[str]
|
List of string options for the user to choose from |
Source code in capturegraph-lib/capturegraph/procedures/nodes/action/user_input.py
UserInputLocation
#
Prompts the user to select or input a location.
Displays a location picker interface that may use maps, GPS, or manual coordinate entry. Users can specify geographic locations for data collection or analysis.
Source code in capturegraph-lib/capturegraph/procedures/nodes/action/user_input.py
UserInputTime
#
Prompts the user to select a specific date and time.
Displays date/time picker interface for selecting timestamps. Can be configured to round selections to day boundaries for simplified date-only input.
Attributes:
| Name | Type | Description |
|---|---|---|
round_to_days |
bool
|
Whether to round time selection to day boundaries (default: False) |
Source code in capturegraph-lib/capturegraph/procedures/nodes/action/user_input.py
UserInputTimeInterval
#
Prompts the user to enter a time duration or interval.
Displays an interface for selecting time durations (e.g., "2 hours", "30 minutes"). Returns the interval as a numeric value in seconds.
Attributes:
| Name | Type | Description |
|---|---|---|
round_to_days |
bool
|
Whether to round interval to day boundaries (default: False) |
Source code in capturegraph-lib/capturegraph/procedures/nodes/action/user_input.py
UserInputTimeOfDay
#
Prompts the user to select a time of day (hours and minutes only).
Displays a time picker for selecting the time portion only, without date information. Returns the time as seconds since midnight (0-86399).
Source code in capturegraph-lib/capturegraph/procedures/nodes/action/user_input.py
UserInputRating
#
Prompts the user to select a star rating from 1-5.
Displays an interactive 5-star rating interface. Returns the selected rating as a number (1-5). Useful for quality assessments, ratings, or any scale-based input.
Attributes:
| Name | Type | Description |
|---|---|---|
max_stars |
int
|
Maximum number of stars (default: 5) |
bad_adjective |
Optional[str]
|
Label to show on the left side (low rating), e.g., "Bad" |
good_adjective |
Optional[str]
|
Label to show on the right side (high rating), e.g., "Good" |
Source code in capturegraph-lib/capturegraph/procedures/nodes/action/user_input.py
ShowInstructions
#
Displays instructions to the user and waits for acknowledgement.
Shows instruction text with an optional image to guide the user through a capture workflow. Returns True when the user acknowledges they have read and understood the instructions. Useful for collaborative capture scenarios where users need clear guidance before proceeding.
Attributes:
| Name | Type | Description |
|---|---|---|
text |
str
|
The instruction text to display to the user |
image |
Procedure[PImage]
|
Optional image procedure to display alongside the instructions |
Source code in capturegraph-lib/capturegraph/procedures/nodes/action/user_input.py
GuideToLocation
#
Guides the user to a target location before proceeding.
Displays a map showing the user's current location and the target location. Completes when the user is within the specified threshold distance and confirms arrival. Unlike ShowInstructions, this does not save acknowledgement state - arrival is always determined by the current location.
Attributes:
| Name | Type | Description |
|---|---|---|
target |
Procedure[PLocation]
|
The target location to guide the user to |
threshold_meters |
float
|
Distance in meters at which the user is considered "arrived" (default: 25) |
Source code in capturegraph-lib/capturegraph/procedures/nodes/action/user_input.py
UserInputOptimalSolarTime
#
Displays solar position plot with optimal capture times for user selection.
Shows a sun path plot with coverage analysis based on existing session data. Computes optimal capture times using the Void and Cluster algorithm and displays them as selectable bell markers. Returns the selected time when user confirms.
The plot shows: - Sun path over 24 hours centered on current position - Coverage shading (green = uncovered/good, red = covered/bad) - Bell markers at optimal capture times - Session markers showing existing captures
Attributes:
| Name | Type | Description |
|---|---|---|
target |
Procedure[PDirectory]
|
The target root directory containing session data |
session |
str
|
Session name to compute coverage for |
count |
int
|
Number of optimal time choices to present (default: 5) |
minimum_altitude |
float
|
Minimum sun altitude in degrees to consider (default: 0 = horizon) |
Source code in capturegraph-lib/capturegraph/procedures/nodes/action/user_input.py
PaceKeeper
#
Displays a flashing visual metronome at a specified BPM.
Flashes the screen between white and black at the configured beats per minute. Returns PVoid immediately (fire-and-forget visual cue). Useful for timing actions like CPR compressions or other rhythmic activities.
The default BPM of 103 matches the tempo of "Staying Alive" by the Bee Gees, which is commonly used for CPR training.
Attributes:
| Name | Type | Description |
|---|---|---|
bpm |
float
|
Beats per minute for the flashing rate (default: 103) |
Example
Source code in capturegraph-lib/capturegraph/procedures/nodes/action/user_input.py
Stopwatch
#
Allows users to record how long something takes.
Displays a stopwatch interface with start/stop controls. The user can start timing, stop when the action is complete, and submit the recorded duration. Returns the elapsed time as a PNumber in seconds.
Useful for timing procedures, measuring reaction times, or recording the duration of observations in data collection workflows.