feat(org-chart): add core cards and fixed-layout integration
This commit is contained in:
1 parent
d18e3c3380
commit
61c6f8d1f1
161 files changed
+13044
-1
No files matched your search
@@ -0,0 +1,15 @@
|
||||
export async function startP1(api, inlineFixture) {
|
||||
const data = inlineFixture ?? await new api.JsonOrgChartDataSource('./data-p1.json').load();
|
||||
const stylesheetUrls = {
|
||||
engine: new URL('./assets/engine.css', location.href).href,
|
||||
core: new URL('./assets/style.css', location.href).href,
|
||||
};
|
||||
// ?mode=readOnly shows the view-only Workdesk composition; the default stays interactive.
|
||||
const displayMode = new URLSearchParams(location.search).get('mode') === 'readOnly' ? 'readOnly' : 'interactive';
|
||||
document.documentElement.dataset.orgchartMode = displayMode;
|
||||
const chart = api.createOrgChart({ container: document.getElementById('chart-host'), dataSource: new api.JsonOrgChartDataSource(data), stylesheetUrls, displayMode });
|
||||
// Development inspection seam: public Core API only. No engine internals.
|
||||
window.OrgChartP1 = { api, data, chart, stylesheetUrls, setData: next => chart.update(next) };
|
||||
window.addEventListener('pagehide', () => chart.destroy(), { once: true });
|
||||
await chart.mount();
|
||||
}
|
||||
Reference in new issue
Block a user