Skip to content

Commit 55bd3a6

Browse files
authored
Merge pull request #46 from will-moore/thumbnails
Thumbnails
2 parents 221517c + 7f25f42 commit 55bd3a6

11 files changed

Lines changed: 205 additions & 109 deletions

File tree

package-lock.json

Lines changed: 45 additions & 72 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@
1616
"dependencies": {
1717
"ajv": "^8.11.0",
1818
"ndarray": "^1.0.19",
19+
"ome-zarr.js": "^0.0.11",
1920
"svelte-icons-pack": "^1.4.6",
2021
"svelte-simple-modal": "^1.4.1",
21-
"zarrita": "^0.4.0-next.15"
22+
"zarrita": "^0.5.0"
2223
}
2324
}

src/Bioformats2rawLayout/index.svelte

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import ImageContainer from "../JsonValidator/Well/ImageContainer.svelte";
1212
import RoCrate from "../JsonValidator/RoCrate/index.svelte";
1313
import OpenWith from "../JsonValidator/OpenWithViewers/index.svelte";
14+
import Thumbnail from "../JsonValidator/Thumbnail/index.svelte";
1415
1516
export let source;
1617
export let rootAttrs;
@@ -125,20 +126,23 @@
125126
<ul>
126127
{#each metadataJson.images as image}
127128
<li class="image">
129+
<div>
128130
/{image.path}
129131
<a title="Open Image" href="{url}?source={source}/{image.path}/"
130132
>{image.name}</a
131133
>
132134
133135
<ImageContainer {source} path={image.path} />
134136
135-
<a title="Open Image" href="{url}?source={source}/{image.path}/"
136-
>Open in validator</a
137-
>
138-
139137
<div style="margin-top: 10px">
140138
<OpenWith source={`${source}/${image.path}`} dtype={"image"} {version} />
141139
</div>
140+
</div>
141+
<div class="thumbnail_wrapper">
142+
<a title="Open Image in Validator" href="{url}?source={source}/{image.path}/">
143+
<Thumbnail source={`${source}/${image.path}`} targetSize=100 />
144+
</a>
145+
</div>
142146
</li>
143147
{/each}
144148
</ul>
@@ -193,6 +197,8 @@
193197
}
194198
195199
.image {
200+
display: flex;
201+
flex-direction: row;
196202
list-style: none;
197203
text-align: left;
198204
margin-top: 10px;
@@ -204,4 +210,17 @@
204210
border-radius: 10px;
205211
font-family: monospace;
206212
}
213+
.image div {
214+
flex: 1 1 auto;
215+
}
216+
217+
.image .thumbnail_wrapper {
218+
flex: 0 0 auto;
219+
}
220+
221+
.thumbnail_wrapper :global(.thumbnail) {
222+
max-width: 100px;
223+
max-height: 100px;
224+
border-radius: 5px;
225+
}
207226
</style>

src/CheckMark.svelte

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,13 @@
1212
.invalid,
1313
.valid {
1414
border-radius: 50%;
15-
padding: 10px;
15+
padding: 13px;
1616
margin: 10px auto;
1717
color: white;
18-
width: 100px;
19-
height: 100px;
18+
width: 90px;
19+
height: 90px;
2020
font-size: 50px;
2121
text-align: center;
22-
padding: 15px;
2322
}
2423
.invalid {
2524
background-color: red;

src/JsonValidator/MultiscaleArrays/Multiscale.svelte

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,15 @@
44
55
export let source;
66
export let multiscale;
7+
export let version;
78
89
const WARNING = "warning";
910
1011
// We check that all multiscale Datasets have same dtype and
1112
// shape.length (number of dimensions)
1213
1314
// If multiscale.axes (version > 0.3) check it matches shape
14-
const { axes, datasets, version } = multiscale;
15+
const { axes, datasets } = multiscale;
1516
1617
const permitDtypeMismatch = ["0.1", "0.2", "0.3", "0.4"].includes(version);
1718
const checkDimSeparator = ["0.2", "0.3", "0.4"].includes(version);

src/JsonValidator/MultiscaleArrays/ZarrArray/ChunkLoader.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import { get, writable } from "svelte/store";
44
import ChunkViewer from "./ChunkViewer.svelte";
55
import * as zarr from "zarrita";
6-
import { slice } from "@zarrita/indexing";
6+
import { slice } from "zarrita";
77
88
99
export let source;

src/JsonValidator/MultiscaleArrays/ZarrArray/ChunkViewer.svelte

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<script>
22
import { onMount, afterUpdate } from "svelte";
3-
import { slice, get } from "@zarrita/indexing";
43
import ndarray from "ndarray";
54
65
export let chunk;

src/JsonValidator/MultiscaleArrays/index.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
{#each rootAttrs.multiscales as multiscale, idx}
1414
<article>
1515
<h2>Multiscale {idx}</h2>
16-
<Multiscale {source} {multiscale} />
16+
<Multiscale {source} {multiscale} version={msVersion}/>
1717
{#each multiscale.datasets as dataset}
1818
<ZarrArray {source} path={dataset.path + "/" + zarrAttrsFileName} />
1919
{/each}

0 commit comments

Comments
 (0)