Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

configurable label settings #29

Open
deanmalmgren opened this issue Nov 7, 2013 · 2 comments
Open

configurable label settings #29

deanmalmgren opened this issue Nov 7, 2013 · 2 comments

Comments

@deanmalmgren
Copy link
Contributor

This is a really nice example of using catcorrjs on non-survey categorical data and the 'Respondents' labels jump out as being rather ridiculous when they refer to pictures, not people. I'm sure there will be other things, like animation times in #26, absolute or relative views in #25, etc that will also need to have customized settings. Here's a proposed API change to incorporate an optional settings object that is passed as a third argument:

var cc = catcorr("#selector", data, {
    // specify [singular, plural] noun for data so that legend labels don't look ridiculous.
    datum_label: ["respondent", "respondents"],

    // to be added for #25, follows all configuration options in d3 
    // https://github.com/mbostock/d3/wiki/Transitions#starting-transitions
    animation: {
        delay: value_in_ms_or_function, 
        duration: value_in_ms_or_function,
        ease: string_or_function,
    },

    // to be added for #26, "absolute" (current) or "relative" (Option C in #26)
    default_view: "absolute",

    // other hardcoded values that come to mind off the top of my mind 
    // (will open new issue for this one)
    bar_width: 80,
    chart_height: 100,
});
@deanmalmgren
Copy link
Contributor Author

Just going to mention @timelyportfolio here in case you want to keep tabs on progress :)

@ramnathv
Copy link

ramnathv commented Nov 7, 2013

This is a nice feature to add to the API. As we go over the vcdExtra library in R, we might find more ways in which CatCorrJS would be useful. Thanks for this terrific library!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants