in src/responsibleai/rai_analyse/_score_card/common_components.py [0:0]
def get_dot_plot(center, ep, em):
fig = go.Figure()
fig.add_trace(
go.Scatter(
x=[center],
y=[0.5],
mode="markers",
error_x=dict(
type="data",
symmetric=False,
array=[ep],
arrayminus=[em],
color="rgba(39, 110, 237, 1)",
width=15,
),
)
)
fig.update_xaxes(
showgrid=False,
# tickvals=[0, 25, 50, 75, 100],
# ticktext=["0%", "25%", "50%", "75%", "100%"],
# range=[0, 100]
)
fig.update_yaxes(
showgrid=False,
zeroline=True,
zerolinecolor="black",
zerolinewidth=3,
showticklabels=False,
)
fig.update_layout(height=240, width=700, plot_bgcolor="white")
fig.update_traces(
marker=dict(
color="white", size=20, line=dict(width=2, color="rgba(39, 110, 237, 1)")
)
)
png = pio.to_image(fig)
png_base64 = base64.b64encode(png).decode("ascii")
return png_base64