-
-
Notifications
You must be signed in to change notification settings - Fork 32
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
223 heatload graph #288
223 heatload graph #288
Conversation
heat-stack/app/components/ui/heat/CaseSummaryComponents/Graphs/HeatLoad.tsx
Outdated
Show resolved
Hide resolved
heat-stack/app/components/ui/heat/CaseSummaryComponents/Graphs/HeatLoad.tsx
Outdated
Show resolved
Hide resolved
heat-stack/app/components/ui/heat/CaseSummaryComponents/Graphs/HeatLoad.tsx
Outdated
Show resolved
Hide resolved
maxValue = Math.max(maxValue, maxLine, avgLine) | ||
} | ||
|
||
const minY = Math.max(0, Math.floor((minValue * 0.8) / 10000) * 10000) // 20% buffer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
might want to put some of these hardcoded files into a configuration file
heat-stack/app/components/ui/heat/CaseSummaryComponents/Graphs/HeatLoad.tsx
Outdated
Show resolved
Hide resolved
heat-stack/app/components/ui/heat/CaseSummaryComponents/Graphs/HeatLoad.tsx
Outdated
Show resolved
Hide resolved
heat-stack/app/components/ui/heat/CaseSummaryComponents/Graphs/HeatLoad.tsx
Outdated
Show resolved
Hide resolved
heat-stack/app/components/ui/heat/CaseSummaryComponents/Graphs/HeatLoad.tsx
Outdated
Show resolved
Hide resolved
<Label | ||
value="Heat Load (BTU/h)" | ||
position="left" | ||
angle={-90} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we move the label more to the center easily?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was not able to get to this
heat-stack/app/components/ui/heat/CaseSummaryComponents/utility/heat-load-calculations.ts
Outdated
Show resolved
Hide resolved
heat-stack/app/components/ui/heat/CaseSummaryComponents/utility/heat-load-calculations.ts
Outdated
Show resolved
Hide resolved
|
||
const X_AXIS_BUFFER_PERCENTAGE_MAX = 1.3; // 30% buffer | ||
const Y_AXIS_ROUNDING_UNIT = 10000; // Rounding unit for minY and maxY | ||
const Y_AXIS_MIN_VALUE = 0; // Always start the Y axis at 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added constants for these numbers
const Y_AXIS_ROUNDING_UNIT = 10000; // Rounding unit for minY and maxY | ||
const Y_AXIS_MIN_VALUE = 0; // Always start the Y axis at 0 | ||
|
||
const roundDownToNearestTen = (n: number) => Math.floor(n / 10) * 10; // Used for determining the start temperature on the X axis |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Made this a function for clarity
// seet min and max Y axis values | ||
const minY = Y_AXIS_MIN_VALUE | ||
const adjustedMaxYValue = maxValue * X_AXIS_BUFFER_PERCENTAGE_MAX; | ||
const maxY = Math.ceil(adjustedMaxYValue / Y_AXIS_ROUNDING_UNIT) * Y_AXIS_ROUNDING_UNIT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
min and max values here are now more readable
unit="°F" | ||
dataKey="temperature" | ||
name="Outdoor Temperature" | ||
domain={[minTemperature, maxTemperature]} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated to min/max instead of start/end
</ResponsiveContainer> | ||
<CustomLegend /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Created a custom legend after discovering it was only working by accident
import { buildHeatLoadGraphData } from '../utility/build-heat-load-graph-data' | ||
import { HeatLoadGraphToolTip } from './HeatLoadGraphToolTip' | ||
import { CustomLegend } from './HeatLoadGraphLegend' | ||
import { DESIGN_SET_POINT } from '../../../../../global_constants' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moved design set point to a constant
@@ -0,0 +1 @@ | |||
export const DESIGN_SET_POINT = 70 // Design set point (70°F), defined in external documentation - https://docs.google.com/document/d/16WlqY3ofq4xpalsfwRuYBWMbeUHfXRvbWU69xxVNCGM/edit?tab=t.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added link to google doc for reference
<div className="min-w-[625px] rounded-lg shadow-lg"> | ||
<span className="mb-4 text-lg font-semibold"> | ||
Heating System Demand | ||
<Icon name="question-mark-circled" className="ps-1" size="md" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did not implement tool tip yet, should probably be a follow up ticket
designSetPoint: number, | ||
): number { | ||
return Math.max(0, (designSetPoint - temperature) * whole_home_heat_loss_rate) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed rounding
Questions to answer:
lastResult
has anaverage_heat_load
that is higher than themaximum_heat_load
, which causes the average point and line to be above the maximum. Is there a better data set that I should be using, or am I misunderstanding the data? In general, am I using the correct data here? And are my calculations correct? They are based off of the document in the issue comments, but the console.log listed in the issue was logging thebalance_point_graph
records, which I am not using.Work Done
Using the JSON data in
lastResult
, I did the following:HeatLoadAnalysis
component (routes/_heat+/heatloadanalysis.tsx
)components/ui.../HeatLoadAnalysis.tsx
)HeatLoad
component for displayTesting
Notes
Graphs
component for now. We could create a context to share this data or at least avoid prop drilling here.Observations
routes.../heatloadanalysis.tsx
andcomponents.../HeatLoadAnalysis.tsx
are meant to compliment each other.Screenshots:
Desktop View:
Tool tip:
Mobile View: