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

URL based API for visualizations #485

Open
dsernst opened this issue Jan 22, 2024 · 2 comments
Open

URL based API for visualizations #485

dsernst opened this issue Jan 22, 2024 · 2 comments

Comments

@dsernst
Copy link

dsernst commented Jan 22, 2024

Hi @artoonie, really great stuff.

Are you open to this additional new proposed interface to create a RCV visualization?

Currently:

  1. Create account
  2. Email for API key
  3. POST election data to create new visualization
  4. Share URL to new visualization [on load the front end downloads the stored data from the DB]

Proposed:

  1. Stick all the election data into URL parameters and just directly link to that. [on load the front end grabs the election data from the URL params]

That's it.

Pros:

  1. Much quicker for others to start using. Eliminates current steps 1 and 2, and merges 3 and 4.
  2. Potentially less DB/infra costs for you, because the data no longer needs to be stored / retrieved from DB.

Similar Examples:

@artoonie
Copy link
Owner

Interesting idea --

It would take a lot more work than it seems on the surface because a ton of preprocessing is done on the server. We have several layers of caching, some of it in this repo, some of it not, with the goal of getting good marks on page rendering benchmarks.

To make this work, we'd have to:

  1. Port all backend python to Javascript
  2. Optimize the javascript to still have fast page loads
  3. Figure out the consequences of extremely large GET payloads

My initial hunch is that it's not worth the effort, as the common use case isn't like a QR code or notepad (where only one person accesses in general), but rather, something that's frequently shared via URLs. I could be convinced to accept a pull request.

If there's a way I can help speed up your integration with our current API, I'm happy to do that. The demo code should make it somewhat quick to create your first vis.

@dsernst
Copy link
Author

dsernst commented Jan 29, 2024

I see. Thanks for the thoughtful reply

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

No branches or pull requests

2 participants