@gradio/dataframe 0.6.4 → 0.6.6
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 +16 -2
- package/Example.svelte +0 -41
- package/README.md +0 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,10 +1,24 @@
|
|
|
1
1
|
# @gradio/dataframe
|
|
2
2
|
|
|
3
|
+
## 0.6.6
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [[`8181695`](https://github.com/gradio-app/gradio/commit/8181695e70187e8bc2bf7518697098c8d1b9843d)]:
|
|
8
|
+
- @gradio/upload@0.7.6
|
|
9
|
+
- @gradio/button@0.2.24
|
|
10
|
+
|
|
11
|
+
## 0.6.5
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
|
|
15
|
+
- [#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)!
|
|
16
|
+
|
|
3
17
|
## 0.6.4
|
|
4
18
|
|
|
5
19
|
### Fixes
|
|
6
20
|
|
|
7
|
-
- [#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.
|
|
21
|
+
- [#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)!
|
|
8
22
|
|
|
9
23
|
## 0.6.3
|
|
10
24
|
|
|
@@ -372,4 +386,4 @@ Thanks [@pngwn](https://github.com/pngwn)!
|
|
|
372
386
|
|
|
373
387
|
- Updated dependencies [[`667875b2`](https://github.com/gradio-app/gradio/commit/667875b2441753e74d25bd9d3c8adedd8ede11cd), [`37caa2e0`](https://github.com/gradio-app/gradio/commit/37caa2e0fe95d6cab8beb174580fb557904f137f)]:
|
|
374
388
|
- @gradio/upload@0.0.3
|
|
375
|
-
- @gradio/button@0.1.0
|
|
389
|
+
- @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.6",
|
|
4
4
|
"description": "Gradio UI packages",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": "",
|
|
@@ -18,10 +18,10 @@
|
|
|
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",
|
|
22
21
|
"@gradio/markdown": "^0.6.5",
|
|
23
|
-
"@gradio/upload": "^0.7.4",
|
|
24
22
|
"@gradio/statustracker": "^0.4.8",
|
|
23
|
+
"@gradio/button": "^0.2.24",
|
|
24
|
+
"@gradio/upload": "^0.7.6",
|
|
25
25
|
"@gradio/utils": "^0.3.0"
|
|
26
26
|
},
|
|
27
27
|
"exports": {
|