Files
astrolabe/src/main.tsx
T
oleh efb5a9bbe0 Data inspector: input/resolved rows below the chart, with a resizable divider
A collapsible Data panel under the Live Preview and Chart Builder charts shows the rows the chart actually uses, switching between Input (parsed source) and Resolved (post-transform) views read from the live Vega view. Collapsed by default; the open-state and a draggable height divider persist.

Rows come through a new RenderHandle.inspectData() accessor, so no component touches the view: core/result-data picks the most-upstream source and most-downstream result from the compiled dataflow, read lazily. The divider reuses the window-splitter pattern (horizontal variant).

Consolidations: a shared DataTable primitive replaces the inspector's and the builder's duplicate read-only tables; useResizeDrag merges the col/row drag-gesture twins.

Docs: spec 04/06 and arch 05/10 updated; the now-shipped exploration memo removed.
2026-06-18 02:22:03 +03:00

66 lines
2.5 KiB
TypeScript

import { createRoot } from 'react-dom/client';
import { App } from './app/App';
import { initPanes, wirePanes } from './app/orchestration/panes';
import {
initChartTheme,
initDataInspectorHeight,
initDataInspectorOpen,
initPreviewFitMode,
wireChartTheme,
wireDataInspectorHeight,
wireDataInspectorOpen,
wirePreviewFitMode,
} from './app/orchestration/preferences';
import { initSettings, wireSettings } from './app/orchestration/settings';
import { initSnippetSort, wireSnippetSort } from './app/orchestration/snippet-sort';
import { initPersistentStorage, registerServiceWorker } from './app/orchestration/pwa';
import { initApp } from './app/orchestration/startup';
import { initTheme, wireTheme } from './app/orchestration/theme';
import '../styles/base.css';
// Self-hosted chart-font roster (Theme Builder font control). Separate from the
// UI font in base.css; only its latin subsets are precached (see chart-fonts.css).
import '../styles/chart-fonts.css';
// Hydrate the persisted theme onto <html data-theme> before first paint (no
// FOUC), then keep store ↔ DOM ↔ localStorage in sync. Store stays DOM-free;
// all browser access funnels through the orchestration + adapter.
initTheme();
wireTheme();
// Hydrate + persist the small UI preferences (preview fit mode, chart theme,
// pane widths) the same way. Pane widths hydrate before render so the layout
// opens as left.
initPreviewFitMode();
wirePreviewFitMode();
initChartTheme();
wireChartTheme();
initDataInspectorOpen();
wireDataInspectorOpen();
initDataInspectorHeight();
wireDataInspectorHeight();
initPanes();
wirePanes();
// Hydrate + persist the library sort (spec §02 → Sort) so the list opens ordered
// the way the user left it. Hydrate before render; persist on change.
initSnippetSort();
wireSnippetSort();
// Hydrate + persist the full UserSettings record (editor / performance /
// formatting) before render, so the editor, preview, and library read the user's
// settings from the first paint (spec §07 → Startup load).
initSettings();
wireSettings();
// Load the library from IndexedDB (seeding a sample on first run) and wire
// persistence. Fire-and-forget: the UI renders immediately and fills in when
// hydration resolves.
void initApp();
// PWA: register the service worker (prompt the user to reload on an update) and
// request persistent storage so the local-first workspace isn't evicted (web.dev).
registerServiceWorker();
initPersistentStorage();
createRoot(document.getElementById('app')!).render(<App />);