diff --git a/.github/workflows/build-and-deploy-docs.yml b/.github/workflows/build-and-deploy-docs.yml index 3b7ebd801..217ef3e7c 100644 --- a/.github/workflows/build-and-deploy-docs.yml +++ b/.github/workflows/build-and-deploy-docs.yml @@ -1,8 +1,6 @@ name: build and deploy docs -on: - push: - branches: [ dev ] +on: workflow_dispatch jobs: build-and-deploy-docs: @@ -14,7 +12,7 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@v1 with: - dotnet-version: 5.0.100 + dotnet-version: '5.0.201' - name: Restore tools run: dotnet tool restore - name: Build docs diff --git a/Plotly.NET.sln b/Plotly.NET.sln index 2849e1987..ba7fa9ca6 100644 --- a/Plotly.NET.sln +++ b/Plotly.NET.sln @@ -32,15 +32,68 @@ EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".ci", ".ci", "{2461AFBF-6E10-4F7B-A0EA-3D62541C2EB1}" ProjectSection(SolutionItems) = preProject .github\workflows\build-and-deploy-docs.yml = .github\workflows\build-and-deploy-docs.yml - .circleci\config.yml = .circleci\config.yml + .github\workflows\build-and-test.yml = .github\workflows\build-and-test.yml + .github\workflows\verify-docs.yml = .github\workflows\verify-docs.yml EndProjectSection EndProject Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Plotly.NET.Interactive", "src\Plotly.NET.Interactive\Plotly.NET.Interactive.fsproj", "{0F135E3B-B0E1-42A9-B180-18C0221DC7B8}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "docs", "docs", "{7B09CC0A-F1E1-4094-9DE4-B047581E01F0}" ProjectSection(SolutionItems) = preProject + docs\00_0_basics.fsx = docs\00_0_basics.fsx + docs\00_1_image-export.fsx = docs\00_1_image-export.fsx + docs\00_2_display-options.fsx = docs\00_2_display-options.fsx + docs\00_3_chart-config.fsx = docs\00_3_chart-config.fsx + docs\01_0_axis-styling.fsx = docs\01_0_axis-styling.fsx + docs\01_1_errorbars.fsx = docs\01_1_errorbars.fsx + docs\01_2_multiple-charts.fsx = docs\01_2_multiple-charts.fsx + docs\01_3_shapes.fsx = docs\01_3_shapes.fsx + docs\01_4_annotations.fsx = docs\01_4_annotations.fsx + docs\02_0_line-scatter-plots.fsx = docs\02_0_line-scatter-plots.fsx + docs\02_1_bar-and-column-charts.fsx = docs\02_1_bar-and-column-charts.fsx + docs\02_2_area-plots.fsx = docs\02_2_area-plots.fsx + docs\02_3_range-plots.fsx = docs\02_3_range-plots.fsx + docs\02_4_bubble-charts.fsx = docs\02_4_bubble-charts.fsx + docs\02_5_pie-doughnut-charts.fsx = docs\02_5_pie-doughnut-charts.fsx + docs\02_6_table.fsx = docs\02_6_table.fsx + docs\02_7_heatmaps.fsx = docs\02_7_heatmaps.fsx + docs\03_0_3d-scatter-plots.fsx = docs\03_0_3d-scatter-plots.fsx + docs\03_1_3d-surface-plots.fsx = docs\03_1_3d-surface-plots.fsx + docs\03_2_3d-mesh-plots.fsx = docs\03_2_3d-mesh-plots.fsx + docs\03_3_3d-cone-charts.fsx = docs\03_3_3d-cone-charts.fsx + docs\03_4_3d-streamtube-plots.fsx = docs\03_4_3d-streamtube-plots.fsx + docs\03_5_3d-volume-plots.fsx = docs\03_5_3d-volume-plots.fsx + docs\03_6_3d-isosurface-plots .fsx = docs\03_6_3d-isosurface-plots .fsx + docs\04_0_histograms.fsx = docs\04_0_histograms.fsx + docs\04_1_box-plots.fsx = docs\04_1_box-plots.fsx + docs\04_2_violin-plots.fsx = docs\04_2_violin-plots.fsx + docs\04_3_contour-plots.fsx = docs\04_3_contour-plots.fsx + docs\04_4_2d-histograms.fsx = docs\04_4_2d-histograms.fsx + docs\04_5_splom.fsx = docs\04_5_splom.fsx + docs\05_0_geo-vs-mapbox.fsx = docs\05_0_geo-vs-mapbox.fsx + docs\05_1_geo-plots.fsx = docs\05_1_geo-plots.fsx + docs\05_2_choropleth-map.fsx = docs\05_2_choropleth-map.fsx + docs\06_0_geo-vs-mapbox.fsx = docs\06_0_geo-vs-mapbox.fsx + docs\06_1_mapbox-plots.fsx = docs\06_1_mapbox-plots.fsx + docs\06_2_choropleth-mapbox.fsx = docs\06_2_choropleth-mapbox.fsx + docs\06_3_density-mapbox.fsx = docs\06_3_density-mapbox.fsx + docs\07_0_candlestick.fsx = docs\07_0_candlestick.fsx + docs\07_1_funnel.fsx = docs\07_1_funnel.fsx + docs\07_2_funnel_area.fsx = docs\07_2_funnel_area.fsx + docs\08_0_polar_line-scatter-plots.fsx = docs\08_0_polar_line-scatter-plots.fsx + docs\08_1_polar_bar_charts.fsx = docs\08_1_polar_bar_charts.fsx + docs\08_2_styling_polar_layouts.fsx = docs\08_2_styling_polar_layouts.fsx + docs\09_0_parallel-categories.fsx = docs\09_0_parallel-categories.fsx + docs\09_1_parallel-coords.fsx = docs\09_1_parallel-coords.fsx + docs\09_2_sankey.fsx = docs\09_2_sankey.fsx + docs\10_0_ternary_line_scatter_plots.fsx = docs\10_0_ternary_line_scatter_plots.fsx + docs\10_1_styling_ternary_layouts.fsx = docs\10_1_styling_ternary_layouts.fsx + docs\_template.fsx = docs\_template.fsx docs\_template.html = docs\_template.html + docs\_template.ipynb = docs\_template.ipynb + docs\Dockerfile = docs\Dockerfile docs\index.fsx = docs\index.fsx + docs\NuGet.config = docs\NuGet.config EndProjectSection EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "reference", "reference", "{5219BAC7-ACE6-435F-A983-BC63DD7B745E}" @@ -50,58 +103,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "reference", "reference", "{ EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "content", "content", "{60FB82C0-F472-494E-BCF7-7B3C54212406}" ProjectSection(SolutionItems) = preProject - docs\0_0_basics.fsx = docs\0_0_basics.fsx - docs\0_1_image-export.fsx = docs\0_1_image-export.fsx - docs\0_2_display-options.fsx = docs\0_2_display-options.fsx - docs\0_3_chart-config.fsx = docs\0_3_chart-config.fsx - docs\1_0_axis-styling.fsx = docs\1_0_axis-styling.fsx - docs\1_1_errorbars.fsx = docs\1_1_errorbars.fsx - docs\1_2_multiple-charts.fsx = docs\1_2_multiple-charts.fsx - docs\1_3_shapes.fsx = docs\1_3_shapes.fsx - docs\1_4_annotations.fsx = docs\1_4_annotations.fsx - docs\2_0_line-scatter-plots.fsx = docs\2_0_line-scatter-plots.fsx - docs\2_1_bar-and-column-charts.fsx = docs\2_1_bar-and-column-charts.fsx - docs\2_2_area-plots.fsx = docs\2_2_area-plots.fsx - docs\2_3_range-plots.fsx = docs\2_3_range-plots.fsx - docs\2_4_bubble-charts.fsx = docs\2_4_bubble-charts.fsx - docs\2_5_pie-doughnut-charts.fsx = docs\2_5_pie-doughnut-charts.fsx - docs\2_6_table.fsx = docs\2_6_table.fsx - docs\2_7_heatmaps.fsx = docs\2_7_heatmaps.fsx - docs\3_0_3d-scatter-plots.fsx = docs\3_0_3d-scatter-plots.fsx - docs\3_1_3d-surface-plots.fsx = docs\3_1_3d-surface-plots.fsx - docs\3_2_3d-mesh-plots.fsx = docs\3_2_3d-mesh-plots.fsx - docs\3_3_3d-cone-charts.fsx = docs\3_3_3d-cone-charts.fsx - docs\3_4_3d-streamtube-plots.fsx = docs\3_4_3d-streamtube-plots.fsx - docs\3_5_3d-volume-plots.fsx = docs\3_5_3d-volume-plots.fsx - docs\3_6_3d-isosurface-plots .fsx = docs\3_6_3d-isosurface-plots .fsx - docs\4_0_histograms.fsx = docs\4_0_histograms.fsx - docs\4_1_box-plots.fsx = docs\4_1_box-plots.fsx - docs\4_2_violin-plots.fsx = docs\4_2_violin-plots.fsx - docs\4_3_contour-plots.fsx = docs\4_3_contour-plots.fsx - docs\4_4_2d-histograms.fsx = docs\4_4_2d-histograms.fsx - docs\4_5_splom.fsx = docs\4_5_splom.fsx - docs\5_0_geo-vs-mapbox.fsx = docs\5_0_geo-vs-mapbox.fsx - docs\5_1_geo-plots.fsx = docs\5_1_geo-plots.fsx - docs\5_2_choropleth-map.fsx = docs\5_2_choropleth-map.fsx - docs\6_0_geo-vs-mapbox.fsx = docs\6_0_geo-vs-mapbox.fsx - docs\6_1_mapbox-plots.fsx = docs\6_1_mapbox-plots.fsx - docs\6_2_choropleth-mapbox.fsx = docs\6_2_choropleth-mapbox.fsx - docs\6_3_density-mapbox.fsx = docs\6_3_density-mapbox.fsx - docs\7_0_candlestick.fsx = docs\7_0_candlestick.fsx - docs\7_1_funnel.fsx = docs\7_1_funnel.fsx - docs\7_2_funnel_area.fsx = docs\7_2_funnel_area.fsx - docs\8_0_polar_line-scatter-plots.fsx = docs\8_0_polar_line-scatter-plots.fsx - docs\8_1_polar_bar_charts.fsx = docs\8_1_polar_bar_charts.fsx - docs\8_2_styling_polar_layouts.fsx = docs\8_2_styling_polar_layouts.fsx - docs\9_0_parallel-categories.fsx = docs\9_0_parallel-categories.fsx - docs\9_1_parallel-coords.fsx = docs\9_1_parallel-coords.fsx - docs\9_2_sankey.fsx = docs\9_2_sankey.fsx - docs\_template.html = docs\_template.html - docs\_template.ipynb = docs\_template.ipynb - docs\Dockerfile = docs\Dockerfile docs\content\fsdocs-custom.css = docs\content\fsdocs-custom.css - docs\index.fsx = docs\index.fsx - docs\NuGet.config = docs\NuGet.config EndProjectSection EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "img", "img", "{CDB973F2-0F60-4ADB-84A8-924AFA8B6D49}" diff --git a/docs/0_0_basics.fsx b/docs/00_0_basics.fsx similarity index 100% rename from docs/0_0_basics.fsx rename to docs/00_0_basics.fsx diff --git a/docs/0_1_image-export.fsx b/docs/00_1_image-export.fsx similarity index 100% rename from docs/0_1_image-export.fsx rename to docs/00_1_image-export.fsx diff --git a/docs/0_2_display-options.fsx b/docs/00_2_display-options.fsx similarity index 100% rename from docs/0_2_display-options.fsx rename to docs/00_2_display-options.fsx diff --git a/docs/0_3_chart-config.fsx b/docs/00_3_chart-config.fsx similarity index 100% rename from docs/0_3_chart-config.fsx rename to docs/00_3_chart-config.fsx diff --git a/docs/1_0_axis-styling.fsx b/docs/01_0_axis-styling.fsx similarity index 100% rename from docs/1_0_axis-styling.fsx rename to docs/01_0_axis-styling.fsx diff --git a/docs/1_1_errorbars.fsx b/docs/01_1_errorbars.fsx similarity index 100% rename from docs/1_1_errorbars.fsx rename to docs/01_1_errorbars.fsx diff --git a/docs/1_2_multiple-charts.fsx b/docs/01_2_multiple-charts.fsx similarity index 100% rename from docs/1_2_multiple-charts.fsx rename to docs/01_2_multiple-charts.fsx diff --git a/docs/1_3_shapes.fsx b/docs/01_3_shapes.fsx similarity index 100% rename from docs/1_3_shapes.fsx rename to docs/01_3_shapes.fsx diff --git a/docs/1_4_annotations.fsx b/docs/01_4_annotations.fsx similarity index 100% rename from docs/1_4_annotations.fsx rename to docs/01_4_annotations.fsx diff --git a/docs/2_0_line-scatter-plots.fsx b/docs/02_0_line-scatter-plots.fsx similarity index 100% rename from docs/2_0_line-scatter-plots.fsx rename to docs/02_0_line-scatter-plots.fsx diff --git a/docs/2_1_bar-and-column-charts.fsx b/docs/02_1_bar-and-column-charts.fsx similarity index 100% rename from docs/2_1_bar-and-column-charts.fsx rename to docs/02_1_bar-and-column-charts.fsx diff --git a/docs/2_2_area-plots.fsx b/docs/02_2_area-plots.fsx similarity index 100% rename from docs/2_2_area-plots.fsx rename to docs/02_2_area-plots.fsx diff --git a/docs/2_3_range-plots.fsx b/docs/02_3_range-plots.fsx similarity index 100% rename from docs/2_3_range-plots.fsx rename to docs/02_3_range-plots.fsx diff --git a/docs/2_4_bubble-charts.fsx b/docs/02_4_bubble-charts.fsx similarity index 100% rename from docs/2_4_bubble-charts.fsx rename to docs/02_4_bubble-charts.fsx diff --git a/docs/2_5_pie-doughnut-charts.fsx b/docs/02_5_pie-doughnut-charts.fsx similarity index 100% rename from docs/2_5_pie-doughnut-charts.fsx rename to docs/02_5_pie-doughnut-charts.fsx diff --git a/docs/2_6_table.fsx b/docs/02_6_table.fsx similarity index 100% rename from docs/2_6_table.fsx rename to docs/02_6_table.fsx diff --git a/docs/2_7_heatmaps.fsx b/docs/02_7_heatmaps.fsx similarity index 100% rename from docs/2_7_heatmaps.fsx rename to docs/02_7_heatmaps.fsx diff --git a/docs/3_0_3d-scatter-plots.fsx b/docs/03_0_3d-scatter-plots.fsx similarity index 100% rename from docs/3_0_3d-scatter-plots.fsx rename to docs/03_0_3d-scatter-plots.fsx diff --git a/docs/3_1_3d-surface-plots.fsx b/docs/03_1_3d-surface-plots.fsx similarity index 100% rename from docs/3_1_3d-surface-plots.fsx rename to docs/03_1_3d-surface-plots.fsx diff --git a/docs/3_2_3d-mesh-plots.fsx b/docs/03_2_3d-mesh-plots.fsx similarity index 100% rename from docs/3_2_3d-mesh-plots.fsx rename to docs/03_2_3d-mesh-plots.fsx diff --git a/docs/3_3_3d-cone-charts.fsx b/docs/03_3_3d-cone-charts.fsx similarity index 100% rename from docs/3_3_3d-cone-charts.fsx rename to docs/03_3_3d-cone-charts.fsx diff --git a/docs/3_4_3d-streamtube-plots.fsx b/docs/03_4_3d-streamtube-plots.fsx similarity index 100% rename from docs/3_4_3d-streamtube-plots.fsx rename to docs/03_4_3d-streamtube-plots.fsx diff --git a/docs/3_5_3d-volume-plots.fsx b/docs/03_5_3d-volume-plots.fsx similarity index 100% rename from docs/3_5_3d-volume-plots.fsx rename to docs/03_5_3d-volume-plots.fsx diff --git a/docs/3_6_3d-isosurface-plots .fsx b/docs/03_6_3d-isosurface-plots .fsx similarity index 100% rename from docs/3_6_3d-isosurface-plots .fsx rename to docs/03_6_3d-isosurface-plots .fsx diff --git a/docs/4_0_histograms.fsx b/docs/04_0_histograms.fsx similarity index 100% rename from docs/4_0_histograms.fsx rename to docs/04_0_histograms.fsx diff --git a/docs/4_1_box-plots.fsx b/docs/04_1_box-plots.fsx similarity index 100% rename from docs/4_1_box-plots.fsx rename to docs/04_1_box-plots.fsx diff --git a/docs/4_2_violin-plots.fsx b/docs/04_2_violin-plots.fsx similarity index 100% rename from docs/4_2_violin-plots.fsx rename to docs/04_2_violin-plots.fsx diff --git a/docs/4_3_contour-plots.fsx b/docs/04_3_contour-plots.fsx similarity index 100% rename from docs/4_3_contour-plots.fsx rename to docs/04_3_contour-plots.fsx diff --git a/docs/4_4_2d-histograms.fsx b/docs/04_4_2d-histograms.fsx similarity index 100% rename from docs/4_4_2d-histograms.fsx rename to docs/04_4_2d-histograms.fsx diff --git a/docs/4_5_splom.fsx b/docs/04_5_splom.fsx similarity index 100% rename from docs/4_5_splom.fsx rename to docs/04_5_splom.fsx diff --git a/docs/5_0_geo-vs-mapbox.fsx b/docs/05_0_geo-vs-mapbox.fsx similarity index 97% rename from docs/5_0_geo-vs-mapbox.fsx rename to docs/05_0_geo-vs-mapbox.fsx index 5a23a089f..08189b2df 100644 --- a/docs/5_0_geo-vs-mapbox.fsx +++ b/docs/05_0_geo-vs-mapbox.fsx @@ -37,7 +37,7 @@ Plotly and therefore Plotly.NET supports two different kinds of maps: - **Geo maps** are outline-based maps. If your figure is created with a `Chart.ScatterGeo, `Chart.PointGeo`, `Chart.LineGeo` or `Chart.Choropleth` function or otherwise contains one or more traces of type `scattergeo` or `choropleth`, the layout.geo object in your figure contains configuration information for the map itself. -_This page documents Geo outline-based maps, and the [Mapbox Layers documentation]({{root}}/6_0_geo-vs-mapbox.html) describes how to configure Mapbox tile-based maps._ +_This page documents Geo outline-based maps, and the [Mapbox Layers documentation]({{root}}/06_0_geo-vs-mapbox.html) describes how to configure Mapbox tile-based maps._ ## Physical Base Maps diff --git a/docs/5_1_geo-plots.fsx b/docs/05_1_geo-plots.fsx similarity index 100% rename from docs/5_1_geo-plots.fsx rename to docs/05_1_geo-plots.fsx diff --git a/docs/5_2_choropleth-map.fsx b/docs/05_2_choropleth-map.fsx similarity index 100% rename from docs/5_2_choropleth-map.fsx rename to docs/05_2_choropleth-map.fsx diff --git a/docs/6_0_geo-vs-mapbox.fsx b/docs/06_0_geo-vs-mapbox.fsx similarity index 98% rename from docs/6_0_geo-vs-mapbox.fsx rename to docs/06_0_geo-vs-mapbox.fsx index 89321d98f..f51d0395a 100644 --- a/docs/6_0_geo-vs-mapbox.fsx +++ b/docs/06_0_geo-vs-mapbox.fsx @@ -37,7 +37,7 @@ Plotly and therefore Plotly.NET supports two different kinds of maps: - **Geo maps** are outline-based maps. If your figure is created with a `Chart.ScatterGeo, `Chart.PointGeo`, `Chart.LineGeo` or `Chart.Choropleth` function or otherwise contains one or more traces of type `scattergeo` or `choropleth`, the layout.geo object in your figure contains configuration information for the map itself. -_This page documents Mapbox tile-based maps, and the [Geo map documentation]({{root}}/5_0_geo-vs-mapbox.html) describes how to configure outline-based maps_ +_This page documents Mapbox tile-based maps, and the [Geo map documentation]({{root}}/05_0_geo-vs-mapbox.html) describes how to configure outline-based maps_ ## How Layers Work in Mapbox Tile Maps diff --git a/docs/6_1_mapbox-plots.fsx b/docs/06_1_mapbox-plots.fsx similarity index 100% rename from docs/6_1_mapbox-plots.fsx rename to docs/06_1_mapbox-plots.fsx diff --git a/docs/6_2_choropleth-mapbox.fsx b/docs/06_2_choropleth-mapbox.fsx similarity index 100% rename from docs/6_2_choropleth-mapbox.fsx rename to docs/06_2_choropleth-mapbox.fsx diff --git a/docs/6_3_density-mapbox.fsx b/docs/06_3_density-mapbox.fsx similarity index 100% rename from docs/6_3_density-mapbox.fsx rename to docs/06_3_density-mapbox.fsx diff --git a/docs/7_0_candlestick.fsx b/docs/07_0_candlestick.fsx similarity index 100% rename from docs/7_0_candlestick.fsx rename to docs/07_0_candlestick.fsx diff --git a/docs/7_1_funnel.fsx b/docs/07_1_funnel.fsx similarity index 100% rename from docs/7_1_funnel.fsx rename to docs/07_1_funnel.fsx diff --git a/docs/7_2_funnel_area.fsx b/docs/07_2_funnel_area.fsx similarity index 100% rename from docs/7_2_funnel_area.fsx rename to docs/07_2_funnel_area.fsx diff --git a/docs/8_0_polar_line-scatter-plots.fsx b/docs/08_0_polar_line-scatter-plots.fsx similarity index 100% rename from docs/8_0_polar_line-scatter-plots.fsx rename to docs/08_0_polar_line-scatter-plots.fsx diff --git a/docs/8_1_polar_bar_charts.fsx b/docs/08_1_polar_bar_charts.fsx similarity index 100% rename from docs/8_1_polar_bar_charts.fsx rename to docs/08_1_polar_bar_charts.fsx diff --git a/docs/8_2_styling_polar_layouts.fsx b/docs/08_2_styling_polar_layouts.fsx similarity index 100% rename from docs/8_2_styling_polar_layouts.fsx rename to docs/08_2_styling_polar_layouts.fsx diff --git a/docs/9_0_parallel-categories.fsx b/docs/09_0_parallel-categories.fsx similarity index 100% rename from docs/9_0_parallel-categories.fsx rename to docs/09_0_parallel-categories.fsx diff --git a/docs/9_1_parallel-coords.fsx b/docs/09_1_parallel-coords.fsx similarity index 100% rename from docs/9_1_parallel-coords.fsx rename to docs/09_1_parallel-coords.fsx diff --git a/docs/9_2_sankey.fsx b/docs/09_2_sankey.fsx similarity index 100% rename from docs/9_2_sankey.fsx rename to docs/09_2_sankey.fsx diff --git a/docs/10_0_ternary_line_scatter_plots.fsx b/docs/10_0_ternary_line_scatter_plots.fsx new file mode 100644 index 000000000..3f9af2161 --- /dev/null +++ b/docs/10_0_ternary_line_scatter_plots.fsx @@ -0,0 +1,94 @@ +(** +--- +title: Ternary line and scatter plots +category: Ternary Plots +categoryindex: 10 +index: 1 +--- +*) + +(*** hide ***) + +(*** condition: prepare ***) +#r "nuget: Newtonsoft.JSON, 12.0.3" +#r "nuget: DynamicObj" +#r "../bin/Plotly.NET/netstandard2.0/Plotly.NET.dll" + +(*** condition: ipynb ***) +#if IPYNB +#r "nuget: Plotly.NET, {{fsdocs-package-version}}" +#r "nuget: Plotly.NET.Interactive, {{fsdocs-package-version}}" +#endif // IPYNB + +(** +# Ternary charts + +[![Binder]({{root}}img/badge-binder.svg)](https://mybinder.org/v2/gh/plotly/Plotly.NET/gh-pages?filepath={{fsdocs-source-basename}}.ipynb)  +[![Script]({{root}}img/badge-script.svg)]({{root}}{{fsdocs-source-basename}}.fsx)  +[![Notebook]({{root}}img/badge-notebook.svg)]({{root}}{{fsdocs-source-basename}}.ipynb) + +*Summary:* This example shows how to create ternary charts in F#. + +let's first create some data for the purpose of creating example charts: + +*) + +open Plotly.NET + +// a coordinates +let a = [ 1; 2; 3; 4; 5; 6; 7;] + +// b coordinates +let b = a |> List.rev + +//c +let c = [ 2; 2; 2; 2; 2; 2; 2;] + + +(** +A Ternary plot is a barycentric plot on three variables which sum to a constant. + +It graphically depicts the ratios of the three variables as positions in an equilateral triangle. + +It is used in physical chemistry, petrology, mineralogy, metallurgy, and other physical sciences to show the compositions of systems composed of three species. +In population genetics, a triangle plot of genotype frequencies is called a de Finetti diagram. In game theory, it is often called a simplex plot. + +Ternary plots are tools for analyzing compositional data in the three-dimensional case. + +## Ternary point charts + +use `Chart.PointTernary` to create a ternary plot that displays points on a ternary coordinate system: +*) + +let ternaryPolar = Chart.PointTernary(a,b,c) +(*** condition: ipynb ***) +#if IPYNB +ternaryPolar +#endif // IPYNB + +(***hide***) +ternaryPolar |> GenericChart.toChartHTML +(***include-it-raw***) + +(** +## Ternary line charts + +use `Chart.LineTernary` to create a ternary plot that displays a line connecting input the data on a ternary coordinate system: + +As values on ternary plots sum to a constant, you can omit one dimension ofd the data by providing that sum. + +You can also for example change the line style using `Chart.withLineStyle` +*) + +let lineTernary = + Chart.LineTernary(a,b,Sum = 10) + |> Chart.withLineStyle(Color=Color.fromString "purple",Dash=StyleParam.DrawingStyle.DashDot) + +(*** condition: ipynb ***) +#if IPYNB +lineTernary +#endif // IPYNB + +(***hide***) +lineTernary |> GenericChart.toChartHTML +(***include-it-raw***) \ No newline at end of file diff --git a/docs/10_1_styling_ternary_layouts.fsx b/docs/10_1_styling_ternary_layouts.fsx new file mode 100644 index 000000000..2e4cfca38 --- /dev/null +++ b/docs/10_1_styling_ternary_layouts.fsx @@ -0,0 +1,110 @@ +(** +--- +title: Styling ternary layouts +category: Ternary Plots +categoryindex: 9 +index: 3 +--- +*) + +(*** hide ***) + +(*** condition: prepare ***) +#r "nuget: Newtonsoft.JSON, 12.0.3" +#r "nuget: DynamicObj" +#r "../bin/Plotly.NET/netstandard2.0/Plotly.NET.dll" + +(*** condition: ipynb ***) +#if IPYNB +#r "nuget: Plotly.NET, {{fsdocs-package-version}}" +#r "nuget: Plotly.NET.Interactive, {{fsdocs-package-version}}" +#endif // IPYNB + +(** +# Styling ternary layouts + +[![Binder]({{root}}img/badge-binder.svg)](https://mybinder.org/v2/gh/plotly/Plotly.NET/gh-pages?filepath={{fsdocs-source-basename}}.ipynb)  +[![Script]({{root}}img/badge-script.svg)]({{root}}{{fsdocs-source-basename}}.fsx)  +[![Notebook]({{root}}img/badge-notebook.svg)]({{root}}{{fsdocs-source-basename}}.ipynb) + +*Summary:* This example shows how to style polar layouts in F#. + +let's first create some data for the purpose of creating example charts: +*) +open Plotly.NET + +// a coordinates +let a = [ 1; 2; 3; 4; 5; 6; 7;] + +// b coordinates +let b = a |> List.rev + +//c +let c = [ 2; 2; 2; 2; 2; 2; 2;] + +(** +Consider this combined ternary chart: +*) + +let combinedTernary = + [ + Chart.PointTernary(a,b,c) + Chart.LineTernary(a,c,Sum = 10) + ] + + |> Chart.combine + +(*** condition: ipynb ***) +#if IPYNB +combinedTernary +#endif // IPYNB + +(***hide***) +combinedTernary |> GenericChart.toChartHTML +(***include-it-raw***) + +(** +## Styling the polar layout + +Use the `Chart.withTernary` function and initialize a Ternary layout with the desired looks +*) +open Plotly.NET.LayoutObjects + +let styledTernary = + combinedTernary + |> Chart.withTernary( + Ternary.init( + AAxis = LinearAxis.init(Title = Title.init("A"), Color = Color.fromKeyword ColorKeyword.DarkOrchid), + BAxis = LinearAxis.init(Title = Title.init("B"), Color = Color.fromKeyword ColorKeyword.DarkRed) + ) + ) + +(*** condition: ipynb ***) +#if IPYNB +styledTernary +#endif // IPYNB + +(***hide***) +styledTernary |> GenericChart.toChartHTML +(***include-it-raw***) + +(** +## Styling A, B, and C Axes + +You could pass these axes to `Chart.withTernary` as above, but for the case where you want to specifically set one axis, there are the `Chart.withAAxis`, `Chart.withBAxis`, `Chart.withCAxis` functions: +*) + +let styledTernary2 = + styledTernary + |> Chart.withCAxis(LinearAxis.init(Title = Title.init("C"), Color = Color.fromKeyword ColorKeyword.DarkCyan)) + + + +(*** condition: ipynb ***) +#if IPYNB +styledTernary2 +#endif // IPYNB + +(***hide***) +styledTernary2 |> GenericChart.toChartHTML +(***include-it-raw***) \ No newline at end of file diff --git a/docs/index.fsx b/docs/index.fsx index 94c35fa4f..bd25a3207 100644 --- a/docs/index.fsx +++ b/docs/index.fsx @@ -211,7 +211,7 @@ One of the main design points of Plotly.NET it is to provide support for multipl [(1,5);(2,10)] |> Chart.Point -|> Chart.withTraceName("Hello from F#",Showlegend=true) +|> Chart.withTraceName("Hello from F#",ShowLegend=true) |> Chart.withYAxisStyle("xAxis",ShowGrid= false, ShowLine=true) |> Chart.withXAxisStyle("yAxis",ShowGrid= false, ShowLine=true) diff --git a/src/Plotly.NET/CSharpLayer/GenericChartExtensions.fs b/src/Plotly.NET/CSharpLayer/GenericChartExtensions.fs index 227d19391..ea2cf11c0 100644 --- a/src/Plotly.NET/CSharpLayer/GenericChartExtensions.fs +++ b/src/Plotly.NET/CSharpLayer/GenericChartExtensions.fs @@ -21,11 +21,11 @@ module GenericChartExtensions = member this.WithTraceName ( [] ?Name, - [] ?Showlegend, - [] ?Legendgroup, + [] ?ShowLegend, + [] ?LegendGroup, [] ?Visible ) = - this |> Chart.withTraceName(?Name=Name,?Showlegend=Showlegend,?Legendgroup=Legendgroup,?Visible=Visible) + this |> Chart.withTraceName(?Name=Name,?ShowLegend=ShowLegend,?LegendGroup=LegendGroup,?Visible=Visible) /// Set the axis anchor id the trace is belonging to [] @@ -659,3 +659,8 @@ module GenericChartExtensions = member this.WithScene(scene:Scene, [] ?Id) = this |> Chart.withScene(scene,?Id=Id) + /// Sets the scene object with the given id on the chart layout + [] + member this.WithTernary(ternary:Ternary, [] ?Id) = + this |> Chart.withTernary(ternary,?Id=Id) + diff --git a/src/Plotly.NET/ChartAPI/Chart.fs b/src/Plotly.NET/ChartAPI/Chart.fs index 9672abcc2..d9c82bc3b 100644 --- a/src/Plotly.NET/ChartAPI/Chart.fs +++ b/src/Plotly.NET/ChartAPI/Chart.fs @@ -72,15 +72,15 @@ type Chart = static member withTraceName ( [] ?Name, - [] ?Showlegend, - [] ?Legendgroup, + [] ?ShowLegend, + [] ?LegendGroup, [] ?Visible ) = fun (ch:GenericChart) -> ch |> mapiTrace (fun i trace -> let naming i name = name |> Option.map (fun v -> if i = 0 then v else sprintf "%s_%i" v i) trace - |> TraceStyle.TraceInfo(?Name=(naming i Name),?Showlegend=Showlegend,?Legendgroup=Legendgroup,?Visible=Visible) + |> TraceStyle.TraceInfo(?Name=(naming i Name),?ShowLegend=ShowLegend,?LegendGroup=LegendGroup,?Visible=Visible) ) /// Set the axis anchor id the trace is belonging to @@ -1420,3 +1420,74 @@ type Chart = |> Layout.updateSceneById(id,scene) GenericChart.setLayout layout ch ) + + /// Sets the scene with the given id on the chart layout + [] + static member withTernary(ternary:Ternary, [] ?Id) = + (fun (ch:GenericChart) -> + let layout = + let id = defaultArg Id (StyleParam.SubPlotId.Ternary 1) + GenericChart.getLayout ch + |> Layout.updateTernaryById(id,ternary) + GenericChart.setLayout layout ch + ) + + /// Sets the A-Axis of the ternary coordinate system with the given id on the chart layout + [] + static member withAAxis(aAxis:LinearAxis, [] ?Id) = + (fun (ch:GenericChart) -> + let id = defaultArg Id (StyleParam.SubPlotId.Ternary 1) + let layout = GenericChart.getLayout ch + + let updatedTernary = + layout + |> Layout.tryGetTernaryById(id) + |> Option.defaultValue (Ternary.init()) + |> Ternary.style(AAxis = aAxis) + + let updatedLayout = + layout + |> Layout.updateTernaryById(id,updatedTernary) + + GenericChart.setLayout updatedLayout ch + ) + + /// Sets the A-Axis of the ternary coordinate system with the given id on the chart layout + [] + static member withBAxis(bAxis:LinearAxis, [] ?Id) = + (fun (ch:GenericChart) -> + let id = defaultArg Id (StyleParam.SubPlotId.Ternary 1) + let layout = GenericChart.getLayout ch + + let updatedTernary = + layout + |> Layout.tryGetTernaryById(id) + |> Option.defaultValue (Ternary.init()) + |> Ternary.style(BAxis = bAxis) + + let updatedLayout = + layout + |> Layout.updateTernaryById(id,updatedTernary) + + GenericChart.setLayout updatedLayout ch + ) + + /// Sets the A-Axis of the ternary coordinate system with the given id on the chart layout + [] + static member withCAxis(cAxis:LinearAxis, [] ?Id) = + (fun (ch:GenericChart) -> + let id = defaultArg Id (StyleParam.SubPlotId.Ternary 1) + let layout = GenericChart.getLayout ch + + let updatedTernary = + layout + |> Layout.tryGetTernaryById(id) + |> Option.defaultValue (Ternary.init()) + |> Ternary.style(CAxis = cAxis) + + let updatedLayout = + layout + |> Layout.updateTernaryById(id,updatedTernary) + + GenericChart.setLayout updatedLayout ch + ) diff --git a/src/Plotly.NET/ChartAPI/Chart2D.fs b/src/Plotly.NET/ChartAPI/Chart2D.fs index 2d54d4ec0..09b8382ec 100644 --- a/src/Plotly.NET/ChartAPI/Chart2D.fs +++ b/src/Plotly.NET/ChartAPI/Chart2D.fs @@ -37,7 +37,7 @@ module Chart2D = /// Sets the y coordinates of the plotted data. /// Determines the drawing mode for this scatter trace. /// Sets the trace name. The trace name appear as the legend item and on hover - /// Determines whether or not an item corresponding to this trace is shown in the legend. + /// Determines whether or not an item corresponding to this trace is shown in the legend. /// Sets the type of symbol that datums are displayed as /// Sets Line/Marker Color /// Sets the Opacity of the trace @@ -53,7 +53,7 @@ module Chart2D = [] static member Scatter(x, y, mode, [] ?Name , - [] ?Showlegend , + [] ?ShowLegend , [] ?MarkerSymbol , [] ?Color , [] ?Opacity , @@ -77,7 +77,7 @@ module Chart2D = ?Orientation= Orientation , ?GroupNorm = GroupNorm ) - >> TraceStyle.TraceInfo(?Name=Name,?Showlegend=Showlegend,?Opacity=Opacity) + >> TraceStyle.TraceInfo(?Name=Name,?ShowLegend=ShowLegend,?Opacity=Opacity) >> TraceStyle.Line(?Color=Color,?Dash=Dash,?Width=Width) >> TraceStyle.Marker(?Color=Color,?Symbol=MarkerSymbol) >> TraceStyle.TextLabel(?Text=Labels,?Textposition=TextPosition,?Textfont=TextFont) @@ -91,7 +91,7 @@ module Chart2D = /// Sets the x,y coordinates of the plotted data. /// Determines the drawing mode for this scatter trace. /// Sets the trace name. The trace name appear as the legend item and on hover - /// Determines whether or not an item corresponding to this trace is shown in the legend. + /// Determines whether or not an item corresponding to this trace is shown in the legend. /// Sets the type of symbol that datums are displayed as /// Sets Line/Marker Color /// Sets the Opacity of the trace @@ -107,7 +107,7 @@ module Chart2D = [] static member Scatter(xy,mode, [] ?Name , - [] ?Showlegend , + [] ?ShowLegend , [] ?MarkerSymbol , [] ?Color , [] ?Opacity , @@ -123,7 +123,7 @@ module Chart2D = let x,y = Seq.unzip xy Chart.Scatter(x, y, mode, ?Name = Name , - ?Showlegend = Showlegend , + ?ShowLegend = ShowLegend , ?MarkerSymbol = MarkerSymbol , ?Color = Color , ?Opacity = Opacity , @@ -144,7 +144,7 @@ module Chart2D = /// Sets the x coordinates of the plotted data. /// Sets the y coordinates of the plotted data. /// Sets the trace name. The trace name appear as the legend item and on hover - /// Determines whether or not an item corresponding to this trace is shown in the legend. + /// Determines whether or not an item corresponding to this trace is shown in the legend. /// Sets the type of symbol that datums are displayed as /// Sets Line/Marker Color /// Sets the Opacity of the trace @@ -158,7 +158,7 @@ module Chart2D = [] static member Point(x, y, [] ?Name, - [] ?Showlegend, + [] ?ShowLegend, [] ?MarkerSymbol, [] ?Color, [] ?Opacity, @@ -182,7 +182,7 @@ module Chart2D = ?StackGroup = StackGroup, ?Orientation= Orientation, ?GroupNorm = GroupNorm) - >> TraceStyle.TraceInfo(?Name=Name,?Showlegend=Showlegend,?Opacity=Opacity) + >> TraceStyle.TraceInfo(?Name=Name,?ShowLegend=ShowLegend,?Opacity=Opacity) >> TraceStyle.Marker(?Color=Color,?Symbol=MarkerSymbol) >> TraceStyle.TextLabel(?Text=Labels,?Textposition=TextPosition,?Textfont=TextFont) @@ -191,7 +191,7 @@ module Chart2D = /// Creates a Point chart, which uses Points in a 2D space to visualize data. /// Sets the x,y coordinates of the plotted data. /// Sets the trace name. The trace name appear as the legend item and on hover - /// Determines whether or not an item corresponding to this trace is shown in the legend. + /// Determines whether or not an item corresponding to this trace is shown in the legend. /// Sets the type of symbol that datums are displayed as /// Sets Line/Marker Color /// Sets the Opacity of the trace @@ -205,7 +205,7 @@ module Chart2D = [] static member Point(xy, [] ?Name, - [] ?Showlegend, + [] ?ShowLegend, [] ?MarkerSymbol, [] ?Color, [] ?Opacity, @@ -220,7 +220,7 @@ module Chart2D = let x,y = Seq.unzip xy Chart.Point(x, y, ?Name = Name, - ?Showlegend = Showlegend, + ?ShowLegend = ShowLegend, ?MarkerSymbol = MarkerSymbol, ?Color = Color, ?Opacity = Opacity, @@ -239,7 +239,7 @@ module Chart2D = /// Sets the y coordinates of the plotted data. /// Sets the trace name. The trace name appear as the legend item and on hover /// Wether to show markers for the individual data points - /// Determines whether or not an item corresponding to this trace is shown in the legend. + /// Determines whether or not an item corresponding to this trace is shown in the legend. /// Sets the type of symbol that datums are displayed as /// Sets Line/Marker Color /// Sets the Opacity of the trace @@ -256,7 +256,7 @@ module Chart2D = static member Line(x, y, [] ?Name, [] ?ShowMarkers, - [] ?Showlegend, + [] ?ShowLegend, [] ?MarkerSymbol, [] ?Color, [] ?Opacity, @@ -289,7 +289,7 @@ module Chart2D = ?Orientation= Orientation, ?GroupNorm = GroupNorm) >> TraceStyle.Line(?Color=Color,?Dash=Dash,?Width=Width) - >> TraceStyle.TraceInfo(?Name=Name,?Showlegend=Showlegend,?Opacity=Opacity) + >> TraceStyle.TraceInfo(?Name=Name,?ShowLegend=ShowLegend,?Opacity=Opacity) >> TraceStyle.Marker(?Color=Color,?Symbol=MarkerSymbol) >> TraceStyle.TextLabel(?Text=Labels,?Textposition=TextPosition,?Textfont=TextFont) @@ -302,7 +302,7 @@ module Chart2D = /// Sets the x,y coordinates of the plotted data. /// Sets the trace name. The trace name appear as the legend item and on hover /// Wether to show markers for the individual data points - /// Determines whether or not an item corresponding to this trace is shown in the legend. + /// Determines whether or not an item corresponding to this trace is shown in the legend. /// Sets the type of symbol that datums are displayed as /// Sets Line/Marker Color /// Sets the Opacity of the trace @@ -319,7 +319,7 @@ module Chart2D = static member Line(xy, [] ?Name, [] ?ShowMarkers, - [] ?Showlegend, + [] ?ShowLegend, [] ?MarkerSymbol, [] ?Color, [] ?Opacity, @@ -338,7 +338,7 @@ module Chart2D = x, y, ?Name = Name, ?ShowMarkers = ShowMarkers, - ?Showlegend = Showlegend, + ?ShowLegend = ShowLegend, ?MarkerSymbol = MarkerSymbol, ?Color = Color, ?Opacity = Opacity, @@ -360,7 +360,7 @@ module Chart2D = /// Sets the y coordinates of the plotted data. /// Sets the trace name. The trace name appear as the legend item and on hover /// Wether to show markers for the individual data points - /// Determines whether or not an item corresponding to this trace is shown in the legend. + /// Determines whether or not an item corresponding to this trace is shown in the legend. /// Sets the type of symbol that datums are displayed as /// Sets Line/Marker Color /// Sets the Opacity of the trace @@ -378,7 +378,7 @@ module Chart2D = static member Spline(x, y, [] ?Name, [] ?ShowMarkers, - [] ?Showlegend, + [] ?ShowLegend, [] ?MarkerSymbol, [] ?Color, [] ?Opacity, @@ -410,7 +410,7 @@ module Chart2D = ?StackGroup = StackGroup, ?Orientation= Orientation, ?GroupNorm = GroupNorm) - >> TraceStyle.TraceInfo(?Name=Name,?Showlegend=Showlegend,?Opacity=Opacity) + >> TraceStyle.TraceInfo(?Name=Name,?ShowLegend=ShowLegend,?Opacity=Opacity) >> TraceStyle.Line(?Color=Color,?Dash=Dash,?Width=Width, Shape=StyleParam.Shape.Spline, ?Smoothing=Smoothing) >> TraceStyle.Marker(?Color=Color,?Symbol=MarkerSymbol) >> TraceStyle.TextLabel(?Text=Labels,?Textposition=TextPosition,?Textfont=TextFont) @@ -424,7 +424,7 @@ module Chart2D = /// Sets the x,y coordinates of the plotted data. /// Sets the trace name. The trace name appear as the legend item and on hover /// Wether to show markers for the individual data points - /// Determines whether or not an item corresponding to this trace is shown in the legend. + /// Determines whether or not an item corresponding to this trace is shown in the legend. /// Sets the type of symbol that datums are displayed as /// Sets Line/Marker Color /// Sets the Opacity of the trace @@ -442,7 +442,7 @@ module Chart2D = static member Spline(xy, [] ?Name, [] ?ShowMarkers, - [] ?Showlegend, + [] ?ShowLegend, [] ?MarkerSymbol, [] ?Color, [] ?Opacity, @@ -461,7 +461,7 @@ module Chart2D = Chart.Spline(x, y, ?Name = Name, ?ShowMarkers = ShowMarkers, - ?Showlegend = Showlegend, + ?ShowLegend = ShowLegend, ?MarkerSymbol = MarkerSymbol, ?Color = Color, ?Opacity = Opacity, @@ -483,7 +483,7 @@ module Chart2D = /// Sets the y coordinates of the plotted data. /// Sets the bubble size of the plotted data /// Sets the trace name. The trace name appear as the legend item and on hover - /// Determines whether or not an item corresponding to this trace is shown in the legend. + /// Determines whether or not an item corresponding to this trace is shown in the legend. /// Sets the type of symbol that datums are displayed as /// Sets Line/Marker Color /// Sets the Opacity of the trace @@ -497,7 +497,7 @@ module Chart2D = [] static member Bubble(x, y,sizes:seq<#IConvertible>, [] ?Name, - [] ?Showlegend, + [] ?ShowLegend, [] ?MarkerSymbol, [] ?Color, [] ?Opacity, @@ -520,7 +520,7 @@ module Chart2D = ?StackGroup = StackGroup, ?Orientation= Orientation, ?GroupNorm = GroupNorm) - >> TraceStyle.TraceInfo(?Name=Name,?Showlegend=Showlegend,?Opacity=Opacity) + >> TraceStyle.TraceInfo(?Name=Name,?ShowLegend=ShowLegend,?Opacity=Opacity) >> TraceStyle.Marker(?Color=Color,?Symbol=MarkerSymbol, MultiSizes=sizes) >> TraceStyle.TextLabel(?Text=Labels,?Textposition=TextPosition,?Textfont=TextFont) @@ -530,7 +530,7 @@ module Chart2D = /// Creates a bubble chart. A bubble chart is a variation of the Point chart, where the data points get an additional scale by being rendered as bubbles of different sizes. /// Sets the x coordinates, y coordinates, and bubble sizes of the plotted data. /// Sets the trace name. The trace name appear as the legend item and on hover - /// Determines whether or not an item corresponding to this trace is shown in the legend. + /// Determines whether or not an item corresponding to this trace is shown in the legend. /// Sets the type of symbol that datums are displayed as /// Sets Line/Marker Color /// Sets the Opacity of the trace @@ -543,7 +543,7 @@ module Chart2D = /// If true, plotly.js will use the WebGL engine to render this chart. use this when you want to render many objects at once. [] static member Bubble(xysizes,[] ?Name, - [] ?Showlegend, + [] ?ShowLegend, [] ?MarkerSymbol, [] ?Color, [] ?Opacity, @@ -559,7 +559,7 @@ module Chart2D = Chart.Bubble( x, y,sizes, ?Name = Name, - ?Showlegend = Showlegend, + ?ShowLegend = ShowLegend, ?MarkerSymbol = MarkerSymbol, ?Color = Color, ?Opacity = Opacity, @@ -577,7 +577,7 @@ module Chart2D = static member Range(x, y, upper, lower,mode, [] ?Name, [] ?ShowMarkers, - [] ?Showlegend, + [] ?ShowLegend, [] ?Color, [] ?RangeColor, [] ?Labels, @@ -603,7 +603,7 @@ module Chart2D = let trace = Trace2D.initScatter ( Trace2DStyle.Scatter(X = x,Y = y, Mode=mode, ?FillColor=Color) ) - |> TraceStyle.TraceInfo(?Name=Name,?Showlegend=Showlegend) + |> TraceStyle.TraceInfo(?Name=Name,?ShowLegend=ShowLegend) |> TraceStyle.Line(?Color=Color) |> TraceStyle.Marker(?Color=Color) |> TraceStyle.TextLabel(?Text=Labels,?Textposition=TextPosition,?Textfont=TextFont) @@ -611,7 +611,7 @@ module Chart2D = let lower = Trace2D.initScatter ( Trace2DStyle.Scatter(X = x,Y = lower, Mode=StyleParam.Mode.Lines, ?FillColor=RangeColor) ) - |> TraceStyle.TraceInfo(?Name = Some lowerName, Showlegend=false) + |> TraceStyle.TraceInfo(?Name = Some lowerName, ShowLegend=false) |> TraceStyle.Line(Width=0.) |> TraceStyle.Marker(Color=if RangeColor.IsSome then RangeColor.Value else (Plotly.NET.Color.fromString "rgba(0,0,0,0.5)")) |> TraceStyle.TextLabel(?Text=LowerLabels,?Textposition=TextPosition,?Textfont=TextFont) @@ -619,7 +619,7 @@ module Chart2D = let upper = Trace2D.initScatter ( Trace2DStyle.Scatter(X = x,Y = upper, Mode=StyleParam.Mode.Lines, ?FillColor=RangeColor, Fill=StyleParam.Fill.ToNext_y) ) - |> TraceStyle.TraceInfo(?Name = Some upperName, Showlegend=false) + |> TraceStyle.TraceInfo(?Name = Some upperName, ShowLegend=false) |> TraceStyle.Line(Width=0.) |> TraceStyle.Marker(Color=if RangeColor.IsSome then RangeColor.Value else (Plotly.NET.Color.fromString "rgba(0,0,0,0.5)")) |> TraceStyle.TextLabel(?Text=UpperLabels,?Textposition=TextPosition,?Textfont=TextFont) @@ -631,7 +631,7 @@ module Chart2D = static member Range(xy, upper, lower, mode, [] ?Name, [] ?ShowMarkers, - [] ?Showlegend, + [] ?ShowLegend, [] ?Color, [] ?RangeColor, [] ?Labels, @@ -642,7 +642,7 @@ module Chart2D = [] ?LowerName, [] ?UpperName) = let x,y = Seq.unzip xy - Chart.Range(x, y, upper, lower, mode, ?Name=Name,?ShowMarkers=ShowMarkers,?Showlegend=Showlegend,?Color=Color,?RangeColor=RangeColor,?Labels=Labels,?UpperLabels=UpperLabels,?LowerLabels=LowerLabels,?TextPosition=TextPosition,?TextFont=TextFont,?LowerName=LowerName,?UpperName=UpperName) + Chart.Range(x, y, upper, lower, mode, ?Name=Name,?ShowMarkers=ShowMarkers,?ShowLegend=ShowLegend,?Color=Color,?RangeColor=RangeColor,?Labels=Labels,?UpperLabels=UpperLabels,?LowerLabels=LowerLabels,?TextPosition=TextPosition,?TextFont=TextFont,?LowerName=LowerName,?UpperName=UpperName) /// Emphasizes the degree of change over time and shows the relationship of the parts to a whole. @@ -650,7 +650,7 @@ module Chart2D = static member Area(x, y, [] ?Name, [] ?ShowMarkers, - [] ?Showlegend, + [] ?ShowLegend, [] ?MarkerSymbol, [] ?Color, [] ?Opacity, @@ -670,7 +670,7 @@ module Chart2D = Trace2D.initScatter ( Trace2DStyle.Scatter(X = x,Y = y, Mode=changeMode StyleParam.Mode.Lines,Fill=StyleParam.Fill.ToZero_y) ) - |> TraceStyle.TraceInfo(?Name=Name,?Showlegend=Showlegend,?Opacity=Opacity) + |> TraceStyle.TraceInfo(?Name=Name,?ShowLegend=ShowLegend,?Opacity=Opacity) |> TraceStyle.Line(?Color=Color,?Dash=Dash,?Width=Width) |> TraceStyle.Marker(?Color=Color,?Symbol=MarkerSymbol) |> TraceStyle.TextLabel(?Text=Labels,?Textposition=TextPosition,?Textfont=TextFont) @@ -682,7 +682,7 @@ module Chart2D = static member Area(xy, [] ?Name, [] ?ShowMarkers, - [] ?Showlegend, + [] ?ShowLegend, [] ?MarkerSymbol, [] ?Color, [] ?Opacity, @@ -692,7 +692,7 @@ module Chart2D = [] ?Dash, [] ?Width) = let x,y = Seq.unzip xy - Chart.Area(x, y, ?Name=Name,?ShowMarkers=ShowMarkers,?Showlegend=Showlegend,?MarkerSymbol=MarkerSymbol,?Color=Color,?Opacity=Opacity,?Labels=Labels,?TextPosition=TextPosition,?TextFont=TextFont,?Dash=Dash,?Width=Width) + Chart.Area(x, y, ?Name=Name,?ShowMarkers=ShowMarkers,?ShowLegend=ShowLegend,?MarkerSymbol=MarkerSymbol,?Color=Color,?Opacity=Opacity,?Labels=Labels,?TextPosition=TextPosition,?TextFont=TextFont,?Dash=Dash,?Width=Width) /// Emphasizes the degree of change over time and shows the relationship of the parts to a whole. @@ -700,7 +700,7 @@ module Chart2D = static member SplineArea(x, y, [] ?Name, [] ?ShowMarkers, - [] ?Showlegend, + [] ?ShowLegend, [] ?MarkerSymbol, [] ?Color, [] ?Opacity, @@ -721,7 +721,7 @@ module Chart2D = Trace2D.initScatter ( Trace2DStyle.Scatter(X = x,Y = y, Mode=changeMode StyleParam.Mode.Lines,Fill=StyleParam.Fill.ToZero_y) ) - |> TraceStyle.TraceInfo(?Name=Name,?Showlegend=Showlegend,?Opacity=Opacity) + |> TraceStyle.TraceInfo(?Name=Name,?ShowLegend=ShowLegend,?Opacity=Opacity) |> TraceStyle.Line(?Color=Color,?Dash=Dash,?Width=Width, Shape=StyleParam.Shape.Spline, ?Smoothing=Smoothing) |> TraceStyle.Marker(?Color=Color,?Symbol=MarkerSymbol) |> TraceStyle.TextLabel(?Text=Labels,?Textposition=TextPosition,?Textfont=TextFont) @@ -733,7 +733,7 @@ module Chart2D = static member SplineArea(xy, [] ?Name, [] ?ShowMarkers, - [] ?Showlegend, + [] ?ShowLegend, [] ?MarkerSymbol, [] ?Color, [] ?Opacity, @@ -744,13 +744,13 @@ module Chart2D = [] ?Width, [] ?Smoothing) = let x,y = Seq.unzip xy - Chart.SplineArea(x, y, ?Name=Name,?ShowMarkers=ShowMarkers,?Showlegend=Showlegend,?MarkerSymbol=MarkerSymbol,?Color=Color,?Opacity=Opacity,?Labels=Labels,?TextPosition=TextPosition,?TextFont=TextFont,?Dash=Dash,?Width=Width,?Smoothing=Smoothing) + Chart.SplineArea(x, y, ?Name=Name,?ShowMarkers=ShowMarkers,?ShowLegend=ShowLegend,?MarkerSymbol=MarkerSymbol,?Color=Color,?Opacity=Opacity,?Labels=Labels,?TextPosition=TextPosition,?TextFont=TextFont,?Dash=Dash,?Width=Width,?Smoothing=Smoothing) /// Emphasizes the degree of change over time and shows the relationship of the parts to a whole. [] static member StackedArea(x, y, [] ?Name, - [] ?Showlegend, + [] ?ShowLegend, [] ?MarkerSymbol, [] ?Color, [] ?Opacity, @@ -761,7 +761,7 @@ module Chart2D = [] ?Width) = Trace2D.initScatter ( Trace2DStyle.Scatter(X = x,Y = y, Mode=StyleParam.Mode.Lines) ) - |> TraceStyle.TraceInfo(?Name=Name,?Showlegend=Showlegend,?Opacity=Opacity) + |> TraceStyle.TraceInfo(?Name=Name,?ShowLegend=ShowLegend,?Opacity=Opacity) |> TraceStyle.Line(?Color=Color,?Dash=Dash,?Width=Width) |> TraceStyle.Marker(?Color=Color,?Symbol=MarkerSymbol) |> TraceStyle.TextLabel(?Text=Labels,?Textposition=TextPosition,?Textfont=TextFont) @@ -772,7 +772,7 @@ module Chart2D = [] static member StackedArea(xy, [] ?Name, - [] ?Showlegend, + [] ?ShowLegend, [] ?MarkerSymbol, [] ?Color, [] ?Opacity, @@ -782,7 +782,7 @@ module Chart2D = [] ?Dash, [] ?Width) = let x,y = Seq.unzip xy - Chart.StackedArea(x, y, ?Name=Name,?Showlegend=Showlegend,?MarkerSymbol=MarkerSymbol,?Color=Color,?Opacity=Opacity,?Labels=Labels,?TextPosition=TextPosition,?TextFont=TextFont,?Dash=Dash,?Width=Width) + Chart.StackedArea(x, y, ?Name=Name,?ShowLegend=ShowLegend,?MarkerSymbol=MarkerSymbol,?Color=Color,?Opacity=Opacity,?Labels=Labels,?TextPosition=TextPosition,?TextFont=TextFont,?Dash=Dash,?Width=Width) /// Creates a Funnel chart. @@ -796,7 +796,7 @@ module Chart2D = /// /// Name : Sets the trace name. The trace name appear as the legend item and on hover /// - /// Showlegend : Determines whether or not an item corresponding to this trace is shown in the legend. + /// ShowLegend : Determines whether or not an item corresponding to this trace is shown in the legend. /// /// Opacity : Sets the Opacity of the trace /// @@ -838,7 +838,7 @@ module Chart2D = [] static member Funnel (x, y, [] ?Name , - [] ?Showlegend , + [] ?ShowLegend , [] ?Opacity , [] ?Labels , [] ?TextPosition , @@ -879,7 +879,7 @@ module Chart2D = ?Outsidetextfont = Outsidetextfont ) ) - |> TraceStyle.TraceInfo(?Name=Name,?Showlegend=Showlegend,?Opacity=Opacity) + |> TraceStyle.TraceInfo(?Name=Name,?ShowLegend=ShowLegend,?Opacity=Opacity) |> TraceStyle.Marker(?Color=Color,?Line=Line) |> TraceStyle.TextLabel(?Text=Labels,?Textposition=TextPosition,?Textfont=TextFont) |> GenericChart.ofTraceObject @@ -987,7 +987,7 @@ module Chart2D = [] static member Column(keys, values, [] ?Name, - [] ?Showlegend, + [] ?ShowLegend, [] ?Color, [] ?Opacity, [] ?Labels, @@ -1001,7 +1001,7 @@ module Chart2D = | Option.None -> TraceObjects.Marker.init (?Color=Color) Trace2D.initBar (Trace2DStyle.Bar(X = keys,Y = values,Marker=marker)) - |> TraceStyle.TraceInfo(?Name=Name,?Showlegend=Showlegend,?Opacity=Opacity) + |> TraceStyle.TraceInfo(?Name=Name,?ShowLegend=ShowLegend,?Opacity=Opacity) |> TraceStyle.TextLabel(?Text=Labels,?Textposition=TextPosition,?Textfont=TextFont) |> GenericChart.ofTraceObject @@ -1010,7 +1010,7 @@ module Chart2D = [] static member Column(keysvalues, [] ?Name, - [] ?Showlegend, + [] ?ShowLegend, [] ?Color, [] ?Opacity, [] ?Labels, @@ -1018,14 +1018,14 @@ module Chart2D = [] ?TextFont, [] ?Marker) = let keys,values = Seq.unzip keysvalues - Chart.Column(keys, values, ?Name=Name,?Showlegend=Showlegend,?Color=Color,?Opacity=Opacity,?Labels=Labels,?TextPosition=TextPosition,?TextFont=TextFont,?Marker=Marker) + Chart.Column(keys, values, ?Name=Name,?ShowLegend=ShowLegend,?Color=Color,?Opacity=Opacity,?Labels=Labels,?TextPosition=TextPosition,?TextFont=TextFont,?Marker=Marker) /// Displays series of column chart type as stacked columns. [] static member StackedColumn(keys, values, [] ?Name, - [] ?Showlegend, + [] ?ShowLegend, [] ?Color, [] ?Opacity, [] ?Labels, @@ -1038,7 +1038,7 @@ module Chart2D = | Option.None -> TraceObjects.Marker.init (?Color=Color) Trace2D.initBar (Trace2DStyle.Bar(X = keys,Y = values,Marker=marker)) - |> TraceStyle.TraceInfo(?Name=Name,?Showlegend=Showlegend,?Opacity=Opacity) + |> TraceStyle.TraceInfo(?Name=Name,?ShowLegend=ShowLegend,?Opacity=Opacity) |> TraceStyle.TextLabel(?Text=Labels,?Textposition=TextPosition,?Textfont=TextFont) |> GenericChart.ofTraceObject //|> GenericChart.setLayout (Layout.init (Layout.style(Barmode=StyleParam.Barmode.Stack))) @@ -1049,7 +1049,7 @@ module Chart2D = [] static member StackedColumn(keysvalues, [] ?Name, - [] ?Showlegend, + [] ?ShowLegend, [] ?Color, [] ?Opacity, [] ?Labels, @@ -1057,14 +1057,14 @@ module Chart2D = [] ?TextFont, [] ?Marker) = let keys,values = Seq.unzip keysvalues - Chart.StackedColumn(keys, values,?Name=Name,?Showlegend=Showlegend,?Color=Color,?Opacity=Opacity,?Labels=Labels,?TextPosition=TextPosition,?TextFont=TextFont,?Marker=Marker) + Chart.StackedColumn(keys, values,?Name=Name,?ShowLegend=ShowLegend,?Color=Color,?Opacity=Opacity,?Labels=Labels,?TextPosition=TextPosition,?TextFont=TextFont,?Marker=Marker) /// Illustrates comparisons among individual items [] static member Bar(keys, values, [] ?Name, - [] ?Showlegend, + [] ?ShowLegend, [] ?Color, [] ?Opacity, [] ?Labels, @@ -1076,7 +1076,7 @@ module Chart2D = | Some marker -> marker |> TraceObjects.Marker.style(?Color=Color) | Option.None -> TraceObjects.Marker.init (?Color=Color) Trace2D.initBar (Trace2DStyle.Bar(X = values,Y = keys,Marker=marker,Orientation = StyleParam.Orientation.Horizontal)) - |> TraceStyle.TraceInfo(?Name=Name,?Showlegend=Showlegend,?Opacity=Opacity) + |> TraceStyle.TraceInfo(?Name=Name,?ShowLegend=ShowLegend,?Opacity=Opacity) |> TraceStyle.TextLabel(?Text=Labels,?Textposition=TextPosition,?Textfont=TextFont) |> GenericChart.ofTraceObject @@ -1085,7 +1085,7 @@ module Chart2D = [] static member Bar(keysvalues, [] ?Name, - [] ?Showlegend, + [] ?ShowLegend, [] ?Color, [] ?Opacity, [] ?Labels, @@ -1093,14 +1093,14 @@ module Chart2D = [] ?TextFont, [] ?Marker) = let keys,values = Seq.unzip keysvalues - Chart.Bar(keys, values, ?Name=Name,?Showlegend=Showlegend,?Color=Color,?Opacity=Opacity,?Labels=Labels,?TextPosition=TextPosition,?TextFont=TextFont,?Marker=Marker) + Chart.Bar(keys, values, ?Name=Name,?ShowLegend=ShowLegend,?Color=Color,?Opacity=Opacity,?Labels=Labels,?TextPosition=TextPosition,?TextFont=TextFont,?Marker=Marker) /// Displays series of tcolumn chart type as stacked bars. [] static member StackedBar(keys, values, [] ?Name, - [] ?Showlegend, + [] ?ShowLegend, [] ?Color, [] ?Opacity, [] ?Labels, @@ -1112,7 +1112,7 @@ module Chart2D = | Some marker -> marker |> TraceObjects.Marker.style(?Color=Color) | Option.None -> TraceObjects.Marker.init (?Color=Color) Trace2D.initBar (Trace2DStyle.Bar(X = values,Y = keys,Marker=marker,Orientation = StyleParam.Orientation.Horizontal)) - |> TraceStyle.TraceInfo(?Name=Name,?Showlegend=Showlegend,?Opacity=Opacity) + |> TraceStyle.TraceInfo(?Name=Name,?ShowLegend=ShowLegend,?Opacity=Opacity) |> TraceStyle.TextLabel(?Text=Labels,?Textposition=TextPosition,?Textfont=TextFont) |> GenericChart.ofTraceObject //|> GenericChart.setLayout (Layout.init (Layout.style(Barmode=StyleParam.Barmode.Stack))) @@ -1123,7 +1123,7 @@ module Chart2D = [] static member StackedBar(keysvalues, [] ?Name, - [] ?Showlegend, + [] ?ShowLegend, [] ?Color, [] ?Opacity, [] ?Labels, @@ -1131,7 +1131,7 @@ module Chart2D = [] ?TextFont, [] ?Marker) = let keys,values = Seq.unzip keysvalues - Chart.StackedBar(keys, values, ?Name=Name,?Showlegend=Showlegend,?Color=Color,?Opacity=Opacity,?Labels=Labels,?TextPosition=TextPosition,?TextFont=TextFont,?Marker=Marker) + Chart.StackedBar(keys, values, ?Name=Name,?ShowLegend=ShowLegend,?Color=Color,?Opacity=Opacity,?Labels=Labels,?TextPosition=TextPosition,?TextFont=TextFont,?Marker=Marker) /// Computes a histogram with auto-determined the bin size. [] @@ -1140,7 +1140,7 @@ module Chart2D = data, [] ?Orientation, [] ?Name, - [] ?Showlegend, + [] ?ShowLegend, [] ?Opacity, [] ?Color, [] ?HistNorm, @@ -1167,7 +1167,7 @@ module Chart2D = ) ) |> TraceStyle.Marker(?Color=Color) - |> TraceStyle.TraceInfo(?Name=Name,?Showlegend=Showlegend,?Opacity=Opacity) + |> TraceStyle.TraceInfo(?Name=Name,?ShowLegend=ShowLegend,?Opacity=Opacity) |> GenericChart.ofTraceObject @@ -1178,7 +1178,7 @@ module Chart2D = x,y, [] ?Z, [] ?Name, - [] ?Showlegend, + [] ?ShowLegend, [] ?Opacity, [] ?Colorscale, [] ?Showscale, @@ -1214,7 +1214,7 @@ module Chart2D = ?HistFunc=HistFunc ) ) - |> TraceStyle.TraceInfo(?Name=Name,?Showlegend=Showlegend,?Opacity=Opacity) + |> TraceStyle.TraceInfo(?Name=Name,?ShowLegend=ShowLegend,?Opacity=Opacity) |> GenericChart.ofTraceObject /// Displays the distribution of data based on the five number summary: minimum, first quartile, median, third quartile, and maximum. @@ -1224,7 +1224,7 @@ module Chart2D = [] ?x, [] ?y, [] ?Name, - [] ?Showlegend, + [] ?ShowLegend, [] ?Color, [] ?Fillcolor, [] ?Opacity, @@ -1250,7 +1250,7 @@ module Chart2D = ?Marker=Marker,?Line=Line,?Alignmentgroup=Alignmentgroup,?Offsetgroup=Offsetgroup,?Notched=Notched,?NotchWidth=NotchWidth,?QuartileMethod=QuartileMethod ) ) - |> TraceStyle.TraceInfo(?Name=Name,?Showlegend=Showlegend,?Opacity=Opacity) + |> TraceStyle.TraceInfo(?Name=Name,?ShowLegend=ShowLegend,?Opacity=Opacity) |> TraceStyle.Marker(?Color=Color) |> GenericChart.ofTraceObject @@ -1259,7 +1259,7 @@ module Chart2D = [] static member BoxPlot(xy, [] ?Name, - [] ?Showlegend, + [] ?ShowLegend, [] ?Color, [] ?Fillcolor, [] ?Opacity, @@ -1278,7 +1278,7 @@ module Chart2D = [] ?QuartileMethod ) = let x,y = Seq.unzip xy - Chart.BoxPlot(x, y, ?Name=Name,?Showlegend=Showlegend,?Color=Color,?Fillcolor=Fillcolor,?Opacity=Opacity,?Whiskerwidth=Whiskerwidth,?Boxpoints=Boxpoints,?Boxmean=Boxmean,?Jitter=Jitter,?Pointpos=Pointpos,?Orientation=Orientation, + Chart.BoxPlot(x, y, ?Name=Name,?ShowLegend=ShowLegend,?Color=Color,?Fillcolor=Fillcolor,?Opacity=Opacity,?Whiskerwidth=Whiskerwidth,?Boxpoints=Boxpoints,?Boxmean=Boxmean,?Jitter=Jitter,?Pointpos=Pointpos,?Orientation=Orientation, ?Marker=Marker,?Line=Line,?Alignmentgroup=Alignmentgroup,?Offsetgroup=Offsetgroup,?Notched=Notched,?NotchWidth=NotchWidth,?QuartileMethod=QuartileMethod) @@ -1289,7 +1289,7 @@ module Chart2D = [] ?x, [] ?y, [] ?Name, - [] ?Showlegend, + [] ?ShowLegend, [] ?Color, [] ?Fillcolor, [] ?Opacity, @@ -1320,7 +1320,7 @@ module Chart2D = ?Scalegroup=Scalegroup,?Scalemode=Scalemode,?Side=Side,?Span=Span,?SpanMode=SpanMode,?Uirevision=Uirevision ) ) - |> TraceStyle.TraceInfo(?Name=Name,?Showlegend=Showlegend,?Opacity=Opacity) + |> TraceStyle.TraceInfo(?Name=Name,?ShowLegend=ShowLegend,?Opacity=Opacity) |> TraceStyle.Marker(?Color=Color) |> GenericChart.ofTraceObject @@ -1329,7 +1329,7 @@ module Chart2D = [] static member Violin(xy, [] ?Name, - [] ?Showlegend, + [] ?ShowLegend, [] ?Color, [] ?Fillcolor, [] ?Opacity, @@ -1353,7 +1353,7 @@ module Chart2D = [] ?Uirevision ) = let x,y = Seq.unzip xy - Chart.Violin(x, y, ?Name=Name,?Showlegend=Showlegend,?Color=Color,?Fillcolor=Fillcolor,?Opacity=Opacity,?Points=Points,?Jitter=Jitter,?Pointpos=Pointpos,?Orientation=Orientation, + Chart.Violin(x, y, ?Name=Name,?ShowLegend=ShowLegend,?Color=Color,?Fillcolor=Fillcolor,?Opacity=Opacity,?Points=Points,?Jitter=Jitter,?Pointpos=Pointpos,?Orientation=Orientation, ?Width=Width,?Marker=Marker,?Line=Line,?Alignmentgroup=Alignmentgroup,?Offsetgroup=Offsetgroup,?Box=Box,?Bandwidth=Bandwidth,?Meanline=Meanline, ?Scalegroup=Scalegroup,?Scalemode=Scalemode,?Side=Side,?Span=Span,?SpanMode=SpanMode,?Uirevision=Uirevision ) @@ -1407,7 +1407,7 @@ module Chart2D = [] ?ColNames, [] ?RowNames, [] ?Name, - [] ?Showlegend, + [] ?ShowLegend, [] ?Opacity, [] ?Colorscale, [] ?Showscale, @@ -1429,7 +1429,7 @@ module Chart2D = ?zSmooth=zSmooth, ?ColorBar=ColorBar ) - >> TraceStyle.TraceInfo(?Name=Name,?Showlegend=Showlegend,?Opacity=Opacity) + >> TraceStyle.TraceInfo(?Name=Name,?ShowLegend=ShowLegend,?Opacity=Opacity) let useWebGL = defaultArg UseWebGL false @@ -1442,7 +1442,7 @@ module Chart2D = [] ?X, [] ?Y, [] ?Name, - [] ?Showlegend, + [] ?ShowLegend, [] ?Opacity, [] ?Colorscale, [] ?Showscale, @@ -1454,7 +1454,7 @@ module Chart2D = ?Colorscale=Colorscale,?Showscale=Showscale,?zSmooth=zSmooth,?ColorBar=ColorBar ) ) - |> TraceStyle.TraceInfo(?Name=Name,?Showlegend=Showlegend,?Opacity=Opacity) + |> TraceStyle.TraceInfo(?Name=Name,?ShowLegend=ShowLegend,?Opacity=Opacity) |> GenericChart.ofTraceObject /// Creates an OHLC (open-high-low-close) chart. OHLC charts are typically used to illustrate movements in the price of a financial instrument over time. diff --git a/src/Plotly.NET/ChartAPI/Chart3D.fs b/src/Plotly.NET/ChartAPI/Chart3D.fs index e0604d8a8..5b8ebc6d2 100644 --- a/src/Plotly.NET/ChartAPI/Chart3D.fs +++ b/src/Plotly.NET/ChartAPI/Chart3D.fs @@ -25,7 +25,7 @@ module Chart3D = ( x, y, z, mode, [] ?Name, - [] ?Showlegend, + [] ?ShowLegend, [] ?MarkerSymbol, [] ?Color, [] ?Opacity, @@ -36,7 +36,7 @@ module Chart3D = [] ?Width ) = Trace3D.initScatter3d (Trace3DStyle.Scatter3d(X = x,Y = y,Z=z, Mode=mode) ) - |> TraceStyle.TraceInfo(?Name=Name,?Showlegend=Showlegend,?Opacity=Opacity) + |> TraceStyle.TraceInfo(?Name=Name,?ShowLegend=ShowLegend,?Opacity=Opacity) |> TraceStyle.Line(?Color=Color,?Dash=Dash,?Width=Width) |> TraceStyle.Marker(?Color=Color,?Symbol=MarkerSymbol) |> TraceStyle.TextLabel(?Text=Labels,?Textposition=TextPosition,?Textfont=TextFont) @@ -47,7 +47,7 @@ module Chart3D = [] static member Scatter3d(xyz, mode, [] ?Name, - [] ?Showlegend, + [] ?ShowLegend, [] ?MarkerSymbol, [] ?Color, [] ?Opacity, @@ -57,7 +57,7 @@ module Chart3D = [] ?Dash, [] ?Width) = let x,y,z = Seq.unzip3 xyz - Chart.Scatter3d(x, y, z, mode, ?Name=Name,?Showlegend=Showlegend,?MarkerSymbol=MarkerSymbol,?Color=Color,?Opacity=Opacity,?Labels=Labels,?TextPosition=TextPosition,?TextFont=TextFont,?Dash=Dash,?Width=Width) + Chart.Scatter3d(x, y, z, mode, ?Name=Name,?ShowLegend=ShowLegend,?MarkerSymbol=MarkerSymbol,?Color=Color,?Opacity=Opacity,?Labels=Labels,?TextPosition=TextPosition,?TextFont=TextFont,?Dash=Dash,?Width=Width) /// [] @@ -65,7 +65,7 @@ module Chart3D = ( x, y, z, [] ?Name, - [] ?Showlegend, + [] ?ShowLegend, [] ?MarkerSymbol, [] ?Color, [] ?Opacity, @@ -82,7 +82,7 @@ module Chart3D = z = z, mode = changeMode StyleParam.Mode.Markers, ?Name = Name, - ?Showlegend = Showlegend, + ?ShowLegend = ShowLegend, ?MarkerSymbol = MarkerSymbol, ?Color = Color, ?Opacity = Opacity, @@ -97,7 +97,7 @@ module Chart3D = ( xyz, [] ?Name, - [] ?Showlegend, + [] ?ShowLegend, [] ?MarkerSymbol, [] ?Color, [] ?Opacity, @@ -110,7 +110,7 @@ module Chart3D = Chart.Point3d( x, y, z, ?Name = Name, - ?Showlegend = Showlegend, + ?ShowLegend = ShowLegend, ?MarkerSymbol = MarkerSymbol, ?Color = Color, ?Opacity = Opacity, @@ -127,7 +127,7 @@ module Chart3D = x, y, z, [] ?Name, [] ?ShowMarkers, - [] ?Showlegend, + [] ?ShowLegend, [] ?MarkerSymbol, [] ?Color, [] ?Opacity, @@ -151,7 +151,7 @@ module Chart3D = z = z, mode = changeMode StyleParam.Mode.Lines, ?Name = Name , - ?Showlegend = Showlegend , + ?ShowLegend = ShowLegend , ?MarkerSymbol = MarkerSymbol, ?Color = Color , ?Opacity = Opacity , @@ -169,7 +169,7 @@ module Chart3D = xyz, [] ?Name, [] ?ShowMarkers, - [] ?Showlegend, + [] ?ShowLegend, [] ?MarkerSymbol, [] ?Color, [] ?Opacity, @@ -185,7 +185,7 @@ module Chart3D = x, y, z, ?Name = Name , ?ShowMarkers = ShowMarkers , - ?Showlegend = Showlegend , + ?ShowLegend = ShowLegend , ?MarkerSymbol = MarkerSymbol, ?Color = Color , ?Opacity = Opacity , @@ -202,7 +202,7 @@ module Chart3D = ( x, y, z, sizes, [] ?Name, - [] ?Showlegend, + [] ?ShowLegend, [] ?MarkerSymbol, [] ?Color, [] ?Opacity, @@ -220,7 +220,7 @@ module Chart3D = Mode=changeMode StyleParam.Mode.Markers ) ) - |> TraceStyle.TraceInfo(?Name=Name,?Showlegend=Showlegend,?Opacity=Opacity) + |> TraceStyle.TraceInfo(?Name=Name,?ShowLegend=ShowLegend,?Opacity=Opacity) |> TraceStyle.Marker(?Color=Color,?Symbol=MarkerSymbol, MultiSizes=sizes) |> TraceStyle.TextLabel(?Text=Labels,?Textposition=TextPosition,?Textfont=TextFont) |> GenericChart.ofTraceObject @@ -231,7 +231,7 @@ module Chart3D = ( xyz, sizes, [] ?Name, - [] ?Showlegend, + [] ?ShowLegend, [] ?MarkerSymbol, [] ?Color, [] ?Opacity, @@ -244,7 +244,7 @@ module Chart3D = Chart.Bubble3d( x, y, z, sizes, ?Name = Name, - ?Showlegend = Showlegend, + ?ShowLegend = ShowLegend, ?MarkerSymbol = MarkerSymbol, ?Color = Color, ?Opacity = Opacity, @@ -262,7 +262,7 @@ module Chart3D = [] ?X, [] ?Y, [] ?Name, - [] ?Showlegend, + [] ?ShowLegend, [] ?Opacity, [] ?Contours, [] ?ColorScale, @@ -280,7 +280,7 @@ module Chart3D = ?ColorBar=ColorBar ) ) - |> TraceStyle.TraceInfo(?Name=Name,?Showlegend=Showlegend,?Opacity=Opacity) + |> TraceStyle.TraceInfo(?Name=Name,?ShowLegend=ShowLegend,?Opacity=Opacity) |> GenericChart.ofTraceObject @@ -293,7 +293,7 @@ module Chart3D = [] ?J, [] ?K, [] ?Name, - [] ?Showlegend, + [] ?ShowLegend, [] ?Opacity, [] ?Contours, [] ?ColorScale, @@ -310,7 +310,7 @@ module Chart3D = ?K = K ) ) - |> TraceStyle.TraceInfo(?Name=Name,?Showlegend=Showlegend,?Opacity=Opacity) + |> TraceStyle.TraceInfo(?Name=Name,?ShowLegend=ShowLegend,?Opacity=Opacity) |> GenericChart.ofTraceObject [] @@ -341,7 +341,7 @@ module Chart3D = ?ColorBar = ColorBar ) ) - |> TraceStyle.TraceInfo(?Name=Name,?Showlegend=ShowLegend,?Opacity=Opacity) + |> TraceStyle.TraceInfo(?Name=Name,?ShowLegend=ShowLegend,?Opacity=Opacity) |> GenericChart.ofTraceObject [] @@ -402,7 +402,7 @@ module Chart3D = ?Starts = Starts ) ) - |> TraceStyle.TraceInfo(?Name=Name,?Showlegend=ShowLegend,?Opacity=Opacity) + |> TraceStyle.TraceInfo(?Name=Name,?ShowLegend=ShowLegend,?Opacity=Opacity) |> GenericChart.ofTraceObject @@ -470,7 +470,7 @@ module Chart3D = ?Surface = Surface ) ) - |> TraceStyle.TraceInfo(?Name=Name,?Showlegend=ShowLegend,?Opacity=Opacity) + |> TraceStyle.TraceInfo(?Name=Name,?ShowLegend=ShowLegend,?Opacity=Opacity) |> GenericChart.ofTraceObject @@ -509,6 +509,6 @@ module Chart3D = ?Surface = Surface ) ) - |> TraceStyle.TraceInfo(?Name=Name,?Showlegend=ShowLegend,?Opacity=Opacity) + |> TraceStyle.TraceInfo(?Name=Name,?ShowLegend=ShowLegend,?Opacity=Opacity) |> GenericChart.ofTraceObject \ No newline at end of file diff --git a/src/Plotly.NET/ChartAPI/ChartDomain.fs b/src/Plotly.NET/ChartAPI/ChartDomain.fs index cfdb20226..8a999ecaf 100644 --- a/src/Plotly.NET/ChartAPI/ChartDomain.fs +++ b/src/Plotly.NET/ChartAPI/ChartDomain.fs @@ -170,7 +170,7 @@ module ChartDomain = /// /// Name : Sets the trace name. The trace name appear as the legend item and on hover. /// - /// Showlegend : Determines whether or not an item corresponding to this trace is shown in the legend. + /// ShowLegend : Determines whether or not an item corresponding to this trace is shown in the legend. /// /// Opacity : Sets the opacity of the trace. /// @@ -205,7 +205,7 @@ module ChartDomain = [] ?dLabel , [] ?Label0 , [] ?Name , - [] ?Showlegend , + [] ?ShowLegend , [] ?Opacity , [] ?Color , [] ?Line , @@ -233,7 +233,7 @@ module ChartDomain = ?Scalegroup = Scalegroup ) ) - |> TraceStyle.TraceInfo(?Name=Name,?Showlegend=Showlegend,?Opacity=Opacity) + |> TraceStyle.TraceInfo(?Name=Name,?ShowLegend=ShowLegend,?Opacity=Opacity) |> TraceStyle.Marker(?Color=Color,?Line=Line) |> TraceStyle.Domain(?X=X,?Y=Y,?Row=Row,?Column=Column) |> TraceStyle.TextLabel(?Text=Text,?Textposition=TextPosition) diff --git a/src/Plotly.NET/ChartAPI/ChartMap.fs b/src/Plotly.NET/ChartAPI/ChartMap.fs index 3ea3a8d32..d5b80143f 100644 --- a/src/Plotly.NET/ChartAPI/ChartMap.fs +++ b/src/Plotly.NET/ChartAPI/ChartMap.fs @@ -62,7 +62,7 @@ module ChartMap = /// /// Name : Sets the trace name. The trace name appear as the legend item and on hover /// - /// Showlegend : Determines whether or not an item corresponding to this trace is shown in the legend. + /// ShowLegend : Determines whether or not an item corresponding to this trace is shown in the legend. /// /// MarkerSymbol: Sets the type of symbol that datums are displayed as /// @@ -90,7 +90,7 @@ module ChartMap = [] static member ScatterGeo(longitudes, latitudes, mode, [] ?Name , - [] ?Showlegend , + [] ?ShowLegend , [] ?MarkerSymbol , [] ?Color , [] ?Opacity , @@ -118,7 +118,7 @@ module ChartMap = ?Fillcolor = Fillcolor ) ) - |> TraceStyle.TraceInfo(?Name=Name,?Showlegend=Showlegend,?Opacity=Opacity) + |> TraceStyle.TraceInfo(?Name=Name,?ShowLegend=ShowLegend,?Opacity=Opacity) |> TraceStyle.Line(?Color=Color,?Dash=Dash,?Width=Width) |> TraceStyle.Marker(?Color=Color,?Symbol=MarkerSymbol) |> TraceStyle.TextLabel(?Text=Labels,?Textposition=TextPosition,?Textfont=TextFont) @@ -136,7 +136,7 @@ module ChartMap = /// /// Name : Sets the trace name. The trace name appear as the legend item and on hover /// - /// Showlegend : Determines whether or not an item corresponding to this trace is shown in the legend. + /// ShowLegend : Determines whether or not an item corresponding to this trace is shown in the legend. /// /// MarkerSymbol: Sets the type of symbol that datums are displayed as /// @@ -164,7 +164,7 @@ module ChartMap = [] static member ScatterGeo(lonlat, mode, [] ?Name , - [] ?Showlegend , + [] ?ShowLegend , [] ?MarkerSymbol , [] ?Color , [] ?Opacity , @@ -193,7 +193,7 @@ module ChartMap = ?Fillcolor = Fillcolor ) ) - |> TraceStyle.TraceInfo(?Name=Name,?Showlegend=Showlegend,?Opacity=Opacity) + |> TraceStyle.TraceInfo(?Name=Name,?ShowLegend=ShowLegend,?Opacity=Opacity) |> TraceStyle.Line(?Color=Color,?Dash=Dash,?Width=Width) |> TraceStyle.Marker(?Color=Color,?Symbol=MarkerSymbol) |> TraceStyle.TextLabel(?Text=Labels,?Textposition=TextPosition,?Textfont=TextFont) @@ -210,7 +210,7 @@ module ChartMap = /// /// Name : Sets the trace name. The trace name appear as the legend item and on hover /// - /// Showlegend : Determines whether or not an item corresponding to this trace is shown in the legend. + /// ShowLegend : Determines whether or not an item corresponding to this trace is shown in the legend. /// /// MarkerSymbol: Sets the type of symbol that datums are displayed as /// @@ -238,7 +238,7 @@ module ChartMap = [] static member ScatterGeo(locations, mode, [] ?Name , - [] ?Showlegend , + [] ?ShowLegend , [] ?MarkerSymbol , [] ?Color , [] ?Opacity , @@ -265,7 +265,7 @@ module ChartMap = ?Fillcolor = Fillcolor ) ) - |> TraceStyle.TraceInfo(?Name=Name,?Showlegend=Showlegend,?Opacity=Opacity) + |> TraceStyle.TraceInfo(?Name=Name,?ShowLegend=ShowLegend,?Opacity=Opacity) |> TraceStyle.Line(?Color=Color,?Dash=Dash,?Width=Width) |> TraceStyle.Marker(?Color=Color,?Symbol=MarkerSymbol) |> TraceStyle.TextLabel(?Text=Labels,?Textposition=TextPosition,?Textfont=TextFont) @@ -281,7 +281,7 @@ module ChartMap = /// /// Name : Sets the trace name. The trace name appear as the legend item and on hover /// - /// Showlegend : Determines whether or not an item corresponding to this trace is shown in the legend. + /// ShowLegend : Determines whether or not an item corresponding to this trace is shown in the legend. /// /// MarkerSymbol: Sets the type of symbol that datums are displayed as /// @@ -305,7 +305,7 @@ module ChartMap = [] static member PointGeo(longitudes, latitudes, [] ?Name , - [] ?Showlegend , + [] ?ShowLegend , [] ?MarkerSymbol , [] ?Color , [] ?Opacity , @@ -333,7 +333,7 @@ module ChartMap = ?Fillcolor = Fillcolor ) ) - |> TraceStyle.TraceInfo(?Name=Name,?Showlegend=Showlegend,?Opacity=Opacity) + |> TraceStyle.TraceInfo(?Name=Name,?ShowLegend=ShowLegend,?Opacity=Opacity) |> TraceStyle.Marker(?Color=Color,?Symbol=MarkerSymbol) |> TraceStyle.TextLabel(?Text=Labels,?Textposition=TextPosition,?Textfont=TextFont) |> GenericChart.ofTraceObject @@ -346,7 +346,7 @@ module ChartMap = /// /// Name : Sets the trace name. The trace name appear as the legend item and on hover /// - /// Showlegend : Determines whether or not an item corresponding to this trace is shown in the legend. + /// ShowLegend : Determines whether or not an item corresponding to this trace is shown in the legend. /// /// MarkerSymbol: Sets the type of symbol that datums are displayed as /// @@ -370,7 +370,7 @@ module ChartMap = [] static member PointGeo(lonlat, [] ?Name , - [] ?Showlegend , + [] ?ShowLegend , [] ?MarkerSymbol , [] ?Color , [] ?Opacity , @@ -399,7 +399,7 @@ module ChartMap = ?Fillcolor = Fillcolor ) ) - |> TraceStyle.TraceInfo(?Name=Name,?Showlegend=Showlegend,?Opacity=Opacity) + |> TraceStyle.TraceInfo(?Name=Name,?ShowLegend=ShowLegend,?Opacity=Opacity) |> TraceStyle.Marker(?Color=Color,?Symbol=MarkerSymbol) |> TraceStyle.TextLabel(?Text=Labels,?Textposition=TextPosition,?Textfont=TextFont) |> GenericChart.ofTraceObject @@ -412,7 +412,7 @@ module ChartMap = /// /// Name : Sets the trace name. The trace name appear as the legend item and on hover /// - /// Showlegend : Determines whether or not an item corresponding to this trace is shown in the legend. + /// ShowLegend : Determines whether or not an item corresponding to this trace is shown in the legend. /// /// MarkerSymbol: Sets the type of symbol that datums are displayed as /// @@ -436,7 +436,7 @@ module ChartMap = [] static member PointGeo(locations, [] ?Name , - [] ?Showlegend , + [] ?ShowLegend , [] ?MarkerSymbol , [] ?Color , [] ?Opacity , @@ -462,7 +462,7 @@ module ChartMap = ?Fillcolor = Fillcolor ) ) - |> TraceStyle.TraceInfo(?Name=Name,?Showlegend=Showlegend,?Opacity=Opacity) + |> TraceStyle.TraceInfo(?Name=Name,?ShowLegend=ShowLegend,?Opacity=Opacity) |> TraceStyle.Marker(?Color=Color,?Symbol=MarkerSymbol) |> TraceStyle.TextLabel(?Text=Labels,?Textposition=TextPosition,?Textfont=TextFont) |> GenericChart.ofTraceObject @@ -479,7 +479,7 @@ module ChartMap = /// /// ShowMarkers : Determines wether or not markers will be rendered for each datum. /// - /// Showlegend : Determines whether or not an item corresponding to this trace is shown in the legend. + /// ShowLegend : Determines whether or not an item corresponding to this trace is shown in the legend. /// /// MarkerSymbol: Sets the type of symbol that datums are displayed as /// @@ -509,7 +509,7 @@ module ChartMap = [] static member LineGeo(longitudes, latitudes, [] ?Name , - [] ?Showlegend , + [] ?ShowLegend , [] ?MarkerSymbol , [] ?ShowMarkers , [] ?Color , @@ -544,7 +544,7 @@ module ChartMap = ?Fillcolor = Fillcolor ) ) - |> TraceStyle.TraceInfo(?Name=Name,?Showlegend=Showlegend,?Opacity=Opacity) + |> TraceStyle.TraceInfo(?Name=Name,?ShowLegend=ShowLegend,?Opacity=Opacity) |> TraceStyle.Marker(?Color=Color,?Symbol=MarkerSymbol) |> TraceStyle.TextLabel(?Text=Labels,?Textposition=TextPosition,?Textfont=TextFont) |> GenericChart.ofTraceObject @@ -559,7 +559,7 @@ module ChartMap = /// /// ShowMarkers : Determines wether or not markers will be rendered for each datum. /// - /// Showlegend : Determines whether or not an item corresponding to this trace is shown in the legend. + /// ShowLegend : Determines whether or not an item corresponding to this trace is shown in the legend. /// /// MarkerSymbol: Sets the type of symbol that datums are displayed as /// @@ -585,7 +585,7 @@ module ChartMap = [] static member LineGeo(lonlat, [] ?Name , - [] ?Showlegend , + [] ?ShowLegend , [] ?MarkerSymbol , [] ?ShowMarkers , [] ?Color , @@ -621,7 +621,7 @@ module ChartMap = ?Fillcolor = Fillcolor ) ) - |> TraceStyle.TraceInfo(?Name=Name,?Showlegend=Showlegend,?Opacity=Opacity) + |> TraceStyle.TraceInfo(?Name=Name,?ShowLegend=ShowLegend,?Opacity=Opacity) |> TraceStyle.Marker(?Color=Color,?Symbol=MarkerSymbol) |> TraceStyle.TextLabel(?Text=Labels,?Textposition=TextPosition,?Textfont=TextFont) |> GenericChart.ofTraceObject @@ -636,7 +636,7 @@ module ChartMap = /// /// ShowMarkers : Determines wether or not markers will be rendered for each datum. /// - /// Showlegend : Determines whether or not an item corresponding to this trace is shown in the legend. + /// ShowLegend : Determines whether or not an item corresponding to this trace is shown in the legend. /// /// MarkerSymbol: Sets the type of symbol that datums are displayed as /// @@ -662,7 +662,7 @@ module ChartMap = [] static member LineGeo(locations, [] ?Name , - [] ?Showlegend , + [] ?ShowLegend , [] ?MarkerSymbol , [] ?ShowMarkers , [] ?Color , @@ -696,7 +696,7 @@ module ChartMap = ?Fillcolor = Fillcolor ) ) - |> TraceStyle.TraceInfo(?Name=Name,?Showlegend=Showlegend,?Opacity=Opacity) + |> TraceStyle.TraceInfo(?Name=Name,?ShowLegend=ShowLegend,?Opacity=Opacity) |> TraceStyle.Marker(?Color=Color,?Symbol=MarkerSymbol) |> TraceStyle.TextLabel(?Text=Labels,?Textposition=TextPosition,?Textfont=TextFont) |> GenericChart.ofTraceObject @@ -754,7 +754,7 @@ module ChartMap = ?Fillcolor = Fillcolor ) ) - |> TraceStyle.TraceInfo(?Name=Name,?Showlegend=ShowLegend,?Opacity=Opacity) + |> TraceStyle.TraceInfo(?Name=Name,?ShowLegend=ShowLegend,?Opacity=Opacity) |> TraceStyle.Line(?Color=Color,?Width=Width) |> TraceStyle.Marker(?Color=Color) |> TraceStyle.TextLabel(?Text=Labels,?Textposition=TextPosition,?Textfont=TextFont) diff --git a/src/Plotly.NET/ChartAPI/ChartPolar.fs b/src/Plotly.NET/ChartAPI/ChartPolar.fs index e6a7d7ffb..70bfe8477 100644 --- a/src/Plotly.NET/ChartAPI/ChartPolar.fs +++ b/src/Plotly.NET/ChartAPI/ChartPolar.fs @@ -32,7 +32,7 @@ module ChartPolar = ( r, theta, mode, [] ?Name, - [] ?Showlegend, + [] ?ShowLegend, [] ?MarkerSymbol, [] ?Color, [] ?Opacity, @@ -50,7 +50,7 @@ module ChartPolar = Theta = theta, Mode = mode ) - >> TraceStyle.TraceInfo(?Name=Name,?Showlegend=Showlegend,?Opacity=Opacity) + >> TraceStyle.TraceInfo(?Name=Name,?ShowLegend=ShowLegend,?Opacity=Opacity) >> TraceStyle.Line(?Color=Color,?Dash=Dash,?Width=Width) >> TraceStyle.Marker(?Color=Color,?Symbol=MarkerSymbol) >> TraceStyle.TextLabel(?Text=Labels,?Textposition=TextPosition,?Textfont=TextFont) @@ -65,7 +65,7 @@ module ChartPolar = ( rtheta, mode, [] ?Name, - [] ?Showlegend, + [] ?ShowLegend, [] ?MarkerSymbol, [] ?Color, [] ?Opacity, @@ -82,7 +82,7 @@ module ChartPolar = Chart.ScatterPolar( r, t, mode, ?Name=Name, - ?Showlegend=Showlegend, + ?ShowLegend=ShowLegend, ?MarkerSymbol=MarkerSymbol, ?Color=Color, ?Opacity=Opacity, @@ -100,7 +100,7 @@ module ChartPolar = ( r, theta, [] ?Name, - [] ?Showlegend, + [] ?ShowLegend, [] ?MarkerSymbol, [] ?Color, [] ?Opacity, @@ -118,7 +118,7 @@ module ChartPolar = Theta = theta, Mode = changeMode StyleParam.Mode.Markers ) - >> TraceStyle.TraceInfo(?Name=Name,?Showlegend=Showlegend,?Opacity=Opacity) + >> TraceStyle.TraceInfo(?Name=Name,?ShowLegend=ShowLegend,?Opacity=Opacity) >> TraceStyle.Marker(?Color=Color,?Symbol=MarkerSymbol) >> TraceStyle.TextLabel(?Text=Labels,?Textposition=TextPosition,?Textfont=TextFont) @@ -132,7 +132,7 @@ module ChartPolar = ( rTheta, [] ?Name, - [] ?Showlegend, + [] ?ShowLegend, [] ?MarkerSymbol, [] ?Color, [] ?Opacity, @@ -146,7 +146,7 @@ module ChartPolar = Chart.PointPolar( r, t, ?Name = Name, - ?Showlegend = Showlegend, + ?ShowLegend = ShowLegend, ?MarkerSymbol = MarkerSymbol, ?Color = Color, ?Opacity = Opacity, @@ -162,7 +162,7 @@ module ChartPolar = ( r, theta, [] ?Name, - [] ?Showlegend, + [] ?ShowLegend, [] ?ShowMarkers, [] ?MarkerSymbol, [] ?Color, @@ -188,7 +188,7 @@ module ChartPolar = Theta = theta, Mode = changeMode StyleParam.Mode.Lines ) - >> TraceStyle.TraceInfo(?Name=Name,?Showlegend=Showlegend,?Opacity=Opacity) + >> TraceStyle.TraceInfo(?Name=Name,?ShowLegend=ShowLegend,?Opacity=Opacity) >> TraceStyle.Line(?Color=Color,?Dash=Dash,?Width=Width) >> TraceStyle.Marker(?Color=Color,?Symbol=MarkerSymbol) >> TraceStyle.TextLabel(?Text=Labels,?Textposition=TextPosition,?Textfont=TextFont) @@ -203,7 +203,7 @@ module ChartPolar = ( rTheta, [] ?Name, - [] ?Showlegend, + [] ?ShowLegend, [] ?ShowMarkers, [] ?MarkerSymbol, [] ?Color, @@ -220,7 +220,7 @@ module ChartPolar = Chart.LinePolar( r, t, ?Name = Name, - ?Showlegend = Showlegend, + ?ShowLegend = ShowLegend, ?ShowMarkers = ShowMarkers, ?MarkerSymbol = MarkerSymbol, ?Color = Color, @@ -239,7 +239,7 @@ module ChartPolar = ( r, theta, [] ?Name, - [] ?Showlegend, + [] ?ShowLegend, [] ?ShowMarkers, [] ?MarkerSymbol, [] ?Color, @@ -266,7 +266,7 @@ module ChartPolar = Theta = theta, Mode = changeMode StyleParam.Mode.Lines ) - >> TraceStyle.TraceInfo(?Name=Name,?Showlegend=Showlegend,?Opacity=Opacity) + >> TraceStyle.TraceInfo(?Name=Name,?ShowLegend=ShowLegend,?Opacity=Opacity) >> TraceStyle.Line(?Color=Color,?Dash=Dash,?Width=Width, Shape=StyleParam.Shape.Spline, ?Smoothing=Smoothing) >> TraceStyle.Marker(?Color=Color,?Symbol=MarkerSymbol) >> TraceStyle.TextLabel(?Text=Labels,?Textposition=TextPosition,?Textfont=TextFont) @@ -280,7 +280,7 @@ module ChartPolar = ( rTheta, [] ?Name, - [] ?Showlegend, + [] ?ShowLegend, [] ?ShowMarkers, [] ?MarkerSymbol, [] ?Color, @@ -298,7 +298,7 @@ module ChartPolar = Chart.SplinePolar( r, t, ?Name = Name, - ?Showlegend = Showlegend, + ?ShowLegend = ShowLegend, ?ShowMarkers = ShowMarkers, ?MarkerSymbol = MarkerSymbol, ?Color = Color, @@ -318,7 +318,7 @@ module ChartPolar = ( r, theta, sizes:seq<#IConvertible>, [] ?Name, - [] ?Showlegend, + [] ?ShowLegend, [] ?MarkerSymbol, [] ?Color, [] ?Opacity, @@ -336,7 +336,7 @@ module ChartPolar = Theta = theta, Mode = changeMode StyleParam.Mode.Markers ) - >> TraceStyle.TraceInfo(?Name=Name,?Showlegend=Showlegend,?Opacity=Opacity) + >> TraceStyle.TraceInfo(?Name=Name,?ShowLegend=ShowLegend,?Opacity=Opacity) >> TraceStyle.Marker(?Color=Color,?Symbol=MarkerSymbol,MultiSizes=sizes) >> TraceStyle.TextLabel(?Text=Labels,?Textposition=TextPosition,?Textfont=TextFont) @@ -350,7 +350,7 @@ module ChartPolar = ( rThetaSizes:seq<#IConvertible*#IConvertible*#IConvertible>, [] ?Name, - [] ?Showlegend, + [] ?ShowLegend, [] ?MarkerSymbol, [] ?Color, [] ?Opacity, @@ -364,7 +364,7 @@ module ChartPolar = Chart.BubblePolar( r, t, sizes, ?Name = Name, - ?Showlegend = Showlegend, + ?ShowLegend = ShowLegend, ?MarkerSymbol = MarkerSymbol, ?Color = Color, ?Opacity = Opacity, @@ -380,7 +380,7 @@ module ChartPolar = ( r, theta, [] ?Name, - [] ?Showlegend, + [] ?ShowLegend, [] ?Color, [] ?Opacity, [] ?Labels, @@ -394,7 +394,7 @@ module ChartPolar = R = r, Theta = theta ) ) - |> TraceStyle.TraceInfo(?Name=Name,?Showlegend=Showlegend,?Opacity=Opacity) + |> TraceStyle.TraceInfo(?Name=Name,?ShowLegend=ShowLegend,?Opacity=Opacity) |> TraceStyle.Line(?Color=Color,?Dash=Dash,?Width=LineWidth) |> TraceStyle.Marker(?Color=Color) |> TraceStyle.TextLabel(?Text=Labels,?Textposition=TextPosition,?Textfont=TextFont) diff --git a/src/Plotly.NET/ChartAPI/ChartTernary.fs b/src/Plotly.NET/ChartAPI/ChartTernary.fs new file mode 100644 index 000000000..09fa1b22f --- /dev/null +++ b/src/Plotly.NET/ChartAPI/ChartTernary.fs @@ -0,0 +1,230 @@ +namespace Plotly.NET + +open Plotly.NET.LayoutObjects +open Plotly.NET.TraceObjects + +open DynamicObj +open System +open System.IO + +open GenericChart +open StyleParam +open System.Runtime.InteropServices +open System.Runtime.CompilerServices + +[] +module ChartTernary = + + [] + type Chart = + + static member ScatterTernary + ( + [] ?A : seq<#IConvertible>, + [] ?B : seq<#IConvertible>, + [] ?C : seq<#IConvertible>, + [] ?Mode : StyleParam.Mode, + [] ?Sum : #IConvertible, + [] ?Labels : seq<#IConvertible>, + [] ?Name : string, + [] ?ShowLegend : bool, + [] ?MarkerSymbol : StyleParam.Symbol, + [] ?Color : Color, + [] ?Opacity : float, + [] ?TextPosition : StyleParam.TextPosition, + [] ?TextFont : Font, + [] ?Dash : StyleParam.DrawingStyle, + [] ?Width : float + + ) = + TraceTernary.initScatterTernary( + TraceTernaryStyle.ScatterTernary( + ?A = A, + ?B = B, + ?C = C, + ?Mode = Mode, + ?Sum = Sum + ) + ) + |> TraceStyle.TraceInfo(?Name=Name,?ShowLegend=ShowLegend,?Opacity=Opacity) + |> TraceStyle.Line(?Color=Color,?Dash=Dash,?Width=Width) + |> TraceStyle.Marker(?Color=Color,?Symbol=MarkerSymbol) + |> TraceStyle.TextLabel(?Text=Labels,?Textposition=TextPosition,?Textfont=TextFont) + |> GenericChart.ofTraceObject + + static member ScatterTernary + ( + abc, + [] ?Mode : StyleParam.Mode, + [] ?Sum : #IConvertible, + [] ?Labels : seq<#IConvertible>, + [] ?Name : string, + [] ?ShowLegend : bool, + [] ?MarkerSymbol : StyleParam.Symbol, + [] ?Color : Color, + [] ?Opacity : float, + [] ?TextPosition : StyleParam.TextPosition, + [] ?TextFont : Font, + [] ?Dash : StyleParam.DrawingStyle, + [] ?Width : float + ) = + let a,b,c = Seq.unzip3 abc + Chart.ScatterTernary( + A = a , + B = b , + C = c , + ?Mode = Mode , + ?Sum = Sum , + ?Labels = Labels , + ?Name = Name , + ?ShowLegend = ShowLegend , + ?MarkerSymbol = MarkerSymbol, + ?Color = Color , + ?Opacity = Opacity , + ?TextPosition = TextPosition, + ?TextFont = TextFont , + ?Dash = Dash , + ?Width = Width + ) + + static member PointTernary + ( + [] ?A : seq<#IConvertible>, + [] ?B : seq<#IConvertible>, + [] ?C : seq<#IConvertible>, + [] ?Sum : #IConvertible, + [] ?Labels : seq<#IConvertible>, + [] ?Name : string, + [] ?ShowLegend : bool, + [] ?MarkerSymbol : StyleParam.Symbol, + [] ?Color : Color, + [] ?Opacity : float, + [] ?TextPosition : StyleParam.TextPosition, + [] ?TextFont : Font + ) = + + let changeMode = StyleParam.ModeUtils.showText (TextPosition.IsSome || TextFont.IsSome) + + TraceTernary.initScatterTernary( + TraceTernaryStyle.ScatterTernary( + ?A = A, + ?B = B, + ?C = C, + Mode = changeMode StyleParam.Mode.Markers, + ?Sum = Sum + ) + ) + |> TraceStyle.TraceInfo(?Name=Name,?ShowLegend=ShowLegend,?Opacity=Opacity) + |> TraceStyle.Marker(?Color=Color,?Symbol=MarkerSymbol) + |> TraceStyle.TextLabel(?Text=Labels,?Textposition=TextPosition,?Textfont=TextFont) + |> GenericChart.ofTraceObject + + static member PointTernary + ( + abc, + [] ?Labels : seq<#IConvertible>, + [] ?Name : string, + [] ?ShowLegend : bool, + [] ?MarkerSymbol : StyleParam.Symbol, + [] ?Color : Color, + [] ?Opacity : float, + [] ?TextPosition : StyleParam.TextPosition, + [] ?TextFont : Font + + ) = + let changeMode = StyleParam.ModeUtils.showText (TextPosition.IsSome || TextFont.IsSome) + let a,b,c = Seq.unzip3 abc + + TraceTernary.initScatterTernary( + TraceTernaryStyle.ScatterTernary( + A = a, + B = b, + C = c, + Mode = changeMode StyleParam.Mode.Markers + ) + ) + |> TraceStyle.TraceInfo(?Name=Name,?ShowLegend=ShowLegend,?Opacity=Opacity) + |> TraceStyle.Marker(?Color=Color,?Symbol=MarkerSymbol) + |> TraceStyle.TextLabel(?Text=Labels,?Textposition=TextPosition,?Textfont=TextFont) + |> GenericChart.ofTraceObject + + static member LineTernary + ( + [] ?A : seq<#IConvertible>, + [] ?B : seq<#IConvertible>, + [] ?C : seq<#IConvertible>, + [] ?Sum : #IConvertible, + [] ?Labels : seq<#IConvertible>, + [] ?Name : string, + [] ?ShowLegend : bool, + [] ?ShowMarkers : bool, + [] ?Dash : StyleParam.DrawingStyle, + [] ?Width : float, + [] ?MarkerSymbol : StyleParam.Symbol, + [] ?Color : Color, + [] ?Opacity : float, + [] ?TextPosition : StyleParam.TextPosition, + [] ?TextFont : Font + ) = + + let changeMode = + let isShowMarker = + match ShowMarkers with + | Some isShow -> isShow + | Option.None -> false + StyleParam.ModeUtils.showText (TextPosition.IsSome || TextFont.IsSome) + >> StyleParam.ModeUtils.showMarker (isShowMarker) + + TraceTernary.initScatterTernary( + TraceTernaryStyle.ScatterTernary( + ?A = A, + ?B = B, + ?C = C, + Mode = changeMode StyleParam.Mode.Lines, + ?Sum = Sum + ) + ) + |> TraceStyle.Line(?Color=Color,?Dash=Dash,?Width=Width) + |> TraceStyle.TraceInfo(?Name=Name,?ShowLegend=ShowLegend,?Opacity=Opacity) + |> TraceStyle.Marker(?Color=Color,?Symbol=MarkerSymbol) + |> TraceStyle.TextLabel(?Text=Labels,?Textposition=TextPosition,?Textfont=TextFont) + |> GenericChart.ofTraceObject + + static member LineTernary + ( + abc, + [] ?Labels : seq<#IConvertible>, + [] ?Name : string, + [] ?ShowLegend : bool, + [] ?ShowMarkers : bool, + [] ?Dash : StyleParam.DrawingStyle, + [] ?Width : float, + [] ?MarkerSymbol : StyleParam.Symbol, + [] ?Color : Color, + [] ?Opacity : float, + [] ?TextPosition : StyleParam.TextPosition, + [] ?TextFont : Font + ) = + let a,b,c = Seq.unzip3 abc + + let changeMode = + let isShowMarker = + match ShowMarkers with + | Some isShow -> isShow + | Option.None -> false + StyleParam.ModeUtils.showText (TextPosition.IsSome || TextFont.IsSome) + >> StyleParam.ModeUtils.showMarker (isShowMarker) + + TraceTernary.initScatterTernary( + TraceTernaryStyle.ScatterTernary( + A = a, + B = b, + C = c, + Mode = changeMode StyleParam.Mode.Lines + ) + ) + |> TraceStyle.Line(?Color=Color,?Dash=Dash,?Width=Width) + |> TraceStyle.TraceInfo(?Name=Name,?ShowLegend=ShowLegend,?Opacity=Opacity) + |> TraceStyle.Marker(?Color=Color,?Symbol=MarkerSymbol) + |> TraceStyle.TextLabel(?Text=Labels,?Textposition=TextPosition,?Textfont=TextFont) + |> GenericChart.ofTraceObject \ No newline at end of file diff --git a/src/Plotly.NET/Layout/Layout.fs b/src/Plotly.NET/Layout/Layout.fs index 79b640618..1f93891b7 100644 --- a/src/Plotly.NET/Layout/Layout.fs +++ b/src/Plotly.NET/Layout/Layout.fs @@ -460,6 +460,30 @@ type Layout() = layout ) + static member tryGetTernaryById (id:StyleParam.SubPlotId) = + (fun (layout:Layout) -> + layout.TryGetTypedValue(StyleParam.SubPlotId.toString id) + ) + + /// Updates the style of current polar object with given Id. + /// If there does not exist a polar object with the given id, sets it with the given polar object + static member updateTernaryById + ( + id : StyleParam.SubPlotId, + ternary : Ternary + ) = + (fun (layout:Layout) -> + + let ternary' = + match layout |> Layout.tryGetTernaryById(id) with + | Some a -> DynObj.combine (unbox a) ternary + | None -> ternary :> DynamicObj + + ternary' |> DynObj.setValue layout (StyleParam.SubPlotId.toString id) + + layout + ) + static member SetLayoutGrid ( grid: LayoutGrid diff --git a/src/Plotly.NET/Layout/ObjectAbstractions/Ternary/Ternary.fs b/src/Plotly.NET/Layout/ObjectAbstractions/Ternary/Ternary.fs new file mode 100644 index 000000000..cbb4f1c9b --- /dev/null +++ b/src/Plotly.NET/Layout/ObjectAbstractions/Ternary/Ternary.fs @@ -0,0 +1,62 @@ +namespace Plotly.NET.LayoutObjects + +open Plotly.NET +open DynamicObj +open System +open System.Runtime.InteropServices + +type Ternary() = + inherit DynamicObj () + + /// + /// Initializes a ternary object + /// + /// Sets the ternary A Axis + /// Sets the ternary B Axis + /// Sets the ternary C Axis + /// Sets the ternary domain + /// The number each triplet should sum to, and the maximum range of each axis + static member init + ( + ?AAxis : LinearAxis, + ?BAxis : LinearAxis, + ?CAxis : LinearAxis, + ?Domain : Domain, + ?Sum : #IConvertible + ) = + Ternary() + |> Ternary.style + ( + ?AAxis = AAxis , + ?BAxis = BAxis , + ?CAxis = CAxis , + ?Domain = Domain, + ?Sum = Sum + ) + + /// + /// Creates a function that applies the given style parameters to a Ternary object. + /// + /// Sets the ternary A Axis + /// Sets the ternary B Axis + /// Sets the ternary C Axis + /// Sets the ternary domain + /// The number each triplet should sum to, and the maximum range of each axis + static member style + ( + ?AAxis : LinearAxis, + ?BAxis : LinearAxis, + ?CAxis : LinearAxis, + ?Domain : Domain, + ?Sum : #IConvertible + ) = + (fun (ternary:Ternary) -> + + AAxis |> DynObj.setValueOpt ternary "aaxis" + BAxis |> DynObj.setValueOpt ternary "baxis" + CAxis |> DynObj.setValueOpt ternary "caxis" + Domain |> DynObj.setValueOpt ternary "domain" + Sum |> DynObj.setValueOpt ternary "sum" + + ternary + ) \ No newline at end of file diff --git a/src/Plotly.NET/Playground.fsx b/src/Plotly.NET/Playground.fsx index 29b84debc..6f6148345 100644 --- a/src/Plotly.NET/Playground.fsx +++ b/src/Plotly.NET/Playground.fsx @@ -27,10 +27,10 @@ #load "Margin.fs" #load "Domain.fs" #load "Shape.fs" -#load "Hoverlabel.fs" #load "Annotation.fs" #load "LayoutGrid.fs" #load "Legend.fs" +#load "Hoverlabel.fs" #load "TickFormatStop.fs" #load "ColorBar.fs" #load "Rangebreak.fs" @@ -57,6 +57,10 @@ #load "RadialAxis.fs" #load "Polar.fs" +#I "Layout/ObjectAbstractions/Ternary" + +#load "Ternary.fs" + #load "Layout/Layout.fs" #I "Traces/ObjectAbstractions" @@ -121,6 +125,7 @@ #load "Chart3D.fs" #load "ChartPolar.fs" #load "ChartMap.fs" +#load "ChartTernary.fs" #load "ChartDomain.fs" #I "CSharpLayer" @@ -146,14 +151,40 @@ open Deedle open FSharpAux open System +open System.IO -let products = ["Product A"; "Product B"; "Product C"]; -let sfValues = [20; 14; 23] -Chart.Column ( products, - sfValues, - Labels= sfValues, - TextPosition = StyleParam.TextPosition.Inside +Chart.ScatterTernary( + A = [1; 2; 3], + B = [3; 2; 1], + C = [0; 1; 2], + Labels = ["A"; "B"; "C"], + Mode= StyleParam.Mode.Lines_Markers_Text, + TextPosition = StyleParam.TextPosition.BottomCenter ) +|> Chart.withLineStyle(Shape=StyleParam.Shape.Spline) +|> Chart.withMarkerStyle(Symbol = StyleParam.Symbol.Cross) +|> Chart.show + +Chart.LineTernary( + A = [10; 20; 30; 40; 50; 60; 70; 80;], + B = ([10; 20; 30; 40; 50; 60; 70; 80;] |> List.rev), + Sum = 100, + ShowMarkers = true, + Dash = StyleParam.DrawingStyle.DashDot +) +|> Chart.withTernary( + Ternary.init( + AAxis = LinearAxis.init(Color = Color.fromKeyword ColorKeyword.DarkOrchid), + BAxis = LinearAxis.init(Color = Color.fromKeyword ColorKeyword.DarkRed), + CAxis = LinearAxis.init(Color = Color.fromKeyword ColorKeyword.DarkCyan) + ) +) +|> Chart.show + +Chart.PointTernary([1,2,3]) +|> Chart.withAAxis(LinearAxis.init(Title = Title.init("A"), Color = Color.fromKeyword ColorKeyword.DarkOrchid)) +|> Chart.withBAxis(LinearAxis.init(Title = Title.init("B"), Color = Color.fromKeyword ColorKeyword.DarkRed)) +|> Chart.withCAxis(LinearAxis.init(Title = Title.init("C"), Color = Color.fromKeyword ColorKeyword.DarkCyan)) |> Chart.show let doughnutChart = @@ -394,6 +425,23 @@ let gridNew (nRows: int) (nCols: int) = |> TraceDomainStyle.SetDomain newDomain :> Trace ) + + | TraceIDLocal.Ternary -> + + let ternary = + layout.TryGetTypedValue "ternary" |> Option.defaultValue (Ternary.init()) + |> Ternary.style(Domain = Domain.init(Row = rowIndex - 1, Column = colIndex - 1)) + + let ternaryAnchor = StyleParam.SubPlotId.Ternary (i+1) + + gChart + |> GenericChart.mapTrace(fun t -> + t + :?> TraceTernary + |> TraceTernaryStyle.SetTernary ternaryAnchor + :> Trace + ) + |> Chart.withTernary(ternary,ternaryAnchor) ) |> Chart.combine |> Chart.withLayoutGrid ( @@ -445,7 +493,7 @@ gridNew 3 3 [ ] |> Chart.combine Chart.PointPolar([1,2]) - Chart.PointGeo([1,2]) + Chart.PointTernary([1,2,3]) Chart.PointMapbox([1,2]) |> Chart.withMapbox(Mapbox.init(Style = StyleParam.MapboxStyle.OpenStreetMap)) Chart.Sunburst( ["A";"B";"C";"D";"E"], diff --git a/src/Plotly.NET/Plotly.NET.fsproj b/src/Plotly.NET/Plotly.NET.fsproj index a8c1df59c..55b0fe870 100644 --- a/src/Plotly.NET/Plotly.NET.fsproj +++ b/src/Plotly.NET/Plotly.NET.fsproj @@ -66,6 +66,7 @@ + @@ -117,6 +118,7 @@ + @@ -129,6 +131,5 @@ - diff --git a/src/Plotly.NET/Traces/Trace.fs b/src/Plotly.NET/Traces/Trace.fs index 0e4714160..0c4bb0ae7 100644 --- a/src/Plotly.NET/Traces/Trace.fs +++ b/src/Plotly.NET/Traces/Trace.fs @@ -23,8 +23,8 @@ type TraceStyle() = ( [] ?Name: string, [] ?Visible: StyleParam.Visible, - [] ?Showlegend: bool, - [] ?Legendgroup:string, + [] ?ShowLegend: bool, + [] ?LegendGroup:string, [] ?Opacity: float, [] ?Uid: string, [] ?Hoverinfo: string @@ -34,8 +34,8 @@ type TraceStyle() = (fun (trace:('T :> Trace)) -> Name |> DynObj.setValueOpt trace "name" Visible |> DynObj.setValueOptBy trace "visible" StyleParam.Visible.toString - Showlegend |> DynObj.setValueOpt trace "showlegend" - Legendgroup |> DynObj.setValueOpt trace "legendgroup" + ShowLegend |> DynObj.setValueOpt trace "showlegend" + LegendGroup |> DynObj.setValueOpt trace "legendgroup" Opacity |> DynObj.setValueOpt trace "opacity" Uid |> DynObj.setValueOpt trace "uid" Hoverinfo |> DynObj.setValueOpt trace "hoverinfo" diff --git a/src/Plotly.NET/Traces/TraceTernary.fs b/src/Plotly.NET/Traces/TraceTernary.fs index bb357628e..6f587b83a 100644 --- a/src/Plotly.NET/Traces/TraceTernary.fs +++ b/src/Plotly.NET/Traces/TraceTernary.fs @@ -25,4 +25,81 @@ type TraceTernaryStyle() = TernaryId |> DynObj.setValueOptBy trace "subplot" StyleParam.SubPlotId.toString trace - ) \ No newline at end of file + ) + + static member ScatterTernary + ( + [] ?Name : string, + [] ?Visible : StyleParam.Visible, + [] ?ShowLegend : bool, + [] ?LegendRank : int, + [] ?LegendGroup : string, + [] ?LegendGroupTitle : Title, + [] ?Opacity : float, + [] ?Mode : StyleParam.Mode, + [] ?Ids : seq<#IConvertible>, + [] ?A : seq<#IConvertible>, + [] ?B : seq<#IConvertible>, + [] ?C : seq<#IConvertible>, + [] ?Text : seq<#IConvertible>, + [] ?TextPosition : StyleParam.TextPosition, + [] ?TextTemplate : string, + [] ?HoverText : string, + [] ?HoverInfo : StyleParam.HoverInfo, + [] ?HoverTemplate : string, + [] ?Meta : string, + [] ?CustomData : seq<#IConvertible>, + [] ?SubPlot : StyleParam.SubPlotId, + [] ?Marker : Marker, + [] ?Line : Line, + [] ?TextFont : Font, + [] ?SelectedPoints : seq<#IConvertible>, + [] ?Selected : Selection, + [] ?Unselected : Selection, + [] ?ClipOnAxis : bool, + [] ?ConnectGaps : bool, + [] ?Fill : StyleParam.Fill, + [] ?FillColor : Color, + [] ?HoverLabel : Hoverlabel, + [] ?HoverOn : StyleParam.HoverOn, + [] ?Sum : #IConvertible + + ) = + fun (trace: TraceTernary) -> + + Name |> DynObj.setValueOpt trace "name" + Visible |> DynObj.setValueOptBy trace "visible" StyleParam.Visible.convert + ShowLegend |> DynObj.setValueOpt trace "showlegend" + LegendRank |> DynObj.setValueOpt trace "legendrank" + LegendGroup |> DynObj.setValueOpt trace "legendgroup" + LegendGroupTitle |> DynObj.setValueOpt trace "legendgrouptitle" + Opacity |> DynObj.setValueOpt trace "opacity" + Mode |> DynObj.setValueOptBy trace "mode" StyleParam.Mode.convert + Ids |> DynObj.setValueOpt trace "ids" + A |> DynObj.setValueOpt trace "a" + B |> DynObj.setValueOpt trace "b" + C |> DynObj.setValueOpt trace "c" + Text |> DynObj.setValueOpt trace "text" + TextPosition |> DynObj.setValueOptBy trace "textposition" StyleParam.TextPosition.convert + TextTemplate |> DynObj.setValueOpt trace "texttemplate" + HoverText |> DynObj.setValueOpt trace "hovertext" + HoverInfo |> DynObj.setValueOptBy trace "hoverinfo" StyleParam.HoverInfo.convert + HoverTemplate |> DynObj.setValueOpt trace "hovertemplate" + Meta |> DynObj.setValueOpt trace "meta" + CustomData |> DynObj.setValueOpt trace "customdata" + SubPlot |> DynObj.setValueOptBy trace "subplot" StyleParam.SubPlotId.convert + Marker |> DynObj.setValueOpt trace "marker" + Line |> DynObj.setValueOpt trace "line" + TextFont |> DynObj.setValueOpt trace "textfont" + SelectedPoints |> DynObj.setValueOpt trace "selectedpoints" + Selected |> DynObj.setValueOpt trace "selected" + Unselected |> DynObj.setValueOpt trace "unselected" + ClipOnAxis |> DynObj.setValueOpt trace "cliponaxis" + ConnectGaps |> DynObj.setValueOpt trace "connectgaps" + Fill |> DynObj.setValueOptBy trace "fill" StyleParam.Fill.convert + FillColor |> DynObj.setValueOpt trace "fillcolor" + HoverLabel |> DynObj.setValueOpt trace "hoverlabel" + HoverOn |> DynObj.setValueOptBy trace "hoveron" StyleParam.HoverOn.convert + Sum |> DynObj.setValueOpt trace "sum" + + trace \ No newline at end of file diff --git a/tests/Plotly.NET.Tests/HtmlCodegen/TernaryCharts.fs b/tests/Plotly.NET.Tests/HtmlCodegen/TernaryCharts.fs new file mode 100644 index 000000000..94accb280 --- /dev/null +++ b/tests/Plotly.NET.Tests/HtmlCodegen/TernaryCharts.fs @@ -0,0 +1,58 @@ +module Tests.TernaryCharts + +open Expecto +open Plotly.NET +open Plotly.NET.LayoutObjects +open Plotly.NET.TraceObjects +open Plotly.NET.GenericChart +open System + +open TestUtils.HtmlCodegen + +let pointTernary = + Chart.PointTernary([1,2,3]) + |> Chart.withAAxis(LinearAxis.init(Title = Title.init("A"), Color = Color.fromKeyword ColorKeyword.DarkOrchid)) + |> Chart.withBAxis(LinearAxis.init(Title = Title.init("B"), Color = Color.fromKeyword ColorKeyword.DarkRed)) + |> Chart.withCAxis(LinearAxis.init(Title = Title.init("C"), Color = Color.fromKeyword ColorKeyword.DarkCyan)) + +let lineTernary = + Chart.LineTernary( + A = [10; 20; 30; 40; 50; 60; 70; 80;], + B = ([10; 20; 30; 40; 50; 60; 70; 80;] |> List.rev), + Sum = 100, + ShowMarkers = true, + Dash = StyleParam.DrawingStyle.DashDot + ) + |> Chart.withTernary( + Ternary.init( + AAxis = LinearAxis.init(Color = Color.fromKeyword ColorKeyword.DarkOrchid), + BAxis = LinearAxis.init(Color = Color.fromKeyword ColorKeyword.DarkRed), + CAxis = LinearAxis.init(Color = Color.fromKeyword ColorKeyword.DarkCyan) + ) + ) + +[] +let ``Ternary Point charts`` = + testList "TernaryCharts.Line charts" [ + testCase "Point data" ( fun () -> + """var data = [{"type":"scatterternary","mode":"markers","a":[1],"b":[2],"c":[3],"marker":{}}];""" + |> chartGeneratedContains pointTernary + ) + testCase "Point layout" ( fun () -> + """var layout = {"ternary":{"aaxis":{"color":"rgba(153, 50, 204, 1.0)","title":{"text":"A"}},"baxis":{"color":"rgba(139, 0, 0, 1.0)","title":{"text":"B"}},"caxis":{"color":"rgba(0, 139, 139, 1.0)","title":{"text":"C"}}}};""" + |> chartGeneratedContains pointTernary + ) + ] + +[] +let ``Ternary Line charts`` = + testList "TernaryCharts.Line charts" [ + testCase "Line data" ( fun () -> + """var data = [{"type":"scatterternary","mode":"lines+markers","a":[10,20,30,40,50,60,70,80],"b":[80,70,60,50,40,30,20,10],"sum":100,"line":{"dash":"dashdot"},"marker":{}}];""" + |> chartGeneratedContains lineTernary + ) + testCase "Line layout" ( fun () -> + """var layout = {"ternary":{"aaxis":{"color":"rgba(153, 50, 204, 1.0)"},"baxis":{"color":"rgba(139, 0, 0, 1.0)"},"caxis":{"color":"rgba(0, 139, 139, 1.0)"}}};""" + |> chartGeneratedContains lineTernary + ) + ] \ No newline at end of file diff --git a/tests/Plotly.NET.Tests/Plotly.NET.Tests.fsproj b/tests/Plotly.NET.Tests/Plotly.NET.Tests.fsproj index cfaa77368..cd019ed36 100644 --- a/tests/Plotly.NET.Tests/Plotly.NET.Tests.fsproj +++ b/tests/Plotly.NET.Tests/Plotly.NET.Tests.fsproj @@ -19,6 +19,7 @@ +