Skip to content

Conversation

@stegben
Copy link

@stegben stegben commented Nov 11, 2016

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.

@jasondavies jasondavies added the req label Mar 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants