open-grid 1.2.0 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +376 -353
- package/README.md +1 -1
- package/dist/OpenGrid-B7m7ei7f.cjs +7385 -0
- package/dist/OpenGrid-CeUdO_fM.js +7398 -0
- package/dist/index-CeJ-0-80.cjs +260 -0
- package/dist/index-DnarQ4eR.js +266 -0
- package/dist/index-DrCPRuYi.js +548 -0
- package/dist/index-JjfWY3Bt.cjs +520 -0
- package/dist/open-grid-base.css +12 -1
- package/dist/open-grid-react.cjs +27 -1
- package/dist/open-grid-react.js +22 -82
- package/dist/open-grid-vue.cjs +31 -1
- package/dist/open-grid-vue.js +29 -79
- package/dist/open-grid.cjs +272 -6
- package/dist/open-grid.js +177 -266
- package/dist/types/bench/perf.d.ts +14 -8
- package/dist/types/core/AppearanceResolver.d.ts +98 -11
- package/dist/types/core/CFRenderBridge.d.ts +13 -0
- package/dist/types/core/CellEditManager.d.ts +73 -0
- package/dist/types/core/CellEventHandler.d.ts +99 -2
- package/dist/types/core/CellTypeRegistry.d.ts +24 -0
- package/dist/types/core/ChartManager.d.ts +51 -3
- package/dist/types/core/ColumnLayout.d.ts +100 -2
- package/dist/types/core/ContextMenu.d.ts +43 -2
- package/dist/types/core/CrossGridController.d.ts +86 -15
- package/dist/types/core/CrossGridMapper.d.ts +43 -5
- package/dist/types/core/CrossGridRegistry.d.ts +36 -2
- package/dist/types/core/DataLayer.d.ts +210 -15
- package/dist/types/core/DetailManager.d.ts +106 -15
- package/dist/types/core/DragVisuals.d.ts +33 -4
- package/dist/types/core/EventEmitter.d.ts +54 -0
- package/dist/types/core/ExportManager.d.ts +66 -1
- package/dist/types/core/ExtensionPointRegistry.d.ts +160 -14
- package/dist/types/core/FilterPanel.d.ts +17 -2
- package/dist/types/core/FilterSelect.d.ts +37 -13
- package/dist/types/core/FindBarManager.d.ts +26 -0
- package/dist/types/core/FlatRowModel.d.ts +54 -11
- package/dist/types/core/FooterManager.d.ts +53 -1
- package/dist/types/core/FormulaController.d.ts +139 -10
- package/dist/types/core/FormulaEngine.d.ts +15 -4
- package/dist/types/core/GridComposer.d.ts +54 -6
- package/dist/types/core/GridRenderer.d.ts +143 -10
- package/dist/types/core/GridShuttle.d.ts +44 -4
- package/dist/types/core/GroupEngine.d.ts +68 -10
- package/dist/types/core/GroupTreeManager.d.ts +86 -2
- package/dist/types/core/IconRegistry.d.ts +56 -9
- package/dist/types/core/KeyboardManager.d.ts +88 -4
- package/dist/types/core/MaskingEngine.d.ts +10 -9
- package/dist/types/core/MathUtils.d.ts +58 -5
- package/dist/types/core/MergeEngine.d.ts +45 -10
- package/dist/types/core/MutationService.d.ts +113 -10
- package/dist/types/core/OGDecimal.d.ts +144 -13
- package/dist/types/core/OpenGrid.d.ts +99 -0
- package/dist/types/core/OrgChart.d.ts +56 -1
- package/dist/types/core/OverrideKernel.d.ts +59 -15
- package/dist/types/core/Pagination.d.ts +38 -4
- package/dist/types/core/PivotEngine.d.ts +37 -0
- package/dist/types/core/RangeSelectionManager.d.ts +121 -7
- package/dist/types/core/RenderController.d.ts +56 -0
- package/dist/types/core/RowDragDrop.d.ts +52 -6
- package/dist/types/core/RowManager.d.ts +55 -0
- package/dist/types/core/SkinRegistry.d.ts +55 -15
- package/dist/types/core/SortFilterManager.d.ts +80 -1
- package/dist/types/core/TreeEngine.d.ts +60 -6
- package/dist/types/core/TriggerManager.d.ts +46 -0
- package/dist/types/core/VirtualScroll.d.ts +64 -0
- package/dist/types/core/WorksheetManager.d.ts +61 -2
- package/dist/types/core/XmlConverter.d.ts +56 -23
- package/dist/types/core/a11y/AccessibilityAdapter.d.ts +103 -0
- package/dist/types/core/a11y/AriaIntent.d.ts +34 -0
- package/dist/types/core/a11y/KeyboardInteractionModel.d.ts +64 -0
- package/dist/types/core/a11y/LiveRegionController.d.ts +89 -0
- package/dist/types/core/a11y/OverlayStack.d.ts +36 -0
- package/dist/types/core/a11y/VisualEquivRegistry.d.ts +37 -0
- package/dist/types/core/a11y/index.d.ts +13 -0
- package/dist/types/core/a11y/ports.d.ts +24 -0
- package/dist/types/core/appearance/Appearance.d.ts +68 -0
- package/dist/types/core/appearance/AppearanceAxis.d.ts +94 -0
- package/dist/types/core/appearance/AppearanceComposer.d.ts +45 -0
- package/dist/types/core/appearance/AppearanceProvider.d.ts +50 -0
- package/dist/types/core/appearance/AppearanceView.d.ts +51 -0
- package/dist/types/core/appearance/DensityRegistry.d.ts +36 -0
- package/dist/types/core/appearance/ResolvedAppearanceSnapshot.d.ts +84 -0
- package/dist/types/core/appearance/TextureRegistry.d.ts +32 -0
- package/dist/types/core/appearance/ThemeMetaRegistry.d.ts +67 -0
- package/dist/types/core/appearance/axisAdapters.d.ts +37 -0
- package/dist/types/core/appearance/defaults.d.ts +10 -0
- package/dist/types/core/appearance/index.d.ts +20 -0
- package/dist/types/core/appearance/tokenCatalog.d.ts +30 -0
- package/dist/types/core/cf/CFEngine.d.ts +56 -0
- package/dist/types/core/cf/CFEvaluator.d.ts +24 -0
- package/dist/types/core/cf/CFRule.d.ts +127 -0
- package/dist/types/core/cf/ColorScale.d.ts +49 -0
- package/dist/types/core/cf/InkResolver.d.ts +33 -0
- package/dist/types/core/cf/appearance.d.ts +20 -0
- package/dist/types/core/cf/encoders.d.ts +61 -0
- package/dist/types/core/cf/eval-types.d.ts +93 -0
- package/dist/types/core/cf/index.d.ts +21 -0
- package/dist/types/core/cf/lineage.d.ts +32 -0
- package/dist/types/core/cf/predicates.d.ts +27 -0
- package/dist/types/core/cf/serialize.d.ts +46 -0
- package/dist/types/core/chart/CanvasAdapter.d.ts +50 -1
- package/dist/types/core/chart/DataExtractor.d.ts +53 -12
- package/dist/types/core/chart/a11y.d.ts +22 -0
- package/dist/types/core/chart/chart-type-registry.d.ts +53 -0
- package/dist/types/core/chart/downsample-report.d.ts +36 -0
- package/dist/types/core/chart/downsample.d.ts +26 -1
- package/dist/types/core/chart/engine/ChartEngineRegistry.d.ts +52 -0
- package/dist/types/core/chart/geometry.d.ts +96 -0
- package/dist/types/core/chart/hittest.d.ts +21 -3
- package/dist/types/core/chart/palette.d.ts +96 -12
- package/dist/types/core/chart/parity.d.ts +12 -0
- package/dist/types/core/chart/provenance.d.ts +47 -0
- package/dist/types/core/chart/scales.d.ts +28 -1
- package/dist/types/core/chart/scene.d.ts +102 -0
- package/dist/types/core/chart/server.d.ts +36 -0
- package/dist/types/core/chart/surfaces/CanvasSurface.d.ts +48 -0
- package/dist/types/core/chart/surfaces/ServerRasterSurface.d.ts +26 -0
- package/dist/types/core/chart/surfaces/SvgSurface.d.ts +24 -0
- package/dist/types/core/chart/surfaces/pattern-overlay.d.ts +24 -0
- package/dist/types/core/chart/types.d.ts +107 -10
- package/dist/types/core/command/CommandBus.d.ts +51 -0
- package/dist/types/core/command/CommandRegistry.d.ts +43 -0
- package/dist/types/core/command/CommandStack.d.ts +38 -0
- package/dist/types/core/command/ICommand.d.ts +110 -0
- package/dist/types/core/command/commands/CellWriteCommand.d.ts +32 -0
- package/dist/types/core/command/commands/CompositeCommand.d.ts +17 -0
- package/dist/types/core/command/commands/RowCommands.d.ts +39 -0
- package/dist/types/core/command/index.d.ts +9 -0
- package/dist/types/core/command/support.d.ts +51 -0
- package/dist/types/core/coordinate/ColumnMetrics.d.ts +30 -0
- package/dist/types/core/coordinate/CoordinateKernel.d.ts +88 -0
- package/dist/types/core/coordinate/FrozenPanes.d.ts +29 -0
- package/dist/types/core/coordinate/MergeSourceAdapter.d.ts +18 -0
- package/dist/types/core/coordinate/NodeBudget.d.ts +33 -0
- package/dist/types/core/coordinate/ResizeGovernor.d.ts +50 -0
- package/dist/types/core/coordinate/RowMetrics.d.ts +37 -0
- package/dist/types/core/coordinate/ViewPermutation.d.ts +23 -0
- package/dist/types/core/coordinate/index.d.ts +10 -0
- package/dist/types/core/coordinate/ports.d.ts +45 -0
- package/dist/types/core/coordinate/types.d.ts +76 -0
- package/dist/types/core/detail/DetailGlyph.d.ts +42 -7
- package/dist/types/core/detail/DetailSplice.d.ts +42 -11
- package/dist/types/core/detail/DetailState.d.ts +80 -11
- package/dist/types/core/detail/SubgridCache.d.ts +72 -10
- package/dist/types/core/detail/index.d.ts +8 -0
- package/dist/types/core/domain/AggregateResult.d.ts +54 -0
- package/dist/types/core/domain/CellAddress.d.ts +61 -0
- package/dist/types/core/domain/CellValueAccess.d.ts +29 -0
- package/dist/types/core/domain/Delta.d.ts +37 -0
- package/dist/types/core/domain/DomainValue.d.ts +80 -0
- package/dist/types/core/domain/Missing.d.ts +65 -0
- package/dist/types/core/domain/Money.d.ts +42 -0
- package/dist/types/core/domain/NormalizationBasis.d.ts +47 -0
- package/dist/types/core/domain/Plain.d.ts +45 -0
- package/dist/types/core/domain/Quantity.d.ts +32 -0
- package/dist/types/core/domain/Ratios.d.ts +100 -0
- package/dist/types/core/domain/ThresholdSet.d.ts +46 -0
- package/dist/types/core/domain/ValueType.d.ts +71 -0
- package/dist/types/core/domain/rounding.d.ts +25 -0
- package/dist/types/core/domain/strategies.d.ts +38 -0
- package/dist/types/core/editors/CellEditor.d.ts +29 -2
- package/dist/types/core/editors/DateEditor.d.ts +18 -0
- package/dist/types/core/editors/SelectEditor.d.ts +29 -0
- package/dist/types/core/export/ChannelRegistry.d.ts +18 -0
- package/dist/types/core/export/ExportManifest.d.ts +13 -0
- package/dist/types/core/export/GridArtifactSource.d.ts +62 -0
- package/dist/types/core/export/Provenance.d.ts +34 -0
- package/dist/types/core/export/StreamPump.d.ts +28 -0
- package/dist/types/core/export/channels/CsvChannel.d.ts +20 -0
- package/dist/types/core/export/channels/JsonChannel.d.ts +18 -0
- package/dist/types/core/export/channels/XlsxChannel.d.ts +53 -0
- package/dist/types/core/export/channels/XmlChannel.d.ts +21 -0
- package/dist/types/core/export/channels/capabilities.d.ts +13 -0
- package/dist/types/core/export/index.d.ts +24 -0
- package/dist/types/core/export/print/OutputChannelAdapter.d.ts +61 -0
- package/dist/types/core/export/print/Paginator.d.ts +48 -0
- package/dist/types/core/export/print/PrintRenderTarget.d.ts +36 -0
- package/dist/types/core/export/sinks.d.ts +40 -0
- package/dist/types/core/export/types.d.ts +211 -0
- package/dist/types/core/extension/DeprecationManager.d.ts +42 -0
- package/dist/types/core/extension/IExtension.d.ts +90 -0
- package/dist/types/core/extension/Registry.d.ts +142 -0
- package/dist/types/core/extension/SlotRegistry.d.ts +46 -0
- package/dist/types/core/extension/adapters.d.ts +44 -0
- package/dist/types/core/extension/conformance.d.ts +47 -0
- package/dist/types/core/extension/index.d.ts +16 -0
- package/dist/types/core/extension/registries.d.ts +31 -0
- package/dist/types/core/extension/reserved.d.ts +10 -0
- package/dist/types/core/format/DisplayFormatter.d.ts +47 -0
- package/dist/types/core/format/FormatCache.d.ts +20 -0
- package/dist/types/core/format/FormatterRegistry.d.ts +22 -0
- package/dist/types/core/format/grammar/AstRenderer.d.ts +10 -0
- package/dist/types/core/format/grammar/FormatCompiler.d.ts +16 -0
- package/dist/types/core/format/index.d.ts +55 -0
- package/dist/types/core/format/pipeline/DomainTypeResolver.d.ts +8 -0
- package/dist/types/core/format/pipeline/LocaleFormat.d.ts +11 -0
- package/dist/types/core/format/pipeline/ValueInterpreter.d.ts +8 -0
- package/dist/types/core/format/policy/MaskPolicy.d.ts +8 -0
- package/dist/types/core/format/policy/NegativePolicy.d.ts +12 -0
- package/dist/types/core/format/policy/NullPolicy.d.ts +10 -0
- package/dist/types/core/format/policy/TruncatePolicy.d.ts +11 -0
- package/dist/types/core/format/types.d.ts +292 -0
- package/dist/types/core/formula/CalcCacheStore.d.ts +89 -0
- package/dist/types/core/formula/CalcProvenance.d.ts +44 -0
- package/dist/types/core/formula/CalcService.d.ts +137 -0
- package/dist/types/core/formula/CyclePathReporter.d.ts +28 -0
- package/dist/types/core/formula/FormulaEvaluator.d.ts +35 -1
- package/dist/types/core/formula/FormulaGraph.d.ts +84 -7
- package/dist/types/core/formula/FormulaParser.d.ts +9 -0
- package/dist/types/core/formula/FormulaStore.d.ts +63 -1
- package/dist/types/core/formula/FunctionRegistry.d.ts +138 -0
- package/dist/types/core/formula/Generation.d.ts +86 -0
- package/dist/types/core/formula/RecalcCoordinator.d.ts +151 -9
- package/dist/types/core/formula/ReferenceRewriter.d.ts +81 -0
- package/dist/types/core/formula/functions/essential.d.ts +3 -0
- package/dist/types/core/formula/functions/extended/index.d.ts +10 -0
- package/dist/types/core/formula/normalizeRefs.d.ts +34 -3
- package/dist/types/core/formula/numericLiteral.d.ts +11 -1
- package/dist/types/core/formula/serializeFormula.d.ts +10 -1
- package/dist/types/core/formula/types.d.ts +71 -8
- package/dist/types/core/host/CapabilityRegistry.d.ts +61 -0
- package/dist/types/core/host/GridHostDriver.d.ts +27 -0
- package/dist/types/core/host/GridHostPort.d.ts +37 -0
- package/dist/types/core/host/SliceOwnershipGuard.d.ts +27 -0
- package/dist/types/core/host/archCheck.d.ts +26 -0
- package/dist/types/core/host/index.d.ts +6 -0
- package/dist/types/core/host/reconcile.d.ts +22 -0
- package/dist/types/core/i18n/LocaleContext.d.ts +40 -0
- package/dist/types/core/i18n/types.d.ts +26 -1
- package/dist/types/core/icons/bootstrap-icons.d.ts +4 -2
- package/dist/types/core/quality/ContrastAuditor.d.ts +64 -0
- package/dist/types/core/quality/DeterminismKernel.d.ts +68 -0
- package/dist/types/core/quality/PerfBaseline.d.ts +23 -0
- package/dist/types/core/quality/PerfSpec.d.ts +95 -0
- package/dist/types/core/quality/RealBrowserGate.d.ts +69 -0
- package/dist/types/core/quality/RegressionJudge.d.ts +35 -0
- package/dist/types/core/quality/ReleaseGate.d.ts +94 -0
- package/dist/types/core/quality/VisualRegression.d.ts +74 -0
- package/dist/types/core/quality/hooks.d.ts +53 -0
- package/dist/types/core/quality/index.d.ts +20 -0
- package/dist/types/core/quality/pixelMetrics.d.ts +24 -0
- package/dist/types/core/range/ClipboardCodec.d.ts +46 -4
- package/dist/types/core/range/FillEngine.d.ts +69 -9
- package/dist/types/core/range/RangeModel.d.ts +100 -13
- package/dist/types/core/range/RangeQuery.d.ts +24 -2
- package/dist/types/core/range/types.d.ts +27 -11
- package/dist/types/core/realtime/BackpressureScheduler.d.ts +0 -0
- package/dist/types/core/realtime/FreshnessClock.d.ts +34 -0
- package/dist/types/core/realtime/IRealtimeSource.d.ts +82 -0
- package/dist/types/core/realtime/LiveStateGuard.d.ts +23 -0
- package/dist/types/core/realtime/PollingSource.d.ts +42 -0
- package/dist/types/core/realtime/RealtimeController.d.ts +54 -0
- package/dist/types/core/realtime/RtAnnouncePolicy.d.ts +53 -0
- package/dist/types/core/realtime/RtApplyCommand.d.ts +29 -0
- package/dist/types/core/realtime/RtChartTargetTrigger.d.ts +26 -0
- package/dist/types/core/realtime/StreamingSource.d.ts +47 -0
- package/dist/types/core/realtime/backoff.d.ts +12 -0
- package/dist/types/core/realtime/index.d.ts +13 -0
- package/dist/types/core/realtime/ports.d.ts +80 -0
- package/dist/types/core/render/CellApplier.d.ts +18 -0
- package/dist/types/core/render/CellErrorBoundary.d.ts +65 -0
- package/dist/types/core/render/CellPipeline.d.ts +39 -0
- package/dist/types/core/render/CellRenderRequest.d.ts +209 -0
- package/dist/types/core/render/CellStageRegistry.d.ts +53 -0
- package/dist/types/core/render/OverlayCompositor.d.ts +38 -0
- package/dist/types/core/render/RenderBudget.d.ts +67 -0
- package/dist/types/core/render/contrast.d.ts +33 -0
- package/dist/types/core/render/index.d.ts +35 -0
- package/dist/types/core/render/stages/BackgroundStage.d.ts +14 -0
- package/dist/types/core/render/stages/DecoratorStage.d.ts +12 -0
- package/dist/types/core/render/stages/OverlayStage.d.ts +12 -0
- package/dist/types/core/render/stages/ValueRendererStage.d.ts +15 -0
- package/dist/types/core/render/stages/index.d.ts +14 -0
- package/dist/types/core/renderers/CellRenderer.d.ts +100 -8
- package/dist/types/core/state/AutosaveController.d.ts +63 -0
- package/dist/types/core/state/IStatePersistence.d.ts +59 -0
- package/dist/types/core/state/MultiTabGuard.d.ts +33 -0
- package/dist/types/core/state/SchemaMigrator.d.ts +33 -0
- package/dist/types/core/state/SemVerPolicy.d.ts +39 -0
- package/dist/types/core/state/StateCodec.d.ts +75 -0
- package/dist/types/core/state/index.d.ts +6 -0
- package/dist/types/core/types.d.ts +17 -0
- package/dist/types/react/OpenGrid.d.ts +54 -0
- package/dist/types/react/index.d.ts +5 -0
- package/dist/types/realtime/index.d.ts +1 -0
- package/dist/types/vue/index.d.ts +5 -0
- package/dist/types/vue/types.d.ts +35 -0
- package/dist/xlsx.min-BQ1o3sB6.cjs +11793 -0
- package/dist/{xlsx.min-Wavxcamn.js → xlsx.min-Bbz2ZypC.js} +453 -566
- package/package.json +112 -110
- package/dist/OpenGrid-B0Spm0rU.js +0 -10404
- package/dist/OpenGrid-CuXj0isp.cjs +0 -97
- package/dist/xlsx.min-Bx-LxWOf.cjs +0 -138
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { ChartDataModelMeta } from './types.js';
|
|
2
|
+
/** 배지 종류(§9.4 통일 문법). / Badge kind (§9.4 unified grammar). */
|
|
3
|
+
export type BadgeKind = 'sampled' | 'aggregated' | 'negativesAbsInPie' | 'pieReducedToFirst' | 'truncatedAxis' | 'engineFallback' | 'unsupportedType';
|
|
4
|
+
/** 무결성 배지 한 건(위치·형태·상호작용은 렌더 계층, 여기선 데이터). / One integrity badge (data only). */
|
|
5
|
+
export interface ProvenanceBadge {
|
|
6
|
+
readonly kind: BadgeKind;
|
|
7
|
+
/** 배지 M(표시)/N(원본) — sampled 에서 채워짐(REQ-T6-810). / Badge M(shown)/N(source). */
|
|
8
|
+
readonly m?: number;
|
|
9
|
+
readonly n?: number;
|
|
10
|
+
/** 로케일 키(t 해석). / Locale key (resolved by t). */
|
|
11
|
+
readonly key: string;
|
|
12
|
+
/** 로케일 파라미터. / Locale params. */
|
|
13
|
+
readonly params?: Readonly<Record<string, string | number>>;
|
|
14
|
+
}
|
|
15
|
+
/** 차트 provenance(scene.meta 동행). / Chart provenance (travels with scene.meta). */
|
|
16
|
+
export interface ChartProvenance {
|
|
17
|
+
readonly badges: readonly ProvenanceBadge[];
|
|
18
|
+
/** 정상(무왜곡) 차트는 배지 0개(§9.3.4 게이트). / An honest (undistorted) chart has 0 badges. */
|
|
19
|
+
readonly clean: boolean;
|
|
20
|
+
}
|
|
21
|
+
/** 추가 변환 플래그(meta 에 없는 절단축·엔진/타입 폴백). / Extra transform flags not in meta. */
|
|
22
|
+
export interface ProvenanceExtra {
|
|
23
|
+
/** line y축 절단(min≠0 opt-in) — 배지 강제(§9.3.1). / Truncated line y-axis (opt-in). */
|
|
24
|
+
truncatedAxis?: boolean;
|
|
25
|
+
/** 외부 엔진 미로드 → builtin 폴백(REQ-T6-812). / External engine fallback. */
|
|
26
|
+
engineFallback?: boolean;
|
|
27
|
+
/** 미지원 차트타입 → builtin 폴백(REQ-T6-812). / Unsupported chart type fallback. */
|
|
28
|
+
unsupportedType?: boolean;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* meta(+extra) → provenance 배지 모델. 순수·결정론. 변형이 없으면 clean=true(배지 0).
|
|
32
|
+
* / meta (+extra) → provenance badge model. Pure & deterministic. clean=true (0 badges) when nothing transformed.
|
|
33
|
+
*
|
|
34
|
+
* @param meta - 차트 데이터 모델 메타 / Chart data model meta
|
|
35
|
+
* @param extra - 절단축·엔진/타입 폴백 플래그(선택) / Truncated-axis / engine-type fallback flags (optional)
|
|
36
|
+
* @returns provenance 배지 모델 / Provenance badge model
|
|
37
|
+
*/
|
|
38
|
+
export declare function buildProvenance(meta: ChartDataModelMeta, extra?: ProvenanceExtra): ChartProvenance;
|
|
39
|
+
/**
|
|
40
|
+
* 배지 → 표시 문자열(로케일 t 주입). 산발 각주 대신 이 함수를 전 표면 공유(§9.4).
|
|
41
|
+
* / Badge → display string (inject locale t). Shared by all surfaces instead of scattered footnotes.
|
|
42
|
+
*
|
|
43
|
+
* @param badge - 배지 / The badge
|
|
44
|
+
* @param t - 로케일 해석기(키·파라미터 → 문자열). 미주입 시 폴백 영문 / Locale resolver; English fallback when absent
|
|
45
|
+
* @returns 표시 문자열 / Display string
|
|
46
|
+
*/
|
|
47
|
+
export declare function badgeText(badge: ProvenanceBadge, t?: (key: string, params?: Record<string, string | number>) => string): string;
|
|
@@ -1,24 +1,51 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* F4 — nice-number 축 눈금 스케일(순수 함수, 헤드리스). §8.1(자동검증 대상 수학).
|
|
3
|
+
* / F4 — nice-number axis-tick scaling (pure functions, headless). §8.1 (auto-verified math).
|
|
3
4
|
*
|
|
4
5
|
* 표준 Heckbert "Nice Numbers for Graph Labels" 알고리즘. 목표 tick 수(default 6)에 맞춰
|
|
5
6
|
* step 을 1/2/5×10^n 중에서 선택하고, [min,max] 를 그 step 배수로 확장한다.
|
|
7
|
+
* / The standard Heckbert "Nice Numbers for Graph Labels" algorithm. It picks a step among
|
|
8
|
+
* 1/2/5×10^n to fit a target tick count (default 6) and expands [min,max] to multiples of that step.
|
|
6
9
|
*
|
|
7
10
|
* 한계(정직 명시): 이 알고리즘은 min=0 류의 "원점 기준" 범위에서는 매우 안정적으로
|
|
8
11
|
* tick 5~6개를 낸다(설계서 §8.1 문서화 예시 [0,97]→6 tick 포함). min≠0 인 임의 구간에서는
|
|
9
12
|
* step 후보가 {1,2,5,10} 로 성기어(coarse) tick 수가 4개나 7개로 튈 수 있다 — 표준 알고리즘의
|
|
10
13
|
* 알려진 한계이며, 본 구현은 문서화된 대표 입력(§8.1)에 대해서만 5~6 불변식을 보장한다.
|
|
14
|
+
* / Honest limitation: for origin-anchored ranges like min=0 the algorithm very stably yields
|
|
15
|
+
* 5–6 ticks (e.g. the documented §8.1 example [0,97]→6 ticks). For arbitrary ranges with min≠0
|
|
16
|
+
* the coarse {1,2,5,10} step candidates can make the tick count jump to 4 or 7 — a known
|
|
17
|
+
* limitation of the standard algorithm; this implementation guarantees the 5–6 invariant only for
|
|
18
|
+
* the documented representative inputs (§8.1).
|
|
11
19
|
*/
|
|
20
|
+
/** nice-number 스케일 결과(min/max/step 과 tick 배열). / A nice-number scale result (min/max/step and tick array). */
|
|
12
21
|
export interface NiceScale {
|
|
22
|
+
/** 확장된 최솟값. / Expanded minimum. */
|
|
13
23
|
min: number;
|
|
24
|
+
/** 확장된 최댓값. / Expanded maximum. */
|
|
14
25
|
max: number;
|
|
26
|
+
/** tick 간격. / Tick step. */
|
|
15
27
|
step: number;
|
|
28
|
+
/** tick 값 배열. / Array of tick values. */
|
|
16
29
|
ticks: number[];
|
|
17
30
|
}
|
|
18
|
-
/**
|
|
31
|
+
/**
|
|
32
|
+
* range 를 1/2/5×10^n 중 하나로 반올림한다(round=true: 가장 가까운 값, false: 올림 쪽 느슨한 값).
|
|
33
|
+
* / Round a range to one of 1/2/5×10^n (round=true: nearest; false: looser round-up).
|
|
34
|
+
*
|
|
35
|
+
* @param range - 반올림할 범위 크기 / Range magnitude to round
|
|
36
|
+
* @param round - true=가장 가까운 nice 값, false=올림 쪽 / true = nearest nice value, false = round-up side
|
|
37
|
+
* @returns nice 값 / The nice value
|
|
38
|
+
*/
|
|
19
39
|
export declare function niceNum(range: number, round: boolean): number;
|
|
20
40
|
/**
|
|
21
41
|
* [dataMin,dataMax] → nice range/step/tick 배열(§8.1). maxTicks 는 목표 tick 수(default 6).
|
|
22
42
|
* dataMin===dataMax(degenerate) 이면 값 주변으로 인위 확장한다.
|
|
43
|
+
* / [dataMin,dataMax] → nice range/step/tick array (§8.1). maxTicks is the target tick count
|
|
44
|
+
* (default 6). A degenerate dataMin===dataMax is artificially expanded around the value.
|
|
45
|
+
*
|
|
46
|
+
* @param dataMin - 데이터 최솟값 / Data minimum
|
|
47
|
+
* @param dataMax - 데이터 최댓값 / Data maximum
|
|
48
|
+
* @param maxTicks - 목표 tick 수(기본 6) / Target tick count (default 6)
|
|
49
|
+
* @returns nice min/max/step 과 tick 배열 / Nice min/max/step and the tick array
|
|
23
50
|
*/
|
|
24
51
|
export declare function niceScale(dataMin: number, dataMax: number, maxTicks?: number): NiceScale;
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { ChartDataModel, ChartRenderSpec, ChartDataModelMeta, ChartSeries } from './types.js';
|
|
2
|
+
import { ChartGeometry } from './geometry.js';
|
|
3
|
+
import { patternOverlay, dashFor } from './surfaces/pattern-overlay.js';
|
|
4
|
+
/** 색 외 구분 패턴(§9.2). / Redundant (non-color) pattern (§9.2). */
|
|
5
|
+
export type SeriesPattern = NonNullable<ChartSeries['pattern']>;
|
|
6
|
+
/** 텍스트 정렬. / Text alignment. */
|
|
7
|
+
export type TextAlign = 'start' | 'center' | 'end';
|
|
8
|
+
/** 텍스트 기준선. / Text baseline. */
|
|
9
|
+
export type TextBaseline = 'top' | 'middle' | 'bottom';
|
|
10
|
+
/** 원시 드로우명령(타깃 무관). / Primitive draw command (target-agnostic). */
|
|
11
|
+
export type DrawPrim = {
|
|
12
|
+
readonly k: 'rect';
|
|
13
|
+
x: number;
|
|
14
|
+
y: number;
|
|
15
|
+
w: number;
|
|
16
|
+
h: number;
|
|
17
|
+
fill: string;
|
|
18
|
+
pattern?: SeriesPattern;
|
|
19
|
+
} | {
|
|
20
|
+
readonly k: 'polyline';
|
|
21
|
+
pts: ReadonlyArray<readonly [number, number]>;
|
|
22
|
+
stroke: string;
|
|
23
|
+
width: number;
|
|
24
|
+
dash?: readonly number[];
|
|
25
|
+
} | {
|
|
26
|
+
readonly k: 'circle';
|
|
27
|
+
cx: number;
|
|
28
|
+
cy: number;
|
|
29
|
+
r: number;
|
|
30
|
+
fill: string;
|
|
31
|
+
} | {
|
|
32
|
+
readonly k: 'line';
|
|
33
|
+
x1: number;
|
|
34
|
+
y1: number;
|
|
35
|
+
x2: number;
|
|
36
|
+
y2: number;
|
|
37
|
+
stroke: string;
|
|
38
|
+
width: number;
|
|
39
|
+
} | {
|
|
40
|
+
readonly k: 'text';
|
|
41
|
+
x: number;
|
|
42
|
+
y: number;
|
|
43
|
+
s: string;
|
|
44
|
+
fill: string;
|
|
45
|
+
align: TextAlign;
|
|
46
|
+
baseline: TextBaseline;
|
|
47
|
+
font: string;
|
|
48
|
+
} | {
|
|
49
|
+
readonly k: 'arc';
|
|
50
|
+
cx: number;
|
|
51
|
+
cy: number;
|
|
52
|
+
r: number;
|
|
53
|
+
a0: number;
|
|
54
|
+
a1: number;
|
|
55
|
+
fill: string;
|
|
56
|
+
pattern?: SeriesPattern;
|
|
57
|
+
};
|
|
58
|
+
/** 장면 = 배경→축→데이터→마커 순서의 원시명령 + 자기고지 메타. / Scene = ordered prims + self-declaring meta. */
|
|
59
|
+
export interface ChartScene {
|
|
60
|
+
readonly width: number;
|
|
61
|
+
readonly height: number;
|
|
62
|
+
readonly bg: string;
|
|
63
|
+
readonly prims: readonly DrawPrim[];
|
|
64
|
+
readonly geometry: ChartGeometry;
|
|
65
|
+
readonly meta: ChartDataModelMeta;
|
|
66
|
+
}
|
|
67
|
+
/** 렌더 타깃 종류. / Render target kind. */
|
|
68
|
+
export type RenderTargetKind = 'canvas' | 'svg' | 'server';
|
|
69
|
+
/** 장면을 백엔드 원시연산으로 번역하는 humble 어댑터. 로직·판단 없음(§2.3). / Humble scene→backend translator. */
|
|
70
|
+
export interface RenderSurface {
|
|
71
|
+
readonly kind: RenderTargetKind;
|
|
72
|
+
paint(scene: ChartScene): void;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* 순수: 완전 기하 → 드로우리스트(§2.2). 색/패턴은 palette 로 확정. **유일한 그림 결정 지점**.
|
|
76
|
+
* / Pure: complete geometry → draw list. Colors/patterns finalized via palette. The sole drawing-decision point.
|
|
77
|
+
*
|
|
78
|
+
* @param model - 차트 데이터 모델 / Chart data model
|
|
79
|
+
* @param spec - 렌더 스펙 / Render spec
|
|
80
|
+
* @param geometry - 공유 기하(computeChartGeometry 산출) / Shared geometry
|
|
81
|
+
* @param hidden - 숨긴 series 인덱스 / Hidden series indices
|
|
82
|
+
* @returns 타깃 무관 장면 / Target-agnostic scene
|
|
83
|
+
*/
|
|
84
|
+
export declare function buildChartScene(model: ChartDataModel, spec: ChartRenderSpec, geometry: ChartGeometry, hidden?: ReadonlySet<number>): ChartScene;
|
|
85
|
+
/**
|
|
86
|
+
* 타깃 통일 진입점 — 계산은 공유(geometry+scene), surface 만 분기(§2.4). scene 반환(파리티 골든·hit-test).
|
|
87
|
+
* / Unified render entry — computation shared (geometry+scene), only the surface branches. Returns
|
|
88
|
+
* the scene (parity golden / hit-test).
|
|
89
|
+
*
|
|
90
|
+
* @param model - 차트 데이터 모델 / Chart data model
|
|
91
|
+
* @param spec - 렌더 스펙 / Render spec
|
|
92
|
+
* @param size - 렌더 크기 / Render size
|
|
93
|
+
* @param surface - 타깃 surface(humble) / Target surface (humble)
|
|
94
|
+
* @param hidden - 숨긴 series 인덱스 / Hidden series indices
|
|
95
|
+
* @returns 소비된 장면 / The consumed scene
|
|
96
|
+
*/
|
|
97
|
+
export declare function renderChart(model: ChartDataModel, spec: ChartRenderSpec, size: {
|
|
98
|
+
width: number;
|
|
99
|
+
height: number;
|
|
100
|
+
}, surface: RenderSurface, hidden?: ReadonlySet<number>): ChartScene;
|
|
101
|
+
/** scene 텍스처 오버레이 재노출(surface 공유). / Re-export texture overlay for surfaces. */
|
|
102
|
+
export { patternOverlay, dashFor };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { ChartDataModel, ChartRenderSpec } from './types.js';
|
|
2
|
+
import { ChartScene } from './scene.js';
|
|
3
|
+
import { IRasterizer } from './surfaces/ServerRasterSurface.js';
|
|
4
|
+
import { ChartProvenance, ProvenanceExtra } from './provenance.js';
|
|
5
|
+
/** 서버 렌더 옵션. / Server render options. */
|
|
6
|
+
export interface ServerRenderOptions {
|
|
7
|
+
/** PNG 픽셀화 주입(없으면 png 미산출, SVG 1급). / PNG rasterizer injection (no png without it). */
|
|
8
|
+
rasterizer?: IRasterizer;
|
|
9
|
+
/** DPR(서버 스케일). 기본 1. / DPR (server scale). Default 1. */
|
|
10
|
+
dpr?: number;
|
|
11
|
+
/** 숨긴 series 인덱스. / Hidden series indices. */
|
|
12
|
+
hidden?: ReadonlySet<number>;
|
|
13
|
+
/** 절단축·엔진/타입 폴백 배지 플래그. / Truncated-axis / engine-type fallback badge flags. */
|
|
14
|
+
provenance?: ProvenanceExtra;
|
|
15
|
+
}
|
|
16
|
+
/** 서버 렌더 결과(§2.5). png 는 rasterizer 주입 시에만. / Server render result. png only with a rasterizer. */
|
|
17
|
+
export interface ServerRenderResult {
|
|
18
|
+
readonly scene: ChartScene;
|
|
19
|
+
readonly svg: string;
|
|
20
|
+
readonly png?: Uint8Array;
|
|
21
|
+
readonly provenance: ChartProvenance;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* 서버 헤드리스 렌더 — SVG·scene·provenance 항상 산출, PNG 는 opt-in. 클라이언트와 동일 scene.
|
|
25
|
+
* / Server headless render — always yields SVG/scene/provenance; PNG is opt-in. Same scene as client.
|
|
26
|
+
*
|
|
27
|
+
* @param spec - 렌더 스펙(타입·테마·포맷) / Render spec (type, theme, format)
|
|
28
|
+
* @param model - 차트 데이터 모델 / Chart data model
|
|
29
|
+
* @param size - 렌더 크기 / Render size
|
|
30
|
+
* @param opts - rasterizer·dpr·hidden·provenance(선택) / rasterizer·dpr·hidden·provenance (optional)
|
|
31
|
+
* @returns scene·svg·(png?)·provenance / scene·svg·(png?)·provenance
|
|
32
|
+
*/
|
|
33
|
+
export declare function renderChartServer(spec: ChartRenderSpec, model: ChartDataModel, size: {
|
|
34
|
+
width: number;
|
|
35
|
+
height: number;
|
|
36
|
+
}, opts?: ServerRenderOptions): ServerRenderResult;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { ChartScene, RenderSurface } from '../scene.js';
|
|
2
|
+
type Ctx = {
|
|
3
|
+
setTransform(a: number, b: number, c: number, d: number, e: number, f: number): void;
|
|
4
|
+
clearRect(x: number, y: number, w: number, h: number): void;
|
|
5
|
+
beginPath(): void;
|
|
6
|
+
moveTo(x: number, y: number): void;
|
|
7
|
+
lineTo(x: number, y: number): void;
|
|
8
|
+
arc(cx: number, cy: number, r: number, a0: number, a1: number): void;
|
|
9
|
+
closePath(): void;
|
|
10
|
+
fill(): void;
|
|
11
|
+
stroke(): void;
|
|
12
|
+
fillRect(x: number, y: number, w: number, h: number): void;
|
|
13
|
+
fillText(s: string, x: number, y: number): void;
|
|
14
|
+
save(): void;
|
|
15
|
+
restore(): void;
|
|
16
|
+
clip(): void;
|
|
17
|
+
rect(x: number, y: number, w: number, h: number): void;
|
|
18
|
+
setLineDash(d: number[]): void;
|
|
19
|
+
fillStyle: string;
|
|
20
|
+
strokeStyle: string;
|
|
21
|
+
lineWidth: number;
|
|
22
|
+
font: string;
|
|
23
|
+
textAlign: string;
|
|
24
|
+
textBaseline: string;
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* canvas 2D 로 scene 을 래스터화한다. constructor 에 canvas·dpr 을 주입받고, paint 시 ctx 를
|
|
28
|
+
* 해소한다(없으면 no-op). / Rasterizes a scene onto a canvas 2D context. Injects canvas/dpr;
|
|
29
|
+
* resolves the ctx at paint time (no-op if absent).
|
|
30
|
+
*/
|
|
31
|
+
export declare class CanvasSurface implements RenderSurface {
|
|
32
|
+
readonly kind: "canvas";
|
|
33
|
+
private _canvas;
|
|
34
|
+
private _dpr;
|
|
35
|
+
/**
|
|
36
|
+
* @param canvas - 렌더 대상 canvas(주입) / Target canvas (injected)
|
|
37
|
+
* @param dpr - devicePixelRatio(호스트 주입, 헤드리스 순수) / devicePixelRatio (host-injected, headless-pure)
|
|
38
|
+
*/
|
|
39
|
+
constructor(canvas: {
|
|
40
|
+
width: number;
|
|
41
|
+
height: number;
|
|
42
|
+
getContext?: (id: string) => Ctx | null;
|
|
43
|
+
}, dpr?: number);
|
|
44
|
+
paint(scene: ChartScene): void;
|
|
45
|
+
private _prim;
|
|
46
|
+
private _overlay;
|
|
47
|
+
}
|
|
48
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { ChartScene, RenderSurface } from '../scene.js';
|
|
2
|
+
/** 주입형 래스터라이저 SPI(옵트인 애드온). scene 또는 SVG→PNG. / Injected rasterizer SPI (opt-in add-on). */
|
|
3
|
+
export interface IRasterizer {
|
|
4
|
+
/** scene 을 PNG 바이트로 래스터화(sharp/pngjs/resvg 등 호스트 제공). / Rasterize scene → PNG bytes. */
|
|
5
|
+
rasterize(scene: ChartScene): Uint8Array;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* 서버 PNG surface — DOM/canvas 전역 없이 동작. rasterizer 미주입 시 toPNG()=throw.
|
|
9
|
+
* / Server PNG surface — works with no DOM/canvas globals. If no rasterizer, toPNG() throws.
|
|
10
|
+
*/
|
|
11
|
+
export declare class ServerRasterSurface implements RenderSurface {
|
|
12
|
+
readonly kind: "server";
|
|
13
|
+
private _rasterizer;
|
|
14
|
+
private _scene;
|
|
15
|
+
/**
|
|
16
|
+
* @param rasterizer - 주입 래스터라이저(없으면 PNG 미산출) / Injected rasterizer (no PNG without it)
|
|
17
|
+
*/
|
|
18
|
+
constructor(rasterizer?: IRasterizer);
|
|
19
|
+
paint(scene: ChartScene): void;
|
|
20
|
+
/**
|
|
21
|
+
* 주입 rasterizer 로 PNG 산출(코어 미내장). 미주입/미paint 시 throw(불변식4).
|
|
22
|
+
* / Produce PNG via the injected rasterizer (not embedded in core). Throws if not injected / not painted.
|
|
23
|
+
* @returns PNG 바이트 / PNG bytes
|
|
24
|
+
*/
|
|
25
|
+
toPNG(): Uint8Array;
|
|
26
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ChartScene, RenderSurface } from '../scene.js';
|
|
2
|
+
/**
|
|
3
|
+
* scene 을 SVG 문자열로 래스터화하는 humble surface. `paint(scene)` 후 `toString()` 으로 완성 마크업.
|
|
4
|
+
* provenance(§9.4)는 `<title>/<desc>` 로 동행한다(REQ-T6-811).
|
|
5
|
+
* / Humble surface that rasterizes a scene into an SVG string. After `paint(scene)`, `toString()`
|
|
6
|
+
* yields the full markup. Provenance travels along in `<title>/<desc>` (REQ-T6-811).
|
|
7
|
+
*/
|
|
8
|
+
export declare class SvgSurface implements RenderSurface {
|
|
9
|
+
readonly kind: "svg";
|
|
10
|
+
private _dpr;
|
|
11
|
+
private _out;
|
|
12
|
+
/** @param opts.dpr - viewBox 배율(선택, 기본 1) / viewBox scale (optional, default 1) */
|
|
13
|
+
constructor(opts?: {
|
|
14
|
+
dpr?: number;
|
|
15
|
+
});
|
|
16
|
+
paint(scene: ChartScene): void;
|
|
17
|
+
/** 완성 <svg> 마크업(RT-803 서버 SVG 출력). / Full <svg> markup (RT-803 server SVG output). */
|
|
18
|
+
toString(): string;
|
|
19
|
+
private _desc;
|
|
20
|
+
private _prim;
|
|
21
|
+
private _overlay;
|
|
22
|
+
/** 파이 슬라이스 path(중심→호→닫기). / Pie-slice path (center → arc → close). */
|
|
23
|
+
private _arcPath;
|
|
24
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { SeriesPattern } from '../scene.js';
|
|
2
|
+
/** 오버레이 선분 [x1,y1,x2,y2]. / Overlay line segment. */
|
|
3
|
+
export type OverlaySeg = readonly [number, number, number, number];
|
|
4
|
+
/** 오버레이 점 [cx,cy,r]. / Overlay dot. */
|
|
5
|
+
export type OverlayDot = readonly [number, number, number];
|
|
6
|
+
/** 텍스처 오버레이 결과(선분·점). / Texture overlay result (segments + dots). */
|
|
7
|
+
export interface PatternOverlay {
|
|
8
|
+
readonly segs: readonly OverlaySeg[];
|
|
9
|
+
readonly dots: readonly OverlayDot[];
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* 사각형 안의 색약 안전 텍스처 좌표(§9.2). solid/undefined → 빈 오버레이.
|
|
13
|
+
* / Colorblind-safe texture coordinates inside a rect. solid/undefined → empty overlay.
|
|
14
|
+
*
|
|
15
|
+
* @param x - 사각형 좌상단 x / Rect top-left x
|
|
16
|
+
* @param y - 사각형 좌상단 y / Rect top-left y
|
|
17
|
+
* @param w - 너비 / Width
|
|
18
|
+
* @param h - 높이 / Height
|
|
19
|
+
* @param pattern - 패턴 종류 / Pattern kind
|
|
20
|
+
* @returns 텍스처 선분·점 좌표 / Texture segments and dots
|
|
21
|
+
*/
|
|
22
|
+
export declare function patternOverlay(x: number, y: number, w: number, h: number, pattern: SeriesPattern | undefined): PatternOverlay;
|
|
23
|
+
/** line/area 대시 배열(현 CanvasAdapter.dashFor 와 동일). / Line dash array (matches CanvasAdapter.dashFor). */
|
|
24
|
+
export declare function dashFor(pattern: SeriesPattern | undefined): number[];
|
|
@@ -7,13 +7,20 @@ import { CellRange } from '../types.js';
|
|
|
7
7
|
* 폴백 렌더된다(CanvasAdapter._computeGeometry). 하위호환을 위해 타입 자체는 유지한다.
|
|
8
8
|
*/
|
|
9
9
|
export type ChartType = 'bar' | 'line' | 'area' | 'pie' | 'doughnut' | 'bar-stacked' | 'bar-grouped';
|
|
10
|
+
/** 시리즈(컬럼) 명세. / Series (column) spec. */
|
|
10
11
|
export interface ChartSeriesSpec {
|
|
12
|
+
/** 값 컬럼 field 명. / Value column field name. */
|
|
11
13
|
field: string;
|
|
14
|
+
/** 범례 라벨(기본 = 컬럼 header/field). / Legend label (default = column header/field). */
|
|
12
15
|
name?: string;
|
|
16
|
+
/** 시리즈 색. / Series color. */
|
|
13
17
|
color?: string;
|
|
18
|
+
/** 색 외 구분 패턴. / Non-color distinction pattern. */
|
|
14
19
|
pattern?: ChartSeries['pattern'];
|
|
20
|
+
/** 시리즈별 렌더 타입(혼합 차트). / Per-series render type (mixed charts). */
|
|
15
21
|
type?: 'bar' | 'line' | 'area';
|
|
16
22
|
}
|
|
23
|
+
/** 차트 데이터 소스(범위/선택/체크/전체/컬럼 지정). / Chart data source (range/selection/checked/all/explicit columns). */
|
|
17
24
|
export type ChartSource = {
|
|
18
25
|
kind: 'range';
|
|
19
26
|
range?: CellRange;
|
|
@@ -28,61 +35,92 @@ export type ChartSource = {
|
|
|
28
35
|
category?: string;
|
|
29
36
|
series: Array<string | ChartSeriesSpec>;
|
|
30
37
|
};
|
|
38
|
+
/** 카테고리 집계 연산. / Category aggregation operation. */
|
|
31
39
|
export type ChartAggregateOp = 'sum' | 'avg' | 'count' | 'min' | 'max';
|
|
40
|
+
/** 집계 연산 또는 커스텀 리듀서. / An aggregation op or a custom reducer. */
|
|
32
41
|
export type ChartAggregate = ChartAggregateOp | ((values: number[], category: string) => number);
|
|
42
|
+
/** 접근성(SR) 테이블 모델 — 스크린리더 폴백. / Accessibility (SR) table model — screen-reader fallback. */
|
|
33
43
|
export interface A11yTableModel {
|
|
34
|
-
/** aria-label 요약
|
|
44
|
+
/** aria-label 요약 캡션. / aria-label summary caption. */
|
|
35
45
|
caption: string;
|
|
36
46
|
/** ['category', ...series names] */
|
|
37
47
|
colHeaders: string[];
|
|
38
|
-
/** [category, v1, v2, ...] — locale 포맷
|
|
48
|
+
/** [category, v1, v2, ...] — locale 포맷 문자열. / [category, v1, v2, ...] — locale-formatted strings. */
|
|
39
49
|
rows: string[][];
|
|
40
50
|
}
|
|
51
|
+
/** 차트 시리즈(정규화된 값 배열). / Chart series (normalized value array). */
|
|
41
52
|
export interface ChartSeries {
|
|
42
|
-
/** 범례 라벨(기본값 = 원본 컬럼 header/field) */
|
|
53
|
+
/** 범례 라벨(기본값 = 원본 컬럼 header/field). / Legend label (default = source column header/field). */
|
|
43
54
|
name: string;
|
|
44
|
-
/** categories 와 동일 순서로 정렬. 결측=null */
|
|
55
|
+
/** categories 와 동일 순서로 정렬. 결측=null. / Aligned to categories order; missing = null. */
|
|
45
56
|
data: Array<number | null>;
|
|
57
|
+
/** 시리즈 색. / Series color. */
|
|
46
58
|
color?: string;
|
|
47
|
-
/** 색 외 구분(HANMS-19) */
|
|
59
|
+
/** 색 외 구분(HANMS-19). / Non-color distinction (HANMS-19). */
|
|
48
60
|
pattern?: 'solid' | 'hatch' | 'dot' | 'cross';
|
|
49
61
|
}
|
|
62
|
+
/** 차트 데이터 모델 메타(출처·샘플링·집계 배지 정보). / Chart data model meta (source, sampling, aggregation badge info). */
|
|
50
63
|
export interface ChartDataModelMeta {
|
|
64
|
+
/** 소스 종류. / Source kind. */
|
|
51
65
|
sourceKind: ChartSource['kind'];
|
|
52
|
-
/** 원본 포인트(행)
|
|
66
|
+
/** 원본 포인트(행) 수. / Original point (row) count. */
|
|
53
67
|
total: number;
|
|
54
|
-
/** LTTB 다운샘플 또는 category 집계로 축약됐는가 → 배지(§C) */
|
|
68
|
+
/** LTTB 다운샘플 또는 category 집계로 축약됐는가 → 배지(§C). / Whether reduced by LTTB downsample or category aggregation → badge (§C). */
|
|
55
69
|
sampled: boolean;
|
|
70
|
+
/** 다운샘플 전 포인트 수. / Point count before downsampling. */
|
|
56
71
|
sampledFrom?: number;
|
|
72
|
+
/** 다운샘플 후 포인트 수. / Point count after downsampling. */
|
|
57
73
|
sampledTo?: number;
|
|
74
|
+
/** 적용된 집계 연산. / Applied aggregation op. */
|
|
58
75
|
aggregatedOp?: 'sum' | 'avg' | 'count' | 'min' | 'max' | 'custom';
|
|
76
|
+
/** pie 에서 첫 시리즈만 사용됐는가. / Whether pie used only the first series. */
|
|
59
77
|
pieReducedToFirst?: boolean;
|
|
78
|
+
/** pie 에서 음수를 절댓값 처리했는가. / Whether pie used absolute values for negatives. */
|
|
60
79
|
negativesAbsInPie?: boolean;
|
|
61
|
-
/** SR 폴백 — extractor 가 렌더러와 무관하게 항상 채운다(§B 하드 게이트) */
|
|
80
|
+
/** SR 폴백 — extractor 가 렌더러와 무관하게 항상 채운다(§B 하드 게이트). / SR fallback — always filled by the extractor regardless of renderer (§B hard gate). */
|
|
62
81
|
a11yTable: A11yTableModel;
|
|
63
82
|
}
|
|
83
|
+
/** 헤드리스 차트 데이터 모델(추출 산출물). / Headless chart data model (extraction output). */
|
|
64
84
|
export interface ChartDataModel {
|
|
85
|
+
/** 카테고리(x축) 라벨. / Category (x-axis) labels. */
|
|
65
86
|
categories: string[];
|
|
87
|
+
/** 시리즈 배열. / Series array. */
|
|
66
88
|
series: ChartSeries[];
|
|
89
|
+
/** 모델 메타. / Model meta. */
|
|
67
90
|
meta: ChartDataModelMeta;
|
|
68
91
|
}
|
|
92
|
+
/** 차트 테마(색·글꼴·팔레트). / Chart theme (colors, fonts, palette). */
|
|
69
93
|
export interface ChartTheme {
|
|
94
|
+
/** 주 색. / Primary color. */
|
|
70
95
|
primary: string;
|
|
96
|
+
/** 축·테두리 색. / Axis/border color. */
|
|
71
97
|
border: string;
|
|
98
|
+
/** 텍스트 색. / Text color. */
|
|
72
99
|
text: string;
|
|
100
|
+
/** 배경 색. / Background color. */
|
|
73
101
|
bg: string;
|
|
102
|
+
/** 그리드 선 색. / Grid line color. */
|
|
74
103
|
gridLine: string;
|
|
104
|
+
/** 글꼴 패밀리. / Font family. */
|
|
75
105
|
fontFamily: string;
|
|
106
|
+
/** 기본 글꼴 크기(px). / Base font size in px. */
|
|
76
107
|
fontSize: number;
|
|
108
|
+
/** 시리즈 순환 팔레트. / Series-cycling palette. */
|
|
77
109
|
palette: string[];
|
|
78
110
|
}
|
|
111
|
+
/** 렌더 스펙(어댑터에 전달되는 스냅샷). / Render spec (snapshot passed to adapters). */
|
|
79
112
|
export interface ChartRenderSpec {
|
|
113
|
+
/** 차트 타입. / Chart type. */
|
|
80
114
|
type: ChartType;
|
|
115
|
+
/** 차트 제목. / Chart title. */
|
|
81
116
|
title?: string;
|
|
117
|
+
/** 범례 표시/위치. / Legend visibility/position. */
|
|
82
118
|
legend?: boolean | {
|
|
83
119
|
position: 'top' | 'bottom' | 'left' | 'right';
|
|
84
120
|
};
|
|
121
|
+
/** 툴팁 사용 여부. / Whether tooltips are enabled. */
|
|
85
122
|
tooltip?: boolean;
|
|
123
|
+
/** 축 설정(라벨·min/max·스택). / Axis config (labels, min/max, stacked). */
|
|
86
124
|
axis?: {
|
|
87
125
|
xLabel?: string;
|
|
88
126
|
yLabel?: string;
|
|
@@ -90,33 +128,56 @@ export interface ChartRenderSpec {
|
|
|
90
128
|
yMax?: number;
|
|
91
129
|
stacked?: boolean;
|
|
92
130
|
};
|
|
131
|
+
/** 시리즈 팔레트(테마 팔레트 오버라이드). / Series palette (overrides theme palette). */
|
|
93
132
|
palette?: string[];
|
|
133
|
+
/** 렌더 테마. / Render theme. */
|
|
94
134
|
theme: ChartTheme;
|
|
135
|
+
/** 숫자 포맷터(축/툴팁/범례 컨텍스트). / Number formatter (axis/tooltip/legend context). */
|
|
95
136
|
numberFormat?: (v: number, ctx: {
|
|
96
137
|
axis: 'x' | 'y' | 'tooltip' | 'legend';
|
|
97
138
|
field?: string;
|
|
98
139
|
}) => string;
|
|
140
|
+
/** 접근성 테이블 모델. / Accessibility table model. */
|
|
99
141
|
a11y: A11yTableModel;
|
|
100
142
|
}
|
|
143
|
+
/** 차트 포인트(히트테스트/클릭 대상). / Chart point (hit-test/click target). */
|
|
101
144
|
export interface ChartPoint {
|
|
145
|
+
/** 시리즈 이름. / Series name. */
|
|
102
146
|
seriesName: string;
|
|
147
|
+
/** 카테고리 라벨. / Category label. */
|
|
103
148
|
category: string;
|
|
149
|
+
/** 값(결측 null). / Value (null if missing). */
|
|
104
150
|
value: number | null;
|
|
151
|
+
/** 카테고리 인덱스. / Category index. */
|
|
105
152
|
index: number;
|
|
153
|
+
/** 원본 행 stable id(있으면). / Source row stable id (if any). */
|
|
106
154
|
rowId?: string;
|
|
107
155
|
}
|
|
156
|
+
/**
|
|
157
|
+
* 차트 렌더 어댑터(교체 seam) — 내장 canvas / 외부 lib 백엔드를 통일된 인터페이스로 감싼다.
|
|
158
|
+
* / Chart render adapter (swap seam) — wraps the built-in canvas / external-lib backends behind one interface.
|
|
159
|
+
*/
|
|
108
160
|
export interface ChartAdapter {
|
|
161
|
+
/** 어댑터 식별자. / Adapter identifier. */
|
|
109
162
|
readonly id: string;
|
|
163
|
+
/** 호스트에 초기화. / Initialize into the host. */
|
|
110
164
|
init(host: HTMLElement, spec: ChartRenderSpec): Promise<void>;
|
|
165
|
+
/** 모델을 렌더. / Render the model. */
|
|
111
166
|
render(model: ChartDataModel, spec: ChartRenderSpec): void;
|
|
167
|
+
/** 렌더 영역 크기 변경. / Resize the render area. */
|
|
112
168
|
resize(width: number, height: number): void;
|
|
169
|
+
/** 현재 렌더를 이미지 Blob 으로(선택). / Export current render as an image Blob (optional). */
|
|
113
170
|
toBlob?(mime?: string): Promise<Blob | null>;
|
|
171
|
+
/** 포인트 클릭 콜백 등록(선택). / Register a point-click callback (optional). */
|
|
114
172
|
onPointClick?(cb: (p: ChartPoint) => void): void;
|
|
173
|
+
/** 어댑터 정리. / Tear down the adapter. */
|
|
115
174
|
destroy(): void;
|
|
116
175
|
}
|
|
117
|
-
/** createChart 반환 핸들(§6). 구현은 ChartManager. */
|
|
176
|
+
/** createChart 반환 핸들(§6). 구현은 ChartManager. / Handle returned by createChart (§6); implemented by ChartManager. */
|
|
118
177
|
export interface ChartInstance {
|
|
178
|
+
/** 차트 인스턴스 id. / Chart instance id. */
|
|
119
179
|
readonly id: string;
|
|
180
|
+
/** 설정 패치 후 갱신. / Patch config and update. */
|
|
120
181
|
update(patch?: Partial<ChartConfig>): void;
|
|
121
182
|
/**
|
|
122
183
|
* 모델을 재추출하고 렌더 스펙(테마 포함)을 재스냅샷해 재렌더한다(§5.3). 그리드는 테마 변경
|
|
@@ -124,56 +185,92 @@ export interface ChartInstance {
|
|
|
124
185
|
* 변화 없는 순수 테마 전환 후에는, 열려 있는 각 차트에 대해 이 메서드를 호출해야 새 테마
|
|
125
186
|
* (색·글꼴·팔레트)가 재적용된다. `update()`/`setType()`도 내부적으로 동일 경로를 탄다.
|
|
126
187
|
*/
|
|
188
|
+
/** 모델을 재추출하고 렌더 스펙(테마 포함)을 재스냅샷해 재렌더. / Re-extract the model and re-snapshot the render spec (incl. theme), then re-render. */
|
|
127
189
|
refresh(): void;
|
|
190
|
+
/** 차트 타입 변경. / Change the chart type. */
|
|
128
191
|
setType(type: ChartType): void;
|
|
192
|
+
/** 차트 인스턴스 파기. / Destroy the chart instance. */
|
|
129
193
|
destroy(): void;
|
|
194
|
+
/** 현재 렌더를 이미지 Blob 으로. / Export current render as an image Blob. */
|
|
130
195
|
toBlob(mime?: string): Promise<Blob | null>;
|
|
196
|
+
/** 현재 데이터 모델 반환. / Return the current data model. */
|
|
131
197
|
getModel(): ChartDataModel;
|
|
198
|
+
/** 차트 이벤트 리스너 등록. / Register a chart event listener. */
|
|
132
199
|
on(ev: 'chartRender' | 'chartPointClick', cb: (...a: any[]) => void): void;
|
|
133
200
|
}
|
|
134
|
-
/** GridOptions.chart 로 중첩되는 전역 옵션(C5.1, 최상위 flat 키 금지). */
|
|
201
|
+
/** GridOptions.chart 로 중첩되는 전역 옵션(C5.1, 최상위 flat 키 금지). / Global options nested under GridOptions.chart (C5.1; no top-level flat keys). */
|
|
135
202
|
export interface ChartGlobalOptions {
|
|
203
|
+
/** 차트 기능 활성화. / Enable the chart feature. */
|
|
136
204
|
enabled?: boolean;
|
|
205
|
+
/** 기본 렌더 엔진. / Default render engine. */
|
|
137
206
|
defaultEngine?: 'builtin' | 'chartjs' | 'echarts';
|
|
207
|
+
/** 기본 차트 타입. / Default chart type. */
|
|
138
208
|
defaultType?: ChartType;
|
|
209
|
+
/** 기본 배치 방식. / Default placement. */
|
|
139
210
|
placement?: 'docked' | 'modal' | 'inline' | 'floating';
|
|
211
|
+
/** 렌더 포인트 상한(초과 시 다운샘플). / Max render points (downsample above this). */
|
|
140
212
|
maxPoints?: number;
|
|
213
|
+
/** live 갱신 디바운스(ms). / Debounce for live updates (ms). */
|
|
141
214
|
debounceMs?: number;
|
|
215
|
+
/** 기본 팔레트. / Default palette. */
|
|
142
216
|
palette?: string[];
|
|
217
|
+
/** 기본 숫자 포맷터. / Default number formatter. */
|
|
143
218
|
numberFormat?: (v: number, ctx: {
|
|
144
219
|
axis: 'x' | 'y' | 'tooltip' | 'legend';
|
|
145
220
|
field?: string;
|
|
146
221
|
}) => string;
|
|
222
|
+
/** 차트 생성 콜백. / Chart-create callback. */
|
|
147
223
|
onChartCreate?: (i: ChartInstance) => void;
|
|
224
|
+
/** 차트 렌더 콜백. / Chart-render callback. */
|
|
148
225
|
onChartRender?: (e: {
|
|
149
226
|
id: string;
|
|
150
227
|
model: ChartDataModel;
|
|
151
228
|
}) => void;
|
|
229
|
+
/** 포인트 클릭 콜백. / Point-click callback. */
|
|
152
230
|
onChartPointClick?: (e: {
|
|
153
231
|
id: string;
|
|
154
232
|
point: ChartPoint;
|
|
155
233
|
}) => void;
|
|
234
|
+
/** 차트 파기 콜백. / Chart-destroy callback. */
|
|
156
235
|
onChartDestroy?: (e: {
|
|
157
236
|
id: string;
|
|
158
237
|
}) => void;
|
|
159
238
|
}
|
|
239
|
+
/** createChart() 공개 설정(§6). / Public config for createChart() (§6). */
|
|
160
240
|
export interface ChartConfig {
|
|
241
|
+
/** 데이터 소스. / Data source. */
|
|
161
242
|
source: ChartSource;
|
|
243
|
+
/** 차트 타입. / Chart type. */
|
|
162
244
|
type: ChartType;
|
|
245
|
+
/** 렌더 엔진 또는 커스텀 어댑터. / Render engine or custom adapter. */
|
|
163
246
|
engine?: 'builtin' | 'chartjs' | 'echarts' | ChartAdapter;
|
|
247
|
+
/** 배치 방식. / Placement. */
|
|
164
248
|
placement?: 'docked' | 'modal' | 'inline' | 'floating';
|
|
249
|
+
/** inline/floating 시 마운트 대상. / Mount target for inline/floating. */
|
|
165
250
|
mount?: HTMLElement;
|
|
251
|
+
/** 카테고리(x축) 컬럼 field. / Category (x-axis) column field. */
|
|
166
252
|
category?: string;
|
|
253
|
+
/** 시리즈 명세 목록. / Series specs. */
|
|
167
254
|
series?: Array<string | ChartSeriesSpec>;
|
|
255
|
+
/** 카테고리 집계 연산. / Category aggregation op. */
|
|
168
256
|
aggregate?: ChartAggregate;
|
|
257
|
+
/** 렌더 포인트 상한. / Max render points. */
|
|
169
258
|
maxPoints?: number;
|
|
259
|
+
/** 데이터 변경 시 자동 갱신. / Auto-refresh on data changes. */
|
|
170
260
|
live?: boolean;
|
|
261
|
+
/** 차트 제목. / Chart title. */
|
|
171
262
|
title?: string;
|
|
263
|
+
/** 범례 설정. / Legend config. */
|
|
172
264
|
legend?: ChartRenderSpec['legend'];
|
|
265
|
+
/** 툴팁 사용 여부. / Whether tooltips are enabled. */
|
|
173
266
|
tooltip?: boolean;
|
|
267
|
+
/** 축 설정. / Axis config. */
|
|
174
268
|
axis?: ChartRenderSpec['axis'];
|
|
269
|
+
/** 시리즈 팔레트. / Series palette. */
|
|
175
270
|
palette?: string[];
|
|
271
|
+
/** 숫자 포맷터. / Number formatter. */
|
|
176
272
|
numberFormat?: ChartRenderSpec['numberFormat'];
|
|
273
|
+
/** 렌더 크기(px). / Render size (px). */
|
|
177
274
|
size?: {
|
|
178
275
|
width: number;
|
|
179
276
|
height: number;
|