Socket
Socket
Sign inDemoInstall

word-cloud-react

Package Overview
Dependencies
346
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    word-cloud-react

A library of to show Word Cloud in ReactJs ![alt tag](https://github.com/sazzadsazib/word-cloud-react/blob/master/Docs/word%20cloud%20react.png)


Version published
Weekly downloads
10
decreased by-9.09%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

Word Cloud React · GitHub license GitHub license

A library of to show Word Cloud in ReactJs alt tag

Getting Started

To install the package run command.
npm i word-cloud-react --save
or using yarn
yarn add word-cloud-react
import the packages to your react Component,
import { WordCloud } from "word-cloud-react";
Use the component as:

<WordCloud 
            width={"auto"} 
            maxFont={40} 
            minFont={10} 
            logFunc={(x)=> Math.log2(x) * 5} 
            data={[{"word":"gt feature recipe","value":275},{"word":"searchknorrproduct service feature","value":275},.......]} 
            clickEvent={(x)=>console.log(x.word)} 
            color={['#71803F', '#F8AC1D','#598EC0','#E2543E','#1A3051','#F46F73','#8A87BB','#56CFCD','#297373','#FF8552','#F2E863','#C2F8CB','#3A6EA5','#FF6700','#C0C0C0','#4E4381','#523CBD',]}/>

Props

There are different conditional Props available in this component, they are,

NameTypeSampleRequiredDescription
width"auto" or any integerwidth={"auto"} or width={600}trueThe width of the word cloud
maxFontintegermaxFont={40}false , default : 40Max Font size for font sizing algorithm for the max value
minFontintegerminFont={10}false , default : 10Min Font size for font sizing algorithm for the min value
logFuncfunctionlogFunc={(x)=> Math.log2(x) * 5}false , if logfunction not provided than maxFont, minFont algorithm will be usedIf this props provided maxFont and minFont will not work. this will use log function to size your word the function you provide as props.
clickEventfunction clickEvent={(x)=>console.log(x.word)} falseget the function for click event through this props.
colorarray of string hex color codecolor={['#71803F', '#F8AC1D','#598EC0','#E2543E']} truecolor hex for randomise your word. more color more random it will be. user has control over this color generations not over its randomness
dataarraydata={[{"word":"gt feature recipe","value":275},...]} truedata that you will provide for word cloud

Contribution

If you want to work in this project. fork it, use the files from

src/lib/WordCloud

component to work. and,

npm run build

to build.

and send a pull request.

Versioning

Current Version: 0.1.7

Authors

License

This project is licensed under the MIT License - see the LICENSE.md file for details

FAQs

Last updated on 12 Mar 2019

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc