mcbrowse.common.data¶
Extract common data from the daf
repository.
- mcbrowse.common.data.tooltips(data: DafReader, axis: str, tooltips_data: Union[None, str, Tuple[str, str], Sequence[Union[str, Tuple[str, str]]], Callable[[DafReader], Sequence[Optional[str]]]] = None) Sequence[str] [source]¶
Compute the
tooltips_data
for each entry along someaxis
of thedata
.
- mcbrowse.common.data.TooltipsData(*args, **kwargs)¶
How to extract tooltip data from the repository.
If
None
, the tooltip data is just the name of the object. This is always the 1st line of the tooltip.If a single
TooltipsEntry
, then a single line containing that tooltip entry will be added.If a sequence of
TooltipsEntry
, then one line will be added to the tooltip for each one.If a
TooltipsFunction
, it will be called to get the (optional) tooltip text for each objects, which will be appended to the object name.
alias of
Union
[None
,str
,Tuple
[str
,str
],Sequence
[Union
[str
,Tuple
[str
,str
]]],Callable
[[DafReader
],Sequence
[Optional
[str
]]]]
- mcbrowse.common.data.TooltipsEntry(*args, **kwargs)¶
How to extract a single entry (line) of the tooltip.
If a simple string, this is the name of some property, and the tooltip entry (line) will have the format
property: value
.If a tuple of two strings, they will contain the name of some property and a title to use for it, and the tooltip entry (line) will have the format
title: value
.
alias of
Union
[str
,Tuple
[str
,str
]]
- mcbrowse.common.data.TooltipsFunction(*args, **kwargs)¶
A function computing the additional tooltip lines for all the objects.
This should return a sequence of (optional) strings, one per object. If the value is not
None
, it will be appended to the object name in the tooltip.alias of
Callable
[[DafReader
],Sequence
[Optional
[str
]]]