heavyai / heavyai-charting

Dimensional charting built to work natively with crossfilter rendered using d3.js
https://heavyai.github.io/heavyai-charting/
Other
399 stars 73 forks source link

[FE-16842] Show legend in bottom left for mesh2d layers (cross section) #649

Closed johallar closed 1 year ago

johallar commented 1 year ago

😌 The position was all driven from the useMap argument passed to raster chart. This enabled individual layers to determine their own legend position but falls back to the useMap logic

This also calls the same format function that legend v1 calls so we don't get crazy precision in the legend values (eg. 45.123853434534)

Before

Screen Shot 2023-06-06 at 5 07 32 PM

After:

Legend Position:

Screen Shot 2023-06-06 at 5 01 05 PM

Format legend values:

Screen Shot 2023-06-06 at 5 06 48 PM

Merge Checklist

:wrench: Issue(s) fixed:

:smoking: Smoke Test

:ship: Merge

cmatzenbach commented 1 year ago

Ok looks like some of those issues are just on the master layer (namely the weird 0 overlay), but the values still seem a bit random (although maybe this is just the data.....not exactly sure what we're measuring here with the colors) and the low value is still appended with a "m". I do see this branch was addressing a ticket re: legend positioning, so if we want to open a separate investigative issue around this behavior and merge this one as-is I'm also fine with it :)

https://github.com/heavyai/heavyai-charting/assets/15268289/5e73652e-61b8-4431-a648-74623fdc83f1

cmatzenbach commented 1 year ago

You're call - if you want to handle those separately I'm fine with it; in that case, this looks good to go as it addresses the ticket scope.

johallar commented 1 year ago

Hm, yeah we've never had a stacked legend on a coordinate grid chart which is probably why we haven't seen the 0 hover thing before. That's coming from the axes, where you can manually input min/max values.

As far as the m, this uses the same formatting function as the rest of the legends so I think this is how immerse just currently formats numeric legends. Scatter chart on master:

Screen Shot 2023-06-08 at 10 44 24 AM Screen Shot 2023-06-08 at 10 47 24 AM

Wondering if the m is coming from "milli" prefix:

Screen Shot 2023-06-08 at 10 46 53 AM

I'll give both of these a quick look, but I think re-positioning and formatting still mostly a win with some good call outs for weird behavior interactions that we should look into separately.

johallar commented 1 year ago

Put this bug in to follow up on the 0 overlap piece. Since the rest of our legends use the same format as the m bit i'm calling that "working as expected". Larger app considerations for changing how we format those values across the app for that one.