@rfkit/charts 1.0.85 → 1.0.87
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/engine/index.d.ts +3 -1
- package/engine/webglEngine.d.ts +23 -0
- package/engine/webglExample.d.ts +21 -0
- package/engine/webglSeries.d.ts +22 -0
- package/index.js +28 -27
- package/package.json +1 -1
- package/utils/index.d.ts +13 -0
package/engine/index.d.ts
CHANGED
|
@@ -5,6 +5,8 @@ import IQEye from './iqEye';
|
|
|
5
5
|
import Dial from './dial';
|
|
6
6
|
import Radar from './radar';
|
|
7
7
|
import Gauge from './gauge';
|
|
8
|
+
import WebGLEngine from './webglEngine';
|
|
9
|
+
import WebGLSeries from './webglSeries';
|
|
8
10
|
import { OrientationType, GraphicType, type StateProps } from './type';
|
|
9
|
-
export { Heatmap, Series, IQ, IQEye, OrientationType, GraphicType, Dial, Radar, Gauge, };
|
|
11
|
+
export { Heatmap, Series, IQ, IQEye, OrientationType, GraphicType, Dial, Radar, Gauge, WebGLEngine, WebGLSeries, };
|
|
10
12
|
export type { StateProps };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { StateProps } from './type';
|
|
2
|
+
export default class WebGLEngine {
|
|
3
|
+
state: StateProps & {
|
|
4
|
+
gl?: WebGLRenderingContext;
|
|
5
|
+
program?: WebGLProgram;
|
|
6
|
+
buffers?: {
|
|
7
|
+
position: WebGLBuffer;
|
|
8
|
+
color: WebGLBuffer;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
constructor(props: StateProps);
|
|
12
|
+
updateProps(e: Partial<StateProps>): void;
|
|
13
|
+
init(_p: StateProps): void;
|
|
14
|
+
initWebGL(): void;
|
|
15
|
+
createShaderProgram(): WebGLProgram | null;
|
|
16
|
+
private createShader;
|
|
17
|
+
resize(draw?: boolean): void;
|
|
18
|
+
clear(): void;
|
|
19
|
+
draw(): void;
|
|
20
|
+
drawLines(vertices: Float32Array, colors: Float32Array): void;
|
|
21
|
+
drawTriangles(vertices: Float32Array, colors: Float32Array): void;
|
|
22
|
+
setupBuffers(vertices: Float32Array, colors: Float32Array): void;
|
|
23
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { WebGLSeries } from './index';
|
|
2
|
+
import type { SeriesConfig } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* WebGL Series 使用示例
|
|
5
|
+
*
|
|
6
|
+
* 这个示例展示了如何使用WebGL版本的Series类来替代传统的Canvas 2D绘制
|
|
7
|
+
* WebGL版本提供了更好的性能,特别是在处理大量数据点时
|
|
8
|
+
*/
|
|
9
|
+
export declare function createWebGLChart(containerId: string): WebGLSeries;
|
|
10
|
+
export declare function updateChartData(webglSeries: WebGLSeries): void;
|
|
11
|
+
export declare function performanceComparison(containerId: string): {
|
|
12
|
+
webglSeries: WebGLSeries;
|
|
13
|
+
};
|
|
14
|
+
export declare function multipleGraphicTypes(containerId: string): WebGLSeries;
|
|
15
|
+
export declare function colorGradientBars(containerId: string): WebGLSeries;
|
|
16
|
+
export declare function realTimeUpdate(containerId: string): {
|
|
17
|
+
webglSeries: WebGLSeries;
|
|
18
|
+
cleanup: () => void;
|
|
19
|
+
};
|
|
20
|
+
export declare function checkWebGLSupport(): boolean;
|
|
21
|
+
export declare function createOptimalSeries(containerId: string, seriesConfig: SeriesConfig[]): WebGLSeries;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type StateProps } from './type';
|
|
2
|
+
import WebGLEngine from './webglEngine';
|
|
3
|
+
import type { AxisYRange, RecursiveObject, SeriesConfig } from '../types';
|
|
4
|
+
export default class WebGLSeries extends WebGLEngine {
|
|
5
|
+
private vertexData;
|
|
6
|
+
private colorData;
|
|
7
|
+
private throttledDraw;
|
|
8
|
+
init(props: StateProps): void;
|
|
9
|
+
updateProps(e: RecursiveObject): void;
|
|
10
|
+
clear(): void;
|
|
11
|
+
setRange(range: AxisYRange): void;
|
|
12
|
+
setIntervel(interval: number): void;
|
|
13
|
+
setSeries(e: SeriesConfig): void;
|
|
14
|
+
render(e: SeriesConfig): void;
|
|
15
|
+
private hexToRgba;
|
|
16
|
+
private generateLineVertices;
|
|
17
|
+
private generateSteplineVertices;
|
|
18
|
+
private generateBarVertices;
|
|
19
|
+
private generateCircleVertices;
|
|
20
|
+
private generateRectVertices;
|
|
21
|
+
draw(): void;
|
|
22
|
+
}
|
package/index.js
CHANGED
|
@@ -3244,7 +3244,7 @@ const getDateTime = (t = Date.now(), sep1 = '-', sep2 = ':', time = false)=>{
|
|
|
3244
3244
|
const dateStr = `${year}${sep1}${month}${sep1}${day}`;
|
|
3245
3245
|
return `${dateStr} ${timeStr}`;
|
|
3246
3246
|
};
|
|
3247
|
-
function
|
|
3247
|
+
function utils_throttle(func = ()=>{}, wait = 1000 / 30) {
|
|
3248
3248
|
let prev = 0;
|
|
3249
3249
|
return (...arg)=>{
|
|
3250
3250
|
const now = Date.now();
|
|
@@ -5425,7 +5425,7 @@ const fillImageData = (canvasWidth, canvasHeight, data, imageData, getColor)=>{
|
|
|
5425
5425
|
}
|
|
5426
5426
|
}
|
|
5427
5427
|
};
|
|
5428
|
-
class
|
|
5428
|
+
class ColorInterpolator_ColorInterpolator {
|
|
5429
5429
|
colorsPresetList = [];
|
|
5430
5430
|
range = [
|
|
5431
5431
|
0,
|
|
@@ -5550,7 +5550,7 @@ class Series extends engine_Engine {
|
|
|
5550
5550
|
super.updateProps(e);
|
|
5551
5551
|
const { colors = this.state.colors } = e;
|
|
5552
5552
|
if (this.state.barValue2Color && !this.state.CI) this.updateProps({
|
|
5553
|
-
CI: new
|
|
5553
|
+
CI: new ColorInterpolator_ColorInterpolator(colors, 0, 100, 0.1)
|
|
5554
5554
|
});
|
|
5555
5555
|
}
|
|
5556
5556
|
clear() {
|
|
@@ -5600,7 +5600,7 @@ class Series extends engine_Engine {
|
|
|
5600
5600
|
}
|
|
5601
5601
|
render(e) {
|
|
5602
5602
|
e && this.setSeries(e);
|
|
5603
|
-
|
|
5603
|
+
utils_throttle(()=>{
|
|
5604
5604
|
this.draw();
|
|
5605
5605
|
})();
|
|
5606
5606
|
}
|
|
@@ -6044,7 +6044,7 @@ class Heatmap extends engine_Engine {
|
|
|
6044
6044
|
const [rangeMin, rangeMax] = range;
|
|
6045
6045
|
if (isNumberAlias(rangeMax) && isNumberAlias(rangeMax) && rangeMin < rangeMax) if (this.state.CI) this.state.CI.setColors(colors, rangeMin, rangeMax, 0.1);
|
|
6046
6046
|
else this.updateProps({
|
|
6047
|
-
CI: new
|
|
6047
|
+
CI: new ColorInterpolator_ColorInterpolator(colors, rangeMin, rangeMax, 0.1)
|
|
6048
6048
|
});
|
|
6049
6049
|
}
|
|
6050
6050
|
}
|
|
@@ -6078,7 +6078,7 @@ class Heatmap extends engine_Engine {
|
|
|
6078
6078
|
render(data) {
|
|
6079
6079
|
if (data?.length >= 0) {
|
|
6080
6080
|
this.state.data = data;
|
|
6081
|
-
|
|
6081
|
+
utils_throttle(()=>{
|
|
6082
6082
|
this.draw();
|
|
6083
6083
|
})();
|
|
6084
6084
|
}
|
|
@@ -6106,7 +6106,7 @@ class IQ extends engine_Engine {
|
|
|
6106
6106
|
render(data) {
|
|
6107
6107
|
if (data.IData && data.QData) {
|
|
6108
6108
|
this.state.data = data;
|
|
6109
|
-
|
|
6109
|
+
utils_throttle(()=>{
|
|
6110
6110
|
this.draw();
|
|
6111
6111
|
})();
|
|
6112
6112
|
}
|
|
@@ -6173,7 +6173,7 @@ class iqEye_IQ extends engine_Engine {
|
|
|
6173
6173
|
render(data) {
|
|
6174
6174
|
if (data.IData && data.QData) {
|
|
6175
6175
|
this.state.data = data;
|
|
6176
|
-
|
|
6176
|
+
utils_throttle(()=>{
|
|
6177
6177
|
this.draw();
|
|
6178
6178
|
})();
|
|
6179
6179
|
}
|
|
@@ -8397,7 +8397,7 @@ EventBus_styles_module_options.domAPI = styleDomAPI_default();
|
|
|
8397
8397
|
EventBus_styles_module_options.insertStyleElement = insertStyleElement_default();
|
|
8398
8398
|
injectStylesIntoStyleTag_default()(EventBus_styles_module.Z, EventBus_styles_module_options);
|
|
8399
8399
|
const components_EventBus_styles_module = EventBus_styles_module.Z && EventBus_styles_module.Z.locals ? EventBus_styles_module.Z.locals : void 0;
|
|
8400
|
-
const
|
|
8400
|
+
const EventBus = ({ id })=>{
|
|
8401
8401
|
const { state: { globalID } } = useStore_useStore();
|
|
8402
8402
|
const EID = (0, __WEBPACK_EXTERNAL_MODULE_react__.useMemo)(()=>getEID(id), [
|
|
8403
8403
|
id
|
|
@@ -8443,7 +8443,7 @@ const EventBus_EventBus = ({ id })=>{
|
|
|
8443
8443
|
}, [
|
|
8444
8444
|
EID
|
|
8445
8445
|
]);
|
|
8446
|
-
const handleMouseMove = (0, __WEBPACK_EXTERNAL_MODULE_react__.useCallback)(
|
|
8446
|
+
const handleMouseMove = (0, __WEBPACK_EXTERNAL_MODULE_react__.useCallback)(utils_throttle((e)=>{
|
|
8447
8447
|
createMoveEventManager(EID)(e, calculateEventRelativePosition(e));
|
|
8448
8448
|
updateCursor();
|
|
8449
8449
|
if (dragState.current.isDragging && dragState.current.startPoint.event) {
|
|
@@ -8489,7 +8489,7 @@ const EventBus_EventBus = ({ id })=>{
|
|
|
8489
8489
|
}, [
|
|
8490
8490
|
EID
|
|
8491
8491
|
]);
|
|
8492
|
-
const handleWheel = (0, __WEBPACK_EXTERNAL_MODULE_react__.useCallback)(
|
|
8492
|
+
const handleWheel = (0, __WEBPACK_EXTERNAL_MODULE_react__.useCallback)(utils_throttle((e)=>{
|
|
8493
8493
|
createWheelEventManager(EID)(-1 * e.deltaY, calculateEventRelativePosition(e));
|
|
8494
8494
|
}), [
|
|
8495
8495
|
EID
|
|
@@ -8519,7 +8519,7 @@ const EventBus_EventBus = ({ id })=>{
|
|
|
8519
8519
|
})
|
|
8520
8520
|
});
|
|
8521
8521
|
};
|
|
8522
|
-
const
|
|
8522
|
+
const components_EventBus = EventBus;
|
|
8523
8523
|
const CURSOR_SETACTIVE = (globalID, func)=>subscription_createSubscriptionManager(`CURSOR_SETACTIVE-${globalID}`, '0', func);
|
|
8524
8524
|
function convertCoordToVisualLeft({ coord, zoom, segments }) {
|
|
8525
8525
|
const { left } = coord;
|
|
@@ -9744,7 +9744,7 @@ const Area_Area = (props)=>{
|
|
|
9744
9744
|
});
|
|
9745
9745
|
};
|
|
9746
9746
|
const Area = Area_Area;
|
|
9747
|
-
const
|
|
9747
|
+
const HeatmapCapture_HeatmapCapture = (props)=>{
|
|
9748
9748
|
const { state: { heatmapCapture } } = useStore_useStore();
|
|
9749
9749
|
const { show, type } = heatmapCapture;
|
|
9750
9750
|
if (!show) return null;
|
|
@@ -9756,7 +9756,7 @@ const HeatmapCapture = (props)=>{
|
|
|
9756
9756
|
...props
|
|
9757
9757
|
});
|
|
9758
9758
|
};
|
|
9759
|
-
const
|
|
9759
|
+
const HeatmapCapture = HeatmapCapture_HeatmapCapture;
|
|
9760
9760
|
var Boundary_styles_module = __webpack_require__("../../../../node_modules/.pnpm/@rsbuild+core@1.3.18/node_modules/@rsbuild/core/compiled/css-loader/index.js??ruleSet[1].rules[11].use[1]!builtin:lightningcss-loader??ruleSet[1].rules[11].use[2]!../../../../node_modules/.pnpm/@rsbuild+plugin-less@1.2.4_@rsbuild+core@1.3.22/node_modules/@rsbuild/plugin-less/compiled/less-loader/index.js??ruleSet[1].rules[11].use[3]!./src/components/GridLines/Boundary/styles.module.less");
|
|
9761
9761
|
var Boundary_styles_module_options = {};
|
|
9762
9762
|
Boundary_styles_module_options.styleTagTransform = styleTagTransform_default();
|
|
@@ -9882,7 +9882,7 @@ const Heatmap_Heatmap = (props)=>{
|
|
|
9882
9882
|
children: [
|
|
9883
9883
|
/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(Boundary, {}),
|
|
9884
9884
|
/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(Chart, {}),
|
|
9885
|
-
/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(
|
|
9885
|
+
/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(components_EventBus, {
|
|
9886
9886
|
id: id
|
|
9887
9887
|
}),
|
|
9888
9888
|
/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(components_Markers, {
|
|
@@ -9890,7 +9890,7 @@ const Heatmap_Heatmap = (props)=>{
|
|
|
9890
9890
|
heatmapMode: true,
|
|
9891
9891
|
selecter: selecter
|
|
9892
9892
|
}),
|
|
9893
|
-
/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(
|
|
9893
|
+
/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(HeatmapCapture, {
|
|
9894
9894
|
id: id
|
|
9895
9895
|
}),
|
|
9896
9896
|
/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(components_Cursor, {
|
|
@@ -10160,7 +10160,7 @@ const Occupancy_Occupancy = (props)=>{
|
|
|
10160
10160
|
children: [
|
|
10161
10161
|
/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(Occdahsed, {}),
|
|
10162
10162
|
/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(Chart, {}),
|
|
10163
|
-
/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(
|
|
10163
|
+
/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(components_EventBus, {
|
|
10164
10164
|
id: id
|
|
10165
10165
|
}),
|
|
10166
10166
|
/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(Occupancy_TotalLine, {
|
|
@@ -11506,7 +11506,7 @@ const Board_Board = ({ id })=>{
|
|
|
11506
11506
|
};
|
|
11507
11507
|
const FrequencyMarkerLine_Board = /*#__PURE__*/ __WEBPACK_EXTERNAL_MODULE_react__["default"].memo(Board_Board);
|
|
11508
11508
|
const FrequencyMarkerLine_COMPONENT_KEY = constants_ToolType.FrequencyMarkerLine;
|
|
11509
|
-
const
|
|
11509
|
+
const FrequencyMarkerLine_FrequencyMarkerLine = (props)=>{
|
|
11510
11510
|
const { state: { frequencyMarkerLine }, dispatch } = useStore_useStore();
|
|
11511
11511
|
const { show, display, left, onChange } = frequencyMarkerLine;
|
|
11512
11512
|
const { id } = props;
|
|
@@ -11580,7 +11580,7 @@ const FrequencyMarkerLine = (props)=>{
|
|
|
11580
11580
|
})
|
|
11581
11581
|
});
|
|
11582
11582
|
};
|
|
11583
|
-
const
|
|
11583
|
+
const FrequencyMarkerLine = /*#__PURE__*/ __WEBPACK_EXTERNAL_MODULE_react__["default"].memo(FrequencyMarkerLine_FrequencyMarkerLine);
|
|
11584
11584
|
const Spectrum_Spectrum = (props)=>{
|
|
11585
11585
|
const { selecter, children } = props;
|
|
11586
11586
|
const { state: { axisY: { autoranging }, series: { weaken }, globalID } } = useStore_useStore();
|
|
@@ -11672,7 +11672,7 @@ const Spectrum_Spectrum = (props)=>{
|
|
|
11672
11672
|
heatmapMode: false,
|
|
11673
11673
|
selecter: selecter
|
|
11674
11674
|
}),
|
|
11675
|
-
/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(
|
|
11675
|
+
/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(components_EventBus, {
|
|
11676
11676
|
id: id
|
|
11677
11677
|
}),
|
|
11678
11678
|
/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(components_Limit, {
|
|
@@ -11693,7 +11693,7 @@ const Spectrum_Spectrum = (props)=>{
|
|
|
11693
11693
|
/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(components_Stripe, {
|
|
11694
11694
|
id: id
|
|
11695
11695
|
}),
|
|
11696
|
-
/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(
|
|
11696
|
+
/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(FrequencyMarkerLine, {
|
|
11697
11697
|
id: id
|
|
11698
11698
|
}),
|
|
11699
11699
|
/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(FrequencyAllocation, {}),
|
|
@@ -11704,7 +11704,7 @@ const Spectrum_Spectrum = (props)=>{
|
|
|
11704
11704
|
});
|
|
11705
11705
|
};
|
|
11706
11706
|
const modules_Spectrum = Spectrum_Spectrum;
|
|
11707
|
-
const
|
|
11707
|
+
const Level = (props)=>{
|
|
11708
11708
|
const { state: { axisY, globalID } } = useStore_useStore();
|
|
11709
11709
|
const { opacity } = props;
|
|
11710
11710
|
const { chart, Chart } = hooks_useChart({
|
|
@@ -11733,7 +11733,7 @@ const Level_Level = (props)=>{
|
|
|
11733
11733
|
style: style
|
|
11734
11734
|
});
|
|
11735
11735
|
};
|
|
11736
|
-
const
|
|
11736
|
+
const modules_Level = Level;
|
|
11737
11737
|
function uselevelStreamAnalyzer() {
|
|
11738
11738
|
const { state: { globalID, axisY: { range }, levelStream: { cacheTime, granularity } } } = useStore_useStore();
|
|
11739
11739
|
const analyzer = (0, __WEBPACK_EXTERNAL_MODULE_react__.useRef)(null);
|
|
@@ -11827,7 +11827,7 @@ const LevelStream_Chart_Chart = (props)=>{
|
|
|
11827
11827
|
children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(components_FlexBox, {
|
|
11828
11828
|
children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(modules_Spectrum, {
|
|
11829
11829
|
children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(PluginBox, {
|
|
11830
|
-
children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(
|
|
11830
|
+
children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(modules_Level, {
|
|
11831
11831
|
opacity: 0.5
|
|
11832
11832
|
})
|
|
11833
11833
|
})
|
|
@@ -13141,14 +13141,15 @@ function useSeries() {
|
|
|
13141
13141
|
]);
|
|
13142
13142
|
const updateSeries = (0, __WEBPACK_EXTERNAL_MODULE_react__.useCallback)((config)=>{
|
|
13143
13143
|
if (!config?.name) return;
|
|
13144
|
-
const { name, data } = config;
|
|
13144
|
+
const { name, label, data } = config;
|
|
13145
13145
|
const existingSeries = seriesRef.current.get(name);
|
|
13146
|
+
console.log(label, name, existingSeries?.label, existingSeries?.name);
|
|
13146
13147
|
const newConfig = {
|
|
13147
13148
|
...SERIES_DEFAULT_CONFIG,
|
|
13148
13149
|
...existingSeries,
|
|
13149
13150
|
...config,
|
|
13150
|
-
label:
|
|
13151
|
-
data:
|
|
13151
|
+
label: label || existingSeries?.label || name || existingSeries?.name,
|
|
13152
|
+
data: data || existingSeries?.data
|
|
13152
13153
|
};
|
|
13153
13154
|
if (!constants_SERIES_NAMES.includes(name) && !seriesStore.data.has(name) && void 0 === config.display) newConfig.display = true;
|
|
13154
13155
|
seriesRef.current.set(name, newConfig);
|
package/package.json
CHANGED
package/utils/index.d.ts
CHANGED
|
@@ -91,3 +91,16 @@ export declare const createChartRenderID: ({ moduleType, globalID, }: {
|
|
|
91
91
|
* @returns 转换后的TimestampedFloat32Array数组
|
|
92
92
|
*/
|
|
93
93
|
export declare const convertToTimestampedArrays: (data: number[][], timestamps?: Array<number>) => TimestampedFloat32Array[];
|
|
94
|
+
/**
|
|
95
|
+
* 防抖函数
|
|
96
|
+
* @param fn 需要防抖的函数
|
|
97
|
+
* @param delay 延迟时间(毫秒)
|
|
98
|
+
* @returns 带有cancel方法的防抖函数
|
|
99
|
+
*/
|
|
100
|
+
export declare const debounce: <T extends (...args: unknown[]) => unknown>(fn: T, delay?: number) => ((...args: Parameters<T>) => void) & {
|
|
101
|
+
cancel: () => void;
|
|
102
|
+
};
|
|
103
|
+
/**
|
|
104
|
+
* 基于 requestAnimationFrame 的节流函数,适合视觉更新相关操作
|
|
105
|
+
*/
|
|
106
|
+
export declare function debounceRequestAnimationFrame<T extends unknown[]>(func?: (...args: T) => void): (...args: T) => void;
|