SharpVG 0.0.2

There is a newer version of this package available.
See the version list below for details.
dotnet add package SharpVG --version 0.0.2
NuGet\Install-Package SharpVG -Version 0.0.2
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="SharpVG" Version="0.0.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add SharpVG --version 0.0.2
#r "nuget: SharpVG, 0.0.2"
#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 SharpVG as a Cake Addin
#addin nuget:?package=SharpVG&version=0.0.2

// Install SharpVG as a Cake Tool
#tool nuget:?package=SharpVG&version=0.0.2

SharpVG

Travis CI Build Status Join the chat at https://gitter.im/SharpVG/Lobby

A .NET Standard library for F# to generate vector graphics in SVG format.

Pull requests and suggestions are greatly appreciated.

Why SharpVG?

  • Allows you to emit SVG using simple F# commands so that you can create graphics and animations that are easy to distribute
  • Ability to render dynamically using Fable to create interactive web pages
  • All basic SVG elements are supported: line, circle, ellipse, rect, text, polygon, polyline, path, image, and groups
  • No understanding of SVG is required and its as easy as using seq, list, or array
  • No external dependencies other than SharpVG are required
  • .NET Core cross platform support on Windows, Linux, and OSX
  • Limited support for SVG animations
  • Limited support for cartesian plotting
  • Reusable styles

Examples

let upperLeft = Point.ofInts (10, 10)
let area = Area.ofInts (50, 50)
let style = Style.create (Name Colors.Cyan) (Name Colors.Blue) (Length.ofInt 3) 1.0 1.0

Rect.create upperLeft area
  |> Element.createWithStyle style
  |> printf "%O"
<rect stroke="blue" stroke-width="3" fill="cyan" opacity="1" x="10" y="10" height="50" width="50"/>
let center = Point.ofInts (60, 60)
let radius = Length.ofInt 50
let style = Style.create (Name Colors.Violet) (Name Colors.Indigo) (Length.ofInt 3) 1.0 1.0

Circle.create center radius
  |> Element.createWithStyle style
  |> Svg.ofElement
  |> Svg.toHtml "Example"
  |> printf "%s"
<!DOCTYPE html>
<html>
<head>
<title>Example</title>
</head>
<body>
<svg><circle stroke="indigo" stroke-width="3" fill="violet" opacity="1" r="50" cx="60" cy="60"/></svg>
</body>
</html>

Building SharpVG

Clone the repository:

git clone https://github.com/ChrisNikkel/SharpVG.git
cd SharpVG

Start the build:

dotnet build

Run the tests:

dotnet test Tests

Run the examples:

dotnet run -p Examples\Triangle\Triangle.fsproj
dotnet run -p Examples\Life\Life.fsproj
dotnet run -p Examples\Graph\Graph.fsproj
dotnet run -p Examples\Animate\Animate.fsproj

Run the Fable example (prerequisites):

cd Examples\Bounce\src
dotnet restore
dotnet fable yarn-run start

Explore interactively:

fsharpi -r:SharpVG/bin/Debug/netcoreapp2.0/SharpVG.dll
open SharpVG;;
Circle.create Point.origin (Length.ofInt 10) |> printf "%O";;
Circle.create Point.origin (Length.ofInt 10) |> Element.create |> Svg.ofElement |> Svg.toHtml "Example";;
#quit;;

Documentation

Read the documentation here.

Support

Please submit bugs and feature requests here.

Library License

The library is available under the MIT license. For more information see the license file.

Maintainer(s)

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos 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.0.19 83 4/1/2024
0.0.18 81 3/30/2024
0.0.16 432 12/8/2022
0.0.13 755 7/11/2020
0.0.12 452 4/19/2020
0.0.11 437 4/18/2020
0.0.10 418 4/17/2020
0.0.9 535 2/9/2020
0.0.8 460 2/8/2020
0.0.7 471 2/3/2020
0.0.6 512 12/23/2019
0.0.5 485 12/18/2019
0.0.4 507 11/10/2019
0.0.3 839 12/24/2018
0.0.2 830 12/23/2018
0.0.1 837 12/23/2018