Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

planned solar projects #45

Merged
merged 15 commits into from
May 22, 2024
Merged

planned solar projects #45

merged 15 commits into from
May 22, 2024

Conversation

derekeder
Copy link
Member

@derekeder derekeder commented May 8, 2024

Tasks to implement:

  • identify source files for planned projects from EIA, ABP and ILSFA
  • add source files to project and extract to csv files
  • combine planned projects into one file
  • update aggregates to include planned projects for dg_small, dg_large, cs and utility
  • add planned numbers to geojson and csv files
  • update map to toggle between energized and planned
  • update tables to show energized and planned
  • update about page text to include planned project info and counts

Screenshot 2024-05-10 at 5 08 37 PM

Testing instructions

  • browse the map and confirm you can toggle between energized and planned projects (planned should show up in purple). hovering over a geography should show a table with energized and planned projects
  • confirm that the buttons selected are updated in the URL as you click them. copying a URL with options selected and pasting into a new tab/window should load the map with those options selected
  • confirm on the about page that there is a new section on planned solar projects
  • view the reference tables page and confirm they all include a set of columns for planned projects

@derekeder derekeder marked this pull request as draft May 8, 2024 22:15
@derekeder derekeder marked this pull request as ready for review May 10, 2024 22:07
Copy link

netlify bot commented May 15, 2024

Deploy Preview for il-solar-map ready!

Name Link
🔨 Latest commit b33e061
🔍 Latest deploy log https://app.netlify.com/sites/il-solar-map/deploys/664e6c9a46e557000986a64d
😎 Deploy Preview https://deploy-preview-45--il-solar-map.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@vkoves
Copy link
Collaborator

vkoves commented May 17, 2024

@derekeder - not related to this, but I wanted to mention the active state of each toggle definitely looks like it would fail a contrast check. I also wonder if it's worth putting an explainer somewhere of what/how you get "planned" projects. Like what's the certainty those would happen and how far out might they be?

Screenshot from 2024-05-17 14-58-25

@derekeder
Copy link
Member Author

@vkoves good catch! i'll open a separate PR for the contrasting buttons and pick it up in another PR. would you believe its a bootstrap default!?

Agreed on the language too. I will ping the clean jobs folks and see what the say. That makes sense to address in this PR

Copy link
Collaborator

@vkoves vkoves left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have some starting comments, but I think I'll need a good bit more documentation to understand what your doing where, since I'm just jumping into this for the first time. From testing it seems fine though!

about.html Outdated Show resolved Hide resolved
data/scripts/aggregate_data.py Show resolved Hide resolved
cur_project["kw"] = clean_number(row["Project Size AC kW"])
cur_project["census_tract"] = row["Census Tract Code"]
if project_type == "planned":
cur_project["energization_date"] = row["Scheduled Energization Date"]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I try to avoid magic strings, so I'd consider making a constant for the available columns in your data, as otherwise someone could slip in a typo on one specific check

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you say more here? this script is combining 3 different CSVs and aligning the appropriate columns into a shared form

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What I mean is that hard coding energization_date and Scheduled Energ... is dangerous, since someone could be referencing those elsewhere, make a typo, and break something. Constants, like OrigCols.EnegDate prevent that, since the variable would bomb out if you have a typo.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, i understand. that's easier to do in javascript due to the way they interpret json data. it would take some code to turn each of these string values in the python dict to act as variables, so probably not worth it.

<br /><br />
<h5>Select status</h5>
<div id="status-select" class="btn-group flex-wrap" role="group" aria-label="Status">
<button value="energized" type="button" class="btn btn-light active">Energized</button>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an issue with your other buttons as well, but worth noting a toggle button like this should use aria-pressed to indicate to screen readers when it's active or not. Accessibility might just be a separate task though

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i will open this up as a separate issue to address

@@ -12,6 +12,8 @@ <h1>Reference Tables</h1>
<li><a href="#il-senate">IL State Senate Districts</a></li>
</ul>

<p>Note, all values are in kilowatts (kW). Columns with a <code>PL_</code> prefix are planned and not yet energized projects.</p>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor, but wanted to mention you can add thead { position: sticky; top: 0; } to this table to have the headers and filters stick, which makes it a lot easier to read and understand

Screenshot from 2024-05-17 15-05-26

The column titles are also a little technical, I don't know what CS means, and I think using titlecase and human words helps:

Screenshot from 2024-05-17 15-08-51

Lastly please add units! Otherwise it's unclear what each thing is referencing, and I thought it was the count of projects, not kW of capacity

Copy link
Member Author

@derekeder derekeder May 21, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

adding kW to each value is a bit more involved if we want the sorting to work, so i'll open a separate issue

js/map.js Outdated
</tr>
</thead>
<tbody>
<tr>
<td>Total</td>
<td><span class='float-end'>${props.total_kw.toLocaleString()}kW</span></td>
<td><span class='float-end'>${props.total_count.toLocaleString()}</span></td>
<td><span class='float-end'>${props.planned_total_kw.toLocaleString()}kW</span></td>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A space before kw would make these all a lot readable in my opinion, e.g. 49,038kW vs 49,038 kW.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good call

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So it looks like you only did this on the total, I meant it for the whole table 😆

I'll leave that for later though

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah woops - i'll get that fixed

</tr>
</tbody>
</table>
`
}

function updateLegend(layerSource, category){
let legendText = `<strong>${friendly_category_names[category]} kW of solar installed<br />by ${friendly_geography_names[layerSource]}</strong>`
function updateLegend(layerSource, category, status){
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh no, jQuery 😭

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'm using it for a few plugins I need:

  • jquery csv for converting a csv into a list of javascript objects
  • jquery address for updating and loading in query string parameters

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One day, we can switch it to React or Vue 😆

js/map.js Show resolved Hide resolved
@derekeder
Copy link
Member Author

@vkoves thx for the review. I addressed or commented (and opened PRs) for your comments. we can discuss tonight at hack night

@vkoves
Copy link
Collaborator

vkoves commented May 22, 2024

@derekeder - I also noticed that you changed the scale, which means that there's more faint colors overall, is this okay?

Before After
Screenshot from 2024-05-21 21-02-35 Screenshot from 2024-05-21 21-02-41

Copy link
Collaborator

@vkoves vkoves left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! I'm not sure how best to validate the data other than to compare the data to prod, and it looks the same but fainter (see my comment about shifting the scale). I'd say anything else (adding space before kw on each row of the table, the map color scale) can be done in another PR!

@derekeder
Copy link
Member Author

@vkoves thx! addressed the simple feedback. also made the buckets a little closer to what they were before. you're right - the map did look pretty light

@derekeder derekeder merged commit 9c5914f into main May 22, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

add solar projects in the queue
2 participants