Skip to content

Commit

Permalink
Show 'Loading...' while dynamic columns load
Browse files Browse the repository at this point in the history
  • Loading branch information
will-moore committed Mar 9, 2023
1 parent 0f9bdf1 commit bef6f29
Showing 1 changed file with 6 additions and 28 deletions.
34 changes: 6 additions & 28 deletions src/ImageItem.jsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import React from "react";

import Thumbnail from "./Thumbnail";
// import Viewer from "./Viewer";
import { loadOmeroMultiscales, open, getNgffAxes } from "./util";
import { open, getNgffAxes } from "./util";
import { openArray } from "zarr";

// DeckGL react component
Expand All @@ -11,8 +10,6 @@ export default function ImageItem({ source, zarr_columns }) {
source = source.slice(0, -1);
}

// const [layers, setLayers] = React.useState([]);

const [imgInfo, setImageInfo] = React.useState({});

React.useEffect(() => {
Expand Down Expand Up @@ -65,29 +62,6 @@ export default function ImageItem({ source, zarr_columns }) {
let shape = store.meta.shape;
let chunks = store.meta.chunks;

// let layerData = await loadOmeroMultiscales(config, node, attrs);
// let shape = ["TBD"] // layerData.loader[0]._data.meta.shape;
// let chunks = ["TBD"] // layerData.loader[0]._data.meta.chunks;
// console.log("layerData.loader[0]._data.meta", layerData.loader[0]._data.meta, chunks, chunks.join(","))

// let selections = [];
// layerData.channelsVisible.forEach((visible, chIndex) => {
// if (visible) {
// selections.push(
// axes.map((axis, dim) => {
// if (axis.type == "time") return 0;
// if (axis.name == "z") return parseInt(shape[dim] / 2);
// if (axis.name == "c") return chIndex;
// return 0;
// })
// );
// }
// });

// layerData.selections = selections;

// setLayers([layerData]);

setImageInfo({
attrs,
Axes: axes.map((axis) => axis.name).join(""),
Expand Down Expand Up @@ -124,7 +98,11 @@ export default function ImageItem({ source, zarr_columns }) {
</div>
);
} else {
return imgInfo[col_name];
if (imgInfo[col_name] != undefined) {
return imgInfo[col_name];
} else {
return <span style={{"color": "#959595"}}>Loading...</span>
}
}
}

Expand Down

0 comments on commit bef6f29

Please sign in to comment.