Skip to content

configurable label settings #29

Open
@deanmalmgren

Description

@deanmalmgren

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,
});

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions