I am working on a passenger forecast system and got introduced to hvplots and widgets. The idea is have a panel to select a day of the week and a slider showing time_frame in which data is taken in, every 5 mins, 10 mins etc. Typically, when using the typical console, by simply asking for the user input for the day and split of time, the code works fine and gives the desired graph and table using matlibplot. However, when using hvplots and widgets, when I select a value in the interactive panel, the default value stays and doesn't change the graph/table after changing the panel. Though both day of the week and time_frame are used throughout the code in various assignments and loops. Unfortunately, I cannot provide with the dataset, but I can provide with the code.Below is a small part of the code, not fully but just to give an idea:
X = pn.widgets.IntSlider(name='Time Divison (mins)', start=5, end=20, step=5)
Dweek = pn.widgets.Select(name='DayChosen', options=['Monday', 'Tuesday',
'Wedesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'])
#interact(f, options=['Monday', 'Tuesday', 'Wedesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'] )
#Dweek = input("Enter a day of the week: ")
#X = input("How many minutes would you like to split the graph")
#X = int(X)
dDay = data['DateofFlight'].dt.day_name()
dScannedDateTime = data.set_index(dDay).loc[Dweek.value]['ScanDateTime']
dScannedTime = data.set_index(dDay).loc[Dweek.value]['ScanTime']
dTimeHour = dScannedDateTime.dt.hour
dTimeMinute = dScannedDateTime.dt.minute
dw = data.set_index(dDay).loc[Dweek.value]['FlightNumber'].unique()
dl = data.set_index(dDay).loc[Dweek.value]['FlightNumber']
dRec = data.set_index(dDay).loc[Dweek.value]['RecID']
dCode = data.set_index(dDay).loc[Dweek.value]['AirlineName']
dDepTime = data.set_index(dDay).loc[Dweek.value]['ScheduleTime']
dFlightNum = data['FlightNumber']