@rfkit/charts 1.16.0 → 1.17.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.
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import type { AxisXProps } from '../../../types/index.js';
3
+ import type { BandState } from '../../../types/store/ui.js';
4
+ interface Props {
5
+ band?: BandState;
6
+ frequencyFormat?: AxisXProps['frequencyFormat'];
7
+ }
8
+ declare const _default: React.NamedExoticComponent<Props>;
9
+ export default _default;
@@ -1,9 +1,12 @@
1
1
  import type { SegmentType } from '../../../types/common.js';
2
2
  import { type BandState } from '../../../types/store/ui.js';
3
+ import { type FrequencyRange } from '../../../utils/frequencyCalculation.js';
3
4
  export { resolveBandState } from '../../../store/bandState.js';
4
5
  export interface BandPosition {
5
6
  key: string;
6
7
  left: number;
7
8
  width: number;
8
9
  }
10
+ export declare function resolveBandFrequencyRange(band: BandState, frequencyFormat?: (left: number) => string): FrequencyRange | null;
9
11
  export declare function resolveBandPositions(band: BandState, segments: SegmentType[]): BandPosition[];
12
+ export declare function resolveBandAtPosition(band: BandState, segments: SegmentType[], left: number): BandState | undefined;
@@ -0,0 +1,15 @@
1
+ import type { RectBounds, RectPosition } from '../../../hooks/useDragSelect.js';
2
+ import type { AxisXRange, DeltaMeasurementData } from '../../../types/index.js';
3
+ export interface MeasurementViewport {
4
+ x: readonly [number, number];
5
+ y: readonly [number, number];
6
+ }
7
+ export interface MeasurementSelection {
8
+ x: readonly [number, number];
9
+ y: readonly [number, number];
10
+ }
11
+ export declare const createMeasurementViewport: (totalPoints: number, interval: AxisXRange, range: readonly number[]) => MeasurementViewport | null;
12
+ export declare const selectionFromRect: (rect: RectPosition, viewport: MeasurementViewport) => MeasurementSelection;
13
+ export declare const rectFromSelection: (selection: MeasurementSelection, viewport: MeasurementViewport) => RectPosition;
14
+ export declare const measurementBounds: (rect: RectPosition, viewport: MeasurementViewport) => RectBounds;
15
+ export declare const calculateMeasurement: (selection: MeasurementSelection, frequencyFormat: (left: number) => string, amplitudeOffset?: number) => DeltaMeasurementData | null;
@@ -8,6 +8,7 @@ interface Props {
8
8
  }) => void;
9
9
  updateKey?: number;
10
10
  showSignalInfo?: boolean;
11
+ showBandInfo?: boolean;
11
12
  cursorSample?: CursorSampleSnapshot | null;
12
13
  }
13
14
  declare const _default: React.NamedExoticComponent<Props>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rfkit/charts",
3
- "version": "1.16.0",
3
+ "version": "1.17.0",
4
4
  "type": "module",
5
5
  "description": "Chart components for wireless monitoring web applications",
6
6
  "exports": {
@@ -63,6 +63,12 @@ export interface ZoomProps {
63
63
  type BandSharedProps = {
64
64
  show?: boolean;
65
65
  color?: string;
66
+ details?: {
67
+ name?: string;
68
+ organization?: string;
69
+ modulation?: string;
70
+ remark?: string;
71
+ };
66
72
  };
67
73
  type BandPositionProps = {
68
74
  left?: number;
@@ -99,18 +105,21 @@ export type BandState = {
99
105
  kind: typeof BandKind.Position;
100
106
  show: boolean;
101
107
  color?: string;
108
+ details?: BandSharedProps['details'];
102
109
  left?: number;
103
110
  width: number;
104
111
  } | {
105
112
  kind: typeof BandKind.CenterBandwidth;
106
113
  show: boolean;
107
114
  color?: string;
115
+ details?: BandSharedProps['details'];
108
116
  frequency: number;
109
117
  bandwidth: number;
110
118
  } | {
111
119
  kind: typeof BandKind.FrequencyRange;
112
120
  show: boolean;
113
121
  color?: string;
122
+ details?: BandSharedProps['details'];
114
123
  startFrequency: number;
115
124
  stopFrequency: number;
116
125
  };
package/utils/index.d.ts CHANGED
@@ -7,4 +7,5 @@ export * from './object.js';
7
7
  export * from './throttle.js';
8
8
  export * from './time.js';
9
9
  export declare const createGUID: () => string;
10
+ export declare const createRuntimeID: () => string;
10
11
  export declare const convertToTimestampedArrays: (data: number[][], timestamps?: Array<string>) => TimestampedFloat32Array[];