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

Working in celcius #5

Open
gorstj opened this issue Apr 4, 2014 · 2 comments
Open

Working in celcius #5

gorstj opened this issue Apr 4, 2014 · 2 comments

Comments

@gorstj
Copy link

gorstj commented Apr 4, 2014

Trying to decode the index.html to find the setting for changing the y axis so it is a sensible range for degrees celcius - any ideas?

@chriseng
Copy link
Owner

chriseng commented Apr 4, 2014

I actually don't remember because I haven't looked at this code since I first commited it. ;-)

However, I believe the y-axis automatically adjusts to the range of data points. The hackish thing I did was map the "heat on/off" line to 60 and 61 degrees so it could appear on the same axis. So I bet if you change the line:

return { date: d.date, val: +d[name] + 60 }

to:

return { date: d.date, val: +d[name] + 15 }

Or some value that's within the range of your Celsius values, it might solve the problem. No guarantees; I can barely understand the D3 code any more at this point.

@gorstj
Copy link
Author

gorstj commented Apr 5, 2014

Thanks for your suggestion. Here is what I did to get it looking reasonable for us new UK Nest customers who like degrees celsius:

Change line 156. I have changed 60 to 0. When heating is on there is a line at 1 degrees, when off the line is at 0 degrees. Make sure that the temp range you list in the next section includes these values.

line 156:

      return { date: d.date, val: +d[name] + 0 };

Change lines 170-173. Change 0, 30 for the temp range you want, using the 'auto' settings I commented out it would miss out my target temperature graph which is lower than any of my away temperatures currently. I have commented out the lines that are now redundant, you can delete them:

lines 170-173:

  y.domain([0, 30]);
//      +d3.min(points, function(c) { return d3.min(c.values, function(v) { return v.val }); }),
//      +d3.max(points, function(c) { return d3.max(c.values, function(v) { return v.val }); }) + 0.5
//  ]);

line 191:

    .text("Temperature (C)");

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

No branches or pull requests

2 participants