Title: Improve usability from C# · Issue #52 · plotly/Plotly.NET · GitHub
Open Graph Title: Improve usability from C# · Issue #52 · plotly/Plotly.NET
X Title: Improve usability from C# · Issue #52 · plotly/Plotly.NET
Description: 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 t...
Open Graph Description: 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 iss...
X Description: 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 iss...
Opengraph URL: https://github.com/plotly/Plotly.NET/issues/52
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Improve usability from C#","articleBody":"### Description\r\n\r\nThere were already reports regarding problems using Plotly.NET from C#, e.g. #29 . \r\n\r\nProblems regarding the translation of F# options into C# have been fixed, however there are 2 main issues left:\r\n- [x] Extension methods defined in the `ChartExtensions` module do not works as intended. This can be fixed using the `[\u003cSystem.Runtime.CompilerServices.Extension\u003e]` atttribute for those methods, making it possible to call the methods on chart instances in C#, e.g \r\n\r\n ```F#\r\n myChart |\u003e Chart.Show\r\n ```\r\n will in C# be \r\n ```C#\r\n myChart.Show()\r\n ```\r\n \r\n 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.\r\n\r\n implemented via members of `GenericChart` via c1ed1be0234a4fcfab921acb43f1c0cf128cc233\r\n\r\n- [ ] Generic types are easier to use in F#. Consider the following F# example:\r\n\r\n ```F#\r\n Chart.Point(data,Color=\"#ffffff\")\r\n ```\r\n 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 second `string` annotation). :\r\n\r\n ```C#\r\n var chart = Chart.Point\u003cdouble, double, string, string\u003e(data, Color: \"#ffffff\");\r\n\r\n //This is what you should be able to do:\r\n var chart = Chart.Point\u003cdouble, double, string\u003e(data, Color: \"#ffffff\");\r\n\r\n ```\r\n\r\n I see no solution for that other than adding type annotations to the respective parameters extensively.\r\n\r\nHowever, 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.","author":{"url":"https://github.com/kMutagene","@type":"Person","name":"kMutagene"},"datePublished":"2020-09-15T12:30:22.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/52/Plotly.NET/issues/52"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:0cb8ae82-7744-f389-8f14-e3e31e6029c2 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C732:14B4F3:19FFC93:219A206:698FE397 |
| html-safe-nonce | 36122ae1bf1c27bad8f632520f1a049e565a2b2d9d1eb8a86d0afff0dabfbdd4 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNzMyOjE0QjRGMzoxOUZGQzkzOjIxOUEyMDY6Njk4RkUzOTciLCJ2aXNpdG9yX2lkIjoiODc0NjkwOTc4NTgwOTQ3ODU1MSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 5a7d73874e11f458b0e3217ee0a1d19cf323dffab25cbdc7af0a974f1f6fa786 |
| hovercard-subject-tag | issue:701888561 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/plotly/Plotly.NET/52/issue_layout |
| twitter:image | https://opengraph.githubassets.com/c089e2d49a0c80fb9ca1c6889d19a309cf5adca04a02b7c2de2fede796ece339/plotly/Plotly.NET/issues/52 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/c089e2d49a0c80fb9ca1c6889d19a309cf5adca04a02b7c2de2fede796ece339/plotly/Plotly.NET/issues/52 |
| og:image:alt | 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 iss... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | kMutagene |
| hostname | github.com |
| expected-hostname | github.com |
| None | 42c603b9d642c4a9065a51770f75e5e27132fef0e858607f5c9cb7e422831a7b |
| turbo-cache-control | no-preview |
| go-import | github.com/plotly/Plotly.NET git https://github.com/plotly/Plotly.NET.git |
| octolytics-dimension-user_id | 5997976 |
| octolytics-dimension-user_login | plotly |
| octolytics-dimension-repository_id | 58708375 |
| octolytics-dimension-repository_nwo | plotly/Plotly.NET |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 58708375 |
| octolytics-dimension-repository_network_root_nwo | plotly/Plotly.NET |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 3b33c5aedc9808f45bc5fcf0b1e4404cf749dac7 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width