Coder Social home page Coder Social logo

Stacked bar chart? about roughviz HOT 8 CLOSED

jwilber avatar jwilber commented on April 28, 2024
Stacked bar chart?

from roughviz.

Comments (8)

peterbe avatar peterbe commented on April 28, 2024 1

I doubt that I'll get around to it. I'm currently not blocked as this is just an experiment I was planning to do. Perhaps when my experiment materializes more I might be capable to help out but I doubt it's an investment I'm ready to do any time soon.

If you get around to it, it would be great but don't hope for me being a good open-source citizen :)

from roughviz.

jolo-dev avatar jolo-dev commented on April 28, 2024 1

Can I try?

from roughviz.

jolo-dev avatar jolo-dev commented on April 28, 2024 1

@jwilber Wow, thanks for your support. Stacks are created. Let's see if I can do a PR soon.

from roughviz.

jwilber avatar jwilber commented on April 28, 2024 1

Hey @peterbe , this was added by @jolo-dev and is now available in version 1.0.5 :)

Example

from roughviz.

jwilber avatar jwilber commented on April 28, 2024

Hey @peterbe, currently this would be a feature request.
It's something I'd like to add as well, maybe this weekend :)

from roughviz.

jwilber avatar jwilber commented on April 28, 2024

I should mention if you/anyone wants to submit a pr that’d be awesome as well and I’d be super down to assist 😎

from roughviz.

jwilber avatar jwilber commented on April 28, 2024

No worries! I'll make sure to ping you when one is added

from roughviz.

jwilber avatar jwilber commented on April 28, 2024

@jolo-dev yep!

Some advice: If you look at, say, the Bar class, there's a lot of stuff you can reuse (at some point I'll throw these into an ABC).

Basically, when defining a new chart, you just need to define 2-3 methods:

  • drawFromFile(): roughjs code for data from files.
  • drawFromObject(): roughjs code for data from parameters.
  • addInteraction: This is where the original, non-rough d3 code goes. Basically, you just create a stacked barchart as normal in d3 that will exist behind the roughjs version. This allows for interactivity on hover.

Note that much of the code for the above methods in the Bar class may itself be recycled.

You should be able to reuse all of the other methods. If you need to update the axis values, edit the addAxes() method (no need to touch makeAxesRough().

Feel free to reach out with any questions if you decide to approach this, and thanks for the interest!

from roughviz.

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.