diff --git a/hierarchical_review_plots/tilt_ppda_and_build_up_disruption_altair.py b/hierarchical_review_plots/tilt_ppda_and_build_up_disruption_altair.py index cde6194..797edbb 100644 --- a/hierarchical_review_plots/tilt_ppda_and_build_up_disruption_altair.py +++ b/hierarchical_review_plots/tilt_ppda_and_build_up_disruption_altair.py @@ -21,3 +21,25 @@ def make_tilt_ppda_build_up_disruption(tilt_ppda, xcol_param): .add_params(xcol_param) ) return tilt_plot + + +def select_indices_presion(): + dropdown = alt.binding_select( + options=["build_up_disruption", "ppda", "tilt"], name="Índices de presión" + ) + return alt.param(value="tilt", bind=dropdown) + + +def make_quality_and_pressure_indexes(tilt_ppda, xcol_param): + tilt_plot = ( + alt.Chart(tilt_ppda) + .mark_point() + .encode( + x=alt.X("x:Q").title(""), + y="xG:Q", + tooltip=["team", "xG", "tilt", "build_up_disruption", "ppda"], + ) + .transform_calculate(x=f"datum[{xcol_param.name}]") + .add_params(xcol_param) + ) + return tilt_plot