SelectoComponents.Form.DrillDownFilters (selecto_components v0.3.12)

Handles filter creation logic for drill-down operations from aggregate views and charts.

This module contains complex logic for:

  • Building filters from aggregate drill-down clicks
  • Handling date/time filters with various formats (YYYY, YYYY-MM, YYYY-MM-DD)
  • Processing bucket ranges (age buckets, numeric ranges)
  • Determining appropriate comparison operators for different field types

Link to this section Summary

Functions

Build filter parameters for aggregate drill-down.

Build filters map from indexed drill-down parameters.

Build filter tuples for view_config from drill-down parameters (simpler version for view_config.filters).

Determine the appropriate comparison operator and values based on the clicked value format.

Link to this section Functions

Link to this function

build_agg_drill_down_params(params, socket)

Build filter parameters for aggregate drill-down.

Takes the clicked parameters and socket assigns, returns a map ready for view_from_params.

Link to this function

build_filter_map(params, socket)

Build filters map from indexed drill-down parameters.

Link to this function

build_filter_tuples(params, socket)

Build filter tuples for view_config from drill-down parameters (simpler version for view_config.filters).

Link to this function

determine_filter_comp_and_values(value, field_conf, drill_context)

Determine the appropriate comparison operator and values based on the clicked value format.

Handles:

  • NULL values (creates IS_EMPTY filter)
  • Bucket ranges (1-10, 11+, Other)
  • Date formats (YYYY-MM-DD, YYYY-MM, YYYY)
  • Age buckets on date fields
  • Text-prefix buckets with optional article exclusion
  • Default equality