Closed yGuy closed 2 years ago
Describe the bug For simple cases, it should not be required to provide "properties" for nodes.
To Reproduce Steps to reproduce the behavior:
w.nodes = [ {"id": 0}, {"id": "one", "properties": {"firstName": "Bravo", "label": "Person B"}}, {"id": 2.0, "properties": {"firstName": "Charlie", "label": "Person C", "has_hat": False}}, {"id": True, "properties": {"firstName": "Delta", "label": "Person D", "likes_pizza": True}} ]
w.show()
File /opt/conda/lib/python3.9/site-packages/yfiles_jupyter_graphs/widget.py:976, in GraphWidget.default_element_label_mapping(index, element) 939 @staticmethod 940 def default_element_label_mapping(index: int, element: TDict): 941 """The default label mapping for graph elements. 942 943 Element (dict) should have key properties which itself should be a dict. (...) 974 975 """ --> 976 properties = element['properties'] 977 return str(properties.get('label', properties.get('yf_label', index)))
Expected behavior This should be required by default. Some people have nodes without properties and it would still be useful.
Describe the bug For simple cases, it should not be required to provide "properties" for nodes.
To Reproduce Steps to reproduce the behavior:
w.show()
Expected behavior This should be required by default. Some people have nodes without properties and it would still be useful.