Closed NunoSempere closed 2 years ago
The manifold market guys shared their binary forecast charts code:
return (
<div
className="w-full overflow-hidden"
style={{ height: height ?? (!width || width >= 800 ? 400 : 250) }}
>
<ResponsiveLine
data={data}
yScale={{ min: 0, max: 100, type: 'linear' }}
yFormat={formatPercent}
gridYValues={yTickValues}
axisLeft={{
tickValues: yTickValues,
format: formatPercent,
}}
xScale={{
type: 'time',
min: startDate,
max: latestTime.toDate(),
}}
xFormat={(d) => formatTime(+d.valueOf(), lessThanAWeek)}
axisBottom={{
tickValues: numXTickValues,
format: (time) => formatTime(+time, lessThanAWeek),
}}
colors={{ datum: 'color' }}
pointSize={bets.length > 100 ? 0 : 10}
pointBorderWidth={1}
pointBorderColor="#fff"
enableSlices="x"
enableGridX={!!width && width >= 800}
enableArea
margin={{ top: 20, right: 28, bottom: 22, left: 40 }}
/>
</div>
)
They also pointed to https://nivo.rocks/ as their library for charts.
Maybe @Hazelfire would be interested in this?
Looks interesting! I currently have priorities with Squiggle so I don't think I'd be coming to this soon
Done with #74
Right now, we are saving forecasts' history, but we are not doing much with it. It would be nice to display forecast evolution. But then we'd have to figure out how to display it (e.g., in forecast-specific pages? in the normal view?), which might be a bit tricky. If we have forecast-specific pages, we might also want to do some other stuff with it...