Computed Fields
Overview
Computed fields allow you to create new data properties by combining or transforming existing data. These properties can display as plain text or clickable links in your inspector panel. The computations happen dynamically and don't modify your underlying data.
Format Types
External Links (format: "link")
Creates clickable links to external websites, using one field for the URL and another for the display text.
- Required Fields:
source_field
: The column containing the complete URL to link todisplay_field
: The column containing the text that should appear as the clickable link
Example: If your data looks like this:
Configuration:| id | company_name | website_url | |----|--------------|------------------------| | 1 | Example Corp | https://example.com |
Result: Creates a new column "company_website" with an HTML link that shows "Example Corp" and links to "https://example.com"{ "node_encodings": { "complex": { "default": { "pointComputedEncoding": { "graphType": "point", "encodingType": "computed", "attribute": "company_website", // Name of the new computed field "computed": { "format": "link", "source_field": "website_url", // URL to link to "display_field": "company_name" // Text to show for the link } } } } } }
Internal Links (format: "relative-link")
Creates clickable links to other visualizations within Graphistry. You can specify the link either through a template or by referencing a field containing the dataset ID.
- Option 1: Dynamic URLs with template
template
: Pattern for internal URLs using ${fieldName} to insert valuesdisplay_field
: The column containing the text to show for the link
Example: Creating links to related visualizations:
Configuration:| id | alert_name | dataset_id | severity | |----|------------|------------|----------| | 1 | Alert 123 | abc123 | high |
Result: Creates a link showing "Alert 123" that leads to "/graph.html?dataset=abc123&severity=high"{ "computed": { "format": "relative-link", "template": "/graph.html?dataset=${dataset_id}&severity=${severity}", // Dynamic URL pattern "display_field": "alert_name" // Shows "Alert 123" as link text } }
- Option 2: Simple dataset links
source_field
: Column containing the dataset IDs to link todisplay_field
: Column containing the text to show for the link
Example: Simple links to related datasets:
Configuration:| id | name | related_viz_id | |----|-----------|----------------| | 1 | View More | xyz789 |
Result: Creates a link showing "View More" that leads to "/graph.html?dataset=xyz789"{ "computed": { "format": "relative-link", "source_field": "related_viz_id", // Dataset ID to link to "display_field": "name" // Shows "View More" as link text } }
Text Templates (format: "text-template")
Combines multiple fields into a single text string using a template pattern. This is useful when you want to create readable descriptions by combining values from different columns without creating links. Any text outside the ${} placeholders will be kept as-is in the final output.
- Required Fields:
template
: Pattern for text using ${fieldName} to insert values from other columns. The ${fieldName} will be replaced with the actual value from that column. The value will not be a link.
Example: If your data looks like this:
Configuration:| id | hostname | ip_address | status | |----|------------|-------------|---------| | 1 | server-01 | 10.0.0.1 | active |
Result: Creates a new column "server_info" with value: "Host server-01 (10.0.0.1) - active"{ "node_encodings": { "complex": { "default": { "pointComputedEncoding": { "graphType": "point", "encodingType": "computed", "attribute": "server_info", // Name of the new computed field "computed": { "format": "text-template", "template": "Host ${hostname} (${ip_address}) - ${status}" // Static text "Host", "()", and "-" will remain unchanged } } } } } }
Where:- "Host " - Static text prefix
- "server-01" - Value from hostname column
- " (" - Static text
- "10.0.0.1" - Value from ip_address column
- ") - " - Static text
- "active" - Value from status column
Validation Rules
attribute
is always required and must be a stringformat
must be one of: "text-template", "link", or "relative-link"- For
text-template
: template is required - For
link
: both source_field and display_field are required - For
relative-link
: display_field and either template or source_field are required - All referenced fields (in template variables, source_field, or display_field) must exist in your data
Common Use Cases
- Text Templates:
- Combining name and ID fields: "${name} (ID: ${id})"
- Formatting addresses: "${street}, ${city}, ${state} ${zip}"
- Status descriptions: "${status} since ${date}"
- External Links:
- Linking to user profiles in external systems
- Adding links to documentation or reference materials
- Connecting to ticket management systems
- Internal Links:
- Creating drill-down links between related visualizations
- Building investigation workflows across multiple graphs
- Linking to filtered views of the same dataset