feat(orgchart): integrate chart-only viewport and scoped guard fixes

Add initial fit and direct wheel zoom with preserved default presentation. Integrate five scoped GuardFix findings and AI generation preselection policy. Exclude Cell experiments and retain five historical guard failures.
This commit is contained in:
shkim4 committed 2026-10-13 18:41:14 +09:00
1 parent 0a8daf7ee7
commit d56d587fd2
28 files changed
+1170 -77

No files matched your search

+23
View File
@@ -0,0 +1,23 @@
import { createOrgChart, JsonOrgChartDataSource } from '@hm-design/org-chart';
import engineUrl from '@hm-design/org-chart/engine.css?url';
import coreUrl from '@hm-design/org-chart/style.css?url';
import { datasets, readQuery } from './data';
import './chart-only.css';
const { data, layout, embed } = readQuery();
if (embed) document.body.classList.add('embed');
const chart = createOrgChart({
container: document.getElementById('chart')!,
dataSource: new JsonOrgChartDataSource(datasets[data]!()),
stylesheetUrls: { engine: engineUrl, core: coreUrl },
displayMode: 'readOnly',
layoutMode: 'auto',
autoLayout: { type: layout },
// Chart Only implies initialView "fit" and wheelZoom "direct".
presentationMode: 'chart-only',
// Regression fixture: Fit below the manual zoom floor, without huge data.
zoom: new URLSearchParams(location.search).has('verify-min') ? { min: 0.8 } : undefined,
});
void chart.mount();
// Verification seam only: replace the whole dataset through the public handle.
Object.assign(window, { orgChart: chart, replaceData: (key: string) => chart.update(datasets[key]!()) });