simple word cloud

This commit is contained in:
Joffrey JAFFEUX 2025-01-03 17:11:20 +01:00
parent 5b916dcf1c
commit e9e6d80eac
3 changed files with 13 additions and 11 deletions

View File

@ -27,7 +27,7 @@ module DiscourseRewind
ndoc DESC,
word
LIMIT
100
5
), lex AS (
SELECT
DISTINCT ON (lexeme) to_tsvector('english', word) as lexeme,

View File

@ -2,8 +2,16 @@ import Component from "@glimmer/component";
export default class WordCloud extends Component {
<template>
<div class="rewind-report-page">
Word cloud
<div class="rewind-report-page -word-cloud">
<h3 class="rewind-report-title">Most used words</h3>
<div class="rewind-report-container">
{{#each-in @report.data as |word count|}}
<div class="rewind-card">
<span>{{word}}</span>
<span>{{count}} times</span>
</div>
{{/each-in}}
</div>
</div>
</template>
}

View File

@ -113,16 +113,10 @@ export default class Rewind extends Component {
<div class={{concatClass "rewind-report" report.identifier}}>
{{#if (eq report.identifier "reactions")}}
<Reactions @report={{report}} />
<Reactions @report={{report}} />
<Reactions @report={{report}} />
<Reactions @report={{report}} />
{{else if (eq report.identifier "word-cloud")}}
<WordCloud @report={{report}} />
{{else if (eq report.identifier "activity-calendar")}}
<ActivityCalendar @report={{report}} />
<ActivityCalendar @report={{report}} />
<ActivityCalendar @report={{report}} />
<ActivityCalendar @report={{report}} />
{{/if}}
{{!-- {{else if (eq report.identifier "fbff")}}
<FBFF @report={{report}} />