@chartts/parquet 0.1.3 → 0.1.5

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.
Files changed (2) hide show
  1. package/README.md +60 -0
  2. package/package.json +5 -4
package/README.md ADDED
@@ -0,0 +1,60 @@
1
+ <p align="center">
2
+ <a href="https://www.npmjs.com/package/@chartts/parquet"><img src="https://img.shields.io/npm/v/@chartts/parquet?color=06B6D4&label=npm" alt="npm version" /></a>
3
+ <a href="https://github.com/chartts/chartts/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-MIT-06B6D4" alt="MIT License" /></a>
4
+ <a href="https://chartts.com"><img src="https://img.shields.io/badge/docs-chartts.com-06B6D4" alt="Documentation" /></a>
5
+ </p>
6
+
7
+ # @chartts/parquet
8
+
9
+ Parquet adapter for Chartts. Import Parquet files as chart data.
10
+
11
+ ## Install
12
+
13
+ ```bash
14
+ npm install @chartts/parquet @chartts/core
15
+ ```
16
+
17
+ Uses [hyparquet](https://github.com/hyparam/hyparquet) for Parquet parsing.
18
+
19
+ ## Usage
20
+
21
+ ```ts
22
+ import { fromParquet } from "@chartts/parquet"
23
+
24
+ const response = await fetch("/data/metrics.parquet")
25
+ const buffer = await response.arrayBuffer()
26
+ const data = await fromParquet(buffer)
27
+
28
+ // With column selection and row limit
29
+ const data2 = await fromParquet(buffer, {
30
+ labelColumn: "timestamp",
31
+ seriesColumns: ["cpu", "memory", "disk"],
32
+ rowLimit: 1000,
33
+ })
34
+ ```
35
+
36
+ ## API
37
+
38
+ ### `fromParquet(buffer, options?)`
39
+
40
+ Parses a Parquet file (`ArrayBuffer` or `Uint8Array`) into `ChartData`. Returns a `Promise`.
41
+
42
+ | Option | Type | Default | Description |
43
+ |--------|------|---------|-------------|
44
+ | `labelColumn` | `string` | auto-detect | Column to use as labels |
45
+ | `seriesColumns` | `string[]` | all numeric | Columns to use as series |
46
+ | `rowLimit` | `number` | all rows | Maximum rows to read |
47
+
48
+ > Export is not supported. Parquet writing is complex and out of scope for a charting adapter.
49
+
50
+ ## Part of Chartts
51
+
52
+ Beautiful charts. Tiny bundle. Every framework.
53
+
54
+ - [Documentation](https://chartts.com/docs)
55
+ - [GitHub](https://github.com/chartts/chartts)
56
+ - [All packages](https://www.npmjs.com/org/chartts)
57
+
58
+ ## License
59
+
60
+ MIT
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@chartts/parquet",
3
- "version": "0.1.3",
4
- "description": "Parquet import for Chartts",
3
+ "version": "0.1.5",
4
+ "description": "Parquet adapter for Chartts. Import Parquet files as chart data.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
7
7
  "module": "./dist/index.js",
@@ -14,11 +14,12 @@
14
14
  }
15
15
  },
16
16
  "files": [
17
- "dist"
17
+ "dist",
18
+ "README.md"
18
19
  ],
19
20
  "sideEffects": false,
20
21
  "peerDependencies": {
21
- "@chartts/core": "0.1.3"
22
+ "@chartts/core": "0.1.5"
22
23
  },
23
24
  "dependencies": {
24
25
  "hyparquet": "^1.7.0"