Add live sample embeds for SVG path examples#38928
Conversation
|
Preview URLs Flaws (9)URL:
(comment last updated: 2025-04-05 19:00:37) |
|
I think the original intention behind this issue may have been to replace the PNG diagrams with live SVG samples. I've gone ahead and added That said, some of the PNG illustrations, especially those with blue and red lines, convey additional contextual information (like inferred control points or ellipse boundaries) that’s not as easily represented through live code alone. So instead of removing those, I’ve kept them alongside the live samples to preserve that extra clarity. Happy to hear your thoughts on this approach! |
chrisdavidmills
left a comment
There was a problem hiding this comment.
Hi @AshmitGupta, and thank you so much for converting all of these demos into live samples. I really think it improves the experience on the page.
The only thing I wondered is whether it would be good to add a paragraph before each live sample embed saying something like "The above code is rendered as follows:", so it is really obvious what the connection is in each case. What do you think?
files/en-us/web/svg/tutorials/svg_from_scratch/paths/svgarcs_flags.png
Outdated
Show resolved
Hide resolved
Thanks @chrisdavidmills! That’s a great suggestion. Just wanted to note that pages like https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/transform-origin and https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-width also use similar live SVG embeds, and they don’t include that extra explanatory line either. I think that extra sentence might have made more sense if we were keeping the PNG images. But since, as @Josh-Cena pointed out, we’re replacing them with live SVG samples and possibly incorporating the necessary markup directly into them, it feels consistent to follow the simpler pattern used in those other pages. What do you think? |
@AshmitGupta OK, that is totally fair. I'm not that familiar with the SVG docs; in the API and CSS docs, we usually include a bit more structure and explanation around the code listing and live example, but I think you are right — it makes sense to be consistent. I'm satisfied with this, but I'll not merge yet in case @Josh-Cena has any more thoughts, or you want to make any more changes. |
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Josh-Cena
left a comment
There was a problem hiding this comment.
I'm having a lot of fun :) I now migrated all PNGs to SVGs, and made the reference markup hidden from the page. Thank you!
* upstream/main: (158 commits) fix: remove unrelated add() method reference from openCursor() doc (mdn#38998) Fix link (mdn#38995) Remove uncovered topic from a tuturial overview. (mdn#38999) Change the description of Temporal.Instant (mdn#38996) Remove `port` mention for URL `protocol` documentation (mdn#39000) Improve the clarity of a sentence (mdn#39003) Change if...else to non-zero on control_flow page (mdn#38992) Update group-data of EditContext API (mdn#38842) improve description (mdn#38845) fix: auto-cleanup by bot (mdn#38990) New pages: HTMLFormElement.rel and .relList (mdn#38900) Add live sample embeds for SVG path examples (mdn#38928) Remove uncovered topic from the introduction (mdn#38986) Remove self-links (mdn#38982) Synchronize with BCD v6.0.3 (mdn#38983) Fix grammar (mdn#38981) Remove external Web Speech API articles (mdn#38980) Add missing {{Specifications}} macros (mdn#38975) Remove browser-compat for CSS types without BCD (mdn#38970) Update async_function_star_ to have a working example (mdn#38972) ...
* Add live sample embeds for SVG path examples * Update index.md * Removed extra png image for large arc sweep flag * Migrate all PNG * Update files/en-us/web/svg/tutorials/svg_from_scratch/paths/index.md Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Minor fix --------- Co-authored-by: Joshua Chen <sidachen2003@gmail.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Description
svgarcs_flags.pngto reflect "Large Arc Flag"{{EmbedLiveSample}}for better user experienceMotivation
large-arc-flagandsweep-flagparameters.Additional details
Related issues and pull requests
Fixes #38495