GraphVG 0.1.0
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package GraphVG --version 0.1.0
NuGet\Install-Package GraphVG -Version 0.1.0
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="GraphVG" Version="0.1.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="GraphVG" Version="0.1.0" />
<PackageReference Include="GraphVG" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add GraphVG --version 0.1.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: GraphVG, 0.1.0"
#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.
#:package GraphVG@0.1.0
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=GraphVG&version=0.1.0
#tool nuget:?package=GraphVG&version=0.1.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
GraphVG
A .NET library for F# to generate graph and chart visuals as SVG using SharpVG.
Pull requests and suggestions are greatly appreciated.
Why GraphVG?
- Build graphs with an F#-first API instead of writing raw SVG by hand.
- Generate clean SVG output that can be embedded anywhere HTML/SVG is supported.
- Compose charts from reusable pieces: scales, axes, series, themes, annotations, and legends.
- Supports common chart types out of the box: line, scatter, and area.
- Supports linear and logarithmic scales.
- Minimal dependency footprint: GraphVG depends on SharpVG only.
GraphVG Goals
- Make graph generation in F# simple and pipeline-friendly.
- Keep rendering deterministic and testable.
- Use strong types to reduce invalid chart state.
- Keep visual customization explicit and composable.
Examples
open GraphVG
open SharpVG
let points =
[
1.0, 1.0
2.0, 1.4
5.0, 2.0
10.0, 2.6
20.0, 3.2
50.0, 4.0
100.0, 4.7
]
let response =
points
|> Series.line
|> Series.withLabel "Response"
|> Series.withStrokeWidth (Length.ofFloat 3.0)
let samples =
points
|> Series.scatter
|> Series.withLabel "Samples"
|> Series.withPointRadius (Length.ofFloat 6.0)
let xScale = Scale.log (1.0, 100.0) (0.0, CommonMath.canvasSize) 10.0
let yScale = Scale.linear (0.0, 5.0) (CommonMath.canvasSize, 0.0)
let graph =
Graph.create [ response; samples ] (1.0, 100.0) (0.0, 5.0)
|> Graph.withXScale xScale
|> Graph.withYScale yScale
|> Graph.withTitle "Log Scale"
|> Graph.withAxes
(
Some (Axis.create Bottom xScale |> Axis.withLabel "Input Scale"),
Some (Axis.create Left yScale |> Axis.withLabel "Response")
)
|> Graph.withLegend (Legend.create LegendRight)
let svg = GraphVG.toSvg graph
let html = GraphVG.toHtml graph
Simple start:
let html =
Graph.create [ unitCircle; lissajous ] (-1.2, 1.2) (-1.2, 1.2)
|> Graph.withTheme Theme.light
|> GraphVG.toHtml
Building GraphVG
Clone the repository:
git clone https://github.com/ChrisNikkel/GraphVG.git
cd GraphVG
Build:
dotnet build
Run tests:
dotnet test
Run the example gallery generator:
dotnet run --project Examples/Example
Project Structure
REQUIREMENTS.md # Planned requirements/bugs
DESIGN.md # Architecture and design notes
GraphVG/ # Main library (net8.0)
Examples/Example/ # Executable usage demo
Tests/ # xUnit and FsCheck test suite
Documentation
- Design notes: DESIGN.md
- Requirements/backlog: REQUIREMENTS.md
- Developer guidance: CLAUDE.md
- Contributing guide: CONTRIBUTING.md
- Security policy: SECURITY.md
Support
Please submit bugs and feature requests here.
Library License
The library is available under the MIT license. For more information see LICENSE.md.
Maintainer(s)
| Product | Versions 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. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net8.0
- FSharp.Core (>= 9.0.303)
- SharpVG (>= 0.1.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
See CHANGELOG.md at https://github.com/ChrisNikkel/GraphVG/blob/main/CHANGELOG.md