fpl-stats's People
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,
- 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?
-
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
-
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.
- 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.
webpack always needs to be rebuilt
my run watch does not update on changes and I have to close and rebuild every time.
can anything be done to fix this?
@rapala61
@gittheking
@jasonseminara
@mgershowitz
@trevorpreston esquire
First Draft of Project 4
Be ruthless. If this idea sucks, let's kill it now.
Is this of appropriate size/scope for a final project?
Is the intent clear? If not, what requires further explanation?
Do you foresee any problems/difficulties that I have not mentioned?
Thanks
@gittheking
@jasonseminara
@trevorpreston
@rapala61
@irwintsay
loop on a fetch route? also multiple get routes
want to fire different middlewares on the same get route - is that a thing?
also, this would return a array of 600 ish objects and pull out values from each.
was told this might involve a promise.all thingy?
front-end fetch not hitting backend function
pretty sure it is failing due to the relative path e.g. fetch(/api/graph/:id
) and or ${id} however i;ve tried all permutations of url formats and it never hits that function on the backend.
not sure what else to try - and this is exacerbated by the need to rebuild the webpack every time so takes a while to trouble shoot.
Help!
the world is ending!
@jasonseminara
@gittheking
@trevorpreston
@mgershowitz
@rapala61
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.