Skip to content

project-spinoza/WordCrowd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

69 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Word Crowd

This is a WordCram-inspired WordCrowd layout written in JavaScript.
WordCrowd screenshot


![WordCrowd screenshot](images/Capture.JPG) ## USAGE:

Download zip or clone it using the following command.

`git clone https://github.com/project-spinoza/WordCrowd.git`

Navigate to the examples directory and run the index.html file in web browser.

## Running WordCrowd: `var settings = {`
`"container":"body",`
`"data":"Input text data for visualization"`
`};`
`var wordCrowd = new WordCrowd(settings);` ## Settings:

Global setting for wordcrowd container.

* container

Selector of the wordCrowd container element

default value `body`

`container : "#wordCrowdContainer"`

* data

input text which WordCrowd will generate graph.

default value `Input text data for visualization`

`data: "Input text data for visualization"`

Data can also be given in the form of json.

`data: "[{word:'first word', size:12},{word:'second word', size:10}]"`

* width

Width of WordCrowd container.

default value `800`

`width:800`

* height

Height of WordCrowd container.

default value `600`

`height:600`

* background :"white"

Background color of WordCrowd container.

default value `"white" `

`background :"white"`

* fontsize_range

Sizes of words in proportional to their relative frequencies. Words with high relative frequency will get larger font_size compared to those with lower relative frequencies.

default value `{ min : 12, max : 36 } `

`fontsize_range : { min : 12, max : 36 }`

* hover_color

Words color on hover.

default value `"#000000"`

`hover_color :"#000000"`

* colors

Wordcrowd words color

"random" will assign random color to each word.

default value `"random"`

`colors:"random" `

Custom color can be assigned to wordcrowd.

To color black each word in cloud:`colors:"#000000" `

* collision

number of iterations before a word is placed in specified container.

'min' Minimum number of iterations.

'max' Maximum number of iterations.

default value `min:500,max:1000`

`collision:{ min:500, max:1000 }`

* sortDescending

specify the order in which words will be arranged in container based on their relative frequencies.

default value `sortDescending:false`

* angles

list of angles each word can take to rotate. Each angle must be between 0 and 360.

default value `[0,90] `

`angles : [0,90] `

* font_families

list of available font-families.

default value `[ "Verdana", "Arial"]`

`font_families:[ "Verdana", "Arial"]`

* readFromFile

path to external data file.

data format must be specified in settings options.

json format: `readFromFile:{ type:"json", fileLocation:'json file location' }`

text format: `readFromFile:{ type:"text", fileLocation:'text file location' }`

default value `readFromFile:{ type:"text", fileLocation:false }`

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •