-
Notifications
You must be signed in to change notification settings - Fork 308
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Question] Basic Graph with SvgGraphWriter #248
Comments
`open System [] edge.SourceNode.Attr.Shape <- Shape.DrawFromGeometry; This seems working, but more code needed to create the label. Usually the viewers take care of filling the geometry. [s.svg.txt](https://github.com/microsoft/automatic-graph-layout/files/4973721/s.svg.txt) |
Ahhhh! Ok this makes sense now, a little hand-raulic but that's ok! Thank
you!
…On Sat, 25 Jul 2020, 3:52 am Lev Nachmanson, ***@***.***> wrote:
`open System
open Microsoft.Msagl.Drawing
open Microsoft.Msagl.Layout.Layered
open Microsoft.Msagl.Core.Geometry
[]
let main argv =
let graph = new Graph("Test")
let mutable edge = graph.AddEdge("a", "a to b", "b")
graph.CreateGeometryGraph() // otherwise NRE in
SvgGraphWriter.TransformGraphByFlippingY
edge.SourceNode.Attr.Shape <- Shape.DrawFromGeometry;
edge.TargetNode.Attr.Shape <- Shape.DrawFromGeometry;
edge.GeometryEdge.Source.BoundaryCurve <-
Microsoft.Msagl.Core.Geometry.Curves.CurveFactory.CreateCircle(10.0, new
Point())
edge.TargetNode.GeometryNode.BoundaryCurve <-
Microsoft.Msagl.Core.Geometry.Curves.CurveFactory.CreateCircle(10., new
Point())
use stream = new System.IO.StreamWriter(@"c:\tmp\s.svg", false)
let layout = new LayeredLayout(graph.GeometryGraph, new
SugiyamaLayoutSettings())
layout.Run();
let svgWriter = new SvgGraphWriter(stream.BaseStream, graph)
svgWriter.Write()
0
`
This seem working, but more code needed to create the label. Usually the
viewers take care of filling the geometry.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#248 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AMAM73EN4EMEGOX6HLF4YA3R5HC5BANCNFSM4PGL2HTQ>
.
|
I am trying to create the simplest possible SVG rendering of a graph, using a single edge with two nodes, I have been reading sample code for the last hour, and hitting walls. Was hoping that some guidance could be provided.
This generates the following exception when svgWriter.Write() is called:
The text was updated successfully, but these errors were encountered: