Clean up numeric bucket computation
This commit is contained in:
parent
6b9b0760b1
commit
7fa11bdc4e
|
@ -14,9 +14,9 @@ const getNumericChartData = (contract: NumericContract) => {
|
|||
const { totalShares, bucketCount, min, max } = contract
|
||||
const step = (max - min) / bucketCount
|
||||
const bucketProbs = getDpmOutcomeProbabilities(totalShares)
|
||||
const xs = range(bucketCount).map((i) => min + step * (i + 0.5))
|
||||
const probs = range(bucketCount).map((i) => bucketProbs[`${i}`])
|
||||
return probs.map((prob, i) => [xs[i], prob] as const)
|
||||
return range(bucketCount).map(
|
||||
(i) => [min + step * (i + 0.5), bucketProbs[`${i}`]] as const
|
||||
)
|
||||
}
|
||||
|
||||
export const NumericContractChart = (props: {
|
||||
|
|
Loading…
Reference in New Issue
Block a user