Skip to main content
Glama

apply_ring_continuous_layout

Arrange graph nodes in continuous rings based on numeric attributes like scores to visualize hierarchical relationships and patterns in network data.

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
NameRequiredDescriptionDefault
graph_idYes
ring_colYes

Implementation Reference

  • The handler function decorated with @mcp.tool(), which registers and implements the 'apply_ring_continuous_layout' tool. It retrieves the graph from cache, applies ring_continuous_layout using the specified ring_col, updates the cache, and returns the graph_id and updated 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)}

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/graphistry/graphistry-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server