Superset wears the new design; site charts sit as boxes (PD-24 to PD-26)
Theme tokens for the slate surfaces and borders, the logo with the green Y, chart boxes at 16 px with the card shadow. Full figures with the unit in the subheader; every layer of the tabs transparent, so the site's charts sit as boxes in Firefox and Safari too. The Overview gets a Sites filter and the period's scope returns to the time charts (PD-25). The embedded frame can shrink again. A change to the image's inputs: Superset rebuilds on the next deploy. Bands: Superset. Rules: 2. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
78a498f1ce
commit
d95e6e184a
5 files changed
+91
-24
No files matched your search
@@ -89,7 +89,7 @@ Source: `petrolyst-web/design/brand/` (tokens `07_UI_Tokens/petrolyst_tokens.css
|
|||||||
|
|
||||||
- Light theme: action teal `#00695C` for primary and links, navy `#0B1D33` text, `#F8FAFC`
|
- Light theme: action teal `#00695C` for primary and links, navy `#0B1D33` text, `#F8FAFC`
|
||||||
layout, full-colour stacked logo.
|
layout, full-colour stacked logo.
|
||||||
- Dark theme: `#35C5B6` primary, `#071425` / `#12263D` surfaces, white logo.
|
- Dark theme: `#35C5B6` primary, `#1F2A33` / `#2A3945` surfaces (PD-26), white logo with the Y in its green.
|
||||||
- Font: Inter, Superset's default. Satoshi is licence-restricted and is not used.
|
- Font: Inter, Superset's default. Satoshi is licence-restricted and is not used.
|
||||||
- Chart palettes: "Petrolyst" categorical (the default, brand teal first) and "Petrolyst Teal" /
|
- Chart palettes: "Petrolyst" categorical (the default, brand teal first) and "Petrolyst Teal" /
|
||||||
"Petrolyst Navy" sequential. The categorical palette was validated with the dataviz skill's
|
"Petrolyst Navy" sequential. The categorical palette was validated with the dataviz skill's
|
||||||
|
|||||||
@@ -0,0 +1,27 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="89 671 1268 103" role="img" aria-label="Petrolyst">
|
||||||
|
<!-- Petrolyst's wordmark alone: petrolyst-web/design/brand/02_Logo/Vector_Master/
|
||||||
|
petrolyst_wordmark_fullcolor.svg with the letters white for the dark chrome (PD-26); the Y keeps its original gradient. -->
|
||||||
|
|
||||||
|
<defs>
|
||||||
|
<linearGradient id="wordYGradient" x1="945" y1="660" x2="1090" y2="780" gradientUnits="userSpaceOnUse">
|
||||||
|
<stop offset="0%" stop-color="#009688"/>
|
||||||
|
<stop offset="100%" stop-color="#00B6E6"/>
|
||||||
|
</linearGradient>
|
||||||
|
</defs>
|
||||||
|
|
||||||
|
<g fill="#FFFFFF">
|
||||||
|
<path d="M 250.0,753.0 L 250.0,767.0 L 339.0,767.0 L 339.0,764.0 L 340.0,763.0 L 340.0,757.0 L 339.0,756.0 L 339.0,752.0 L 251.0,752.0 Z" fill="#FFFFFF" fill-rule="evenodd"/>
|
||||||
|
<path d="M 250.0,715.0 L 250.0,729.0 L 266.0,729.0 L 267.0,730.0 L 301.0,730.0 L 302.0,729.0 L 307.0,729.0 L 308.0,730.0 L 325.0,730.0 L 326.0,729.0 L 340.0,729.0 L 340.0,716.0 L 339.0,715.0 Z" fill="#FFFFFF" fill-rule="evenodd"/>
|
||||||
|
<path d="M 1260.0,678.0 L 1260.0,692.0 L 1264.0,692.0 L 1265.0,693.0 L 1296.0,693.0 L 1297.0,694.0 L 1297.0,767.0 L 1313.0,767.0 L 1313.0,694.0 L 1314.0,693.0 L 1351.0,693.0 L 1351.0,678.0 Z" fill="#FFFFFF" fill-rule="evenodd"/>
|
||||||
|
<path d="M 867.0,678.0 L 867.0,767.0 L 951.0,767.0 L 951.0,753.0 L 950.0,752.0 L 883.0,752.0 L 882.0,751.0 L 882.0,678.0 Z" fill="#FFFFFF" fill-rule="evenodd"/>
|
||||||
|
<path d="M 551.0,678.0 L 551.0,767.0 L 566.0,767.0 L 566.0,743.0 L 567.0,742.0 L 567.0,739.0 L 566.0,738.0 L 567.0,737.0 L 604.0,737.0 L 614.0,747.0 L 614.0,748.0 L 622.0,756.0 L 622.0,757.0 L 630.0,765.0 L 630.0,766.0 L 631.0,767.0 L 651.0,767.0 L 651.0,766.0 L 649.0,764.0 L 649.0,763.0 L 642.0,756.0 L 642.0,755.0 L 628.0,741.0 L 628.0,740.0 L 626.0,738.0 L 628.0,736.0 L 630.0,736.0 L 631.0,735.0 L 633.0,735.0 L 634.0,734.0 L 636.0,734.0 L 638.0,732.0 L 639.0,732.0 L 645.0,726.0 L 645.0,725.0 L 648.0,720.0 L 648.0,718.0 L 649.0,717.0 L 649.0,713.0 L 650.0,712.0 L 650.0,703.0 L 649.0,702.0 L 649.0,698.0 L 648.0,697.0 L 648.0,695.0 L 647.0,694.0 L 646.0,691.0 L 644.0,689.0 L 644.0,688.0 L 640.0,684.0 L 639.0,684.0 L 637.0,682.0 L 636.0,682.0 L 633.0,680.0 L 631.0,680.0 L 630.0,679.0 L 626.0,679.0 L 625.0,678.0 Z M 567.0,694.0 L 568.0,693.0 L 625.0,693.0 L 626.0,694.0 L 629.0,695.0 L 632.0,698.0 L 632.0,699.0 L 633.0,700.0 L 633.0,713.0 L 632.0,714.0 L 632.0,716.0 L 630.0,718.0 L 630.0,719.0 L 629.0,720.0 L 628.0,720.0 L 626.0,722.0 L 622.0,722.0 L 621.0,723.0 L 568.0,723.0 L 566.0,721.0 L 566.0,703.0 L 567.0,702.0 Z" fill="#FFFFFF" fill-rule="evenodd"/>
|
||||||
|
<path d="M 398.0,678.0 L 398.0,693.0 L 434.0,693.0 L 435.0,694.0 L 435.0,767.0 L 451.0,767.0 L 451.0,694.0 L 452.0,693.0 L 489.0,693.0 L 489.0,679.0 L 488.0,678.0 Z" fill="#FFFFFF" fill-rule="evenodd"/>
|
||||||
|
<path d="M 250.0,678.0 L 250.0,692.0 L 251.0,692.0 L 252.0,693.0 L 339.0,693.0 L 339.0,691.0 L 340.0,690.0 L 340.0,679.0 L 339.0,678.0 Z" fill="#FFFFFF" fill-rule="evenodd"/>
|
||||||
|
<path d="M 1134.0,683.0 L 1129.0,688.0 L 1129.0,689.0 L 1127.0,691.0 L 1127.0,693.0 L 1126.0,694.0 L 1126.0,696.0 L 1125.0,697.0 L 1125.0,712.0 L 1126.0,713.0 L 1126.0,715.0 L 1127.0,716.0 L 1128.0,719.0 L 1134.0,725.0 L 1135.0,725.0 L 1137.0,727.0 L 1139.0,727.0 L 1140.0,728.0 L 1143.0,728.0 L 1144.0,729.0 L 1185.0,729.0 L 1186.0,730.0 L 1191.0,730.0 L 1192.0,731.0 L 1193.0,731.0 L 1197.0,735.0 L 1197.0,739.0 L 1198.0,740.0 L 1198.0,742.0 L 1197.0,743.0 L 1197.0,746.0 L 1196.0,747.0 L 1196.0,748.0 L 1193.0,751.0 L 1192.0,751.0 L 1189.0,753.0 L 1184.0,753.0 L 1183.0,754.0 L 1151.0,754.0 L 1150.0,753.0 L 1143.0,753.0 L 1142.0,752.0 L 1139.0,752.0 L 1138.0,751.0 L 1135.0,751.0 L 1134.0,750.0 L 1131.0,750.0 L 1130.0,749.0 L 1128.0,749.0 L 1127.0,748.0 L 1125.0,748.0 L 1125.0,760.0 L 1124.0,761.0 L 1126.0,763.0 L 1128.0,763.0 L 1129.0,764.0 L 1131.0,764.0 L 1132.0,765.0 L 1134.0,765.0 L 1135.0,766.0 L 1139.0,766.0 L 1140.0,767.0 L 1146.0,767.0 L 1147.0,768.0 L 1186.0,768.0 L 1187.0,767.0 L 1191.0,767.0 L 1192.0,766.0 L 1195.0,766.0 L 1196.0,765.0 L 1198.0,765.0 L 1199.0,764.0 L 1201.0,764.0 L 1203.0,762.0 L 1204.0,762.0 L 1209.0,757.0 L 1209.0,756.0 L 1211.0,754.0 L 1211.0,753.0 L 1212.0,752.0 L 1212.0,750.0 L 1213.0,749.0 L 1213.0,734.0 L 1212.0,733.0 L 1212.0,730.0 L 1211.0,729.0 L 1211.0,728.0 L 1209.0,726.0 L 1209.0,725.0 L 1204.0,720.0 L 1203.0,720.0 L 1202.0,719.0 L 1201.0,719.0 L 1196.0,716.0 L 1192.0,716.0 L 1191.0,715.0 L 1148.0,715.0 L 1147.0,714.0 L 1145.0,714.0 L 1142.0,711.0 L 1142.0,710.0 L 1141.0,709.0 L 1141.0,699.0 L 1142.0,698.0 L 1142.0,697.0 L 1145.0,694.0 L 1146.0,694.0 L 1147.0,693.0 L 1150.0,693.0 L 1151.0,692.0 L 1190.0,692.0 L 1191.0,693.0 L 1196.0,693.0 L 1197.0,694.0 L 1201.0,694.0 L 1202.0,695.0 L 1204.0,695.0 L 1205.0,696.0 L 1209.0,696.0 L 1209.0,683.0 L 1206.0,681.0 L 1203.0,681.0 L 1202.0,680.0 L 1198.0,680.0 L 1197.0,679.0 L 1193.0,679.0 L 1192.0,678.0 L 1182.0,678.0 L 1181.0,677.0 L 1156.0,677.0 L 1155.0,678.0 L 1146.0,678.0 L 1145.0,679.0 L 1143.0,679.0 L 1142.0,680.0 L 1140.0,680.0 L 1139.0,681.0 L 1138.0,681.0 L 1137.0,682.0 Z" fill="#FFFFFF" fill-rule="evenodd"/>
|
||||||
|
<path d="M 714.0,691.0 L 714.0,692.0 L 711.0,695.0 L 711.0,696.0 L 709.0,698.0 L 709.0,699.0 L 708.0,700.0 L 708.0,702.0 L 707.0,703.0 L 707.0,706.0 L 706.0,707.0 L 706.0,711.0 L 705.0,712.0 L 705.0,734.0 L 706.0,735.0 L 706.0,739.0 L 707.0,740.0 L 707.0,743.0 L 708.0,744.0 L 708.0,745.0 L 709.0,746.0 L 709.0,747.0 L 710.0,748.0 L 711.0,751.0 L 713.0,753.0 L 713.0,754.0 L 718.0,759.0 L 719.0,759.0 L 721.0,761.0 L 722.0,761.0 L 723.0,762.0 L 724.0,762.0 L 729.0,765.0 L 731.0,765.0 L 732.0,766.0 L 735.0,766.0 L 736.0,767.0 L 741.0,767.0 L 742.0,768.0 L 775.0,768.0 L 776.0,767.0 L 781.0,767.0 L 782.0,766.0 L 785.0,766.0 L 786.0,765.0 L 788.0,765.0 L 789.0,764.0 L 790.0,764.0 L 791.0,763.0 L 792.0,763.0 L 793.0,762.0 L 796.0,761.0 L 798.0,759.0 L 799.0,759.0 L 805.0,753.0 L 805.0,752.0 L 807.0,750.0 L 807.0,749.0 L 809.0,746.0 L 809.0,744.0 L 811.0,741.0 L 811.0,737.0 L 812.0,736.0 L 812.0,711.0 L 811.0,710.0 L 811.0,706.0 L 810.0,705.0 L 810.0,703.0 L 809.0,702.0 L 809.0,700.0 L 808.0,699.0 L 808.0,698.0 L 806.0,696.0 L 806.0,695.0 L 803.0,692.0 L 803.0,691.0 L 799.0,687.0 L 798.0,687.0 L 793.0,683.0 L 792.0,683.0 L 791.0,682.0 L 789.0,682.0 L 786.0,680.0 L 783.0,680.0 L 782.0,679.0 L 779.0,679.0 L 778.0,678.0 L 770.0,678.0 L 769.0,677.0 L 748.0,677.0 L 747.0,678.0 L 739.0,678.0 L 738.0,679.0 L 734.0,679.0 L 733.0,680.0 L 731.0,680.0 L 730.0,681.0 L 728.0,681.0 L 727.0,682.0 L 726.0,682.0 L 725.0,683.0 L 722.0,684.0 L 720.0,686.0 L 719.0,686.0 Z M 725.0,702.0 L 730.0,697.0 L 731.0,697.0 L 733.0,695.0 L 735.0,695.0 L 738.0,693.0 L 742.0,693.0 L 743.0,692.0 L 772.0,692.0 L 773.0,693.0 L 777.0,693.0 L 778.0,694.0 L 781.0,694.0 L 782.0,695.0 L 785.0,696.0 L 787.0,698.0 L 788.0,698.0 L 791.0,701.0 L 791.0,702.0 L 793.0,704.0 L 793.0,705.0 L 794.0,706.0 L 794.0,708.0 L 795.0,709.0 L 795.0,712.0 L 796.0,713.0 L 796.0,733.0 L 795.0,734.0 L 795.0,738.0 L 794.0,739.0 L 793.0,742.0 L 791.0,744.0 L 791.0,745.0 L 788.0,748.0 L 787.0,748.0 L 785.0,750.0 L 784.0,750.0 L 781.0,752.0 L 778.0,752.0 L 777.0,753.0 L 770.0,753.0 L 769.0,754.0 L 747.0,754.0 L 746.0,753.0 L 740.0,753.0 L 739.0,752.0 L 737.0,752.0 L 736.0,751.0 L 734.0,751.0 L 733.0,750.0 L 732.0,750.0 L 730.0,748.0 L 729.0,748.0 L 725.0,744.0 L 725.0,743.0 L 722.0,738.0 L 722.0,734.0 L 721.0,733.0 L 721.0,713.0 L 722.0,712.0 L 722.0,709.0 L 723.0,708.0 L 723.0,706.0 L 724.0,705.0 Z" fill="#FFFFFF" fill-rule="evenodd"/>
|
||||||
|
<path d="M 95.0,678.0 L 95.0,766.0 L 96.0,767.0 L 111.0,767.0 L 111.0,737.0 L 112.0,736.0 L 171.0,736.0 L 172.0,735.0 L 175.0,735.0 L 176.0,734.0 L 178.0,734.0 L 179.0,733.0 L 180.0,733.0 L 182.0,731.0 L 183.0,731.0 L 186.0,728.0 L 187.0,728.0 L 187.0,727.0 L 190.0,724.0 L 190.0,723.0 L 193.0,718.0 L 193.0,715.0 L 194.0,714.0 L 194.0,702.0 L 193.0,701.0 L 193.0,696.0 L 192.0,695.0 L 192.0,693.0 L 191.0,692.0 L 190.0,689.0 L 188.0,687.0 L 188.0,686.0 L 185.0,683.0 L 184.0,683.0 L 182.0,681.0 L 181.0,681.0 L 180.0,680.0 L 178.0,680.0 L 177.0,679.0 L 174.0,679.0 L 173.0,678.0 L 168.0,678.0 L 167.0,677.0 L 156.0,677.0 L 155.0,678.0 L 135.0,678.0 L 134.0,677.0 L 132.0,677.0 L 131.0,678.0 L 108.0,678.0 L 107.0,677.0 L 105.0,677.0 L 104.0,678.0 Z M 111.0,693.0 L 112.0,692.0 L 169.0,692.0 L 170.0,693.0 L 172.0,693.0 L 177.0,698.0 L 177.0,699.0 L 178.0,700.0 L 178.0,712.0 L 177.0,713.0 L 177.0,715.0 L 176.0,716.0 L 176.0,717.0 L 174.0,719.0 L 173.0,719.0 L 170.0,721.0 L 167.0,721.0 L 166.0,722.0 L 154.0,722.0 L 153.0,721.0 L 152.0,722.0 L 115.0,722.0 L 114.0,721.0 L 113.0,722.0 L 111.0,720.0 Z" fill="#FFFFFF" fill-rule="evenodd"/>
|
||||||
|
<rect x="250" y="678" width="16" height="90" fill="#FFFFFF"/>
|
||||||
|
</g>
|
||||||
|
<path d="M 1084.0,678.0 L 1063.0,678.0 L 1056.0,685.0 L 1056.0,686.0 L 1049.0,693.0 L 1049.0,694.0 L 1042.0,701.0 L 1042.0,702.0 L 1036.0,708.0 L 1036.0,709.0 L 1035.0,710.0 L 1035.0,711.0 L 1033.0,713.0 L 1033.0,714.0 L 1032.0,715.0 L 1032.0,716.0 L 1031.0,717.0 L 1031.0,718.0 L 1030.0,719.0 L 1030.0,720.0 L 1028.0,723.0 L 1028.0,725.0 L 1026.0,728.0 L 1026.0,730.0 L 1025.0,731.0 L 1025.0,733.0 L 1024.0,734.0 L 1024.0,738.0 L 1023.0,739.0 L 1023.0,743.0 L 1022.0,744.0 L 1022.0,752.0 L 1021.0,753.0 L 1021.0,766.0 L 1022.0,767.0 L 1038.0,767.0 L 1038.0,737.0 L 1039.0,736.0 L 1039.0,734.0 L 1040.0,733.0 L 1040.0,732.0 L 1041.0,731.0 L 1041.0,730.0 L 1043.0,728.0 L 1043.0,727.0 L 1046.0,724.0 L 1046.0,723.0 L 1052.0,717.0 L 1052.0,716.0 L 1060.0,708.0 L 1060.0,707.0 L 1065.0,702.0 L 1065.0,701.0 L 1072.0,694.0 L 1072.0,693.0 L 1077.0,688.0 L 1077.0,687.0 L 1082.0,682.0 L 1082.0,681.0 L 1084.0,679.0 L 1085.0,679.0 Z" fill="url(#wordYGradient)" fill-rule="evenodd"/>
|
||||||
|
<path d="M 975.0,678.0 L 975.0,679.0 L 979.0,683.0 L 979.0,684.0 L 983.0,688.0 L 983.0,689.0 L 990.0,696.0 L 990.0,697.0 L 996.0,703.0 L 996.0,704.0 L 1002.0,710.0 L 1002.0,711.0 L 1010.0,719.0 L 1010.0,720.0 L 1014.0,724.0 L 1014.0,725.0 L 1017.0,728.0 L 1017.0,729.0 L 1018.0,730.0 L 1018.0,731.0 L 1019.0,732.0 L 1020.0,732.0 L 1020.0,729.0 L 1021.0,728.0 L 1021.0,726.0 L 1022.0,725.0 L 1022.0,722.0 L 1023.0,721.0 L 1023.0,715.0 L 1024.0,714.0 L 1023.0,713.0 L 1023.0,709.0 L 1022.0,708.0 L 1022.0,707.0 L 1021.0,706.0 L 1021.0,705.0 L 1016.0,700.0 L 1016.0,699.0 L 1010.0,693.0 L 1010.0,692.0 L 1003.0,685.0 L 1003.0,684.0 L 997.0,678.0 Z" fill="url(#wordYGradient)" fill-rule="evenodd"/>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 10 KiB |
@@ -566,10 +566,10 @@ The Petrolyst app (petrolyst-platform `app/`, PD-12) shows Superset dashboards i
|
|||||||
Insights lens, with guest passes from the Petrolyst server (petrolyst-platform `server/`).
|
Insights lens, with guest passes from the Petrolyst server (petrolyst-platform `server/`).
|
||||||
`build_bundle.py` builds them (since PD-13 the only dashboards in the bundle):
|
`build_bundle.py` builds them (since PD-13 the only dashboards in the bundle):
|
||||||
|
|
||||||
| Slug | Content | Filters (set by the app; Superset's filter column is hidden) |
|
| Slug | Content | Filters (preset by the app's filter row, PD-25; Superset's filter column is hidden) |
|
||||||
|---|---|---|
|
|---|---|---|
|
||||||
| `atoma-overview` | O1–O6: sites by pilot status and by baseline status, litres delivered, fuel cost by currency, electricity billed by currency and basis, litres delivered per month | Viewing period on O3–O6 |
|
| `overview` | O1–O6: sites by pilot status and by baseline status, litres delivered, fuel cost by currency, electricity billed by currency and basis, litres delivered per month | Sites (`NATIVE_FILTER-sites`, any number, none is all; every chart), Viewing period on O3–O6 |
|
||||||
| `atoma-site` | the four §4 detail tabs as Superset's own tabs, the same rows and charts; no D0 (the app shows the site's header) | Site (all charts), Viewing period (as §4: fuel and runtime charts only) |
|
| `site` | the four §4 detail tabs as Superset's own tabs, the same rows and charts; no D0 (the app shows the site's header) | Site (all charts), Viewing period (as §4: fuel and runtime charts only) |
|
||||||
|
|
||||||
- **One site dashboard with tabs** *(owner, 29 Oct: "move it back inside the dashboard and make
|
- **One site dashboard with tabs** *(owner, 29 Oct: "move it back inside the dashboard and make
|
||||||
the tab as they were")*: replaces the four one-tab dashboards `atoma-site-summary`, `-fuel`,
|
the tab as they were")*: replaces the four one-tab dashboards `atoma-site-summary`, `-fuel`,
|
||||||
@@ -582,7 +582,9 @@ Insights lens, with guest passes from the Petrolyst server (petrolyst-platform `
|
|||||||
recorded values across sites (`OVERVIEW_METRICS`); per-site rates (L/h, L/day) are never
|
recorded values across sites (`OVERVIEW_METRICS`); per-site rates (L/h, L/day) are never
|
||||||
averaged; money is grouped by `currency_text`, a missing currency is its own row, and no
|
averaged; money is grouped by `currency_text`, a missing currency is its own row, and no
|
||||||
total crosses currencies. `build_bundle.py` checks both.
|
total crosses currencies. `build_bundle.py` checks both.
|
||||||
- They carry no CSS.
|
- **Dashboard CSS** (`EMBEDDED_CSS` and the site dashboard's tab rule in `build_bundle.py`): Superset's roots at their
|
||||||
|
content's height, so the app's frame can shrink again (PD-25); the site dashboard's tab layers transparent, so its
|
||||||
|
charts sit as boxes like the Overview's (PD-24); the chart boxes with 16 px corners and the card shadow (PD-26).
|
||||||
- `import_bundle.py --embedded-out FILE --embed-domain URL` makes them embeddable from the app's
|
- `import_bundle.py --embedded-out FILE --embed-domain URL` makes them embeddable from the app's
|
||||||
origin and writes `{slug: embedding id}` for the Petrolyst server.
|
origin and writes `{slug: embedding id}` for the Petrolyst server.
|
||||||
- Embedding is switched on in the local stack only (`.local/fmdb-scratch`,
|
- Embedding is switched on in the local stack only (`.local/fmdb-scratch`,
|
||||||
|
|||||||
@@ -456,7 +456,8 @@ def big_number(key: str, title: str, view: str, metric: dict[str, Any], *,
|
|||||||
"subheader": subheader,
|
"subheader": subheader,
|
||||||
"header_font_size": 0.4,
|
"header_font_size": 0.4,
|
||||||
"subheader_font_size": 0.15,
|
"subheader_font_size": 0.15,
|
||||||
"y_axis_format": "SMART_NUMBER",
|
# The brand's number conventions (PD-24): "59,312", never "59.3k"; the unit is named in the subheader.
|
||||||
|
"y_axis_format": ",d",
|
||||||
"time_format": "smart_date",
|
"time_format": "smart_date",
|
||||||
"force_timestamp_formatting": False,
|
"force_timestamp_formatting": False,
|
||||||
}
|
}
|
||||||
@@ -487,7 +488,8 @@ def timeseries_common(x: str, metrics: list[Any], groupby: list[str], grain: str
|
|||||||
"y_axis_title_margin": 40,
|
"y_axis_title_margin": 40,
|
||||||
"y_axis_title_position": "Left",
|
"y_axis_title_position": "Left",
|
||||||
"x_axis_time_format": "%Y-%m-%d",
|
"x_axis_time_format": "%Y-%m-%d",
|
||||||
"y_axis_format": "SMART_NUMBER",
|
# Full figures, as the brand's conventions want (PD-24): one decimal for a rate, none for litres and counts.
|
||||||
|
"y_axis_format": ",.1f" if "/" in y_title else ",d",
|
||||||
"rich_tooltip": True,
|
"rich_tooltip": True,
|
||||||
"tooltipTimeFormat": "%Y-%m-%d",
|
"tooltipTimeFormat": "%Y-%m-%d",
|
||||||
"truncateXAxis": True,
|
"truncateXAxis": True,
|
||||||
@@ -523,7 +525,7 @@ def overview_charts() -> list[Chart]:
|
|||||||
|
|
||||||
return [
|
return [
|
||||||
big_number("O3", "Litres delivered", "v_delivery", m("SUM(delivered_l)", "Litres delivered"),
|
big_number("O3", "Litres delivered", "v_delivery", m("SUM(delivered_l)", "Litres delivered"),
|
||||||
period="delivery_date", subheader="all sites, in the viewing period",
|
period="delivery_date", subheader="litres, the chosen sites, in the viewing period",
|
||||||
description="Recorded deliveries. Deliveries are not consumption."),
|
description="Recorded deliveries. Deliveries are not consumption."),
|
||||||
summary_table("O1", "Sites by pilot status", "v_site", ["pilot_status"],
|
summary_table("O1", "Sites by pilot status", "v_site", ["pilot_status"],
|
||||||
[m("COUNT(*)", "Sites")]),
|
[m("COUNT(*)", "Sites")]),
|
||||||
@@ -552,8 +554,9 @@ def overview_charts() -> list[Chart]:
|
|||||||
OVERVIEW_NOTES = ("**Reading this page.** All sites together, from recorded values only: "
|
OVERVIEW_NOTES = ("**Reading this page.** All sites together, from recorded values only: "
|
||||||
"deliveries are not consumption, and site rates (L/h, L/day) are never averaged "
|
"deliveries are not consumption, and site rates (L/h, L/day) are never averaged "
|
||||||
"here; each site's own page has them. Money is shown per currency and never added "
|
"here; each site's own page has them. Money is shown per currency and never added "
|
||||||
"up across currencies. The viewing period narrows the deliveries, the costs and "
|
"up across currencies. The Sites filter narrows every figure to the chosen sites "
|
||||||
"the monthly bars; the site counts are always the current state.")
|
"(none chosen: all); the viewing period narrows the deliveries, the costs and "
|
||||||
|
"the monthly bars, while the site counts are always the current state.")
|
||||||
OVERVIEW_ROWS = [
|
OVERVIEW_ROWS = [
|
||||||
[("MARKDOWN:notes-overview", 12, 14)],
|
[("MARKDOWN:notes-overview", 12, 14)],
|
||||||
[("O3", 4, 40), ("O1", 4, 40), ("O2", 4, 40)],
|
[("O3", 4, 40), ("O1", 4, 40), ("O2", 4, 40)],
|
||||||
@@ -561,6 +564,17 @@ OVERVIEW_ROWS = [
|
|||||||
[("O6", 12, 60)],
|
[("O6", 12, 60)],
|
||||||
]
|
]
|
||||||
OVERVIEW_PERIOD_SCOPE = {"O3", "O4", "O5", "O6"}
|
OVERVIEW_PERIOD_SCOPE = {"O3", "O4", "O5", "O6"}
|
||||||
|
SITES_FILTER = "NATIVE_FILTER-sites"
|
||||||
|
|
||||||
|
|
||||||
|
def overview_filters(ids: dict[str, int]) -> list[dict[str, Any]]:
|
||||||
|
"""Sites (any number, none is all) and the Viewing period (PD-25: both in Superset's column)."""
|
||||||
|
sites = select_filter(SITES_FILTER, "Sites", "v_site", "site_label", multi=True,
|
||||||
|
required=False, excluded=[])
|
||||||
|
sites["description"] = "Any number of sites; none chosen is all sites. Search by code or name."
|
||||||
|
period = period_filter(ids, OVERVIEW_PERIOD_SCOPE,
|
||||||
|
"Narrows the deliveries, the costs and the monthly bars.")
|
||||||
|
return [sites, period]
|
||||||
|
|
||||||
|
|
||||||
# --- Site Detail -----------------------------------------------------------------------
|
# --- Site Detail -----------------------------------------------------------------------
|
||||||
@@ -699,7 +713,7 @@ def detail_charts() -> list[Chart]:
|
|||||||
"show_legend": True,
|
"show_legend": True,
|
||||||
"legendType": "scroll",
|
"legendType": "scroll",
|
||||||
"legendOrientation": "top",
|
"legendOrientation": "top",
|
||||||
"y_axis_format": "SMART_NUMBER",
|
"y_axis_format": ",.1f",
|
||||||
"rich_tooltip": True,
|
"rich_tooltip": True,
|
||||||
"x_axis_time_format": "%Y-%m-%d",
|
"x_axis_time_format": "%Y-%m-%d",
|
||||||
"y_axis_title": "L/h",
|
"y_axis_title": "L/h",
|
||||||
@@ -947,6 +961,20 @@ def dashboard_yaml(key: str, title: str, slug: str, layout: Layout, metadata: di
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# Dashboard CSS for the app's frame (PD-12): the app grows the frame to the page's scroll height,
|
||||||
|
# and Superset's page stretches to the frame, so without this the frame could only ever grow (a
|
||||||
|
# taller tab, once opened, left empty space under every other tab: measured 1438 → 2174 → 3158,
|
||||||
|
# never back). With the roots at their content's height the frame shrinks again.
|
||||||
|
EMBEDDED_CSS = ("html, body, #app, #app > div, #app > div > div, .dashboard, .dashboard-content "
|
||||||
|
"{ height: auto !important; min-height: 0 !important; } "
|
||||||
|
# Chart boxes as the app's cards (PD-26); dashboard CSS cannot read the brand's tokens,
|
||||||
|
# so these are --radius-md and the light --shadow-card written out.
|
||||||
|
".dashboard-component-chart-holder, .dashboard-markdown { border-radius: 16px !important; box-shadow: "
|
||||||
|
"0 2px 4px rgb(11 29 51 / 0.04), 0 12px 28px -8px rgb(11 29 51 / 0.12) !important; } "
|
||||||
|
# A notes block's wrapper clips what is inside it, so the wrapper carries the shadow.
|
||||||
|
".dashboard-markdown .dashboard-component-chart-holder { box-shadow: none !important; } ")
|
||||||
|
|
||||||
|
|
||||||
def base_metadata(layout: Layout, filters: list[dict[str, Any]], cross_filters: bool) -> dict[str, Any]:
|
def base_metadata(layout: Layout, filters: list[dict[str, Any]], cross_filters: bool) -> dict[str, Any]:
|
||||||
return {
|
return {
|
||||||
"color_scheme": "supersetColors",
|
"color_scheme": "supersetColors",
|
||||||
@@ -959,8 +987,8 @@ def base_metadata(layout: Layout, filters: list[dict[str, Any]], cross_filters:
|
|||||||
"map_label_colors": {},
|
"map_label_colors": {},
|
||||||
"color_scheme_domain": [],
|
"color_scheme_domain": [],
|
||||||
"cross_filters_enabled": cross_filters,
|
"cross_filters_enabled": cross_filters,
|
||||||
# Filters in Superset's left column (owner, 29 Oct); the Petrolyst app hides the column
|
# Filters in Superset's left column (owner, 29 Oct) for admins; the Petrolyst app hides
|
||||||
# when it embeds a dashboard and sets the filters itself.
|
# the column when it embeds a dashboard and sets the filters itself (PD-25).
|
||||||
"filter_bar_orientation": "VERTICAL",
|
"filter_bar_orientation": "VERTICAL",
|
||||||
"native_filter_configuration": filters,
|
"native_filter_configuration": filters,
|
||||||
"chart_configuration": {},
|
"chart_configuration": {},
|
||||||
@@ -1010,16 +1038,26 @@ def build(database_uuid: str, columns_path: Path) -> dict[str, Any]:
|
|||||||
page.markdown["notes-overview"] = OVERVIEW_NOTES
|
page.markdown["notes-overview"] = OVERVIEW_NOTES
|
||||||
if key == OVERVIEW_SLUG:
|
if key == OVERVIEW_SLUG:
|
||||||
page.rows(OVERVIEW_ROWS, "GRID_ID", "overview")
|
page.rows(OVERVIEW_ROWS, "GRID_ID", "overview")
|
||||||
filters = [period_filter(page.ids, OVERVIEW_PERIOD_SCOPE,
|
filters = overview_filters(page.ids)
|
||||||
"Narrows the deliveries, the costs and the monthly bars.")]
|
css = EMBEDDED_CSS
|
||||||
else:
|
else:
|
||||||
page.tabs(DETAIL_TABS, "GRID_ID", "TABS-detail")
|
page.tabs(DETAIL_TABS, "GRID_ID", "TABS-detail")
|
||||||
filters = detail_filters(page.ids)
|
filters = detail_filters(page.ids)
|
||||||
|
# Superset paints its tab container white, which swallows the charts' own boxes; the
|
||||||
|
# Overview has no tabs and shows each chart as a box on the page (PD-24). Every layer
|
||||||
|
# of the tabs is named, with !important, because Superset 6.1 paints the holder white
|
||||||
|
# with a two-class rule, and Firefox and Safari also paint the outer container white
|
||||||
|
# where Chrome does not (measured in all three).
|
||||||
|
css = EMBEDDED_CSS + (
|
||||||
|
".dashboard-component-tabs, .dashboard-component-tabs-content, "
|
||||||
|
".dashboard-component-tabs .ant-tabs, .dashboard-component-tabs .ant-tabs-content-holder, "
|
||||||
|
".dashboard-component-tabs .ant-tabs-content, .dashboard-component-tabs .ant-tabs-tabpane "
|
||||||
|
"{ background: transparent !important; }")
|
||||||
placed = {k: all_charts[k] for k in page.ids}
|
placed = {k: all_charts[k] for k in page.ids}
|
||||||
page_metadata = base_metadata(page, filters, cross_filters=False)
|
page_metadata = base_metadata(page, filters, cross_filters=False)
|
||||||
page_metadata["label_colors"].update(STOCK_STATUS_COLOURS)
|
page_metadata["label_colors"].update(STOCK_STATUS_COLOURS)
|
||||||
files[f"dashboards/{key}.yaml"] = dashboard_yaml(key, title, key, page,
|
files[f"dashboards/{key}.yaml"] = dashboard_yaml(key, title, key, page,
|
||||||
page_metadata)
|
page_metadata, css=css)
|
||||||
dashboards.append((page, placed, page_metadata))
|
dashboards.append((page, placed, page_metadata))
|
||||||
|
|
||||||
for chart in all_charts.values():
|
for chart in all_charts.values():
|
||||||
|
|||||||
@@ -189,8 +189,8 @@ THEME_DEFAULT["token"].update(
|
|||||||
"colorError": "#B3261E",
|
"colorError": "#B3261E",
|
||||||
"colorInfo": "#2563EB",
|
"colorInfo": "#2563EB",
|
||||||
"colorTextBase": "#0B1D33",
|
"colorTextBase": "#0B1D33",
|
||||||
"colorBgLayout": "#F8FAFC",
|
"colorBgLayout": "#F7F9FA",
|
||||||
"colorBorder": "#E2E8F0",
|
"colorBorder": "#DDE5E9",
|
||||||
"borderRadius": 8,
|
"borderRadius": 8,
|
||||||
"fontFamily": "Inter, system-ui, sans-serif",
|
"fontFamily": "Inter, system-ui, sans-serif",
|
||||||
}
|
}
|
||||||
@@ -200,7 +200,7 @@ THEME_DARK = deepcopy(THEME_DEFAULT)
|
|||||||
THEME_DARK["algorithm"] = "dark"
|
THEME_DARK["algorithm"] = "dark"
|
||||||
THEME_DARK["token"].update(
|
THEME_DARK["token"].update(
|
||||||
{
|
{
|
||||||
"brandLogoUrl": f"{BRANDING}/petrolyst_wordmark_white.svg",
|
"brandLogoUrl": f"{BRANDING}/petrolyst_wordmark_white_y.svg",
|
||||||
"colorPrimary": "#35C5B6",
|
"colorPrimary": "#35C5B6",
|
||||||
"colorLink": "#35C5B6",
|
"colorLink": "#35C5B6",
|
||||||
"colorSuccess": "#35C5B6",
|
"colorSuccess": "#35C5B6",
|
||||||
@@ -208,10 +208,10 @@ THEME_DARK["token"].update(
|
|||||||
"colorError": "#FF6B6B",
|
"colorError": "#FF6B6B",
|
||||||
"colorInfo": "#60A5FA",
|
"colorInfo": "#60A5FA",
|
||||||
"colorTextBase": "#F8FAFC",
|
"colorTextBase": "#F8FAFC",
|
||||||
"colorBgBase": "#071425",
|
"colorBgBase": "#1F2A33",
|
||||||
"colorBgLayout": "#071425",
|
"colorBgLayout": "#1F2A33",
|
||||||
"colorBgContainer": "#12263D",
|
"colorBgContainer": "#2A3945",
|
||||||
"colorBorder": "#526D82",
|
"colorBorder": "#76828E",
|
||||||
"colorEditorSelection": superset_defaults.THEME_DARK["token"][
|
"colorEditorSelection": superset_defaults.THEME_DARK["token"][
|
||||||
"colorEditorSelection"
|
"colorEditorSelection"
|
||||||
],
|
],
|
||||||
@@ -219,7 +219,7 @@ THEME_DARK["token"].update(
|
|||||||
)
|
)
|
||||||
|
|
||||||
# Chart colours. Validated with the dataviz skill's validator on both chart
|
# Chart colours. Validated with the dataviz skill's validator on both chart
|
||||||
# surfaces (#FFFFFF light, #12263D dark): all slots in both lightness bands and
|
# surfaces (#FFFFFF light, #2A3945 dark, PD-26): all slots in both lightness bands and
|
||||||
# >= 3:1; worst adjacent CVD dE 13.7, normal-vision dE 26.2; the first three
|
# >= 3:1; worst adjacent CVD dE 13.7, normal-vision dE 26.2; the first three
|
||||||
# slots also pass all-pairs (scatter, maps). Brand teal leads; brand cyan
|
# slots also pass all-pairs (scatter, maps). Brand teal leads; brand cyan
|
||||||
# #00B6E6 is snapped to #0097C4 because it is too light for the dark surface
|
# #00B6E6 is snapped to #0097C4 because it is too light for the dark surface
|
||||||
|
|||||||
Reference in new issue
Block a user