@rfkit/charts 1.2.23 → 1.2.24

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 CHANGED
@@ -187,7 +187,7 @@ export interface PublishSpectrum {
187
187
  templateData?: Float32Array;
188
188
  extraData?: SpectrumExtraData;
189
189
  // 瀑布图可选参数
190
- timestamp?: number;
190
+ timestamp?: string;
191
191
  // 扫描可选参数
192
192
  offset?: number; // 当前段的点偏移量
193
193
  segmentOffset?: number; // 当前段的索引
@@ -1,7 +1,7 @@
1
- import type React from 'react';
1
+ import React from 'react';
2
2
  interface Props {
3
3
  id: string;
4
4
  inside?: boolean;
5
5
  }
6
- declare const Ticks: React.FC<Props>;
7
- export default Ticks;
6
+ declare const _default: React.NamedExoticComponent<Props>;
7
+ export default _default;
@@ -14,12 +14,8 @@ export declare const defaultAreaInfoResult: {
14
14
  endIndex: number;
15
15
  startCol: number;
16
16
  endCol: number;
17
- startTimestamp: number;
18
- startTimestampFormat: string;
19
- endTimestamp: number;
20
- endTimestampFormat: string;
21
- duration: number;
22
- durationFormat: string;
17
+ startTimestamp: string;
18
+ endTimestamp: string;
23
19
  startFrequency: number;
24
20
  startFrequencyFormat: string;
25
21
  endFrequency: number;
package/index.js CHANGED
@@ -125,8 +125,8 @@ var __webpack_modules__ = {
125
125
  Ax: ()=>leftSegments2frequency,
126
126
  Bp: ()=>isdBm,
127
127
  Ce: ()=>_frequencyCalculation__WEBPACK_IMPORTED_MODULE_0__.Ce,
128
- Fc: ()=>getDateTime,
129
128
  IS: ()=>generateFrequencySegments,
129
+ JP: ()=>dateTimeToTimestamp,
130
130
  LB: ()=>_frequencyCalculation__WEBPACK_IMPORTED_MODULE_0__.LB,
131
131
  P2: ()=>throttle1,
132
132
  P9: ()=>convertToTimestampedArrays,
@@ -136,6 +136,7 @@ var __webpack_modules__ = {
136
136
  SF: ()=>createGUID,
137
137
  cE: ()=>_frequencyCalculation__WEBPACK_IMPORTED_MODULE_0__.cE,
138
138
  hK: ()=>_frequencyCalculation__WEBPACK_IMPORTED_MODULE_0__.hK,
139
+ i$: ()=>formatTimestamp,
139
140
  ih: ()=>_frequencyCalculation__WEBPACK_IMPORTED_MODULE_0__.ih,
140
141
  kL: ()=>getDimInfo,
141
142
  lj: ()=>getFrequencyToFixed,
@@ -152,27 +153,58 @@ var __webpack_modules__ = {
152
153
  });
153
154
  var _frequencyCalculation__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./src/utils/frequencyCalculation.ts");
154
155
  const createGUID = ()=>((1 + Math.random()) * 0x10000 | 0).toString(16).substring(1);
155
- const getDateTime = (t = Date.now(), sep1 = '-', sep2 = ':', time = false)=>{
156
- if (!t) return '';
157
- let timestamp;
158
- if (t instanceof Date) timestamp = t.getTime();
159
- else {
160
- if ('number' != typeof t) return '';
161
- timestamp = t;
162
- if (10 === timestamp.toString().length) timestamp *= 1000;
156
+ const formatTimestamp = (input = Date.now(), options)=>{
157
+ if (null == input) return '';
158
+ let ts = 0;
159
+ if ('number' == typeof input) {
160
+ ts = input;
161
+ if (ts > 0 && ts < 10000000000) ts *= 1000;
162
+ } else ts = input.getTime();
163
+ const d = new Date(ts);
164
+ const time = d.getTime();
165
+ if (!Number.isFinite(time)) return '';
166
+ const { dateSeparator = '-', timeSeparator = ':', timeOnly = false } = options ?? {};
167
+ const y = d.getFullYear();
168
+ const m = `${d.getMonth() + 1}`.padStart(2, '0');
169
+ const dd = `${d.getDate()}`.padStart(2, '0');
170
+ const hh = `${d.getHours()}`.padStart(2, '0');
171
+ const mm = `${d.getMinutes()}`.padStart(2, '0');
172
+ const ss = `${d.getSeconds()}`.padStart(2, '0');
173
+ const tStr = `${hh}${timeSeparator}${mm}${timeSeparator}${ss}`;
174
+ if (timeOnly) return tStr;
175
+ const dStr = `${y}${dateSeparator}${m}${dateSeparator}${dd}`;
176
+ return `${dStr} ${tStr}`;
177
+ };
178
+ const dateTimeToTimestamp = (dateTimeStr, sep1 = '-', sep2 = ':', isTimeOnly = false)=>{
179
+ if ('string' != typeof dateTimeStr) {
180
+ console.error("dateTimeToTimestamp: \u8F93\u5165\u5FC5\u987B\u662F\u5B57\u7B26\u4E32");
181
+ return -1;
182
+ }
183
+ let year = 0, month = 0, day = 0, hours = 0, minutes = 0, seconds = 0;
184
+ if (isTimeOnly) {
185
+ const timeParts = dateTimeStr.split(sep2);
186
+ if (3 !== timeParts.length) return -1;
187
+ hours = parseInt(timeParts[0], 10) || 0;
188
+ minutes = parseInt(timeParts[1], 10) || 0;
189
+ seconds = parseInt(timeParts[2], 10) || 0;
190
+ const now = new Date();
191
+ return new Date(now.getFullYear(), now.getMonth(), now.getDate(), hours, minutes, seconds).getTime();
163
192
  }
164
- const date = new Date(timestamp);
165
- if (Number.isNaN(date.getTime())) return '';
166
- const year = date.getFullYear();
167
- const month = String(date.getMonth() + 1).padStart(2, '0');
168
- const day = String(date.getDate()).padStart(2, '0');
169
- const hours = String(date.getHours()).padStart(2, '0');
170
- const minutes = String(date.getMinutes()).padStart(2, '0');
171
- const seconds = String(date.getSeconds()).padStart(2, '0');
172
- const timeStr = `${hours}${sep2}${minutes}${sep2}${seconds}`;
173
- if (time) return timeStr;
174
- const dateStr = `${year}${sep1}${month}${sep1}${day}`;
175
- return `${dateStr} ${timeStr}`;
193
+ const partsBySpace = dateTimeStr.split(' ');
194
+ if (2 !== partsBySpace.length) return -1;
195
+ const [datePart, timePart] = partsBySpace;
196
+ const dateParts = datePart.split(sep1);
197
+ if (3 !== dateParts.length) return -1;
198
+ year = parseInt(dateParts[0], 10) || 0;
199
+ month = parseInt(dateParts[1], 10) || 0;
200
+ day = parseInt(dateParts[2], 10) || 0;
201
+ const timeParts = timePart.split(sep2);
202
+ if (3 !== timeParts.length) return -1;
203
+ hours = parseInt(timeParts[0], 10) || 0;
204
+ minutes = parseInt(timeParts[1], 10) || 0;
205
+ seconds = parseInt(timeParts[2], 10) || 0;
206
+ const date = new Date(year, month - 1, day, hours, minutes, seconds);
207
+ return date.getTime();
176
208
  };
177
209
  function throttle1(func = ()=>{}, wait = 1000 / 30) {
178
210
  let prev = 0;
@@ -705,7 +737,7 @@ var __webpack_modules__ = {
705
737
  };
706
738
  const __WEBPACK_DEFAULT_EXPORT__ = ___CSS_LOADER_EXPORT___;
707
739
  },
708
- "../../../../../../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.5.0_@rsbuild+core@1.6.9/node_modules/@rsbuild/plugin-less/compiled/less-loader/index.js??ruleSet[1].rules[11].use[3]!./src/components/AxisY/heatmap/components/FullTicks/styles.module.less": function(module, __webpack_exports__, __webpack_require__) {
740
+ "../../../../../../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.5.0_@rsbuild+core@1.6.9/node_modules/@rsbuild/plugin-less/compiled/less-loader/index.js??ruleSet[1].rules[11].use[3]!./src/components/AxisY/heatmap/components/Ticks/styles.module.less": function(module, __webpack_exports__, __webpack_require__) {
709
741
  __webpack_require__.d(__webpack_exports__, {
710
742
  Z: ()=>__WEBPACK_DEFAULT_EXPORT__
711
743
  });
@@ -716,7 +748,7 @@ var __webpack_modules__ = {
716
748
  var ___CSS_LOADER_EXPORT___ = _node_modules_pnpm_rsbuild_core_1_3_18_node_modules_rsbuild_core_compiled_css_loader_api_js__WEBPACK_IMPORTED_MODULE_1___default()(_node_modules_pnpm_rsbuild_core_1_3_18_node_modules_rsbuild_core_compiled_css_loader_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default());
717
749
  ___CSS_LOADER_EXPORT___.push([
718
750
  module.id,
719
- `.ticks-xEFqwB {
751
+ `.ticks-jNI7Tw {
720
752
  z-index: 2;
721
753
  opacity: .5;
722
754
  box-sizing: border-box;
@@ -732,7 +764,7 @@ var __webpack_modules__ = {
732
764
  position: relative;
733
765
  }
734
766
 
735
- .ticks-xEFqwB .tick-LfGNCR {
767
+ .ticks-jNI7Tw .tick-lQRfPY {
736
768
  text-align: right;
737
769
  justify-content: flex-end;
738
770
  align-items: center;
@@ -743,53 +775,19 @@ var __webpack_modules__ = {
743
775
  transform: translateY(-50%)scaleX(.85);
744
776
  }
745
777
 
746
- .ticks-xEFqwB .tick-LfGNCR:first-child {
778
+ .ticks-jNI7Tw .tick-lQRfPY:first-child {
747
779
  transform: translateY(-100%)scaleX(.85);
748
780
  }
749
781
 
750
- .ticks-xEFqwB .tick-LfGNCR:last-child {
782
+ .ticks-jNI7Tw .tick-lQRfPY:last-child {
751
783
  transform: translateY(0%)scaleX(.85);
752
784
  }
753
785
  `,
754
786
  ""
755
787
  ]);
756
788
  ___CSS_LOADER_EXPORT___.locals = {
757
- ticks: "ticks-xEFqwB",
758
- tick: "tick-LfGNCR"
759
- };
760
- const __WEBPACK_DEFAULT_EXPORT__ = ___CSS_LOADER_EXPORT___;
761
- },
762
- "../../../../../../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.5.0_@rsbuild+core@1.6.9/node_modules/@rsbuild/plugin-less/compiled/less-loader/index.js??ruleSet[1].rules[11].use[3]!./src/components/AxisY/heatmap/components/Ticks/styles.module.less": function(module, __webpack_exports__, __webpack_require__) {
763
- __webpack_require__.d(__webpack_exports__, {
764
- Z: ()=>__WEBPACK_DEFAULT_EXPORT__
765
- });
766
- var _node_modules_pnpm_rsbuild_core_1_3_18_node_modules_rsbuild_core_compiled_css_loader_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/.pnpm/@rsbuild+core@1.3.18/node_modules/@rsbuild/core/compiled/css-loader/noSourceMaps.js");
767
- var _node_modules_pnpm_rsbuild_core_1_3_18_node_modules_rsbuild_core_compiled_css_loader_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/ __webpack_require__.n(_node_modules_pnpm_rsbuild_core_1_3_18_node_modules_rsbuild_core_compiled_css_loader_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
768
- var _node_modules_pnpm_rsbuild_core_1_3_18_node_modules_rsbuild_core_compiled_css_loader_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/.pnpm/@rsbuild+core@1.3.18/node_modules/@rsbuild/core/compiled/css-loader/api.js");
769
- var _node_modules_pnpm_rsbuild_core_1_3_18_node_modules_rsbuild_core_compiled_css_loader_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/ __webpack_require__.n(_node_modules_pnpm_rsbuild_core_1_3_18_node_modules_rsbuild_core_compiled_css_loader_api_js__WEBPACK_IMPORTED_MODULE_1__);
770
- var ___CSS_LOADER_EXPORT___ = _node_modules_pnpm_rsbuild_core_1_3_18_node_modules_rsbuild_core_compiled_css_loader_api_js__WEBPACK_IMPORTED_MODULE_1___default()(_node_modules_pnpm_rsbuild_core_1_3_18_node_modules_rsbuild_core_compiled_css_loader_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default());
771
- ___CSS_LOADER_EXPORT___.push([
772
- module.id,
773
- `.ticks-jNI7Tw {
774
- z-index: 2;
775
- opacity: .5;
776
- box-sizing: border-box;
777
- width: 100%;
778
- height: 100%;
779
- color: var(--theme-color-base);
780
- flex-flow: column;
781
- justify-content: space-between;
782
- align-items: flex-end;
783
- padding-right: 2px;
784
- font-size: 12px;
785
- display: flex;
786
- position: relative;
787
- }
788
- `,
789
- ""
790
- ]);
791
- ___CSS_LOADER_EXPORT___.locals = {
792
- ticks: "ticks-jNI7Tw"
789
+ ticks: "ticks-jNI7Tw",
790
+ tick: "tick-lQRfPY"
793
791
  };
794
792
  const __WEBPACK_DEFAULT_EXPORT__ = ___CSS_LOADER_EXPORT___;
795
793
  },
@@ -4365,7 +4363,6 @@ function defaultState_createParams() {
4365
4363
  type: axisYTypeList["default"],
4366
4364
  hidden: [],
4367
4365
  linkage: true,
4368
- heatmapFullTicks: void 0,
4369
4366
  onChange: ()=>{}
4370
4367
  },
4371
4368
  axisX: {
@@ -7888,18 +7885,19 @@ function useSpectrumRule(type) {
7888
7885
  }, []);
7889
7886
  return handleSpectrumRule;
7890
7887
  }
7891
- var FullTicks_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.5.0_@rsbuild+core@1.6.9/node_modules/@rsbuild/plugin-less/compiled/less-loader/index.js??ruleSet[1].rules[11].use[3]!./src/components/AxisY/heatmap/components/FullTicks/styles.module.less");
7892
- var FullTicks_styles_module_options = {};
7893
- FullTicks_styles_module_options.styleTagTransform = styleTagTransform_default();
7894
- FullTicks_styles_module_options.setAttributes = setAttributesWithoutAttributes_default();
7895
- FullTicks_styles_module_options.insert = insertBySelector_default().bind(null, "head");
7896
- FullTicks_styles_module_options.domAPI = styleDomAPI_default();
7897
- FullTicks_styles_module_options.insertStyleElement = insertStyleElement_default();
7898
- injectStylesIntoStyleTag_default()(FullTicks_styles_module.Z, FullTicks_styles_module_options);
7899
- const components_FullTicks_styles_module = FullTicks_styles_module.Z && FullTicks_styles_module.Z.locals ? FullTicks_styles_module.Z.locals : void 0;
7888
+ var Ticks_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.5.0_@rsbuild+core@1.6.9/node_modules/@rsbuild/plugin-less/compiled/less-loader/index.js??ruleSet[1].rules[11].use[3]!./src/components/AxisY/heatmap/components/Ticks/styles.module.less");
7889
+ var Ticks_styles_module_options = {};
7890
+ Ticks_styles_module_options.styleTagTransform = styleTagTransform_default();
7891
+ Ticks_styles_module_options.setAttributes = setAttributesWithoutAttributes_default();
7892
+ Ticks_styles_module_options.insert = insertBySelector_default().bind(null, "head");
7893
+ Ticks_styles_module_options.domAPI = styleDomAPI_default();
7894
+ Ticks_styles_module_options.insertStyleElement = insertStyleElement_default();
7895
+ injectStylesIntoStyleTag_default()(Ticks_styles_module.Z, Ticks_styles_module_options);
7896
+ const components_Ticks_styles_module = Ticks_styles_module.Z && Ticks_styles_module.Z.locals ? Ticks_styles_module.Z.locals : void 0;
7900
7897
  const COMPONENT_KEY = 'AxisYHeatmapTicks';
7898
+ const calcTimeDiffLastTwoDigits = (time)=>time?.slice?.(-8);
7901
7899
  const HEATMAP_FULL_TICKS = 10;
7902
- const FullTicks_Ticks = (props)=>{
7900
+ const Ticks_Ticks = (props)=>{
7903
7901
  const { id } = props;
7904
7902
  const { state: { globalID } } = useStore_useStore();
7905
7903
  const [timeValues, setTimeValues] = (0, __WEBPACK_EXTERNAL_MODULE_react__.useState)(Array(HEATMAP_FULL_TICKS).fill(''));
@@ -7916,7 +7914,7 @@ const FullTicks_Ticks = (props)=>{
7916
7914
  for(let i = 0; i < HEATMAP_FULL_TICKS; i++){
7917
7915
  const index = Math.floor((dataLength - 1) * i / (HEATMAP_FULL_TICKS - 1));
7918
7916
  const data = waterfallData[index];
7919
- const value = data?.timestamp ? (0, utils.Fc)(data.timestamp, void 0, void 0, true) : '';
7917
+ const value = calcTimeDiffLastTwoDigits(data?.timestamp);
7920
7918
  values.push(value);
7921
7919
  }
7922
7920
  setTimeValues(values);
@@ -7926,64 +7924,17 @@ const FullTicks_Ticks = (props)=>{
7926
7924
  globalID
7927
7925
  ]);
7928
7926
  return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("div", {
7929
- className: components_FullTicks_styles_module.ticks,
7927
+ className: components_Ticks_styles_module.ticks,
7930
7928
  children: positions.map((position, index)=>/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("div", {
7931
- className: components_FullTicks_styles_module.tick,
7929
+ className: components_Ticks_styles_module.tick,
7932
7930
  style: {
7933
7931
  top: position
7934
7932
  },
7935
7933
  children: timeValues[index]
7936
- }, index))
7934
+ }, `tick-${position}`))
7937
7935
  });
7938
7936
  };
7939
- const FullTicks = /*#__PURE__*/ __WEBPACK_EXTERNAL_MODULE_react__["default"].memo(FullTicks_Ticks);
7940
- var Ticks_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.5.0_@rsbuild+core@1.6.9/node_modules/@rsbuild/plugin-less/compiled/less-loader/index.js??ruleSet[1].rules[11].use[3]!./src/components/AxisY/heatmap/components/Ticks/styles.module.less");
7941
- var Ticks_styles_module_options = {};
7942
- Ticks_styles_module_options.styleTagTransform = styleTagTransform_default();
7943
- Ticks_styles_module_options.setAttributes = setAttributesWithoutAttributes_default();
7944
- Ticks_styles_module_options.insert = insertBySelector_default().bind(null, "head");
7945
- Ticks_styles_module_options.domAPI = styleDomAPI_default();
7946
- Ticks_styles_module_options.insertStyleElement = insertStyleElement_default();
7947
- injectStylesIntoStyleTag_default()(Ticks_styles_module.Z, Ticks_styles_module_options);
7948
- const components_Ticks_styles_module = Ticks_styles_module.Z && Ticks_styles_module.Z.locals ? Ticks_styles_module.Z.locals : void 0;
7949
- const Ticks_COMPONENT_KEY = 'AxisYHeatmapTicks';
7950
- const Ticks_Ticks = (props)=>{
7951
- const { id, inside = false } = props;
7952
- const { state: { globalID } } = useStore_useStore();
7953
- const [tickFormat, setTickFormat] = (0, __WEBPACK_EXTERNAL_MODULE_react__.useState)();
7954
- (0, __WEBPACK_EXTERNAL_MODULE_react__.useEffect)(()=>{
7955
- if (id && globalID) withUpdateData(id, Ticks_COMPONENT_KEY, ()=>{
7956
- let { waterfallData: d } = withDatabase(globalID).getAllRawData();
7957
- if (d?.length > 0) {
7958
- if (d.at(0)?.length === 0) d = d?.filter?.((i)=>i?.length > 0);
7959
- const start = d.at(-1)?.timestamp;
7960
- const end = d.at(0)?.timestamp;
7961
- if (start && end) setTickFormat((start - end) / 1e3);
7962
- }
7963
- });
7964
- }, [
7965
- id,
7966
- globalID
7967
- ]);
7968
- return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsxs)("div", {
7969
- className: components_Ticks_styles_module.ticks,
7970
- style: {
7971
- alignItems: inside ? 'flex-start' : 'flex-end'
7972
- },
7973
- children: [
7974
- /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("div", {
7975
- className: components_Ticks_styles_module.start,
7976
- children: "0"
7977
- }),
7978
- /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("div", {
7979
- className: components_Ticks_styles_module.end,
7980
- title: "\u5355\u4F4D\uFF1A\u79D2",
7981
- children: tickFormat?.toFixed(1)
7982
- })
7983
- ]
7984
- });
7985
- };
7986
- const components_Ticks = Ticks_Ticks;
7937
+ const components_Ticks = /*#__PURE__*/ __WEBPACK_EXTERNAL_MODULE_react__["default"].memo(Ticks_Ticks);
7987
7938
  var Default_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.5.0_@rsbuild+core@1.6.9/node_modules/@rsbuild/plugin-less/compiled/less-loader/index.js??ruleSet[1].rules[11].use[3]!./src/components/AxisY/heatmap/type/Default/styles.module.less");
7988
7939
  var Default_styles_module_options = {};
7989
7940
  Default_styles_module_options.styleTagTransform = styleTagTransform_default();
@@ -7994,7 +7945,6 @@ Default_styles_module_options.insertStyleElement = insertStyleElement_default();
7994
7945
  injectStylesIntoStyleTag_default()(Default_styles_module.Z, Default_styles_module_options);
7995
7946
  const type_Default_styles_module = Default_styles_module.Z && Default_styles_module.Z.locals ? Default_styles_module.Z.locals : void 0;
7996
7947
  const Default_Default = (props)=>{
7997
- const { state: { axisY: { heatmapFullTicks } } } = useStore_useStore();
7998
7948
  const { axisYWidth, marginLeft } = useAxisYWidth_useAxisYWidth();
7999
7949
  return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("div", {
8000
7950
  className: type_Default_styles_module.axisyheatmapdefault,
@@ -8002,9 +7952,7 @@ const Default_Default = (props)=>{
8002
7952
  width: axisYWidth,
8003
7953
  marginLeft
8004
7954
  },
8005
- children: heatmapFullTicks ? /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(FullTicks, {
8006
- ...props
8007
- }) : /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(components_Ticks, {
7955
+ children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(components_Ticks, {
8008
7956
  ...props
8009
7957
  })
8010
7958
  });
@@ -8627,7 +8575,7 @@ function getStableOrder(globalID, currentNames) {
8627
8575
  }
8628
8576
  return stored;
8629
8577
  }
8630
- function useFilteredSeries_useFilteredSeries(globalID, filter) {
8578
+ function useFilteredSeries(globalID, filter) {
8631
8579
  const { series } = useSeriesManager(globalID);
8632
8580
  const { state: { series: { legendExternal } } } = useStore_useStore();
8633
8581
  const filteredData = (0, __WEBPACK_EXTERNAL_MODULE_react__.useMemo)(()=>{
@@ -8770,7 +8718,7 @@ injectStylesIntoStyleTag_default()(FrequencyDataBoard_styles_module.Z, Frequency
8770
8718
  const components_FrequencyDataBoard_styles_module = FrequencyDataBoard_styles_module.Z && FrequencyDataBoard_styles_module.Z.locals ? FrequencyDataBoard_styles_module.Z.locals : void 0;
8771
8719
  const FrequencyDataBoard_FrequencyDataBoard = ({ left, updateKey, onChange })=>{
8772
8720
  const { state: { axisY, axisX: { frequencyFormat, unit }, globalID } } = useStore_useStore();
8773
- const filteredSeries = useFilteredSeries_useFilteredSeries(globalID);
8721
+ const filteredSeries = useFilteredSeries(globalID);
8774
8722
  const index = (0, __WEBPACK_EXTERNAL_MODULE_react__.useRef)(Number.NaN);
8775
8723
  const calculateIndex = (0, __WEBPACK_EXTERNAL_MODULE_react__.useCallback)((data, n, series)=>{
8776
8724
  const values = data[n] || [];
@@ -8913,7 +8861,7 @@ const HeatmapPopover = ({ id })=>{
8913
8861
  const newValue = yValue[xIndex];
8914
8862
  setValue(Number.isFinite(newValue) ? newValue.toFixed(1) : '');
8915
8863
  const timestamp = yValue.timestamp;
8916
- if (timestamp) setTimestamp((0, utils.Fc)(timestamp));
8864
+ if (timestamp) setTimestamp(timestamp);
8917
8865
  }
8918
8866
  }
8919
8867
  }
@@ -8982,7 +8930,7 @@ const LevelStreamPopover = ({ id })=>{
8982
8930
  setValue(Number.isFinite(dataValue) ? dataValue.toFixed(1) : '');
8983
8931
  if (levelStreamData.timestampData && levelStreamData.timestampData.length > clampedIndex) {
8984
8932
  const timestampValue = levelStreamData.timestampData[clampedIndex];
8985
- if (timestampValue) setTimestamp((0, utils.Fc)(timestampValue));
8933
+ if (timestampValue) setTimestamp((0, utils.i$)(Number(timestampValue)));
8986
8934
  }
8987
8935
  }
8988
8936
  }
@@ -9375,12 +9323,8 @@ const defaultAreaInfoResult = {
9375
9323
  endIndex: 0,
9376
9324
  startCol: 0,
9377
9325
  endCol: 0,
9378
- startTimestamp: 0,
9379
- startTimestampFormat: '',
9380
- endTimestamp: 0,
9381
- endTimestampFormat: '',
9382
- duration: 0,
9383
- durationFormat: '',
9326
+ startTimestamp: '',
9327
+ endTimestamp: '',
9384
9328
  startFrequency: 0,
9385
9329
  startFrequencyFormat: '',
9386
9330
  endFrequency: 0,
@@ -9405,20 +9349,15 @@ function calculateAreaInfo({ endLeft, startLeft, startTop, endTop, frequencyForm
9405
9349
  end: Math.round(Number(frequencyFormat(endLeft)) * tools_PRECISION) / tools_PRECISION
9406
9350
  };
9407
9351
  const bandwidth = Math.abs(frequencies.end - frequencies.start);
9408
- const startTimestamp = waterfallData[indices.top]?.timestamp || 0;
9409
- const endTimestamp = waterfallData[indices.bottom]?.timestamp || 0;
9410
- const duration = endTimestamp - startTimestamp;
9352
+ const startTimestamp = waterfallData[indices.top]?.timestamp || '';
9353
+ const endTimestamp = waterfallData[indices.bottom]?.timestamp || '';
9411
9354
  const result = {
9412
9355
  startIndex: indices.top,
9413
9356
  endIndex: indices.bottom,
9414
9357
  startCol: indices.start,
9415
9358
  endCol: indices.end,
9416
9359
  startTimestamp,
9417
- startTimestampFormat: (0, utils.Fc)(startTimestamp),
9418
9360
  endTimestamp,
9419
- endTimestampFormat: (0, utils.Fc)(endTimestamp),
9420
- duration,
9421
- durationFormat: (0, utils.lj)(duration / 1000, 3),
9422
9361
  startFrequency: frequencies.start,
9423
9362
  startFrequencyFormat: String(frequencies.start),
9424
9363
  endFrequency: frequencies.end,
@@ -9564,7 +9503,7 @@ const Area_Area = (props)=>{
9564
9503
  children: "\u8D77\u59CB\u65F6\u95F4"
9565
9504
  }),
9566
9505
  /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("div", {
9567
- children: info?.startTimestampFormat
9506
+ children: info?.startTimestamp
9568
9507
  })
9569
9508
  ]
9570
9509
  }),
@@ -9575,18 +9514,7 @@ const Area_Area = (props)=>{
9575
9514
  children: "\u7ED3\u675F\u65F6\u95F4"
9576
9515
  }),
9577
9516
  /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("div", {
9578
- children: info?.endTimestampFormat
9579
- })
9580
- ]
9581
- }),
9582
- (0, utils.Ri)(info.durationFormat) && /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsxs)("div", {
9583
- className: HeatmapCapture_Area_styles_module.item,
9584
- children: [
9585
- /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("div", {
9586
- children: "\u65F6\u95F4\u5DEE"
9587
- }),
9588
- /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("div", {
9589
- children: `${info.durationFormat}s`
9517
+ children: info?.endTimestamp
9590
9518
  })
9591
9519
  ]
9592
9520
  })
@@ -9638,7 +9566,6 @@ const RowIndex = ({ id })=>{
9638
9566
  const rowData = {
9639
9567
  data: waterfallData[newRowIndex],
9640
9568
  timestamp: newTimestamp,
9641
- timestampFormat: (0, utils.Fc)(newTimestamp),
9642
9569
  rowIndex: newRowIndex
9643
9570
  };
9644
9571
  setInfo(rowData);
@@ -9725,7 +9652,7 @@ const RowIndex = ({ id })=>{
9725
9652
  /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsxs)("span", {
9726
9653
  children: [
9727
9654
  "\u65F6\u95F4",
9728
- info?.timestampFormat
9655
+ info?.timestamp
9729
9656
  ]
9730
9657
  })
9731
9658
  ]
@@ -9790,9 +9717,11 @@ const Slider = ({ id })=>{
9790
9717
  const { position: pos, height: h, leftPosition: left, width: w } = r;
9791
9718
  const endIndex = Math.round((100 - pos) / 100 * (len - 1));
9792
9719
  const startIndex = Math.round((100 - (pos + h)) / 100 * (len - 1));
9793
- const startTimestamp = heatmapData[startIndex]?.timestamp;
9794
- const endTimestamp = heatmapData[endIndex]?.timestamp;
9795
- const duration = endTimestamp - startTimestamp;
9720
+ const startTimestamp = heatmapData[startIndex]?.timestamp ?? '';
9721
+ const endTimestamp = heatmapData[endIndex]?.timestamp ?? '';
9722
+ const startTs = (0, utils.JP)(startTimestamp);
9723
+ const endTs = (0, utils.JP)(endTimestamp);
9724
+ const duration = startTs > 0 && endTs > 0 ? Math.abs(endTs - startTs) : 0;
9796
9725
  const colCount = heatmapData[0]?.length || 0;
9797
9726
  const startCol = Math.max(0, Math.min(colCount - 1, Math.ceil(colCount * left / 100) - 1));
9798
9727
  const endCol = Math.max(0, Math.min(colCount - 1, Math.ceil(colCount * (left + w) / 100) - 1));
@@ -9802,23 +9731,21 @@ const Slider = ({ id })=>{
9802
9731
  const PRECISION = 1e4;
9803
9732
  const startFrequency = startFreqStr ? Math.round(Number(startFreqStr) * PRECISION) / PRECISION : 0;
9804
9733
  const endFrequency = endFreqStr ? Math.round(Number(endFreqStr) * PRECISION) / PRECISION : 0;
9734
+ const bandwidth = Math.abs(endFrequency - startFrequency);
9805
9735
  return {
9806
9736
  startIndex,
9807
9737
  endIndex,
9808
9738
  startTimestamp,
9809
- startTimestampFormat: (0, utils.Fc)(startTimestamp),
9810
9739
  endTimestamp,
9811
- endTimestampFormat: (0, utils.Fc)(endTimestamp),
9812
9740
  duration,
9813
- durationFormat: (duration / 1000).toFixed(3),
9814
9741
  startCol,
9815
9742
  endCol,
9816
9743
  startFrequency,
9817
9744
  startFrequencyFormat: String(startFrequency),
9818
9745
  endFrequency,
9819
9746
  endFrequencyFormat: String(endFrequency),
9820
- bandwidth: Math.abs(endFrequency - startFrequency),
9821
- bandwidthFormat: (0, utils.lj)(Math.abs(endFrequency - startFrequency))
9747
+ bandwidth,
9748
+ bandwidthFormat: (0, utils.lj)(bandwidth)
9822
9749
  };
9823
9750
  }, [
9824
9751
  getHeatmapData
@@ -10079,7 +10006,7 @@ const Slider = ({ id })=>{
10079
10006
  top: `${position}%`,
10080
10007
  left: `${leftPosition + width / 2}%`
10081
10008
  },
10082
- children: info?.endTimestampFormat
10009
+ children: info?.endTimestamp
10083
10010
  }),
10084
10011
  /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("div", {
10085
10012
  className: `${HeatmapCapture_Slider_styles_module.externalLabel} ${bounds.nearBottom ? HeatmapCapture_Slider_styles_module.externalLabelBottomInner : HeatmapCapture_Slider_styles_module.externalLabelBottom} ${bounds.centerNearLeft ? HeatmapCapture_Slider_styles_module.externalLabelHorizontalRight : bounds.centerNearRight ? HeatmapCapture_Slider_styles_module.externalLabelHorizontalLeft : ''}`,
@@ -10087,7 +10014,7 @@ const Slider = ({ id })=>{
10087
10014
  top: `${position + height}%`,
10088
10015
  left: `${leftPosition + width / 2}%`
10089
10016
  },
10090
- children: info?.startTimestampFormat
10017
+ children: info?.startTimestamp
10091
10018
  }),
10092
10019
  /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsxs)("div", {
10093
10020
  className: HeatmapCapture_Slider_styles_module.slider,
@@ -10115,15 +10042,14 @@ const Slider = ({ id })=>{
10115
10042
  /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsxs)("div", {
10116
10043
  children: [
10117
10044
  "\u5E26\u5BBD:",
10118
- ' ',
10119
10045
  info?.bandwidth !== void 0 ? (1000 * info.bandwidth).toFixed(2) : '',
10120
10046
  unitKHz
10121
10047
  ]
10122
10048
  }),
10123
10049
  /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsxs)("div", {
10124
10050
  children: [
10125
- "\u65F6\u957F: ",
10126
- info?.durationFormat,
10051
+ "\u65F6\u957F:",
10052
+ info?.duration !== void 0 ? (info.duration / 1000).toFixed(3) : '',
10127
10053
  "s"
10128
10054
  ]
10129
10055
  })
@@ -12278,7 +12204,7 @@ injectStylesIntoStyleTag_default()(SeriesDisplayControl_styles_module.Z, SeriesD
12278
12204
  const ToolsBar_SeriesDisplayControl_styles_module = SeriesDisplayControl_styles_module.Z && SeriesDisplayControl_styles_module.Z.locals ? SeriesDisplayControl_styles_module.Z.locals : void 0;
12279
12205
  const SeriesDisplayControl = ()=>{
12280
12206
  const { state: { globalID, series: seriesConfig } } = useStore_useStore();
12281
- const filteredSeries = useFilteredSeries_useFilteredSeries(globalID);
12207
+ const filteredSeries = useFilteredSeries(globalID);
12282
12208
  const { forceUpdate } = useSeriesForComponent(globalID);
12283
12209
  (0, __WEBPACK_EXTERNAL_MODULE_react__.useEffect)(()=>{
12284
12210
  if (!globalID || !seriesConfig?.forceDisplay) return;
@@ -15655,7 +15581,7 @@ const LevelStream_Chart_Chart = (props)=>{
15655
15581
  subscribe: (e)=>{
15656
15582
  const { pstype } = e;
15657
15583
  if (pstype === constants_PSType.Reset) analyzer?.reset();
15658
- if (pstype === constants_PSType.LevelStream) analyzer?.process(e.data, e.timestamp);
15584
+ if (pstype === constants_PSType.LevelStream) analyzer?.process(e.data, (0, utils.JP)(e.timestamp));
15659
15585
  }
15660
15586
  });
15661
15587
  (0, __WEBPACK_EXTERNAL_MODULE_react__.useEffect)(()=>{
@@ -15915,7 +15841,7 @@ Blaze_styles_module_options.insertStyleElement = insertStyleElement_default();
15915
15841
  injectStylesIntoStyleTag_default()(Blaze_styles_module.Z, Blaze_styles_module_options);
15916
15842
  const components_Blaze_styles_module = Blaze_styles_module.Z && Blaze_styles_module.Z.locals ? Blaze_styles_module.Z.locals : void 0;
15917
15843
  const BLAZE_PROGRESS = (globalID, func)=>subscription_createSubscriptionManager(`BLAZE_PROGRESS-${globalID}`, '0', func);
15918
- const Blaze = ()=>{
15844
+ const Blaze_Blaze = ()=>{
15919
15845
  const { state: { blaze: { show }, segments, globalID } } = useStore_useStore();
15920
15846
  const [left, setLeft] = (0, __WEBPACK_EXTERNAL_MODULE_react__.useState)('');
15921
15847
  const excludePercent = (0, __WEBPACK_EXTERNAL_MODULE_react__.useMemo)(()=>{
@@ -15954,7 +15880,7 @@ const Blaze = ()=>{
15954
15880
  })
15955
15881
  });
15956
15882
  };
15957
- const components_Blaze = /*#__PURE__*/ __WEBPACK_EXTERNAL_MODULE_react__["default"].memo(Blaze);
15883
+ const Blaze = /*#__PURE__*/ __WEBPACK_EXTERNAL_MODULE_react__["default"].memo(Blaze_Blaze);
15958
15884
  var Legend_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.5.0_@rsbuild+core@1.6.9/node_modules/@rsbuild/plugin-less/compiled/less-loader/index.js??ruleSet[1].rules[11].use[3]!./src/components/Legend/styles.module.less");
15959
15885
  var Legend_styles_module_options = {};
15960
15886
  Legend_styles_module_options.styleTagTransform = styleTagTransform_default();
@@ -16633,7 +16559,7 @@ const Spectrum_Chart_Chart = (props)=>{
16633
16559
  type === constants_ChartType.Scan && /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsxs)(__WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.Fragment, {
16634
16560
  children: [
16635
16561
  /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(components_SegmentsZebra, {}),
16636
- /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(components_Blaze, {})
16562
+ /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(Blaze, {})
16637
16563
  ]
16638
16564
  }),
16639
16565
  /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(components_Legend, {})
package/package.json CHANGED
@@ -5,6 +5,6 @@
5
5
  "types": "index.d.ts",
6
6
  "author": "Hxgh",
7
7
  "license": "MIT",
8
- "version": "1.2.23",
8
+ "version": "1.2.24",
9
9
  "private": false
10
10
  }
@@ -56,14 +56,14 @@ export interface PublishSpectrum {
56
56
  templateData?: Float32Array;
57
57
  templateTolerance?: number;
58
58
  extraData?: SpectrumExtraData;
59
- timestamp?: number;
59
+ timestamp?: string;
60
60
  offset?: number;
61
61
  segmentOffset?: number;
62
62
  }
63
63
  export interface PublishHeatmap {
64
64
  pstype: PSType.Heatmap;
65
65
  data: number[][];
66
- timestamps: number[];
66
+ timestamps: string[];
67
67
  }
68
68
  export interface PublishFluorescence {
69
69
  pstype: PSType.Fluorescence;
@@ -77,7 +77,7 @@ export interface PublishOccupancy {
77
77
  export interface PublishLevelStream {
78
78
  pstype: PSType.LevelStream;
79
79
  data: number;
80
- timestamp: number;
80
+ timestamp: string;
81
81
  }
82
82
  export interface PublishIQ {
83
83
  pstype: PSType.IQ;
package/types/store.d.ts CHANGED
@@ -25,7 +25,6 @@ export interface AxisYProps {
25
25
  type?: string;
26
26
  hidden?: string[];
27
27
  linkage?: boolean;
28
- heatmapFullTicks?: boolean;
29
28
  onChange?: (e: RecursiveObject) => void;
30
29
  }
31
30
  export interface AxisXProps {
@@ -105,14 +104,11 @@ export declare enum HeatmapCaptureType {
105
104
  export interface HeatmapSliderData {
106
105
  startIndex: number;
107
106
  endIndex: number;
108
- startTimestamp: number;
109
- startTimestampFormat: string;
110
- endTimestamp: number;
111
- endTimestampFormat: string;
112
- duration: number;
113
- durationFormat: string;
107
+ startTimestamp: string;
108
+ endTimestamp: string;
114
109
  }
115
110
  export interface HeatmapSlider2DData extends HeatmapSliderData {
111
+ duration: number;
116
112
  startCol: number;
117
113
  endCol: number;
118
114
  startFrequency: number;
@@ -135,8 +131,7 @@ export interface HeatmapAreaData extends HeatmapSliderData {
135
131
  }
136
132
  export interface HeatmapRowIndexData {
137
133
  data: TimestampedFloat32Array;
138
- timestamp: number;
139
- timestampFormat: string;
134
+ timestamp: string;
140
135
  rowIndex: number;
141
136
  }
142
137
  export interface HeatmapCaptureProps {
package/utils/index.d.ts CHANGED
@@ -6,7 +6,14 @@ import type { RecursiveObject, SegmentsOriginal, SegmentsType } from '../types';
6
6
  * @returns {string}
7
7
  */
8
8
  export declare const createGUID: () => string;
9
- export declare const getDateTime: (t?: number | Date, sep1?: string, sep2?: string, time?: boolean) => string;
9
+ export interface TimestampFormatOptions {
10
+ dateSeparator?: string;
11
+ timeSeparator?: string;
12
+ timeOnly?: boolean;
13
+ }
14
+ export declare const formatTimestamp: (input?: number | Date, options?: TimestampFormatOptions) => string;
15
+ export declare const dateTimeToTimestamp: (dateTimeStr: unknown, // 改为 unknown 类型,强制运行时检查
16
+ sep1?: string, sep2?: string, isTimeOnly?: boolean) => number;
10
17
  /**
11
18
  * 节流
12
19
  */
@@ -96,7 +103,7 @@ export declare const createChartRenderID: ({ moduleType, globalID }: {
96
103
  * @param timestamps 可选的时间戳数组
97
104
  * @returns 转换后的TimestampedFloat32Array数组
98
105
  */
99
- export declare const convertToTimestampedArrays: (data: number[][], timestamps?: Array<number>) => TimestampedFloat32Array[];
106
+ export declare const convertToTimestampedArrays: (data: number[][], timestamps?: Array<string>) => TimestampedFloat32Array[];
100
107
  /**
101
108
  * 防抖函数
102
109
  * @param fn 需要防抖的函数
@@ -1,7 +0,0 @@
1
- import React from 'react';
2
- interface Props {
3
- id: string;
4
- inside?: boolean;
5
- }
6
- declare const _default: React.NamedExoticComponent<Props>;
7
- export default _default;