@rfkit/charts 1.4.2 → 1.5.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/README.md +2 -0
- package/components/AxisY/heatmap/index.d.ts +1 -1
- package/components/AxisY/spectrum/index.d.ts +1 -1
- package/components/AxisY/spectrum/presenters/TicksPanel/index.d.ts +1 -1
- package/components/AxisY/spectrum/tools.d.ts +1 -1
- package/components/AxisY/spectrum/useRanging/index.d.ts +1 -1
- package/components/AxisY/spectrum/useRanging/ranging.d.ts +3 -3
- package/components/Cursor/tools.d.ts +3 -1
- package/components/EventBus/useKeyEvent.d.ts +1 -1
- package/components/ui/button.d.ts +8 -8
- package/components/ui/dialog.d.ts +1 -1
- package/components/ui/dropdown-menu.d.ts +1 -1
- package/components/ui/panel.d.ts +4 -4
- package/components/ui/tooltip.d.ts +1 -1
- package/components/ui/useChartsPortalContainer.d.ts +1 -1
- package/hooks/publish/usePublish.d.ts +1 -1
- package/hooks/spectrum/useSpectrumRule.d.ts +1 -1
- package/hooks/useChart/index.d.ts +1 -1
- package/hooks/useDragSelect.d.ts +1 -1
- package/hooks/useLevelStreamAnalyzer.d.ts +1 -1
- package/index.js +326 -219
- package/modules/Spectrum/AxisYCanvas/index.d.ts +2 -2
- package/modules/Spectrum/AxisYCanvas/useCanvasAxisY.d.ts +4 -4
- package/modules/Spectrum/FrequencyAllocation/model/useAllocationAtCursor.d.ts +1 -1
- package/modules/Spectrum/Markers/hooks/useMarkerEvents.d.ts +2 -2
- package/modules/Spectrum/Markers/hooks/useMarkers.d.ts +2 -2
- package/modules/Spectrum/Markers/tools.d.ts +3 -3
- package/modules/Spectrum/Signal/model/useStationInfoAtCursor.d.ts +1 -1
- package/modules/base/BaseRenderer.d.ts +2 -2
- package/modules/base/GradientRenderer.d.ts +4 -4
- package/package.json +1 -1
- package/store/Params.d.ts +1 -1
- package/store/context.d.ts +1 -1
- package/store/globalState.d.ts +2 -1
- package/theme/style-scope.d.ts +1 -1
- package/theme/theme-contract.d.ts +1 -1
- package/types/publish.d.ts +1 -0
- package/utils/converter.d.ts +1 -1
- package/utils/series/events.d.ts +4 -4
- package/utils/series/subscription.d.ts +1 -1
- package/utils/subscription.d.ts +1 -1
package/README.md
CHANGED
|
@@ -94,6 +94,8 @@ export function GaugeDemo() {
|
|
|
94
94
|
- `SetSegments`
|
|
95
95
|
- `SetMarker`
|
|
96
96
|
|
|
97
|
+
`PublishSpectrum` 支持推送内置频谱数据线,包括 `data`、`maxData`、`minData`、`avgData`、`thresholdData`、`templateData`、`backgroundNoiseData` 和 `extraData`。
|
|
98
|
+
|
|
97
99
|
工具栏相关命名统一使用:
|
|
98
100
|
|
|
99
101
|
- 工具栏枚举使用 `ToolbarItemType`
|
|
@@ -4,7 +4,7 @@ import GradientRibbon from './variants/standard/GradientRibbon';
|
|
|
4
4
|
export { GradientRibbon };
|
|
5
5
|
interface Props {
|
|
6
6
|
id: string;
|
|
7
|
-
chart: RenderChartType;
|
|
7
|
+
chart: RenderChartType | null;
|
|
8
8
|
}
|
|
9
9
|
declare const AxisYHeatmap: React.FC<Props>;
|
|
10
10
|
export default AxisYHeatmap;
|
|
@@ -2,7 +2,7 @@ import type React from 'react';
|
|
|
2
2
|
import type { AxisYRange } from '../../../../../types';
|
|
3
3
|
interface RangeProps {
|
|
4
4
|
onChange(): unknown;
|
|
5
|
-
move?: (value: number
|
|
5
|
+
move?: (value: number) => void;
|
|
6
6
|
focus?: (options: {
|
|
7
7
|
isHand: string;
|
|
8
8
|
}) => void;
|
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* @returns {T} 下一个值
|
|
6
6
|
*/
|
|
7
7
|
export declare const nextItem: <T extends string | number>(v: T, list: T[]) => T;
|
|
8
|
-
export declare function findNeighbors(currentValue: number, arr: number[], deltaY: number): number;
|
|
8
|
+
export declare function findNeighbors(currentValue: number, arr: number[], deltaY: number): number | null | undefined;
|
|
@@ -3,7 +3,7 @@ import type { RenderChartType } from '../../../../types';
|
|
|
3
3
|
import Ranging, { RangeController, useRangeAutoFocus, useRangeMove, useRangeSet } from './ranging';
|
|
4
4
|
import { getVirtualLevel, range2realRange } from './tools';
|
|
5
5
|
interface Props {
|
|
6
|
-
chart: RenderChartType;
|
|
6
|
+
chart: RenderChartType | null;
|
|
7
7
|
}
|
|
8
8
|
declare const useRange: ({ chart }: Props) => Ranging;
|
|
9
9
|
export default useRange;
|
|
@@ -44,8 +44,8 @@ declare class RangeController {
|
|
|
44
44
|
* @param {*} func
|
|
45
45
|
* @returns
|
|
46
46
|
*/
|
|
47
|
-
export declare const useRangeAutoFocus: (id: string, func?: RecursiveFunction) => (...args: any[]) => void;
|
|
48
|
-
export declare const useRangeMove: (globalID: string, func?: RecursiveFunction) => (...args: any[]) => void;
|
|
49
|
-
export declare const useRangeSet: (globalID: string, func?: RecursiveFunction) => (...args: any[]) => void;
|
|
47
|
+
export declare const useRangeAutoFocus: (id: string, func?: RecursiveFunction<[]>) => (...args: any[]) => void;
|
|
48
|
+
export declare const useRangeMove: (globalID: string, func?: RecursiveFunction<[number]>) => (...args: any[]) => void;
|
|
49
|
+
export declare const useRangeSet: (globalID: string, func?: RecursiveFunction<[AxisYRange]>) => (...args: any[]) => void;
|
|
50
50
|
export { RangeController };
|
|
51
51
|
export default RangeController;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { RecursiveFunction } from '../../types';
|
|
2
|
-
|
|
2
|
+
type CursorTimer = ReturnType<typeof setTimeout> | null;
|
|
3
|
+
export declare const CURSOR_TIMEOUT: (globalID: string, timer?: CursorTimer) => CursorTimer;
|
|
3
4
|
export declare const CURSOR_SETACTIVE: (globalID: string, func?: RecursiveFunction) => (...args: any[]) => void;
|
|
4
5
|
/**
|
|
5
6
|
* 将位置信息转换为视觉left
|
|
@@ -33,3 +34,4 @@ export declare function convertVisualLeftToRealLeft({ visualLeft, zoom, segments
|
|
|
33
34
|
totalPoints: number;
|
|
34
35
|
};
|
|
35
36
|
}): number;
|
|
37
|
+
export {};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { RecursiveFunction } from '../../types';
|
|
2
|
-
export declare function subscriptionKeyBus(globalID: string, EID: string, func?: RecursiveFunction): (...args: any[]) => void;
|
|
2
|
+
export declare function subscriptionKeyBus(globalID: string, EID: string, func?: RecursiveFunction<[KeyboardEvent]>): (...args: any[]) => void;
|
|
3
3
|
export default function useKeyEvent(globalID: string, EID: string): void;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { type VariantProps } from 'class-variance-authority';
|
|
2
2
|
import type { ButtonHTMLAttributes } from 'react';
|
|
3
|
-
declare const buttonVariants: (props?: {
|
|
4
|
-
variant?: "link" | "destructive" | "secondary" | "default" | "outline" | "ghost";
|
|
5
|
-
size?: "default" | "icon" | "sm" | "lg";
|
|
6
|
-
} & import("class-variance-authority/types").ClassProp) => string;
|
|
3
|
+
declare const buttonVariants: (props?: ({
|
|
4
|
+
variant?: "link" | "destructive" | "secondary" | "default" | "outline" | "ghost" | null | undefined;
|
|
5
|
+
size?: "default" | "icon" | "sm" | "lg" | null | undefined;
|
|
6
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
7
|
export type ButtonProps = ButtonHTMLAttributes<HTMLButtonElement> & VariantProps<typeof buttonVariants> & {
|
|
8
8
|
asChild?: boolean;
|
|
9
9
|
};
|
|
10
|
-
export declare const Button: import("react").ForwardRefExoticComponent<ButtonHTMLAttributes<HTMLButtonElement> & VariantProps<(props?: {
|
|
11
|
-
variant?: "link" | "destructive" | "secondary" | "default" | "outline" | "ghost";
|
|
12
|
-
size?: "default" | "icon" | "sm" | "lg";
|
|
13
|
-
} & import("class-variance-authority/types").ClassProp) => string> & {
|
|
10
|
+
export declare const Button: import("react").ForwardRefExoticComponent<ButtonHTMLAttributes<HTMLButtonElement> & VariantProps<(props?: ({
|
|
11
|
+
variant?: "link" | "destructive" | "secondary" | "default" | "outline" | "ghost" | null | undefined;
|
|
12
|
+
size?: "default" | "icon" | "sm" | "lg" | null | undefined;
|
|
13
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string> & {
|
|
14
14
|
asChild?: boolean;
|
|
15
15
|
} & import("react").RefAttributes<HTMLButtonElement>>;
|
|
16
16
|
export { buttonVariants };
|
|
@@ -2,7 +2,7 @@ import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
declare function Dialog({ ...props }: React.ComponentProps<typeof DialogPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
declare function DialogTrigger({ ...props }: React.ComponentProps<typeof DialogPrimitive.Trigger>): import("react/jsx-runtime").JSX.Element;
|
|
5
|
-
declare function DialogPortal({ ...props }: React.ComponentProps<typeof DialogPrimitive.Portal>): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
declare function DialogPortal({ ...props }: React.ComponentProps<typeof DialogPrimitive.Portal>): import("react/jsx-runtime").JSX.Element | null;
|
|
6
6
|
declare const DialogOverlay: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogOverlayProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
7
7
|
declare const DialogContent: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
8
8
|
declare function DialogHeader({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -2,7 +2,7 @@ import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
declare function DropdownMenu({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
declare const DropdownMenuTrigger: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
5
|
-
declare function DropdownMenuPortal({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Portal>): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
declare function DropdownMenuPortal({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Portal>): import("react/jsx-runtime").JSX.Element | null;
|
|
6
6
|
declare function DropdownMenuContent({ className, sideOffset, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Content>): import("react/jsx-runtime").JSX.Element;
|
|
7
7
|
declare const DropdownMenuItem: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
8
8
|
declare const DropdownMenuSeparator: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuSeparatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
package/components/ui/panel.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { type VariantProps } from 'class-variance-authority';
|
|
2
2
|
import { type HTMLAttributes } from 'react';
|
|
3
|
-
export declare const panelVariants: (props?: {
|
|
4
|
-
variant?: "default" | "ghost" | "subtle" | "floating";
|
|
5
|
-
size?: "sm" | "lg" | "xs" | "md";
|
|
6
|
-
} & import("class-variance-authority/types").ClassProp) => string;
|
|
3
|
+
export declare const panelVariants: (props?: ({
|
|
4
|
+
variant?: "default" | "ghost" | "subtle" | "floating" | null | undefined;
|
|
5
|
+
size?: "sm" | "lg" | "xs" | "md" | null | undefined;
|
|
6
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
7
|
export interface PanelProps extends HTMLAttributes<HTMLDivElement>, VariantProps<typeof panelVariants> {
|
|
8
8
|
}
|
|
9
9
|
export declare const Panel: import("react").ForwardRefExoticComponent<PanelProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -3,5 +3,5 @@ import type * as React from 'react';
|
|
|
3
3
|
declare function TooltipProvider({ delayDuration, ...props }: React.ComponentProps<typeof TooltipPrimitive.Provider>): import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
declare function Tooltip({ ...props }: React.ComponentProps<typeof TooltipPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
5
5
|
declare function TooltipTrigger({ ...props }: React.ComponentProps<typeof TooltipPrimitive.Trigger>): import("react/jsx-runtime").JSX.Element;
|
|
6
|
-
declare function TooltipContent({ className, sideOffset, children, ...props }: React.ComponentProps<typeof TooltipPrimitive.Content>): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
declare function TooltipContent({ className, sideOffset, children, ...props }: React.ComponentProps<typeof TooltipPrimitive.Content>): import("react/jsx-runtime").JSX.Element | null;
|
|
7
7
|
export { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const useChartsPortalContainer: (slot: string) => HTMLElement;
|
|
1
|
+
export declare const useChartsPortalContainer: (slot: string) => HTMLElement | null;
|
|
@@ -3,7 +3,7 @@ import { type CSMCallback } from '../../utils/subscription';
|
|
|
3
3
|
export declare const PUB_SUB: (globalID: string, func?: CSMCallback) => (...args: any[]) => void;
|
|
4
4
|
interface Props {
|
|
5
5
|
subscribe?: CSMCallback;
|
|
6
|
-
publish
|
|
6
|
+
publish?: Publish;
|
|
7
7
|
}
|
|
8
8
|
declare const usePublish: ({ publish, subscribe }: Props) => void;
|
|
9
9
|
export default usePublish;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { ChartType } from '../../config';
|
|
2
2
|
import type { PublishData, RecursiveFunction } from '../../types';
|
|
3
|
-
export declare const SET_SEGMENTS_DISPLAY: (globalID: string, func?: RecursiveFunction) => (...args: any[]) => void;
|
|
3
|
+
export declare const SET_SEGMENTS_DISPLAY: (globalID: string, func?: RecursiveFunction<[number | undefined]>) => (...args: any[]) => void;
|
|
4
4
|
export default function useSpectrumRule(type: ChartType): (e: PublishData) => void;
|
|
@@ -15,7 +15,7 @@ interface Props<T extends RenderChartType = RenderChartType> {
|
|
|
15
15
|
}
|
|
16
16
|
declare const useChart: <T extends RenderChartType = RenderChartType>(props: Props<T>) => {
|
|
17
17
|
id: string;
|
|
18
|
-
chart: T;
|
|
18
|
+
chart: T | null;
|
|
19
19
|
Chart: (e: React.HTMLAttributes<HTMLDivElement>) => import("react/jsx-runtime").JSX.Element;
|
|
20
20
|
};
|
|
21
21
|
export default useChart;
|
package/hooks/useDragSelect.d.ts
CHANGED
|
@@ -27,7 +27,7 @@ export declare const useDragSelect: (config?: UseDragSelectConfig) => {
|
|
|
27
27
|
rect: RectPosition;
|
|
28
28
|
isDragging: boolean;
|
|
29
29
|
dragType: DragType;
|
|
30
|
-
containerRef: import("react").RefObject<HTMLDivElement>;
|
|
30
|
+
containerRef: import("react").RefObject<HTMLDivElement | null>;
|
|
31
31
|
handleMouseDown: (e: React.MouseEvent<HTMLDivElement>, type: DragType) => void;
|
|
32
32
|
resetRect: (newRect: Partial<RectPosition>) => void;
|
|
33
33
|
setRect: (newRect: RectPosition) => void;
|
|
@@ -4,7 +4,7 @@ interface levelStreamRenderData {
|
|
|
4
4
|
spectrumData: Float32Array;
|
|
5
5
|
}
|
|
6
6
|
export default function useLevelStreamAnalyzer(): {
|
|
7
|
-
analyzer: LevelStreamAnalyzer;
|
|
7
|
+
analyzer: LevelStreamAnalyzer | null;
|
|
8
8
|
updateLevelStreamData: (renderData: levelStreamRenderData) => void;
|
|
9
9
|
};
|
|
10
10
|
export {};
|