16 | Copyright {year} Own Me Inc.
17 |
18 | );
19 | });
20 |
21 | export default Footer;
--------------------------------------------------------------------------------
/components/HashtagWordCloud.tsx:
--------------------------------------------------------------------------------
1 | import React, { useCallback, useMemo } from "react";
2 | import styled from "styled-components";
3 | import { Text } from "@visx/text";
4 | import { scaleLog } from "@visx/scale";
5 | import { Wordcloud } from "@visx/wordcloud";
6 |
7 | const SvgContainer = styled.div`
8 | display: flex;
9 | justify-content: center;
10 | align-items: center;
11 | `;
12 |
13 | const WordText = styled(Text)`
14 | cursor: pointer;
15 | &:hover {
16 | fill: yellow;
17 | }
18 | `;
19 |
20 | const colors = ["#6c27a5", "#c252d1", "#c73c9d"];
21 |
22 | interface HashtagWordCloudProps {
23 | width: number;
24 | height: number;
25 | hashtags: string[];
26 | }
27 |
28 | export interface WordData {
29 | text: string;
30 | value: number;
31 | }
32 |
33 | const HashtagWordCloud = ({ width, height, hashtags }: HashtagWordCloudProps) => {
34 |
35 | const wordFreq = useCallback((text: string): WordData[] => {
36 | const words: string[] = text.replace(/\./g, "").split(/\s/);
37 | const freqMap: Record