pygraphistry
pygraphistry copied to clipboard
[FEA] Node and property shaping in hypergraph
Is your feature request related to a problem? Please describe.
When shaping a datawarehouse extract, we can structure the edges but not nodes:
### | account_id | account_name | item_id | item_name | quantity |
graphistry.hypergraph(
df,
['account_id', 'item_id'],
direct=True,
opts={
'EDGES': {
'account_id': [ 'item_id' ]
},
'CATEGORIES': {
'account': ['account_id'],
'item': ['item_id']
})
This will connect accounts to items, but does not associate node IDs to corresponding node Names, instead leaving them on edges
Describe the solution you'd like
Maybe something like:
'NODE_PROPERTIES': {
'account_id': ['account_name']
'item_id': ['item_name']
},
'EDGE_PROPERTIES': {
...
},
'partition_node_properties': True
- Adds properties to nodes (or edges) as dictated
-
partition_node_properties
: whether node properties also appear on edges
Additional context
A little complicated here is what the node IDs should be and handling case of direct=False