What's the Best Practice for the Automatic Granularity Pickers?

Whenever you choose a time-series Dimension, a granularity picker also shows up automatically. This behavior is intended to replace the previous need to define a granularity input in your emb.ts file. If you have built custom components that use granularity inputs, you have two options:

  1. Our suggested choice - remove the granularity input and use the automatic granularity instead. This may require you to move from passing dimensions and measures separately to loadData and instead use select - see the loadData documentation for examples.
  2. The alternate choice - on your dimension definition in the emb.ts file, you can add hideGranularity: true to the config property to disable the automatic granularity. Here’s a full example:
    {
      name: 'xAxis',
      type: 'dimension',
      label: 'X-Axis',
      config: {
        dataset: 'ds',
        supportedTypes: ['time'],
        hideGranularity: true,
      },
      category: 'Chart data',
    },