8000 Allow user to specify variable/chart type for a column · Issue #128 · RhoInc/web-codebook · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
8000

Allow user to specify variable/chart type for a column #128

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

Closed
bzkrouse opened this issue Jun 29, 2017 · 8 comments
Closed

Allow user to specify variable/chart type for a column #128

bzkrouse opened this issue Jun 29, 2017 · 8 comments

Comments

@bzkrouse
Copy link

As we continue to connect R + JS, here's another thing to consider: Having the JS side accept the variable type from R. This will ensure that the codebook matches what's happening in the analysis workflow. For example, if the R user changes the variable type (e.g. categorical -> numeric) it would reflect on the JS side.

@jwildfire
Copy link
Contributor

I guess this would be implemented by adding an option to the js renderer that lets the user specify the variable type (instead of only doing it via auto-detection) and then just writing a little loop on the r side of things to pull variable types and pass them to the js function in the proper format. Isn't really all that different that letting the user specify the label or something like that, so definitely possible. Let's revisit after v1.2 is out the door.

@jwildfire
Copy link
Contributor

See #149 for a possible approach.

@jwildfire jwildfire added this to the v1.3.0 milestone Aug 11, 2017
@jwildfire
Copy link
Contributor

#149 is in place, but currently users cannot coerce the chart type of a given column.

We could set something up that is similar to label handling via meta[].label. e.g.if some key parameter exists in meta (meta[].type?) then that overwrites the default logic for determining chart type.

@jwildfire jwildfire changed the title Receive the variable type from R Allow user to specify variable/chart type for a column Aug 11, 2017
@jwildfire
Copy link
Contributor

@bzkrouse I'm currently leaning towards leaving this out of v1.3.0. I'm worried unless the meta[].type option is paired with some kind of data validation we're going to run in to problems with trying to use the wrong chart type when type is incorrectly specified.

Worth tackling eventually, but it would be a fairly big effort.

@jwildfire
Copy link
Contributor

meta[].type implemented in v1.6.0. Wiki documentation added. Separate issues for data checks and adding controls to the settings page coming shortly.

@jwildfire
Copy link
Contributor

Updated type implementation to mirror the approach to column labels. The relevant settings are config.meta[].type and config.variableTypes (which takes precedence). Wiki is updated.

@jwildfire
Copy link
Contributor
jwildfire commented Oct 8, 2018

Test Notes

Confirm that users can set the type for a variable via config.variableTypes or config.meta[].type (which takes precedence). Using CAT with the default ADAE dataset, do the following:

  • Confirm that SITEID renders as categorical by default
  • Change variableTypes for SITEID to continuous using CAT - confirm that the continuous chart is rendered in the codebook tab. Change it back to cagetorical, and confirm that it displays the categorical chart.
  • Set the variableType for SITEID to 'continuous' and then 'categorical' using the meta parameter and confirm the correct chart renders. Use these text settings:
{
    "meta": [
        {
            "value_col": "SITEID",
            "type": "continuous" //or "categorical"
        }
    ]
}

-Confirm that "variableType" takes precedence over "meta", try the various combinations of "continuous" and "categorical" and confirm the chart renders as expected:

{
    "meta": [
        {
            "value_col": "SITEID",
            "type": "continuous" //or "categorical"
        }
    ],
    "variableTypes": [
        {
            "value_col": "SITEID",
            "type": "continuous" //or "categorical"
        }
    ]
}

@danedexF5
Copy link

Looks good. No matter if it's continuous or categorical, the VariableTypes take precedence over Meta.

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

4 participants
0