Describe the bug
The default mappings for nodes and edges always fall back to the item's index if no label property is given. Therefore, graph items always have at least the index as label.
To Reproduce
Delete the label property in the data of the introduction graph and show the diagram.
Expected behavior
No label should be displayed if the data doesn't contain a label property.
Additional context
This behavior can be adjusted by setting another label mapping function:
def custom_label_mapping(index: int, node: Dict):
"""don't show any label"""
return ''
w.set_node_label_mapping(custom_label_mapping)
w.set_edge_label_mapping(custom_label_mapping)
I think the better default may be to remove the index label fallback and let users explicitly add the index label by overwriting the label mapping.
Describe the bug The default mappings for nodes and edges always fall back to the item's index if no label property is given. Therefore, graph items always have at least the index as label.
To Reproduce Delete the label property in the data of the introduction graph and show the diagram.
Expected behavior No label should be displayed if the data doesn't contain a label property.
Additional context This behavior can be adjusted by setting another label mapping function:
I think the better default may be to remove the index label fallback and let users explicitly add the index label by overwriting the label mapping.