https://github.com/curiosity-ai/plotly-sharp
Auto-generated plotly.js bindings for C#
https://github.com/curiosity-ai/plotly-sharp
bridge-dot csharp dotnet dotnetcore javascript netcore plotly
Last synced: 5 months ago
JSON representation
Auto-generated plotly.js bindings for C#
- Host: GitHub
- URL: https://github.com/curiosity-ai/plotly-sharp
- Owner: curiosity-ai
- License: mit
- Created: 2019-11-13T13:46:46.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2025-09-30T10:13:34.000Z (8 months ago)
- Last Synced: 2025-09-30T11:36:15.562Z (8 months ago)
- Topics: bridge-dot, csharp, dotnet, dotnetcore, javascript, netcore, plotly
- Language: C#
- Homepage:
- Size: 5.21 MB
- Stars: 17
- Watchers: 5
- Forks: 1
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://dev.azure.com/curiosity-ai/mosaik/_build/latest?definitionId=19&branchName=master)

_**Plotly.Sharp**_ provides a strongly-typed binding to generate embedded HTML using [Plotly](https://plot.ly/javascript/).
[](https://www.nuget.org/packages/Plotly.Sharp)
_**Plotly.Bridge**_ provides a strongly-typed binding to use [Plotly](https://plot.ly/javascript/) on [Bridge.Net](https://github.com/bridgedotnet/Bridge) applications.
[](https://www.nuget.org/packages/Plotly.Bridge)
Both libraries are automatically generated from the official [plotly.js API schema](https://raw.githubusercontent.com/plotly/plotly.js/master/dist/plot-schema.json), and includes the respective plotly.min.js file as part of the Nuget package.
Example:
```csharp
var data = new[]{
new []{ 1f, 20f, 30f },
new []{20f, 1f, 60f },
new []{30f, 60f, 1f }
};
//Or use the shortcut:
// var data = data.m( 1f, 20f, 30f)
// .r(20f, 1f, 60f)
// .r(30f, 60f, 1f);
var chart = new Plot(
Plot.traces(
Traces.heatmap(
Heatmap.z(data))));
//For Plotly.Bridge, you can directly render the chart to an HTMLElement:
document.body.appendChild(chart.Render());
//For Plotly.Sharp, you can create the embedded HTML string as follows:
var html = chart.Render().ToHTML();
```
You can follow the official [documentation](https://plot.ly/javascript/) from Plotly, as the types and usage are almost exactly the same (one minor but **important change**: some of the objects on C# have the first letter in upper-case (like Traces.heatmap on the example above).
*Note*: Event types have been manually created, and have not been all validated against plotly's events. If you find any definition that doesn't match the expected one from plotly, please open an issue for it!
This project is derived from the awesome work by [Cody Johnson](https://github.com/Shmew) on the [F# bindings](https://github.com/Shmew/Feliz.Plotly/).