encode_point_color
Set node color encoding in a graph using a specified column, with options for categorical mapping, default colors, or continuous gradients via Graphistry MCP.
Instructions
Set node color encoding for a graph using Graphistry's encode_point_color API.
Args:
graph_id (str): The ID of the graph to modify (from visualize_graph).
column (str): The node column to use for color encoding (e.g., 'type', 'score').
categorical_mapping (dict, optional): Map of category values to color codes. Example: {'mac': '#F99', 'macbook': '#99F'}. If not provided, Graphistry will auto-assign colors.
default_mapping (str, optional): Color code to use for values not in categorical_mapping. Example: 'silver'.
as_continuous (bool, optional): If True, treat the column as continuous and use a gradient palette. Example: True for numeric columns like 'score'.
Returns:
dict: { 'graph_id': ..., 'url': ... } with the updated visualization URL.
Example:
encode_point_color(graph_id, column='type', categorical_mapping={'mac': '#F99', 'macbook': '#99F'}, default_mapping='silver')
Input Schema
Name | Required | Description | Default |
---|---|---|---|
as_continuous | No | ||
categorical_mapping | No | ||
column | Yes | ||
default_mapping | No | ||
graph_id | Yes |
Input Schema (JSON Schema)
{
"properties": {
"as_continuous": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": false,
"title": "As Continuous"
},
"categorical_mapping": {
"anyOf": [
{
"additionalProperties": true,
"type": "object"
},
{
"type": "null"
}
],
"default": null,
"title": "Categorical Mapping"
},
"column": {
"title": "Column",
"type": "string"
},
"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_colorArguments",
"type": "object"
}