pygraphistry icon indicating copy to clipboard operation
pygraphistry copied to clipboard

[FEA] Node and property shaping in hypergraph

Open lmeyerov opened this issue 2 years ago • 0 comments

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

lmeyerov avatar Nov 19 '21 19:11 lmeyerov