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

Improve the quality of the rendered diagrams #1999

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

zecakeh
Copy link
Contributor

@zecakeh zecakeh commented Nov 16, 2024

The first commit allows to lazy-load the diagrams, which should improve the loading time of the CS API on mobile. In the process it also improves the alt text of the images.

The second commit serves the diagrams as high-resolution WebPs. Encoding a high resolution diagram as WebP gives a file of approximately the same size as the lower resolution PNG. For maximum compatibility we also serve them as a lower resolution WebP and a fallback PNG. WebP was chosen because it is one of the export formats of draw.io/diagrams.net, and it is widely available in modern browsers.

Pull Request Checklist

Preview: https://pr1999--matrix-spec-previews.netlify.app

Encoding the high resolution diagram as WebP gives an image of
approximately the same size as the low resolution PNG.
For maximum compatibility we also serve them as low resolution WebP and
PNG.
WebP was chosen because it is a default export format of draw.io, and it
is widely available in modern browsers.

Signed-off-by: Kévin Commaille <[email protected]>
@zecakeh zecakeh requested a review from a team as a code owner November 16, 2024 14:45
Signed-off-by: Kévin Commaille <[email protected]>
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.

1 participant