How should we work with JSON fields in Embeddable?

Some teams store custom data as a JSON inside a database field, like this:
{“Ford”: “Transit”, “Renault”: “Clio”, “Volkswagen”: “Polo”}

You can put as many fields in the JSON as you like. To use the values themselves in your charts you need to do one of two things:

  1. define a separate dimension in your model for each field that you want to have access to, or
  2. have a dimension that returns the whole JSON object, but then modify your chart component to handle the JSON object (i.e. use JavaScript to extract the values you need)