
Moving legends left/right (launched)
New functionality to move legends around. Starting with left/right, the next focus of work will be on bottom/top legends. Some better erroring as well.
Transcript
This transcript is auto-generated. Names and product terms may be wrong.
on a couple very minor ones I can show um this is not even really work I can claim uh but there's a strong ask to to be able to reorient the Legends and um basically I made it so you can do that at least left and right so trivial um top and bottom are significantly more difficult mostly because when we um when we schedule PDFs of these things uh we fall back from using our custom Legend and use um Vega's built-in Legend and Vega's built-in top and bottom Legend are pretty crude uh to put it nicely they sort of basically ask you to configure them manually and they don't really have a a lot of um visibility into how many points are in The Legend
and things like that so going to work on that totally understand that top and bottom Legends are the actual strongest part of the requirement here but um I want to sh just for the uh for the non-technical folks why do we uh why do we have to use the Vega legend for scheduling uh I the answer is I don't know I didn't write this part I mean okay look like we we can use we could render our HTML Legends if we really want to but I assume whoever worked on this before me uh made it quite a bit easier by isolating the viz and just having it output like when vega generates its output it outputs it as a simple image and Pro I assume
getting that to be rendered by the schedule was significantly easier yeah I mean I could speak to that if you want um the main problem is is that we we render the Vega and then we interrogate Vega to see like what its Legend uh structure looks like and then we render our own and so like that work is asynchronous and our scheduling code runs synchronously and so like we really don't have any space for asynchronous code yeah okay I can just already see the bug that's filed that the Legends don't match that's going to come up so sorry you guys well they already don't like you can already see some visual differences and there's some you know but it's not as it's going to be
way more obvious like Nate said in the top and bottom because it's like huh yeah so I think probably just to give a heads up to the field like we can get top and bottom Legends probably even working kind of today day but the next immediate request will be why do my bottom Legends get cut off or if they don't get cut off it'll be like why is the chart rendered so small because the legend is taking up so much space um so just be prepared like you know probably 60 70% of the use cases will work fine and then the other 30 or 40 will people will inevitably be complaining about very difficult to solve sizing and stylistic problems um but you know having
something is probably better than having nothing um this all does work in the scheduler I'm not going to run it but uh this is an example of the left uh located axis this particular example there's a one use case I found where there's a size Legend um and this just demonstrates that we can render both independently so you can choose size to be on the right and color to be on the left um you could have them both on the left you could have them both on the right you could have one be not be rendered um but this is a minor Corner case um I guess oh one other quick note I I updated the styling of the Legends uh in the scheduler because
they were um they had a strange border around them so I removed that and just made The Styling more consistent with the app styling um and I guess like I guess last thing I could do is uh if you if you want to see what the legend looks like when it's in the bottom this is this case will actually look pretty good it's going to look like this um this case obviously works okay if I had the real issue is when we have a lot of uh Legend items and it just starts to kind of run off the screen and it's really difficult to predict how much space we need based on the size of the text um cool that's one another real quick one
I can show is this is kind of behind the scenes um but we've had had for for a while we've had this kind of longstanding problem where um errors thrown in the query execution pipelines on dashboards and workbooks never really got handled super well and this is exacerbated by um some of the changes we made to holistically handle errors and not have uh full page errors so uh what you would see on dashboards or errors that look like this pretty pretty much like in actionable like nothing nothing you can really do with that bear with me for a sec while I restart my local um but basically now we can Surface the errors uh it's a little bit aggressive um in that we get a
bunch of tiles with errors and we also get like a a little toast that pops up that's also got an error in it but at least the error message now in theory will be visible in the UI and be somewhat actionable um let's see almost there that's not it this is just because my server hasn't started yet come on model server where are you well I might have to rebuild my local uh which probably why the model server is not starting I can uh I'll just drop a screenshot into the Colin or something for the the um purpose of the demo of course literally as soon as I sto sharing my model server started H hang on let me share my screen again if you
want a beautiful edit in the future just talk like it's working and I'll just uh but if we if we have to splice sound in video that's that goes beyond my skill set yeah well you can see it here so I just have in my code I've manually thrown an error um and so now we just get a notice that like something was wrong with the query request and the toast pops up here with the error message um so that's that and then the only other thing to mention I guess on my end is um as most of you all know I've been like deep in the salt mines dealing with viz code stuff um I have a big plan there I think we're going
to come up with some kind of format to to talk to the rest of the or around it in the next week or two um in the process I've I've filled in a lot of testing uh bits I think I've added with this next PR that'll land I've added like 30 ,000 lines of snapshot tests um just to try to cover as much of the surface area as possible so progress is being made even even though it's not totally visible