pygraphistry icon indicating copy to clipboard operation
pygraphistry copied to clipboard

[FEA] Encode edge direction

Open lmeyerov opened this issue 2 years ago • 0 comments

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

lmeyerov avatar Nov 11 '21 23:11 lmeyerov