fslaborg / Cytoscape.NET

.NET interface for Cytoscape.js written in F#
http://fslab.org/Cytoscape.NET/
MIT License
45 stars 5 forks source link

with* methods not visible when calling from C# #1

Closed Haapavuo closed 3 years ago

Haapavuo commented 3 years ago

Hi. I have a ASP.NET 5.0 application that uses Razor Pages and C#. I want to generate a Cytoscape graph in the backend.

It seems to be possible to do this:

public string GraphHTML { get; set; }

public void OnGet()
{
    var graph = CyGraph.initEmpty();
    graph.AddElement(Elements.node("n1", new FSharpList<CyParam.CyStyleParam>(CyParam.label("TEST 1"), FSharpList<CyParam.CyStyleParam>.Empty)));
    graph.AddElement(Elements.node("n2", new FSharpList<CyParam.CyStyleParam>(CyParam.label("TEST 2"), FSharpList<CyParam.CyStyleParam>.Empty)));
    graph.AddElement(Elements.edge("e1", "n1", "n2", FSharpList<CyParam.CyStyleParam>.Empty));
    GraphHTML = HTML.toCytoHTML(graph);
}

However, I am unable to call withSize() or any other with* methods on the graph. This must be something F# specific that I am not familiar with. Any ideas on how to approach this? Thank you.

Haapavuo commented 3 years ago

Seems like all the with* methods are static and can be accessed by passing an existing Cytoscape graph instance to those.