d3-cloud icon indicating copy to clipboard operation
d3-cloud copied to clipboard

feature: blink words to load more?

Open ycgambo opened this issue 3 years ago • 2 comments

here is what I try to do by using jquery:

var func = (v) => {
    $(v).css('opacity', 0)
    setTimeout(()=> {
        $(v).text(parseInt(Math.random() * 100))
        $(v).css('opacity', 1)
        setTimeout(func.bind(this, v), 3000 + Math.random() * 3000)
    },5000)
}

$('svg text').each((k, v) => {
    $(v).css('transition', 'opacity 5s cubic-bezier(0.4, 0, 0.2, 1) 0s')
    setTimeout(func.bind(this, v), Math.random() * 10000)
})

GIF 12-2 21-30-05

ycgambo avatar Dec 02 '20 13:12 ycgambo

words has different lengths and font-sizes. the code above will actually cause a text overlap. I hope someone will introduce a good way to blink them in appropriate position.

ycgambo avatar Dec 02 '20 13:12 ycgambo

The current implementation only places a static set of words in one go: it can't deal with adding new words and placing them dynamically. Might be interesting for a future version.

jasondavies avatar Jul 15 '22 22:07 jasondavies