Giter Club home page Giter Club logo

Comments (6)

sdaclin avatar sdaclin commented on May 17, 2024

I agree :p

from d3-cloud.

fosterrath avatar fosterrath commented on May 17, 2024

Is there a work-around to get an approximation of this feature ? (I can handle the cloud being re-arranged) i.e. in a way that acts like your word cloud generator. I can't seem to find a way to do so. Thanks.

from d3-cloud.

jasondavies avatar jasondavies commented on May 17, 2024

The word cloud generator knows all the words up-front, so this doesn’t apply. This issue addresses the case where you don’t know all the words in advance, and you want to position new words in a partially-filled region.

from d3-cloud.

fosterrath avatar fosterrath commented on May 17, 2024

Right, got that.

But I meant that the word cloud generator can re-use the same tagcloud instance, re-submit words with new words appended and have them integrated to the re-mixed tagcloud.

I can handle keeping the state out of the tagcloud instance (differs from original post, sorry) and I can handle re-calculating the cloud layout. I just can't figure from the source or the examples how to add new words without having to create a new instance for each new word arrival. Any hints?

Thanks!

from d3-cloud.

jasondavies avatar jasondavies commented on May 17, 2024

Perhaps I was nit-picking. :) The word cloud generator reuses a single layout instance. Every time you call layout.start(), it starts with an empty canvas and lays out the words that you have given it via layout.words(…). So if you have an array of words, and you want to add a new word, you can simply push it onto the array, and call:

layout
    .stop()
    .words(words)
    .start();

If you are reading words from some kind of stream, then that’s what this issue is about: there’s no way to reuse a partially-filled canvas for collision detection if a new word arrives. This probably wouldn’t give good results anyway, because the algorithm starts off by placing the largest words first.

from d3-cloud.

maryokhin avatar maryokhin commented on May 17, 2024

@jasondavies do you have any tips or pointers for someone interested in implementing dynamically placing tags in an already existing layout?

from d3-cloud.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.