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

aspect-ratio #112

Merged
merged 5 commits into from
Oct 18, 2024
Merged

aspect-ratio #112

merged 5 commits into from
Oct 18, 2024

Conversation

eatyourpeas
Copy link
Member

Overview

@dmc-cambric and colleagues from Cambric in Scotland need the chart to be wider in landscape the the currently hard-coded width of 1000px

This PR reintroduces height and width optional props to the RCPCHChart component. If not supplied, the chart defaults to 1000px width, 800px height. NOTE: both height and weight must be supplied and the user must work out a sensible aspect ratio themselves. Because the SVG chart will scale to the width and height supplied, but the text (and datapoints) within it will not, the height and weight are used to calculate a scale factor for text to be applied to tooltips and axis labels and the event and legend text. This scaling does not apply to titles, buttons or plotted datapoints.

A further raised issue relates to the use of createGlobalStyles which has had the effect of applying RCPCHChart styles across the DOM. Apologies for this. This has been fixed by using a simpler styled div to wrap the <CentileChart/> and <SDSChart/> components.

Code changes

Please describe the changes you made here.

Documentation changes (done or required as a result of this PR)

The documentation in the mdx story file has been updated with the changes.

Related Issues

This closes #101 and #110

Mentions

Thanks to @dmc-cambric

@eatyourpeas eatyourpeas added the ui issues relating to user interface label Oct 17, 2024
@eatyourpeas eatyourpeas self-assigned this Oct 17, 2024
@eatyourpeas eatyourpeas linked an issue Oct 17, 2024 that may be closed by this pull request
Copy link
Contributor

@dmc-cambric dmc-cambric left a comment

Choose a reason for hiding this comment

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

Looks good! Once deployed will give it a proper test in our system @eatyourpeas

@eatyourpeas eatyourpeas merged commit 507c9fd into live Oct 18, 2024
1 check passed
@eatyourpeas eatyourpeas deleted the eatyourpeas/issue101 branch October 18, 2024 18:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ui issues relating to user interface
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RCPCH Chart - SVG scaling maxes out at 1000w x 800h - v7.0.12 aspect ratio
2 participants