All Projects → Lupusa87 → BlazorSvgHelper

Lupusa87 / BlazorSvgHelper

Licence: other
All Blazor Demos

Programming Languages

C#
18002 projects

Labels

Projects that are alternatives of or similar to BlazorSvgHelper

blazor-dashboard
Blazor sample dashboard app with native components from Telerik
Stars: ✭ 20 (-44.44%)
Mutual labels:  blazor
MvvmBlazor
A lightweight Blazor Mvvm Library
Stars: ✭ 203 (+463.89%)
Mutual labels:  blazor
Fun.Blazor
Powered by .NET blazor!!! ❤ F#
Stars: ✭ 107 (+197.22%)
Mutual labels:  blazor
BlazorCanvas
Simple 2D gamedev examples using Blazor and .NET 5
Stars: ✭ 99 (+175%)
Mutual labels:  blazor
BethanysPieShopHR
Server-side Blazor project
Stars: ✭ 45 (+25%)
Mutual labels:  blazor
BlazorVirtualScrolling
Blazor components for efficiently rendering large lists and data using virtual scrolling
Stars: ✭ 56 (+55.56%)
Mutual labels:  blazor
AspNetCore6Experiments
ASP.NET Core Blazor BFF with Azure AD and Razor page
Stars: ✭ 43 (+19.44%)
Mutual labels:  blazor
blazor-validation
Validation extensions for Microsoft Blazor / FluentValidation
Stars: ✭ 142 (+294.44%)
Mutual labels:  blazor
Amazing-Favorites
Amazing Favorites is a browser extension to help you to manage you bookmarks efficiently.
Stars: ✭ 48 (+33.33%)
Mutual labels:  blazor
XAF Security E4908
This repository contains examples for Role-based Access Control, Permission Management, and OData / Web / REST API Services for Entity Framework and XPO ORM
Stars: ✭ 47 (+30.56%)
Mutual labels:  blazor
Jonty.Blog
🎯Jonty.Blog个人博客项目,底层基于免费开源跨平台的.NET Core 3.1开发,使用 ABP vNext搭建项目框架,支持主流数据库,遵循RESTful接口规范,前端使用Blazor开发。
Stars: ✭ 42 (+16.67%)
Mutual labels:  blazor
blazorators
This project converts TypeScript type declarations into C# representations, and use C# source generators to expose automatic JavaScript interop functionality.
Stars: ✭ 225 (+525%)
Mutual labels:  blazor
BlazorEFCoreMultitenant
Examples of multitenancy using EF Core and Blazor.
Stars: ✭ 67 (+86.11%)
Mutual labels:  blazor
Home
Home for Blazor Extensions
Stars: ✭ 51 (+41.67%)
Mutual labels:  blazor
MudBlazor
Blazor Component Library based on Material design with an emphasis on ease of use. Mainly written in C# with Javascript kept to a bare minimum it empowers .NET developers to easily debug it if needed.
Stars: ✭ 4,539 (+12508.33%)
Mutual labels:  blazor
Blazor-Survey
A hybrid F#/C# blazor sample app to kick the tyres of blazor.
Stars: ✭ 16 (-55.56%)
Mutual labels:  blazor
TabBlazor
Blazor admin template based on Tabler UI
Stars: ✭ 222 (+516.67%)
Mutual labels:  blazor
Blazor.PersianDatePicker
A free JavaScript Jalali (Persian) and Gregorian (Miladi) dual datepicker library for Blazor applications
Stars: ✭ 40 (+11.11%)
Mutual labels:  blazor
BlazoredLocalStorage
This library has been moved to the Blazored org
Stars: ✭ 26 (-27.78%)
Mutual labels:  blazor
BlazorTimeline
Responsive, vertical timeline component.
Stars: ✭ 56 (+55.56%)
Mutual labels:  blazor

Blazor Svg Helper

If you like my blazor works and want to see more open sourced repos please support me with paypal donation

Please send email if you consider to hire me.

This repo contains svg classes for using in blazor.

Project is available on nuget.

For install use command - Install-Package BlazorSvgHelper

You can create svg element and add children (circle, rectangle, image, text and etc) and finally render this svg with blazor RenderTreeBuilder.

image

Usage:

 public svg ComposeSVG()
  {
   _svg = new svg
    {
        id = "svgclock",
        width = 100,
        height = 100,
        xmlns = "http://www.w3.org/2000/svg",
    };


   _svg.Children.Add(new circle
                  {
                      cx = 0,
                      cy = 0,
                      r = 30,
                      fill = "red",
                      transform = "translate(50,50)",
                  });
                  
   return _svg;
 }

When you done composing svg you can render it.

 protected override void BuildRenderTree(RenderTreeBuilder builder)
 {
     svg _svg = ComposeSVG();
     new SvgHelper().Cmd_Render(_svg, 0, builder);
 }

SVG helper works only for dynamic component and not for markup. You should create cs file and inside BuildRenderTree method render svg.

public class SomeComponent:BlazorComponent
{
  protected override void BuildRenderTree(RenderTreeBuilder builder)
  {
      svg _svg = ComposeSVG();
      new SvgHelper().Cmd_Render(_svg, 0, builder);
  }
}

Before use SvgHeler you need to have basic understanding what is and how works dynamic component.

You can compose more complex svg.

For example this helper was used here

You can see code how this svg was composed here

For any questions please email me at [email protected]

Any PRs are welcome.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].