Skip to content

Possible improvements #59

@SebWiers

Description

@SebWiers

I've been using this for a widget at work, had PM ask for a lot of changes and have implemented some improvements, would be happy to do a code for w/ changes if you like.

  • words sometimes clip of bottom : the top position of a word sometimes results in it being partially rendered, with some or most of the word outside the visible area. I fixed this by adding a condition at the top the hitTest function : if (this.options.height && elem.top + 2*elem.height >= this.options.height) { return true; }
  • cloud density is sparse : I fixed this (for elliptic spiral only) by twiddling the radius and angle growth. Obviously this can slow down draw speed, but I got much greater density without much cost. I hard coded the changes, options for the growth numbers would be ideal; some number combinations produce very nice shapes that are not so much clouds as curving word arcs.
  • lack of dynamic resize to fit all words : while you can remove over flowing words, there's no option to auto-size to fit all words. I wrote such capability by using an afterWordRender function to check how many elements were rendered (with removeOverflowing : true) and adjusting the fontSize attributes (decreased by amount proportional to number of words not yet shown) then re-drawing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions