Skip to content

Commit 60b9733

Browse files
committed
rename to react-jq-cloud
1 parent ac1a3c1 commit 60b9733

10 files changed

Lines changed: 36 additions & 32 deletions

File tree

.npmrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
registry=https://registry.npmjs.org/
2+
access=public

README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# react-word-cloud
1+
# react-jqcloud
22

33
A React + TypeScript word cloud component based on the layout algorithm from [jQCloud](https://github.com/lucaong/jQCloud).
44

@@ -31,7 +31,7 @@ Words are placed on a spiral (elliptic or rectangular) starting from the center
3131
## Installation
3232

3333
```bash
34-
npm install react-word-cloud
34+
npm install react-jqcloud
3535
```
3636

3737
Peer dependencies (`react` and `react-dom` ≥ 17) must already be installed in your project.
@@ -41,8 +41,8 @@ Peer dependencies (`react` and `react-dom` ≥ 17) must already be installed in
4141
## Quick start
4242

4343
```tsx
44-
import { WordCloud } from 'react-word-cloud';
45-
import 'react-word-cloud/styles.css';
44+
import { WordCloud } from 'react-jqcloud';
45+
import 'react-jqcloud/styles.css';
4646

4747
const words = [
4848
{ text: 'React', weight: 10 },
@@ -102,15 +102,15 @@ interface Word {
102102

103103
### CSS weight classes
104104

105-
When you import `react-word-cloud/styles.css` each word receives a class `w1``w10` (1 = lightest, 10 = heaviest). You can override these classes in your own stylesheet:
105+
When you import `react-jqcloud/styles.css` each word receives a class `w1``w10` (1 = lightest, 10 = heaviest). You can override these classes in your own stylesheet:
106106

107107
```css
108108
/* your-styles.css */
109-
.react-word-cloud .w10 { color: #e63946; }
110-
.react-word-cloud .w9 { color: #e63946; }
111-
.react-word-cloud .w8 { color: #457b9d; }
109+
.react-jqcloud .w10 { color: #e63946; }
110+
.react-jqcloud .w9 { color: #e63946; }
111+
.react-jqcloud .w8 { color: #457b9d; }
112112
/**/
113-
.react-word-cloud .w1 { color: #a8dadc; }
113+
.react-jqcloud .w1 { color: #a8dadc; }
114114
```
115115

116116
### Inline colors
@@ -277,8 +277,8 @@ Contributions are welcome — bug reports, feature requests, and pull requests a
277277
### Development setup
278278

279279
```bash
280-
git clone https://github.com/your-org/react-word-cloud.git
281-
cd react-word-cloud
280+
git clone https://github.com/your-org/react-jqcloud.git
281+
cd react-jqcloud
282282
npm install
283283
```
284284

example/App.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,7 @@ export default function App() {
479479

480480
return (
481481
<div style={{ fontFamily: 'sans-serif', padding: 24, maxWidth: 800 }}>
482-
<h1 style={{ margin: '0 0 4px' }}>React Word Cloud</h1>
482+
<h1 style={{ margin: '0 0 4px' }}>React JQCloud</h1>
483483
<p style={{ margin: '0 0 20px', color: '#666', fontSize: 14 }}>Demos</p>
484484

485485
{/* Demo selector */}

example/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<head>
44
<meta charset="UTF-8" />
55
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
6-
<title>React Word Cloud — Example</title>
6+
<title>React JQCloud — Example</title>
77
</head>
88
<body>
99
<div id="root"></div>

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "react-word-cloud",
2+
"name": "react-jqcloud",
33
"version": "0.1.0",
44
"description": "React word cloud component based on jQCloud layout algorithm",
55
"keywords": ["react", "word-cloud", "tag-cloud", "visualization"],

src/WordCloud.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ export function WordCloud({
156156

157157
return (
158158
<div
159-
className={`react-word-cloud${className ? ` ${className}` : ''}`}
159+
className={`react-jqcloud${className ? ` ${className}` : ''}`}
160160
style={containerStyle}
161161
>
162162
{words.map((word, i) => {

src/styles.css

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
1-
.react-word-cloud {
1+
.react-jqcloud {
22
overflow: hidden;
33
position: relative;
44
font-family: "Helvetica", "Arial", sans-serif;
55
}
66

7-
.react-word-cloud span {
7+
.react-jqcloud span {
88
position: absolute;
99
padding: 0;
1010
cursor: default;
1111
}
1212

13-
.react-word-cloud a {
13+
.react-jqcloud a {
1414
text-decoration: none;
1515
color: inherit;
1616
}
1717

1818
/* Weight classes for color theming (font sizes are inline) */
19-
.react-word-cloud .w10 { color: #0cf; }
20-
.react-word-cloud .w9 { color: #0cf; }
21-
.react-word-cloud .w8 { color: #0cf; }
22-
.react-word-cloud .w7 { color: #39d; }
23-
.react-word-cloud .w6 { color: #90c5f0; }
24-
.react-word-cloud .w5 { color: #90a0dd; }
25-
.react-word-cloud .w4 { color: #90c5f0; }
26-
.react-word-cloud .w3 { color: #a0ddff; }
27-
.react-word-cloud .w2 { color: #99ccee; }
28-
.react-word-cloud .w1 { color: #aab5f0; }
19+
.react-jqcloud .w10 { color: #0cf; }
20+
.react-jqcloud .w9 { color: #0cf; }
21+
.react-jqcloud .w8 { color: #0cf; }
22+
.react-jqcloud .w7 { color: #39d; }
23+
.react-jqcloud .w6 { color: #90c5f0; }
24+
.react-jqcloud .w5 { color: #90a0dd; }
25+
.react-jqcloud .w4 { color: #90c5f0; }
26+
.react-jqcloud .w3 { color: #a0ddff; }
27+
.react-jqcloud .w2 { color: #99ccee; }
28+
.react-jqcloud .w1 { color: #aab5f0; }

test/WordCloud.test.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import React from 'react';
12
import { describe, it, expect, vi } from 'vitest';
23
import { render, screen, fireEvent } from '@testing-library/react';
34
import { WordCloud } from '../src/WordCloud';
@@ -31,7 +32,7 @@ describe('WordCloud', () => {
3132
<WordCloud words={words} width={600} height={400} className="my-cloud" />
3233
);
3334
const div = container.firstChild as HTMLElement;
34-
expect(div.classList.contains('react-word-cloud')).toBe(true);
35+
expect(div.classList.contains('react-jqcloud')).toBe(true);
3536
expect(div.classList.contains('my-cloud')).toBe(true);
3637
});
3738

test/setup.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
import '@testing-library/jest-dom';
1+
import '@testing-library/jest-dom/vitest';

tsconfig.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"module": "ESNext",
55
"moduleResolution": "bundler",
66
"jsx": "react-jsx",
7+
"allowUmdGlobalAccess": true,
78
"strict": true,
89
"noUncheckedIndexedAccess": true,
910
"declaration": true,
@@ -13,6 +14,6 @@
1314
"skipLibCheck": true,
1415
"forceConsistentCasingInFileNames": true
1516
},
16-
"include": ["src"],
17-
"exclude": ["node_modules", "dist", "test", "example"]
17+
"include": ["src", "test"],
18+
"exclude": ["node_modules", "dist", "example"]
1819
}

0 commit comments

Comments
 (0)