plotly/Plotly.NET

Chart descriptions do not work if Cytoscape.NET.Interactive is referenced simultaneously

bvenn opened this issue · 4 comments

bvenn commented

I have no clue if this belongs to Plotly.NET, Cytoscape.NET or both, but if you load both interactive references, ChartDescriptions do not work anymore.

#r "nuget: Plotly.NET, 4.2.0"
#r "nuget: Plotly.NET.Interactive, 4.2.1"
#r "nuget: Cytoscape.NET, 0.2.0"
#r "nuget: Cytoscape.NET.Interactive, 0.2.0"


open Plotly.NET
open Cytoscape.NET

Chart.Point([1,2])
|> Chart.withDescription [Giraffe.ViewEngine.HtmlElements.rawText "Hello"]
typecheck error This expression was expected to have type
'Giraffe.ViewEngine.HtmlElements.XmlNode (Giraffe.ViewEngine.StrongName, Version=2.0.0.0, Culture=neutral, PublicKeyToken=028aa8e2a326f4d0)'
but here has type
'Giraffe.ViewEngine.HtmlElements.XmlNode (Giraffe.ViewEngine, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null)'

For information, if you exclude the first Plotly.NET 4.2.0 reference, it works...

Hi @bvenn,

I just copied your code into a new Polyglot Notebook and it works. Excluding the first line did not change anything.

bvenn commented

@Peter-B- I did the same and the first time it showed the same error. The second time after restarting the kernel it worked just fine. The same pattern occurred when I switched the references to Cytoscape beeing first. I spoke to @kMutagene on the conference and he already had an idea what happened.

@kMutagene feel free closing this issue if the issue just affects my local setup

I find it weird that it works for you @Peter-B-, because the error makes sense: Plotly.NET and Cytoscape.NET use different view engine packages (Giraffe.ViewEngine.StrongName vs Giraffe.ViewEngine) (i have to fix this for Cytoscape.NET), because Plotly.NET needs to be signed (long story).

Cytoscape.NET only uses the engine internally, while Plotly.NET actually allows you to use the ViewEngine html dsl for chart description. It could be possible for type inference to know which assembly to use, but when one shadows the other as the functions are named exactly the same, i would expect this error to occur. So i would guess @bvenn if you reverse the dependencies (loading cytoscape first, then plotly) it should work

Closing this as there is not much we can do when libraries use incompatible transient dependencies.