Giter Club home page Giter Club logo

refactor-tractor's Issues

fix failing final test in hydration

idea: maybe fix by adding check so that if parameters are undefined, have a message saying no real data was passed through

Also not immediately clear why we even need this; maybe we could just eliminate that method? It seems to be related to calculateRandomWeekOunces and the display on DOM of some way-past week's water consumption. Just remove all this stuff?

resolve mismatches between sleep dashboard spec and actual display

  • remove all-user average sleep quality

  • remove data from random week in July of 2019 (second pink box on the right)

  • display user sleep quality over latest week (sleep hours is already there but need to add quality)

  • display this particular user's all-time average for sleep hours and quality (third bullet in spec)

refactor obviously WET code in class files

(just scrolling through Sleep.js, for example, we noticed a few places where there were nearly identical functions that differ only in whether they're dealing with sleep hours or sleep quality)

Refactor existing CSS into SASS

Refactor the existing CSS into Sass:

  • Break your Sass out into separate files

    • index.scss
    • variables.scss
    • additional partials (if needed)
  • Install normalize or reset file to help with cross-browser compatibility

  • Review for other opportunities for modularity/partials

investigate chart.js -- how to use it?

  • Draft charts
  • Insert data from server

https://www.chartjs.org/

David sez: "I think chart.js works well! It’s definitely the quickest option. If you really wanted a challenge, you could also consider D3."

Lucas from Mod 3 sez:

  • there are YouTube videos available
  • we can consult his GH repo if needed and/or ask him questions
  • best way forward is to get it implemented and then build one chart to play around with
  • can set up in two ways:
    • (more difficult option) as a dependency
    • (easier but not as clean option) import via a scripts tag in html; charts will need to live in our main js file and in onload functions
    • if the easy way goes smoothly enough, we can always implement the dependency way later to make things cleaner

fix bug in date-getting methods in `User-repo.js`

bug is that userRepo.getWeekFromDate (and probably also userRepo.getFirstWeek) gets the seven date entries leading up to the current one, which may or may not be the previous week.

For example, in the Hydration class file, something like userRepo.getWeekFromDate('2019/09/18', 4, this.hydrationData will return an array like

[
  { userID: 4, date: '2019/09/18', numOunces: 40 },
  { userID: 4, date: '2019/09/17', numOunces: 40 },
  { userID: 4, date: '2019/09/16', numOunces: 30 },
  { userID: 4, date: '2019/09/15', numOunces: 30 },
  { userID: 4, date: '2019/04/15', numOunces: 36 },
  { userID: 4, date: '2019/03/15', numOunces: 35 },
  { userID: 4, date: '2018/02/01', numOunces: 28 }
]

where the last three dates are from months ago, not earlier dates in the same week.

Note that I ran into this issue using the sample data in hydration-test.js, so the problematic array above will be different when the methods are run using the real data.

Those methods will also return an array with less than seven entries if there aren't seven days leading up to the relevant date.

fix `accomplishStepGoal` if condition

right now, it looks like it only checks that steps are equal to goal and will return false if steps exceed goal, but of course the goal is met even if the steps are greater than that goal

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.