This can certainly be refined and improved, but for now this pull seeks to address #19.
Summary of Changes
create new drawWordCloud method for use by render and resize
bail out of word cloud instantiation if either width or height are 0 to avoid infinite loop
add resize call
change append to data([0]).enter().append() pattern for reused elements like tooltip
add instance.drawn to avoid adding font multiple times; note, if more than one d3wordcloud in document, multiple same css will be added but not really a problem since cached
This can certainly be refined and improved, but for now this pull seeks to address #19.
Summary of Changes
drawWordCloud
method for use byrender
andresize
resize
callappend
todata([0]).enter().append()
pattern for reused elements liketooltip
instance.drawn
to avoid adding font multiple times; note, if more than oned3wordcloud
in document, multiple samecss
will be added but not really a problem since cached