Giter Club home page Giter Club logo

fpl-stats's People

Contributors

indefinitelee avatar

Watchers

 avatar

fpl-stats's Issues

not sure if object is returning

getting unexpected end of input where I am mapping through the array returned from my fetch call.
thus, can't pass my data to my graph or table packages for rendering.

getting a backend error due to no props but fetch to get props is not runnig

First,

My App has componentDidMount which calls the function .getStats that runs the fetch on the backend (this is to work around CORS issue).
my fetch returns the needed object if i hit the route directly.
The fetch data should be passed into state and then sent as props to Table.

However, I am getting Table.jsx:10 Uncaught TypeError: Cannot read property 'props' of undefined(โ€ฆ)

It is hitting Table.jsx and before the componentDidMount (console.logs in App.jsx don't print)
I;ve tried changing various component/mount things and even removing componentMount entirely.
Not sure what else to try.

In addition, nothing is rendering on page - I had login/signup rendering all day yesterday and this morning. All that changed was I restarted computer ( a mistake which will not be repeated).

@rapala61
@gittheking
@irwintsay
@jasonseminara
@trevorpreston
pls holla back with an acknowledgement or ETA.
grazie tutti.

but howw???

Ok, fetch call to url returns a large object, iterate through with .map to retrieve each of the fields that I want.
services/stats-api.js

function getStats(req, res, next){
  fetch(`fantasy.premierleague.com/drf/bootstrap-static`)
    .then(r => r.json())
    .then((data) => {
      res.rows = data.elements.map((player) => {
        return {
          firstName: player.first_name,
          secondName: player.second_name,
  1. can I create a calculated field like this?
    onPace: parseInt(ppg)*38
  • maybe this isn't even necessary if i use something like this https://www.npmjs.com/package/react-json-table
    but since .map returns an array i'd have to either change the way I filter the object or turn it back into a json, right? or is .map giving me a new array of objects?
  1. ideally in addition to data retrieved from the fetch there would be a column that would allow users to enter their own total value. since the data would appear on the landing page I'm thinking that my fetch call can be directly in my App.jsx instead of services/stats-api.js

  2. What's the State?

  • the user entered column would have to be in State
  • as well as any recalculated fields
  • any field used in the 3ds graph needs to get it's content from the state - iirc.
  1. graphing data
  • the graph should display two lines which would be identical up to the current game week and then diverge based on the user entered final value.
  • figure out formula to make sure divergence only happens at current week, not since beginning of season.

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.