I am creating a word cloud that looks like this:
I have the English word "Tickets" fixed at 160px. How can I set a minimum size for the non-English words (32 for example)? I am using d3.js and Math.random().
var languages = [{"text":"Tickets"},{"text":"Fahrkarten"},{"text":"Entradas"},{"text":"Billets"},{"text":"Biglietti"},{"text":"チケット"},{"text":"티켓"},{"text":"Bilhetes"},{"text":"门票"},{"text":"門票"}];
var eases = [d3.easeExp,d3.easeSin,d3.easeLinear,d3.easeCubic];
var easesItem = eases[Math.floor(Math.random()*eases.length)];
console.log(easesItem);
var color = d3.scaleLinear()
.domain([0,1,2,3,4,5,6,10,15,20,100])
.range(["#000000", "#2F4F4F", "#708090", "#778899", "#808080", "#696969", "#A9A9A9", "#C0C0C0", "#D3D3D3", "#DCDCDC"]);
var layout = d3.layout.cloud()
.size([1020, 1980])
.words(languages)
.padding(5)
.rotate(function() { return ~~(Math.random() * 2) * 90; })
.font("MoMA Sans Office")
.fontSize(function(d) { if(d.text === 'Tickets') { return 160; } else { return 10 + Math.random() * 160; } })
.on("end", draw);
layout.start();
NOTE: The screen changes every 5 seconds and the words appear in random order, color, and sizes, except for the English word "Ticket" which has a random color and order, but is always 160px. I am looking to avoid very small words.