Skip to content

Image component and magnified image#162

Merged
gfrn merged 13 commits into
mainfrom
feature/image-and-magnified-image
Jun 15, 2026
Merged

Image component and magnified image#162
gfrn merged 13 commits into
mainfrom
feature/image-and-magnified-image

Conversation

@gfrn

@gfrn gfrn commented Apr 17, 2026

Copy link
Copy Markdown
Collaborator

This adds two components we made for Evo, one that provides an "upgraded" HTML tag that displays a placeholder if the image fails to load, and displays a loading indicator while the image loads.

It also adds another component (mainly used for diffraction images and particle picking) that allows users to zoom in on any area in an image, with lens/zoom sizes being configurable. It also allows users to set contrast, brightness and invert colours to make features easier to detect

image

It is also built entirely with CSS, MUI and HTML, so it requires no extra dependencies.

This depends on #161, as it would be ideal for us to only import components we're using to minimise bundle size and dependencies

@gfrn gfrn requested a review from akademy April 17, 2026 09:14
@gfrn gfrn self-assigned this Apr 17, 2026

@VictoriaBeilsten-Edmands VictoriaBeilsten-Edmands left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does the zoom go outside the image when clicking on the right but inside when clicking on the left?

Image Image

Comment thread package.json
@gfrn

gfrn commented Jun 4, 2026

Copy link
Copy Markdown
Collaborator Author

Why does the zoom go outside the image when clicking on the right but inside when clicking on the left?
Image Image

There was a 100px window where the padding didn't kick in, and it resulted in that, but I removed it because it's just better to use the native breakpoints anyway, so that should be fixed

Comment thread yarn.lock Outdated

@VictoriaBeilsten-Edmands VictoriaBeilsten-Edmands left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like a good addition.

@gfrn

gfrn commented Jun 15, 2026

Copy link
Copy Markdown
Collaborator Author

Sorry, is it OK to merge this one?

@VictoriaBeilsten-Edmands

Copy link
Copy Markdown
Collaborator

Yes. 👍

@gfrn

gfrn commented Jun 15, 2026

Copy link
Copy Markdown
Collaborator Author

Ah yeah, I had to merge main, so I guess it needs another approval

@akademy

akademy commented Jun 15, 2026

Copy link
Copy Markdown
Member

I'm seeing a problem in Storybook where when you use the zoom button (the one actually created BY storybook) the red box doesn't show the right position. I'm on firefox.

Is that reproducable for you?

@akademy

akademy commented Jun 15, 2026

Copy link
Copy Markdown
Member

I'm seeing a problem in Storybook where when you use the zoom button (the one actually created BY storybook) the red box doesn't show the right position. I'm on firefox.

Is that reproducable for you?

I don't know when it will affect the real world, so I'm happy for it to be merged.

@akademy

akademy commented Jun 15, 2026

Copy link
Copy Markdown
Member

PS When this is in, I'll make a new beta release.

@gfrn

gfrn commented Jun 15, 2026

Copy link
Copy Markdown
Collaborator Author

I can reproduce it in Storybook, but in real usage, because it's hooked to the window size, it actually responds to screen size changes/resizes/zoom, so I don't think it would affect real usage

I'll merge it in, then, thanks for having a look!

@gfrn gfrn merged commit 058d903 into main Jun 15, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants