Commit 86f8d8c
[Lens as code] Fix waffle chart legend values not roundtripping through the API (elastic#269774)
## Summary
fix elastic#268819
The waffle chart is the only partition chart that lets users show/hide
metric values in the legend. However, the API transform layer was
missing the mapping between the API legend.values field and the internal
legendStats state — meaning this setting was silently lost when
converting to/from the API format.
This adds bidirectional mapping:
- `legend.values: ['absolute']` → `legendStats: ['value']` (show values)
- `legend.values` omitted → `legendStats: []` (hide values)
For existing saved objects where `legendStats` is `undefined` (which
renders as "show values" by default), serializing to API now correctly
emits `legend.values: ['absolute']`.1 parent 613f82f commit 86f8d8c
2 files changed
Lines changed: 105 additions & 0 deletions
File tree
Lines changed: 73 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
203 | 203 | | |
204 | 204 | | |
205 | 205 | | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
206 | 279 | | |
Lines changed: 32 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
232 | 232 | | |
233 | 233 | | |
234 | 234 | | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
235 | 263 | | |
236 | 264 | | |
237 | 265 | | |
| |||
381 | 409 | | |
382 | 410 | | |
383 | 411 | | |
| 412 | + | |
384 | 413 | | |
385 | 414 | | |
386 | 415 | | |
| |||
468 | 497 | | |
469 | 498 | | |
470 | 499 | | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
471 | 503 | | |
472 | 504 | | |
473 | 505 | | |
| |||
0 commit comments