datamade/just-spaces

Display preset observational question data as columns in DAD

Opened this issue · 1 comments

The data handler currently saves preset observational questions as JSON strings, which winds up displaying strangely in the Collected Data view:

Screenshot from 2019-05-13 18-18-37

There are two ways we could fix this:

  1. Update the data handler to save each key/value pair as a separate SurveyComponent

    • Pros:
      • Semantically matches the purpose of this question (to create common groups of SurveyComponents)
      • Maintains the same representation of the data between storage, display, and export
    • Cons:
      • Unclear how much we'd have to refactor the DAD source data selector in order to group the separate SurveyComponents properly
      • We'd have to save a display name that would make sense as a column name
  2. Update the frontend code to format the JSON as columns in DataTables

    • Pros:
      • Relatively simple refactor from the current state of the code
    • Cons:
      • Creates representational mismatch between storage, display, and export
      • Further complicates frontend data processing, which is already complicated
      • Requires either transforming the data for both DataTables display and data export, or tightly coupling these two systems with the same transformation logic

I've been thinking about this a little more as I implement ACS data comparisons. Let's hold off for now; it may turn out to be much easier to use JSON for ACS data purposes.