Skip to content

Commit 3842757

Browse files
committed
Support extra scale bands and docs fixes
Add two intermediate scale bands (small, large) and map them to the three displayed tiers so highlights resolve correctly (ScaleAwarePage). Remove an unused chartFrame style from the scale-aware suggestions blog and update links/paths in the release blog entry. Clarify API name in chartCapabilityTypes comment (suggestChartsGrouped), add a missing sample array in dataScaleProfile tests, and update dataScaleProfile's comment to note that per-chart minBand/maxBand can hard-filter as well as affect ranking.
1 parent 956bda4 commit 3842757

6 files changed

Lines changed: 20 additions & 20 deletions

File tree

docs/src/blog/entries/release-3-6-0.js

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,12 @@ function Body() {
88
<p>
99
3.6.0 is the AI release. The library has carried{" "}
1010
<Link to="/intelligence/observation-hooks">observation hooks</Link>,{" "}
11-
<Link to="/charts/annotations">native annotations</Link>, and a{" "}
12-
<Link to="/features/server-side-rendering">streaming-first runtime</Link> for a while; this
13-
version turns those pieces into an explicit AI-facing surface. Charts now declare what
14-
they're for, datasets get profiled and ranked, audiences get calibrated, and conversations
15-
anchor back onto the chart instead of stopping at a chat bubble. Three case-study posts
16-
published alongside this release walk through what that makes possible. Full release notes
17-
are on{" "}
11+
<Link to="/features/annotations">native annotations</Link>, and a{" "}
12+
<Link to="/features/push-api">streaming-first runtime</Link> for a while; this version turns
13+
those pieces into an explicit AI-facing surface. Charts now declare what they're for,
14+
datasets get profiled and ranked, audiences get calibrated, and conversations anchor back
15+
onto the chart instead of stopping at a chat bubble. Three case-study posts published
16+
alongside this release walk through what that makes possible. Full release notes are on{" "}
1817
<a
1918
href="https://github.com/nteract/semiotic/blob/main/CHANGELOG.md#360---2026-05-31"
2019
target="_blank"

docs/src/blog/entries/scale-aware-suggestions.js

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,6 @@ import {
1010

1111
// ─── Shared styling ────────────────────────────────────────────────────────
1212

13-
const chartFrame = {
14-
background: "var(--surface-1)",
15-
borderRadius: 8,
16-
padding: 16,
17-
border: "1px solid var(--surface-3)",
18-
overflow: "hidden",
19-
margin: "20px 0",
20-
}
21-
2213
const sideBySide = {
2314
display: "grid",
2415
gridTemplateColumns: "repeat(3, minmax(0, 1fr))",

docs/src/pages/features/ScaleAwarePage.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,18 @@ const BANDS = ["tiny", "medium", "huge"]
5454

5555
const BAND_LABEL = {
5656
tiny: "Tiny (≤3)",
57+
small: "Small (~15)",
5758
medium: "Medium (~140)",
59+
large: "Large (~1k)",
5860
huge: "Huge (>5k)",
5961
}
6062

63+
// effectiveBand can be any of the five ScaleBand values, but only three tiers
64+
// are displayed. Map the in-between bands to the nearest displayed tier so the
65+
// highlight still resolves.
66+
const toDisplayedBand = (band) =>
67+
band === "small" ? "tiny" : band === "large" ? "huge" : band
68+
6169
const DATASETS = {
6270
layered: {
6371
label: "Categories × Categories × Value",
@@ -305,7 +313,7 @@ function ScaleAwareDemo() {
305313
key={band}
306314
band={band}
307315
suggestion={grouped[band][0]}
308-
highlighted={effectiveBand === band}
316+
highlighted={toDisplayedBand(effectiveBand) === band}
309317
/>
310318
))}
311319
</div>

src/components/ai/chartCapabilityTypes.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ export interface Suggestion {
267267

268268
/**
269269
* Multi-tier grouping of suggestions by scale band. Returned by
270-
* `suggestCharts` when `groupByScale: true` is passed.
270+
* `suggestChartsGrouped()`.
271271
*
272272
* Each tier is a ranked list of suggestions whose `scaleRange.band` falls in
273273
* that tier. A single chart can appear in multiple tiers when its sweet-spot

src/components/ai/dataScaleProfile.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ function makeProfile(overrides: Partial<ChartDataProfile> = {}): ChartDataProfil
3737
return {
3838
rowCount: 50,
3939
fields: { x: { type: "numeric", min: 0, max: 100, distinctCount: 50 } as never },
40+
sample: [],
4041
data: [],
4142
candidates: { x: [], y: [], size: [], category: [], series: [], time: [] },
4243
primary: { x: "x", y: "y" },

src/components/ai/dataScaleProfile.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@
1515
* + qualityBias(quality, capability, profile)
1616
* + audienceBias(audience, capability)
1717
*
18-
* Each layer can be omitted independently. None of them gate the suggestion;
19-
* `fits()` is still the only hard reject.
18+
* Each layer can be omitted independently. Most adjust ranking only, but
19+
* per-chart scale preferences can also hard-filter via `minBand`/`maxBand`
20+
* exclusions in addition to `fits()`.
2021
*/
2122

2223
import type { ChartCapability, ChartDataProfile } from "./chartCapabilityTypes"

0 commit comments

Comments
 (0)