@rfkit/charts 1.4.0 → 1.4.2
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/README.md +156 -273
- package/components/AxisY/heatmap/index.d.ts +1 -1
- package/components/AxisY/heatmap/variants/standard/index.d.ts +6 -0
- package/components/Container/runtime.d.ts +10 -0
- package/components/Cursor/popover-support.d.ts +8 -0
- package/components/Toolbar/registry.d.ts +12 -0
- package/components/Toolbar/toggles/index.d.ts +10 -0
- package/components/Zoom/ZoomViewportLayer.d.ts +7 -0
- package/components/ui/button.d.ts +2 -2
- package/config/constants.d.ts +2 -2
- package/hooks/index.d.ts +1 -2
- package/hooks/module-subscription-core.d.ts +23 -0
- package/hooks/publish/enhancedPublish.d.ts +1 -1
- package/hooks/publish/index.d.ts +0 -1
- package/hooks/publish/publish-event.d.ts +9 -0
- package/hooks/useLevelStreamAnalyzer.d.ts +1 -1
- package/hooks/useModuleSubscription.d.ts +21 -23
- package/index.d.ts +5 -5
- package/index.js +7378 -6950
- package/modules/Gauge/render.d.ts +0 -2
- package/{components/HeatmapCapture → modules/Heatmap/Capture}/tools.d.ts +1 -1
- package/modules/Heatmap/CursorPopover.d.ts +6 -0
- package/modules/Heatmap/render.d.ts +2 -0
- package/modules/Level/CursorPopover.d.ts +6 -0
- package/modules/Occupancy/CursorPopover.d.ts +3 -0
- package/modules/Occupancy/TotalLine/index.d.ts +1 -1
- package/modules/Occupancy/total-line-runtime.d.ts +4 -0
- package/modules/Spectrum/AxisYCanvas/index.d.ts +6 -0
- package/{components/AxisYByCanvas → modules/Spectrum/AxisYCanvas}/useCanvasAxisY.d.ts +1 -1
- package/modules/Spectrum/BandLayer/index.d.ts +5 -0
- package/modules/Spectrum/BandLayer/useBandLayerController.d.ts +2 -0
- package/{components → modules/Spectrum}/Blaze/tools.d.ts +1 -1
- package/modules/Spectrum/CursorPopover.d.ts +6 -0
- package/{components → modules/Spectrum}/FrequencyAllocation/color.d.ts +1 -1
- package/{components → modules/Spectrum}/FrequencyAllocation/model/resolveFrequencyAllocationData.d.ts +1 -1
- package/{components → modules/Spectrum}/FrequencyAllocation/model/resolver.d.ts +1 -1
- package/{components → modules/Spectrum}/FrequencyAllocation/model/useAllocationAtCursor.d.ts +1 -1
- package/{components → modules/Spectrum}/FrequencyAllocation/model/useFrequencyAllocationData.d.ts +1 -1
- package/{components → modules/Spectrum}/FrequencyAllocation/presenters/AllocationInfo/index.d.ts +1 -1
- package/{components → modules/Spectrum}/FrequencyAllocation/presenters/AllocationSegments/index.d.ts +1 -1
- package/{components → modules/Spectrum}/FrequencyAllocation/tools.d.ts +1 -1
- package/{components → modules/Spectrum}/FrequencyAllocation/types.d.ts +1 -1
- package/{components → modules/Spectrum}/FrequencyDataBoard/panels/StationInfoPanel/index.d.ts +1 -1
- package/{components → modules/Spectrum}/FrequencyTagLine/index.d.ts +1 -1
- package/{components → modules/Spectrum}/Markers/MarkerItem/index.d.ts +1 -1
- package/{components → modules/Spectrum}/Markers/hooks/useMarkerEvents.d.ts +1 -1
- package/{components → modules/Spectrum}/Markers/hooks/useMarkers.d.ts +2 -2
- package/{components → modules/Spectrum}/Markers/tools.d.ts +1 -1
- package/{components → modules/Spectrum}/Scope/useScope.d.ts +1 -1
- package/{components → modules/Spectrum}/Signal/model/resolver.d.ts +1 -1
- package/{components → modules/Spectrum}/Signal/model/useStationInfoAtCursor.d.ts +1 -1
- package/{components → modules/Spectrum}/Signal/tools.d.ts +1 -1
- package/{components → modules/Spectrum}/Signal/useSignalDataManager.d.ts +1 -1
- package/{components → modules/Spectrum}/Signal/utils.d.ts +3 -3
- package/modules/Spectrum/render.d.ts +31 -52
- package/{hooks → modules/Spectrum}/useSpectrumAnalyzer/index.d.ts +1 -1
- package/modules/base/BaseRenderer.d.ts +63 -0
- package/modules/base/CircularRenderer.d.ts +4 -5
- package/package.json +21 -4
- package/{modules/tools.d.ts → runtime/passThrough.d.ts} +1 -1
- package/store/chart-store.d.ts +11 -0
- package/store/context.d.ts +5 -2
- package/store/hooks/index.d.ts +1 -1
- package/store/hooks/useStore.d.ts +11 -1
- package/store/index.d.ts +1 -1
- package/store/reducer.d.ts +1 -33
- package/store/runtime.d.ts +16 -0
- package/tailwind-bridge.css +28 -101
- package/theme/init-charts-theme.d.ts +7 -11
- package/theme/style-scope.d.ts +0 -1
- package/{utils/theme.d.ts → theme/theme-color.d.ts} +0 -11
- package/theme/theme-contract.d.ts +28 -0
- package/theme/theme-runtime.d.ts +14 -0
- package/theme/theme-styles.d.ts +10 -0
- package/theme/theme-tokens.d.ts +85 -0
- package/types/common.d.ts +1 -1
- package/types/store/index.d.ts +6 -4
- package/types/store/ui.d.ts +4 -4
- package/utils/index.d.ts +0 -1
- package/utils/subscription.d.ts +18 -3
- package/components/AxisY/heatmap/type/Default/index.d.ts +0 -6
- package/components/AxisYByCanvas/index.d.ts +0 -6
- package/components/Band/index.d.ts +0 -5
- package/components/Band/useBand.d.ts +0 -2
- package/components/Cursor/popovers/index.d.ts +0 -10
- package/components/SignalAnalysis/Switch/index.d.ts +0 -3
- package/components/ToolsBar/registry.d.ts +0 -12
- package/components/ToolsBar/toggles/index.d.ts +0 -10
- package/components/Zoom/ZoomOffsetContainer/index.d.ts +0 -7
- package/lib/LevelStream/useAxisY.d.ts +0 -1
- package/theme/charts-theme-controller.d.ts +0 -27
- package/theme/charts-theme-environment.d.ts +0 -7
- package/theme/shadcn-theme-config.d.ts +0 -221
- /package/{lib → charts}/Dial/Chart.d.ts +0 -0
- /package/{lib → charts}/Dial/index.d.ts +0 -0
- /package/{lib → charts}/Gauge/Chart.d.ts +0 -0
- /package/{lib → charts}/Gauge/index.d.ts +0 -0
- /package/{lib → charts}/Heatmap/Chart.d.ts +0 -0
- /package/{lib → charts}/Heatmap/index.d.ts +0 -0
- /package/{lib → charts}/IQ/Chart.d.ts +0 -0
- /package/{lib → charts}/IQ/index.d.ts +0 -0
- /package/{lib → charts}/LevelStream/Chart.d.ts +0 -0
- /package/{lib → charts}/LevelStream/index.d.ts +0 -0
- /package/{lib → charts}/Occupancy/Chart.d.ts +0 -0
- /package/{lib → charts}/Occupancy/index.d.ts +0 -0
- /package/{lib → charts}/SpatialSpectrum/Chart.d.ts +0 -0
- /package/{lib → charts}/SpatialSpectrum/index.d.ts +0 -0
- /package/{lib → charts}/Spectrum/Chart.d.ts +0 -0
- /package/{lib → charts}/Spectrum/index.d.ts +0 -0
- /package/{lib → charts}/index.d.ts +0 -0
- /package/components/AxisY/heatmap/{type/Default → variants/standard}/GradientRibbon/index.d.ts +0 -0
- /package/components/AxisY/occupancy/{type/Default → variants/standard}/index.d.ts +0 -0
- /package/components/{ToolsBar → Toolbar}/controls/Reset.d.ts +0 -0
- /package/components/{ToolsBar → Toolbar}/controls/SegmentsDisplayControl/index.d.ts +0 -0
- /package/components/{ToolsBar → Toolbar}/controls/SeriesControl/index.d.ts +0 -0
- /package/components/{ToolsBar → Toolbar}/controls/SeriesDisplayControl/index.d.ts +0 -0
- /package/components/{ToolsBar → Toolbar}/controls/index.d.ts +0 -0
- /package/components/{ToolsBar → Toolbar}/decorations/GradientRibbon/index.d.ts +0 -0
- /package/components/{ToolsBar → Toolbar}/decorations/SpacerLine.d.ts +0 -0
- /package/components/{ToolsBar → Toolbar}/decorations/index.d.ts +0 -0
- /package/components/{ToolsBar → Toolbar}/index.d.ts +0 -0
- /package/components/{ToolsBar → Toolbar}/primitives/IconBox.d.ts +0 -0
- /package/components/{ToolsBar → Toolbar}/primitives/ToolbarContentBox.d.ts +0 -0
- /package/components/{ToolsBar → Toolbar}/primitives/ToolbarDropdown.d.ts +0 -0
- /package/components/{ToolsBar → Toolbar}/primitives/ToolbarGlyph.d.ts +0 -0
- /package/components/{ToolsBar → Toolbar}/primitives/ToolbarGroup.d.ts +0 -0
- /package/components/{ToolsBar → Toolbar}/primitives/ToolbarGroupIconBox.d.ts +0 -0
- /package/components/{ToolsBar → Toolbar}/primitives/ToolbarSurface.d.ts +0 -0
- /package/components/{ToolsBar → Toolbar}/primitives/index.d.ts +0 -0
- /package/components/{ToolsBar → Toolbar}/primitives/styles.d.ts +0 -0
- /package/{components/GaugeBox/index.d.ts → modules/Gauge/InteractionSurface.d.ts} +0 -0
- /package/{components/HeatmapCapture → modules/Heatmap/Capture}/Area/index.d.ts +0 -0
- /package/{components/HeatmapCapture → modules/Heatmap/Capture}/RowIndex/index.d.ts +0 -0
- /package/{components/HeatmapCapture → modules/Heatmap/Capture}/Slider/index.d.ts +0 -0
- /package/{components/FrequencyTagLine → modules/Heatmap/Capture}/Switch/index.d.ts +0 -0
- /package/{components/HeatmapCapture → modules/Heatmap/Capture}/index.d.ts +0 -0
- /package/{components/HeatmapCapture → modules/Heatmap/TimeRange}/Switch/index.d.ts +0 -0
- /package/{components → modules/Heatmap}/TimeRange/useTimeRange.d.ts +0 -0
- /package/{components → modules/Spectrum}/Blaze/index.d.ts +0 -0
- /package/{components → modules/Spectrum}/DeltaMeasurement/Switch.d.ts +0 -0
- /package/{components → modules/Spectrum}/DeltaMeasurement/index.d.ts +0 -0
- /package/{components → modules/Spectrum}/DragFrame/index.d.ts +0 -0
- /package/{components → modules/Spectrum}/FrequencyAllocation/Switch/index.d.ts +0 -0
- /package/{components → modules/Spectrum}/FrequencyAllocation/data.d.ts +0 -0
- /package/{components → modules/Spectrum}/FrequencyAllocation/index.d.ts +0 -0
- /package/{components → modules/Spectrum}/FrequencyAllocation/model/index.d.ts +0 -0
- /package/{components → modules/Spectrum}/FrequencyAllocation/overlays/Tooltip/index.d.ts +0 -0
- /package/{components → modules/Spectrum}/FrequencyAllocation/overlays/index.d.ts +0 -0
- /package/{components → modules/Spectrum}/FrequencyAllocation/presenters/index.d.ts +0 -0
- /package/{components → modules/Spectrum}/FrequencyDataBoard/hooks/index.d.ts +0 -0
- /package/{components → modules/Spectrum}/FrequencyDataBoard/hooks/useStationInfoAtCursor.d.ts +0 -0
- /package/{components → modules/Spectrum}/FrequencyDataBoard/index.d.ts +0 -0
- /package/{components → modules/Spectrum}/FrequencyDataBoard/panels/index.d.ts +0 -0
- /package/{components → modules/Spectrum}/FrequencyTagLine/Board/index.d.ts +0 -0
- /package/{components/Limit → modules/Spectrum/FrequencyTagLine}/Switch/index.d.ts +0 -0
- /package/{components → modules/Spectrum}/Legend/index.d.ts +0 -0
- /package/{components → modules/Spectrum}/Limit/Item.d.ts +0 -0
- /package/{components/TimeRange → modules/Spectrum/Limit}/Switch/index.d.ts +0 -0
- /package/{components → modules/Spectrum}/Limit/index.d.ts +0 -0
- /package/{components → modules/Spectrum}/Markers/Switch/index.d.ts +0 -0
- /package/{components → modules/Spectrum}/Markers/index.d.ts +0 -0
- /package/{components → modules/Spectrum}/Scope/index.d.ts +0 -0
- /package/{components → modules/Spectrum}/SegmentsZebra/index.d.ts +0 -0
- /package/{components → modules/Spectrum}/Signal/Switch/index.d.ts +0 -0
- /package/{components → modules/Spectrum}/Signal/index.d.ts +0 -0
- /package/{components → modules/Spectrum}/Signal/metadata/index.d.ts +0 -0
- /package/{components → modules/Spectrum}/Signal/metadata/signalType.d.ts +0 -0
- /package/{components → modules/Spectrum}/Signal/model/index.d.ts +0 -0
- /package/{components → modules/Spectrum}/Signal/model/useUnifiedSignals.d.ts +0 -0
- /package/{components → modules/Spectrum}/Signal/presenters/SignalSegments/index.d.ts +0 -0
- /package/{components → modules/Spectrum}/Signal/presenters/index.d.ts +0 -0
- /package/{components → modules/Spectrum}/Stripe/Switch/index.d.ts +0 -0
- /package/{components → modules/Spectrum}/Stripe/index.d.ts +0 -0
- /package/{hooks/publish → modules/Spectrum}/useMarkerPublish.d.ts +0 -0
- /package/{hooks → modules/Spectrum}/useSpectrumAnalyzer/useTemplateComparison.d.ts +0 -0
|
@@ -1,15 +1,6 @@
|
|
|
1
1
|
import type { ModuleType } from '../config';
|
|
2
2
|
import type { PublishData } from '../types';
|
|
3
|
-
|
|
4
|
-
* 模块订阅所需的图表接口(最小化)
|
|
5
|
-
*/
|
|
6
|
-
interface ChartSubscriptionInterface<TData = unknown> {
|
|
7
|
-
updateSeries?(data: TData): void;
|
|
8
|
-
reset(): void;
|
|
9
|
-
resize(): void;
|
|
10
|
-
}
|
|
11
|
-
type DataExtractor<TData> = (d: PublishData) => TData;
|
|
12
|
-
type CustomHandler = (d: PublishData) => boolean | undefined;
|
|
3
|
+
import { type ChartSubscriptionInterface, type DataExtractor, type ModuleEventHandler, type ModulePublishType } from './module-subscription-core';
|
|
13
4
|
interface UseModuleSubscriptionOptions<TData = unknown> {
|
|
14
5
|
/**
|
|
15
6
|
* 模块类型
|
|
@@ -22,11 +13,23 @@ interface UseModuleSubscriptionOptions<TData = unknown> {
|
|
|
22
13
|
/**
|
|
23
14
|
* 从 PublishData 中提取数据(默认直接传递整个 d)
|
|
24
15
|
*/
|
|
25
|
-
extractData?: DataExtractor<TData>;
|
|
16
|
+
extractData?: DataExtractor<TData, PublishData>;
|
|
17
|
+
/**
|
|
18
|
+
* 显式声明哪些 pstype 视作当前模块的渲染主路径
|
|
19
|
+
*/
|
|
20
|
+
renderPSTypes?: ModulePublishType[];
|
|
21
|
+
/**
|
|
22
|
+
* 当事件没有 pstype 时,是否也视为 render 事件
|
|
23
|
+
*/
|
|
24
|
+
treatMissingPSTypeAsRender?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* 自定义 render 处理逻辑;未提供时走 updateSeries + extractData 默认链路
|
|
27
|
+
*/
|
|
28
|
+
handleRender?: ModuleEventHandler<TData, PublishData>;
|
|
26
29
|
/**
|
|
27
|
-
*
|
|
30
|
+
* 事件级处理器,优先级高于默认 Render/Reset/Resize 行为
|
|
28
31
|
*/
|
|
29
|
-
|
|
32
|
+
eventHandlers?: Partial<Record<ModulePublishType, ModuleEventHandler<TData, PublishData>>>;
|
|
30
33
|
}
|
|
31
34
|
/**
|
|
32
35
|
* 模块订阅 Hook
|
|
@@ -49,18 +52,13 @@ interface UseModuleSubscriptionOptions<TData = unknown> {
|
|
|
49
52
|
* });
|
|
50
53
|
*
|
|
51
54
|
* @example
|
|
52
|
-
* //
|
|
55
|
+
* // 自定义 render 类型或事件处理
|
|
53
56
|
* useModuleSubscription({
|
|
54
|
-
* moduleType: ModuleType.
|
|
57
|
+
* moduleType: ModuleType.Gauge,
|
|
55
58
|
* chart,
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
* // 自定义处理
|
|
59
|
-
* return true; // 已处理
|
|
60
|
-
* }
|
|
61
|
-
* return false; // 继续默认处理
|
|
62
|
-
* }
|
|
59
|
+
* renderPSTypes: [PSType.Gauge],
|
|
60
|
+
* treatMissingPSTypeAsRender: true
|
|
63
61
|
* });
|
|
64
62
|
*/
|
|
65
|
-
export declare function useModuleSubscription<TData = unknown>({ moduleType, chart, extractData,
|
|
63
|
+
export declare function useModuleSubscription<TData = unknown>({ moduleType, chart, extractData, renderPSTypes, treatMissingPSTypeAsRender, handleRender, eventHandlers }: UseModuleSubscriptionOptions<TData>): void;
|
|
66
64
|
export default useModuleSubscription;
|
package/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import './theme/library.css';
|
|
2
|
-
export {
|
|
3
|
-
export { ChartType, FrequencyUnit, MarkerEventType, ModuleType, OptionKey, PSType, SegmentsEvent, SeriesType,
|
|
2
|
+
export { Dial, Gauge, Heatmap, IQ, LevelStream, Occupancy, Spectrum } from './charts';
|
|
3
|
+
export { ChartType, FrequencyUnit, MarkerEventType, ModuleType, OptionKey, PSType, SegmentsEvent, SeriesType, ToolbarItemType, ToolType } from './config';
|
|
4
4
|
export { type EnhancedPublish, useSafePublish, withChartPublisher } from './hooks';
|
|
5
|
-
export {
|
|
6
|
-
export { applyChartsTheme, applyChartsThemePreference, type ChartsThemePreference, type ChartsThemeState, getChartsThemePreference, getChartsThemeState, subscribeChartsThemeChange } from './theme/charts-theme-controller';
|
|
5
|
+
export { setFrequencyAllocationToCache } from './modules/Spectrum/FrequencyAllocation/tools';
|
|
7
6
|
export { type ChartsThemeChange, type InitChartsThemeOptions, type InitChartsThemeResult, initChartsTheme } from './theme/init-charts-theme';
|
|
8
|
-
export {
|
|
7
|
+
export { type ChartsThemePreference, type ChartsThemeState, getChartsThemeState, subscribeChartsThemeChange } from './theme/theme-runtime';
|
|
8
|
+
export type { ChartsSizeTokensConfig, ChartsThemeTokensConfig } from './theme/theme-tokens';
|
|
9
9
|
export type { AxisXProps, AxisYRange, ChartRef, FrequencyAllocationItem, MarkerProps, MarkerType, Publish, PublishData, PublishDial, PublishGauge, PublishHeatmap, PublishIQ, PublishLevelStream, PublishOccupancy, PublishSpectrum, RecursiveFunction, // 递归方法 后期会删除
|
|
10
10
|
RecursiveObject, // 递归对象 后期会删除
|
|
11
11
|
Render, Reset, SegmentsOriginal, SeriesConfig, SetAntennaFactor, SetChannels, SetMarker, SetSegments, SetSeries, SetSpectrumBandwidth, SpectrumBandwidth, SpectrumExtraData, StationInfoType } from './types';
|