Open Ben-Epstein opened 1 year ago
Hmm, yeah, TIMESERIES
and LINE
are both early era nodes that haven't been updated in a while.
The solution that I would recommend:
TIMESERIES
generator is updated to output a DataContainer of type timeseries
, which we define as a Pandas dataframe with an index of type DatetimeIndex (see, https://jakevdp.github.io/PythonDataScienceHandbook/03.11-working-with-time-series.html)https://github.com/flojoy-io/nodes/blob/main/GENERATORS/SIMULATIONS/TIMESERIES/TIMESERIES.py
LINE
is updated to recognize the timeseries
DataContainer type, and make sure that the DatetimeIndex is correctly converted to plotly's preferred string format for dates (' YYYY-MM-DD hh:mm:ss '). IIRC both pandas and plotly should be capable of nanosecond precision but worth testing: https://pandas.pydata.org/docs/reference/api/pandas.DatetimeIndex.nanosecond.htmlhttps://github.com/flojoy-io/nodes/blob/main/VISUALIZERS/PLOTLY/LINE/LINE.py#L16
Given this flow
flojoy.txt
After being executed, the timeseries plot won't load.
I took the
dc_input
from the LINE node of the timeseries, and saved it to disk. I loaded it in jupyter and the plot rendered just fine, both usingpx.express
andpx.graph_object
Not sure why the UI can't render the timeseries plot, but it has something to do with the
x
being timeseries data. If I replace it withNone
ornp.random.rand
in theTIMESERIES
node code, it renders as expected