Skip to content

docs: unify chart dimension settings into shared snippets (#4773)#7031

Open
florent-leborgne wants to merge 3 commits into
mainfrom
docs-issue-4773-chart-snippets
Open

docs: unify chart dimension settings into shared snippets (#4773)#7031
florent-leborgne wants to merge 3 commits into
mainfrom
docs-issue-4773-chart-snippets

Conversation

@florent-leborgne

@florent-leborgne florent-leborgne commented Jun 19, 2026

Copy link
Copy Markdown
Member

Summary

This PR addresses #4773 by single-sourcing the bucket dimension Data settings that Lens chart types share (Top values, Date histogram, Intervals, Filters, and Collapse by) into reusable snippets, and by bringing each page up to standard against the Kibana source so the lists are exhaustive and accurate.

Each page now shows only the functions that its dimensions actually support, with the same wording sourced from one place.

New snippets (explore-analyze/_snippets/)

  • lens-bucket-top-values.md: the Top values function. The default count is verified against source: 9 on {applies_to}stack: ga 9.4/serverless, and on stack: 9.0-9.3 it defaults to 5 for the first dimension and 3 for each additional dimension.
  • lens-bucket-date-histogram.md, lens-bucket-intervals.md, lens-bucket-filters.md: the remaining bucket functions.
  • lens-collapse-by.md: the dimension-level Collapse by control.

Pages rewired to include the snippets

  • Partition (pie-charts.md, waffle-charts.md, treemap-charts.md, mosaic-charts.md)
  • heat-map-charts.md, tag-cloud-charts.md, tables.md
  • XY (bar-charts.md, line-charts.md, area-charts.md)
  • metric-charts.md

Accuracy fixes made while single-sourcing (verified against elastic/kibana at HEAD)

  • Heat map: added the Filters function to both axes (the axis predicate is isBucketed, so Filters applies but was undocumented).
  • Metric: the Break down by dimension now lists the full bucket function set (Date histogram, Intervals, Filters) instead of Top values only, matching its isBucketed predicate.
  • Collapse by is now placed once per dimension and only where the editor exposes it: all partition dimensions, the XY and metric Break down by groups, and table Rows. It is correctly absent from XY horizontal axes, table Split metrics by columns, heat map axes, tag clouds, and gauges.
  • Intervals now documents granularity, custom ranges, and "Include empty rows" (on by default), which were missing on several pages.
  • The shared advanced-settings snippet had partition-specific "tile" wording neutralized so it reads correctly on every chart type.
  • Region map and gauge are intentionally left as-is: region map's Region key only accepts string buckets (Top values and Filters), and gauges have no bucket dimension.

Snippet consolidation

  • Merged the Top values primary/secondary snippet pair into a single snippet (the legacy default now states the real first-vs-additional-dimension rule rather than approximating it across two files).
  • Pointed the area chart vertical axis at the shared lens-value-advanced-settings.md snippet and removed the area-only variant, which was an incomplete duplicate of the same XY metric options.

Resolves

Closes #4773


AI-generated draft — created with Claude Opus 4.8.
Review all generated content for factual accuracy before merging.

Single-source the bucket dimension "Data" settings (Top values, Date
histogram, Intervals, Filters, and Collapse by) shared across Lens chart
types into reusable snippets, and bring each page up to standard against
the Kibana source:

- Add bucket-function snippets and a Collapse by snippet under
  explore-analyze/_snippets/.
- Rewire pie, waffle, treemap, mosaic, heat map, tag cloud, table, bar,
  line, area, and metric pages to include them.
- Add the Filters function to heat map axes and the full function set to
  the metric breakdown, which were missing.
- Place Collapse by once per dimension and only where the UI exposes it
  (partition dimensions, XY/metric breakdown, table rows).
- Neutralize partition-specific wording in the shared advanced-settings
  snippet so it reads correctly on every chart type.

Co-authored-by: Cursor <cursoragent@cursor.com>
@github-actions

Copy link
Copy Markdown
Contributor

Elastic Docs AI PR menu

Check the box to run an AI review for this pull request.

  • Review docs changes (docs-review). Status: not started.

Powered by GitHub Agentic Workflows and docs-actions. For more information, reach out to the docs team.

@github-actions

Copy link
Copy Markdown
Contributor

✅ Elastic Docs Style Checker (Vale)

No issues found on modified lines!


The Vale linter checks documentation changes against the Elastic Docs style guide. To use Vale locally or report issues, refer to Elastic style guide for Vale.

Reduce the number of near-identical snippets:

- Merge lens-bucket-top-values and its -secondary variant into one
  snippet. The legacy (9.0-9.3) default now states the real rule
  ("5 for the first dimension and 3 for each additional dimension")
  instead of approximating it across two files.
- Point area chart vertical-axis settings at the shared
  lens-value-advanced-settings snippet (verified the XY metric options
  against Kibana) and remove the redundant area-only variant, which was
  an incomplete duplicate.

Co-authored-by: Cursor <cursoragent@cursor.com>
)

Rarity is available for single-field terms on any field except
floating-point numeric types, not "non-numeric fields" as previously
stated. Align the setting name with the UI ("Max doc count per term").

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unify chart settings into snippets for proper single-sourcing

1 participant