encode_point_icon
Set node icon encoding for graphs by mapping node data to specific icons or text, enabling clear visual differentiation based on categorical or continuous values in Graphistry visualizations.
Instructions
Set node icon encoding for a graph using Graphistry's encode_point_icon API.
Args:
graph_id (str): The ID of the graph to modify.
column (str): The node column to use for icon encoding (e.g., 'type', 'origin').
categorical_mapping (dict, optional): Map of category values to icon names or URLs. Example: {'macbook': 'laptop', 'Canada': 'flag-icon-ca'}. See FontAwesome 4 or ISO country codes for built-ins.
default_mapping (str, optional): Icon to use for values not in categorical_mapping. Example: 'question'.
as_text (bool, optional): If True, use text as the icon (for continuous binning or direct text display).
continuous_binning (list, optional): List of [threshold, icon] pairs for binning continuous values. Example: [[33, 'low'], [66, 'mid'], [None, 'high']].
Returns:
dict: { 'graph_id': ..., 'url': ... } with the updated visualization URL.
Example:
encode_point_icon(graph_id, column='type', categorical_mapping={'macbook': 'laptop', 'Canada': 'flag-icon-ca'}, default_mapping='question')
Input Schema
Name | Required | Description | Default |
---|---|---|---|
as_text | No | ||
categorical_mapping | No | ||
column | Yes | ||
continuous_binning | No | ||
default_mapping | No | ||
graph_id | Yes |
Input Schema (JSON Schema)
{
"properties": {
"as_text": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": false,
"title": "As Text"
},
"categorical_mapping": {
"anyOf": [
{
"additionalProperties": true,
"type": "object"
},
{
"type": "null"
}
],
"default": null,
"title": "Categorical Mapping"
},
"column": {
"title": "Column",
"type": "string"
},
"continuous_binning": {
"anyOf": [
{
"items": {},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"title": "Continuous Binning"
},
"default_mapping": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Default Mapping"
},
"graph_id": {
"title": "Graph Id",
"type": "string"
}
},
"required": [
"graph_id",
"column"
],
"title": "encode_point_iconArguments",
"type": "object"
}