Skip to content
Merged

Dev #176

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
86b06f5
Title wrap: fullest lines with no widow, plus a comparison page
xavier-shaw Oct 22, 2026
b85167b
feat(mcp): validate and show report only what to act on
xavier-shaw Oct 22, 2026
081e989
fix(table): only the rows scroll, the table draws its theme's furnitu…
xavier-shaw Oct 22, 2026
ff18201
fix some layout issue
Chenglong-MS Oct 24, 2026
0f4bf56
merge
Chenglong-MS Oct 24, 2026
efaa93a
add navigator and fix talk slides
xavier-shaw Oct 26, 2026
522beec
updates
Chenglong-MS Oct 29, 2026
c82b22b
layout algorithm update
Chenglong-MS Oct 29, 2026
204c868
updates
Chenglong-MS Oct 29, 2026
0c1e76b
Merge branch 'dev' of github.com:microsoft/flint-chart into dev
Chenglong-MS Oct 29, 2026
7cc2b3a
fixes
Chenglong-MS Oct 30, 2026
9db520a
fix(site): keep the page scrolling under embedded MCP cards
xavier-shaw Oct 30, 2026
aad6b2d
bug fixes
Chenglong-MS Nov 1, 2026
91d2241
fixes
Chenglong-MS Nov 1, 2026
583b3af
fix(layout): hold a Vega-Lite drawing within its canvasSize
Chenglong-MS Nov 1, 2026
0f56073
test(vegalite): compile value-sorted bars at every size under every h…
Chenglong-MS Nov 1, 2026
f7be0d2
fix(interactive): shape filtered rows as the chart's data was shaped
Chenglong-MS Nov 1, 2026
fe074e6
layout fixes, binning color etc
Chenglong-MS Nov 3, 2026
8dab45b
1.0.2
Chenglong-MS Nov 7, 2026
450f4a9
annotation, layout, maps
Chenglong-MS Nov 9, 2026
b772b03
ok
Chenglong-MS Nov 9, 2026
b448bec
fixes and talk
Chenglong-MS Nov 10, 2026
d72d808
fix interaction, annotation, box overflow, and tooltip issues
Chenglong-MS Nov 14, 2026
20a6c7d
Roll compact numbers over to the next unit when rounding reaches 1000…
Chenglong-MS Nov 14, 2026
196f987
updates dev and fixes
Chenglong-MS Nov 15, 2026
98dbe1c
perf(js): lazily discover fields for encoding sort repair (#168)
spboyer Nov 15, 2026
e38235a
perf(python): reduce temporal conversion column allocations (#169)
spboyer Nov 15, 2026
3f77c4b
perf(python): avoid preliminary full semantics pass (#170)
spboyer Nov 15, 2026
e4f3cd2
perf: add reproducible compiler and MCP render baselines (#171)
spboyer Nov 15, 2026
6086e0f
perf: index explicit overflow order membership (#167)
spboyer Nov 15, 2026
6bfa56b
slides update
Chenglong-MS Nov 15, 2026
0dda596
prep release
Chenglong-MS Nov 16, 2026
80204ec
updates
Chenglong-MS Nov 16, 2026
7452b07
fix
Chenglong-MS Nov 16, 2026
7114f73
Fix out-of-memory flint-js build and flaky hull timing test (#175)
Chenglong-MS Nov 16, 2026
95bb289
Merge main into dev (record the 1.1 release squash; dev's content kept)
Chenglong-MS Nov 16, 2026
43f3ae6
test: time the enclosure cost suite by median, with CI-sized budgets
Chenglong-MS Nov 16, 2026
5073159
update tests to avoid CI failure
Chenglong-MS Nov 16, 2026
3d18cbd
test: steady the placement, hull and tween tests under load
Chenglong-MS Nov 16, 2026
8f0129d
site: add Flint 1.1 to the landing updates
Chenglong-MS Nov 16, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/flint-js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@
"LICENSE"
],
"scripts": {
"build": "tsup",
"build": "tsup && tsup --dts-only",
"dev": "tsup --watch",
"typecheck": "tsc --noEmit && tsc --noEmit -p tsconfig.test.json",
"test": "vitest run",
Expand Down
6 changes: 3 additions & 3 deletions packages/flint-js/tests/annotation-placement.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,16 +169,16 @@ describe('a note on one mark', () => {
it('places among thousands of marks in milliseconds', () => {
const obstacles = Array.from({ length: 4000 }, (_, i) => asObstacle(dot((i * 37) % 400, (i * 91) % 300, 3)));
// The median of runs after a warm-up, so the JIT's first pass and a busy runner's stalls do not
// count. About 8 ms on a laptop and roughly twice that on a CI runner: the bound catches placement
// slowing several times over, not a slower machine.
// count. About 9 ms on a laptop, and four to five times that on a loaded CI runner: the bound,
// about ten times a laptop's, catches placement slowing many times over, not a slower machine.
const place = () => placeNote({ target: dot(200, 150), label: LABEL, plot: PLOT, canvas: CANVAS, obstacles });
place();
const runs = Array.from({ length: 21 }, () => {
const started = performance.now();
place();
return performance.now() - started;
}).sort((a, b) => a - b);
expect(runs[10]).toBeLessThan(40);
expect(runs[10]).toBeLessThan(90);
});
});

Expand Down
29 changes: 18 additions & 11 deletions packages/flint-js/tests/annotation-region-enclosure.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,11 +188,17 @@ describe('annotation colours', () => {
});

describe('cost', () => {
const time = (run: () => void, repeat = 10) => {
// The median of runs after a warm-up, so the JIT's first pass and a busy runner's stalls do not
// count. Each bound is about ten times a laptop's median: a shared CI runner, running other test
// files at once, is four to five times slower, and a quadratic slip is a hundred times slower.
const time = (run: () => void, repeat = 11) => {
run();
const started = performance.now();
for (let index = 0; index < repeat; index++) run();
return (performance.now() - started) / repeat;
const runs = Array.from({ length: repeat }, () => {
const started = performance.now();
run();
return performance.now() - started;
}).sort((a, b) => a - b);
return runs[Math.floor(repeat / 2)];
};
const cloud = (count: number) => Array.from({ length: count }, (_, index) => dot((index * 37) % 400, (index * 91) % 300, 3));
const obstacles = (count: number): NoteObstacle[] => cloud(count).map((mark) => ({ kind: 'mark', box: mark.box }));
Expand All @@ -203,16 +209,16 @@ describe('cost', () => {
const outline = enclosureOutline(marks, 'hull', PLOT)!;
placeEnclosureCaption({ outlines: [outline], layouts: [LAYOUT, { lines: ['Recession', 'era'], width: 40, height: 32 }], plot: PLOT, canvas: CANVAS, obstacles: ink });
});
expect(ms).toBeLessThan(40);
expect(ms).toBeLessThan(80);
});
it('fits an ellipse round 5,000 points and outlines 20 groups quickly', () => {
const marks = cloud(5_000);
expect(time(() => enclosureOutline(marks, 'ellipse', PLOT))).toBeLessThan(40);
expect(time(() => enclosureOutline(marks, 'ellipse', PLOT))).toBeLessThan(100);
const groups = Array.from({ length: 20 }, (_, index) => cloud(250).map((mark) => ({ ...mark, box: { ...mark.box, x: mark.box.x / 20 + index * 20 } })));
expect(time(() => {
const outlines = groups.map((group) => enclosureOutline(group, 'hull', PLOT)!);
placeEnclosureCaption({ outlines, layouts: [LAYOUT], plot: PLOT, canvas: CANVAS, connect: 'all', obstacles: obstacles(5_000) });
})).toBeLessThan(60);
})).toBeLessThan(100);
});
it('seats a region caption among 20,000 marks and lines quickly', () => {
const ink = obstacles(20_000);
Expand All @@ -222,10 +228,11 @@ describe('cost', () => {
expect(time(() => {
placeRegionCaption({ region, axes: { x: true, y: true }, layouts: [LAYOUT], plot: PLOT, canvas: CANVAS, obstacles: ink, segments });
placeRegionCaption({ region: { x: 100, y: 0, width: 80, height: 300 }, axes: { x: true, y: false }, layouts: [LAYOUT], plot: PLOT, canvas: CANVAS, obstacles: ink, segments, vertices });
})).toBeLessThan(60);
})).toBeLessThan(150);
});
it('keeps a convex hull of a million points under a second', () => {
const points = Array.from({ length: 1_000_000 }, (_, index) => ({ x: (index * 7919) % 1000, y: (index * 104729) % 777 }));
expect(time(() => convexHull(points), 1)).toBeLessThan(1_000);
// About 70 ms on a laptop; a quadratic hull would take minutes.
it('hulls 200,000 points quickly', () => {
const points = Array.from({ length: 200_000 }, (_, index) => ({ x: (index * 7919) % 1000, y: (index * 104729) % 777 }));
expect(time(() => convexHull(points), 5)).toBeLessThan(750);
});
});
16 changes: 12 additions & 4 deletions packages/flint-js/tests/semantic-interactions.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, expect, it } from 'vitest';
import { describe, expect, it, onTestFinished, vi } from 'vitest';
import { changeset, parse, View, type GroupMark } from 'vega';
import { expressionInterpreter } from 'vega-interpreter';
import { compile } from 'vega-lite';
Expand Down Expand Up @@ -1202,6 +1202,14 @@ describe('Vega-Lite semantic interactions', () => {
factor: 4, anchor: { x: 0.25, y: 0.5 },
}, guard)!;

// The tween's frames run on a fake clock, so how many it draws does not hang on the machine's load.
vi.useFakeTimers({ toFake: ['setTimeout', 'clearTimeout', 'performance'] });
onTestFinished(() => { vi.useRealTimers(); });
const settle = async () => {
const done = controller.settled!();
await vi.advanceTimersByTimeAsync(1_000);
await done;
};
// The tween starts on the domain on screen; nothing lands before the first frame.
const phases: string[] = [];
expect(controller.apply(zoom, { transition: { duration: 60, onFrame: (phase) => phases.push(phase) } })).toBe(true);
Expand All @@ -1212,7 +1220,7 @@ describe('Vega-Lite semantic interactions', () => {
expect(controller.apply(zoom)).toBe(true);
await view.runAsync();
expect(view.scale('x').domain().map(Number)).toEqual(initial);
await controller.settled!();
await settle();
const landed: number[] = view.scale('x').domain().map(Number);
const target = zoom.value.x!.map(Number);
landed.forEach((value, index) => expect(value).toBeCloseTo(target[index], 6));
Expand All @@ -1233,7 +1241,7 @@ describe('Vega-Lite semantic interactions', () => {
},
},
});
await controller.settled!();
await settle();
expect(new Set(operations)).toEqual(new Set(['reset']));
expect(view.scale('x').domain().map(Number)).toEqual(initial);
expect(spans.some((span) => span > target[1] - target[0] && span < initial[1] - initial[0])).toBe(true);
Expand All @@ -1242,7 +1250,7 @@ describe('Vega-Lite semantic interactions', () => {
const cancelled: string[] = [];
controller.apply(zoom, { transition: { duration: 500, onFrame: (phase) => cancelled.push(phase) } });
controller.apply({ op: 'set-viewport', axes: 'x', value: {} });
await controller.settled!();
await settle();
await view.runAsync();
expect(view.scale('x').domain().map(Number)).toEqual(initial);
expect(cancelled).not.toContain('commit');
Expand Down
18 changes: 14 additions & 4 deletions packages/flint-js/tsup.config.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { defineConfig } from 'tsup';
import { defineConfig, type Options } from 'tsup';

/** The boundaries the renderers import on a map's first draw: one ES module each, split off by the host's bundler. */
const LAZY_TOPOLOGIES = ['world-bank-coarse', 'world-bank-medium', 'world-110m', 'states-10m', 'counties-albers-10m'];

export default defineConfig([{
const library: Options = {
entry: {
index: 'src/index.ts',
'core/index': 'src/core/index.ts',
Expand Down Expand Up @@ -48,12 +48,22 @@ export default defineConfig([{
// The bundled boundaries, imported by the package's own name (see src/vegalite/boundary-loader.ts).
/^flint-chart\/geo\/lazy\//,
],
}, {
};

const lazyGeo: Options = {
entry: Object.fromEntries(LAZY_TOPOLOGIES.map((name) => [`geo/lazy/${name}`, `src/geo/lazy/${name}.js`])),
format: ['esm'],
dts: false,
sourcemap: false,
clean: false,
splitting: false,
target: 'es2020',
}]);
};

// tsup runs the ESM, CJS and declaration builds at once, and together they outgrow an 8 GB build
// agent. `npm run build` runs the bundles first, then `tsup --dts-only` for the declarations.
export default defineConfig((cli) => {
if (cli.watch) return [library, lazyGeo];
if (typeof cli.dts === 'object' && cli.dts.only) return { ...library, clean: false };
return [{ ...library, dts: false }, lazyGeo];
});
5 changes: 5 additions & 0 deletions site/src/i18n/messages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,11 @@
"title": "Updates",
"video": "Video",
"watchVideo": "Watch the Flint 1.0 demo video on YouTube",
"release110": {
"date": "November 16, 2026",
"dateTime": "2026-11-16",
"text": "Flint 1.1 brings maps (custom boundaries, globes, routes and labels) and sturdier layouts across every backend."
},
"release100": {
"date": "October 19, 2026",
"dateTime": "2026-10-19",
Expand Down
5 changes: 5 additions & 0 deletions site/src/i18n/messages/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,11 @@
"title": "更新",
"video": "视频",
"watchVideo": "在 YouTube 观看 Flint 1.0 演示视频",
"release110": {
"date": "2026 年 11 月 16 日",
"dateTime": "2026-11-16",
"text": "Flint 1.1 带来地图(自定义边界、地球仪、路线与标签),并让各后端的布局更稳健。"
},
"release100": {
"date": "2026 年 10 月 19 日",
"dateTime": "2026-10-19",
Expand Down
3 changes: 2 additions & 1 deletion site/src/routes/Landing.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -191,9 +191,10 @@ export function Landing() {
<h2 style={newsHeadingStyle}>{t('landing.news.title')}</h2>
<div style={newsListStyle}>
{([
{ key: 'release110', href: `${GITHUB_REPO}/releases/tag/1.1`, linkLabel: 'v1.1' },
{ key: 'release100', to: '/interactions', linkLabel: 'Interactive', video: 'https://youtu.be/JAJy7ToczMs' },
{ key: 'release051', href: `${GITHUB_REPO}/blob/main/CHANGELOG.md`, linkLabel: 'Changelog' },
{ key: 'release050', href: `${GITHUB_REPO}/releases/tag/0.5.0`, linkLabel: 'v0.5.0' },
{ key: 'release050', href: `${GITHUB_REPO}/releases/tag/0.5`, linkLabel: 'v0.5.0' },
] as { key: string; href?: string; to?: string; linkLabel: string; video?: string }[]).map((update) => (
<article className="landing-news-item" style={newsItemStyle} key={update.key}>
<time style={newsDateStyle} dateTime={t(`landing.news.${update.key}.dateTime`)}>
Expand Down
Loading