@gradio/dataframe 0.6.3 → 0.6.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.
- package/CHANGELOG.md +13 -1
- package/Example.svelte +0 -41
- package/README.md +0 -1
- package/package.json +5 -5
- package/shared/VirtualTable.svelte +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @gradio/dataframe
|
|
2
2
|
|
|
3
|
+
## 0.6.5
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
- [#7528](https://github.com/gradio-app/gradio/pull/7528) [`eda33b3`](https://github.com/gradio-app/gradio/commit/eda33b3763897a542acf298e523fa493dc655aee) - Refactors `get_fetchable_url_or_file()` to remove it from the frontend. Thanks [@abidlabs](https://github.com/abidlabs)!
|
|
8
|
+
|
|
9
|
+
## 0.6.4
|
|
10
|
+
|
|
11
|
+
### Fixes
|
|
12
|
+
|
|
13
|
+
- [#7495](https://github.com/gradio-app/gradio/pull/7495) [`ddd4d3e`](https://github.com/gradio-app/gradio/commit/ddd4d3e4d3883fb7540d1df240fb08202fc77705) - ensure Dataframe headers are aligned with content when scrolling. Thanks [@abidlabs](https://github.com/abidlabs)!
|
|
14
|
+
|
|
3
15
|
## 0.6.3
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
@@ -366,4 +378,4 @@ Thanks [@pngwn](https://github.com/pngwn)!
|
|
|
366
378
|
|
|
367
379
|
- Updated dependencies [[`667875b2`](https://github.com/gradio-app/gradio/commit/667875b2441753e74d25bd9d3c8adedd8ede11cd), [`37caa2e0`](https://github.com/gradio-app/gradio/commit/37caa2e0fe95d6cab8beb174580fb557904f137f)]:
|
|
368
380
|
- @gradio/upload@0.0.3
|
|
369
|
-
- @gradio/button@0.1.0
|
|
381
|
+
- @gradio/button@0.1.0
|
package/Example.svelte
CHANGED
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import { csvParseRows, tsvParseRows } from "d3-dsv";
|
|
3
|
-
import type { Gradio } from "@gradio/utils";
|
|
4
|
-
|
|
5
|
-
export let gradio: Gradio;
|
|
6
2
|
export let value: (string | number)[][] | string;
|
|
7
|
-
export let samples_dir: string;
|
|
8
3
|
export let type: "gallery" | "table";
|
|
9
4
|
export let selected = false;
|
|
10
5
|
export let index: number;
|
|
@@ -12,42 +7,6 @@
|
|
|
12
7
|
let hovered = false;
|
|
13
8
|
let loaded_value: (string | number)[][] | string = value;
|
|
14
9
|
let loaded = Array.isArray(loaded_value);
|
|
15
|
-
|
|
16
|
-
$: if (!loaded && typeof value === "string" && /\.[a-zA-Z]+$/.test(value)) {
|
|
17
|
-
fetch(samples_dir + value)
|
|
18
|
-
.then((v) => v.text())
|
|
19
|
-
.then((v) => {
|
|
20
|
-
try {
|
|
21
|
-
if ((value as string).endsWith("csv")) {
|
|
22
|
-
const small_df = v
|
|
23
|
-
.split("\n")
|
|
24
|
-
.slice(0, 4)
|
|
25
|
-
.map((v) => v.split(",").slice(0, 4).join(","))
|
|
26
|
-
.join("\n");
|
|
27
|
-
|
|
28
|
-
loaded_value = csvParseRows(small_df);
|
|
29
|
-
} else if ((value as string).endsWith("tsv")) {
|
|
30
|
-
const small_df = v
|
|
31
|
-
.split("\n")
|
|
32
|
-
.slice(0, 4)
|
|
33
|
-
.map((v) => v.split("\t").slice(0, 4).join("\t"))
|
|
34
|
-
.join("\n");
|
|
35
|
-
|
|
36
|
-
loaded_value = tsvParseRows(small_df);
|
|
37
|
-
} else {
|
|
38
|
-
throw new Error(gradio.i18n("dataframe.incorrect_format"));
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
loaded = true;
|
|
42
|
-
} catch (e) {
|
|
43
|
-
console.error(e);
|
|
44
|
-
}
|
|
45
|
-
})
|
|
46
|
-
.catch((e) => {
|
|
47
|
-
loaded_value = value;
|
|
48
|
-
loaded = true;
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
10
|
</script>
|
|
52
11
|
|
|
53
12
|
{#if loaded}
|
package/README.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gradio/dataframe",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.5",
|
|
4
4
|
"description": "Gradio UI packages",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": "",
|
|
@@ -18,11 +18,11 @@
|
|
|
18
18
|
"katex": "^0.16.7",
|
|
19
19
|
"marked": "^12.0.0",
|
|
20
20
|
"@gradio/atoms": "^0.5.3",
|
|
21
|
-
"@gradio/button": "^0.2.
|
|
22
|
-
"@gradio/
|
|
23
|
-
"@gradio/upload": "^0.7.4",
|
|
21
|
+
"@gradio/button": "^0.2.23",
|
|
22
|
+
"@gradio/upload": "^0.7.5",
|
|
24
23
|
"@gradio/utils": "^0.3.0",
|
|
25
|
-
"@gradio/
|
|
24
|
+
"@gradio/statustracker": "^0.4.8",
|
|
25
|
+
"@gradio/markdown": "^0.6.5"
|
|
26
26
|
},
|
|
27
27
|
"exports": {
|
|
28
28
|
".": "./Index.svelte",
|