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

Add figure customization options #236

Merged
merged 1 commit into from
Nov 21, 2024
Merged

Conversation

mathewjordan
Copy link
Member

@mathewjordan mathewjordan commented Nov 20, 2024

What does this do?

This extends Figure related options for the Scroll component. Completing this allows implementers of Scroll to customize the canvas figures as required, giving more our less screen space to the figure, and provides flexibility on how the figure is rendered.

Users can now customize:

  • options.figure.aspectRatio default: 1.618 (golden ratio)
  • options.figure.display default: image-viewer
  • options.figure.width default: 38.2%

As an enum, the other option for display is thumbnail.

How to Review?

  1. Install dependencies if required
  2. Spin up local dev npm run dev
  3. Navigate to Scroll demo http://localhost:3000/docs/scroll/demo
  4. Edit the demo.mdx page at pages/docs/scroll/demo.mdx, replacing Scroll JSX with:
<Scroll
  iiifContent="https://digital.lib.utk.edu/assemble/manifest/civilwar/5390"
  options={{
    figure: {
      aspectRatio: 1,
      display: "thumbnail",
      width: "200px",
    },
  }}
/>

@@ -60,14 +61,23 @@ const ScrollItem: React.FC<ScrollItemProps> = ({
total: itemCount,
};

console.log({ figure });
Copy link
Contributor

Choose a reason for hiding this comment

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

@mathewjordan do you want to leave this here? Just checking, PR looks great! 👍

Copy link
Member Author

Choose a reason for hiding this comment

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

Nope, thanks 🙏!

@mathewjordan mathewjordan merged commit 3b869a9 into main Nov 21, 2024
1 check passed
@mathewjordan mathewjordan deleted the scroll-figure-options branch November 21, 2024 16:40
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.

2 participants