Skip to content

Commit 17fd1ae

Browse files
committed
Fix and update index docs page
1 parent 68f1e40 commit 17fd1ae

File tree

2 files changed

+43
-29
lines changed

2 files changed

+43
-29
lines changed

docs/index.fsx

+30-27
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
(*** condition: prepare ***)
44
#r "nuget: Newtonsoft.JSON, 13.0.1"
55
#r "nuget: DynamicObj, 1.0.1"
6-
#r "../bin/Plotly.NET/netstandard2.0/Plotly.NET.dll"
6+
#I "../src/Plotly.NET/bin/Release/netstandard2.0"
7+
#r "Plotly.NET.dll"
78

89
(*** condition: ipynb ***)
910
#if IPYNB
@@ -41,13 +42,13 @@ Plotly.NET provides functions for generating and rendering plotly.js charts in *
4142
4243
# Installation
4344
44-
Plotly.NET will be available as 2.0.0 version of its predecessor FSharp.Plotly. The feature roadmap can be seen [here](https://github.com/plotly/Plotly.NET/issues/43). Contributions are very welcome!
45+
Plotly.NET is the 2.0.0+ version of its predecessor FSharp.Plotly.
4546
46-
Old packages up until version 1.2.2 can be accessed via the old package name *FSharp.Plotly* [here](https://www.nuget.org/packages/FSharp.Plotly/)
47+
If needed, old packages up until version 1.2.2 can be accessed via the old package name *FSharp.Plotly* [here](https://www.nuget.org/packages/FSharp.Plotly/)
4748
4849
### For applications and libraries
4950
50-
A preview version of Plotly.NET 2.0.0 is available on nuget to plug into your favorite package manager.
51+
Plotly.NET is available on nuget to plug into your favorite package manager.
5152
5253
You can find all available package versions on the [nuget page](https://www.nuget.org/packages/Plotly.NET/).
5354
@@ -85,7 +86,7 @@ You can include the package via an inline package reference:
8586
8687
### For dotnet interactive notebooks
8788
88-
You can use the same inline package reference as in script, but as an additional goodie,
89+
You can use the same inline package reference as in scripts, but as an additional goodie
8990
the interactive extensions for dotnet interactive have you covered for seamless chart rendering:
9091
9192
```
@@ -110,7 +111,7 @@ A possible fix for this is the inclusion of Dotnet.Interactive preview package s
110111
111112
## Basics
112113
113-
The general design philosophy of Plotly.NET implements the following visualization flow:
114+
The general, high-level API of Plotly.NET implements the following visualization flow:
114115
115116
- **initialize** a `GenericChart` object from the data you want to visualize by using the respective `Chart.*` function, optionally setting some specific style parameters
116117
- further **style** the chart with fine-grained control, e.g. by setting axis titles, tick intervals, etc.
@@ -147,8 +148,8 @@ Styling functions are generally the `Chart.with*` naming convention. The followi
147148
let myFirstStyledChart =
148149
Chart.Point(xData,yData)
149150
|> Chart.withTitle "Hello world!"
150-
|> Chart.withXAxisStyle ("xAxis", ShowGrid=false)
151-
|> Chart.withYAxisStyle ("yAxis", ShowGrid=false)
151+
|> Chart.withXAxisStyle ("xAxis")
152+
|> Chart.withYAxisStyle ("yAxis")
152153

153154
(**
154155
**Attention:** Styling functions mutate 😈 the input chart, therefore possibly affecting bindings to intermediary results.
@@ -197,8 +198,8 @@ Chart.Point(xData',yData')
197198

198199
Chart.Point(xData,yData)
199200
|> Chart.withTitle "Hello world!"
200-
|> Chart.withXAxisStyle ("xAxis", ShowGrid=false)
201-
|> Chart.withYAxisStyle ("yAxis", ShowGrid=false)
201+
|> Chart.withXAxisStyle ("xAxis")
202+
|> Chart.withYAxisStyle ("yAxis")
202203

203204

204205
(**
@@ -211,19 +212,20 @@ One of the main design points of Plotly.NET it is to provide support for multipl
211212

212213
[(1,5);(2,10)]
213214
|> Chart.Point
214-
|> Chart.withTraceInfo("Hello from F#",ShowLegend=true)
215-
|> Chart.withYAxisStyle("xAxis",ShowGrid= false, ShowLine=true)
216-
|> Chart.withXAxisStyle("yAxis",ShowGrid= false, ShowLine=true)
215+
|> Chart.withTraceInfo(Name = "Hello from F#")
216+
|> Chart.withYAxisStyle(TitleText = "xAxis")
217+
|> Chart.withXAxisStyle(TitleText = "yAxis")
217218

218219
(**
219220
### Fluent interface style in C#:
220221
221-
```
222+
```csharp
222223
using System;
223224
using Plotly.NET;
224225
using Microsoft.FSharp.Core; // use this for less verbose and more helpful intellisense
226+
using Plotly.NET.LayoutObjects;
225227
226-
namespace Plotly.NET.Tests.CSharp
228+
namespace Plotly.NET.Tests.CSharpConsole
227229
{
228230
class Program
229231
{
@@ -233,17 +235,18 @@ namespace Plotly.NET.Tests.CSharp
233235
double[] y = new double[] { 5, 10 };
234236
GenericChart.GenericChart chart = Chart2D.Chart.Point<double, double, string>(x: x, y: y);
235237
chart
236-
.WithTraceName("Hello from C#", true)
237-
.WithXAxisStyle(title: Title.init("xAxis"), ShowGrid: false, ShowLine: true)
238-
.WithYAxisStyle(title: Title.init("yAxis"), ShowGrid: false, ShowLine: true)
238+
.WithTraceInfo("Hello from C#", ShowLegend: true)
239+
.WithXAxisStyle(title: Title.init("xAxis"))
240+
.WithYAxisStyle(title: Title.init("yAxis"))
239241
.Show();
240242
}
241243
}
242244
}
243-
244245
```
245246
246247
### Declarative style in F# using the underlying `DynamicObj`:
248+
249+
This API is the most low-level and closest to the original plotly.js syntax. Make sure to spell dynamic members exactly as they are used in the plotly.js json schema.
247250
*)
248251

249252
open Plotly.NET.LayoutObjects
@@ -283,13 +286,13 @@ GenericChart.ofTraceObject true trace
283286
(**
284287
### Declarative style in C# using the underlying `DynamicObj`:
285288
286-
```
289+
```csharp
287290
using System;
288291
using Plotly.NET;
289292
using Microsoft.FSharp.Core; // use this for less verbose and more helpful intellisense
290293
using Plotly.NET.LayoutObjects;
291294
292-
namespace Plotly.NET.Tests.CSharp
295+
namespace Plotly.NET.Tests.CSharpConsole
293296
{
294297
class Program
295298
{
@@ -320,7 +323,7 @@ namespace Plotly.NET.Tests.CSharp
320323
trace.SetValue("name", "Hello from C#");
321324
322325
GenericChart
323-
.ofTraceObject(trace)
326+
.ofTraceObject(true, trace)
324327
.WithLayout(layout)
325328
.Show();
326329
}
@@ -332,16 +335,16 @@ namespace Plotly.NET.Tests.CSharp
332335
333336
The project is hosted on [GitHub][gh] where you can [report issues][issues], fork
334337
the project and submit pull requests. If you're adding a new public API, please also
335-
consider adding [samples][content] that can be turned into a documentation. You might
338+
consider adding [samples][docs] that can be turned into a documentation. You might
336339
also want to read the [library design notes][readme] to understand how it works.
337340
338-
The library is available under Public Domain license, which allows modification and
341+
The library is available under the OSI-approved MIT license, which allows modification and
339342
redistribution for both commercial and non-commercial purposes. For more information see the
340343
[License file][license] in the GitHub repository.
341344
342-
[content]: https://github.com/plotly/Plotly.NET/tree/master/docs/content
345+
[docs]: https://github.com/plotly/Plotly.NET/tree/dev/docs
343346
[gh]: https://github.com/plotly/Plotly.NET
344347
[issues]: https://github.com/plotly/Plotly.NET/issues
345-
[readme]: https://github.com/plotly/Plotly.NET/blob/master/README.md
346-
[license]: https://github.com/plotly/Plotly.NET/blob/master/LICENSE.txt
348+
[readme]: https://github.com/plotly/Plotly.NET/blob/dev/README.md
349+
[license]: https://github.com/plotly/Plotly.NET/blob/dev/LICENSE
347350
*)

tests/Plotly.NET.Tests.CSharpConsole/Program.cs

+13-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
using Microsoft.FSharp.Core; // use this for less verbose and more helpful intellisense
44
using Plotly.NET.LayoutObjects;
55

6-
namespace Plotly.NET.Tests.CSharp
6+
namespace Plotly.NET.Tests.CSharpConsole
77
{
88
class Program
99
{
@@ -34,9 +34,20 @@ static void Main(string[] args)
3434
trace.SetValue("name", "Hello from C#");
3535

3636
GenericChart
37-
.ofTraceObject(true,trace)
37+
.ofTraceObject(true, trace)
3838
.WithLayout(layout)
3939
.Show();
4040
}
41+
static void Main2(string[] args)
42+
{
43+
double[] x = new double[] { 1, 2 };
44+
double[] y = new double[] { 5, 10 };
45+
GenericChart.GenericChart chart = Chart2D.Chart.Point<double, double, string>(x: x, y: y);
46+
chart
47+
.WithTraceInfo("Hello from C#", ShowLegend: true)
48+
.WithXAxisStyle(title: Title.init("xAxis"))
49+
.WithYAxisStyle(title: Title.init("yAxis"))
50+
.Show();
51+
}
4152
}
4253
}

0 commit comments

Comments
 (0)