Plotly.NET icon indicating copy to clipboard operation
Plotly.NET copied to clipboard

[C#] Plotly.NET.CSharp Roadmap

Open kMutagene opened this issue 4 years ago • 21 comments

This issue tracks the roadmap for the native C# package Plotly.NET.CSharp

Plans on how to design and develop the C# API have been laid out and tracked in #285 and #322.

The general roadmap implementation-wise is the following:

  • [x] 1. C# bindings for the high-level Chart construction API (#296), one binding per chart at first (no overloads)
  • [ ] 2. C# GenericChart Extension methods (this covers more or less all styling functions). Once these are finished, the F# extension methods for fluent interface can be removed.
  • [ ] 3. C# bindings for Object abstractions (TraceObjects, LayoutObjects, etc.) this might be a bit tricky

kMutagene avatar Aug 23 '22 15:08 kMutagene

Please update us, I ask ChatGPT to provide me useful links for Plotly.NET C# notebook examples.

Please take a closer look on ChatGPT and it's limitations, especially regarding the years of origin of it's training dataset and compare that to the year the C# bindings lib was released.

The only one that works are in the unit tests, which are limiting in scope

Plotly.NET.CSharp is already released on nuget. Any chart you create with it works in a notebook. If you cannot give me links to notebooks "not working" i cannot help you further.

This is an open source project. If you need C# notebook samples, there is no one stopping you from contributing.

That being said, for a direct pointer at some C# notebooks that use Plotly.NET.CSharp, take a look at the ML.NET sample books: https://github.com/dotnet/csharp-notebooks/tree/main/machine-learning

kMutagene avatar Mar 14 '23 09:03 kMutagene

Nothing here talks about ==> Plotly.NET.CSharp

Please read the title of this very issue you just posted on.

kMutagene avatar Mar 14 '23 09:03 kMutagene

  1. 11 are closed.

kMutagene avatar Mar 14 '23 09:03 kMutagene

After going through many issues here, I started to piece together, what will work and what will not work.

If that is the case, feel free to contribute a notebook that contains the things that work.

Am I wrong to assume this project [https://plotly.com/csharp/] is not related to this?

That site uses the base library Plotly.NET. Plotly.NET.CSharp is a native C# API on top of that. You can still use base Plotly.NET in C#, but the native bindings are idiomatic C#. All of this information is contained in both the Readme and Docs of this library.

kMutagene avatar Mar 14 '23 09:03 kMutagene

In general however i can see that confusion is coming from the docs on plotly.com being old. See for example https://github.com/plotly/Plotly.NET/issues/356

kMutagene avatar Mar 14 '23 09:03 kMutagene

It is indeed a problem for newbies who had experience in Plotly before. Their first stop shall be the official doc from Plotly, not searching prior issues here on GitHub. It is just a big obstacle for onboarding .Net users of Plotly.

Hope the official doc architecture at Plotly can be improved. Otherwise, the capital and time invested in .Net adoption of Plotly might be wasted. @jackparmer. It is like a last-mile problem to me.

zyzhu avatar Mar 14 '23 14:03 zyzhu

I agree about the notebook. Microsoft's doc team shall consider contributing time to add more C# notebooks. F# community has coped with a decade of using C# only samples and docs to work around edgy issues in F#.

The F# community is small and engaging. But you cannot expect to put too much extra burden for them to add more C# resources. It needs broader help from the C# community. though they are under the same umbrella of .Net.

What I'm talking about is the investment from Plotly in this library. The official document on its website is still using a preview package and not showing examples of using Plotly.NET.CSharp yet. That is a pity as the engagement is missing the last piece to complete the picture.

zyzhu avatar Mar 14 '23 16:03 zyzhu

not showing examples of using Plotly.NET.CSharp yet.

Without digging further, I thought Plotly.NET is strictly F#

That’s such a weird comment TBH. The name .Net means it’s for all languages under .Net. Following your logic, F# community should consider 99% of .Net libraries are strictly C# simply because the examples or docs are in C#?

zyzhu avatar Mar 15 '23 04:03 zyzhu

I am investigating how to update the docs on the official page and moving completely to those docs eventually, including C# versions of the samples.

However, i still want to comment on your general attitude here @GeorgeS2019.

Comments like this

not showing examples of using Plotly.NET.CSharp yet.

Without digging further, I thought Plotly.NET is strictly F#

this

In short, the pieces of information NEEDED for a QUICK Start in c# REMAINS missing

and this

There are ONLY 4 issues labelled with csharp. It is like finding a needle in an ocean!

In combination with repeatedly ignoring me asking for further information or contributions reflect a certain demanding attitude i find rather reprehensive to show in an open source project that is maintained and provided to you completely free of charge. Just note that i investigate this issue despite this attitude, not because of it. Please rethink the way you interact with OSS maintainers in the future.

kMutagene avatar Mar 15 '23 08:03 kMutagene

@zyzhu

It is like a last-mile problem to me.

Absolutely, but it is still quite a lot of work porting and maintaining official samples, and now additionally for C# as well. Even after understanding how the whole process works. See #376 for a more in-depth explanation on the current status

Despite that, this library has seen quite some growth and adoption, also in the C# space with ML.NET using it for their sample notebooks and model builder for example. The additional weight of maintaining and improving the C# bindings is however becoming visible, meaning this will just need some time, especially if i am the only one to do it.

kMutagene avatar Mar 15 '23 08:03 kMutagene

@kMutagene

We just need ONE SMALL START!

A proper place within this github.

Plotly.NET/publication/example_charts/

Separate F# and C# examples

publication)/example_charts/FSharp publication)/example_charts/CSharp=> here you just need ONE simple example and state that community help is needed to port the F# notebooks to c# notebooks

OR

Plotly.NET/docs/

Separate F# and C# examples

Plotly.NET)/doc/FSharp folder for F# notebooks Plotly.NET)/doc/CSharp folder for c# notebooks => here you just need ONE simple example and state that community help is needed to port the F# notebooks to c# notebooks

GeorgeS2019 avatar Mar 15 '23 12:03 GeorgeS2019

@GeorgeS2019 You severely underestimate how hard it is to get content on the official plotly site. Putting it in this repo will not help with the samples you saw being outdated.

However, while I am working on that, my latest blog post might help you out, it contains both F# and C# code for the same graphs, so it might also help you translating F# sample sin the future (you can select the language on the top of the page): https://fslab.org/blog/graph-gallery/scatter/fsharp.html

kMutagene avatar Mar 16 '23 21:03 kMutagene

@kMutagene I have spent a few hours getting familiar with this github and also receiving kind feedback.

The keyword I need is: There is something call Plotly.NET.Csharp in addition to Plotly.NET

That means I need to spend further many many hours preparing myself to learn Poltly.NET.Csharp and ignore all the F# notebooks.

I hate to get into this kind of unfruitful argument. But I have to say your comments severely lack empathy and basic respect to the free open source resources provided here. Don’t forget the author did not owe you any C# documentation as you did not sponsor a penny to the project. Anything provided here are out of courtesy.

If you or your clients are expected to earn profits from using Plotly.Net in their products or research, consider sponsoring the project to show your support for its long-term sustainability https://opencollective.com/fslab. This spirit applies in general to all open source projects.

Based on my understanding, Plotly.Net library was written for F# first and was open sourced. Out of courtesy and benefits for the whole .Net community, a package to be more friendly to C# is written as Plotly.Net.CSharp. But it has little use for the author and his research group. So don’t expect they spend extra time out of their leisure to help you with that front. If you want, either contribute yourself, sponsor it or at least ask nicely.

Just go check the samples of Newtonsoft.Json https://www.newtonsoft.com/json/help/html/SerializeObject.htm. Any sights of F# samples? Following your logic, shouldn’t F# users just give up using Newtonsoft.Json?

Stop acting like a cry baby. Act like a grownup and show basic respect. Sorry and not sorry about my bluntness.

zyzhu avatar Mar 17 '23 01:03 zyzhu

@GeorgeS2019 You severely underestimate how hard it is to get content on the official plotly site. Putting it in this repo will not help with the samples you saw being outdated.

However, while I am working on that, my latest blog post might help you out, it contains both F# and C# code for the same graphs, so it might also help you translating F# sample sin the future (you can select the language on the top of the page): https://fslab.org/blog/graph-gallery/scatter/fsharp.html

Thank you so much for putting in efforts to consolidate two documentation sites into one. Though I like the beauty of fsdocs, having one single official documentation will go a long way for adoption. Hope the guys from Plotly will be helpful in this transition. Not sure whether they have capacity in the current uncertain economy and financial market.

Unfortunately I have little time to spare these days on OSS. I am also stuck with some old XPlot use cases myself internally and haven’t made the transition to Plotly.Net yet. But I will try to contribute to fixing some old docs and submit issues once I use it more often.

zyzhu avatar Mar 17 '23 02:03 zyzhu

@zyzhu @kMutagene

There is no cry baby here.

It is my ignorance that it takes extra community effort to re-purpose F# library for c# usage, though both are .NET

Since c# is integrating more and more functional syntax e.g. c# 11 and future.

I hope in near future, the re-purposing of f# for c# will be less. => the f# and s# syntax will be almost identical

GeorgeS2019 avatar Mar 17 '23 08:03 GeorgeS2019

@zyzhu

I wonder if you have feedback on

WHY we need TWO Nugets:

  • Plotly.NET
  • Plotly.NET.Csharp

given discussions as below

Best approach for designing F# libraries for use from both F# and C#
F# - C# Interop

GeorgeS2019 avatar Mar 23 '23 12:03 GeorgeS2019

The Fundamental motivation of a .NET nuget is that it is written ONCE and accessible to other .NET languages.

There is a need to compromise between PERFECTIONIST adherence to F# (functional superiorities) without compromising the fundamental motivation of a Write ONCE .NET nuget.

GeorgeS2019 avatar Mar 23 '23 12:03 GeorgeS2019

@GeorgeS2019

The reasoning behind having these packages is clearly stated in the first few sentences in the readme. Additionally, it is also stated that you can use the core API in both languages, and it is indeed designed to work that way.

You do not seem to bother to do some basic reading before you go into a project, DEMAND changes and influence on library design that took weeks internally until a common ground was found. Instead, you post a 10-year-old Stack Overflow question, like that would magically solve the issues that we have seen with using the core F# API from C# in the past.

So let me be quite clear here:

Even after me stating that your behavior is unacceptable, you ignored that and even went forward tagging me in other projects like I am your personal code monkey.

From now on, I will ignore you in any issue in any project, until you learn some basic manners. Go on with this behavior, and I will block you entirely.

kMutagene avatar Mar 23 '23 13:03 kMutagene

Closing this issue and opening a new one since this got off-topic real hard.

kMutagene avatar Mar 23 '23 13:03 kMutagene

@kMutagene

I ended up using this https://github.com/ScottPlot/ScottPlot - very intuitive to use. I would have wished all the hard work go into Plotly.NET could be intuitively used by c# community without having TWO separate nugets (F# and c#) and AT THE SAME TIME lacking sufficient c# documentation.

GeorgeS2019 avatar Mar 23 '23 13:03 GeorgeS2019