Skip to content

Instantly share code, notes, and snippets.

@kantord
Created January 29, 2018 15:53
Show Gist options
  • Save kantord/c8658efd938354435cd36b854f7d724a to your computer and use it in GitHub Desktop.
Save kantord/c8658efd938354435cd36b854f7d724a to your computer and use it in GitHub Desktop.
Cereals
dashboard "Cereals":
- h1 text: "Cereals"
- h2 text: "By calories"
- bar chart:
- attr:query: '{"columns": [(sort_by(-(.calories | tonumber)) | .[] | [.name, .calories])]}'
- data: https://gist.githubusercontent.com/ZeningQu/6184eaf8faa533e320abc938c4738c3e/raw/40f237de825061faa8721c2293b79c46979780b4/cereals.csv
- h2 text: "By nutritional profile"
- 4 columns:
- attr:query: '.[] | {"component": "rows", "data": [{"component": "text", "args": {"tagName": "h3"}, "data": .name}, {"component": "chart", "args": {"type": "pie"}, "data": {"columns": [["protein", .protein], ["carbo", .carbo], ["sugars", .sugars], ["fat", .fat]]}}]}'
- data: https://gist.githubusercontent.com/ZeningQu/6184eaf8faa533e320abc938c4738c3e/raw/40f237de825061faa8721c2293b79c46979780b4/cereals.csv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment