Retrieve stored data and update SVGView

Hi there (again),

I found out a way to upload the file and if this is uploaded then the data is stored in the entity. I’ve also added a SVGView to display the data as an image using matplotlib.

It’s not quite clear for me how the controller knows when to update the image because I can see that the data is loaded in my simple print debug statements but the image is empty because the data is not there yet.

So how can I proceed to update the plot after the data is loaded?

The code is here;https://github.com/breinbaas/v_ncross

and if you need the actual testdata (not in the repo) I can send it to you

Thanks in advance

There are 2 possible ways a view can be updated:

  • Fast view (duration_guess <= 3): update is done immediately after a triggering action
  • Slow view (duration_guess > 3): update is done if the user clicks the view’s update button

See here for more info on the fundamentals of triggering actions.

See here for more info on views.

I looked at your code and noticed that you store data on the Controller as a class variable. This is not going to work, your code is rerun each trigger action, meaning your code should be stateless.

I would advise you to do the “Getting Started” (or at least have a look at the “Understand your first app”) section first, to get a quick tour on getting started with VIKTOR and its fundamentals.

1 Like

Having a nice long walk helped…