{"id":13466623,"url":"https://github.com/Lupusa87/BlazorSvgHelper","last_synced_at":"2025-03-25T21:32:42.018Z","repository":{"id":217343252,"uuid":"143446598","full_name":"Lupusa87/BlazorSvgHelper","owner":"Lupusa87","description":"All Blazor Demos","archived":false,"fork":false,"pushed_at":"2021-01-15T04:59:59.000Z","size":40,"stargazers_count":40,"open_issues_count":2,"forks_count":11,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-08-01T15:05:34.879Z","etag":null,"topics":["blazor"],"latest_commit_sha":null,"homepage":"https://lupblazordemos.z13.web.core.windows.net/","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Lupusa87.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2018-08-03T15:53:16.000Z","updated_at":"2024-04-25T16:55:32.000Z","dependencies_parsed_at":"2024-01-18T05:09:47.651Z","dependency_job_id":"e4a76d0b-abce-4082-98f5-20d2fe736112","html_url":"https://github.com/Lupusa87/BlazorSvgHelper","commit_stats":null,"previous_names":["lupusa87/blazorsvghelper"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lupusa87%2FBlazorSvgHelper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lupusa87%2FBlazorSvgHelper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lupusa87%2FBlazorSvgHelper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lupusa87%2FBlazorSvgHelper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Lupusa87","download_url":"https://codeload.github.com/Lupusa87/BlazorSvgHelper/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":222092169,"owners_count":16929803,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["blazor"],"created_at":"2024-07-31T15:00:47.374Z","updated_at":"2024-10-29T18:32:13.296Z","avatar_url":"https://github.com/Lupusa87.png","language":"C#","funding_links":["https://www.paypal.me/VakhtangiAbashidze/10"],"categories":["Libraries \u0026 Extensions","others"],"sub_categories":["Tools \u0026 Utilities"],"readme":"# Blazor Svg Helper\n\n![](https://placehold.it/15/4747d1/000000?text=+) \nIf you like my blazor works and want to see more open sourced repos please support me with [paypal donation](https://www.paypal.me/VakhtangiAbashidze/10)\n![](https://placehold.it/15/4747d1/000000?text=+) \n\n![](https://placehold.it/15/00e600/000000?text=+) \nPlease send [email](mailto:VakhtangiAbashidze@gmail.com) if you consider to **hire me**.\n![](https://placehold.it/15/00e600/000000?text=+)     \n\n\n![](https://placehold.it/15/ffffff/000000?text=+)  \n\n\n\nThis repo contains svg classes for using in blazor.\n\n[Project](https://www.nuget.org/packages/BlazorSvgHelper/) is available on nuget.\n\nFor install use command - **Install-Package BlazorSvgHelper**\n\nYou can create svg element and add children (circle, rectangle, image, text and etc) and finally render this svg with blazor RenderTreeBuilder.\n\n\n![image](https://raw.githubusercontent.com/Lupusa87/BlazorSvgHelper/master/Untitled.png)\n\n\nUsage:\n```\n public svg ComposeSVG()\n  {\n   _svg = new svg\n    {\n        id = \"svgclock\",\n        width = 100,\n        height = 100,\n        xmlns = \"http://www.w3.org/2000/svg\",\n    };\n\n\n   _svg.Children.Add(new circle\n                  {\n                      cx = 0,\n                      cy = 0,\n                      r = 30,\n                      fill = \"red\",\n                      transform = \"translate(50,50)\",\n                  });\n                  \n   return _svg;\n }\n```\n\n When you done composing svg you can render it.\n \n ```\n  protected override void BuildRenderTree(RenderTreeBuilder builder)\n  {\n      svg _svg = ComposeSVG();\n      new SvgHelper().Cmd_Render(_svg, 0, builder);\n  }\n  ```\n\n**SVG helper works only for dynamic component and not for markup.**\nYou should create cs file and inside BuildRenderTree method render svg.\n```\npublic class SomeComponent:BlazorComponent\n{\n  protected override void BuildRenderTree(RenderTreeBuilder builder)\n  {\n      svg _svg = ComposeSVG();\n      new SvgHelper().Cmd_Render(_svg, 0, builder);\n  }\n}\n```\n\nBefore use SvgHeler you need to have basic understanding what is and how works dynamic component.\n\nYou can compose more complex svg.\n\nFor example this helper was used [here](https://lupusablazordemos.azurewebsites.net/)\n\nYou can see code how this svg was composed [here](https://github.com/Lupusa87/LupusaBlazorDemos/blob/master/BlazorClockSvgComponent/CompClockSVG.cs)\n\n\nFor any questions please email me at VakhtangiAbashidze@gmail.com\n\nAny PRs are welcome.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FLupusa87%2FBlazorSvgHelper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FLupusa87%2FBlazorSvgHelper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FLupusa87%2FBlazorSvgHelper/lists"}