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

[NEW] Word cloud generation for poll responses #6

Merged
merged 13 commits into from
Sep 18, 2021

Conversation

RonLek
Copy link
Collaborator

@RonLek RonLek commented Jun 29, 2021

  • wordcloud property added to IPoll interface.
  • Used Quickchart API to generate word clouds.
  • Option to enable/disable wordcloud during poll creation.
  • Settings configuration to enable/disable use of public Internet for access to Quickchart.
  • If public Internet access not granted, insert response summary.
Screencast.from.28-06-21.08.20.04.PM.IST.mp4

Closes #3

@RonLek RonLek requested a review from ramkumarkb July 2, 2021 07:06
@RonLek
Copy link
Collaborator Author

RonLek commented Jul 2, 2021

@murtaza98 @ramkumarkb could you please take a look. Thanks.


if (poll.wordcloud && useInternet.value) {
const attachment = <IMessageAttachment>{
imageUrl: `https://quickchart.io/wordcloud?text=${poll.options.join(

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 points here

  1. If we're hard-coding this url here then how would the organisations who have hosted their own quickcharts server connect this app to it? For this reason, I'd earlier suggested to keep this api url as a app setting.

  2. Are we planning to support paid plans for quickcharts? On the pricing page of quickcharts, it says that it has some rate limitation for the free plan - if that's the case then this might be an issue with bigger communities and for such big communities we'd need to add support for their paid plans.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Murtaza.

  1. I realized (on contacting Ian from Quickchart) that they haven't integrated the word-cloud API in their open-source codebase so there wouldn't be much use hosting a Quickchart server. The only way to access the word-cloud API is through the public URL which some organizations might not have access to. Hence the boolean app setting determining whether the org has access or not.
  2. I'm unsure whether word-cloud hits would be included within the paid version since it hasn't been integrated. Moreover, the current rate-limitation is 1 chart/sec which I think should be pretty scalable.

Let me know your thoughts.

Copy link

@murtaza98 murtaza98 Jul 4, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. If that's the case, then I think we don't have any option here with QuickChart 😞 Did he happen to mention when they will be allowing this feature? Also during your research did you find any alternative chart generator which provides on-premise hosting? I'm asking this because if we're introducing this public internet access limitation in this app, then the communities using Rocket.Chat within on-premise would miss out on this feature.
  2. They say its a 60 requests per minute per IP rate limit so if all the users are accessing the room from a different network then the limit is fair enough, however if all the users are on a private network behind a (Router + NAT) then although each of them will have a different local IP, but the same public IP - In that case if there is a single room with more than 60 users, they all would be identified as a single entity/IP and the rate limit will come into picture. Please give some thought on this and check if we can add support for the paid plan. Thanks.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Unfortunately no. They seem to be in a fix whether to include it within the docker image or spin it out as a separate image. They don't seem to have time-boxed this change.
    I found a few on RapidAPI but they don't seem to have a locally hosted or open-source version and are all paid.

  2. Valid point. I've mailed inquiring whether word-cloud is included within the paid plan. Will update here. Thanks.

@RonLek
Copy link
Collaborator Author

RonLek commented Jul 10, 2021

Decided to shun Quickchart in favor of an in-house wordcloud-api I developed. This has theoretically no rate-limits, requires no Internet-access to generate wordclouds and can be self-hosted for on-premise users.

If no API endpoint is provided a poll summary would be generated. Worcloud API endpoint is kept empty by default to enable the wordcloud feature to work out-of-the-box. Users can then insert either the in-house wordcloud-api or any other API (eg Quickchart)

Other changes

  • Changed settings config to a string field to allow users to enter their endpoint. If no endpoint is entered poll summary is generated.
  • Relative scaling of word size within wordcloud based on the number of votes received.
Screencast.from.10-07-21.09.36.25.AM.IST.mp4

@murtaza98 please take a look

src/definition.ts Outdated Show resolved Hide resolved
PollApp.ts Outdated Show resolved Hide resolved
PollApp.ts Outdated Show resolved Hide resolved
@murtaza98
Copy link

image

I'm still getting following tslint errors in this PR

@RonLek
Copy link
Collaborator Author

RonLek commented Aug 17, 2021

@murtaza98 resolved all comments and fixed lint. Please take a look. Thanks.

@ramkumarkb ramkumarkb merged commit 7858281 into RocketChat:master Sep 18, 2021
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.

[FEATURE] Word Cloud Generation for Poll Responses
3 participants