{"id":437734,"date":"2024-11-07T21:17:26","date_gmt":"2024-11-07T21:17:26","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=437734"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=437734","title":{"rendered":"<span>\u041f\u043e\u043b\u0435\u0437\u043d\u044b\u0435 \u0440\u0435\u0446\u0435\u043f\u0442\u044b \u0440\u0443\u0447\u043d\u043e\u0433\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f SVG<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-1\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/webt\/ma\/po\/lv\/mapolvqq4uunxfqoaviv3g9km9y.jpeg\" data-src=\"https:\/\/habrastorage.org\/webt\/ma\/po\/lv\/mapolvqq4uunxfqoaviv3g9km9y.jpeg\" data-blurred=\"true\"\/> <\/p>\n<p> <\/p>\n<p> <\/p>\n<p>\u041f\u0440\u0438\u0437\u043d\u0430\u044e\u0441\u044c, \u043f\u043e\u043d\u0430\u0447\u0430\u043b\u0443 \u044f \u0431\u044b\u043b\u0430 \u0441\u043a\u0435\u043f\u0442\u0438\u043a\u043e\u043c \u0440\u0443\u0447\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f SVG. \u0411\u0443\u0434\u0443\u0447\u0438 \u0444\u0440\u043e\u043d\u0442\u0435\u043d\u0434-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u043c, \u043f\u0440\u0438\u0432\u044b\u043a\u0448\u0438\u043c \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442\u044c \u0432 \u043f\u043e\u0440\u044f\u0434\u043e\u043a &#171;\u043f\u043b\u043e\u0445\u0438\u0435&#187; SVG-\u0444\u0430\u0439\u043b\u044b, \u044f \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u0432\u0441\u0435\u0440\u044c\u0435\u0437 \u043d\u0435 \u0437\u0430\u0434\u0443\u043c\u044b\u0432\u0430\u043b\u0430\u0441\u044c \u043e \u0442\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u0441\u0430\u043c\u043e\u0439 <em>\u0440\u0438\u0441\u043e\u0432\u0430\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u0434\u0430<\/em>.<\/p>\n<p> <\/p>\n<p>\u041e\u0434\u043d\u0430\u043a\u043e, \u043f\u0440\u043e\u0448\u043b\u043e\u0439 \u0437\u0438\u043c\u043e\u0439 \u044f \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u043b\u0430 \u043f\u0440\u043e\u0435\u043a\u0442 \u0434\u043b\u044f <a href=\"https:\/\/code.halfapx.com\/guideline-generator\/\">\u0440\u0438\u0441\u043e\u0432\u0430\u043d\u0438\u044f \u043a\u0430\u043b\u043b\u0438\u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0441\u0435\u0442\u043e\u043a<\/a> \u0438 \u0441 \u0433\u043e\u043b\u043e\u0432\u043e\u0439 \u043f\u043e\u0433\u0440\u0443\u0437\u0438\u043b\u0430\u0441\u044c \u0432 \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u0435 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0439 SVG. \u041e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c, \u0447\u0442\u043e, \u043d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0437\u043d\u0430\u043d\u0438\u0435 \u0431\u0430\u0437\u043e\u0432\u044b\u0445 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440 \u0438 \u043f\u0440\u0430\u0432\u0438\u043b \u0440\u0430\u0431\u043e\u0442\u044b \u0441 SVG, \u043f\u043e-\u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0435\u043c\u0443 \u043f\u043e\u043d\u044f\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432\u0441\u0435\u0445 \u044d\u0442\u0438\u0445 \u0446\u0438\u0444\u0440 \u0438 \u0438\u0445 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043c\u0435\u0436\u0434\u0443 \u0441\u043e\u0431\u043e\u0439 \u043c\u043e\u0436\u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0435\u0440\u0435\u0437 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0443 \u0440\u0443\u0447\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f.<\/p>\n<p> <\/p>\n<p>\u0410 \u043a\u0430\u043a \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0441\u0432\u043e\u0438\u0448\u044c\u0441\u044f, \u044d\u0442\u043e \u0437\u0430\u043d\u044f\u0442\u0438\u0435 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u043d\u0430 \u0440\u0435\u0434\u043a\u043e\u0441\u0442\u044c \u0443\u0432\u043b\u0435\u043a\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u0438 \u0434\u0430\u0436\u0435 \u0437\u0430\u0431\u0430\u0432\u043d\u044b\u043c.<\/p>\n<p><a name=\"habracut\"><\/a> <\/p>\n<blockquote><p><em>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u043d\u0435 \u0431\u0443\u0434\u0435\u043c \u0443\u0433\u043b\u0443\u0431\u043b\u044f\u0442\u044c\u0441\u044f \u0432 \u0441\u043b\u043e\u0436\u043d\u044b\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b SVG, \u0442\u0430\u043a\u0438\u0435 \u043a\u0430\u043a <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/SVG\/Tutorial\/Paths\">path<\/a>. \u041d\u0430\u0448\u0430 \u0446\u0435\u043b\u044c \u2014 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0430\u0441\u043f\u0435\u043a\u0442\u044b \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043f\u0440\u043e\u0441\u0442\u044b\u043c\u0438 SVG. \u041a\u043e\u0433\u0434\u0430 \u0434\u0435\u043b\u043e \u0434\u043e\u0445\u043e\u0434\u0438\u0442 \u0434\u043e \u0440\u0438\u0441\u043e\u0432\u0430\u043d\u0438\u044f \u043a\u0440\u0438\u0432\u044b\u0445 (curves), \u044f \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b \u0432\u0440\u043e\u0434\u0435 Illustrator \u0438\u043b\u0438 Affinity. \u041e\u0434\u043d\u0430\u043a\u043e, \u0435\u0441\u043b\u0438 \u0432\u044b \u0437\u0430\u0445\u043e\u0442\u0438\u0442\u0435 \u043f\u043e\u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441 \u0441\u043e\u0441\u0442\u0430\u0432\u043d\u044b\u043c\u0438 \u043b\u0438\u043d\u0438\u044f\u043c\u0438, \u0437\u043d\u0430\u043d\u0438\u0435 path \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u0433\u043e\u0434\u0438\u0442\u044c\u0441\u044f. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u043c\u044b \u0432\u0435\u0440\u043d\u0435\u043c\u0441\u044f \u043a \u044d\u0442\u043e\u0439 \u0442\u0435\u043c\u0435 \u0432 \u043e\u0434\u043d\u043e\u0439 \u0438\u0437 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0441\u0442\u0430\u0442\u0435\u0439.<\/em><\/p>\n<p> <em>\u041e\u0441\u043d\u043e\u0432\u043d\u043e\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u0432 \u044d\u0442\u043e\u043c \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u0435 \u0443\u0434\u0435\u043b\u0435\u043d\u043e \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u043c\u043e\u0433\u0443\u0442 \u043f\u043e\u043d\u044f\u0442\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0430\u0441\u043f\u0435\u043a\u0442\u044b \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f SVG-\u0433\u0440\u0430\u0444\u0438\u043a\u0438. \u0414\u043b\u044f \u0431\u043e\u043b\u0435\u0435 \u0433\u043b\u0443\u0431\u043e\u043a\u043e\u0433\u043e \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u044f \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0439 SVG \u0441\u043e\u0432\u0435\u0442\u0443\u044e \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c\u0441\u044f \u043a \u0441\u0442\u0430\u0442\u044c\u0435 <a href=\"https:\/\/www.smashingmagazine.com\/2019\/05\/svg-design-tools-practical-guide\/#comments-svg-design-tools-practical-guide\">&#171;A Practical Guide To SVG And Design Tools&#187;<\/a>.<\/em><\/p><\/blockquote>\n<p> <\/p>\n<h2 id=\"-risovanie-s-pomoschyu-matematiki-pomnite-o-sistemah-koordinat\">\u276f \u0420\u0438\u0441\u043e\u0432\u0430\u043d\u0438\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u043a\u0438. \u041f\u043e\u043c\u043d\u0438\u0442\u0435 \u043e \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u0445 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442?<\/h2>\n<p> <\/p>\n<p>Illustrator, Affinity \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0432\u0435\u043a\u0442\u043e\u0440\u043d\u043e\u0439 \u0433\u0440\u0430\u0444\u0438\u043a\u043e\u0439 \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u043f\u043e\u043c\u043e\u0433\u0430\u044e\u0442 \u0440\u0438\u0441\u043e\u0432\u0430\u0442\u044c \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442, \u0430 \u0437\u0430\u0442\u0435\u043c \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u044e\u0442 \u044d\u0442\u0438 \u043f\u0443\u0442\u0438 \u0438 \u0444\u0438\u0433\u0443\u0440\u044b \u0432 \u0444\u0430\u0439\u043b\u0430\u0445 SVG.<\/p>\n<p> <\/p>\n<p>\u0415\u0441\u043b\u0438 \u043e\u0442\u043a\u0440\u044b\u0442\u044c \u044d\u0442\u0438 \u0444\u0430\u0439\u043b\u044b \u0432 \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0435, \u043c\u043e\u0436\u043d\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c, \u0447\u0442\u043e \u043e\u043d\u0438 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0441\u043e\u0431\u043e\u0439 \u043d\u0430\u0431\u043e\u0440 \u043f\u0443\u0442\u0435\u0439, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0445 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0447\u0438\u0441\u0435\u043b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u0430\u043c\u0438 \u0432 \u0442\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435, \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0441\u043e\u0441\u0442\u043e\u044f\u0442 \u043b\u0438\u043d\u0438\u0438.<\/p>\n<p> <\/p>\n<p>\u041e\u0434\u043d\u0430\u043a\u043e, \u043f\u043e\u043c\u0438\u043c\u043e \u0432\u0441\u0435\u043c\u043e\u0433\u0443\u0449\u0435\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 <code>&lt;path&gt;<\/code>, SVG \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0438 \u0431\u043e\u043b\u0435\u0435 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043f\u0440\u0438\u043c\u0438\u0442\u0438\u0432\u044b: <code>&lt;rect&gt;<\/code>, <code>&lt;circle&gt;<\/code>, <code>&lt;line&gt;<\/code>, <code>&lt;ellipse&gt;<\/code>, <code>&lt;polygon&gt;<\/code> \u0438 <code>&lt;polyline&gt;<\/code>.<\/p>\n<p> <\/p>\n<p>\u042d\u0442\u0438 \u0431\u0430\u0437\u043e\u0432\u044b\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u043d\u0435 \u0442\u0430\u043a \u0441\u043b\u043e\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0432\u0440\u0443\u0447\u043d\u0443\u044e, \u0438 \u043e\u043d\u0438 \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u044e\u0442 \u043c\u043d\u043e\u0433\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439 \u0434\u043b\u044f \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0438 \u0438 \u0434\u0440\u0443\u0433\u0438\u0445 \u0438\u043d\u0442\u0435\u0440\u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0445 \u044d\u0444\u0444\u0435\u043a\u0442\u043e\u0432. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, SVG \u2014 \u044d\u0442\u043e \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u0443\u0435\u043c\u044b\u0435 \u0440\u0430\u0441\u0442\u0440\u043e\u0432\u044b\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f, \u043d\u043e \u0438 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u044b\u0435 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u044b \u043a\u043e\u0434\u0430.<\/p>\n<p> <\/p>\n<h3 id=\"kak-rabotaet-svg-unit--unit\">\u041a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 SVG? <code>unit != unit<\/code><\/h3>\n<p> <\/p>\n<p>\u041f\u0440\u0435\u0436\u0434\u0435 \u0447\u0435\u043c \u043c\u044b \u0443\u0433\u043b\u0443\u0431\u0438\u043c\u0441\u044f \u0432 \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0434\u0435\u0442\u0430\u043b\u0438 \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0438 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 SVG, \u0441\u0442\u043e\u0438\u0442 \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0432 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044f\u0445 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0435\u0434\u0438\u043d\u0438\u0446\u0430\u043c\u0438 \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u044f \u0432 \u044d\u0442\u043e\u043c \u0444\u043e\u0440\u043c\u0430\u0442\u0435.<\/p>\n<p> <\/p>\n<p>\u0413\u043b\u0430\u0432\u043d\u043e\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e SVG \u2014 \u044d\u0442\u043e \u0432\u0435\u043a\u0442\u043e\u0440\u043d\u044b\u0439 \u0444\u043e\u0440\u043c\u0430\u0442, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0439 \u0435\u043c\u0443 \u0431\u044b\u0442\u044c \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b\u043c \u043e\u0442 \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u0432 \u044d\u043a\u0440\u0430\u043d\u0430. \u0415\u0434\u0438\u043d\u0438\u0446\u044b \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u044f \u0432 SVG \u043e\u0442\u0432\u044f\u0437\u0430\u043d\u044b \u043e\u0442 \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u0438\u0441\u0442\u0438\u043a \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u0438 \u0432\u043c\u0435\u0441\u0442\u043e \u044d\u0442\u043e\u0433\u043e \u043e\u0442\u043d\u043e\u0441\u044f\u0442\u0441\u044f \u043a \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u0439 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430.<\/p>\n<p> <\/p>\n<p>\u041f\u0440\u043e\u0449\u0435 \u0433\u043e\u0432\u043e\u0440\u044f, \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 SVG \u043c\u044b <strong>\u043d\u0435 \u043e\u043f\u0435\u0440\u0438\u0440\u0443\u0435\u043c<\/strong> \u043f\u0438\u043a\u0441\u0435\u043b\u044f\u043c\u0438 \u0438\u043b\u0438 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c\u0438 \u0435\u0434\u0438\u043d\u0438\u0446\u0430\u043c\u0438, \u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0443\u0441\u043b\u043e\u0432\u043d\u044b\u0435 \u0447\u0438\u0441\u043b\u043e\u0432\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u0430 \u0443\u0436\u0435 \u043f\u043e\u0442\u043e\u043c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c \u0440\u0430\u0437\u043c\u0435\u0440 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430.<\/p>\n<p> <\/p>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0445\u043e\u0442\u044f <code>width<\/code> \u0438 <code>height<\/code> SVG-\u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043c\u043e\u0433\u0443\u0442 \u0437\u0430\u0434\u0430\u0432\u0430\u0442\u044c\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u0440\u0438\u0432\u044b\u0447\u043d\u044b\u0445 CSS-\u0435\u0434\u0438\u043d\u0438\u0446, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 <code>rem<\/code>, \u0432\u043d\u0443\u0442\u0440\u0438 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430 <code>viewBox<\/code> \u044d\u0442\u0438 \u0432\u0435\u043b\u0438\u0447\u0438\u043d\u044b \u0441\u0442\u0430\u043d\u043e\u0432\u044f\u0442\u0441\u044f \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0442\u043d\u044b\u043c\u0438 \u0447\u0438\u0441\u043b\u0430\u043c\u0438. \u0414\u0440\u0443\u0433\u0438\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438, \u0435\u0434\u0438\u043d\u0438\u0446\u044b \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u044f \u0432 <code>viewBox<\/code> \u0441\u043b\u0443\u0436\u0430\u0442 \u043b\u0438\u0448\u044c \u0434\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u043e\u043f\u043e\u0440\u0446\u0438\u0439 \u0438 \u043d\u0435 \u043f\u0440\u0438\u0432\u044f\u0437\u0430\u043d\u044b \u043a \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u043c \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u0440\u0430\u0437\u043c\u0435\u0440\u0430\u043c.<\/p>\n<p> <\/p>\n<h3 id=\"chto-takoe-viewbox\">\u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 <code>viewBox<\/code>?<\/h3>\n<p> <\/p>\n<p><code>viewBox<\/code> \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a \u0436\u0435, \u043a\u0430\u043a \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e <code>aspect-ratio<\/code> \u0432 CSS. \u041e\u043d \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0441\u043e\u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u0435 \u043c\u0435\u0436\u0434\u0443 \u0448\u0438\u0440\u0438\u043d\u043e\u0439 \u0438 \u0432\u044b\u0441\u043e\u0442\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442 \u0438 \u0437\u0430\u0434\u0430\u0435\u0442 \u0433\u0440\u0430\u043d\u0438\u0446\u044b \u0440\u0430\u0431\u043e\u0447\u0435\u0439 \u043e\u0431\u043b\u0430\u0441\u0442\u0438. \u042f \u043e\u0431\u044b\u0447\u043d\u043e \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u044e <code>viewBox<\/code> \u043a\u0430\u043a &#171;\u0440\u0430\u0437\u043c\u0435\u0440 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430&#187;.<\/p>\n<p> <\/p>\n<p>\u041b\u044e\u0431\u043e\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442, \u0440\u0430\u0437\u043c\u0435\u0449\u0435\u043d\u043d\u044b\u0439 \u0432\u043d\u0443\u0442\u0440\u0438 SVG, \u0433\u0430\u0431\u0430\u0440\u0438\u0442\u044b \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043f\u0440\u0435\u0432\u044b\u0448\u0430\u044e\u0442 \u0440\u0430\u0437\u043c\u0435\u0440\u044b <code>viewBox<\/code>, \u0431\u0443\u0434\u0435\u0442 \u043e\u0431\u0440\u0435\u0437\u0430\u0442\u044c\u0441\u044f. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, <code>viewBox<\/code> \u2014 \u044d\u0442\u043e \u0441\u0440\u0435\u0437 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u0432\u0438\u0434\u0438\u043c \u043d\u0430 \u044d\u043a\u0440\u0430\u043d\u0435. \u041f\u0440\u0438 \u043d\u0430\u043b\u0438\u0447\u0438\u0438 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430 <code>viewBox<\/code>, \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b <code>width<\/code> \u0438 <code>height<\/code> \u0441\u0442\u0430\u043d\u043e\u0432\u044f\u0442\u0441\u044f \u043d\u0435\u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u043c\u0438.<\/p>\n<p> <\/p>\n<p>\u0414\u0440\u0443\u0433\u0438\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438, \u043d\u0430\u043b\u0438\u0447\u0438\u0435 <code>viewBox<\/code> \u0434\u0435\u043b\u0430\u0435\u0442 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 SVG \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u0445\u043e\u0436\u0438\u043c \u043d\u0430 \u043e\u0431\u044b\u0447\u043d\u043e\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435. \u0418 \u043a\u0430\u043a \u0438 \u0441 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f\u043c\u0438, \u043e\u0431\u044b\u0447\u043d\u043e \u0443\u0434\u043e\u0431\u043d\u0435\u0435 \u0437\u0430\u0434\u0430\u0442\u044c \u043b\u0438\u0431\u043e <code>width<\/code>, \u043b\u0438\u0431\u043e <code>height<\/code>, \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0432 \u0432\u0442\u043e\u0440\u043e\u043c\u0443 \u0440\u0430\u0437\u043c\u0435\u0440\u0443 \u043f\u043e\u0434\u0441\u0442\u0440\u043e\u0438\u0442\u044c\u0441\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0441 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0445 \u043f\u0440\u043e\u043f\u043e\u0440\u0446\u0438\u0439.<\/p>\n<p> <\/p>\n<p>\u0418\u0442\u0430\u043a, \u043f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0434\u043b\u044f \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0438 SVG \u043d\u0430\u043c \u043f\u043e\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043b\u043e\u0441\u044c \u0431\u044b \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0442\u0440\u0438 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0438 \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0438\u0445 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<p> <\/p>\n<pre><code class=\"javascript\">`&lt;svg   width=\"${svgWidth}\"   viewBox=\"0 0 ${documentWidth} ${documentHeight}\"   xmlns=\"http:\/\/www.w3.org\/2000\/svg\" &gt;`;<\/code><\/pre>\n<p> <\/p>\n<h3 id=\"vazhnye-osobennosti-svg\">\u0412\u0430\u0436\u043d\u044b\u0435 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 SVG<\/h3>\n<p> <\/p>\n<p>\u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 SVG \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u0448\u0438\u0440\u0435, \u0447\u0435\u043c \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u043f\u0435\u0440\u0432\u044b\u0439 \u0432\u0437\u0433\u043b\u044f\u0434. \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0442\u0435\u0433\u0430 <code>use<\/code> \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0435\u0432\u0440\u0430\u0442\u0438\u0442\u044c \u0447\u0430\u0441\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u043e\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0432 <code>symbol<\/code>; \u043c\u043e\u0436\u043d\u043e \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u044f\u0442\u044c SVG-\u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0432 \u0441\u043f\u0440\u0430\u0439\u0442\u044b (sprites), \u0430 \u0442\u0430\u043a\u0436\u0435 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0442\u044c \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0435 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0430\u0446\u0438\u0438 \u043f\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044e SVG \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0438\u043a\u043e\u043d\u043e\u043a.<\/p>\n<p> <\/p>\n<p>\u041e\u0434\u043d\u0430\u043a\u043e, \u0434\u0435\u0442\u0430\u043b\u044c\u043d\u043e\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u0438\u0435 \u044d\u0442\u0438\u0445 \u0430\u0441\u043f\u0435\u043a\u0442\u043e\u0432 \u0432\u044b\u0445\u043e\u0434\u0438\u0442 \u0437\u0430 \u0440\u0430\u043c\u043a\u0438 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438. \u0417\u0434\u0435\u0441\u044c \u043c\u044b \u0441\u043e\u0441\u0440\u0435\u0434\u043e\u0442\u043e\u0447\u0438\u043c\u0441\u044f \u0432 \u043f\u0435\u0440\u0432\u0443\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u043d\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 SVG-\u0444\u0430\u0439\u043b\u043e\u0432, \u0430 \u043d\u0435 \u043d\u0430 \u0438\u0445 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u0438 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438.<\/p>\n<p> <\/p>\n<p>\u0422\u0435\u043c \u043d\u0435 \u043c\u0435\u043d\u0435\u0435, \u0435\u0441\u0442\u044c \u043e\u0434\u043d\u0430 \u0432\u0430\u0436\u043d\u0430\u044f \u0442\u0435\u043c\u0430, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0441\u0442\u043e\u0438\u0442 \u0437\u0430\u0442\u0440\u043e\u043d\u0443\u0442\u044c \u2014 <strong>\u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0441\u0442\u044c<\/strong> SVG.<\/p>\n<p> <\/p>\n<p>SVG-\u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u043d\u0443\u0442\u0440\u0438 \u0442\u0435\u0433\u0430 <code>&lt;img&gt;<\/code>, \u0433\u0434\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u0430\u0442\u0440\u0438\u0431\u0443\u0442 <code>alt<\/code>. \u041e\u0434\u043d\u0430\u043a\u043e, \u0442\u0430\u043a\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432\u0430\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441 SVG-\u043a\u043e\u0434\u043e\u043c. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u043e \u043c\u043d\u043e\u0433\u0438\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 \u043b\u0443\u0447\u0448\u0438\u043c \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u043c \u0431\u0443\u0434\u0435\u0442 \u0438\u043c\u0435\u043d\u043d\u043e \u0432\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u043d\u0438\u0435 SVG \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u0432 HTML-\u043a\u043e\u0434 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b.<\/p>\n<p> <\/p>\n<p>\u0414\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0430\u0442\u0440\u0438\u0431\u0443\u0442 <code>role=\"img\"<\/code> \u043a SVG-\u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0443, \u0430 \u0437\u0430\u0442\u0435\u043c \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0442\u0435\u0433 <code>&lt;title&gt;<\/code> \u0441 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f.<\/p>\n<p> <\/p>\n<p><strong>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435<\/strong>: \u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u044b\u0435 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0430\u0446\u0438\u0438 \u043f\u043e \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u0438\u044e \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0441\u0442\u0438 SVG-\u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 <a href=\"https:\/\/www.smashingmagazine.com\/2021\/05\/accessible-svg-patterns-comparison\/\">\u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435<\/a>.<\/p>\n<p> <\/p>\n<pre><code class=\"javascript\">&lt;svg   role=\"img\"   [...attr] &gt;   &lt;title&gt;\u0414\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0439 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a&lt;\/title&gt;   &lt;!-- \u041a\u043e\u0434 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f --&gt; &lt;\/svg&gt;<\/code><\/pre>\n<p> <\/p>\n<h2 id=\"-sozdanie-svg-s-pomoschyu-javascript\">\u276f \u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 SVG \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e JavaScript<\/h2>\n<p> <\/p>\n<p>\u041f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 SVG \u0447\u0430\u0441\u0442\u043e \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043f\u0440\u0438\u0431\u0435\u0433\u0430\u0442\u044c \u043a \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u0440\u0430\u0441\u0447\u0435\u0442\u0430\u043c, \u043f\u043e\u0440\u043e\u0439 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u044b\u043c, \u0430 \u0438\u043d\u043e\u0433\u0434\u0430 \u0438 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0441\u043b\u043e\u0436\u043d\u044b\u043c (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u0440\u0438 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0438 \u043a\u0430\u043b\u043b\u0438\u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0441\u0435\u0442\u043e\u043a \u043d\u0443\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0442\u0440\u0438\u0433\u043e\u043d\u043e\u043c\u0435\u0442\u0440\u0438\u044e). \u041d\u043e, \u043d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u043f\u0440\u043e\u0441\u0442\u0443\u044e \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u043a\u0443, \u043c\u043d\u043e\u0433\u0438\u0435 \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0438\u0442\u0430\u044e\u0442 \u043d\u0435 \u043f\u0438\u0441\u0430\u0442\u044c SVG-\u043a\u043e\u0434 \u043d\u0430 \u0447\u0438\u0441\u0442\u043e\u043c HTML, \u0430 \u0445\u043e\u0442\u044f\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0430\u043b\u0433\u0435\u0431\u0440\u0443.<\/p>\n<p> <\/p>\n<p>\u041b\u0438\u0447\u043d\u043e \u043c\u043d\u0435 \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u043f\u0440\u043e\u0449\u0435 \u043f\u043e\u043d\u0438\u043c\u0430\u0442\u044c SVG-\u043a\u043e\u0434, \u043a\u043e\u0433\u0434\u0430 \u044f \u043c\u043e\u0433\u0443 \u0434\u0430\u0432\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c \u043e\u0441\u043c\u044b\u0441\u043b\u0435\u043d\u043d\u044b\u0435 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f, \u043d\u0435\u0436\u0435\u043b\u0438 \u043e\u043f\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0430\u0431\u043e\u0440\u043e\u043c \u0446\u0438\u0444\u0440. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432 \u0441\u0432\u043e\u0435\u0439 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 \u044f \u0432\u0441\u0435\u0433\u0434\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e JS.<\/p>\n<p> <\/p>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u0445 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0438 \u043f\u0440\u043e\u0441\u0442\u044b\u0435 \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f, \u0430 \u0437\u0430\u0442\u0435\u043c, \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0448\u0430\u0431\u043b\u043e\u043d\u043d\u044b\u0435 \u0441\u0442\u0440\u043e\u043a\u0438 (template literals) (\u0432 \u0441\u0442\u0438\u043b\u0435 JSX) \u0434\u043b\u044f \u0431\u043e\u043b\u0435\u0435 \u0447\u0438\u0442\u0430\u0431\u0435\u043b\u044c\u043d\u043e\u0439 \u0438\u043d\u0442\u0435\u0440\u043f\u043e\u043b\u044f\u0446\u0438\u0438.<\/p>\n<p> <\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u043e \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b\u043c \u043e\u0442 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0445 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u043e\u0432, \u044f \u0445\u043e\u0447\u0443 \u0432\u043a\u0440\u0430\u0442\u0446\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 SVG-\u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0447\u0438\u0441\u0442\u043e\u0433\u043e JS.<\/p>\n<p> <\/p>\n<p>\u041c\u044b \u043d\u0430\u0447\u043d\u0435\u043c \u0441 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043d\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 HTML, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043c\u0435\u0449\u0435\u043d SVG, \u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u044d\u0442\u043e\u0442 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0447\u0435\u0440\u0435\u0437 JS.<\/p>\n<p> <\/p>\n<pre><code class=\"javascript\">&lt;div data-svg-container&gt;&lt;\/div&gt; &lt;script src=\"template.js\"&gt;&lt;\/script&gt;<\/code><\/pre>\n<p> <\/p>\n<p>\u0414\u043b\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u044b \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u043c\u044b \u043d\u0430\u0440\u0438\u0441\u0443\u0435\u043c \u043f\u0440\u044f\u043c\u043e\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a <code>&lt;rect&gt;<\/code> \u0441 \u0437\u0430\u043b\u0438\u0432\u043a\u043e\u0439, \u0437\u0430\u043d\u0438\u043c\u0430\u044e\u0449\u0438\u0439 \u0432\u0435\u0441\u044c <code>viewBox<\/code>.<\/p>\n<p> <\/p>\n<p><em>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435: \u0434\u043b\u044f \u0437\u0430\u043b\u0438\u0432\u043a\u0438 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0442\u044c \u043b\u044e\u0431\u044b\u0435 \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u044b\u0435 \u0432 CSS \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u043e\u0442 \u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0446\u0432\u0435\u0442\u043e\u0432 \u0434\u043e \u0442\u0430\u043a\u0438\u0445 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439, \u043a\u0430\u043a <code>currentColor<\/code> \u0438\u043b\u0438 CSS-\u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435. \u042d\u0442\u043e \u0443\u0434\u043e\u0431\u043d\u043e, \u0435\u0441\u043b\u0438 SVG \u0432\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0432 HTML-\u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u0438 \u0434\u043e\u043b\u0436\u0435\u043d \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u044c \u0435\u0435 \u0441\u0442\u0438\u043b\u0435\u0432\u043e\u0435 \u043e\u0444\u043e\u0440\u043c\u043b\u0435\u043d\u0438\u0435.<\/em><\/p>\n<p> <\/p>\n<p>\u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435:<\/p>\n<p> <\/p>\n<pre><code class=\"javascript\">\/\/ \u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 const container = document.querySelector(\"[data-svg-container]\"); const svgWidth = \"30rem\"; \/\/ \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043b\u044e\u0431\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0441 \u0435\u0434\u0438\u043d\u0438\u0446\u0430\u043c\u0438 \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u044f const documentWidth = 100; const documentHeight = 100; const rectWidth = documentWidth; const rectHeight = documentHeight; const rectFill = \"currentColor\"; \/\/ \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043b\u044e\u0431\u043e\u0435 \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0446\u0432\u0435\u0442\u0430 const title = \"A simple square box\";<\/code><\/pre>\n<p> <\/p>\n<h3 id=\"metod-1-sozdanie-elementa-i-ustanovka-atributov\">\u041c\u0435\u0442\u043e\u0434 1. \u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432<\/h3>\n<p> <\/p>\n<p>\u0414\u0430\u043d\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u043f\u0440\u043e\u0449\u0435 \u0432 \u043f\u043b\u0430\u043d\u0435 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u0438\u044f \u0442\u0438\u043f\u043e\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438 (\u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f TypeScript) \u2014 \u043e\u043d \u0437\u0430\u0434\u0435\u0439\u0441\u0442\u0432\u0443\u0435\u0442 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b, \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b SVG \u0438 \u0442.\u0434. \u041e\u0434\u043d\u0430\u043a\u043e, \u043e\u043d \u043c\u0435\u043d\u0435\u0435 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u0435\u043d \u0438 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u0435 \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u0435\u0441\u043b\u0438 \u0440\u0435\u0447\u044c \u0438\u0434\u0435\u0442 \u043e \u0431\u043e\u043b\u044c\u0448\u043e\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432.<\/p>\n<p> <\/p>\n<pre><code class=\"javascript\">const svg = document.createElementNS(\"http:\/\/www.w3.org\/2000\/svg\", \"svg\"); const titleElement = document.createElementNS(\"http:\/\/www.w3.org\/2000\/svg\", \"title\"); const rect = document.createElementNS(\"http:\/\/www.w3.org\/2000\/svg\", \"rect\");  svg.setAttribute(\"width\", svgWidth); svg.setAttribute(\"viewBox\", `0 0 ${documentWidth} ${documentHeight}`); svg.setAttribute(\"xmlns\", \"http:\/\/www.w3.org\/2000\/svg\"); svg.setAttribute(\"role\", \"img\");  titleElement.textContent = title;  rect.setAttribute(\"width\", rectWidth); rect.setAttribute(\"height\", rectHeight); rect.setAttribute(\"fill\", rectFill);  svg.appendChild(titleElement); svg.appendChild(rect);  container.appendChild(svg);<\/code><\/pre>\n<p> <\/p>\n<div class=\"oembed\">\n<div class=\"tm-iframe_temp\" data-src=\"https:\/\/embedd.srv.habr.com\/iframe\/67178c84315cc3d4a18599ae\" data-style=\"\" id=\"67178c84315cc3d4a18599ae\" width=\"\"><\/div>\n<\/div>\n<p> <\/p>\n<h3 id=\"metod-2-sozdanie-svg-stroki\">\u041c\u0435\u0442\u043e\u0434 2. \u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 SVG-\u0441\u0442\u0440\u043e\u043a\u0438<\/h3>\n<p> <\/p>\n<p>\u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u044b, \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u0442\u0440\u043e\u043a\u0443 SVG \u0438 \u043f\u0440\u0438\u0441\u0432\u043e\u0438\u0442\u044c \u0435\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0443 <code>innerHTML<\/code> \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0433\u043e \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430. \u0422\u0430\u043a\u043e\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439, \u043d\u043e \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0442\u0435\u0440\u044f\u0435\u0442\u0441\u044f \u0442\u0438\u043f\u043e\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c, \u0430 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u043d\u0435 \u0431\u0443\u0434\u0443\u0442 \u0434\u043e\u043b\u0436\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c\u0441\u044f \u0432 DOM.<\/p>\n<p> <\/p>\n<pre><code class=\"javascript\">container.innerHTML = ` &lt;svg   width=\"${svgWidth}\"   viewBox=\"0 0 ${documentWidth} ${documentHeight}\"   xmlns=\"http:\/\/www.w3.org\/2000\/svg\"   role=\"img\" &gt;   &lt;title&gt;${title}&lt;\/title&gt;   &lt;rect     width=\"${rectWidth}\"     height=\"${rectHeight}\"     fill=\"${rectFill}\"   \/&gt; &lt;\/svg&gt;`;<\/code><\/pre>\n<p> <\/p>\n<div class=\"oembed\">\n<div class=\"tm-iframe_temp\" data-src=\"https:\/\/embedd.srv.habr.com\/iframe\/67178c844c5bea9d8ab8f007\" data-style=\"\" id=\"67178c844c5bea9d8ab8f007\" width=\"\"><\/div>\n<\/div>\n<p> <\/p>\n<h3 id=\"metod-3-berem-luchshee-ot-dvuh-variantov\">\u041c\u0435\u0442\u043e\u0434 3. \u0411\u0435\u0440\u0435\u043c \u043b\u0443\u0447\u0448\u0435\u0435 \u043e\u0442 \u0434\u0432\u0443\u0445 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432<\/h3>\n<p> <\/p>\n<p>\u041d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u043c \u0440\u0435\u0448\u0435\u043d\u0438\u0435\u043c \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 SVG-\u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 DOM-\u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430, \u0430 \u0437\u0430\u0442\u0435\u043c \u043f\u0440\u0438\u0441\u0432\u043e\u0435\u043d\u0438\u0435 \u0435\u0433\u043e \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0433\u043e \u0447\u0435\u0440\u0435\u0437 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e <code>innerHTML<\/code>.<\/p>\n<p> <\/p>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043c\u044b \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u0439 SVG-\u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u0438 \u043c\u043e\u0436\u0435\u043c \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u043d\u0438\u043c, \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u044f \u0442\u0438\u043f\u043e\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c. \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 SVG, \u043a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u043e, \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0447\u0430\u0441\u0442\u043e\u0433\u043e \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f, \u044d\u0442\u043e\u0442 \u043f\u043e\u0434\u0445\u043e\u0434 \u043a\u0430\u0436\u0435\u0442\u0441\u044f \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0442\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c.<\/p>\n<p> <\/p>\n<pre><code class=\"javascript\">const svg = document.createElementNS(\"http:\/\/www.w3.org\/2000\/svg\", \"svg\");  svg.setAttribute(\"width\", svgWidth); svg.setAttribute(\"viewBox\", `0 0 ${documentWidth} ${documentHeight}`); svg.setAttribute(\"xmlns\", \"http:\/\/www.w3.org\/2000\/svg\"); svg.setAttribute(\"role\", \"img\");  svg.innerHTML = `   &lt;title&gt;${title}&lt;\/title&gt;   &lt;rect     width=\"${rectWidth}\"     height=\"${rectHeight}\"     fill=\"${rectFill}\"   \/&gt; `;  container.appendChild(svg);<\/code><\/pre>\n<p> <\/p>\n<div class=\"oembed\">\n<div class=\"tm-iframe_temp\" data-src=\"https:\/\/embedd.srv.habr.com\/iframe\/67178c85d1b5b66d8d3ded2d\" data-style=\"\" id=\"67178c85d1b5b66d8d3ded2d\" width=\"\"><\/div>\n<\/div>\n<p> <\/p>\n<h2 id=\"otrisovka-bazovyh-elementov\">\u041e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0430 \u0431\u0430\u0437\u043e\u0432\u044b\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432<\/h2>\n<p> <\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c, \u043a\u043e\u0433\u0434\u0430 \u043c\u044b \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u043b\u0438\u0441\u044c \u0441 \u043e\u0441\u043d\u043e\u0432\u0430\u043c\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 SVG, \u0441\u0430\u043c\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u043a \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 \u0438 \u0438\u0437\u0443\u0447\u0438\u0442\u044c, \u043a\u0430\u043a \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u043d\u044b\u0435 \u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b.<\/p>\n<p> <\/p>\n<h3 id=\"risovanie-pryamougolnikov\">\u0420\u0438\u0441\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u044f\u043c\u043e\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a\u043e\u0432<\/h3>\n<p> <\/p>\n<p>\u041a\u0430\u043a \u043c\u044b \u0443\u0436\u0435 \u0432\u044b\u044f\u0441\u043d\u0438\u043b\u0438 \u0432 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435, \u044d\u043b\u0435\u043c\u0435\u043d\u0442 <code>&lt;rect&gt;<\/code> \u0441\u043b\u0443\u0436\u0438\u0442 \u0434\u043b\u044f \u0440\u0438\u0441\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u044f\u043c\u043e\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a\u0430. \u041e\u043d \u0438\u043c\u0435\u0435\u0442 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b <code>x<\/code> \u0438 <code>y<\/code>, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0449\u0438\u0435 \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0435\u0433\u043e \u0432\u0435\u0440\u0445\u043d\u0435\u0433\u043e \u043b\u0435\u0432\u043e\u0433\u043e \u0443\u0433\u043b\u0430. \u042d\u0442\u0438 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b \u043d\u0435\u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b, \u0438 \u0435\u0441\u043b\u0438 \u043e\u043d\u0438 \u043d\u0435 \u0437\u0430\u0434\u0430\u043d\u044b, \u043f\u0440\u044f\u043c\u043e\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c\u0441\u044f \u0432 \u043d\u0430\u0447\u0430\u043b\u0435 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442 <code>(0, 0)<\/code>, \u043a\u0430\u043a \u0432 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435.<\/p>\n<p> <\/p>\n<p>\u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u0443 <code>&lt;rect&gt;<\/code> \u0435\u0441\u0442\u044c \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b <code>rx<\/code> \u0438 <code>ry<\/code>, \u0437\u0430\u0434\u0430\u044e\u0449\u0438\u0435 \u0440\u0430\u0434\u0438\u0443\u0441\u044b \u0441\u043a\u0440\u0443\u0433\u043b\u0435\u043d\u0438\u044f \u0443\u0433\u043b\u043e\u0432. \u0415\u0441\u043b\u0438 \u0432\u044b \u0443\u043a\u0430\u0436\u0435\u0442\u0435 \u0442\u043e\u043b\u044c\u043a\u043e <code>rx<\/code>, \u0442\u043e <code>ry<\/code> \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u0442 \u0442\u0430\u043a\u043e\u0435 \u0436\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435.<\/p>\n<p> <\/p>\n<p>\u0412 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043c\u044b \u043d\u0430\u0440\u0438\u0441\u0443\u0435\u043c \u0447\u0435\u0442\u044b\u0440\u0435 \u0440\u0430\u0437\u043d\u044b\u0445 \u043f\u0440\u044f\u043c\u043e\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a\u0430, \u043f\u043e \u043e\u0434\u043d\u043e\u043c\u0443 \u0432 \u043a\u0430\u0436\u0434\u043e\u043c \u043a\u0432\u0430\u0434\u0440\u0430\u043d\u0442\u0435:<\/p>\n<p> <\/p>\n<ol>\n<li>\u0412\u0435\u0440\u0445\u043d\u0438\u0439 \u043b\u0435\u0432\u044b\u0439: \u044d\u0442\u043e \u043e\u0431\u044b\u0447\u043d\u044b\u0439 \u043f\u0440\u044f\u043c\u043e\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a \u0441\u043e \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0435\u043c \u043f\u043e \u0432\u0435\u0440\u0445\u043d\u0435\u043c\u0443 \u0438 \u043b\u0435\u0432\u043e\u043c\u0443 \u043a\u0440\u0430\u044f\u043c \u0438 \u0437\u0430\u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0448\u0438\u0440\u0438\u043d\u043e\u0439 \u0438 \u0432\u044b\u0441\u043e\u0442\u043e\u0439.<\/li>\n<li>\u0412\u0435\u0440\u0445\u043d\u0438\u0439 \u043f\u0440\u0430\u0432\u044b\u0439: \u0437\u0434\u0435\u0441\u044c \u043c\u044b \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u043c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0440\u0430\u0434\u0438\u0443\u0441 \u0441\u043a\u0440\u0443\u0433\u043b\u0435\u043d\u0438\u044f \u0443\u0433\u043b\u043e\u0432, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0437\u0430\u043a\u0440\u0443\u0433\u043b\u0435\u043d\u043d\u044b\u0439 \u043f\u0440\u044f\u043c\u043e\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a.<\/li>\n<li>\u041d\u0438\u0436\u043d\u0438\u0439 \u043b\u0435\u0432\u044b\u0439: \u0432 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0440\u0430\u0434\u0438\u0443\u0441 \u0441\u043a\u0440\u0443\u0433\u043b\u0435\u043d\u0438\u044f \u043d\u0430\u0441\u0442\u043e\u043b\u044c\u043a\u043e \u0432\u0435\u043b\u0438\u043a, \u0447\u0442\u043e \u043f\u0440\u044f\u043c\u043e\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u0432 \u043a\u0440\u0443\u0433. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u0435\u0433\u043e \u043d\u0430\u0447\u0430\u043b\u043e \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0441\u043c\u0435\u0449\u0435\u043d\u043e.<\/li>\n<li>\u041d\u0438\u0436\u043d\u0438\u0439 \u043f\u0440\u0430\u0432\u044b\u0439: \u0437\u0434\u0435\u0441\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u044d\u043b\u043b\u0438\u043f\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0440\u0430\u0434\u0438\u0443\u0441 \u0441\u043a\u0440\u0443\u0433\u043b\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0441\u0433\u043b\u0430\u0436\u0435\u043d\u043d\u043e\u0439 \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u043d\u043e\u0439 \u0444\u043e\u0440\u043c\u044b.<\/li>\n<\/ol>\n<p> <\/p>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u0438 \u043f\u0440\u044f\u043c\u043e\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e JS:<\/p>\n<p> <\/p>\n<pre><code class=\"javascript\">const rectDocWidth = 200; const rectDocHeight = 200; const rectFill = \"currentColor\"; const docOffset = 15; const rectSize = rectDocWidth \/ 2 - docOffset * 2; const roundedCornerRadius = 10; const circleLookRadius = rectSize \/ 2; const ellipticalRy = roundedCornerRadius * 2;<\/code><\/pre>\n<p> <\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u043e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u044c \u044d\u0442\u0438 \u043f\u0440\u044f\u043c\u043e\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a\u0438 \u0432 SVG, \u043f\u0440\u0438\u043c\u0438\u0435\u043d\u044f\u0435\u043c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043a \u0448\u0430\u0431\u043b\u043e\u043d\u0443 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430:<\/p>\n<p> <\/p>\n<pre><code class=\"javascript\">&lt;svg   width={svgWidth}   viewBox={`0 0 ${rectDocWidth} ${rectDocHeight}`}   xmlns=\"http:\/\/www.w3.org\/2000\/svg\"   role=\"img\" &gt;   &lt;title&gt;Four Rectangles of different qualities placed in each quadrant&lt;\/title&gt;   &lt;rect     x={docOffset}     y={docOffset}     width={rectSize}     height={rectSize}     fill={rectFill}   \/&gt;   &lt;rect     x={rectDocWidth - rectSize - docOffset}     rx={roundedCornerRadius}     y={docOffset}     width={rectSize}     height={rectSize}     fill={rectFill}   \/&gt;   &lt;rect     x={docOffset}     rx={circleLookRadius}     y={rectDocHeight - rectSize - docOffset}     width={rectSize}     height={rectSize}     fill={rectFill}   \/&gt;   &lt;rect     x={rectDocWidth - rectSize - docOffset}     rx={roundedCornerRadius}     ry={ellipticalRy}     y={rectDocHeight - rectSize - docOffset}     width={rectSize}     height={rectSize}     fill={rectFill}   \/&gt; &lt;\/svg&gt;<\/code><\/pre>\n<p> <\/p>\n<div class=\"oembed\">\n<div class=\"tm-iframe_temp\" data-src=\"https:\/\/embedd.srv.habr.com\/iframe\/67178c862331bb9d714c9b53\" data-style=\"\" id=\"67178c862331bb9d714c9b53\" width=\"\"><\/div>\n<\/div>\n<p> <\/p>\n<h3 id=\"risovanie-liniy\">\u0420\u0438\u0441\u043e\u0432\u0430\u043d\u0438\u0435 \u043b\u0438\u043d\u0438\u0439<\/h3>\n<p> <\/p>\n<p>\u0412 SVG \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u044d\u043b\u0435\u043c\u0435\u043d\u0442 <code>&lt;line&gt;<\/code>, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0439 \u0440\u0438\u0441\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u044f\u043c\u044b\u0435 \u043b\u0438\u043d\u0438\u0438. \u041e\u043d \u0438\u043c\u0435\u0435\u0442 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b <code>x1<\/code>, <code>y1<\/code>, <code>x2<\/code> \u0438 <code>y2<\/code>, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0449\u0438\u0435 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u0439 \u0438 \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0439 \u0442\u043e\u0447\u0435\u043a \u043b\u0438\u043d\u0438\u0438.<\/p>\n<p> <\/p>\n<p>\u0423\u043c\u0435\u043d\u0438\u0435 \u0440\u0438\u0441\u043e\u0432\u0430\u0442\u044c \u0433\u043e\u0440\u0438\u0437\u043e\u043d\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u0438 \u0432\u0435\u0440\u0442\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0435 \u043b\u0438\u043d\u0438\u0438 \u2014 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0432\u0430\u0436\u043d\u044b\u0439 \u043d\u0430\u0432\u044b\u043a. \u041f\u0440\u0430\u0432\u0438\u043b\u043e \u043f\u0440\u043e\u0441\u0442\u043e\u0435: <em>\u0434\u043b\u044f \u0433\u043e\u0440\u0438\u0437\u043e\u043d\u0442\u0430\u043b\u044c\u043d\u043e\u0439 \u043b\u0438\u043d\u0438\u0438 \u0434\u043e\u043b\u0436\u043d\u044b \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f <code>y<\/code> \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u0439 \u0438 \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0439 \u0442\u043e\u0447\u0435\u043a, \u0430 \u0434\u043b\u044f \u0432\u0435\u0440\u0442\u0438\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u043b\u0438\u043d\u0438\u0438 \u2014 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f <code>x<\/code>.<\/em><\/p>\n<p> <\/p>\n<p>\u041d\u0430\u0440\u0438\u0441\u0443\u0435\u043c \u0433\u043e\u0440\u0438\u0437\u043e\u043d\u0442\u0430\u043b\u044c\u043d\u0443\u044e \u0438 \u0432\u0435\u0440\u0442\u0438\u043a\u0430\u043b\u044c\u043d\u0443\u044e \u043b\u0438\u043d\u0438\u0438, \u043f\u0435\u0440\u0435\u0441\u0435\u043a\u0430\u044e\u0449\u0438\u0435\u0441\u044f \u0432 \u0446\u0435\u043d\u0442\u0440\u0435 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430. \u042f \u043d\u0430\u043c\u0435\u0440\u0435\u043d\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043d\u0435\u043e\u0431\u044b\u0447\u043d\u044b\u0435 \u0447\u0438\u0441\u043b\u043e\u0432\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u043d\u043e, \u0442\u0435\u043c \u043d\u0435 \u043c\u0435\u043d\u0435\u0435, \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u043e \u0446\u0435\u043d\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0435 SVG-\u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435. \u0412 SVG \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0447\u0438\u0441\u043b\u0430 \u0441 \u043f\u043b\u0430\u0432\u0430\u044e\u0449\u0435\u0439 \u0437\u0430\u043f\u044f\u0442\u043e\u0439.<\/p>\n<p> <\/p>\n<p>\u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435:<\/p>\n<p> <\/p>\n<pre><code class=\"javascript\">const lineDocWidth = 421; const lineDocHeight = 391; const lineStroke = \"currentColor\"; const lineStrokeWidth = 5; const horizontalLineStart = 0; const horizontalLineEnd = lineDocWidth; const horizontalLineY = lineDocHeight \/ 2; const verticalLineStart = 0; const verticalLineEnd = lineDocHeight; const verticalLineX = lineDocWidth \/ 2;<\/code><\/pre>\n<p> <\/p>\n<p>\u0418\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u0443\u0435\u043c \u0438\u0445 \u0432 SVG-\u044d\u043b\u0435\u043c\u0435\u043d\u0442:<\/p>\n<p> <\/p>\n<pre><code class=\"javascript\">&lt;svg   width={svgWidth}   viewBox={`0 0 ${lineDocWidth} ${lineDocHeight}`}   xmlns=\"http:\/\/www.w3.org\/2000\/svg\"   role=\"img\" &gt;   &lt;title&gt;Horizontal and Vertical Line through the middle of the document&lt;\/title&gt;   &lt;line     x1={horizontalLineStart}     x2={horizontalLineEnd}     y1={horizontalLineY}     y2={horizontalLineY}     stroke={lineStroke}     stroke-width={lineStrokeWidth}   \/&gt;   &lt;line     x1={verticalLineX}     x2={verticalLineX}     y1={verticalLineStart}     y2={verticalLineEnd}     stroke={lineStroke}     stroke-width={lineStrokeWidth}   \/&gt; &lt;\/svg&gt;<\/code><\/pre>\n<p> <\/p>\n<div class=\"oembed\">\n<div class=\"tm-iframe_temp\" data-src=\"https:\/\/embedd.srv.habr.com\/iframe\/67178c8687bb36d4b30410d8\" data-style=\"\" id=\"67178c8687bb36d4b30410d8\" width=\"\"><\/div>\n<\/div>\n<p> <\/p>\n<h3 id=\"risovanie-krugov\">\u0420\u0438\u0441\u043e\u0432\u0430\u043d\u0438\u0435 \u043a\u0440\u0443\u0433\u043e\u0432<\/h3>\n<p> <\/p>\n<p>\u0423 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 <code>&lt;circle&gt;<\/code> \u0432 SVG \u0435\u0441\u0442\u044c \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b <code>cx<\/code>, <code>cy<\/code> \u0438 <code>r<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0442 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u0446\u0435\u043d\u0442\u0440\u0430 \u043a\u0440\u0443\u0433\u0430 \u0438 \u0435\u0433\u043e \u0440\u0430\u0434\u0438\u0443\u0441.<\/p>\n<p> <\/p>\n<p>\u0418\u043d\u043e\u0433\u0434\u0430 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u044e\u0442 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438, \u043a\u043e\u0433\u0434\u0430 \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e, \u0447\u0442\u043e\u0431\u044b \u0432 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0439 \u0442\u043e\u0447\u043a\u0435 \u0440\u0430\u0441\u043f\u043e\u043b\u0430\u0433\u0430\u043b\u0441\u044f \u043a\u0440\u0430\u0439 \u043a\u0440\u0443\u0433\u0430, \u0430 \u043d\u0435 \u0435\u0433\u043e \u0446\u0435\u043d\u0442\u0440. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u043c\u044b \u0437\u0430\u0447\u0430\u0441\u0442\u0443\u044e \u043c\u044b\u0441\u043b\u0438\u043c \u0432 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u0445 \u0434\u0438\u0430\u043c\u0435\u0442\u0440\u0430, \u0430 \u043d\u0435 \u0440\u0430\u0434\u0438\u0443\u0441\u0430. \u0412 \u0442\u0430\u043a\u0438\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 \u043d\u0430\u043c \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f, \u0447\u0442\u043e\u0431\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u043d\u0443\u0436\u043d\u044b\u0435 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b.<\/p>\n<p> <\/p>\n<p>\u041f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u043c, \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u043d\u0430\u0440\u0438\u0441\u043e\u0432\u0430\u0442\u044c \u043a\u0440\u0443\u0433, \u043a\u0440\u0430\u0439 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0441\u043c\u0435\u0449\u0435\u043d \u043e\u0442 \u043d\u0438\u0436\u043d\u0435\u0433\u043e \u043b\u0435\u0432\u043e\u0433\u043e \u0443\u0433\u043b\u0430 \u043d\u0430 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0435 \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0435, \u0430 \u0435\u0433\u043e \u0434\u0438\u0430\u043c\u0435\u0442\u0440 \u0438\u043c\u0435\u0435\u0442 \u0437\u0430\u0434\u0430\u043d\u043d\u044b\u0439 \u0440\u0430\u0437\u043c\u0435\u0440. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u044f\u0442\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435:<\/p>\n<p> <\/p>\n<pre><code class=\"javascript\">const circleDocWidth = 100; const circleDocHeight = 100; const circleOffset = 10; const circleDiameter = 20; const circleRadius = circleDiameter \/ 2; const circleX = circleOffset + circleRadius; const circleY = circleDocHeight - circleOffset - circleRadius;<\/code><\/pre>\n<p> <\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0442\u0430\u043a \u0436\u0435, \u043a\u0430\u043a \u0438 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441 \u043b\u0438\u043d\u0438\u044f\u043c\u0438, \u043f\u0435\u0440\u0435\u0434\u0430\u0434\u0438\u043c \u044d\u0442\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0432 SVG-\u044d\u043b\u0435\u043c\u0435\u043d\u0442:<\/p>\n<p> <\/p>\n<pre><code class=\"javascript\">&lt;svg   width={svgWidth}   viewBox={`0 0 ${circleDocWidth} ${circleDocHeight}`}   xmlns=\"http:\/\/www.w3.org\/2000\/svg\"   role=\"img\" &gt;   &lt;circle     cx={circleX}     cy={circleY}     r={circleRadius}     fill=\"red\"   \/&gt; &lt;\/svg&gt;<\/code><\/pre>\n<p> <\/p>\n<div class=\"oembed\">\n<div class=\"tm-iframe_temp\" data-src=\"https:\/\/embedd.srv.habr.com\/iframe\/67178c8628dfc09d9ea309b3\" data-style=\"\" id=\"67178c8628dfc09d9ea309b3\" width=\"\"><\/div>\n<\/div>\n<p> <\/p>\n<h3 id=\"risovanie-ellipsov\">\u0420\u0438\u0441\u043e\u0432\u0430\u043d\u0438\u0435 \u044d\u043b\u043b\u0438\u043f\u0441\u043e\u0432<\/h3>\n<p> <\/p>\n<p>\u0423 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 <code>&lt;ellipse&gt;<\/code> \u0432 SVG \u0435\u0441\u0442\u044c \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b <code>cx<\/code>, <code>cy<\/code>, <code>rx<\/code> \u0438 <code>ry<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0442 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u0446\u0435\u043d\u0442\u0440\u0430 \u044d\u043b\u043b\u0438\u043f\u0441\u0430, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0435\u0433\u043e \u0433\u043e\u0440\u0438\u0437\u043e\u043d\u0442\u0430\u043b\u044c\u043d\u044b\u0439 \u0438 \u0432\u0435\u0440\u0442\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u0440\u0430\u0434\u0438\u0443\u0441\u044b.<\/p>\n<p> <\/p>\n<p>\u0417\u043d\u0430\u0447\u0435\u043d\u0438\u044f <code>x<\/code> \u0438 <code>y<\/code> \u0437\u0430\u0434\u0430\u044e\u0442 \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0446\u0435\u043d\u0442\u0440\u0430 \u044d\u043b\u043b\u0438\u043f\u0441\u0430, \u0430 <code>rx<\/code> \u0438 <code>ry<\/code> \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0442 \u0435\u0433\u043e \u0440\u0430\u0434\u0438\u0443\u0441\u044b \u043f\u043e \u0433\u043e\u0440\u0438\u0437\u043e\u043d\u0442\u0430\u043b\u0438 \u0438 \u0432\u0435\u0440\u0442\u0438\u043a\u0430\u043b\u0438, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e.<\/p>\n<p> <\/p>\n<p>\u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u043c, \u0447\u0442\u043e \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043d\u0430\u0440\u0438\u0441\u043e\u0432\u0430\u0442\u044c \u044d\u043b\u043b\u0438\u043f\u0441, \u0441\u043c\u0435\u0449\u0435\u043d\u043d\u044b\u0439 \u043e\u0442 \u0432\u0435\u0440\u0445\u043d\u0435\u0433\u043e \u043f\u0440\u0430\u0432\u043e\u0433\u043e \u0443\u0433\u043b\u0430 \u043d\u0430 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0435 \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0435, \u0441 \u0433\u043e\u0440\u0438\u0437\u043e\u043d\u0442\u0430\u043b\u044c\u043d\u044b\u043c \u0440\u0430\u0434\u0438\u0443\u0441\u043e\u043c \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u043c\u0435\u0440\u0430 \u0438 \u0432\u0435\u0440\u0442\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u043c \u0440\u0430\u0434\u0438\u0443\u0441\u043e\u043c, \u0440\u0430\u0432\u043d\u044b\u043c \u043f\u043e\u043b\u043e\u0432\u0438\u043d\u0435 \u0433\u043e\u0440\u0438\u0437\u043e\u043d\u0442\u0430\u043b\u044c\u043d\u043e\u0433\u043e.<\/p>\n<p> <\/p>\n<p>\u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435:<\/p>\n<p> <\/p>\n<pre><code class=\"javascript\">const ellipseSVGWidth = 100; const ellipseDocWidth = 100; const ellipseDocHeight = 100; const ellipseOffset = 10; const ellipseHorizontalRadius = ellipseDocWidth \/ 2 - ellipseOffset; const ellipseVerticalRadius = ellipseHorizontalRadius \/ 2; const ellipseX = ellipseDocWidth - ellipseOffset - ellipseHorizontalRadius; const ellipseY = ellipseOffset + ellipseVerticalRadius;<\/code><\/pre>\n<p> <\/p>\n<p>\u0418\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u0443\u0435\u043c \u0432 SVG-\u044d\u043b\u0435\u043c\u0435\u043d\u0442:<\/p>\n<p> <\/p>\n<pre><code class=\"javascript\">&lt;svg   width={svgWidth}   viewBox={`0 0 ${ellipseDocWidth} ${ellipseDocHeight}`}   xmlns=\"http:\/\/www.w3.org\/2000\/svg\"   role=\"img\" &gt;   &lt;title&gt;Ellipse offset from the top right corner&lt;\/title&gt;   &lt;ellipse     cx={ellipseX}     cy={ellipseY}     rx={ellipseHorizontalRadius}     ry={ellipseVerticalRadius}     fill=\"hotpink\"   \/&gt; &lt;\/svg&gt;<\/code><\/pre>\n<p> <\/p>\n<div class=\"oembed\">\n<div class=\"tm-iframe_temp\" data-src=\"https:\/\/embedd.srv.habr.com\/iframe\/67178c876748d7d46f18a12a\" data-style=\"\" id=\"67178c876748d7d46f18a12a\" width=\"\"><\/div>\n<\/div>\n<p> <\/p>\n<h3 id=\"soedinenie-tochek-s-pomoschyu-polyline-i-polygon\">\u0421\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u0442\u043e\u0447\u0435\u043a \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>&lt;polyline&gt;<\/code> \u0438 <code>&lt;polygon&gt;<\/code><\/h3>\n<p> <\/p>\n<p>\u0418\u043d\u043e\u0433\u0434\u0430 \u043d\u0430\u043c \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043b\u0438\u043d\u0438\u044e, \u0441\u043e\u0441\u0442\u043e\u044f\u0449\u0443\u044e \u0438\u0437 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0442\u043e\u0447\u0435\u043a, \u043d\u043e \u043d\u0435 \u043e\u0431\u0440\u0430\u0437\u0443\u044e\u0449\u0443\u044e \u043f\u0440\u044f\u043c\u043e\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a \u0438\u043b\u0438 \u043a\u0440\u0443\u0433. \u0412 \u0442\u0430\u043a\u0438\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b <code>polyline<\/code> \u0438 <code>polygon<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u043c\u0435\u044e\u0442 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0435 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b, \u043d\u043e \u043e\u0442\u043b\u0438\u0447\u0430\u044e\u0442\u0441\u044f \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u043f\u0435\u0440\u0432\u043e\u0439 \u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439 \u0442\u043e\u0447\u0435\u043a: <code>polygon<\/code> \u0437\u0430\u043c\u044b\u043a\u0430\u0435\u0442 \u0444\u0438\u0433\u0443\u0440\u0443, \u0430 <code>polyline<\/code> \u2014 \u043d\u0435\u0442.<\/p>\n<p> <\/p>\n<p>\u041e\u0431\u0430 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u044e\u0442 \u0430\u0442\u0440\u0438\u0431\u0443\u0442 <code>points<\/code>, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0439 \u0441\u043f\u0438\u0441\u043e\u043a \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442 <code>x<\/code> \u0438 <code>y<\/code>, \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0445 \u043f\u0440\u043e\u0431\u0435\u043b\u0430\u043c\u0438. \u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0443 \u043d\u0438\u0445 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0430 <code>fill<\/code>(\u0437\u0430\u043b\u0438\u0432\u043a\u0430), \u0447\u0442\u043e \u043d\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u0443\u043c\u0435\u0441\u0442\u043d\u043e, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0434\u043b\u044f <code>polyline<\/code>, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0447\u0430\u0441\u0442\u043e \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0437\u0430\u0434\u0430\u0432\u0430\u0442\u044c \u0435\u0439 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <code>none<\/code>.<\/p>\n<p> <\/p>\n<p>\u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c, \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0442\u0440\u0438 \u043a\u0440\u0443\u0433\u0430, \u0438 \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u0441\u043e\u0435\u0434\u0438\u043d\u0438\u0442\u044c \u0438\u0445 \u0446\u0435\u043d\u0442\u0440\u044b \u043b\u0438\u043d\u0438\u044f\u043c\u0438. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0432\u0437\u044f\u0442\u044c \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b <code>cx<\/code> \u0438 <code>cy<\/code> \u044d\u0442\u0438\u0445 \u043a\u0440\u0443\u0433\u043e\u0432 \u0438 \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0438\u0442\u044c \u0438\u0445 \u0432 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0435 <code>points<\/code>.<\/p>\n<p> <\/p>\n<p>\u0412\u0430\u0436\u043d\u043e \u043f\u043e\u043c\u043d\u0438\u0442\u044c, \u0447\u0442\u043e SVG \u0440\u0438\u0441\u0443\u0435\u0442\u0441\u044f \u043e\u0442 \u0437\u0430\u0434\u043d\u0435\u0433\u043e \u043f\u043b\u0430\u043d\u0430 \u043a \u043f\u0435\u0440\u0435\u0434\u043d\u0435\u043c\u0443, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0431\u0443\u0434\u0443\u0442 \u043d\u0430\u0440\u0438\u0441\u043e\u0432\u0430\u043d\u044b \u043a\u0440\u0443\u0433\u0438, \u0430 \u0437\u0430\u0442\u0435\u043c \u2014 \u043b\u0438\u043d\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u043a\u0430\u0436\u0443\u0442\u0441\u044f \u0441\u0432\u0435\u0440\u0445\u0443 \u043a\u0440\u0443\u0433\u043e\u0432.<\/p>\n<p> <\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u043e \u043f\u0440\u043e\u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0440\u0430\u0437\u043b\u0438\u0447\u0438\u044f \u043c\u0435\u0436\u0434\u0443 <code>polyline<\/code> \u0438 <code>polygon<\/code>, \u043c\u044b \u043d\u0430\u0440\u0438\u0441\u0443\u0435\u043c \u043a\u043e\u043c\u043f\u043e\u0437\u0438\u0446\u0438\u044e \u0447\u0435\u0442\u044b\u0440\u0435 \u0440\u0430\u0437\u0430, \u043a\u0430\u043a \u0443\u0436\u0435 \u0434\u0435\u043b\u0430\u043b\u0438 \u0441 \u043a\u0440\u0443\u0433\u0430\u043c\u0438.<\/p>\n<p> <\/p>\n<p>\u0412 \u044d\u0442\u043e\u0442 \u0440\u0430\u0437 \u0443 \u043d\u0430\u0441 \u0431\u0443\u0434\u0435\u0442 \u0431\u043e\u043b\u044c\u0448\u0435 \u043e\u0434\u043d\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430. \u0427\u0442\u043e\u0431\u044b \u0431\u044b\u0441\u0442\u0440\u0435\u0435 \u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f, \u043a\u0430\u043a\u0438\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u043e\u0442\u043d\u043e\u0441\u044f\u0442\u0441\u044f \u043a \u043e\u0434\u043d\u043e\u0439 \u0433\u0440\u0443\u043f\u043f\u0435, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u044d\u043b\u0435\u043c\u0435\u043d\u0442 <code>g<\/code>, \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u044f\u044e\u0449\u0438\u0439 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432. \u042d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0442\u044c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0435 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b \u043a\u043e \u0432\u0441\u0435\u043c \u0434\u043e\u0447\u0435\u0440\u043d\u0438\u043c \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e.<\/p>\n<p> <\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u0441\u044d\u043a\u043e\u043d\u043e\u043c\u0438\u0442\u044c \u0432\u0440\u0435\u043c\u044f \u043d\u0430 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435 \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u043a\u043e\u043c\u043f\u043e\u0437\u0438\u0446\u0438\u0438, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c <code>transform<\/code> \u043a \u0433\u0440\u0443\u043f\u043f\u0435, \u0447\u0442\u043e\u0431\u044b \u0440\u0430\u0437\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0435\u0435 \u0432 \u0440\u0430\u0437\u043d\u044b\u0445 \u043a\u0432\u0430\u0434\u0440\u0430\u043d\u0442\u0430\u0445.<\/p>\n<p> <\/p>\n<p>\u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0430\u0442\u0440\u0438\u0431\u0443\u0442 <code>transform=\"translate(x,y)\"<\/code>, \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0438\u0439 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e CSS-\u0442\u0440\u0430\u043d\u0441\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f\u043c, \u0441 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u043c\u0438 \u043e\u0442\u043b\u0438\u0447\u0438\u044f\u043c\u0438 \u0432 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441\u0435. \u0412 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0435 \u043f\u0440\u043e\u0441\u0442\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u0435\u0432 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0442\u044c, \u0447\u0442\u043e \u043e\u043d \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0442\u0430\u043a \u0436\u0435. \u0410\u0442\u0440\u0438\u0431\u0443\u0442 <code>translate<\/code> \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0430\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0433\u0440\u0443\u043f\u043f\u044b \u0432\u0434\u043e\u043b\u044c \u043e\u0441\u0435\u0439 <code>x<\/code> \u0438 <code>y<\/code>.<\/p>\n<p> <\/p>\n<p>\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 SVG:<\/p>\n<p> <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/dj\/ac\/gi\/djacgij2uyfhvbr1n4plpohf9ku.png\" data-src=\"https:\/\/habrastorage.org\/webt\/dj\/ac\/gi\/djacgij2uyfhvbr1n4plpohf9ku.png\"\/> <\/p>\n<p> <\/p>\n<p> <\/p>\n<p><em>\u0421\u043b\u0435\u0432\u0430 \u043d\u0430\u043f\u0440\u0430\u0432\u043e, \u0441\u043d\u0438\u0437\u0443 \u0432\u0432\u0435\u0440\u0445: polyline \u0431\u0435\u0437 \u0437\u0430\u043b\u0438\u0432\u043a\u0438, polyline \u0441 \u0437\u0430\u043b\u0438\u0432\u043a\u043e\u0439, polygon \u0431\u0435\u0437 \u0437\u0430\u043b\u0438\u0432\u043a\u0438, polygon \u0441 \u0437\u0430\u043b\u0438\u0432\u043a\u043e\u0439<\/em><\/p>\n<p> <\/p>\n<p>\u0417\u0434\u0435\u0441\u044c \u043c\u044b \u0432\u0438\u0434\u0438\u043c, \u0447\u0442\u043e \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u043e\u0434\u043d\u0438\u0445 \u0438 \u0442\u0435\u0445 \u0436\u0435 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442, <code>polyline<\/code> \u043d\u0435 \u0441\u043e\u0435\u0434\u0438\u043d\u044f\u0435\u0442 \u043b\u0438\u043d\u0438\u0435\u0439 \u0441\u0438\u043d\u044e\u044e \u0438 \u043a\u0440\u0430\u0441\u043d\u0443\u044e \u0442\u043e\u0447\u043a\u0438, \u0432 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 <code>polygon<\/code>. \u041d\u043e \u043f\u0440\u0438 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0438 \u0437\u0430\u043b\u0438\u0432\u043a\u0438, \u043e\u043d\u0438 \u043e\u0431\u0430 \u0432\u043e\u0441\u043f\u0440\u0438\u043d\u0438\u043c\u0430\u044e\u0442 \u0444\u043e\u0440\u043c\u0443 \u043a\u0430\u043a \u0437\u0430\u043c\u043a\u043d\u0443\u0442\u0443\u044e, \u0447\u0442\u043e \u0432\u0438\u0434\u043d\u043e \u043d\u0430 \u043f\u0440\u0430\u0432\u043e\u043c \u0432\u0435\u0440\u0445\u043d\u0435\u043c \u043a\u0432\u0430\u0434\u0440\u0430\u043d\u0442\u0435.<\/p>\n<p> <\/p>\n<p>\u042d\u0442\u043e \u0443\u0436\u0435 \u0432\u0442\u043e\u0440\u043e\u0439 \u0441\u043b\u0443\u0447\u0430\u0439, \u043a\u043e\u0433\u0434\u0430 \u043c\u044b \u0438\u043c\u0435\u0435\u043c \u0434\u0435\u043b\u043e \u0441 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0439 \u0434\u043e\u043b\u0435\u0439 \u043f\u043e\u0432\u0442\u043e\u0440\u0435\u043d\u0438\u044f, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441\u0442\u043e\u0438\u0442 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c, \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 JS \u0434\u043b\u044f \u0431\u043e\u043b\u0435\u0435 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0433\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0448\u0430\u0431\u043b\u043e\u043d\u0430.<\/p>\n<p> <\/p>\n<p>\u041d\u043e \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c \u0431\u0430\u0437\u043e\u0432\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442, \u043a\u0430\u043a \u043c\u044b \u0434\u0435\u043b\u0430\u043b\u0438 \u0440\u0430\u043d\u0435\u0435. \u041c\u044b \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u0434\u043b\u044f \u043a\u0440\u0443\u0433\u043e\u0432, \u0430 \u0437\u0430\u0442\u0435\u043c \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0438\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f <code>cx<\/code> \u0438 <code>cy<\/code>, \u0447\u0442\u043e\u0431\u044b \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0430\u0442\u0440\u0438\u0431\u0443\u0442 <code>points<\/code>. \u0422\u0430\u043a\u0436\u0435 \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u043c \u043d\u0430\u0448\u0438 \u0442\u0440\u0430\u043d\u0441\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445.<\/p>\n<p> <\/p>\n<pre><code class=\"javascript\">const polyDocWidth = 200; const polyDocHeight = 200; const circleOne = { cx: 25, cy: 80, r: 10, fill: \"red\" }; const circleTwo = { cx: 40, cy: 20, r: 5, fill: \"lime\" }; const circleThree = { cx: 70, cy: 60, r: 8, fill: \"cyan\" }; const points = `${circleOne.cx},${circleOne.cy} ${circleTwo.cx},${circleTwo.cy} ${circleThree.cx},${circleThree.cy}`; const moveToTopRight = `translate(${polyDocWidth \/ 2}, 0)`; const moveToBottomRight = `translate(${polyDocWidth \/ 2}, ${polyDocHeight \/ 2})`; const moveToBottomLeft = `translate(0, ${polyDocHeight \/ 2})`;<\/code><\/pre>\n<p> <\/p>\n<p>\u0414\u0430\u043b\u0435\u0435, \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u043c \u044d\u0442\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043a \u0448\u0430\u0431\u043b\u043e\u043d\u0443, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043b\u0438\u0431\u043e <code>polyline<\/code>, \u043b\u0438\u0431\u043e <code>polygon<\/code>, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0430\u0442\u0440\u0438\u0431\u0443\u0442 <code>fill<\/code> \u0441 \u0446\u0432\u0435\u0442\u043e\u0432\u044b\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c \u0438\u043b\u0438 <code>none<\/code>.<\/p>\n<p> <\/p>\n<pre><code class=\"javascript\">&lt;svg   width={svgWidth}   viewBox={`0 0 ${polyDocWidth} ${polyDocHeight}`}   xmlns=\"http:\/\/www.w3.org\/2000\/svg\"   role=\"img\" &gt;   &lt;title&gt;Composite shape comparison&lt;\/title&gt;   &lt;g&gt;     &lt;circle       cx={circleOne.cx}       cy={circleOne.cy}       r={circleOne.r}       fill={circleOne.fill}     \/&gt;     &lt;circle       cx={circleTwo.cx}       cy={circleTwo.cy}       r={circleTwo.r}       fill={circleTwo.fill}     \/&gt;     &lt;circle       cx={circleThree.cx}       cy={circleThree.cy}       r={circleThree.r}       fill={circleThree.fill}     \/&gt;     &lt;polyline       points={points}       fill=\"none\"       stroke=\"black\"     \/&gt;   &lt;\/g&gt;   &lt;g transform={moveToTopRight}&gt;     &lt;circle       cx={circleOne.cx}       cy={circleOne.cy}       r={circleOne.r}       fill={circleOne.fill}     \/&gt;     &lt;circle       cx={circleTwo.cx}       cy={circleTwo.cy}       r={circleTwo.r}       fill={circleTwo.fill}     \/&gt;     &lt;circle       cx={circleThree.cx}       cy={circleThree.cy}       r={circleThree.r}       fill={circleThree.fill}     \/&gt;     &lt;polyline       points={points}       fill=\"white\"       stroke=\"black\"     \/&gt;   &lt;\/g&gt;   &lt;g transform={moveToBottomLeft}&gt;     &lt;circle       cx={circleOne.cx}       cy={circleOne.cy}       r={circleOne.r}       fill={circleOne.fill}     \/&gt;     &lt;circle       cx={circleTwo.cx}       cy={circleTwo.cy}       r={circleTwo.r}       fill={circleTwo.fill}     \/&gt;     &lt;circle       cx={circleThree.cx}       cy={circleThree.cy}       r={circleThree.r}       fill={circleThree.fill}     \/&gt;     &lt;polygon       points={points}       fill=\"none\"       stroke=\"black\"     \/&gt;   &lt;\/g&gt;   &lt;g transform={moveToBottomRight}&gt;     &lt;circle       cx={circleOne.cx}       cy={circleOne.cy}       r={circleOne.r}       fill={circleOne.fill}     \/&gt;     &lt;circle       cx={circleTwo.cx}       cy={circleTwo.cy}       r={circleTwo.r}       fill={circleTwo.fill}     \/&gt;     &lt;circle       cx={circleThree.cx}       cy={circleThree.cy}       r={circleThree.r}       fill={circleThree.fill}     \/&gt;     &lt;polygon       points={points}       fill=\"white\"       stroke=\"black\"     \/&gt;   &lt;\/g&gt; &lt;\/svg&gt;<\/code><\/pre>\n<p> <\/p>\n<div class=\"oembed\">\n<div class=\"tm-iframe_temp\" data-src=\"https:\/\/embedd.srv.habr.com\/iframe\/67178c87aeb5569d7bf0771c\" data-style=\"\" id=\"67178c87aeb5569d7bf0771c\" width=\"\"><\/div>\n<\/div>\n<p> <\/p>\n<h2 id=\"-borba-s-povtoreniyami\">\u276f \u0411\u043e\u0440\u044c\u0431\u0430 \u0441 \u043f\u043e\u0432\u0442\u043e\u0440\u0435\u043d\u0438\u044f\u043c\u0438<\/h2>\n<p> <\/p>\n<p>\u041f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 SVG-\u0433\u0440\u0430\u0444\u0438\u043a\u0438 \u043c\u043e\u0436\u043d\u043e \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u0442\u044c\u0441\u044f \u0441 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c\u044e \u043c\u043d\u043e\u0433\u043e\u043a\u0440\u0430\u0442\u043d\u043e\u0433\u043e \u043f\u043e\u0432\u0442\u043e\u0440\u0435\u043d\u0438\u044f \u043e\u0434\u043d\u043e\u0433\u043e \u0438 \u0442\u043e\u0433\u043e \u0436\u0435 \u043a\u043e\u0434\u0430. \u0412 \u044d\u0442\u0438\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 JS \u043c\u043e\u0436\u0435\u0442 \u0441\u0442\u0430\u0442\u044c \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u043c \u043f\u043e\u043c\u043e\u0449\u043d\u0438\u043a\u043e\u043c. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0435\u0449\u0435 \u0440\u0430\u0437 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u0438 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u0435\u0433\u043e, \u0441\u043e\u043a\u0440\u0430\u0442\u0438\u0432 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u043e\u0432\u0442\u043e\u0440\u0435\u043d\u0438\u0439.<\/p>\n<p> <\/p>\n<p>\u041d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u044f:<\/p>\n<p> <\/p>\n<ul>\n<li>\u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0442\u0440\u0438 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 <code>circle<\/code>, \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043e\u0434\u043d\u043e\u043c\u0443 \u0438 \u0442\u043e\u043c\u0443 \u0436\u0435 \u0448\u0430\u0431\u043b\u043e\u043d\u0443<\/li>\n<li>\u043c\u044b \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u0435\u043c\u0441\u044f, \u0447\u0442\u043e\u0431\u044b \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0441\u0442\u0438\u043b\u044c \u0437\u0430\u043b\u0438\u0432\u043a\u0438 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430<\/li>\n<li>\u043c\u044b \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u0435\u043c \u044d\u0442\u0438 \u0434\u0432\u0430 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0435\u0449\u0435 \u0440\u0430\u0437, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043b\u0438\u0431\u043e <code>polyline<\/code>, \u043b\u0438\u0431\u043e <code>polygon<\/code><\/li>\n<li>\u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0447\u0435\u0442\u044b\u0440\u0435 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u0442\u0440\u0430\u043d\u0441\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 (\u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u0442\u0440\u0430\u043d\u0441\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0442\u0440\u0430\u043d\u0441\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0435\u0439)<\/li>\n<\/ul>\n<p> <\/p>\n<p>\u0412\u044b\u0432\u043e\u0434: \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0435 \u0446\u0438\u043a\u043b\u044b.<\/p>\n<p> <\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0432\u0435\u0440\u043d\u0435\u043c\u0441\u044f \u043a \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438, \u0442\u0430\u043a \u043a\u0430\u043a \u0441\u043f\u043e\u0441\u043e\u0431\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0446\u0438\u043a\u043b\u043e\u0432 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0440\u0430\u0437\u043b\u0438\u0447\u0430\u044e\u0442\u0441\u044f \u043c\u0435\u0436\u0434\u0443 \u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430\u043c\u0438.<\/p>\n<p> <\/p>\n<p>\u041c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e\u0442 \u043f\u043e\u0434\u0445\u043e\u0434 \u0431\u043e\u043b\u0435\u0435 \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u044b\u043c, \u043d\u0430\u043f\u0438\u0441\u0430\u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0442\u0438\u043f\u0430 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430. \u041d\u043e \u0441\u0435\u0439\u0447\u0430\u0441 \u043c\u044b \u043b\u0438\u0448\u044c \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043e\u0431\u0449\u0443\u044e \u0438\u0434\u0435\u044e \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u043b\u043e\u0433\u0438\u043a\u0438. \u0411\u0435\u0437\u0443\u0441\u043b\u043e\u0432\u043d\u043e, \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442 \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u0441\u043f\u043e\u0441\u043e\u0431\u044b \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438.<\/p>\n<p> <\/p>\n<p>\u042f \u0440\u0435\u0448\u0438\u043b\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u0430\u0441\u0441\u0438\u0432\u044b \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0442\u0438\u043f\u0430, \u0430 \u0437\u0430\u0442\u0435\u043c \u043d\u0430\u043f\u0438\u0441\u0430\u043b\u0430 \u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u0435\u0440\u0435\u0431\u0438\u0440\u0430\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u0438 \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442 \u043c\u0430\u0441\u0441\u0438\u0432 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u0441\u043e \u0432\u0441\u0435\u0439 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0435\u0439 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u0433\u0440\u0443\u043f\u043f\u044b. \u041f\u0440\u0438 \u0442\u0430\u043a\u043e\u043c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u043c \u043e\u0431\u044a\u0435\u043c\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432\u043f\u043e\u043b\u043d\u0435 \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0432\u0441\u0435 \u0432 \u043e\u0434\u043d\u043e\u043c \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0435, \u0433\u0434\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u044e\u0442\u0441\u044f, \u043d\u043e \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043c\u044b \u0441\u0435\u0440\u044c\u0435\u0437\u043d\u043e \u043e\u0442\u043d\u043e\u0441\u0438\u043c\u0441\u044f \u043a \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0443 DRY (Don&#8217;t Repeat Yourself).<\/p>\n<p> <\/p>\n<pre><code class=\"javascript\">const container = document.querySelector(\"[data-svg-container]\"); const svgWidth = 200; const documentWidth = 200; const documentHeight = 200; const halfWidth = documentWidth \/ 2; const halfHeight = documentHeight \/ 2; const circles = [   { cx: 25, cy: 80, r: 10, fill: \"red\" },   { cx: 40, cy: 20, r: 5, fill: \"lime\" },   { cx: 70, cy: 60, r: 8, fill: \"cyan\" }, ]; const points = circles.map(({ cx, cy }) =&gt; `${cx},${cy}`).join(\" \"); const elements = [\"polyline\", \"polygon\"]; const fillOptions = [\"none\", \"white\"]; const transforms = [   undefined,   `translate(${halfWidth}, 0)`,   `translate(0, ${halfHeight})`,   `translate(${halfWidth}, ${halfHeight})`, ]; const makeGroupsDataObject = () =&gt; {   let counter = 0;   const g = [];   elements.forEach((element) =&gt; {     fillOptions.forEach((fill) =&gt; {       const transform = transforms[counter++];       g.push({ element, fill, transform });     });   });   return g; }; const groups = makeGroupsDataObject(); \/\/ result: \/\/ [ \/\/   { \/\/     element: \"polyline\", \/\/     fill: \"none\", \/\/   }, \/\/   { \/\/     element: \"polyline\", \/\/     fill: \"white\", \/\/     transform: \"translate(100, 0)\", \/\/   }, \/\/   { \/\/     element: \"polygon\", \/\/     fill: \"none\", \/\/     transform: \"translate(0, 100)\", \/\/   }, \/\/   { \/\/     element: \"polygon\", \/\/     fill: \"white\", \/\/     transform: \"translate(100, 100)\", \/\/   } \/\/ ]  const svg = document.createElementNS(\"http:\/\/www.w3.org\/2000\/svg\", \"svg\"); svg.setAttribute(\"width\", svgWidth); svg.setAttribute(\"viewBox\", `0 0 ${documentWidth} ${documentHeight}`); svg.setAttribute(\"xmlns\", \"http:\/\/www.w3.org\/2000\/svg\"); svg.setAttribute(\"role\", \"img\"); svg.innerHTML = \"&lt;title&gt;Composite shape comparison&lt;\/title&gt;\"; groups.forEach((groupData) =&gt; {   const circlesHTML = circles     .map((circle) =&gt; {       return `         &lt;circle           cx=\"${circle.cx}\"           cy=\"${circle.cy}\"           r=\"${circle.r}\"           fill=\"${circle.fill}\"         \/&gt;`;     })     .join(\"\");   const polyElementHTML = `     &lt;${groupData.element}       points=\"${points}\"       fill=\"${groupData.fill}\"       stroke=\"black\"     \/&gt;`;   const group = `       &lt;g ${groupData.transform ? `transform=\"${groupData.transform}\"` : \"\"}&gt;         ${circlesHTML}         ${polyElementHTML}       &lt;\/g&gt;     `;   svg.innerHTML += group; }); container.appendChild(svg);<\/code><\/pre>\n<p> <\/p>\n<div class=\"oembed\">\n<div class=\"tm-iframe_temp\" data-src=\"https:\/\/embedd.srv.habr.com\/iframe\/67178c8787bb36d4b30410da\" data-style=\"\" id=\"67178c8787bb36d4b30410da\" width=\"\"><\/div>\n<\/div>\n<p> <\/p>\n<h2 id=\"-uvlekatelnye-vozmozhnosti-svg\">\u276f \u0423\u0432\u043b\u0435\u043a\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 SVG<\/h2>\n<p> <\/p>\n<p>\u041c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043b\u0438 \u0431\u0430\u0437\u043e\u0432\u044b\u0435 \u0430\u0441\u043f\u0435\u043a\u0442\u044b \u0440\u0430\u0431\u043e\u0442\u044b \u0441 SVG, \u043d\u043e \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u044d\u0442\u043e\u0433\u043e \u0444\u043e\u0440\u043c\u0430\u0442\u0430 \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u0448\u0438\u0440\u0435. \u041f\u043e\u043c\u0438\u043c\u043e \u0442\u0440\u0430\u043d\u0441\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0439 (<code>transform<\/code>), \u043e \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043c\u044b \u0433\u043e\u0432\u043e\u0440\u0438\u043b\u0438, \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0442\u044c \u043c\u0430\u0441\u043a\u0438 (<code>mask<\/code>), \u043c\u0430\u0440\u043a\u0435\u0440\u044b (<code>marker<\/code>) \u0438 \u043c\u043d\u043e\u0433\u043e\u0435 \u0434\u0440\u0443\u0433\u043e\u0435.<\/p>\n<p> <\/p>\n<p>\u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u043c\u044b \u043d\u0435 \u0441\u043c\u043e\u0436\u0435\u043c \u043f\u043e\u0433\u0440\u0443\u0437\u0438\u0442\u044c\u0441\u044f \u0432\u043e \u0432\u0441\u0435 \u044d\u0442\u0438 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0435 \u0442\u0435\u043c\u044b \u043f\u0440\u044f\u043c\u043e \u0441\u0435\u0439\u0447\u0430\u0441. \u041d\u043e \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043d\u0430\u0448\u0435 \u0437\u043d\u0430\u043a\u043e\u043c\u0441\u0442\u0432\u043e \u0441 SVG \u043d\u0430\u0447\u0430\u043b\u043e\u0441\u044c \u0441 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0441\u0435\u0442\u043e\u043a \u0434\u043b\u044f \u043a\u0430\u043b\u043b\u0438\u0433\u0440\u0430\u0444\u0438\u0438, \u044f \u0431\u044b \u0445\u043e\u0442\u0435\u043b\u0430 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u0432\u0430\u043c \u043e \u0434\u0432\u0443\u0445 \u0441\u0430\u043c\u044b\u0445 \u0443\u0432\u043b\u0435\u043a\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0444\u0438\u0448\u043a\u0430\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435, \u043a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u044f \u043d\u0435 \u043c\u043e\u0433\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u0441\u0432\u043e\u0435\u043c \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440\u0435. \u0414\u0435\u043b\u043e \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u044f \u0441\u0442\u0440\u0435\u043c\u0438\u043b\u0430\u0441\u044c \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 SVG-\u0444\u0430\u0439\u043b\u044b \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0442\u044c \u0432 Affinity, \u0430 \u044d\u0442\u0430 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0448\u0430\u0431\u043b\u043e\u043d\u044b (<code>pattern<\/code>).<\/p>\n<p> <\/p>\n<p>\u0418\u0442\u0430\u043a, \u0448\u0430\u0431\u043b\u043e\u043d\u044b \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0447\u0430\u0441\u0442\u044c\u044e \u0440\u0430\u0437\u0434\u0435\u043b\u0430 <code>defs<\/code> \u0432 SVG. \u0417\u0434\u0435\u0441\u044c \u043c\u043e\u0436\u043d\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c \u043c\u043d\u043e\u0433\u043e\u0440\u0430\u0437\u043e\u0432\u044b\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0437\u0430\u0442\u0435\u043c \u043c\u043e\u0436\u043d\u043e \u0441\u0441\u044b\u043b\u0430\u0442\u044c\u0441\u044f \u0432 SVG.<\/p>\n<p> <\/p>\n<h3 id=\"setka-grafika-s-pomoschyu-pattern\">\u0421\u0435\u0442\u043a\u0430 \u0433\u0440\u0430\u0444\u0438\u043a\u0430 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>pattern<\/code><\/h3>\n<p> <\/p>\n<p>\u0415\u0441\u043b\u0438 \u043f\u043e\u0434\u0443\u043c\u0430\u0442\u044c, \u0433\u0440\u0430\u0444\u0438\u043a \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u043d\u0430\u0431\u043e\u0440 \u0433\u043e\u0440\u0438\u0437\u043e\u043d\u0442\u0430\u043b\u044c\u043d\u044b\u0445 \u0438 \u0432\u0435\u0440\u0442\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0445 \u043b\u0438\u043d\u0438\u0439, \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u044e\u0449\u0438\u0445\u0441\u044f \u0432\u0434\u043e\u043b\u044c \u043e\u0441\u0435\u0439 X \u0438 Y.<\/p>\n<p> <\/p>\n<p>\u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u0442\u043b\u0438\u0447\u043d\u044b\u043c \u0440\u0435\u0448\u0435\u043d\u0438\u0435\u043c \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432 \u0432 SVG. \u041c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u0442\u044c <code>&lt;rect&gt;<\/code> \u0438 \u0437\u0430\u0442\u0435\u043c \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0448\u0430\u0431\u043b\u043e\u043d \u0432 \u0435\u0433\u043e \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0435 <code>fill<\/code>. \u0421\u0430\u043c \u0448\u0430\u0431\u043b\u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u0438\u043c\u0435\u0442\u044c \u0441\u0432\u043e\u0438 <code>width<\/code>, <code>height<\/code> \u0438 <code>viewBox<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0442, \u043a\u0430\u043a \u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u0442\u044c\u0441\u044f.<\/p>\n<p> <\/p>\n<p>\u041f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u043c, \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u0440\u0430\u0437\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0441\u0435\u0442\u043a\u0443 \u0433\u0440\u0430\u0444\u0438\u043a\u0430 \u043f\u043e \u0446\u0435\u043d\u0442\u0440\u0443, \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0438\u043c\u0435\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0437\u0430\u0434\u0430\u0432\u0430\u0442\u044c \u0440\u0430\u0437\u043c\u0435\u0440\u044b \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u043d\u044b\u0445 \u044f\u0447\u0435\u0435\u043a.<\/p>\n<p> <\/p>\n<p>\u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445:<\/p>\n<p> <\/p>\n<pre><code class=\"javascript\">const graphDocWidth = 226; const graphDocHeight = 101; const cellSize = 5; const strokeWidth = 0.3; const strokeColor = \"currentColor\"; const patternHeight = (cellSize \/ graphDocHeight) * 100; const patternWidth = (cellSize \/ graphDocWidth) * 100; const gridYStart = (graphDocHeight % cellSize) \/ 2; const gridXStart = (graphDocWidth % cellSize) \/ 2;<\/code><\/pre>\n<p> <\/p>\n<p>\u0418\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u0443\u0435\u043c \u0438\u0445 \u0432 SVG-\u044d\u043b\u0435\u043c\u0435\u043d\u0442:<\/p>\n<p> <\/p>\n<pre><code class=\"javascript\">&lt;svg   width={svgWidth}   viewBox={`0 0 ${graphDocWidth} ${graphDocHeight}`}   xmlns=\"http:\/\/www.w3.org\/2000\/svg\"   role=\"img\" &gt;   &lt;defs&gt;     &lt;pattern       id=\"horizontal\"       viewBox={`0 0 ${graphDocWidth} ${strokeWidth}`}       width=\"100%\"       height={`${patternHeight}%`}     &gt;       &lt;line         x1=\"0\"         x2={graphDocWidth}         y1={gridYStart}         y2={gridYStart}         stroke={strokeColor}         stroke-width={strokeWidth}       \/&gt;     &lt;\/pattern&gt;     &lt;pattern       id=\"vertical\"       viewBox={`0 0 ${strokeWidth} ${graphDocHeight}`}       width={`${patternWidth}%`}       height=\"100%\"     &gt;       &lt;line         y1={0}         y2={graphDocHeight}         x1={gridXStart}         x2={gridXStart}         stroke={strokeColor}         stroke-width={strokeWidth}       \/&gt;     &lt;\/pattern&gt;   &lt;\/defs&gt;   &lt;title&gt;A graph grid&lt;\/title&gt;   &lt;rect     width={graphDocWidth}     height={graphDocHeight}     fill=\"url(#horizontal)\"   \/&gt;   &lt;rect     width={graphDocWidth}     height={graphDocHeight}     fill=\"url(#vertical)\"   \/&gt; &lt;\/svg&gt;<\/code><\/pre>\n<p> <\/p>\n<div class=\"oembed\">\n<div class=\"tm-iframe_temp\" data-src=\"https:\/\/embedd.srv.habr.com\/iframe\/67178c88ee68229db6a0629b\" data-style=\"\" id=\"67178c88ee68229db6a0629b\" width=\"\"><\/div>\n<\/div>\n<p> <\/p>\n<h3 id=\"setka-iz-tochek-s-pomoschyu-pattern\">\u0421\u0435\u0442\u043a\u0430 \u0438\u0437 \u0442\u043e\u0447\u0435\u043a \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>pattern<\/code><\/h3>\n<p> <\/p>\n<p>\u0415\u0441\u043b\u0438 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u0430 \u043d\u0435 \u043b\u0438\u043d\u0435\u0439\u043d\u0430\u044f, \u0430 \u0442\u043e\u0447\u0435\u0447\u043d\u0430\u044f \u0441\u0435\u0442\u043a\u0430, \u0432\u043c\u0435\u0441\u0442\u043e \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u044e\u0449\u0438\u0445\u0441\u044f \u043b\u0438\u043d\u0438\u0439 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u043a\u0440\u0443\u0436\u043d\u043e\u0441\u0442\u0438. \u0418\u043b\u0438, \u043a\u0430\u043a \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442, \u043f\u0443\u043d\u043a\u0442\u0438\u0440\u043d\u044b\u0435 \u043b\u0438\u043d\u0438\u0438, \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u0432\u043e\u0439\u0441\u0442\u0432 <code>stroke-dasharray<\/code> \u0438 <code>stroke-dashoffset<\/code>. \u0412 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u0432\u0441\u0435\u0433\u043e \u043e\u0434\u043d\u0430 \u043b\u0438\u043d\u0438\u044f.<\/p>\n<p> <\/p>\n<pre><code class=\"javascript\">const dotDocWidth = 219; const dotDocHeight = 100; const cellSize = 4; const strokeColor = \"black\"; const gridYStart = (dotDocHeight % cellSize) \/ 2; const gridXStart = (dotDocWidth % cellSize) \/ 2; const dotSize = 0.5; const patternHeight = (cellSize \/ dotDocHeight) * 100;<\/code><\/pre>\n<p> <\/p>\n<p>\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0432 SVG-\u044d\u043b\u0435\u043c\u0435\u043d\u0442:<\/p>\n<p> <\/p>\n<pre><code class=\"javascript\">&lt;svg   width={svgWidth}   viewBox={`0 0 ${dotDocWidth} ${dotDocHeight}`}   xmlns=\"http:\/\/www.w3.org\/2000\/svg\"   role=\"img\" &gt;   &lt;defs&gt;     &lt;pattern       id=\"horizontal-dotted-line\"       viewBox={`0 0 ${dotDocWidth} ${dotSize}`}       width=\"100%\"       height={`${patternHeight}%`}     &gt;       &lt;line         x1={gridXStart}         y1={gridYStart}         x2={dotDocWidth}         y2={gridYStart}         stroke={strokeColor}         stroke-width={dotSize}         stroke-dasharray={`0,${cellSize}`}         stroke-linecap=\"round\"       &gt;&lt;\/line&gt;     &lt;\/pattern&gt;   &lt;\/defs&gt;   &lt;title&gt;A Dot Grid&lt;\/title&gt;   &lt;rect     x=\"0\"     y=\"0\"     width={dotDocWidth}     height={dotDocHeight}     fill=\"url(#horizontal-dotted-line)\"   &gt;&lt;\/rect&gt; &lt;\/svg&gt;<\/code><\/pre>\n<p> <\/p>\n<div class=\"oembed\">\n<div class=\"tm-iframe_temp\" data-src=\"https:\/\/embedd.srv.habr.com\/iframe\/67178c886748d7d46f18a130\" data-style=\"\" id=\"67178c886748d7d46f18a130\" width=\"\"><\/div>\n<\/div>\n<p> <\/p>\n<h2 id=\"-zaklyuchenie\">\u276f \u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h2>\n<p> <\/p>\n<p>\u041d\u0430 \u044d\u0442\u043e\u043c \u043c\u044b \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u0435\u043c \u043d\u0430\u0448\u0435 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u0432\u0432\u043e\u0434\u043d\u043e\u0435 \u043f\u0443\u0442\u0435\u0448\u0435\u0441\u0442\u0432\u0438\u0435 \u0432 \u043c\u0438\u0440 SVG. \u041a\u0430\u043a \u0432\u0438\u0434\u0438\u0442\u0435, \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 SVG \u0432\u0440\u0443\u0447\u043d\u0443\u044e \u043d\u0435 \u0442\u0430\u043a\u043e\u0435 \u0441\u0442\u0440\u0430\u0448\u043d\u043e\u0435, \u043a\u0430\u043a \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u043f\u0435\u0440\u0432\u044b\u0439 \u0432\u0437\u0433\u043b\u044f\u0434. \u0420\u0430\u0437\u0431\u0438\u0432 \u0437\u0430\u0434\u0430\u0447\u0443 \u043d\u0430 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u0448\u0430\u0433\u0438, \u043c\u044b \u043f\u043e\u043d\u0438\u043c\u0430\u0435\u043c, \u0447\u0442\u043e \u044d\u0442\u043e \u043d\u0435 \u0441\u0438\u043b\u044c\u043d\u043e \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442 \u0434\u0440\u0443\u0433\u0438\u0445 \u0437\u0430\u0434\u0430\u0447 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f:<\/p>\n<p> <\/p>\n<ol>\n<li>\u041c\u044b \u0438\u0437\u0443\u0447\u0430\u0435\u043c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443.<\/li>\n<li>\u0420\u0430\u0437\u0431\u0438\u0432\u0430\u0435\u043c \u0435\u0435 \u043d\u0430 \u0431\u043e\u043b\u0435\u0435 \u043c\u0435\u043b\u043a\u0438\u0435 \u0447\u0430\u0441\u0442\u0438.<\/li>\n<li>\u0418\u0441\u0441\u043b\u0435\u0434\u0443\u0435\u043c \u043a\u0430\u0436\u0434\u0443\u044e \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u0443 \u0438 \u0435\u0435 \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435.<\/li>\n<li>\u0410 \u0437\u0430\u0442\u0435\u043c \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u043c \u0432\u0441\u0435 \u0432\u043e\u0435\u0434\u0438\u043d\u043e.<\/li>\n<\/ol>\n<p> <\/p>\n<p>\u041d\u0430\u0434\u0435\u044e\u0441\u044c, \u0434\u0430\u043d\u043d\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u043f\u043e\u0441\u043b\u0443\u0436\u0438\u043b\u0430 \u0434\u043b\u044f \u0432\u0430\u0441 \u043e\u0442\u043f\u0440\u0430\u0432\u043d\u043e\u0439 \u0442\u043e\u0447\u043a\u043e\u0439 \u0432 \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0438 \u0443\u0434\u0438\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u043c\u0438\u0440\u0430 \u043a\u043e\u0434\u0438\u0440\u0443\u0435\u043c\u043e\u0439 \u0433\u0440\u0430\u0444\u0438\u043a\u0438. \u0422\u0435\u043f\u0435\u0440\u044c \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u043c\u043e\u0442\u0438\u0432\u0430\u0446\u0438\u044f \u0443\u0433\u043b\u0443\u0431\u0438\u0442\u044c\u0441\u044f \u0432 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0438 \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0447\u0442\u043e-\u043d\u0438\u0431\u0443\u0434\u044c \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e. \u041f\u0443\u0441\u0442\u044c \u044d\u0442\u043e\u0442 \u043e\u043f\u044b\u0442 \u0432\u0434\u043e\u0445\u043d\u043e\u0432\u0438\u0442 \u0432\u0430\u0441 \u043d\u0430 \u043d\u043e\u0432\u044b\u0435 \u0442\u0432\u043e\u0440\u0447\u0435\u0441\u043a\u0438\u0435 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u044b!<\/p>\n<p> <\/p>\n<hr\/>\n<p> <\/p>\n<blockquote><p><a href=\"https:\/\/t.me\/timewebru\"><b>\u041d\u043e\u0432\u043e\u0441\u0442\u0438, \u043e\u0431\u0437\u043e\u0440\u044b \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u043e\u0432 \u0438 \u043a\u043e\u043d\u043a\u0443\u0440\u0441\u044b \u043e\u0442 \u043a\u043e\u043c\u0430\u043d\u0434\u044b Timeweb.Cloud \u2014 \u0432 \u043d\u0430\u0448\u0435\u043c Telegram-\u043a\u0430\u043d\u0430\u043b\u0435<\/b><\/a> <b>\u21a9<\/b><\/p><\/blockquote>\n<p><a href=\"https:\/\/timeweb.cloud\/?i=106909\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/u9\/vg\/io\/u9vgio3hxj12h5u7j3un0wx_zpk.png\" data-src=\"https:\/\/habrastorage.org\/webt\/u9\/vg\/io\/u9vgio3hxj12h5u7j3un0wx_zpk.png\"\/><\/a><\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/852522\/\"> https:\/\/habr.com\/ru\/articles\/852522\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-1\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/webt\/ma\/po\/lv\/mapolvqq4uunxfqoaviv3g9km9y.jpeg\" data-src=\"https:\/\/habrastorage.org\/webt\/ma\/po\/lv\/mapolvqq4uunxfqoaviv3g9km9y.jpeg\" data-blurred=\"true\"\/> <\/p>\n<p> <\/p>\n<p> <\/p>\n<p>\u041f\u0440\u0438\u0437\u043d\u0430\u044e\u0441\u044c, \u043f\u043e\u043d\u0430\u0447\u0430\u043b\u0443 \u044f \u0431\u044b\u043b\u0430 \u0441\u043a\u0435\u043f\u0442\u0438\u043a\u043e\u043c \u0440\u0443\u0447\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f SVG. \u0411\u0443\u0434\u0443\u0447\u0438 \u0444\u0440\u043e\u043d\u0442\u0435\u043d\u0434-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u043c, \u043f\u0440\u0438\u0432\u044b\u043a\u0448\u0438\u043c \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442\u044c \u0432 \u043f\u043e\u0440\u044f\u0434\u043e\u043a &#171;\u043f\u043b\u043e\u0445\u0438\u0435&#187; SVG-\u0444\u0430\u0439\u043b\u044b, \u044f \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u0432\u0441\u0435\u0440\u044c\u0435\u0437 \u043d\u0435 \u0437\u0430\u0434\u0443\u043c\u044b\u0432\u0430\u043b\u0430\u0441\u044c \u043e \u0442\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u0441\u0430\u043c\u043e\u0439 <em>\u0440\u0438\u0441\u043e\u0432\u0430\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u0434\u0430<\/em>.<\/p>\n<p> <\/p>\n<p>\u041e\u0434\u043d\u0430\u043a\u043e, \u043f\u0440\u043e\u0448\u043b\u043e\u0439 \u0437\u0438\u043c\u043e\u0439 \u044f \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u043b\u0430 \u043f\u0440\u043e\u0435\u043a\u0442 \u0434\u043b\u044f <a href=\"https:\/\/code.halfapx.com\/guideline-generator\/\">\u0440\u0438\u0441\u043e\u0432\u0430\u043d\u0438\u044f \u043a\u0430\u043b\u043b\u0438\u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0441\u0435\u0442\u043e\u043a<\/a> \u0438 \u0441 \u0433\u043e\u043b\u043e\u0432\u043e\u0439 \u043f\u043e\u0433\u0440\u0443\u0437\u0438\u043b\u0430\u0441\u044c \u0432 \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u0435 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0439 SVG. \u041e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c, \u0447\u0442\u043e, \u043d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0437\u043d\u0430\u043d\u0438\u0435 \u0431\u0430\u0437\u043e\u0432\u044b\u0445 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440 \u0438 \u043f\u0440\u0430\u0432\u0438\u043b \u0440\u0430\u0431\u043e\u0442\u044b \u0441 SVG, \u043f\u043e-\u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0435\u043c\u0443 \u043f\u043e\u043d\u044f\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432\u0441\u0435\u0445 \u044d\u0442\u0438\u0445 \u0446\u0438\u0444\u0440 \u0438 \u0438\u0445 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043c\u0435\u0436\u0434\u0443 \u0441\u043e\u0431\u043e\u0439 \u043c\u043e\u0436\u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0435\u0440\u0435\u0437 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0443 \u0440\u0443\u0447\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f.<\/p>\n<p> <\/p>\n<p>\u0410 \u043a\u0430\u043a \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0441\u0432\u043e\u0438\u0448\u044c\u0441\u044f, \u044d\u0442\u043e \u0437\u0430\u043d\u044f\u0442\u0438\u0435 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u043d\u0430 \u0440\u0435\u0434\u043a\u043e\u0441\u0442\u044c \u0443\u0432\u043b\u0435\u043a\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u0438 \u0434\u0430\u0436\u0435 \u0437\u0430\u0431\u0430\u0432\u043d\u044b\u043c.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-437734","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/437734","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=437734"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/437734\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=437734"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=437734"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=437734"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}