Skip to content

Commit

Permalink
first term always at the center'
Browse files Browse the repository at this point in the history
  • Loading branch information
suyax committed Aug 30, 2016
1 parent 726aee9 commit 57f2c33
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 14 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "d3-cloud",
"version": "1.2.2",
"version": "1.2.2-suya",
"main": "build/d3.layout.cloud.js",
"dependencies": {
"d3-dispatch": "0.2.x"
Expand Down
23 changes: 13 additions & 10 deletions build/d3.layout.cloud.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ module.exports = function() {
var start = Date.now();
while (Date.now() - start < timeInterval && ++i < n && timer) {
var d = data[i];
d.x = (size[0] * (random() + .5)) >> 1;
d.y = (size[1] * (random() + .5)) >> 1;
d.x = (size[0]) >> 1;
d.y = (size[1]) >> 1;
cloudSprite(contextAndRatio, d, data, i);
if (d.hasText && place(board, d, bounds)) {
tags.push(d);
Expand Down Expand Up @@ -403,9 +403,13 @@ var spirals = {
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
typeof define === 'function' && define.amd ? define(['exports'], factory) :
factory((global.dispatch = {}));
(factory((global.d3_dispatch = {})));
}(this, function (exports) { 'use strict';

function dispatch() {
return new Dispatch(arguments);
}

function Dispatch(types) {
var i = -1,
n = types.length,
Expand Down Expand Up @@ -449,7 +453,8 @@ var spirals = {
for (var otherType in callbacksByType) {
if (callback = callbackByName[otherType + type.name]) {
callback.value = null;
var callbacks = callbacksByType[otherType], i = callbacks.indexOf(callback);
callbacks = callbacksByType[otherType];
i = callbacks.indexOf(callback);
callbacksByType[otherType] = callbacks.slice(0, i).concat(callbacks.slice(i + 1));
delete callbackByName[callback.name];
}
Expand All @@ -476,13 +481,12 @@ var spirals = {
function applier(type) {
return function() {
var callbacks = callbacksByType[type], // Defensive reference; copy-on-remove.
callback,
callbackValue,
i = -1,
n = callbacks.length;

while (++i < n) {
if (callbackValue = (callback = callbacks[i]).value) {
if (callbackValue = callbacks[i].value) {
callbackValue.apply(this, arguments);
}
}
Expand All @@ -492,12 +496,11 @@ var spirals = {
}
}

function dispatch() {
return new Dispatch(arguments);
}
dispatch.prototype = Dispatch.prototype;

dispatch.prototype = Dispatch.prototype; // allow instanceof
var version = "0.2.6";

exports.version = version;
exports.dispatch = dispatch;

}));
Expand Down
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ module.exports = function() {
var start = Date.now();
while (Date.now() - start < timeInterval && ++i < n && timer) {
var d = data[i];
d.x = (size[0] * (random() + .5)) >> 1;
d.y = (size[1] * (random() + .5)) >> 1;
d.x = (size[0]) >> 1;
d.y = (size[1]) >> 1;
cloudSprite(contextAndRatio, d, data, i);
if (d.hasText && place(board, d, bounds)) {
tags.push(d);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "d3-cloud",
"version": "1.2.2",
"version": "1.2.2-suya",
"description": "Generate word clouds in JavaScript.",
"keywords": [
"word",
Expand Down

1 comment on commit 57f2c33

@pemery
Copy link

@pemery pemery commented on 57f2c33 Aug 31, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commits for FE-113

Please sign in to comment.