apply_ring_continuous_layout
Apply a continuous ring layout to a graph by specifying a numeric node attribute for ring positioning, enhancing visualization clarity. Returns a URL to the updated graph.
Instructions
Apply a continuous ring layout to the graph using Graphistry's ring_continuous_layout API.
Args:
graph_id (str): The ID of the graph to modify.
ring_col (str): The node column to use for determining ring position (should be a continuous/numeric attribute, e.g., 'score').
Returns:
dict: { 'graph_id': ..., 'url': ... } with the updated visualization URL.
Example:
apply_ring_continuous_layout(graph_id, ring_col='score')
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| graph_id | Yes | ||
| ring_col | Yes |
Implementation Reference
- The handler function for the 'apply_ring_continuous_layout' tool, decorated with @mcp.tool() for registration. It applies Graphistry's ring_continuous_layout using the specified ring_col on the graph associated with graph_id, updates the cache, and returns the graph_id and visualization URL.@mcp.tool() async def apply_ring_continuous_layout(graph_id: str, ring_col: str) -> Dict[str, Any]: """ Apply a continuous ring layout to the graph using Graphistry's ring_continuous_layout API. Args: graph_id (str): The ID of the graph to modify. ring_col (str): The node column to use for determining ring position (should be a continuous/numeric attribute, e.g., 'score'). Returns: dict: { 'graph_id': ..., 'url': ... } with the updated visualization URL. Example: apply_ring_continuous_layout(graph_id, ring_col='score') """ if graph_id not in graph_cache: raise ValueError(f"Graph not found: {graph_id}") g = graph_cache[graph_id]["graph"] g = g.ring_continuous_layout(ring_col) graph_cache[graph_id]["graph"] = g return {"graph_id": graph_id, "url": g.plot(render=False)}