@zjlab-fe/data-hub-ui 0.32.2 → 0.32.4
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.
|
@@ -7,6 +7,14 @@ import initWasm, { wasmMemory, readParquet } from 'parquet-wasm';
|
|
|
7
7
|
|
|
8
8
|
initWasm();
|
|
9
9
|
let WASM_MEMORY;
|
|
10
|
+
function transformData(data) {
|
|
11
|
+
const result = {};
|
|
12
|
+
Object.keys(data).forEach((key) => {
|
|
13
|
+
const value = data[key];
|
|
14
|
+
result[key] = typeof value === 'bigint' ? value.toString() : String(value);
|
|
15
|
+
});
|
|
16
|
+
return result;
|
|
17
|
+
}
|
|
10
18
|
function ParquetPreview(props) {
|
|
11
19
|
var _a;
|
|
12
20
|
const ref = useRef(null);
|
|
@@ -31,12 +39,12 @@ function ParquetPreview(props) {
|
|
|
31
39
|
// console.log('+++ head', head);
|
|
32
40
|
// 获取数据
|
|
33
41
|
const data = [];
|
|
34
|
-
console.log('+++ arrowTable.numRows', arrowTable.numRows);
|
|
35
42
|
for (let i = 0; i < arrowTable.numRows; i++) {
|
|
36
|
-
data.push(Object.assign(Object.assign({}, arrowTable.get(i).toJSON()), { key: i.toString() }));
|
|
43
|
+
data.push(Object.assign(Object.assign({}, transformData(arrowTable.get(i).toJSON())), { key: i.toString() }));
|
|
37
44
|
}
|
|
38
45
|
// const end = new Date().getTime();
|
|
39
46
|
// console.log('+++ 耗时', end - start);
|
|
47
|
+
console.log('+++ parquet head data', head, data);
|
|
40
48
|
setParquetData({ head, data });
|
|
41
49
|
setContainerHeight((_a = ref.current) === null || _a === void 0 ? void 0 : _a.clientHeight);
|
|
42
50
|
setContainerWidth((_b = ref.current) === null || _b === void 0 ? void 0 : _b.clientWidth);
|
|
@@ -7,15 +7,13 @@ import { TextSelection } from 'prosemirror-state';
|
|
|
7
7
|
import { BlockNoteSchema, defaultStyleSpecs, defaultInlineContentSpecs, defaultBlockSpecs } from '@blocknote/core';
|
|
8
8
|
import { BlockNoteView } from '@blocknote/mantine';
|
|
9
9
|
import { zh } from '@blocknote/core/locales';
|
|
10
|
-
import
|
|
11
|
-
import
|
|
10
|
+
import '@blocknote/core/fonts/inter.css';
|
|
11
|
+
import '@blocknote/mantine/style.css';
|
|
12
12
|
import useStyle from './index.scss.js';
|
|
13
13
|
import { CustomCodeBlock } from './code-block/index.js';
|
|
14
14
|
import { detectLanguage } from './code-block/languageDetector.js';
|
|
15
15
|
import { parsePastedMarkdown } from './parseMarkdown.js';
|
|
16
16
|
|
|
17
|
-
__inject_css0();
|
|
18
|
-
__inject_css1();
|
|
19
17
|
useStyle();
|
|
20
18
|
// 自定义文件块,替换默认的文件块
|
|
21
19
|
const CustomFileBlock = createReactBlockSpec({
|