shahinrostami / plotapi

Engaging visualisations, made easy.
https://plotapi.com
MIT License
267 stars 17 forks source link

offline mode? #35

Closed evan-wes closed 3 years ago

evan-wes commented 3 years ago

Hi,

I have been experimenting with the Chord Free version and so far I am enjoying the visualizations. However, I run into an issue with the "Too many requests made to chord free" message. If I am working on a project that utilizes a chord visualization, and am running it and testing it as I write the code for other parts of the project, this message shows up after a while. Now from your response to another user's issue, it seems this is a feature (not a bug) introduced to limit requests to your AWS service that generates the visualizations, and that this blocking mechanism should last for up to one hour. This makes it quite hard to work with the free version since if I want to make any changes to my code and run it, it uses up one of the "free requests" allotted me before the blocking happens. Is it feasible for you to provide an offline version so that I can generate the visualizations locally? Does the pro license allow this? I imagined that once I installed the package, it would work like any other python visualization library (like matplotlib or seaborn) and would run locally and offline (if needed), and that the pro version came with extra options (something I would consider if I found myself using these types of charts often, since I usually like to customize things if I can).

If there is no way to bypass this blocking feature, would you consider reducing the blocking time down from 1 hour? If it was meant to mitigate requests down from the level of hundreds per second, having a blocking period (or better yet, a waiting period instead of returning to the user the "too many requests" message) of say, one second, should easily smooth out the requests. Is AWS really unable to handle the traffic?

shahinrostami commented 3 years ago

Hi @evan-wes !

Happy to see you're enjoying the visualisations :)

Maintaining chord-pro and chord-free ended up being quite onerous as they were two different codebases. To address that I merged them into one, with chord-pro allowing the use of additional customisations and modes (e.g. those here https://datacrayon.com/posts/statistics/data-is-beautiful/chord-pro-features-for-chord-diagrams/), some of which rely on server-side extras.

As you saw in a previous issue somewhere (or on our discord), I discovered some users were using chord-pro to generate chord diagrams as part of their own service/software. This meant one license was being used by hundreds of users - but the real problem was that modest instance (single VPS) was unable to cope with all the requests. The chord-pro rate limit is 200 an hour, so it's unlikely you will ever hit it when using it for data visualisation.

Saying that - I just rebooted the chord service which resets the limits, so you should be able to try a few more when you get this reply.

If you're interested, chord-pro is a (relatively) small one-time cost. I'm sure if I dumped more money into AWS I could remove the rate limits entirely (especially for free users), but I'm not able to fund any philanthropy just yet!

There are some nice alternatives too, like https://plotly.com/python/v3/filled-chord-diagram/.

All the best