Skip to content

Commit

Permalink
Update Cypress reference snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
axelboc committed Jan 9, 2024
1 parent d97399f commit 37c425e
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 16 deletions.
12 changes: 1 addition & 11 deletions apps/storybook/src/Utilities.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ writing your own geometries:
- `ScatterPointsGeometry`, used in [`ScatterPoints`](https://h5web-docs.panosc.eu/?path=/docs/visualizations-scattervis--docs) (undocumented)
- `SurfaceMeshGeometry`, used in [`SurfaceMesh`](https://h5web-docs.panosc.eu/?path=/docs/experimental-surfacevis--docs) (experimental)

### Mock data
### Mock values

The `mockValues` object can be used to generate mock ndarrays for testing purposes:

Expand All @@ -415,16 +415,6 @@ import { mockValues } from '@h5web/lib';
const dataArray = mockValues.twoD();
```

The library also exposes the `makeMockFile` utility function that is used by the [mock demo](https://h5web.panosc.eu/mock) to generate mock metadata and values.
You can retrieve entities from the generated mock file by their paths using the `findMockEntity` utility function:

```ts
import { findMockEntity, makeMockFile } from '@h5web/lib';

const mockFile = makeMockFile();
const entity = findMockEntity(mockFile, '/nD_datasets/twoD');
```

### Box

Utility class that extends Three's [Box3](https://threejs.org/docs/?q=box#api/en/math/Box3) class. Particularly useful when dealing with selection rectangles, the camera's field of view, etc.
Expand Down
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/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/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.
10 changes: 5 additions & 5 deletions packages/shared/src/mock/metadata-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,8 @@ export function withImageAttr<T extends Entity>(entity: T): T {
type EntityOpts = Partial<Pick<Entity, 'attributes' | 'link'>>;
type GroupOpts = EntityOpts & { isRoot?: boolean; children?: ChildEntity[] };

function prefixChildrenPaths(gr: GroupWithChildren, parentPath: string): void {
gr.children.forEach((c) => {
function prefixChildrenPaths(grp: GroupWithChildren, parentPath: string): void {
grp.children.forEach((c) => {
c.path = buildEntityPath(parentPath, c.path.slice(1));

if (isGroup(c) && hasChildren(c)) {
Expand All @@ -159,7 +159,7 @@ export function group(
const { attributes = [], link, isRoot = false } = opts;
const path = isRoot ? '/' : `/${name}`;

const gr: GroupWithChildren = {
const grp: GroupWithChildren = {
name,
path,
kind: EntityKind.Group,
Expand All @@ -168,8 +168,8 @@ export function group(
link,
};

prefixChildrenPaths(gr, path);
return gr;
prefixChildrenPaths(grp, path);
return grp;
}

export function dataset<S extends Shape, T extends DType>(
Expand Down

0 comments on commit 37c425e

Please sign in to comment.