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

Question pages and charts #74

Merged
merged 31 commits into from
May 9, 2022
Merged

Question pages and charts #74

merged 31 commits into from
May 9, 2022

Conversation

berekuk
Copy link
Collaborator

@berekuk berekuk commented Apr 27, 2022

Since I had to merge #71 urgently, this is a new PR for finishing question pages and implementing history/charts.

I'll merge the code from #63 into this branch too.

Also, suggestions on a question page layout are very welcome!

  • What should the order of blocks be? For now, I put the "footer" before the description, since description can be quite long and I don't truncate it.
  • Should we expand qualityIndicators data somehow since we have more space on a separate page?
  • Where should the platform name link? To the platform's website? To the separate page on metaforecast?
  • Should we display probability in a larger font / highlight it somehow, since it's the key information? (I think since it's in color it should be good enough as it is)
  • Any other ideas?

@vercel
Copy link

vercel bot commented Apr 27, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
metaforecast ✅ Ready (Inspect) Visit Preview May 9, 2022 at 2:27PM (UTC)

@berekuk
Copy link
Collaborator Author

berekuk commented Apr 27, 2022

Checklist by @NunoSempere from #63 (easier to continue here than there but see #63 for relevant comments):

To do:

  • Use real rather than fake data. I'm hoping the graphql interface can be used for this, rather than having to interact with it directly
  • Reduce the chart size. Take https://manifold.markets/ or https://polymarket.com/ as reference points
    • As a sidenote, I think I'm accustomed to much bigger fonts than normal, so my personal preference shouldn't really be a guiding factor here.
  • Add functionality so that charts can be embedded
  • Only display the yes in the case of a binary question
  • Add the ability to combine many questions at once, maybe with shorthand labels in the url query
  • Add bells and whistles: Different options, allow one to consider different time periods, show quality indicators, add zoom ability, add other functionality in https://polymarket.com/ (they recently did a really nice chart refactoring)
  • Incorporate some feedback from twitter, and generally from @ClayGraubard or @uvafan
  • Embed into EA Forum/LessWrong

@berekuk
Copy link
Collaborator Author

berekuk commented Apr 27, 2022

@berekuk berekuk marked this pull request as draft April 27, 2022 19:56
@berekuk berekuk mentioned this pull request Apr 27, 2022
8 tasks
@NunoSempere
Copy link
Collaborator

@NunoSempere
Copy link
Collaborator

NunoSempere commented Apr 27, 2022

Some suggestions:

  • What should the order of blocks be? For now, I put the "footer" before the description, since description can be quite long and I don't truncate it.
    • I'm thinking of title, chart, description. And then I'm not sure
    • Right now the chart has its own title, but it's enough for there to be just one title.
    • Not sure about the quality indicators and the summary probability
  • Should we expand qualityIndicators data somehow since we have more space on a separate page? Yes, please. Not sure about location though, probably below the chart?
  • Where should the platform name link? To the platform's website? To the separate page on metaforecast? For now, to the platforms' website. But when the charts are a bit more polished, probably to the individual questions' page.
  • Should we display probability in a larger font / highlight it somehow, since it's the key information? (I think since it's in color it should be good enough as it is).
  • Any other ideas? I'm going to either do some mockups or get @ClayGraubard to do them.

@NunoSempere
Copy link
Collaborator

Maybe something like

metaforecast-charts

@berekuk
Copy link
Collaborator Author

berekuk commented Apr 27, 2022

I think we should also incorporate capture functionality on question pages. It doesn't make much sense to me to keep it separate.

@berekuk
Copy link
Collaborator Author

berekuk commented Apr 27, 2022

Note to self: figure out what to do with guesstimate questions. They are currently broken since they're not stored in the database. Maybe they should just be fetched and stored in questions like everything else?

@NunoSempere
Copy link
Collaborator

Maybe they should just be fetched and stored in questions like everything else?

This would be in principle fine, but there are too many of them. But we can get a hq preview to display? Or else we can embed them as an iframe?

Add line, reorganize display

Also fix nasty bug where probabilities are inverted in frontpage
Various indicators code should probably be moved to its own file.
@berekuk
Copy link
Collaborator Author

berekuk commented Apr 29, 2022

Turns out history entries weren't sorted and charts didn't display the full history because of this, should be better now.

@berekuk
Copy link
Collaborator Author

berekuk commented May 9, 2022

Ok, now I think it's ready.

Changes since my previous comments:

  1. Handle guesstimate:
  • I don't fetch all guesstimate models in platform code (yet), but question(id: "guesstimate-...") graphql endpoint fetches the guesstimate model just-in-time and upserts it into metaforecast database
    • history relation didn't work correctly otherwise
    • I don't really like that graphql queries modify the database state, but it shouldn't cause any problems, and I still think that we should just pull all guesstimate models into our DB anyway, eventually
  1. Layout & other improvements:
  • I added the platform name and stars count at the top of the page, so that it's more clear that the data was pulled from somewhere else; this duplicates the same data in indicators, but it's not a big deal
  • Everything is aligned to the left (I could unpack my reasoning here if this seems worse than before)
  • I rewrote chart legend in HTML, so the code for measuring element widths is not necessary anymore
  • Legend items are hoverable, show the full name in tooltip (example here) and highlight the line in chart for a given item
  • Use tailwind colors in charts
  1. Chart renders on client-side only
  • the reason for that is timezones; they make it impossible to render the chart on the server side correctly
  • while there are possible workarounds, e.g. we could round the timestamps to dates calculated for EST or GMT, it could be confusing (some people would see the predictions from the future)
  • also, Victory's js bundle is kinda large, and it's better to lazy-load it

@berekuk berekuk marked this pull request as ready for review May 9, 2022 14:30
@berekuk berekuk changed the title WIP: question pages and charts Question pages and charts May 9, 2022
@berekuk berekuk merged commit 44fbd0c into master May 9, 2022
@OAGr
Copy link

OAGr commented May 10, 2022

This is really neat, happy to see this in!

@berekuk berekuk deleted the questions-page-2 branch May 12, 2022 22:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants