Improve usability from C# #52
Labels
Area: MissingAbstraction
Plotly.js functionality that has to be implemented
Priority: Critical
Status: In Progress
Type: Enhancement
Description
There were already reports regarding problems using Plotly.NET from C#, e.g. #29 .
Problems regarding the translation of F# options into C# have been fixed, however there are 2 main issues left:
Extension methods defined in the
ChartExtensions
module do not works as intended. This can be fixed using the[<System.Runtime.CompilerServices.Extension>]
atttribute for those methods, making it possible to call the methods on chart instances in C#, e.gmyChart |> Chart.Show
will in C# be
The extension method must have the Chart as first parameter though, so overloads for all fitting methods are necessary. Additionally,
using static ChartExtensions
already works.implemented via members of
GenericChart
via c1ed1beGeneric types are easier to use in F#. Consider the following F# example:
In this case, Color is not typed in the Chart.Point function, and is infered as generic
'a1
. This is not the case in C#, where you must annotate it (the secondstring
annotation). :I see no solution for that other than adding type annotations to the respective parameters extensively.
However, when these issues are taken care of, from my limited usage of C# it seems like we can reach comfortable usage in that language with these features added.
The text was updated successfully, but these errors were encountered: