# Activity by location (Trellis example)

> WestCoast Charts 1.1.5, release, public Core release, on npm. HTML: https://westcoast-charts.com/gallery/trellis/activity-by-location/ · Index for agents: https://westcoast-charts.com/llms.txt

Weekday × hour heatmaps per office on one shared colour scale.

- Chart type: `heatmap` (Heatmap)
- Collection: Trellis · Trellis
- Raw configuration: https://westcoast-charts.com/gallery-src/trellis/activity-by-location.js
- Standalone example: https://westcoast-charts.com/embed/samples/wcc/gallery/trellis/activity-by-location.html

## Setup

```js
import WestCoastCharts from 'west-coast-charts'
import types from 'west-coast-charts/types'
import trellis from 'west-coast-charts/features/trellis'

WestCoastCharts.use(types).use(trellis)
```

## Options

```js
const options = {
  chart: {
    height: "auto",
    fontFamily: "Inter, Geist, \"IBM Plex Sans\", system-ui, sans-serif",
    type: "heatmap",
    toolbar: {
      show: false
    }
  },
  series: [
    {
      name: "Mon",
      office: "Lisbon",
      data: [
        {
          x: "8h",
          y: 27
        },
        {
          x: "9h",
          y: 22
        },
        {
          x: "10h",
          y: 36
        },
        {
          x: "11h",
          y: 39
        },
        {
          x: "12h",
          y: 21
        },
        {
          x: "13h",
          y: 13
        },
        {
          x: "14h",
          y: 28
        },
        {
          x: "15h",
          y: 29
        },
        {
          x: "16h",
          y: 29
        },
        {
          x: "17h",
          y: 50
        }
      ]
    },
    {
      name: "Tue",
      office: "Lisbon",
      data: [
        {
          x: "8h",
          y: 46
        },
        {
          x: "9h",
          y: 38
        },
        {
          x: "10h",
          y: 9
        },
        {
          x: "11h",
          y: 22
        },
        {
          x: "12h",
          y: 6
        },
        {
          x: "13h",
          y: 39
        },
        {
          x: "14h",
          y: 22
        },
        {
          x: "15h",
          y: 12
        },
        {
          x: "16h",
          y: 19
        },
        {
          x: "17h",
          y: 0
        }
      ]
    },
    {
      name: "Wed",
      office: "Lisbon",
      data: [
        {
          x: "8h",
          y: 35
        },
        {
          x: "9h",
          y: 49
        },
        {
          x: "10h",
          y: 15
        },
        {
          x: "11h",
          y: 44
        },
        {
          x: "12h",
          y: 10
        },
        {
          x: "13h",
          y: 5
        },
        {
          x: "14h",
          y: 15
        },
        {
          x: "15h",
          y: 3
        },
        {
          x: "16h",
          y: 26
        },
        {
          x: "17h",
          y: 14
        }
      ]
    },
    {
      name: "Thu",
      office: "Lisbon",
      data: [
        {
          x: "8h",
          y: 11
        },
        {
          x: "9h",
          y: 0
        },
        {
          x: "10h",
          y: 30
        },
        {
          x: "11h",
          y: 7
        },
        {
          x: "12h",
          y: 5
        },
        {
          x: "13h",
          y: 22
        },
        {
          x: "14h",
          y: 6
        },
        {
          x: "15h",
          y: 49
        },
        {
          x: "16h",
          y: 19
        },
        {
          x: "17h",
          y: 2
        }
      ]
    },
    {
      name: "Fri",
      office: "Lisbon",
      data: [
        {
          x: "8h",
          y: 3
        },
        {
          x: "9h",
          y: 0
        },
        {
          x: "10h",
          y: 41
        },
        {
          x: "11h",
          y: 44
        },
        {
          x: "12h",
          y: 35
        },
        {
          x: "13h",
          y: 17
        },
        {
          x: "14h",
          y: 47
        },
        {
          x: "15h",
          y: 5
        },
        {
          x: "16h",
          y: 29
        },
        {
          x: "17h",
          y: 16
        }
      ]
    },
    {
      name: "Mon",
      office: "Berlin",
      data: [
        {
          x: "8h",
          y: 35
        },
        {
          x: "9h",
          y: 11
        },
        {
          x: "10h",
          y: 9
        },
        {
          x: "11h",
          y: 24
        },
        {
          x: "12h",
          y: 31
        },
        {
          x: "13h",
          y: 30
        },
        {
          x: "14h",
          y: 22
        },
        {
          x: "15h",
          y: 27
        },
        {
          x: "16h",
          y: 16
        },
        {
          x: "17h",
          y: 28
        }
      ]
    },
    {
      name: "Tue",
      office: "Berlin",
      data: [
        {
          x: "8h",
          y: 37
        },
        {
          x: "9h",
          y: 17
        },
        {
          x: "10h",
          y: 6
        },
        {
          x: "11h",
          y: 0
        },
        {
          x: "12h",
          y: 30
        },
        {
          x: "13h",
          y: 50
        },
        {
          x: "14h",
          y: 17
        },
        {
          x: "15h",
          y: 33
        },
        {
          x: "16h",
          y: 38
        },
        {
          x: "17h",
          y: 25
        }
      ]
    },
    {
      name: "Wed",
      office: "Berlin",
      data: [
        {
          x: "8h",
          y: 6
        },
        {
          x: "9h",
          y: 23
        },
        {
          x: "10h",
          y: 19
        },
        {
          x: "11h",
          y: 9
        },
        {
          x: "12h",
          y: 8
        },
        {
          x: "13h",
          y: 27
        },
        {
          x: "14h",
          y: 49
        },
        {
          x: "15h",
          y: 13
        },
        {
          x: "16h",
          y: 36
        },
        {
          x: "17h",
          y: 10
        }
      ]
    },
    {
      name: "Thu",
      office: "Berlin",
      data: [
        {
          x: "8h",
          y: 39
        },
        {
          x: "9h",
          y: 15
        },
        {
          x: "10h",
          y: 39
        },
        {
          x: "11h",
          y: 13
        },
        {
          x: "12h",
          y: 39
        },
        {
          x: "13h",
          y: 10
        },
        {
          x: "14h",
          y: 16
        },
        {
          x: "15h",
          y: 20
        },
        {
          x: "16h",
          y: 32
        },
        {
          x: "17h",
          y: 11
        }
      ]
    },
    {
      name: "Fri",
      office: "Berlin",
      data: [
        {
          x: "8h",
          y: 3
        },
        {
          x: "9h",
          y: 14
        },
        {
          x: "10h",
          y: 25
        },
        {
          x: "11h",
          y: 25
        },
        {
          x: "12h",
          y: 34
        },
        {
          x: "13h",
          y: 32
        },
        {
          x: "14h",
          y: 35
        },
        {
          x: "15h",
          y: 34
        },
        {
          x: "16h",
          y: 44
        },
        {
          x: "17h",
          y: 0
        }
      ]
    },
    {
      name: "Mon",
      office: "Austin",
      data: [
        {
          x: "8h",
          y: 0
        },
        {
          x: "9h",
          y: 39
        },
        {
          x: "10h",
          y: 37
        },
        {
          x: "11h",
          y: 13
        },
        {
          x: "12h",
          y: 8
        },
        {
          x: "13h",
          y: 3
        },
        {
          x: "14h",
          y: 20
        },
        {
          x: "15h",
          y: 32
        },
        {
          x: "16h",
          y: 7
        },
        {
          x: "17h",
          y: 15
        }
      ]
    },
    {
      name: "Tue",
      office: "Austin",
      data: [
        {
          x: "8h",
          y: 47
        },
        {
          x: "9h",
          y: 33
        },
        {
          x: "10h",
          y: 31
        },
        {
          x: "11h",
          y: 37
        },
        {
          x: "12h",
          y: 26
        },
        {
          x: "13h",
          y: 50
        },
        {
          x: "14h",
          y: 33
        },
        {
          x: "15h",
          y: 15
        },
        {
          x: "16h",
          y: 7
        },
        {
          x: "17h",
          y: 43
        }
      ]
    },
    {
      name: "Wed",
      office: "Austin",
      data: [
        {
          x: "8h",
          y: 44
        },
        {
          x: "9h",
          y: 32
        },
        {
          x: "10h",
          y: 37
        },
        {
          x: "11h",
          y: 36
        },
        {
          x: "12h",
          y: 15
        },
        {
          x: "13h",
          y: 29
        },
        {
          x: "14h",
          y: 4
        },
        {
          x: "15h",
          y: 26
        },
        {
          x: "16h",
          y: 49
        },
        {
          x: "17h",
          y: 39
        }
      ]
    },
    {
      name: "Thu",
      office: "Austin",
      data: [
        {
          x: "8h",
          y: 38
        },
        {
          x: "9h",
          y: 32
        },
        {
          x: "10h",
          y: 40
        },
        {
          x: "11h",
          y: 50
        },
        {
          x: "12h",
          y: 44
        },
        {
          x: "13h",
          y: 44
        },
        {
          x: "14h",
          y: 6
        },
        {
          x: "15h",
          y: 47
        },
        {
          x: "16h",
          y: 0
        },
        {
          x: "17h",
          y: 4
        }
      ]
    },
    {
      name: "Fri",
      office: "Austin",
      data: [
        {
          x: "8h",
          y: 47
        },
        {
          x: "9h",
          y: 11
        },
        {
          x: "10h",
          y: 42
        },
        {
          x: "11h",
          y: 19
        },
        {
          x: "12h",
          y: 35
        },
        {
          x: "13h",
          y: 43
        },
        {
          x: "14h",
          y: 48
        },
        {
          x: "15h",
          y: 10
        },
        {
          x: "16h",
          y: 41
        },
        {
          x: "17h",
          y: 29
        }
      ]
    },
    {
      name: "Mon",
      office: "Osaka",
      data: [
        {
          x: "8h",
          y: 35
        },
        {
          x: "9h",
          y: 38
        },
        {
          x: "10h",
          y: 39
        },
        {
          x: "11h",
          y: 50
        },
        {
          x: "12h",
          y: 31
        },
        {
          x: "13h",
          y: 48
        },
        {
          x: "14h",
          y: 43
        },
        {
          x: "15h",
          y: 47
        },
        {
          x: "16h",
          y: 37
        },
        {
          x: "17h",
          y: 12
        }
      ]
    },
    {
      name: "Tue",
      office: "Osaka",
      data: [
        {
          x: "8h",
          y: 8
        },
        {
          x: "9h",
          y: 36
        },
        {
          x: "10h",
          y: 13
        },
        {
          x: "11h",
          y: 8
        },
        {
          x: "12h",
          y: 38
        },
        {
          x: "13h",
          y: 39
        },
        {
          x: "14h",
          y: 21
        },
        {
          x: "15h",
          y: 13
        },
        {
          x: "16h",
          y: 34
        },
        {
          x: "17h",
          y: 33
        }
      ]
    },
    {
      name: "Wed",
      office: "Osaka",
      data: [
        {
          x: "8h",
          y: 6
        },
        {
          x: "9h",
          y: 1
        },
        {
          x: "10h",
          y: 16
        },
        {
          x: "11h",
          y: 46
        },
        {
          x: "12h",
          y: 49
        },
        {
          x: "13h",
          y: 21
        },
        {
          x: "14h",
          y: 11
        },
        {
          x: "15h",
          y: 40
        },
        {
          x: "16h",
          y: 40
        },
        {
          x: "17h",
          y: 33
        }
      ]
    },
    {
      name: "Thu",
      office: "Osaka",
      data: [
        {
          x: "8h",
          y: 48
        },
        {
          x: "9h",
          y: 33
        },
        {
          x: "10h",
          y: 7
        },
        {
          x: "11h",
          y: 18
        },
        {
          x: "12h",
          y: 21
        },
        {
          x: "13h",
          y: 42
        },
        {
          x: "14h",
          y: 43
        },
        {
          x: "15h",
          y: 37
        },
        {
          x: "16h",
          y: 27
        },
        {
          x: "17h",
          y: 1
        }
      ]
    },
    {
      name: "Fri",
      office: "Osaka",
      data: [
        {
          x: "8h",
          y: 41
        },
        {
          x: "9h",
          y: 15
        },
        {
          x: "10h",
          y: 19
        },
        {
          x: "11h",
          y: 21
        },
        {
          x: "12h",
          y: 33
        },
        {
          x: "13h",
          y: 22
        },
        {
          x: "14h",
          y: 1
        },
        {
          x: "15h",
          y: 21
        },
        {
          x: "16h",
          y: 41
        },
        {
          x: "17h",
          y: 15
        }
      ]
    }
  ],
  colors: ["#0d9488"],
  dataLabels: {
    enabled: false
  },
  trellis: {
    by: "office",
    columns: 2,
    aspectRatio: 1.9,
    legend: "none"
  },
  title: {
    text: "Desk bookings by hour"
  },
  theme: {
    mode: "light",
    preset: "coastal"
  }
}

const chart = new WestCoastCharts(document.querySelector('#chart'), options)
await chart.render()
```

## Verify

- Text check (Library 1.1.5): load `west-coast-charts/agent/describe` and call `chart.describe({ format: "json" })` for the actual drawn state. The live reader is on this example’s HTML page.
- Command line (Public agent tools 0.2.3, tested with Library 1.1.5; available from the versioned GitHub release and npm, https://westcoast-charts.com/docs/cli/index.md): `wcc chart export trellis-activity-by-location.json --out trellis-activity-by-location.svg --with-table` (save the options above as JSON first)
