Commit 9588cb3
Fix Charge Point sessions chart loading, plus zoom-sync, epoch-bar, and alignment improvements (#2259)
* fix: render charge point sessions chart and sync x-axis zoom
The charge point sessions chart crashed and, once rendering, did not share
x-axis pan/zoom with the other subcharts.
- Read sensors via _extract_sensors_from_entry to handle the standardized
{title, plots:[{sensors}]} format (fixes NoneType/KeyError on 'sensors').
- Filter the 'Power flow by type' entry through its plots.
- Always set resolve.scale.x = shared (only mark color independent when
legends are not combined) so subcharts share the x scale.
- Remove pinned x/x2 scale domains from the sessions layers.
- Add an invisible zoom layer bound to the same event_start field the other
charts use, so dragging the sessions chart drives the same shared-scale
signal and all subcharts pan together.
* fix: hide incomplete charge point session pairs (no epoch bars)
A session bar was drawn from 1970-01-01 when one endpoint of a pair was
missing (e.g. a 'stop charging' value with no matching 'start charging').
The pivot transform fills the missing endpoint with 0, which Vega renders
as epoch 0 (1970); isValid() treats 0 as valid, so it must be excluded too.
Filter each paired session layer (start/stop charging, arrival/departure,
plug in/plug out) requiring both endpoints to be > 0, so a pair missing an
endpoint is skipped while the asset's other complete pairs still render.
* fix: align charge point session lines per asset
The thick start/stop charging line did not sit on the thin plug-in/out and
arrival/departure lines. Each layer derived its yOffset from a session_id
built as asset_id + event_start, but the charging beliefs carry a different
event_start than the plug/arrival beliefs (and may even fall on another day),
so the charging layer landed in a different yOffset sub-band.
Remove the per-session yOffset from the session layers so all three pairs of
the same asset share one row (y = asset_id) and line up exactly.
* docs: reassign changelog entry for PR #2237 from v1.0.0 to v0.33.1
Signed-off-by: F.N. Claessen <claessen@seita.nl>
* docs: changelog entry
Signed-off-by: F.N. Claessen <claessen@seita.nl>
---------
Signed-off-by: F.N. Claessen <claessen@seita.nl>
Co-authored-by: F.N. Claessen <claessen@seita.nl>1 parent cbb67be commit 9588cb3
2 files changed
Lines changed: 104 additions & 77 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
33 | 32 | | |
34 | 33 | | |
35 | 34 | | |
36 | 35 | | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
37 | 42 | | |
38 | 43 | | |
39 | 44 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
656 | 656 | | |
657 | 657 | | |
658 | 658 | | |
659 | | - | |
660 | | - | |
661 | | - | |
662 | | - | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
663 | 665 | | |
664 | 666 | | |
665 | 667 | | |
| |||
1132 | 1134 | | |
1133 | 1135 | | |
1134 | 1136 | | |
1135 | | - | |
| 1137 | + | |
1136 | 1138 | | |
1137 | 1139 | | |
1138 | 1140 | | |
| |||
1181 | 1183 | | |
1182 | 1184 | | |
1183 | 1185 | | |
| 1186 | + | |
1184 | 1187 | | |
1185 | 1188 | | |
1186 | 1189 | | |
| |||
1206 | 1209 | | |
1207 | 1210 | | |
1208 | 1211 | | |
1209 | | - | |
1210 | | - | |
1211 | | - | |
1212 | | - | |
1213 | | - | |
1214 | | - | |
1215 | 1212 | | |
1216 | 1213 | | |
1217 | 1214 | | |
1218 | 1215 | | |
1219 | 1216 | | |
1220 | | - | |
1221 | | - | |
1222 | | - | |
1223 | | - | |
1224 | | - | |
1225 | | - | |
1226 | 1217 | | |
1227 | 1218 | | |
1228 | 1219 | | |
| |||
1233 | 1224 | | |
1234 | 1225 | | |
1235 | 1226 | | |
1236 | | - | |
1237 | | - | |
1238 | | - | |
1239 | | - | |
1240 | | - | |
1241 | | - | |
1242 | | - | |
1243 | | - | |
1244 | 1227 | | |
1245 | 1228 | | |
1246 | 1229 | | |
| |||
1291 | 1274 | | |
1292 | 1275 | | |
1293 | 1276 | | |
| 1277 | + | |
1294 | 1278 | | |
1295 | 1279 | | |
1296 | 1280 | | |
| |||
1310 | 1294 | | |
1311 | 1295 | | |
1312 | 1296 | | |
1313 | | - | |
1314 | | - | |
1315 | | - | |
1316 | | - | |
1317 | | - | |
1318 | | - | |
1319 | 1297 | | |
1320 | 1298 | | |
1321 | 1299 | | |
1322 | 1300 | | |
1323 | | - | |
1324 | | - | |
1325 | | - | |
1326 | | - | |
1327 | | - | |
1328 | | - | |
1329 | 1301 | | |
1330 | 1302 | | |
1331 | 1303 | | |
| |||
1339 | 1311 | | |
1340 | 1312 | | |
1341 | 1313 | | |
1342 | | - | |
1343 | | - | |
1344 | | - | |
1345 | | - | |
1346 | | - | |
1347 | | - | |
1348 | | - | |
1349 | | - | |
1350 | | - | |
1351 | | - | |
1352 | | - | |
1353 | 1314 | | |
1354 | 1315 | | |
1355 | 1316 | | |
| |||
1397 | 1358 | | |
1398 | 1359 | | |
1399 | 1360 | | |
| 1361 | + | |
| 1362 | + | |
| 1363 | + | |
1400 | 1364 | | |
1401 | 1365 | | |
1402 | 1366 | | |
| |||
1413 | 1377 | | |
1414 | 1378 | | |
1415 | 1379 | | |
1416 | | - | |
1417 | | - | |
1418 | | - | |
1419 | | - | |
1420 | | - | |
1421 | | - | |
1422 | 1380 | | |
1423 | 1381 | | |
1424 | 1382 | | |
1425 | 1383 | | |
1426 | | - | |
1427 | | - | |
1428 | | - | |
1429 | | - | |
1430 | | - | |
1431 | | - | |
1432 | 1384 | | |
1433 | 1385 | | |
1434 | 1386 | | |
| |||
1442 | 1394 | | |
1443 | 1395 | | |
1444 | 1396 | | |
1445 | | - | |
1446 | | - | |
1447 | | - | |
1448 | | - | |
1449 | | - | |
1450 | | - | |
1451 | | - | |
1452 | | - | |
1453 | | - | |
1454 | | - | |
1455 | | - | |
1456 | 1397 | | |
1457 | 1398 | | |
1458 | 1399 | | |
| |||
1489 | 1430 | | |
1490 | 1431 | | |
1491 | 1432 | | |
1492 | | - | |
1493 | | - | |
1494 | | - | |
1495 | | - | |
1496 | | - | |
| 1433 | + | |
| 1434 | + | |
| 1435 | + | |
| 1436 | + | |
| 1437 | + | |
| 1438 | + | |
| 1439 | + | |
1497 | 1440 | | |
1498 | 1441 | | |
1499 | 1442 | | |
| |||
1506 | 1449 | | |
1507 | 1450 | | |
1508 | 1451 | | |
| 1452 | + | |
| 1453 | + | |
| 1454 | + | |
| 1455 | + | |
| 1456 | + | |
| 1457 | + | |
| 1458 | + | |
| 1459 | + | |
| 1460 | + | |
| 1461 | + | |
| 1462 | + | |
| 1463 | + | |
| 1464 | + | |
| 1465 | + | |
| 1466 | + | |
| 1467 | + | |
| 1468 | + | |
| 1469 | + | |
| 1470 | + | |
| 1471 | + | |
| 1472 | + | |
| 1473 | + | |
| 1474 | + | |
| 1475 | + | |
| 1476 | + | |
| 1477 | + | |
| 1478 | + | |
| 1479 | + | |
| 1480 | + | |
| 1481 | + | |
| 1482 | + | |
| 1483 | + | |
1509 | 1484 | | |
1510 | 1485 | | |
| 1486 | + | |
| 1487 | + | |
| 1488 | + | |
| 1489 | + | |
| 1490 | + | |
| 1491 | + | |
| 1492 | + | |
| 1493 | + | |
| 1494 | + | |
| 1495 | + | |
| 1496 | + | |
| 1497 | + | |
| 1498 | + | |
| 1499 | + | |
| 1500 | + | |
| 1501 | + | |
| 1502 | + | |
| 1503 | + | |
| 1504 | + | |
| 1505 | + | |
| 1506 | + | |
| 1507 | + | |
| 1508 | + | |
| 1509 | + | |
| 1510 | + | |
| 1511 | + | |
| 1512 | + | |
| 1513 | + | |
| 1514 | + | |
| 1515 | + | |
| 1516 | + | |
| 1517 | + | |
| 1518 | + | |
| 1519 | + | |
| 1520 | + | |
| 1521 | + | |
| 1522 | + | |
| 1523 | + | |
| 1524 | + | |
| 1525 | + | |
| 1526 | + | |
| 1527 | + | |
| 1528 | + | |
| 1529 | + | |
| 1530 | + | |
| 1531 | + | |
| 1532 | + | |
0 commit comments