Open stegben opened 7 years ago
I would like to pass a custom fontSize mapper like this:
function fontSizeMapper (word, idx, words) { const max = 100; const min = 10; const wordSize = words.map(w => w.size); const minSize = Math.min(...wordSize); const maxSize = Math.max(...wordSize); return min + (max - min) * (word.size - minSize) / (maxSize - minSize); };
It's a normalization of font sizes, which requires to know the min and max value of word counts.
I would like to pass a custom fontSize mapper like this:
It's a normalization of font sizes, which requires to know the min and max value of word counts.