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

Readme is not clear #64

Open
ismailonur opened this issue Feb 23, 2023 · 5 comments
Open

Readme is not clear #64

ismailonur opened this issue Feb 23, 2023 · 5 comments
Labels

Comments

@ismailonur
Copy link

1-) Where does usePriceHistory come from?
2-) Is priceHistory an array or an object? What value should it contain?
Thank you

@Wilmela
Copy link

Wilmela commented Feb 28, 2023

Same here.

@shawnob2123
Copy link

Agreed. Show imports and possibly a better use case

@hiphilli
Copy link

Unsure how to use priceHistory too. Very unclear in the docs.

@Montchy Montchy mentioned this issue Aug 14, 2023
@Montchy Montchy added the docs label Aug 14, 2023
@papidb
Copy link

papidb commented Sep 28, 2023

Hey @Montchy can I pick this up?

@IAmCoder
Copy link

I found some examples here: https://github.com/margelo/react-native-graph/blob/main/example/src/data/GraphData.ts

function weightedRandom(mean: number, variance: number): number {
  var distribution = gaussian(mean, variance)
  // Take a random sample using inverse transform sampling method.
  return distribution.ppf(Math.random())
}

export function generateRandomGraphData(length: number): GraphPoint[] {
  return Array<number>(length)
    .fill(0)
    .map((_, index) => ({
      date: new Date(
        new Date(2000, 0, 1).getTime() + 1000 * 60 * 60 * 24 * index
      ),
      value: weightedRandom(10, Math.pow(index + 1, 2)),
    }))
}

export function generateSinusGraphData(length: number): GraphPoint[] {
  return Array<number>(length)
    .fill(0)
    .map((_, index) => ({
      date: new Date(index),
      value: Math.sin(index),
    }))
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants