pygraphistry
pygraphistry copied to clipboard
[FEA] Encode edge direction
Is your feature request related to a problem? Please describe.
Sometimes edges have their own direction, like:
| account1 | account2 | debitOrCredit |
In these cases, it'd be easier if we can encode the direction vs have to manually preprocess
Describe the solution you'd like
g.edges(df, 'col_a', 'col_b').bind(edge_direction='col_c') # where values are 0 (forward), 1 (backward), and later 2 (undirected)
g.edges(df, 'col_a', 'col_b', edge_direction='col_c') # where values are 0 (forward), 1 (backward), and later 2 (undirected)
- May be value in doing as a mapping:
edge_direction={'attribute': 'credit_or_debit', 'categorical': {True: 0, False: 1}, 'other': 2}
Ideally processed on the server (multi-client), but ok if locally preprocessed
Describe alternatives you've considered
- bool-valued
- something computed
Additional context
- Common in cases like finance