Maintain the current state of graph when selecting from the dropdown

I’m attempting to plot a time series of multiple values that dynamically update (via a callback) as dropdown items are added. I managed to plot them but each time an additional filter is added, the update combines the items that appear on the same day and randomly chooses which one to display. I would like all distinct values to populate separately.

I’ve used different aggregate functions in both the Plotly dictionary structure as well as grouping the dataframe. I’ve tried groupby(‘date’)[‘col’], value_counts(), count(), and other grouping/summing methods.

@app.callback(Output('main_graph', 'figure'),
          [Input('col', 'value'),
           Input('month_slider', 'value')])
def make_main_figure(col, month_slider):

    dff = filter_dataframe(df, col, month_slider)

    data = ({
    'data':[
        {'x' : dff['date'], 
        'y' : dff['col'],
        'type':'hist',
        'text':dff['col'],
        'mode' : 'markers',
        'marker_color':{
            'line':{'color':'red'}
        },
    'transforms':[
        {'type':'aggregate',
            'groups': dff['date'],
    'aggregations': [
        {'target':'y', 'func':'count'}]
        }]
        }],
    'layout':{'title':'Time Series'} 
    })

I think I need to maintain the State because the previous graph is being overwritten and values from the previous graph are being added to the current dropdown value. I’m not sure how to maintain the State and add the dropdown values