All Projects → jasondavies → D3 Cloud

jasondavies / D3 Cloud

Licence: other
Create word clouds in JavaScript.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to D3 Cloud

WordCloud.jl
word cloud generator in julia
Stars: ✭ 66 (-98.09%)
Mutual labels:  wordcloud, layout-algorithm
Carbon Charts
📊 📈⠀Robust dataviz framework implemented using D3 & typescript
Stars: ✭ 287 (-91.71%)
Mutual labels:  d3
react-org-chart
Component for displaying an org chart for a large organization. Supports lazy load and export.
Stars: ✭ 147 (-95.75%)
Mutual labels:  d3
D3 Extended
Extends D3 with some common jQuery functions and more
Stars: ✭ 269 (-92.23%)
Mutual labels:  d3
d3-sankey-circular
A fork of the d3-sankey library to allow circular links.
Stars: ✭ 65 (-98.12%)
Mutual labels:  d3
Realize
A React component tree visualizer
Stars: ✭ 285 (-91.76%)
Mutual labels:  d3
vue-d3-charts
D3 charts for Vue
Stars: ✭ 66 (-98.09%)
Mutual labels:  d3
Flask jsondash
🐍 📊 📈 Build complex dashboards without any front-end code. Use your own endpoints. JSON config only. Ready to go.
Stars: ✭ 3,215 (-7.08%)
Mutual labels:  d3
Recharts
Redefined chart library built with React and D3
Stars: ✭ 17,455 (+404.48%)
Mutual labels:  d3
React Native Svg Charts Examples
A collection of usage examples of react-native-svg-charts
Stars: ✭ 266 (-92.31%)
Mutual labels:  d3
Floweaver
View flow data as Sankey diagrams
Stars: ✭ 266 (-92.31%)
Mutual labels:  d3
cryptoization
Data visualization application showing all BTC transactions in real-time
Stars: ✭ 12 (-99.65%)
Mutual labels:  d3
Doctor
基于知识图谱的医学诊断系统。Medical Diagnosis System Based on Knowledge Map.
Stars: ✭ 286 (-91.73%)
Mutual labels:  d3
jelly-chart
Jelly-Chart is a chart library based on D3v4 and SVG.
Stars: ✭ 34 (-99.02%)
Mutual labels:  d3
Rumble Charts
React components for building composable and flexible charts
Stars: ✭ 293 (-91.53%)
Mutual labels:  d3
pdf2xml-viewer
A simple viewer and inspection tool for text boxes in PDF documents
Stars: ✭ 82 (-97.63%)
Mutual labels:  d3
Plottable
📊 A library of modular chart components built on D3
Stars: ✭ 2,834 (-18.09%)
Mutual labels:  d3
D3 Funnel
A JavaScript library for rendering funnel charts using the D3.js framework.
Stars: ✭ 283 (-91.82%)
Mutual labels:  d3
Vivagraphjs
Graph drawing library for JavaScript
Stars: ✭ 3,442 (-0.52%)
Mutual labels:  layout-algorithm
Dtree
A library for visualizing data trees with multiple parents, such as family trees. Built on top of D3.
Stars: ✭ 308 (-91.1%)
Mutual labels:  d3

Word Cloud Layout

This is a Wordle-inspired word cloud layout written in JavaScript. It uses HTML5 canvas and sprite masks to achieve near-interactive speeds.

See here for an interactive demonstration along with implementation details.

Example cloud of Twitter search results for “amazing”

Usage

See the samples in examples/.

API Reference

# d3.layout.cloud()

Constructs a new cloud layout instance.

# on(type, listener)

Registers the specified listener to receive events of the specified type from the layout. Currently, only "word" and "end" events are supported.

A "word" event is dispatched every time a word is successfully placed. Registered listeners are called with a single argument: the word object that has been placed.

An "end" event is dispatched when the layout has finished attempting to place all words. Registered listeners are called with two arguments: an array of the word objects that were successfully placed, and a bounds object of the form [{x0, y0}, {x1, y1}] representing the extent of the placed objects.

# start()

Starts the layout algorithm. This initialises various attributes on the word objects, and attempts to place each word, starting with the largest word. Starting with the centre of the rectangular area, each word is tested for collisions with all previously-placed words. If a collision is found, it tries to place the word in a new position along the spiral.

Note: if a word cannot be placed in any of the positions attempted along the spiral, it is not included in the final word layout. This may be addressed in a future release.

# stop()

Stops the layout algorithm.

# timeInterval([time])

Internally, the layout uses setInterval to avoid locking up the browser’s event loop. If specified, time is the maximum amount of time that can be spent during the current timestep. If not specified, returns the current maximum time interval, which defaults to Infinity.

# words([words])

If specified, sets the words array. If not specified, returns the current words array, which defaults to [].

# size([size])

If specified, sets the rectangular [width, height] of the layout. If not specified, returns the current size, which defaults to [1, 1].

# font([font])

If specified, sets the font accessor function, which indicates the font face for each word. If not specified, returns the current font accessor function, which defaults to "serif". A constant may be specified instead of a function.

# fontStyle([fontStyle])

If specified, sets the fontStyle accessor function, which indicates the font style for each word. If not specified, returns the current fontStyle accessor function, which defaults to "normal". A constant may be specified instead of a function.

# fontWeight([fontWeight])

If specified, sets the fontWeight accessor function, which indicates the font weight for each word. If not specified, returns the current fontWeight accessor function, which defaults to "normal". A constant may be specified instead of a function.

# fontSize([fontSize])

If specified, sets the fontSize accessor function, which indicates the numerical font size for each word. If not specified, returns the current fontSize accessor function, which defaults to:

function(d) { return Math.sqrt(d.value); }

A constant may be specified instead of a function.

# rotate([rotate])

If specified, sets the rotate accessor function, which indicates the rotation angle (in degrees) for each word. If not specified, returns the current rotate accessor function, which defaults to:

function() { return (~~(Math.random() * 6) - 3) * 30; }

A constant may be specified instead of a function.

# text([text])

If specified, sets the text accessor function, which indicates the text for each word. If not specified, returns the current text accessor function, which defaults to:

function(d) { return d.text; }

A constant may be specified instead of a function.

# spiral([spiral])

If specified, sets the current type of spiral used for positioning words. This can either be one of the two built-in spirals, "archimedean" and "rectangular", or an arbitrary spiral generator can be used, of the following form:

// size is the [width, height] array specified in cloud.size
function(size) {
  // t indicates the current step along the spiral; it may monotonically
  // increase or decrease indicating clockwise or counterclockwise motion.
  return function(t) { return [x, y]; };
}

If not specified, returns the current spiral generator, which defaults to the built-in "archimedean" spiral.

# padding([padding])

If specified, sets the padding accessor function, which indicates the numerical padding for each word. If not specified, returns the current padding, which defaults to 1.

# random([random])

If specified, sets the internal random number generator, used for selecting the initial position of each word, and the clockwise/counterclockwise direction of the spiral for each word. This should return a number in the range [0, 1).

If not specified, returns the current random number generator, which defaults to Math.random.

# canvas([canvas])

If specified, sets the canvas generator function, which is used internally to draw text. If not specified, returns the current generator function, which defaults to:

function() { return document.createElement("canvas"); }

When using Node.js, you will almost definitely override this default, e.g. using the canvas module.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].