Files
shkim4 d56d587fd2 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.
2026-10-13 18:41:14 +09:00

21 lines
990 B
TypeScript

import { StrictMode, useMemo } from 'react';
import { createRoot } from 'react-dom/client';
import { OrgChart } from '@hm-design/org-chart-react/hm-dialog';
import { 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 './hm-theme.css';
import './chart-only.css';
const { data, layout } = readQuery();
const stylesheetUrls = { engine: engineUrl, core: coreUrl };
function ChartOnlyPage() {
const dataSource = useMemo(() => new JsonOrgChartDataSource(datasets[data]!()), []);
return <OrgChart dataSource={dataSource} stylesheetUrls={stylesheetUrls} displayMode="readOnly" layoutMode="auto"
autoLayout={{ type: layout }} presentationMode="chart-only" employeePopup="hm-dialog" style={{ height: '100%' }} />;
}
createRoot(document.getElementById('chart')!).render(<StrictMode><ChartOnlyPage /></StrictMode>);