gexf-dotnet 1.0.2

dotnet add package gexf-dotnet --version 1.0.2
                    
NuGet\Install-Package gexf-dotnet -Version 1.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="gexf-dotnet" Version="1.0.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="gexf-dotnet" Version="1.0.2" />
                    
Directory.Packages.props
<PackageReference Include="gexf-dotnet" />
                    
Project file
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 gexf-dotnet --version 1.0.2
                    
#r "nuget: gexf-dotnet, 1.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.
#addin nuget:?package=gexf-dotnet&version=1.0.2
                    
Install gexf-dotnet as a Cake Addin
#tool nuget:?package=gexf-dotnet&version=1.0.2
                    
Install gexf-dotnet as a Cake Tool

gexf-dotnet

A .NET/C# library to generate GEXF (Graph Exchange XML Format) files

NuGet version

Getting Started

Install using the NuGet Package Manager

PM> Install-Package gexf-dotnet

Example Usage

void Main()
{
    var dragon = new Location(1, 40.589649m, -105.045624m, "Horse & Dragon Brewing Company");
    var odell = new Location(2, 40.589476m, -105.063186m, "Odell Brewing Company");
    var belgium = new Location(3, 40.593238m, -105.068600m, "New Belgium Brewing Company");
    var equinox = new Location(4, 40.586356m, -105.075812m, "Equinox Brewing");

    var locations = new[] { dragon, odell, belgium, equinox };

    var gexf = new GexfDocument();
    gexf.Meta.LastModified = DateTimeOffset.Now;
    gexf.Meta.Creator = Environment.UserName;

    gexf.Graph.IdType = GexfIdType.Integer;

    GexfId lat = "lat";
    GexfId lon = "lon";

    gexf.Graph.NodeAttributes.AddRange(
        new GexfAttribute(lat, "latitude", GexfDataType.Double),
        new GexfAttribute(lon, "longitude", GexfDataType.Double)
        );

    gexf.Graph.Nodes.AddRange(locations.Select(location =>
        new GexfNode(location.Id)
        {
            Label = location.Label,
            AttrValues =
            {
                new GexfAttributeValue(lat, location.Lat),
                new GexfAttributeValue(lon, location.Lon)
            }
        }));

    gexf.Graph.Edges.AddRange(
        new GexfEdge(1, dragon.Id, odell.Id),
        new GexfEdge(2, odell.Id, belgium.Id),
        new GexfEdge(3, belgium.Id, equinox.Id)
        );

    string path = Path.Combine(
        Environment.GetFolderPath(Environment.SpecialFolder.Desktop),
        "breweries.gexf");

    gexf.Save(path);
}

class Location
{
    public Location(int id, decimal lat, decimal lon, string label)
    {
        Id = id;
        Lat = lat;
        Lon = lon;
        Label = label;
    }

    public int Id { get; }
    public decimal Lat { get; }
    public decimal Lon { get; }
    public string Label { get; }
}

This code generates the following GEXF file:

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<gexf xmlns="http://www.gexf.net/1.2draft" xmlns:viz="http://www.gexf.net/1.2draft/viz" version="1.2">
  <meta lastmodifieddate="2020-01-29">
    <creator>you</creator>
  </meta>
  <graph idtype="integer">
    <attributes class="node">
      <attribute id="lat" title="latitude" type="double" />
      <attribute id="lon" title="longitude" type="double" />
    </attributes>
    <nodes count="4">
      <node id="1" label="Horse &amp; Dragon Brewing Company">
        <attvalues>
          <attvalue for="lat" value="40.589649" />
          <attvalue for="lon" value="-105.045624" />
        </attvalues>
      </node>
      <node id="2" label="Odell Brewing Company">
        <attvalues>
          <attvalue for="lat" value="40.589476" />
          <attvalue for="lon" value="-105.063186" />
        </attvalues>
      </node>
      <node id="3" label="New Belgium Brewing Company">
        <attvalues>
          <attvalue for="lat" value="40.593238" />
          <attvalue for="lon" value="-105.068600" />
        </attvalues>
      </node>
      <node id="4" label="Equinox Brewing">
        <attvalues>
          <attvalue for="lat" value="40.586356" />
          <attvalue for="lon" value="-105.075812" />
        </attvalues>
      </node>
    </nodes>
    <edges count="3">
      <edge id="1" source="1" target="2" />
      <edge id="2" source="2" target="3" />
      <edge id="3" source="3" target="4" />
    </edges>
  </graph>
</gexf>

Change Log

The change log is available here.

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 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. 
.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
1.0.2 123 2 months ago
1.0.1 86 2 months ago
1.0.0 15,243 10/8/2021
0.2.1 612 1/30/2020
0.2.0 607 1/26/2020
0.1.1 540 1/9/2020
0.1.0 529 12/27/2019