Skip to content

docs: describe how the best-fit chart type is recommended - #11567

Open
igorlukanin wants to merge 2 commits into
masterfrom
igor/cub-3820-document-chart-type-recommendation
Open

docs: describe how the best-fit chart type is recommended#11567
igorlukanin wants to merge 2 commits into
masterfrom
igor/cub-3820-document-chart-type-recommendation

Conversation

@igorlukanin

Copy link
Copy Markdown
Member

Summary

The chart picker now suggests one best-fit chart type for the current query, and applies a high-confidence one on a report that has no chart yet. Nothing described how it decides, so this documents the conditions in business-user language on the existing Chart types overview.

Covers what the recommendation reads, the ordered conditions, when it deliberately stays quiet, and the higher bar that automatic application clears.

Thresholds are cited to Draco (Moritz et al., Formalizing Visualization Design Knowledge as Constraints, IEEE VIS 2018). The two numbers that are Cube's own rather than Draco's — the 16-character mean label length and the 5,000-row cap — are marked as ours.

Test plan

  • Prose reviewed against the shipped rule table, not the plan — the conditions, the suppression cases and the auto-apply set match the implementation
  • Draco citation and its IEEE document ID verified
  • No new navigation entry needed; the section extends the existing overview page, which already frames choosing a type
  • Docs preview build must pass

@igorlukanin
igorlukanin requested a review from keydunov as a code owner August 15, 2026 05:13
@mintlify

mintlify Bot commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
cubed3 🟢 Ready View Preview Aug 15, 2026, 5:13 AM

💡 Tip: Enable Workflows to automatically generate PRs for you.

@claude

claude Bot commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

Claude finished @igorlukanin's task in 1m 57s —— View job


Docs review — 0 blocking, 3 medium, 4 low. Prose is clear and well-structured; main gaps are terminology (report), Bar/Pie rule ambiguity, and a contradiction with an existing page.

Full review
  • Read PR diff
  • Check for existing review threads (none)
  • Verify prose against implementation
  • Check Mintlify conventions / nav / links
  • Post review

Scope note

I could not verify the prose against the shipped rule table. The chart picker implementation is not in this repo — searching packages/ for the recommendation logic turns up only unrelated hits (maven.ts, env.ts, DevServer.ts). So the PR's first two test-plan boxes (conditions match implementation, Draco thresholds) are unverifiable from here and I've taken them on trust. Everything below is a docs-internal consistency and style review.

Conventions — clean

Body starts at H2, no stray H1, frontmatter untouched, internal links root-relative, and no docs.json change needed since the page already exists. Extending the overview rather than adding a page is the right call per docs-mintlify/CLAUDE.md.

Medium

1. Contradicts an existing page, with no cross-link. docs/explore-analyze/charts/index.mdx:16 says "Cube automatically picks a chart type when you run a new query" — flatly broader than what this PR documents (auto-apply only on an empty report, only for 5 of the types, never on a truncated result). Line 20 has the same problem ("let Cube re-select a chart type"). Both should be narrowed and linked to the new #recommended-chart-type anchor, otherwise a reader landing on the Charts page gets the old, wrong story.

Also worth one sentence distinguishing this from charts/index.mdx:24 — "let the agent auto-suggest the best chart for your query results." That's a different mechanism (AI agent, Vega-Lite output) with a near-identical description, and nothing tells the reader which one the Recommended outline comes from.

2. report is not a product term. Three uses (lines 28, 29, 80) of a noun absent from the taxonomy in docs-mintlify/CLAUDE.md and from every other page in charts/. Inline comment on line 28.

3. Bar vs. Pie looks unreachable. Under "first that matches", Pie's condition is a subset of Bar's. Inline comment on lines 60–62.

Low

4. Ordering contradiction between "checks these in order" and Table-as-disqualifier. Inline on lines 65–68.

5. Stacked bar / Horizontal bar presented as types, but they're Bar variants and absent from this page's own list. Inline on lines 58–61.

6. Unclear privacy claim on line 36. Inline comment.

7. Auto-apply internals (the 20% margin) document a tuning constant a user can't observe. Inline on lines 80–85.

Two smaller things, no inline comment

  • Say which types are never recommended. Area, Boxplot and HTML appear in the list at lines 8–18 but in neither the rule table nor the suppression list. One clause — "Area, boxplot and HTML are never recommended; pick them yourself" — closes the gap.
  • The Draco link is paywalled. ieeexplore.ieee.org/document/8440847 is correct, but the paper is open-access from the UW Interactive Data Lab. A reader who wants to check the 12/10/30 thresholds against the source will hit a login wall.
• [`igor/cub-3820-document-chart-type-recommendation`](https://github.com/cube-js/cube/tree/igor/cub-3820-document-chart-type-recommendation)

Comment thread docs-mintlify/docs/explore-analyze/charts/chart-types/index.mdx Outdated
Comment on lines +58 to +61
| **Stacked bar** | One measure split by two categories, the first up to 12 values and the second up to 10 |
| **Heatmap** | One measure split by two larger categories that fill enough of the grid to be worth drawing |
| **Bar** | One measure across a few categories with short labels |
| **Horizontal bar** | The same, where the labels are long or the categories too many for a vertical axis |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stacked bar and Horizontal bar are presented here as if they were chart types, but neither appears in this page's own list at lines 8–18 — they're variants of Bar (bar.mdx has ### Stacked and ### Horizontal). A reader scanning this table has nowhere to click and no way to map these names onto the type list at the top of the same page.

Suggest naming them as variants, e.g. "Bar (stacked)" / "Bar (horizontal)", and linking to Bar. Same applies to the prose on line 83.

Comment on lines +28 to +30
On a report that has no chart yet, a recommendation Cube is confident about is applied for you, and
the report names the rule it followed — for example, *Applied Line — a measure over time*. Anywhere
else the recommendation is only outlined, never applied.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"report" isn't a term in the product taxonomy in docs-mintlify/CLAUDE.md (Account → Deployment → Workbook → Tab → Dashboard builder → Widget; plus Dashboard), and it appears nowhere else in docs/explore-analyze/charts/. This PR introduces it as a new noun in three places (lines 28, 29, 80).

If the surface is a workbook tab, say "a tab with no chart yet"; if it's a dashboard widget, say widget. Whichever it is, the reader needs to know which UI this auto-apply behavior fires in — right now "report" reads as a fourth, undefined surface.

Comment on lines +65 to +68
Table's conditions are disqualifiers rather than a last preference: a query that meets any of them
has no chart encoding that reads well, so the table is the honest answer. Maps are the exception —
a map has no category axis to crowd, so a choropleth over 40 regions is normal rather than
unreadable.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This paragraph contradicts the table it follows. Line 50 says the conditions are checked "in order" with first match winning, and Table is listed last — but "disqualifiers rather than a last preference" means they're evaluated before the others, otherwise a 4-dimension query would match Bar or Stacked bar first and never reach Table.

Either move the Table row to the top of the table (and say the first row is a disqualifier gate), or drop the "in order" framing and describe the check as "disqualifiers first, then the ordered preferences."

Comment on lines +36 to +37
labels are, and how many rows came back. Nothing is sent anywhere and nothing is saved — the
suggestion lasts for the current session only.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Nothing is sent anywhere" reads as a privacy guarantee but the thing being described is derived from a result set that already came back from the server, so a reader can't tell what claim is being made — that the recommendation runs client-side? that no telemetry is emitted? Suggest saying the specific thing ("the recommendation is computed in your browser and isn't persisted"), or dropping the sentence: nobody asked, and an unclear privacy claim is worse than none.

Comment on lines +80 to +85
Automatic application on an empty report clears a higher bar than the outline does. It happens only
for Map, KPI, Line, Scatter and vertical Bar, only when no threshold sits within 20% of the observed
value — so a row either way would not change the answer — and never on a truncated result. Stacked
bar, heatmap, horizontal bar and pie are offered but never applied for you: stacking asserts that
the parts compose the whole, which Cube cannot verify from a filtered result, and the others turn on
a judgment of Cube's own.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This paragraph is the section's highest-maintenance content and its lowest reader value. "No threshold sits within 20% of the observed value" is an internal confidence heuristic — a business user can't act on it, can't observe it, and it will silently go stale the first time the margin is retuned. The closing rationale ("stacking asserts that the parts compose the whole… the others turn on a judgment of Cube's own") is design justification, not usage guidance.

docs-mintlify/CLAUDE.md asks for the shortest version that answers "how do I use this?" I'd keep the actionable half — auto-apply happens only for Map, KPI, Line, Scatter and vertical Bar, only on a confident match, and never on a truncated result — and cut the rest. Same instinct applies to line 45's "tuned by us": documenting exact tuned constants invites drift between the page and the rule table.

@claude

claude Bot commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

Claude finished @igorlukanin's task in 1m 16s —— View job


Re-review of the new commit — 0 blocking, 2 medium, 3 low. The Pie fix lands cleanly; four prior threads still apply, and the new Pie paragraph is longer than the behavior it describes.

Full review
  • Read incremental diff (263cc2c)
  • Check existing review threads
  • Resolve stale threads of my own
  • Re-verify against docs conventions
  • Post review

What changed in 263cc2c

Dropping the Pie row is the right fix for the unreachability problem I raised — its condition really was a subset of Bar's under "first that matches". Removing the region-match clause from Map and the "choropleth over 40 regions" example also removes a rule that couldn't fire. I've resolved that thread.

Same scope caveat as before: the chart-picker implementation isn't in this repo, so "these rules don't fire" is taken on trust — this remains a docs-internal consistency review.

Medium

1. Qualitative rows in a numeric table (lines 59–61) — the surviving half of the resolved thread, re-posted narrowly. Bar / Horizontal bar / Heatmap are the only rows without numbers, in a table that otherwise cites 12 / 10 / 30 / 5,000, and directly after a section that defines 12 and 16 exactly. Heatmap's "fill enough of the grid to be worth drawing" gives the reader no way to predict when it beats Stacked bar.

2. Auto-apply internals (lines 83–88) — re-raised on the rewritten paragraph; my earlier thread went outdated when Pie left the list, but the 20% margin and the design rationale are unchanged.

Low

3. The Pie paragraph is three sentences for a non-behavior (lines 64–66). "Pie is not recommended — a bar chart compares the same values more accurately, so Cube suggests Bar instead. Pie remains selectable." says all of it. The current version also imports the comparative-accuracy argument, which is design justification of the kind docs-mintlify/CLAUDE.md asks you to trim.

4. "Maps are the exception" now reads oddly (lines 69–71). With Map reduced to a lat/long test and checked first, it wins before any disqualifier is reached — so the caveat is defending against a case the ordering already prevents. If the point is that the 30-value and 5,000-row limits don't apply to maps, say that.

5. Still unaddressed from the first pass (no new comments posted — the threads are open):

  • report is not in the product taxonomy (lines 28, 29, 83)
  • Stacked bar / Horizontal bar presented as types rather than Bar variants
  • "in order" vs. Table-as-disqualifier contradiction
  • "Nothing is sent anywhere" as an unclear privacy claim
  • docs/explore-analyze/charts/index.mdx:16 still says "Cube automatically picks a chart type when you run a new query", which this PR makes wrong, and line 24's agent auto-suggest is a different mechanism with a near-identical description.
  • Area, Boxplot and HTML appear in the type list but in neither the rule table nor the suppression list — one clause closes it.
• [`igor/cub-3820-document-chart-type-recommendation`](https://github.com/cube-js/cube/tree/igor/cub-3820-document-chart-type-recommendation)

Comment on lines +59 to +61
| **Heatmap** | One measure split by two larger categories that fill enough of the grid to be worth drawing |
| **Bar** | One measure across a few categories with short labels |
| **Horizontal bar** | The same, where the labels are long or the categories too many for a vertical axis |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dropping the Pie row resolves the unreachability problem, but the vagueness half of my earlier comment survives: these three rows are the only qualitative ones in a table that otherwise cites exact numbers (12 / 10 / 30 / 5,000), and the section above defines 12 and 16 precisely so the reader arrives expecting them.

  • "a few categories with short labels" — presumably ≤ 12 values and mean label < 16 characters, but the row doesn't say, and the reader has just been handed both numbers.
  • "the categories too many for a vertical axis" (line 61) — same number, unnamed.
  • "fill enough of the grid to be worth drawing" (line 59) — no stated criterion at all; a reader cannot predict when Heatmap wins over Stacked bar.

Naming the numbers here costs a few words and makes the table self-consistent.

Comment on lines +83 to +88
Automatic application on an empty report clears a higher bar than the outline does. It happens only
for Map, KPI, Line, Scatter and vertical Bar, only when no threshold sits within 20% of the observed
value — so a row either way would not change the answer — and never on a truncated result. Stacked
bar, heatmap and horizontal bar are offered but never applied for you: stacking asserts that the
parts compose the whole, which Cube cannot verify from a filtered result, and the others turn on a
judgment of Cube's own.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-raising on the rewritten paragraph (my earlier thread went outdated when Pie was dropped from the list, but the substance is unchanged).

"no threshold sits within 20% of the observed value" is an internal confidence constant — a business user can't observe it, can't act on it, and it goes stale the first time the margin is retuned. The closing rationale ("stacking asserts that the parts compose the whole… the others turn on a judgment of Cube's own") is design justification rather than usage guidance.

docs-mintlify/CLAUDE.md asks for the shortest version that answers "how do I use this?" The actionable half — auto-apply happens only for Map, KPI, Line, Scatter and vertical Bar, only on a confident match, never on a truncated result — is worth keeping; the rest I'd cut. Same instinct for "tuned by us" on line 45.

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.

1 participant