Initializing a Parameter

Edit this page

Parameters can be initialized using the value property.

  • For variable parameters, this value can be set to any valid JSON primitive type including booleans, numbers, or string.
  • For selection parameters, value should specify mappings between projected channels or field names to initial values.
    • Point selections are initialized with an array of such mappings.
    • Interval selections are initialized with a single object mapping to arrays of values.

Examples

In the example below, we initalize the "CylYr" selection with two values by setting the values for the "Cylinders" and "Years" fields.

Similarly, we initialize the "brush" selection to the extent of the brush for the x and y encoding channels. The values specify the start and end of the interval selection.