A Scatter places a catalog’s items as points on two of their number values: foods by calories across and protein up, coloured by Food type; emotions on pleasantness and energy, coloured by family, which is the circumplex of affect the Emotion catalog is built on (Emotions). One drawing serves two places, a catalog’s page and a trackable’s visualizations. It shares its name with the chart that compares two trackables, since both place points by two values.
On a catalog’s page
Scatter is a view beside Auto, Table and Cards, offered where the catalog has at least two number fields. It draws the items the page’s search and filters leave, with values scaled as the table shows them (per 100 g, per serving), and its controls sit beside it: Across, Up, Color (a Category, or none) and Size (a third number value, or none). The axes are remembered per catalog on the device.
- Defaults come from the catalog: pleasantness and energy where it has both, else calories and protein, else its first two number fields; coloured by its first Category.
- A point’s colour is its Category value’s own colour, else the chart palette’s colour for the value’s place in the list.
- A point’s size runs from 3 to 10 across the size value’s range, by area. Without a size, or for an item lacking that value, points are alike.
- An item without both values is not drawn, and the view says how many were left out.
- The tooltip names the item.
As a trackable’s visualization
A trackable whose item field names a catalog is offered a Scatter among its visualizations (Visualizations). It draws the catalog’s items faint, then the items the trackable logged in the period on top, larger the more often each was logged (from 4 to 12, by area), coloured by the chosen Category or, with none, the trackable’s own colour. The tooltip says how many times each was logged in the period, a legend lists the Category’s values, and a line beneath counts the items logged out of the catalog’s, both of them the items drawn, so a one-off logged in the period is in neither. So Diet’s Scatter shows which foods were eaten, by calories against protein, and Emotions’ shows the week’s emotions on the circumplex. Its Across, Up and Color are held in the visualization’s spec (axes, a ScatterAxes) and set in the visualization’s settings; size there is how often, not a value. One-offs are not drawn.
Code
apps/renderer/src/components/catalog/CatalogScatter.tsx:canScatter,defaultAxes,catalogPoints, the view.apps/renderer/src/components/visualizations/TrackableScatter.tsx:loggedItems, the trackable’s Scatter and its settings fields;apps/renderer/src/lib/visualizations.ts:logsCatalogItems.packages/core/src/value-schema.ts:ScatterAxes.
Related
Catalog Entities · Catalog Categories · Visualizations · Editor for Several Trackables · Emotions