from shiny import render from shiny.express import input, ui import plotly.express as px ui.page_opts(fillable=True) ui.panel_title("Kmer Analysis") with ui.layout_columns(): with ui.card(): ui.input_slider("slider", "Slider", 0, 10, 5) @render.plot def plot(): df = pd.read_csv('kmers.csv') k = input.slider() fig = None if k: df = df[df['k'] == k] fig = px.bar(df, x='kmer', y='count', title=f'Most common {k}-mers') return fig