shprink / d3js-wordcloud

http://julienrenaux.fr/2014/09/23/d3-js-responsive-word-cloud/
MIT License
48 stars 31 forks source link

Demo not working #3

Open christianw opened 7 years ago

christianw commented 7 years ago

Your demo is currently not working due to the https website whereas the content comes from an unencrypted site.

shprink commented 7 years ago

thanks for letting me know. link: http://examples.julienrenaux.fr/d3js/wordcloud/

christianw commented 7 years ago

Thanks, this one works perfectly :-)

AppWerft commented 6 years ago

How can I make the texts clickable?

chaosbiber commented 6 years ago

@AppWerft I haven't tested it with this code, but I would add

.on('click', (d, i) => {
      //do something
})

in the selection.enter() part, but before .transition(), around line 68. That's where the text items are created. You can also append mouseover and -out events to change the mouse cursor.

AppWerft commented 6 years ago

Thanks I will try and will send you feedback.

AppWerft commented 6 years ago

It works! http://hosdev.sub.uni-hamburg.de/ (Klick on left cloud)

jgorene commented 5 years ago

Yes, it even works perfectly, thx! Otherwise, I also use another solution by attaching an listener to the parent div. So that clicking on a keyword can interact with other modules outside the scope if needed.

document.getElementById(parentDiv).addEventListener('click', function(e) {
    let text = (e.target.tagName === "text") ? e.target.innerHTML : null;
    if (text) {
        // do something...
    }
}, false);

Here an example https://jgorene.github.io/ical-vision/index.html