# Advent of Code, Day 11: Rendering Charts from Ember Data

- Link: https://cagrimmett.com/2019/12/12/advent-day-11/
- Published: 2019-12-12T03:46:00-05:00
- Author: Chuck Grimmett

Day 11!

After some frustrating trial and error and searching through docs with lots of words
I don’t quite understand, [Dave Wasmer](https://davewasmer.com) kindly helped me
figure out how to get Ember Objects (the results of Ember data queries) in a format
I’m used to working with: Something that looks like a regular array of objects, 
or [“POJO”](https://en.wikipedia.org/wiki/Plain_old_Java_object) as Dave said.

The solution ended up being calling the `map` method on the array-but-not-really-
array and `toJSON` on each item in that. Then I get something back that looks like`[{
name: ..., startDate:...}, {...}]`

    ```highlight
    model.plants.map(c => c.toJSON()); 
    ```

This allowed me to render the charts with Ember Data stored in Firebase.

Tomorrow: Digging back in to D3’s update pattern and getting the chart automatically
updating when adding a new plant. Dave’s helpful suggestion was to look into the“
data down, action up” pattern.

Thanks, Dave!
