in src/responsibleai/rai_analyse/_score_card/common_components.py [0:0]
def get_box_plot(data):
fig = go.Figure()
for i in data["data"]:
fig.add_trace(
go.Box(
x=i["datapoints"],
boxpoints=False,
line_color="rgba(39, 110, 237, 1)",
fillcolor="rgba(218, 227, 243, 1)",
name=i["label"],
showlegend=False,
)
)
fig.update_layout(
paper_bgcolor="rgb(255, 255, 255)",
plot_bgcolor="rgb(255, 2555, 255)",
margin=dict(l=25, r=25, t=25, b=25),
width=700,
height=len(data["data"]) * 70 + 60,
# annotations=annotations,
boxgap=0,
)
fig.update_layout()
png = pio.to_image(fig)
png_base64 = base64.b64encode(png).decode("ascii")
return png_base64