Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
"embla-carousel-react": "^8.6.0",
"fflate": "^0.8.2",
"gsap": "^3.13.0",
"icechunk-js": "^0.4.0",
"icechunk-js": "^0.6.0",
"input-otp": "^1.4.2",
"js-colormaps-es": "^0.0.5",
"lucide-react": "^0.562.0",
Expand Down
5 changes: 3 additions & 2 deletions src/components/ui/Elements/HomeButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@

import Image from "next/image";
import Link from "next/link";
import logoHome from "public/logo-light.svg";
import { Button } from "@/components/ui/button-enhanced";
import {
Tooltip,
TooltipContent,
TooltipTrigger,
} from "@/components/ui/tooltip";

const logoHome = "/logo-light.svg";

export default function HomeButton() {
return (
<Tooltip delayDuration={500}>
Expand All @@ -20,7 +21,7 @@ export default function HomeButton() {
size="icon"
className="cursor-pointer hover:scale-90 transition-transform duration-100 ease-out"
>
<Image src={logoHome} alt="logoMPI" height={32} />
<Image src={logoHome} alt="logoMPI" height={32} width={32} />
</Button>
</Link>
</TooltipTrigger>
Expand Down
29 changes: 28 additions & 1 deletion src/components/zarr/ZarrParser.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,33 @@
import * as zarr from 'zarrita'
import { jsonDecodeObject, jsonEncodeObject } from 'node_modules/zarrita/dist/src/util';
import { InvalidMetadataError } from 'zarrita';

// jsonEncodeObject and jsonDecodeObject
// From zarrita/src/util.ts, better this, than rely on internals
export function jsonEncodeObject(o: Record<string, unknown>): Uint8Array {
const str = JSON.stringify(
o,
(_key, value) => {
// JSON.stringify converts NaN/Infinity/-Infinity to null.
// Zarr v3 spec requires these as string representations.
if (typeof value === "number") {
if (Number.isNaN(value)) return "NaN";
if (value === Infinity) return "Infinity";
if (value === -Infinity) return "-Infinity";
}
return value;
},
2,
);
return new TextEncoder().encode(str);
}
export function jsonDecodeObject(bytes: Uint8Array) {
const str = new TextDecoder().decode(bytes);
try {
return JSON.parse(str);
} catch (cause) {
throw new InvalidMetadataError("Failed to decode JSON", { cause });
}
}
function is_meta_key(key: string) {
return (key.endsWith(".zarray") ||
key.endsWith(".zgroup") ||
Expand Down
5 changes: 2 additions & 3 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,12 @@
"name": "next"
}
],
"baseUrl": ".",
Comment thread
lazarusA marked this conversation as resolved.
"paths": {
"@/*": [
"src/*"
"./src/*"
],
"@/components/*": [
"src/components/*"
"./src/components/*"
]
}
},
Expand Down
Loading