enamlx icon indicating copy to clipboard operation
enamlx copied to clipboard

[DOC] How to add live data without reloading them ?

Open Kochise opened this issue 4 years ago • 2 comments

Hi, nice project, I try to add data to a table/tree/plot without changing the existing data yet obviously you have to "reload" the whole model every time.

For instance in enamlx-master\examples\tree_view\tree_view.enaml, when you add a Person using add_person it reloads the model and collapses all the opened nodes, yet the data already present is preserved (checked nodes are still checked). How preventing the tree from collapsing ?

Btw when you delete two Person the example crashes.

As for the plot area, I'd like to add values coming from a probe and have the view to scroll "like an oscilloscope". How is it possible ?

Mostly like https://raw.githubusercontent.com/wiki/epezent/implot/screenshots3/rt.gif (the graph on top)

Kochise avatar Oct 19 '21 09:10 Kochise

I haven't messed with this in a while but for the TreeView you should be able to use a ContainerList and windowing technique (see the table view example). You might need just create a custom widget.

For the plot the you need to use pyqtgraph's PlotCurveItem and draw with the QPainterPath directly from what I remember.

frmdstryr avatar Oct 19 '21 14:10 frmdstryr

I tried to check with https://github.com/inkcut/inkcut/ since it looks like the Live panel seems to do exactly that, but not.

Will see, thank.

Kochise avatar Oct 19 '21 15:10 Kochise