Skip to content

Commit 9d9d756

Browse files
committed
add docstring
1 parent a725c8d commit 9d9d756

1 file changed

Lines changed: 22 additions & 2 deletions

File tree

holoviews/plotting/bokeh/util.py

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1264,8 +1264,28 @@ def get_ticker_axis_props(ticker):
12641264
return axis_props
12651265

12661266

1267-
def get_tool_id(tool: str | tools.Tool) -> tuple[type[tools.Tool], str | None]:
1268-
"""Returns the tool type and an identifier for a given tool."""
1267+
def get_tool_id(tool: str | tools.Tool) -> tuple[type[tools.Tool], str | tuple | None]:
1268+
"""
1269+
Returns the tool type and an identifier for a given tool.
1270+
1271+
The identifier allows distinguishing tools of the same type but with
1272+
different properties. This function checks all disambiguation properties
1273+
(dimensions, tags, name, description, icon) and returns a composite
1274+
identifier if multiple properties are present.
1275+
1276+
Parameters
1277+
----------
1278+
tool : str or Bokeh Tool class
1279+
Tool specification as string name or Tool class instance
1280+
1281+
Returns
1282+
-------
1283+
tuple[type[tools.Tool], str | tuple | None]
1284+
Tuple of (tool_type, identifier). The identifier can be:
1285+
- str: Single property value (e.g., 'both', 'width')
1286+
- tuple: Multiple property values as tuple of tuples
1287+
- None: No distinguishing properties
1288+
"""
12691289
is_str = isinstance(tool, str)
12701290
tool_type = TOOL_TYPES.get(tool) if is_str else type(tool)
12711291

0 commit comments

Comments
 (0)