Sankey Node value representing incoming and outgoing flows

I’m trying to have the Sankey diagram show node values that represent both the incoming and outgoing flows.

The example below ‘Define Node Position’ on the Plotly Sankey has a clear visualisation that the value for a node (in this case Node A) only represents outgoing flows.

How can I also include incoming flows in this value?