I am stuck on sankey plots. I would like the green bar on the image below to represent a width of 525, but at the moment it is 1131. I think this is because the source is the purple 1131 to the left of the green, but I cannot figure out how to change it. I would like to understand how it's working, as I have read the documentation (https://plotly.com/python/sankey-diagram/) but just cannot get my head around it. Thank you!
Image:
Code:
import plotly.graph_objects as go
import numpy as np
import pandas as pd
from matplotlib import pyplot as plt
fig1 = go.Figure(data=[go.Sankey(
arrangement = "freeform",
node = dict(
pad = 80,
thickness = 10,
line = dict(color = "black", width = 0.5),
label = ["1131 articles identified through database search",
"3 additional articles identified",
"525 articles after duplicates removed",
"426 articles excluded based on title/abstract",
"98 full-text articles assessed for eligibility",
"50 full-text articles excluded",
"48 articles included in the literature overview"],
x = [0, 0, 0.4, 0.6, 0.5, 0.8, 0.7],
y = [0, 0, 0.5, 0.8, 0.15, 0.05, 0.4],
#color = ["darkblue","darkblue","darkblue","darkred","darkgreen","darkred","darkgreen"]
),
link = dict(
source = [0, 1, 2, 2, 4, 4], #corresponds to labels
target = [2, 2, 3, 4, 5, 6],
value = [1131, 3, 426, 98, 50, 48],
))])
fig1.update_layout(title = dict(text="Figure 1 - Review search and article screening"),
width=650,
height=450,
font_size=10,
margin=dict(l=0))```