Coder Social home page Coder Social logo

Comments (4)

jjallaire avatar jjallaire commented on August 15, 2024

@javierluraschi Is there anything special we would do here? It seems like this is already covered by the D3 API (i.e. you can provide these callbacks directly without any help from r2d3) but perhaps I'm missing something.

from r2d3.

edgararuiz-zz avatar edgararuiz-zz commented on August 15, 2024

Maybe adding how to do that to the basic example in the site/vignettes?

// !preview r2d3 data=c(0.3, 0.6, 0.8, 0.95, 0.40, 0.20)

var barHeight = Math.floor(height / data.length);

svg.selectAll('rect')
  .data(data)
  .enter().append('rect')
    .attr('width', function(d) { return d * width; })
    .attr('height', barHeight)
    .attr('y', function(d, i) { return i * barHeight; })
    .attr('fill', 'steelblue')
    .on("mouseover", function(){ d3.select(this) .attr('fill', 'orange'); })
    .on("mouseout", function() { d3.select(this) .attr('fill', 'steelblue') });

from r2d3.

jjallaire avatar jjallaire commented on August 15, 2024

One thing we aren't trying to do in the basic examples is teach D3 (as that's a much, much bigger topic!). That's why we created the Learning D3 page: https://rstudio.github.io/r2d3/articles/learning_d3.html

So I could add the simple interactions suggested here, but that will also just beg the question of how to do other non-toy interactions.

from r2d3.

TuSKan avatar TuSKan commented on August 15, 2024

Sorry for open this issue guys. All of you are correct, you can't put in preview examples, all the features of the D3.
Thank you very much, for providing one example above.
You can close this issue.

from r2d3.

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.