Anvil: Web Apps with Nothing but Python Transcripts
Chapter: Charts and graphs
Lecture: Finishing the no-data story
Login or
purchase this course
to watch this video and the rest of the course contents.
0:00
All right. Our app is looking really good. We saw we can get this chart looking fantastic. Another thing going on, though
0:07
down here, that's not great is we can show this. Alright. Let's actually go and test that. Let's in here and set that to be empty.
0:18
All right. Here's our spot where it says Hey, there's no data. Maybe you should go add some. Well, this is an encouraging button
0:26
but it's behavior is not so encouraging. We just need to take them here over to add measurement, right? That would be great. How do we do that?
0:34
Well, it turns out to be super easy. Do we have navigation imported? Not yet. Remember we wrote this navigation thing
0:42
specifically so all these components' controls can use the navigation stuff without knowing or caring about it. So let's go to our design
0:51
do the double-click on that thing. And then, all we've got to do down here we want to go home, is we say, navigation.go_add
0:58
Or go to add an element, we say, go_add like this. Let's get rid of this space. There. Like so. What do you think? Is it going to work?
1:08
Of course it's going to work because our navigation is awesome. Alright. Here it is. Let's give it a click and see what happens. Ready? Boom.
1:17
Just like that. We can add another measurement. If we had deleted our elements out maybe that's, maybe that's worth a little try here.
1:23
Let's go and do one more thing. Let's go over to our data table. Delete out the elements. So I can go up here. Right now, remember, I'm faking this out
1:31
to only...just only show no data. So what I want to do is go through the experience of there is no data, I click the button
1:39
I enter an element, then I have data. So instead of deleting them just so we still have them, I'm going to try to simulate that by seeing...
1:47
Let's go for the 6th onward one. Alright. Because there's five, and I said Give me only the 6th and onward measurements this thing thinks there's none.
1:57
So let's go and add one. There should be at least one and we'll get started from there. So we'll say, add measurement and I'll pick yesterday.
2:04
Let's say, The weight's 180, heart rate is 69. I hit this. It'll take me back home. Going back home should realize that
2:13
there's now at least one element shows something different. Boom. There it goes. Now, why do we see all of these here? We see two, four, six because
2:22
remember, I was doing the slice up here; but down the bottom we're getting all of them again. That works. That's the flow that we're looking for.
2:31
You go there, you land on the page you've signed up for an account you don't have any measurements. Put one in. Boom.
2:37
You're taken back. Now, that graph is shown. I think this whole graph and home page thing is well, it's pretty good. I'm going to call it done.