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

Add Historical Graph to Building Details Over Any Tracked Column #107

Merged
merged 9 commits into from
Jul 17, 2024

Conversation

vkoves
Copy link
Owner

@vkoves vkoves commented Jun 15, 2024

Description

Adds a basic BarGraph component (powered by D3) and implements it on the building details page to show a switchable graph of a few of the historically tracked columns. Here's a demo with Marina Towers;

Total Emissions Electric Use
Screenshot from 2024-06-15 16-42-13 Screenshot from 2024-06-15 16-41-54

Fixes #4

Testing Instructions

Please describe the tests/QA that you did to verify your changes. Provide instructions so we can reproduce.
Please also list any relevant details for your test configuration

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Copy link

netlify bot commented Jun 15, 2024

Deploy Preview for radiant-cucurucho-d09bae ready!

Name Link
🔨 Latest commit dac8087
🔍 Latest deploy log https://app.netlify.com/sites/radiant-cucurucho-d09bae/deploys/667b79286d20660008880880
😎 Deploy Preview https://deploy-preview-107--radiant-cucurucho-d09bae.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.

src/components/BarGraph.vue Fixed Show fixed Hide fixed
src/components/BarGraph.vue Fixed Show fixed Hide fixed
src/components/BarGraph.vue Fixed Show fixed Hide fixed
src/components/BarGraph.vue Dismissed Show dismissed Hide dismissed
src/components/BarGraph.vue Fixed Show fixed Hide fixed
src/templates/BuildingDetails.vue Fixed Show fixed Hide fixed
src/templates/BuildingDetails.vue Fixed Show fixed Hide fixed
src/templates/BuildingDetails.vue Fixed Show fixed Hide fixed

this.currGraphData = this.historicData.map((datum: IHistoricData) => ({
x: datum.DataYear,
y: parseFloat((datum as any)[this.colToGraph] as string),

Check warning

Code scanning / ESLint

Disallow the `any` type Warning

Unexpected any. Specify a different type.
y: parseFloat((datum as any)[this.colToGraph] as string),
}));

this.currGraphTitle = (this.graphTitles as any)[this.colToGraph];

Check warning

Code scanning / ESLint

Disallow the `any` type Warning

Unexpected any. Specify a different type.
@vkoves vkoves changed the title Add historical graph Add Historical Graph to Building Details Over Any Tracked Column Jun 19, 2024
<div class="bar-graph-cont">
<div
class="label"
v-html="graphTitle"

Check warning

Code scanning / ESLint

disallow use of v-html to prevent XSS attack Warning

'v-html' directive can lead to XSS attack.
@alexkcode
Copy link
Collaborator

The pytest bug is a pandas issue related to this numpy issue: numpy/numpy#26710

@alexkcode
Copy link
Collaborator

According this comment on that issue thread, as long as we're using pandas == 2.2.2 and above we should be fine. But if we use any earlier version we must pin down a numpy version below 2.0.0.

alexkcode and others added 3 commits June 25, 2024 20:39
This is to prevent Netlify installing Python dependencies, when
we do not need those to build the app
@alexkcode
Copy link
Collaborator

Getting an intermittent issue of D3 not installing with docker compose up --build, looking into it currently.

@vkoves
Copy link
Owner Author

vkoves commented Jul 15, 2024

@alexkcode I had that happen due to caching or having an existing build, I had to do a fresh Docker build to make sure it installs dependencies.

@vkoves vkoves marked this pull request as ready for review July 17, 2024 00:39
@vkoves
Copy link
Owner Author

vkoves commented Jul 17, 2024

@alexkcode - do you want to give this a proper final review?

Copy link
Collaborator

@alexkcode alexkcode left a comment

Choose a reason for hiding this comment

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

Checked a couple different building sites, looks good!

@vkoves vkoves merged commit 221c6f6 into main Jul 17, 2024
7 checks passed
@vkoves vkoves deleted the add-historical-graph branch July 17, 2024 02:55
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 Graph For Emissions Over Time On Building Details (Requires Integrating Full Data Source)
2 participants