streamz
streamz copied to clipboard
Streamz + Panel Plotting Issue
Im trying to plot a simple chart with streamz + panel in jupyter lab but there seems to be an issue at the end: there is an extra line that goes back to the starting point. This is the code that I wrote and the plot that I get:
beacon_sdf=sDataFrame(example=pd.DataFrame({'interval_duration_sec':[],'sim_time_sec':[]},index=pd.DatetimeIndex([])))
def beacon_Line(beacon_sdf):
return beacon_sdf.hvplot.line('sim_time_sec','interval_duration_sec')
beacon_Line(beacon_sdf)
hvplot_stream = beacon_sdf.stream.map(beacon_Line)
hvplot_pane = pn.pane.Streamz(hvplot_stream, height=350, always_watch=True,widgets={'Simulation Time(sec)': pn.widgets.FloatSlider})
def emit():
for index,rows in beacon_df.iterrows():
beacon_sdf.stream.emit(pd.DataFrame({'interval_duration_sec':rows['interval_duration_sec'],'sim_time_sec':rows['sim_time_sec']},index=pd.DatetimeIndex([pd.datetime.now()])))
sleep(0.01)
hvplot_pane.add_periodic_callback(emit,period=500,timeout=2)

Does anyone have any thoughts? The source data is not the problem.
cc @philippjfr
@philippjfr could you help on this? Thanks!