
Top and bottom legend (launched)
Top and bottom legends - continuing the push on new, better vis
Transcript
This transcript is auto-generated. Names and product terms may be wrong.
rip it uh I have a quick demo okay so I think I already demoed a couple weeks ago you can now go like left and right on Legends uh now you can also go top and bottom that's fun um and then the real fun thing was like we originally having problems with resizing on top and bottom but that obviously works pretty well now um and couple other things so if you throw in a quantitative uh field that generates a quantitative Legend you can now put this thing top and bottom that's fun resizing should still all work of course and then here's another fun one if you make this thing nominal so we get a ton of Legend items and getting this thing to actually respond
uh in a sort of like responsive and dynamic way it was fairly difficult surprisingly um so like obviously when the chart's this large we can allow the legend to take up a pretty good amount of space but as it gets smaller we don't want the legend to um take priority and so now the top and bottom Legends can shrink appropriately and they're they stay scrollable um and then one last fun little wild card is that there is this Third Kind Of Legend which is the size Legend um and if I Map size to count uh I steal my own Thunder by showing that the size Legend also will render top or bottom um and it can be moved independent of the other Legends it could
be on the right um or the left could be anywhere just like the other Legends uh and last but not least all of this stuffff works so here's a dashboard obviously it works on the dashboard uh but it also works through the scheduler awesome yeah it looked like if I if I saw correctly in that scenario where the legend was super large and then you SK so and in the the dashboard in the workbook it was scrollable in the when you schedule it it just kind of gets cut off it looks like which I'm not saying is a I don't know what else we can do about it but is that the right uh understanding yeah so Colin cut the demo video before these comments
because I intentionally didn't mention any of that uh there's still a bunch of stuff to be done here I your short answer is you're right um slightly that that's the wrong answer to be clear yeah I agree well slightly longer answer and Technical explanation here is that um there are a bunch of so there are a bunch of problems like um getting the this Legend and basically any Legend that goes through the scheduler is rendered by Vega itself and getting Vega to position a legend is like moving Heaven and Earth uh it's incredibly frustrating and so uh the default setting is basically this one where it sort of left aligns with the the left axis here um and instead of going the incredibly complicated route
I I think I want to just enumerate all the caveats to the the sales and field teams for now and you know we can do a second pass that tries to make the alignments a little bit prettier and then similarly like as you noted these things get cut off which is a super bummer because I actually have I wrote a bunch of code um that locally doesn't cut them off in the static renderer and then learned uh late in the game that the way Vega executes its Expressions which you have to use to dynamically change like their Legends is in a second pass and so basically it does one pass renders everything and then does a second pass and executes the Expressions but the scheder
has already captured the output before the second pass has happened so I have some ideas about how to try to minimize the amount of Legends that get cut off but the V1 of this maybe to ship it as is because when we have a smaller set of Legends it's totally fine and then V2 to make these incremental improvements strongly agree that this is shippable do do we have the power to Center this horizontally if we wanted to or is it pretty rigid in terms of like what we can do to it I think we do uh but it requires some hair pulling and like fighting Vega it's just yeah Vega provides very few like the biggest issue is uh Vega I think operates under the
assumption that you are building a thing that has some sort of like well understood bounds around the data that you're displaying and so if you want to position like bottom center then you just manually input a bunch of padding like static padding values and you're good and that works sometimes but uh obviously like if you're clicking around and you're in autoz it can make Legends look horrible um so yeah I would say that's like a V2 pass or V3 pass okay I mean I think ultimately we basically have to create there's a larger project here at some point in the future of like creating our own legend renderer for the scheduler that isn't constrained by Vega yeah I'm less conc ered about it from a
scheduling aspect actually um I just think that people will want to lay like just people want find green control overlay out of everything so oh yeah well if we're just talking HTML that's way easier like oh yeah yeah I wouldn't even yeah I I do not care about it in the rendered context I think someone's going to want to take two things like if there's two keys and move it to the center um I feel like that's probably the more important yeah that's super easy so hopefully going out today or early next week I've got a uh I've got a small one