I have a figure.multi_line
plot in which the number of lines is constant, but each time new streaming data comes in, I want to append a new point to each of the lines. For instance:
# initial state, no data
cds.data = {
'x': [
[],
[],
[]
],
'y': [
[],
[],
[]
]
}
# after incorporating two points for each line
cds.data = {
'x': [
[1,2],
[3,5],
[5,3]
],
'y': [
[2,7],
[7,4],
[4,5]
]
}
This is a form of appending that cannot be achieved directly by using cds.stream(...)
, which would instead append to the outer lists cds.data['x']
and cds.data['y']
.
So, I manipulated the cds.data
field directly, I can confirm that the cds.data
structure is as expected, but I don’t see anything showing up in the plot.
Is there some best practice for doing this kind of thing?
Thanks in advance!