GithubHelp home page GithubHelp logo

Working in celcius about nestgraph HOT 2 OPEN

chriseng avatar chriseng commented on August 22, 2024
Working in celcius

from nestgraph.

Comments (2)

chriseng avatar chriseng commented on August 22, 2024

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.

from nestgraph.

gorstj avatar gorstj commented on August 22, 2024

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)");

from nestgraph.

Related Issues (6)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.