Frank.Mermaid 0.2.9-preview

This is a prerelease version of Frank.Mermaid.
There is a newer version of this package available.
See the version list below for details.
dotnet add package Frank.Mermaid --version 0.2.9-preview
NuGet\Install-Package Frank.Mermaid -Version 0.2.9-preview
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Frank.Mermaid" Version="0.2.9-preview" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Frank.Mermaid --version 0.2.9-preview
#r "nuget: Frank.Mermaid, 0.2.9-preview"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Frank.Mermaid as a Cake Addin
#addin nuget:?package=Frank.Mermaid&version=0.2.9-preview&prerelease

// Install Frank.Mermaid as a Cake Tool
#tool nuget:?package=Frank.Mermaid&version=0.2.9-preview&prerelease

Frank.Mermaid

This is a Blazor component that builds Mermaid diagrams. It has no rendering, just the just the different building blocks of the diagram types supported by Mermaid.

This is not complete yet, but more diagram types will be added as time permits.

Installation

You can install the package via NuGet.

dotnet add package Frank.Mermaid

Usage

Add the following using statement to your _Imports.razor:

using Frank.Mermaid;

namespace YourNamespace;

public class Program
{
    public static void Main(string[] args)
    {
        var mermaidPieChart = new PieChart("MyPieChart");
        mermaidPieChart.AddValue("A", 999);
        mermaidPieChart.AddValue("B", 666);
        mermaidPieChart.AddValue("C", 420);
        mermaidPieChart.AddValue("D", 69);
        
        Console.WriteLine(mermaidPieChart.ToMermaidSyntax().ToString());
    }
}

Raw Mermaid syntax outputted:

pie showData
    title MyPieChart
    "A" : 999
    "B" : 666
    "C" : 420
    "D" : 69

Mermaid diagram:

pie showData
    title MyPieChart
    "A" : 999
    "B" : 666
    "C" : 420
    "D" : 69

License

This project is licensed under the MIT License - see the LICENSE file for details.

Credits

This project is 100% original work by Frank R. Haugen. It is not based on any other project or library on purpose. This has is not a unique idea, but I need this for a personal project, and existing libraries did not meet my requirements, like GitGraph and Timeline was missing, and the existing libraries have in many cases been abandoned or not updated in a long time.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
0.5.0 75 4/28/2024
0.2.11-preview 49 4/28/2024
0.2.10-preview 50 4/28/2024
0.2.9-preview 54 4/28/2024
0.2.8-preview 48 4/28/2024
0.2.7-preview 50 4/28/2024
0.2.0 70 4/28/2024