Closed danrademacher closed 2 years ago
[x] "Variant" described above is still TO DO
[x] Also, we need some sort of page break when top blue alert is hidden (because no performance chart):
The second chart on this one for COLMAN BUILDING is overflowing, as if the values are adding up to more than 100%: https://greeninfo-network.github.io/seattle-building-dashboard/#seattle/2020?layer=energy_star_score&sort=energy_star_score&order=desc&lat=47.60475&lng=-122.33566&zoom=15&building=678&report_active=true
Looks like they are running the correct values through a function fixPercents()
which actually makes each measure 1% larger, for a total of 102%. Maybe some of them it actually fixes?
The function itself is inscrutable, without comments:
fixPercents: function(fuels, prop) {
const values = fuels.map((d, i) => {
const decimal = +((d[prop].pct_raw % 1));
const val = Math.floor(d[prop].pct_raw);
return {
idx: i,
val,
iszero: val === 0,
decimal: val === 0 ? 1 : decimal
};
}).sort((a, b) => {
return b.decimal - a.decimal;
});
const sum = d3.sum(values, d => d.val);
let diff = 100 - sum;
values.forEach(d => {
if (diff === 0) return;
diff -= 1;
d.val += 1;
d.iszero = false;
});
I'm only seeing this issue on the one building so far. WASH MUTUAL TOWER (1201 THIRD AVE) is another with all three fuel types, but there is no overflow. https://greeninfo-network.github.io/seattle-building-dashboard/#seattle/2019?layer=energy_star_score&sort=energy_star_score&order=desc&lat=47.60845&lng=-122.33613&zoom=15&building=399&report_active=true
COURTYARD BY MARRIOTT - SEATTLE 100% Electric:
Current threshold is 99% per Terry's comment in #4:
You can use electricity_pct > 0.99 or something
New design:![image](https://user-images.githubusercontent.com/1423200/144132930-619f6b00-3a58-40e0-9312-7ee82c111073.png)
Currently looks like this:![image](https://user-images.githubusercontent.com/1423200/144133030-c5d4cd0d-795f-4494-a137-f2efac15bdc1.png)
The full-width bar charts are the same as the lower left ones in current build, except (a) they are wider and (b) the order of categories should always be electric, steam, gas.
Note that there is variant text that shows when a building is already 100% electric. For the three bullet points at the bottom and the link on right. Icons stay the same
┆Issue is synchronized with this Asana task