Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend canvasHeight option for automatic height. #191

Merged
merged 1 commit into from
Mar 29, 2024

Conversation

mathewjordan
Copy link
Member

@mathewjordan mathewjordan commented Mar 28, 2024

What does this do?

This work of mostly styling changes helps the Viewer component support automatic height within a wrapping container element. If an implementer uses either 100% or auto as values for options.canvasHeight configuration, the viewer with be absolutely positioned, and extend to the bounds of the relative element. Internally in the Clover Viewer, a combination of flexbox flex-grow and height CSS attributes expand the canvas "painting" to fit these bounds. This will be applied to Image, Video, and Sound canvases.

This can be implemented as follows:

<div style={{ position: "relative", height: "900px", zIndex: "0" }}>
  <CloverViewer
    iiifContent="https://example.org/iiif/manifest.json"
    options={{ canvasHeight: "auto" }} // or "100%"
  />
</div>

Further documentation can be found at /docs/viewer#canvas-height.

Notes

This follows work suggested by @tpendragon in the now closed #185.

@mathewjordan mathewjordan self-assigned this Mar 28, 2024
@mathewjordan mathewjordan marked this pull request as ready for review March 28, 2024 19:09
Copy link
Member

@eliotjordan eliotjordan left a comment

Choose a reason for hiding this comment

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

I tried this with our Clover viewer in Figgy and it works great. 💯

Copy link
Contributor

@tpendragon tpendragon left a comment

Choose a reason for hiding this comment

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

Thank you so much! Your support's been incredible, this simplifies our Clover implementation significantly.

@mathewjordan mathewjordan merged commit 57b1629 into main Mar 29, 2024
1 check passed
@mathewjordan mathewjordan deleted the canvas-height-auto branch March 29, 2024 17:52
@mathewjordan
Copy link
Member Author

@eliotjordan @tpendragon Excllent, thank you both for the review. This has been released with v2.7.0 and is documented here https://samvera-labs.github.io/clover-iiif/docs/viewer#automatic-height.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants