|
1 | 1 | <script>
|
2 |
| - import { Button, ButtonGroup } from "flowbite-svelte"; |
3 |
| - import { Spinner, Alert } from "flowbite-svelte"; |
4 |
| - import { Heading, P, A } from "flowbite-svelte"; |
5 |
| - import { Select, Input, Label, Helper } from "flowbite-svelte"; |
| 2 | + import { |
| 3 | + A, |
| 4 | + Alert, |
| 5 | + Button, |
| 6 | + ButtonGroup, |
| 7 | + Heading, |
| 8 | + Input, |
| 9 | + Label, |
| 10 | + P, |
| 11 | + Spinner, |
| 12 | + } from "flowbite-svelte"; |
6 | 13 | import { onMount } from "svelte";
|
| 14 | + import { Sheet, FileJson2 } from "lucide-svelte"; |
| 15 | + import { CodeJar } from "@novacbn/svelte-codejar"; |
7 | 16 |
|
8 | 17 | import { createDbWorker } from "sql.js-httpvfs";
|
9 |
| - import { PowerTable } from "@muonw/powertable"; |
10 |
| - import { Sheet, FileJson2 } from "lucide-svelte"; |
11 | 18 |
|
12 | 19 | import pTime from "p-time";
|
13 | 20 | import saveAs from "file-saver";
|
| 21 | +
|
14 | 22 | // @ts-ignore
|
15 | 23 | import PapaParse from "papaparse";
|
16 | 24 | import prettyBytes from "pretty-bytes";
|
17 | 25 | import pluralize from "pluralize";
|
18 | 26 |
|
19 |
| - import { CodeJar } from "@novacbn/svelte-codejar"; |
| 27 | + import Prism from "prismjs"; |
| 28 | + import "prismjs/components/prism-sql"; |
20 | 29 |
|
| 30 | + import { PowerTable } from "@muonw/powertable"; |
21 | 31 | import "@muonw/powertable/styles/power-table.scss";
|
22 | 32 | // import "@muonw/powertable/styles/power-table-mascara.scss";
|
23 | 33 |
|
24 |
| - let pageSize = "1024"; |
25 |
| - let pageSizes = [ |
26 |
| - { value: "512", name: "512" }, |
27 |
| - { value: "1024", name: "1024" }, |
28 |
| - { value: "2048", name: "2048" }, |
29 |
| - { value: "4096", name: "4096" }, |
30 |
| - { value: "8192", name: "8192" }, |
31 |
| - { value: "16384", name: "16384" }, |
32 |
| - { value: "32768", name: "32768" }, |
33 |
| - ]; |
| 34 | + let pageSize = "1024"; // Default page size for the database worker |
34 | 35 | let sqlQuery = `SELECT * FROM tcga_table LIMIT 20;`;
|
35 | 36 | let activeTable = "";
|
36 | 37 | let selectedColumn = "";
|
37 | 38 | let searchValue = "";
|
38 |
| - // let dbUrl = "https://nishad.github.io/sql.js-httpvfs-playground/db/imdb-titles-100000_1024_indexed.db"; |
39 |
| - // let dbUrl = |
40 |
| - // "https://cnag-biomedical-informatics.github.io/sql.js-httpvfs-playground/db/tcga.db"; |
41 | 39 | let dbUrl =
|
42 | 40 | "https://raw.githubusercontent.com/CNAG-Biomedical-Informatics/cbi-datahub/refs/heads/main/sqlite/tcga.db";
|
43 | 41 |
|
44 |
| - import Prism from "prismjs"; |
45 |
| - import "prismjs/components/prism-sql"; |
46 |
| -
|
47 | 42 | const highlight = (code, syntax) =>
|
48 | 43 | Prism.highlight(code, Prism.languages[syntax], syntax);
|
49 | 44 |
|
|
244 | 239 | <div class=" px-4 mx-auto max-w-screen-xl">
|
245 | 240 | <div class="p-8">
|
246 | 241 | <Heading tag="h2" customeSize="text-4xl font-extrabold "
|
247 |
| - >sql.js-httpvfs Playground</Heading |
| 242 | + >Pheno-Ranker Use Cases Playground</Heading |
248 | 243 | >
|
249 |
| - <P class="my-4 text-gray-500"> |
250 |
| - This is a fork of nishad's sql.js-httpvfs playground |
251 |
| - </P> |
252 |
| - <A href="https://github.com/nishad/sql.js-httpvfs-playground" |
253 |
| - >Check it out here: |
254 |
| - <svg |
255 |
| - class="ml-1 w-6 h-6" |
256 |
| - fill="currentColor" |
257 |
| - viewBox="0 0 20 20" |
258 |
| - xmlns="http://www.w3.org/2000/svg" |
259 |
| - ><path |
260 |
| - fill-rule="evenodd" |
261 |
| - d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z" |
262 |
| - clip-rule="evenodd" |
263 |
| - /></svg |
264 |
| - > |
265 |
| - </A> |
266 | 244 | </div>
|
267 | 245 |
|
268 | 246 | {#if sqliteFiles.length}
|
|
404 | 382 | rel="stylesheet"
|
405 | 383 | />
|
406 | 384 | </svelte:head>
|
| 385 | +
|
| 386 | +<footer class="bg-gray-100 text-center py-4 mt-8"> |
| 387 | + <span class="text-sm text-gray-600"> |
| 388 | + Copyright © 2025 |
| 389 | + <A |
| 390 | + href="https://github.com/CNAG-Biomedical-Informatics" |
| 391 | + target="_blank" |
| 392 | + rel="noopener noreferrer" |
| 393 | + > |
| 394 | + CNAG-Biomedical-Informatics |
| 395 | + </A> |
| 396 | + inspired by |
| 397 | + <A |
| 398 | + href="https://github.com/nishad/sql.js-httpvfs-playground" |
| 399 | + target="_blank" |
| 400 | + rel="noopener noreferrer" |
| 401 | + >nishad's sql.js-httpvfs-playground |
| 402 | + </A> |
| 403 | + </span> |
| 404 | +</footer> |
0 commit comments