Closed sharlagelfand closed 3 years ago
@giorgi-ghviniashvili I'm trying to track down why this is happening, in the app if you hit "Go", then "Go" again, there is this error in the console:
vlSpec.meta is undefined
I'm not sure what's making it freeze but could you try it out and look into that error? Thank you!
@sharlagelfand could you plz record a video?
@sharlagelfand latest code from error-bars will fix this as well.
thanks @giorgi-ghviniashvili! the latest app is here, the animation plays eventually but the first bit is frozen/choppy and the error persists
Something is strange here, we need to debug it .
@sharlagelfand , I see that init function is called multiple times after click "Go", can you see why it happens? It must only call it once..
@giorgi-ghviniashvili yeah i can see it is called once the first time, then twice the second time "go" is clicked.... I'll see if I can figure out why
@sharlagelfand if you can't figure it out, I will just use flag variable: initializing: true | false
and will ignore all subsequent init calls while initializing. Just lmk.
Thanks @giorgi-ghviniashvili - the latest app is here, as far as I can tell on my end init is not being called multiple times but it's still freezing/erroring:
Maybe let's try adding that flag to ignore subsequent init
calls? Just checking, this will only ignore them "while initializing", but will allow for calling again via pressing "go" / changing settings etc, right?
Just checking, this will only ignore them "while initializing", but will allow for calling again via pressing "go" / changing settings etc, right?
Of course :) It will just ensure that init function will complete.
Ah shoot, different error now when you hit "go" twice on the updated app:
vegaLiteSpecs[i] is undefined
@sharlagelfand good catch, please update it.
Thanks @giorgi-ghviniashvili!! It definitely does not freeze now 🎉 Updated here
It seems like maybe something is "off by 1" in terms of the animation shown - maybe having to do with the initialization?
The first time I click "go" it's the default settings - group by Degree, calculate mean Salary - and this works great. The second time (~18 seconds), I group by Degree and Work, but the animation still shows just grouped by Degree. The third time (~40 seconds), I group by Degree and Work, and calculate median Salary, but the animation shows grouped by Degree and Work, but the mean - so it looks like any time after the first click, it uses the previous iterations specs?
@sharlagelfand that's strange. I added console.log statements to print out passed specs. Please update it.
@giorgi-ghviniashvili updated app is here - the log seems to show the lag in specs from what I can tell!
@sharlagelfand init
function is called twice after second click on "GO":
And because initializing flag, second call (with correct specs) is ignored.
So this means that there is an issue on Shiny side, it calls init with old specs.. Please check this, it MUST call init only once.
See video: https://user-images.githubusercontent.com/6615532/120631993-8e27ec00-c479-11eb-8f3d-550f030eff0c.mov
Ahh super annoying, it should only be calling once... but let me debug further. Thanks for looking into this!
Just to update, I have sorted this out 🙌🏻 🥳 Still working out some fiddly bits for #45 but I'll push an updated version of the app with both features / fixes once that's sorted.
Updated app is here with this fix! 🤞🏻
This seems all good, finally, so closing now!
Just to keep track of this so I dig into it... I'm not sure if it's an issue with the way the Shiny app is laid out or how the specs are generated/animated, but will look into it.