Skip to content

Commit

Permalink
Merge pull request #1671 from silx-kit/minor-fixes
Browse files Browse the repository at this point in the history
Better error messages and minor styling fixes
  • Loading branch information
axelboc authored Jun 18, 2024
2 parents 14028fb + 74f9b30 commit 08df670
Show file tree
Hide file tree
Showing 26 changed files with 17 additions and 7 deletions.
Binary file modified cypress/snapshots/app.cy.ts/auximage.snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified cypress/snapshots/app.cy.ts/auxspectrum.snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified cypress/snapshots/app.cy.ts/bgr_image.snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified cypress/snapshots/app.cy.ts/heatmap_2D.snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified cypress/snapshots/app.cy.ts/heatmap_2D_complex.snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified cypress/snapshots/app.cy.ts/heatmap_2D_inverted_cmap.snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified cypress/snapshots/app.cy.ts/heatmap_4d_default.snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified cypress/snapshots/app.cy.ts/heatmap_4d_remapped.snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified cypress/snapshots/app.cy.ts/heatmap_4d_sliced.snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified cypress/snapshots/app.cy.ts/heatmap_4d_zeros.snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified cypress/snapshots/app.cy.ts/heatmap_domain.snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified cypress/snapshots/app.cy.ts/heatmap_flip.snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified cypress/snapshots/app.cy.ts/line_1D.snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified cypress/snapshots/app.cy.ts/line_complex_1D.snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified cypress/snapshots/app.cy.ts/logspectrum.snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified cypress/snapshots/app.cy.ts/nximage.snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified cypress/snapshots/app.cy.ts/nxrgb.snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified cypress/snapshots/app.cy.ts/nxscatter.snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified cypress/snapshots/app.cy.ts/nxspectrum.snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified cypress/snapshots/app.cy.ts/rgb_image.snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions packages/app/src/explorer/Explorer.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
line-height: 1.5; /* fix cropping of ascenders and descenders */
}

.spinner {
Expand Down
2 changes: 1 addition & 1 deletion packages/app/src/metadata-viewer/MetadataTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function MetadataTable(props: PropsWithChildren<Props>) {
<table className={styles.table}>
<thead>
<tr>
<th scope="col" colSpan={2}>
<th className={styles.title} scope="col" colSpan={2}>
{title}
</th>
</tr>
Expand Down
5 changes: 4 additions & 1 deletion packages/app/src/metadata-viewer/MetadataViewer.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,12 @@
margin-top: 1rem;
}

.title {
text-transform: capitalize;
}

.table th {
font-weight: 500;
text-transform: capitalize;
}

.table thead th {
Expand Down
6 changes: 4 additions & 2 deletions packages/app/src/metadata-viewer/RawInspector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import type { ProvidedEntity } from '@h5web/shared/hdf5-models';

import styles from './RawInspector.module.css';

const KEYS_TO_SKIP = new Set(['parents', 'children', 'value']);

interface Props {
entity: ProvidedEntity;
}
Expand All @@ -16,8 +18,8 @@ function RawInspector(props: Props) {
{JSON.stringify(
entity,
(key, value) => {
// Bypass cyclic dependencies
return key !== 'parents' && key !== 'children' ? value : undefined;
// Bypass `value` and cyclic dependencies
return KEYS_TO_SKIP.has(key) ? undefined : value;
},
2,
)}
Expand Down
1 change: 0 additions & 1 deletion packages/app/src/vis-packs/core/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@ export function useMappedArrays(
values: NumArray[],
dims: number[],
mapping: DimensionMapping,
autoScale?: boolean,
): NdArray<NumArray>[];

export function useMappedArrays(
Expand Down
9 changes: 7 additions & 2 deletions packages/app/src/vis-packs/nexus/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,10 +137,15 @@ export function findAssociatedDatasets(
if (name === '.') {
return undefined;
}
if (name.includes('/')) {
throw new Error(
`Expected "${name}" to be the name of a child dataset, not a path`,
);
}

const dataset = getChildEntity(group, name);
assertDefined(dataset);
assertDataset(dataset);
assertDefined(dataset, `Expected child entity "${name}" to exist`);
assertDataset(dataset, `Expected child "${name}" to be a dataset`);
assertArrayShape(dataset);
assertNumericType(dataset);
return dataset;
Expand Down

0 comments on commit 08df670

Please sign in to comment.