diff --git a/.claude/settings.local.json b/.claude/settings.local.json new file mode 100644 index 00000000..db3549ad --- /dev/null +++ b/.claude/settings.local.json @@ -0,0 +1,9 @@ +{ + "permissions": { + "allow": [ + "Bash(dotnet fsi *)", + "Bash(./build.cmd RunCSharpTestsFast)", + "Bash(./build.cmd Build)" + ] + } +} diff --git a/.claude/skills/chart-baseline-generation.md b/.claude/skills/chart-baseline-generation.md new file mode 100644 index 00000000..e3bd13a3 --- /dev/null +++ b/.claude/skills/chart-baseline-generation.md @@ -0,0 +1,116 @@ +--- +name: chart-baseline-generation +description: Use when working in Plotly.NET tests and you need to generate or refresh expected chart output values from real chart rendering instead of inventing assertion strings. This skill helps produce candidate data/layout/html baselines, extract stable segments, and convert investigated output into test expectations. +--- + +# Chart Baseline Generation + +Use this skill when a Plotly.NET test needs an expected string derived from actual chart output. + +## Goal + +Generate the real chart output first, inspect it, then copy only the stable part into the test as the expected value. + +Do not hand-write large expected strings from memory. + +## Prerequisites: build the dependency first + +The script loads Plotly.NET assemblies from `tests/ConsoleApps/CSharpConsole/bin/Debug/net10.0/`. Before running the script, verify that directory contains `Plotly.NET.dll` and `Plotly.NET.CSharp.dll`. If it is empty or the DLLs are missing, build them first via the FAKE pipeline: + +```powershell +./build.cmd Build +``` + +Any of the `Run*TestsFast` targets also produce these assemblies as a side effect, so if you are about to run tests anyway you can skip the explicit build step. + +If you edit sources in `src/Plotly.NET` or `src/Plotly.NET.CSharp` during the investigation, rebuild before re-running the script — `dotnet fsi` caches nothing for you here and stale DLLs silently produce wrong baselines. + +## Default workflow + +1. Ensure the dependency DLLs exist (see Prerequisites above); build them if missing. +2. Identify the chart fixture or chart-construction expression you want to validate. +3. Prefer an existing fixture from `tests/Common/FSharpTestBase/TestCharts/`. +4. If there is no suitable fixture, put a temporary focused chart expression into `tools/chart-baseline-generation/generate-chart-markup.fsx`. +5. Always use that script for both F# tests and C# tests. +6. For C# wrapper baselines, call `Plotly.NET.CSharp.Chart...` inside the F# script. +7. Keep `UseDefaults = false` on the chart to avoid noisy default template output. +8. Generate output with the same renderer the test uses: + - `GenericChart.toChartHTML` for shared chart html + - `GenericChart.toEmbeddedHTML` when the test is specifically about embedded output +9. Let the script print the stable sections you care about directly: `data`, `layout`, `config`, or `plotly-call`. +10. Inspect the generated section output and decide which part is stable enough to assert. +11. Copy the investigated value into the test. +12. Delete any temporary helper code before finishing. + +## Where to generate output + +Always use `tools/chart-baseline-generation/generate-chart-markup.fsx` as the investigation harness. Do not create or edit console app projects for this workflow. + +Edit `createChart()` in `tools/chart-baseline-generation/generate-chart-markup.fsx`, run the script for the section you need, inspect the generated output, then revert the temporary chart expression when finished. + +## How to run the script + +Examples: + +```powershell +dotnet fsi tools/chart-baseline-generation/generate-chart-markup.fsx +dotnet fsi tools/chart-baseline-generation/generate-chart-markup.fsx -- data +dotnet fsi tools/chart-baseline-generation/generate-chart-markup.fsx -- layout +dotnet fsi tools/chart-baseline-generation/generate-chart-markup.fsx -- html +dotnet fsi tools/chart-baseline-generation/generate-chart-markup.fsx -- data --write-html temp/chart.html +``` + +By default, the script prints extracted stable sections to stdout and does not create temporary files. + +Use `--write-html ` only when you explicitly want the full generated html on disk. + +Pick the smallest local loop that matches the test you are editing: + +- C# wrapper tests: `./build.cmd RunCSharpTestsFast` +- Core F# tests: `./build.cmd RunTestsCoreFast` +- Extension library tests: `./build.cmd RunTestsExtensionLibsFast` + +Use the full `./build.cmd runTestsAll` before committing. + +## Recommended temporary pattern + +For a one-off investigation, edit `tools/chart-baseline-generation/generate-chart-markup.fsx` so it generates the chart you need, then run the script with the section you want to inspect. + +Prefer temporary F# script code like: + +```fsharp +let html = GenericChart.toChartHTML chart +``` + +For C# wrapper baselines, still use the same script and create the chart with `Plotly.NET.CSharp.Chart...`, then render it with: + +```fsharp +let html = GenericChart.toChartHTML chart +``` + +Do not leave exploratory printouts or file dumps in committed script code. + +Do not create extra helper files for this workflow unless there is a strong reason. Prefer modifying `tools/chart-baseline-generation/generate-chart-markup.fsx` directly and then reverting the temporary code. + +## What to assert + +Prefer the smallest stable assertion that proves the behavior: + +- full `var data = ...;` block when validating trace serialization +- full `var layout = ...;` block when validating layout generation +- a small but meaningful substring only when the full block is too brittle + +Avoid asserting volatile values such as generated DOM ids. + +The unified script can print sections by label: + +- `data` +- `layout` +- `config` +- `plotly-call` + +## Investigation rules + +- Treat generated output as a candidate baseline, not automatically correct truth. +- Compare the output with the API intent and nearby F# tests before adopting it. +- If the output looks surprising, stop and investigate the chart construction rather than locking in a wrong baseline. diff --git a/.claude/skills/chart-baseline-generation/scripts/generate-chart-markup.fsx b/.claude/skills/chart-baseline-generation/scripts/generate-chart-markup.fsx new file mode 100644 index 00000000..6f92a6f6 --- /dev/null +++ b/.claude/skills/chart-baseline-generation/scripts/generate-chart-markup.fsx @@ -0,0 +1 @@ +#load "../../../../tools/chart-baseline-generation/generate-chart-markup.fsx" diff --git a/.codex/skills/chart-baseline-generation/SKILL.md b/.codex/skills/chart-baseline-generation/SKILL.md new file mode 100644 index 00000000..be1f4984 --- /dev/null +++ b/.codex/skills/chart-baseline-generation/SKILL.md @@ -0,0 +1,116 @@ +--- +name: chart-baseline-generation +description: Use when working in Plotly.NET tests and you need to generate or refresh expected chart output values from real chart rendering instead of inventing assertion strings. This skill helps agents produce candidate data/layout/html baselines, extract stable segments, and convert investigated output into test expectations. +--- + +# Chart Baseline Generation + +Use this skill when a Plotly.NET test needs an expected string derived from actual chart output. + +## Goal + +Generate the real chart output first, inspect it, then copy only the stable part into the test as the expected value. + +Do not hand-write large expected strings from memory. + +## Prerequisites: build the dependency first + +The script loads Plotly.NET assemblies from `tests/ConsoleApps/CSharpConsole/bin/Debug/net10.0/`. Before running the script, verify that directory contains `Plotly.NET.dll` and `Plotly.NET.CSharp.dll`. If it is empty or the DLLs are missing, build them first via the FAKE pipeline: + +```powershell +./build.cmd Build +``` + +Any of the `Run*TestsFast` targets also produce these assemblies as a side effect, so if you are about to run tests anyway you can skip the explicit build step. + +If you edit sources in `src/Plotly.NET` or `src/Plotly.NET.CSharp` during the investigation, rebuild before re-running the script — `dotnet fsi` caches nothing for you here and stale DLLs silently produce wrong baselines. + +## Default workflow + +1. Ensure the dependency DLLs exist (see Prerequisites above); build them if missing. +2. Identify the chart fixture or chart-construction expression you want to validate. +3. Prefer an existing fixture from `tests/Common/FSharpTestBase/TestCharts/`. +4. If there is no suitable fixture, put a temporary focused chart expression into `tools/chart-baseline-generation/generate-chart-markup.fsx`. +5. Always use that script for both F# tests and C# tests. +6. For C# wrapper baselines, call `Plotly.NET.CSharp.Chart...` inside the F# script. +7. Keep `UseDefaults = false` on the chart to avoid noisy default template output. +8. Generate output with the same renderer the test uses: + - `GenericChart.toChartHTML` for shared chart html + - `GenericChart.toEmbeddedHTML` when the test is specifically about embedded output +9. Let the script print the stable sections you care about directly: `data`, `layout`, `config`, or `plotly-call`. +10. Inspect the generated section output and decide which part is stable enough to assert. +11. Copy the investigated value into the test. +12. Delete any temporary helper code before finishing. + +## Where to generate output + +Always use `tools/chart-baseline-generation/generate-chart-markup.fsx` as the investigation harness. Do not create or edit console app projects for this workflow. + +Edit `createChart()` in `tools/chart-baseline-generation/generate-chart-markup.fsx`, run the script for the section you need, inspect the generated output, then revert the temporary chart expression when finished. + +## How to run the script + +Examples: + +```powershell +dotnet fsi tools/chart-baseline-generation/generate-chart-markup.fsx +dotnet fsi tools/chart-baseline-generation/generate-chart-markup.fsx -- data +dotnet fsi tools/chart-baseline-generation/generate-chart-markup.fsx -- layout +dotnet fsi tools/chart-baseline-generation/generate-chart-markup.fsx -- html +dotnet fsi tools/chart-baseline-generation/generate-chart-markup.fsx -- data --write-html temp/chart.html +``` + +By default, the script prints extracted stable sections to stdout and does not create temporary files. + +Use `--write-html ` only when you explicitly want the full generated html on disk. + +Pick the smallest local loop that matches the test you are editing: + +- C# wrapper tests: `./build.cmd RunCSharpTestsFast` +- Core F# tests: `./build.cmd RunTestsCoreFast` +- Extension library tests: `./build.cmd RunTestsExtensionLibsFast` + +Use the full `./build.cmd runTestsAll` before committing. + +## Recommended temporary pattern + +For a one-off investigation, edit `tools/chart-baseline-generation/generate-chart-markup.fsx` so it generates the chart you need, then run the script with the section you want to inspect. + +Prefer temporary F# script code like: + +```fsharp +let html = GenericChart.toChartHTML chart +``` + +For C# wrapper baselines, still use the same script and create the chart with `Plotly.NET.CSharp.Chart...`, then render it with: + +```fsharp +let html = GenericChart.toChartHTML chart +``` + +Do not leave exploratory printouts or file dumps in committed script code. + +Do not create extra helper files for this workflow unless there is a strong reason. Prefer modifying `tools/chart-baseline-generation/generate-chart-markup.fsx` directly and then reverting the temporary code. + +## What to assert + +Prefer the smallest stable assertion that proves the behavior: + +- full `var data = ...;` block when validating trace serialization +- full `var layout = ...;` block when validating layout generation +- a small but meaningful substring only when the full block is too brittle + +Avoid asserting volatile values such as generated DOM ids. + +The unified script can print sections by label: + +- `data` +- `layout` +- `config` +- `plotly-call` + +## Investigation rules + +- Treat generated output as a candidate baseline, not automatically correct truth. +- Compare the output with the API intent and nearby F# tests before adopting it. +- If the output looks surprising, stop and investigate the chart construction rather than locking in a wrong baseline. diff --git a/.codex/skills/chart-baseline-generation/scripts/generate-chart-markup.fsx b/.codex/skills/chart-baseline-generation/scripts/generate-chart-markup.fsx new file mode 100644 index 00000000..6f92a6f6 --- /dev/null +++ b/.codex/skills/chart-baseline-generation/scripts/generate-chart-markup.fsx @@ -0,0 +1 @@ +#load "../../../../tools/chart-baseline-generation/generate-chart-markup.fsx" diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 00000000..4a1c3de3 --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,37 @@ +# Generic devcontainer base; .NET 10 SDK is layered on via the dotnet feature +# in devcontainer.json (the dedicated dotnet:10.0 devcontainer image isn't +# published yet — pinned via global.json rollForward once installed). +FROM mcr.microsoft.com/devcontainers/base:bookworm + +# System deps for Plotly.NET.ImageExport tests (PuppeteerSharp downloads its own +# Chromium at runtime, but needs these shared libraries and fonts to launch it). +RUN apt-get update \ + && apt-get install -y --no-install-recommends \ + ca-certificates \ + fonts-liberation \ + libasound2 \ + libatk-bridge2.0-0 \ + libatk1.0-0 \ + libc6 \ + libcairo2 \ + libcups2 \ + libdbus-1-3 \ + libdrm2 \ + libexpat1 \ + libgbm1 \ + libglib2.0-0 \ + libgtk-3-0 \ + libnspr4 \ + libnss3 \ + libpango-1.0-0 \ + libx11-6 \ + libx11-xcb1 \ + libxcb1 \ + libxcomposite1 \ + libxdamage1 \ + libxext6 \ + libxfixes3 \ + libxkbcommon0 \ + libxrandr2 \ + xdg-utils \ + && rm -rf /var/lib/apt/lists/* diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 00000000..725cf19c --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,39 @@ +{ + "name": "Plotly.NET agent sandbox", + "build": { + "dockerfile": "Dockerfile" + }, + "features": { + "ghcr.io/devcontainers/features/dotnet:2": { + "version": "10.0", + "installUsingApt": false + }, + "ghcr.io/devcontainers/features/node:1": { + "version": "lts" + }, + "ghcr.io/devcontainers/features/github-cli:1": {} + }, + "remoteUser": "vscode", + "containerEnv": { + "DOTNET_CLI_TELEMETRY_OPTOUT": "1", + "DOTNET_NOLOGO": "1", + "NUGET_XMLDOC_MODE": "skip", + "PUPPETEER_SKIP_CHROMIUM_DOWNLOAD": "true" + }, + "postCreateCommand": "bash .devcontainer/postCreate.sh", + "mounts": [ + "source=${localEnv:HOME}${localEnv:USERPROFILE}/.claude,target=/home/vscode/.claude,type=bind,consistency=cached", + "source=${localEnv:HOME}${localEnv:USERPROFILE}/.claude.json,target=/home/vscode/.claude.json,type=bind,consistency=cached", + "source=${localEnv:HOME}${localEnv:USERPROFILE}/.codex,target=/home/vscode/.codex,type=bind,consistency=cached" + ], + "customizations": { + "vscode": { + "extensions": [ + "ms-dotnettools.csdevkit", + "ionide.ionide-fsharp", + "anthropic.claude-code", + "openai.chatgpt" + ] + } + } +} diff --git a/.devcontainer/postCreate.sh b/.devcontainer/postCreate.sh new file mode 100644 index 00000000..504cf061 --- /dev/null +++ b/.devcontainer/postCreate.sh @@ -0,0 +1,30 @@ +#!/usr/bin/env bash +set -euo pipefail + +echo "==> Restoring dotnet local tools (fantomas, fsdocs)" +dotnet tool restore + +echo "==> Warming up NuGet restore for the main solution" +dotnet restore Plotly.NET.sln || true + +echo "==> Installing agent CLIs globally (Claude Code + Codex)" +npm install -g \ + @anthropic-ai/claude-code \ + @openai/codex \ + opencode-ai@latest + +echo "==> Aliasing agent CLIs to skip approvals (sandbox is the devcontainer itself)" +cat >> ~/.bashrc <<'EOF' + +# devcontainer: agent CLIs skip approvals since the container IS the sandbox +alias claude='claude --dangerously-skip-permissions' +alias codex='codex --dangerously-bypass-approvals-and-sandbox' +EOF + +chmod +x build.sh + +echo "==> Done. Verify with:" +echo " ./build.sh # default build target" +echo " ./build.sh RunTestsAllFast" +echo " claude --version" +echo " codex --version" diff --git a/.opencode/skills/chart-baseline-generation/SKILL.md b/.opencode/skills/chart-baseline-generation/SKILL.md new file mode 100644 index 00000000..c715abe8 --- /dev/null +++ b/.opencode/skills/chart-baseline-generation/SKILL.md @@ -0,0 +1,81 @@ +--- +name: chart-baseline-generation +description: Generate Plotly.NET test baselines from real chart rendering so expected data or layout markup is derived from actual output instead of hand-written from memory. +compatibility: opencode +metadata: + audience: maintainers + workflow: chart-tests +--- + +# Chart Baseline Generation + +Use this skill when a Plotly.NET test needs an expected string derived from actual chart output. + +## Goal + +Generate the real chart output first, inspect it, then copy only the stable part into the test as the expected value. + +Do not hand-write large expected strings from memory. + +## Prerequisites + +The script loads Plotly.NET assemblies from `tests/ConsoleApps/CSharpConsole/bin/Debug/net10.0/`. +Before running the script, verify that directory contains `Plotly.NET.dll` and `Plotly.NET.CSharp.dll`. +If it is empty or the DLLs are missing, build them first via the FAKE pipeline: + +```powershell +./build.cmd Build +``` + +Any of the `Run*TestsFast` targets also produce these assemblies as a side effect, so if you are about to run tests anyway you can skip the explicit build step. + +If you edit sources in `src/Plotly.NET` or `src/Plotly.NET.CSharp` during the investigation, rebuild before re-running the script. `dotnet fsi` will happily use stale assemblies. + +## Workflow + +1. Ensure the dependency DLLs exist. +2. Identify the chart fixture or chart-construction expression you want to validate. +3. Prefer an existing fixture from `tests/Common/FSharpTestBase/TestCharts/`. +4. If there is no suitable fixture, put a temporary focused chart expression into `tools/chart-baseline-generation/generate-chart-markup.fsx`. +5. Use that script for both F# tests and C# tests. +6. For C# wrapper baselines, call `Plotly.NET.CSharp.Chart...` inside the F# script. +7. Keep `UseDefaults = false` on the chart to avoid noisy default template output. +8. Generate output with the same renderer the test uses. +9. Copy the smallest stable section into the test. +10. Revert any temporary helper code in the script before finishing. + +## Canonical Harness + +Always use `tools/chart-baseline-generation/generate-chart-markup.fsx` as the investigation harness. + +Edit `createChart()` in that script, run it for the section you need, inspect the generated output, then revert the temporary chart expression when finished. + +## Commands + +```powershell +dotnet fsi tools/chart-baseline-generation/generate-chart-markup.fsx +dotnet fsi tools/chart-baseline-generation/generate-chart-markup.fsx -- data +dotnet fsi tools/chart-baseline-generation/generate-chart-markup.fsx -- layout +dotnet fsi tools/chart-baseline-generation/generate-chart-markup.fsx -- html +dotnet fsi tools/chart-baseline-generation/generate-chart-markup.fsx -- data --write-html temp/chart.html +``` + +## Assertions + +Prefer the smallest stable assertion that proves the behavior: + +- full `var data = ...;` block when validating trace serialization +- full `var layout = ...;` block when validating layout generation +- a small but meaningful substring only when the full block is too brittle + +Avoid asserting volatile values such as generated DOM ids. + +## Verification + +Use the smallest matching FAKE target while iterating: + +- `./build.cmd RunCSharpTestsFast` +- `./build.cmd RunTestsCoreFast` +- `./build.cmd RunTestsExtensionLibsFast` + +Run the broader suite before committing when the change scope warrants it. diff --git a/.opencode/skills/chart-baseline-generation/scripts/generate-chart-markup.fsx b/.opencode/skills/chart-baseline-generation/scripts/generate-chart-markup.fsx new file mode 100644 index 00000000..6f92a6f6 --- /dev/null +++ b/.opencode/skills/chart-baseline-generation/scripts/generate-chart-markup.fsx @@ -0,0 +1 @@ +#load "../../../../tools/chart-baseline-generation/generate-chart-markup.fsx" diff --git a/AGENTS.md b/AGENTS.md index 0c55ec30..2c70e290 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -82,6 +82,18 @@ See [tests/README.md](tests/README.md) for the authoritative overview. Short ver ./build.cmd runTestsJSTests # JS / Mocha tests ``` +For faster local iteration, prefer the FAKE `*Fast` test targets. These skip the repo-wide `Clean` step and let `dotnet test` decide whether restore/build work is actually needed: + +```shell +./build.cmd RunTestsAllFast +./build.cmd RunTestsCoreFast +./build.cmd RunTestsExtensionLibsFast +./build.cmd RunImageExportTestsFast +./build.cmd RunCSharpTestsFast +``` + +Use the fast targets during implementation, but **always run a full `./build.cmd runTestsAll` before committing changes** so the clean end-to-end pipeline is exercised at least once. + ### Writing tests - Use `FSharpTestBase` helpers: `substringIsInChart`, `chartGeneratedContains`, `getFullPlotlyJS`, etc. - **Set `UseDefaults = false` on test charts** to avoid dumping the large default template HTML into test output and making diffs unreadable. @@ -114,6 +126,20 @@ When adding a new chart type or API surface, add or update the corresponding `.f - Main branch for PRs is **`dev`**, not `main`/`master`. - when prompted for planning the implementation of a feature, draft a plan file and put it into /plans. Use that document to split the planned commits for the feature into self-contained commits that include tests. When working on the feature, continuously update the plan with implementation notes and mark the planned commits as done when they are implemented. +## Agent workflows + +### Chart baseline generation + +- When adding or updating tests that assert chart markup, generate the expected `data` or `layout` from real chart rendering first. Do not hand-write large expected strings from memory. +- Use the canonical harness at `tools/chart-baseline-generation/generate-chart-markup.fsx`. +- Prefer existing fixtures from `tests/Common/FSharpTestBase/TestCharts/`. If there is no suitable fixture, temporarily edit `createChart()` in that script, run it, copy the stable section you need, then revert the temporary chart code. +- Keep `UseDefaults = false` on investigation charts to avoid noisy template output. +- Useful commands: + - `dotnet fsi tools/chart-baseline-generation/generate-chart-markup.fsx -- data` + - `dotnet fsi tools/chart-baseline-generation/generate-chart-markup.fsx -- layout` + - `dotnet fsi tools/chart-baseline-generation/generate-chart-markup.fsx -- html` +- For local verification, prefer the smallest matching FAKE target such as `./build.cmd RunCSharpTestsFast`, `./build.cmd RunTestsCoreFast`, or `./build.cmd RunTestsExtensionLibsFast`. + ### Upstream changes from plotly.js - Plotly.NET wraps plotly.js. diff --git a/build/TestTasks.fs b/build/TestTasks.fs index ddff30d6..6a909816 100644 --- a/build/TestTasks.fs +++ b/build/TestTasks.fs @@ -2,6 +2,7 @@ module TestTasks open BlackFox.Fake open Fake.DotNet +open Fake.Core open ProjectInfo open BasicTasks @@ -47,6 +48,28 @@ let createRunTestTask (name: string) (deps: BuildTask.TaskInfo list) (projects: ) } +let createRunTestFastTask (name: string) (projects: ProjectInfo list) = + BuildTask.create name [] { + Trace.trace $"Running {name} without Clean, while letting dotnet test handle restore and incremental builds." + + projects + |> Seq.iter (fun testProjectInfo -> + Fake.DotNet.DotNet.test + (fun testParams -> + { testParams with + Logger = Some "console;verbosity=detailed" + Configuration = DotNet.BuildConfiguration.fromString configuration + MSBuildParams = { testParams.MSBuildParams with DisableInternalBinLog = true } + } + |> DotNet.Options.withCustomParams (Some "-tl") + ) + testProjectInfo.ProjFile + ) + } + +let createRunSingleTestProjectFastTask (project: ProjectInfo) = + createRunTestFastTask $"Run{project.Name}Fast" [ project ] + /// runs the all test projects via `dotnet test` let runTestsAll = createRunTestTask "RunTestsAll" [ clean; build; buildTestsAll ] (testProjectsCore @ testProjectsExtensionsLibs) @@ -55,3 +78,18 @@ let runTestsCore = createRunTestTask "RunTestsCore" [ clean; build; buildTestsCo /// runs the extension lib test projects via `dotnet test` let runTestsExtensionLibs = createRunTestTask "RunTestsExtensionLibs" [ clean; build; buildTestsExtensionsLibs] testProjectsExtensionsLibs + +/// runs all test projects via incremental `dotnet test`, without cleaning first. +let runTestsAllFast = createRunTestFastTask "RunTestsAllFast" (testProjectsCore @ testProjectsExtensionsLibs) + +/// runs core test projects via incremental `dotnet test`, without cleaning first. +let runTestsCoreFast = createRunTestFastTask "RunTestsCoreFast" testProjectsCore + +/// runs extension lib test projects via incremental `dotnet test`, without cleaning first. +let runTestsExtensionLibsFast = createRunTestFastTask "RunTestsExtensionLibsFast" testProjectsExtensionsLibs + +/// runs the ImageExportTests project via incremental `dotnet test`, without cleaning first. +let runImageExportTestsFast = createRunSingleTestProjectFastTask ImageExportTestProject + +/// runs the CSharpTests project via incremental `dotnet test`, without cleaning first. +let runCSharpTestsFast = createRunSingleTestProjectFastTask CSharpTestProject diff --git a/plans/CSharpChartApiFileSplit.md b/plans/CSharpChartApiFileSplit.md new file mode 100644 index 00000000..ef77de5c --- /dev/null +++ b/plans/CSharpChartApiFileSplit.md @@ -0,0 +1,501 @@ +# C# Chart API File Split Plan + +## Background + +The C# Chart API wrapper in [src/Plotly.NET.CSharp/ChartAPI/](src/Plotly.NET.CSharp/ChartAPI/) is still split only by chart family: + +| File | Lines | +|---|---:| +| [Chart2D.cs](src/Plotly.NET.CSharp/ChartAPI/Chart2D.cs) | 2723 | +| [ChartDomain.cs](src/Plotly.NET.CSharp/ChartAPI/ChartDomain.cs) | 876 | +| [ChartMap.cs](src/Plotly.NET.CSharp/ChartAPI/ChartMap.cs) | 871 | +| [Chart3D.cs](src/Plotly.NET.CSharp/ChartAPI/Chart3D.cs) | 834 | +| [ChartCarpet.cs](src/Plotly.NET.CSharp/ChartAPI/ChartCarpet.cs) | 607 | +| [ChartPolar.cs](src/Plotly.NET.CSharp/ChartAPI/ChartPolar.cs) | 482 | +| [ChartTernary.cs](src/Plotly.NET.CSharp/ChartAPI/ChartTernary.cs) | 361 | +| [ChartSmith.cs](src/Plotly.NET.CSharp/ChartAPI/ChartSmith.cs) | 334 | + +The F# Chart API has already been split into smaller files grouped by chart-type families. The C# wrapper still concentrates many generated-looking forwarding methods plus long XML doc blocks into single family files, especially [Chart2D.cs](src/Plotly.NET.CSharp/ChartAPI/Chart2D.cs). That makes review, navigation, and future edits harder than they need to be. + +The goal of this refactor is purely structural: + +- keep the public C# API surface unchanged, +- preserve `Plotly.NET.CSharp.Chart.*` as the entry point, +- reorganize the wrapper implementation into per-family folders and root-level utility files, +- use one partial-class file per chart type or tightly related chart group, +- add per-chart wrapper tests alongside the split so each moved chart keeps explicit coverage. + +## Target layout + +Create subfolders under [src/Plotly.NET.CSharp/ChartAPI/](src/Plotly.NET.CSharp/ChartAPI/) and move methods into one `public static partial class Chart` file per chart or tightly related chart group. + +```text +src/Plotly.NET.CSharp/ChartAPI/ + Chart/ + Combine.cs + Grid.cs + SingleStack.cs + Invisible.cs + Chart2D/ + Scatter.cs + Point.cs + Line.cs + Spline.cs + Bubble.cs + Range.cs + Pareto.cs + Area.cs + SplineArea.cs + StackedArea.cs + Funnel.cs + StackedFunnel.cs + Waterfall.cs + Bar.cs + StackedBar.cs + Column.cs + StackedColumn.cs + Histogram.cs + Histogram2D.cs + Histogram2DContour.cs + BoxPlot.cs + Violin.cs + Heatmap.cs + AnnotatedHeatmap.cs + Image.cs + Contour.cs + OHLC.cs + Candlestick.cs + Splom.cs + PointDensity.cs + Chart3D/ + Scatter3D.cs + Point3D.cs + Line3D.cs + Bubble3D.cs + Surface.cs + Mesh3D.cs + Cone.cs + StreamTube.cs + Volume.cs + IsoSurface.cs + ChartPolar/ + ScatterPolar.cs + PointPolar.cs + LinePolar.cs + SplinePolar.cs + BubblePolar.cs + BarPolar.cs + ChartMap/ + ChoroplethMap.cs + ScatterGeo.cs + PointGeo.cs + LineGeo.cs + BubbleGeo.cs + ScatterMapbox.cs + PointMapbox.cs + LineMapbox.cs + BubbleMapbox.cs + ChoroplethMapbox.cs + DensityMapbox.cs + ChartTernary/ + ScatterTernary.cs + PointTernary.cs + LineTernary.cs + BubbleTernary.cs + ChartCarpet/ + Carpet.cs + ScatterCarpet.cs + PointCarpet.cs + LineCarpet.cs + SplineCarpet.cs + BubbleCarpet.cs + ContourCarpet.cs + ChartDomain/ + Pie.cs + Doughnut.cs + FunnelArea.cs + Sunburst.cs + Treemap.cs + ParallelCoord.cs + ParallelCategories.cs + Sankey.cs + Table.cs + Indicator.cs + Icicle.cs + ChartSmith/ + ScatterSmith.cs + PointSmith.cs + LineSmith.cs + BubbleSmith.cs +``` + +Notes: + +- The current root file [Chart.cs](src/Plotly.NET.CSharp/ChartAPI/Chart.cs) should be split into a top-level [Chart/](src/Plotly.NET.CSharp/ChartAPI/Chart/) folder, with one partial-class file per helper method or tightly related helper group. +- The current family files (`Chart2D.cs`, `Chart3D.cs`, etc.) should be removed once their members are fully migrated. +- SDK-style project defaults should include new `**/*.cs` files automatically, so no `.csproj` item updates are expected unless we deliberately add build metadata later. +- Test coverage should land in [tests/ExtensionLibsTests/CSharpTests/](tests/ExtensionLibsTests/CSharpTests/), which already contains the Plotly.NET.CSharp xUnit suite. + +## File shape + +Each new file should look like this: + +```csharp +using Plotly.NET; +using Plotly.NET.LayoutObjects; +using Plotly.NET.TraceObjects; +using static Plotly.NET.StyleParam; + +namespace Plotly.NET.CSharp; + +public static partial class Chart +{ + /// ... + public static GenericChart Scatter(...) + where XType : IConvertible + where YType : IConvertible + where TextType : IConvertible + => Plotly.NET.Chart2D_Scatter.Chart.Scatter(...); +} +``` + +Implementation rules: + +- Keep the namespace and class name unchanged: `Plotly.NET.CSharp.Chart`. +- Preserve method names, generic parameter names, parameter order, default values, constraints, and XML docs exactly unless a follow-up cleanup explicitly chooses otherwise. +- Keep all overloads of the same method name in the same file. Example: both `Pareto` overloads stay together in `Pareto.cs`. +- Keep the forwarding target unchanged apart from moving the source file. Example: `Scatter` should still call `Plotly.NET.Chart2D_Scatter.Chart.Scatter(...)`. +- Avoid opportunistic API cleanup in the same refactor. This is a file-structure change, not a signature redesign. +- Apply the same rule to root-level helpers from `Chart.cs`: `Combine`, `Invisible`, `Grid`, and `SingleStack` move into their own files without behavioral changes. +- For each chart method that moves, add or move a focused C# test that proves the wrapper still produces the expected chart output. + +## Testing strategy + +The file split should ship with stronger C# wrapper coverage, not just structural changes. + +### Test location + +Add the new wrapper tests under [tests/ExtensionLibsTests/CSharpTests/](tests/ExtensionLibsTests/CSharpTests/), mirroring the production folder layout: + +```text +tests/ExtensionLibsTests/CSharpTests/ + Chart/ + CombineTests.cs + GridTests.cs + SingleStackTests.cs + InvisibleTests.cs + Chart2D/ + ScatterTests.cs + PointTests.cs + ... + Chart3D/ + Scatter3DTests.cs + ... +``` + +If the suite grows enough to justify shared helpers, add them under [tests/Common/CSharpTestBase/](tests/Common/CSharpTestBase/) rather than duplicating setup logic. + +### Fixture reuse preference + +Preferred order: + +1. Reuse the existing F# fixtures from [tests/Common/FSharpTestBase/TestCharts/](tests/Common/FSharpTestBase/TestCharts/) when they are accessible cleanly from C#. +2. If direct C# consumption is awkward because of F# module shape, nested modules, or backtick-named values, add a thin stable accessor layer in `FSharpTestBase` or a mirrored C# fixture in `CSharpTestBase`. +3. Only create fully independent C# fixture data when reuse would add more indirection than value. + +Practical guidance: + +- Many current F# fixtures already express the canonical expected charts and consistently set `UseDefaults = false`; that should remain the source of truth where possible. +- If C# cannot consume a fixture ergonomically, prefer mirroring that fixture with the same data and intent, and document the correspondence in the test file or helper. +- For charts that already have no concrete F# fixture yet, such as placeholders like `StackedFunnel` or `Waterfall`, create a C# mirror fixture until the F# side gains one. + +### Assertion style + +Use focused output-based assertions similar to the existing `htmlcodegen/SimpleTests.cs`: + +- assert on stable JSON/HTML substrings that identify the expected trace type and key options, +- avoid brittle full-document snapshots unless a chart genuinely needs broad coverage, +- keep `UseDefaults = false` on all fixture charts to avoid noisy template output, +- prefer one representative test per chart method, with extra tests only for overloads or behavior that differs materially. + +### Shared test utilities + +The current C# test base is effectively empty, so part of this work should be to make it useful: + +- move or generalize `tests/ExtensionLibsTests/CSharpTests/TestUtils.cs` into [tests/Common/CSharpTestBase/](tests/Common/CSharpTestBase/) if multiple test folders start reusing it, +- add reusable chart-fixture accessors there when mirrored C# fixtures are needed, +- keep helper names aligned with the F# `TestUtils` vocabulary where that improves cross-language readability. + +## Refactor strategy + +The safest path is to mirror the F# split that already exists and move the C# wrappers in small, buildable slices. + +### Phase 1: Establish the pattern on Chart2D + +Start with the largest file because it gives the biggest readability win and validates the folder conventions. Use one chart file per public method group. + +Recommended first moves: + +- `Scatter.cs` +- `Point.cs` +- `Line.cs` +- `Spline.cs` +- `Bubble.cs` +- `Range.cs` +- `Pareto.cs` + +These methods already target `Plotly.NET.Chart2D_Scatter.Chart` and `Plotly.NET.Chart2D_Statistical.Chart`, so they form a natural first slice. + +Add matching C# tests for each moved chart method in `tests/ExtensionLibsTests/CSharpTests/Chart2D/`, reusing the existing F# fixtures where practical and mirroring them where direct reuse is not worth the friction. + +### Phase 2: Finish Chart2D + +Migrate the remaining 2D files in coherent clusters: + +- area family: `Area`, `SplineArea`, `StackedArea` +- funnel family: `Funnel`, `StackedFunnel`, `Waterfall` +- bar family: `Bar`, `StackedBar`, `Column`, `StackedColumn` +- histogram/distribution family: `Histogram`, `Histogram2D`, `Histogram2DContour`, `BoxPlot`, `Violin` +- heatmap/image family: `Heatmap`, `AnnotatedHeatmap`, `Image`, `Contour` +- finance/dimension family: `OHLC`, `Candlestick`, `Splom`, `PointDensity` + +Delete [Chart2D.cs](src/Plotly.NET.CSharp/ChartAPI/Chart2D.cs) only after all 2D methods have landed in their new files and the build is green. + +Finish the 2D test coverage in the same phase so the folder structure and test structure stay in sync. + +### Phase 3: Split the root Chart helpers + +Move the current root-level methods from [Chart.cs](src/Plotly.NET.CSharp/ChartAPI/Chart.cs) into dedicated files: + +- `Chart/Combine.cs` +- `Chart/Invisible.cs` +- `Chart/Grid.cs` +- `Chart/SingleStack.cs` + +Delete [Chart.cs](src/Plotly.NET.CSharp/ChartAPI/Chart.cs) once it no longer contains members. + +Add coverage for `Combine`, `Invisible`, `Grid`, and `SingleStack` in `tests/ExtensionLibsTests/CSharpTests/Chart/`. + +### Phase 4: Migrate the medium-sized families + +Recommended order: + +1. `Chart3D` +2. `ChartMap` +3. `ChartDomain` +4. `ChartCarpet` +5. `ChartPolar` +6. `ChartTernary` +7. `ChartSmith` + +This order roughly follows size and payoff. It also keeps the more repetitive scatter-derived families for later, when the pattern is already proven. + +Each family migration should include the corresponding test folder in the same commit or commit pair. + +### Phase 5: Optional follow-up cleanup + +Only after the structural split is complete and verified: + +- consider consolidating repeated `using` directives with project-level global usings if the team wants that style, +- consider shared editorconfig or file-header conventions for the new folders, +- consider whether related tiny files should be re-merged if one-method-per-file becomes too granular in practice. + +This should be a separate decision, not bundled into the main refactor. + +## Risks and verification + +- **Public API drift.** The main risk is accidentally changing signatures while moving code. Mitigation: copy methods verbatim, then trim the old files. +- **XML documentation drift.** Large comment blocks are easy to damage during moves. Mitigation: prefer whole-method moves and review generated XML docs through a normal build. +- **Duplicate method definitions.** Partial classes merge all members; leaving the old method behind while adding the new one will create compile errors. Mitigation: migrate by cut-over, not by copy-and-forget. +- **Overload separation mistakes.** Unlike the F# side, C# can spread overloads across partial class files, but that makes navigation worse. Mitigation: keep overload families together in one file. +- **Root helper discoverability.** Splitting `Chart.cs` removes the single obvious location for shared helpers. Mitigation: use intuitive filenames that exactly match the public method names. +- **Too many tiny commits.** One-file-per-method is good for layout, but not every single file needs its own commit. Mitigation: commit in family-sized batches that remain reviewable. +- **Style inconsistency.** Mixing block-scoped and file-scoped namespaces or varying `using` sets would create noise. Mitigation: pick one file template and apply it consistently across new files. +- **Fixture reuse friction across F# and C#.** Some F# test-chart modules may not be pleasant to consume directly from C#. Mitigation: prefer reuse, but allow mirrored fixtures in `CSharpTestBase` when access is awkward. +- **Coverage gaps during the move.** A pure file split could accidentally preserve compile success while breaking a forwarder. Mitigation: require at least one representative C# test per chart method as part of the migration. + +Verification for each commit: + +```shell +./build.cmd +./build.cmd runTestsCore +./build.cmd runTestsExtensionLibs +``` + +If a commit only touches C# wrappers and the full build is too expensive during active iteration, at minimum run: + +```shell +./build.cmd runTestsExtensionLibs +./build.cmd runTestsCore +``` + +Before the final merge, run the broader build target used by the team for confidence. + +## Commit packages + +Each commit should stay independently buildable and should include verification. + +### Commit 1: Chart2D scatter-derived wrapper split + +Scope: + +- Create `src/Plotly.NET.CSharp/ChartAPI/Chart2D/`. +- Move `Scatter`, `Point`, `Line`, `Spline`, `Bubble`, `Range`, and both `Pareto` overloads into dedicated files. +- Trim the moved members from [Chart2D.cs](src/Plotly.NET.CSharp/ChartAPI/Chart2D.cs). +- Add `tests/ExtensionLibsTests/CSharpTests/Chart2D/` with representative tests for the moved methods. +- Reuse the matching F# fixtures if they are accessible cleanly from C#; otherwise add mirrored fixture helpers. +- Keep signatures and docs unchanged. +- Run `./build.cmd runTestsCore` and `./build.cmd runTestsExtensionLibs`. + +Exit criteria: + +- New `Chart2D/` folder exists. +- The moved methods compile from partial-class files. +- `Chart2D.cs` is materially smaller. +- The moved chart methods have explicit C# wrapper tests. + +Implementation notes: + +- Done. All seven scatter-derived method groups live in [src/Plotly.NET.CSharp/ChartAPI/Chart2D/](src/Plotly.NET.CSharp/ChartAPI/Chart2D/): `Scatter.cs`, `Point.cs`, `Line.cs`, `Spline.cs`, `Bubble.cs`, `Range.cs`, `Pareto.cs` (both overloads together). +- Those methods have been removed from [Chart2D.cs](src/Plotly.NET.CSharp/ChartAPI/Chart2D.cs) (now ~2081 lines, down from ~2564). +- Test coverage lives under [tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart2D/](tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart2D/) — one `*Tests.cs` per method, with mirrored C# fixtures using `UseDefaults = false` and full `var data = ...` baseline assertions. +- Verification: `./build.cmd RunCSharpTestsFast` (16 passed), `./build.cmd runTestsExtensionLibs` (16 passed), `./build.cmd runTestsCore` (933 passed). + +### Commit 2: Finish Chart2D wrapper split + +Scope: + +- Add the remaining `Chart2D/*.cs` files. +- Remove the rest of the methods from [Chart2D.cs](src/Plotly.NET.CSharp/ChartAPI/Chart2D.cs). +- Delete [Chart2D.cs](src/Plotly.NET.CSharp/ChartAPI/Chart2D.cs) once empty. +- Add the remaining `Chart2D/*Tests.cs` coverage. +- Run `./build.cmd runTestsCore` and `./build.cmd runTestsExtensionLibs`. + +Exit criteria: + +- All 2D wrapper methods live under `ChartAPI/Chart2D/`. +- No `Chart2D.cs` remains. +- All 2D wrapper methods have dedicated C# tests. + +Implementation notes: + +- Added the remaining `tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart2D/*Tests.cs` coverage for the split `Chart2D` wrappers: `Bar`, `StackedBar`, `Column`, `StackedColumn`, `Funnel`, `StackedFunnel`, `Waterfall`, `Histogram`, `Histogram2D`, `Histogram2DContour`, `BoxPlot`, `Violin`, `Heatmap`, `AnnotatedHeatmap`, `Image`, `Contour`, `OHLC`, `Candlestick`, `Splom`, and `PointDensity`. +- Generated the expected `data`/`layout` baselines from real chart rendering via `tools/chart-baseline-generation/generate-chart-markup.fsx` instead of hand-authoring the markup. +- Verification: `./build.cmd RunCSharpTestsFast` / `dotnet run --project ./build/build.fsproj -- RunCSharpTestsFast` (45 passed). + +### Commit 3: Split root Chart helpers + +Scope: + +- Add `Combine.cs`, `Invisible.cs`, `Grid.cs`, and `SingleStack.cs` under `src/Plotly.NET.CSharp/ChartAPI/Chart/`. +- Move the corresponding methods out of [Chart.cs](src/Plotly.NET.CSharp/ChartAPI/Chart.cs). +- Delete [Chart.cs](src/Plotly.NET.CSharp/ChartAPI/Chart.cs) once empty. +- Add `tests/ExtensionLibsTests/CSharpTests/Chart/` coverage for the moved helpers. +- Run `./build.cmd runTestsCore` and `./build.cmd runTestsExtensionLibs`. + +Why here: + +- It keeps the refactor rule consistent across the whole C# Chart API before moving on to the remaining family files. +- The low method count makes this a safe, fast validation of the root-level pattern. + +Implementation notes: + +- Split the root `Chart` wrapper into dedicated partials under [src/Plotly.NET.CSharp/ChartAPI/Chart/](src/Plotly.NET.CSharp/ChartAPI/Chart/): `Combine.cs`, `Invisible.cs`, `Grid.cs`, and `SingleStack.cs`. +- Deleted [Chart.cs](src/Plotly.NET.CSharp/ChartAPI/Chart.cs) after moving the last root helper methods out of it. +- Added focused C# html-codegen coverage under [tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart/](tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart/) for `Combine`, `Invisible`, `Grid`, and `SingleStack`, including baselines for the serialized invisible chart output. +- Verification: `dotnet run --project ./build/build.fsproj -- RunCSharpTestsFast` (52 passed), `dotnet run --project ./build/build.fsproj -- RunTestsExtensionLibsFast` (C# tests 52 passed; ImageExportTests 6 passed, 2 skipped). + +### Commit 4: Split Chart3D and ChartPolar + +Scope: + +- Create `ChartAPI/Chart3D/` and `ChartAPI/ChartPolar/`. +- Move each chart method into its own file. +- Delete [Chart3D.cs](src/Plotly.NET.CSharp/ChartAPI/Chart3D.cs) and [ChartPolar.cs](src/Plotly.NET.CSharp/ChartAPI/ChartPolar.cs) after migration. +- Add `tests/ExtensionLibsTests/CSharpTests/Chart3D/` and `tests/ExtensionLibsTests/CSharpTests/ChartPolar/`. +- Run `./build.cmd runTestsCore` and `./build.cmd runTestsExtensionLibs`. + +Why this pairing: + +- Both families are direct scatter-style wrappers and are straightforward once Chart2D is done. + +Implementation notes: + +- `Chart3D/` and `ChartPolar/` source folders were already present in the branch, so this work package focused on the missing C# html-codegen coverage for those wrappers rather than another source-file move. +- Added focused C# wrapper serialization tests under [tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart3D/](tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart3D/) for `Scatter3D`, `Point3D`, `Line3D`, `Bubble3D`, `Surface`, `Mesh3D`, `Cone`, `StreamTube`, `Volume`, and `IsoSurface`. +- Added matching C# wrapper serialization tests under [tests/ExtensionLibsTests/CSharpTests/htmlcodegen/ChartPolar/](tests/ExtensionLibsTests/CSharpTests/htmlcodegen/ChartPolar/) for `ScatterPolar`, `PointPolar`, `LinePolar`, `SplinePolar`, `BubblePolar`, and `BarPolar`. +- Derived and corrected the new expected markup against actual rendered output during verification, including the `BubblePolar` and `BarPolar` baseline differences. +- Verification: `dotnet run --project ./build/build.fsproj -- RunCSharpTestsFast` (68 passed), `dotnet run --project ./build/build.fsproj -- RunTestsCoreFast` (933 passed), `dotnet run --project ./build/build.fsproj -- RunTestsExtensionLibsFast` (C# tests 68 passed; ImageExportTests 6 passed, 2 skipped). + +### Commit 5: Split ChartMap and ChartTernary + +Scope: + +- Create `ChartAPI/ChartMap/` and `ChartAPI/ChartTernary/`. +- Move each chart method into its own file. +- Delete [ChartMap.cs](src/Plotly.NET.CSharp/ChartAPI/ChartMap.cs) and [ChartTernary.cs](src/Plotly.NET.CSharp/ChartAPI/ChartTernary.cs) after migration. +- Add `tests/ExtensionLibsTests/CSharpTests/ChartMap/` and `tests/ExtensionLibsTests/CSharpTests/ChartTernary/`. +- Run `./build.cmd runTestsCore` and `./build.cmd runTestsExtensionLibs`. + +Implementation notes: + +- `ChartMap/` and `ChartTernary/` source folders were already present in the branch, so this package focused on adding the missing C# html-codegen coverage for those wrappers. +- Added focused C# wrapper serialization tests under [tests/ExtensionLibsTests/CSharpTests/htmlcodegen/ChartMap/](tests/ExtensionLibsTests/CSharpTests/htmlcodegen/ChartMap/) for `ScatterGeo`, `PointGeo`, `LineGeo`, `BubbleGeo`, `ScatterMapbox`, `PointMapbox`, `LineMapbox`, `BubbleMapbox`, `DensityMapbox`, `ChoroplethMap`, and `ChoroplethMapbox`. +- Added focused C# wrapper serialization tests under [tests/ExtensionLibsTests/CSharpTests/htmlcodegen/ChartTernary/](tests/ExtensionLibsTests/CSharpTests/htmlcodegen/ChartTernary/) for `ScatterTernary`, `PointTernary`, `LineTernary`, and `BubbleTernary`. +- Corrected the initial baselines against actual serialized output for `BubbleGeo`, `BubbleMapbox`, and `ChoroplethMapbox` where the emitted shape differed from the first-pass expectation. +- Verification: `dotnet run --project ./build/build.fsproj -- RunCSharpTestsFast` (83 passed), `dotnet run --project ./build/build.fsproj -- RunTestsCoreFast` (933 passed), `dotnet run --project ./build/build.fsproj -- RunTestsExtensionLibsFast` (C# tests 83 passed; ImageExportTests 6 passed, 2 skipped). + +### Commit 6: Split ChartDomain, ChartCarpet, and ChartSmith + +Scope: + +- Create `ChartAPI/ChartDomain/`, `ChartAPI/ChartCarpet/`, and `ChartAPI/ChartSmith/`. +- Move each chart method into its own file. +- Delete [ChartDomain.cs](src/Plotly.NET.CSharp/ChartAPI/ChartDomain.cs), [ChartCarpet.cs](src/Plotly.NET.CSharp/ChartAPI/ChartCarpet.cs), and [ChartSmith.cs](src/Plotly.NET.CSharp/ChartAPI/ChartSmith.cs) after migration. +- Add `tests/ExtensionLibsTests/CSharpTests/ChartDomain/`, `tests/ExtensionLibsTests/CSharpTests/ChartCarpet/`, and `tests/ExtensionLibsTests/CSharpTests/ChartSmith/`. +- Run `./build.cmd runTestsCore` and `./build.cmd runTestsExtensionLibs`. + +Implementation notes: + +- `ChartDomain/`, `ChartCarpet/`, and `ChartSmith/` source folders were already present in the branch, so this package focused on filling the missing C# html-codegen coverage for those wrapper families. +- Added C# wrapper serialization coverage under [tests/ExtensionLibsTests/CSharpTests/htmlcodegen/ChartDomain/](tests/ExtensionLibsTests/CSharpTests/htmlcodegen/ChartDomain/) for `Pie`, `Doughnut`, `FunnelArea`, `Sunburst`, `Treemap`, `ParallelCoord`, `ParallelCategories`, `Sankey`, `Table`, `Indicator`, and `Icicle`. +- Added C# wrapper serialization coverage under [tests/ExtensionLibsTests/CSharpTests/htmlcodegen/ChartCarpet/](tests/ExtensionLibsTests/CSharpTests/htmlcodegen/ChartCarpet/) for `Carpet`, `ScatterCarpet`, `PointCarpet`, `LineCarpet`, `SplineCarpet`, `BubbleCarpet`, and `ContourCarpet`. +- Added C# wrapper serialization coverage under [tests/ExtensionLibsTests/CSharpTests/htmlcodegen/ChartSmith/](tests/ExtensionLibsTests/CSharpTests/htmlcodegen/ChartSmith/) for `ScatterSmith`, `PointSmith`, `LineSmith`, and `BubbleSmith`. +- Adjusted the initial baselines to match actual C# wrapper serialization for the object-heavy and carpet traces, especially `Table`, `ContourCarpet`, `BubbleGeo`, `BubbleMapbox`, and `ChoroplethMapbox`. +- Verification: `dotnet run --project ./build/build.fsproj -- RunCSharpTestsFast` (105 passed), `dotnet run --project ./build/build.fsproj -- RunTestsCoreFast` (933 passed), `dotnet run --project ./build/build.fsproj -- RunTestsExtensionLibsFast` (C# tests 105 passed; ImageExportTests 6 passed, 2 skipped). + +### Commit 7: Consistency pass and final verification + +Scope: + +- Ensure all new files use the same namespace style and `using` ordering. +- Check whether any stale folder-level comments or references still mention the removed family files. +- Run the standard build plus core tests. + +Suggested verification: + +```shell +./build.cmd +./build.cmd runTestsCore +./build.cmd runTestsExtensionLibs +``` + +Implementation notes: + +- No additional namespace or `using` normalization was needed for the newly added C# test files; they already match the file-scoped namespace style used in the surrounding C# test suite. +- Searched for stale references to removed umbrella C# Chart API files. Remaining mentions are confined to planning documents that still describe the pre-split starting point; no code or project files needed cleanup. +- Final verification: `dotnet run --project ./build/build.fsproj` (Build target succeeded), `dotnet run --project ./build/build.fsproj -- RunTestsCoreFast` (933 passed), `dotnet run --project ./build/build.fsproj -- RunTestsExtensionLibsFast` (C# tests 105 passed; ImageExportTests 6 passed, 2 skipped). + +## Completion status + +Implemented. + +Resolved decisions: + +1. New C# test files follow the surrounding suite's file-scoped namespace style; no normalization pass was needed beyond keeping that style consistent. +2. The split stayed at one public chart wrapper per file across the migrated families instead of regrouping tiny related methods. +3. Root helpers were split into one file per method: `Combine.cs`, `Grid.cs`, `SingleStack.cs`, and `Invisible.cs`. +4. Direct F# fixture reuse was not standardized for this pass; the new C# html-codegen coverage uses mirrored C# fixtures and rendered baselines where that kept the tests simpler and more stable. +5. Empty umbrella files were removed rather than kept as placeholders; the root `Chart.cs` file was deleted once its helpers moved. + +No further implementation work remains for this plan. diff --git a/src/Plotly.NET.CSharp/ChartAPI/Chart.cs b/src/Plotly.NET.CSharp/ChartAPI/Chart.cs deleted file mode 100644 index 050f20fd..00000000 --- a/src/Plotly.NET.CSharp/ChartAPI/Chart.cs +++ /dev/null @@ -1,135 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Plotly.NET; -using Plotly.NET.LayoutObjects; -using Plotly.NET.TraceObjects; -using System.Runtime.InteropServices; - -namespace Plotly.NET.CSharp -{ - /// - /// - /// - public static partial class Chart - { - /// - /// Create a combined chart with the given charts merged - /// - /// the charts to combine - /// - public static GenericChart Combine(IEnumerable gCharts) => Plotly.NET.Chart.combine(gCharts); - - /// - /// Creates a chart that is completely invisible when rendered. The Chart object however is NOT empty! Combining this chart with other charts will have unforseen consequences (it has for example invisible axes that can override other axes if used in Chart.Combine) - /// - /// - public static GenericChart Invisible() => Plotly.NET.Chart.Invisible(); - - /// - /// Creates a subplot grid with the given dimensions (nRows x nCols) for the input charts. - /// - /// The charts to display on the grid. - /// The number of rows in the grid. If you provide a 2D `subplots` array or a `yaxes` array, its length is used as the default. But it's also possible to have a different length, if you want to leave a row at the end for non-cartesian subplots. - /// The number of columns in the grid. If you provide a 2D `subplots` array, the length of its longest row is used as the default. If you give an `xaxes` array, its length is used as the default. But it's also possible to have a different length, if you want to leave a row at the end for non-cartesian subplots. - /// A collection of titles for the individual subplots. - /// The font of the subplot titles - /// A vertical offset applied to each subplot title, moving it upwards if positive and vice versa - /// Used for freeform grids, where some axes may be shared across subplots but others are not. Each entry should be a cartesian subplot id, like "xy" or "x3y2", or "" to leave that cell empty. You may reuse x axes within the same column, and y axes within the same row. Non-cartesian subplots and traces that support `domain` can place themselves in this grid separately using the `gridcell` attribute. - /// Used with `yaxes` when the x and y axes are shared across columns and rows. Each entry should be an y axis id like "y", "y2", etc., or "" to not put a y axis in that row. Entries other than "" must be unique. Ignored if `subplots` is present. If missing but `xaxes` is present, will generate consecutive IDs. - /// Used with `yaxes` when the x and y axes are shared across columns and rows. Each entry should be an x axis id like "x", "x2", etc., or "" to not put an x axis in that column. Entries other than "" must be unique. Ignored if `subplots` is present. If missing but `yaxes` is present, will generate consecutive IDs. - /// Is the first row the top or the bottom? Note that columns are always enumerated from left to right. - /// If no `subplots`, `xaxes`, or `yaxes` are given but we do have `rows` and `columns`, we can generate defaults using consecutive axis IDs, in two ways: "coupled" gives one x axis per column and one y axis per row. "independent" uses a new xy pair for each cell, left-to-right across each row then iterating rows according to `roworder`. - /// Horizontal space between grid cells, expressed as a fraction of the total width available to one cell. Defaults to 0.1 for coupled-axes grids and 0.2 for independent grids. - /// Vertical space between grid cells, expressed as a fraction of the total height available to one cell. Defaults to 0.1 for coupled-axes grids and 0.3 for independent grids. - /// Sets the domains of this grid subplot (in plot fraction). The first and last cells end exactly at the domain edges, with no grout around the edges. - /// Sets where the x axis labels and titles go. "bottom" means the very bottom of the grid. "bottom plot" is the lowest plot that each x axis is used in. "top" and "top plot" are similar. - /// Sets where the y axis labels and titles go. "left" means the very left edge of the grid. "left plot" is the leftmost plot that each y axis is used in. "right" and "right plot" are similar. - public static GenericChart Grid( - IEnumerable gCharts, - int nRows, - int nCols, - Optional> SubPlotTitles = default, - Optional SubPlotTitleFont = default, - Optional SubPlotTitleOffset = default, - Optional[][]> SubPlots = default, - Optional XAxes = default, - Optional YAxes = default, - Optional RowOrder = default, - Optional Pattern = default, - Optional XGap = default, - Optional YGap = default, - Optional Domain = default, - Optional XSide = default, - Optional YSide = default - ) => - Plotly.NET.Chart.Grid,IEnumerable>( - nRows: nRows, - nCols: nCols, - SubPlotTitles: SubPlotTitles.ToOption(), - SubPlotTitleFont: SubPlotTitleFont.ToOption(), - SubPlotTitleOffset: SubPlotTitleOffset.ToOption(), - SubPlots: SubPlots.ToOption(), - XAxes: XAxes.ToOption(), - YAxes: YAxes.ToOption(), - RowOrder: RowOrder.ToOption(), - Pattern: Pattern.ToOption(), - XGap: XGap.ToOption(), - YGap: YGap.ToOption(), - Domain: Domain.ToOption(), - XSide: XSide.ToOption(), - YSide: YSide.ToOption() - ).Invoke(gCharts); - - /// - /// Creates a chart stack (a subplot grid with one column) from the input charts. - /// - /// The charts to display. - /// A collection of titles for the individual subplots. - /// The font of the subplot titles - /// A vertical offset applied to each subplot title, moving it upwards if positive and vice versa - /// Used for freeform grids, where some axes may be shared across subplots but others are not. Each entry should be a cartesian subplot id, like "xy" or "x3y2", or "" to leave that cell empty. You may reuse x axes within the same column, and y axes within the same row. Non-cartesian subplots and traces that support `domain` can place themselves in this grid separately using the `gridcell` attribute. - /// Used with `yaxes` when the x and y axes are shared across columns and rows. Each entry should be an y axis id like "y", "y2", etc., or "" to not put a y axis in that row. Entries other than "" must be unique. Ignored if `subplots` is present. If missing but `xaxes` is present, will generate consecutive IDs. - /// Used with `yaxes` when the x and y axes are shared across columns and rows. Each entry should be an x axis id like "x", "x2", etc., or "" to not put an x axis in that column. Entries other than "" must be unique. Ignored if `subplots` is present. If missing but `yaxes` is present, will generate consecutive IDs. - /// Is the first row the top or the bottom? Note that columns are always enumerated from left to right. - /// If no `subplots`, `xaxes`, or `yaxes` are given but we do have `rows` and `columns`, we can generate defaults using consecutive axis IDs, in two ways: "coupled" gives one x axis per column and one y axis per row. "independent" uses a new xy pair for each cell, left-to-right across each row then iterating rows according to `roworder`. - /// Horizontal space between grid cells, expressed as a fraction of the total width available to one cell. Defaults to 0.1 for coupled-axes grids and 0.2 for independent grids. - /// Vertical space between grid cells, expressed as a fraction of the total height available to one cell. Defaults to 0.1 for coupled-axes grids and 0.3 for independent grids. - /// Sets the domains of this grid subplot (in plot fraction). The first and last cells end exactly at the domain edges, with no grout around the edges. - /// Sets where the x axis labels and titles go. "bottom" means the very bottom of the grid. "bottom plot" is the lowest plot that each x axis is used in. "top" and "top plot" are similar. - /// Sets where the y axis labels and titles go. "left" means the very left edge of the grid. "left plot" is the leftmost plot that each y axis is used in. "right" and "right plot" are similar. - public static GenericChart SingleStack( - IEnumerable gCharts, - Optional> SubPlotTitles = default, - Optional SubPlotTitleFont = default, - Optional SubPlotTitleOffset = default, - Optional[][]> SubPlots = default, - Optional XAxes = default, - Optional YAxes = default, - Optional RowOrder = default, - Optional Pattern = default, - Optional XGap = default, - Optional YGap = default, - Optional Domain = default, - Optional XSide = default, - Optional YSide = default - ) => - Plotly.NET.Chart.SingleStack, IEnumerable>( - SubPlotTitles: SubPlotTitles.ToOption(), - SubPlotTitleFont: SubPlotTitleFont.ToOption(), - SubPlotTitleOffset: SubPlotTitleOffset.ToOption(), - SubPlots: SubPlots.ToOption(), - XAxes: XAxes.ToOption(), - YAxes: YAxes.ToOption(), - RowOrder: RowOrder.ToOption(), - Pattern: Pattern.ToOption(), - XGap: XGap.ToOption(), - YGap: YGap.ToOption(), - Domain: Domain.ToOption(), - XSide: XSide.ToOption(), - YSide: YSide.ToOption() - ).Invoke(gCharts); - } -} diff --git a/src/Plotly.NET.CSharp/ChartAPI/Chart/Combine.cs b/src/Plotly.NET.CSharp/ChartAPI/Chart/Combine.cs new file mode 100644 index 00000000..8f7fb1b0 --- /dev/null +++ b/src/Plotly.NET.CSharp/ChartAPI/Chart/Combine.cs @@ -0,0 +1,14 @@ +using System.Collections.Generic; +using Plotly.NET; + +namespace Plotly.NET.CSharp; + +public static partial class Chart +{ + /// + /// Create a combined chart with the given charts merged + /// + /// the charts to combine + /// + public static GenericChart Combine(IEnumerable gCharts) => Plotly.NET.Chart.combine(gCharts); +} diff --git a/src/Plotly.NET.CSharp/ChartAPI/Chart/Grid.cs b/src/Plotly.NET.CSharp/ChartAPI/Chart/Grid.cs new file mode 100644 index 00000000..ef98b748 --- /dev/null +++ b/src/Plotly.NET.CSharp/ChartAPI/Chart/Grid.cs @@ -0,0 +1,64 @@ +using System; +using System.Collections.Generic; +using Plotly.NET; +using Plotly.NET.LayoutObjects; + +namespace Plotly.NET.CSharp; + +public static partial class Chart +{ + /// + /// Creates a subplot grid with the given dimensions (nRows x nCols) for the input charts. + /// + /// The charts to display on the grid. + /// The number of rows in the grid. If you provide a 2D `subplots` array or a `yaxes` array, its length is used as the default. But it's also possible to have a different length, if you want to leave a row at the end for non-cartesian subplots. + /// The number of columns in the grid. If you provide a 2D `subplots` array, the length of its longest row is used as the default. If you give an `xaxes` array, its length is used as the default. But it's also possible to have a different length, if you want to leave a row at the end for non-cartesian subplots. + /// A collection of titles for the individual subplots. + /// The font of the subplot titles + /// A vertical offset applied to each subplot title, moving it upwards if positive and vice versa + /// Used for freeform grids, where some axes may be shared across subplots but others are not. Each entry should be a cartesian subplot id, like "xy" or "x3y2", or "" to leave that cell empty. You may reuse x axes within the same column, and y axes within the same row. Non-cartesian subplots and traces that support `domain` can place themselves in this grid separately using the `gridcell` attribute. + /// Used with `yaxes` when the x and y axes are shared across columns and rows. Each entry should be an y axis id like "y", "y2", etc., or "" to not put a y axis in that row. Entries other than "" must be unique. Ignored if `subplots` is present. If missing but `xaxes` is present, will generate consecutive IDs. + /// Used with `yaxes` when the x and y axes are shared across columns and rows. Each entry should be an x axis id like "x", "x2", etc., or "" to not put an x axis in that column. Entries other than "" must be unique. Ignored if `subplots` is present. If missing but `yaxes` is present, will generate consecutive IDs. + /// Is the first row the top or the bottom? Note that columns are always enumerated from left to right. + /// If no `subplots`, `xaxes`, or `yaxes` are given but we do have `rows` and `columns`, we can generate defaults using consecutive axis IDs, in two ways: "coupled" gives one x axis per column and one y axis per row. "independent" uses a new xy pair for each cell, left-to-right across each row then iterating rows according to `roworder`. + /// Horizontal space between grid cells, expressed as a fraction of the total width available to one cell. Defaults to 0.1 for coupled-axes grids and 0.2 for independent grids. + /// Vertical space between grid cells, expressed as a fraction of the total height available to one cell. Defaults to 0.1 for coupled-axes grids and 0.3 for independent grids. + /// Sets the domains of this grid subplot (in plot fraction). The first and last cells end exactly at the domain edges, with no grout around the edges. + /// Sets where the x axis labels and titles go. "bottom" means the very bottom of the grid. "bottom plot" is the lowest plot that each x axis is used in. "top" and "top plot" are similar. + /// Sets where the y axis labels and titles go. "left" means the very left edge of the grid. "left plot" is the leftmost plot that each y axis is used in. "right" and "right plot" are similar. + public static GenericChart Grid( + IEnumerable gCharts, + int nRows, + int nCols, + Optional> SubPlotTitles = default, + Optional SubPlotTitleFont = default, + Optional SubPlotTitleOffset = default, + Optional[][]> SubPlots = default, + Optional XAxes = default, + Optional YAxes = default, + Optional RowOrder = default, + Optional Pattern = default, + Optional XGap = default, + Optional YGap = default, + Optional Domain = default, + Optional XSide = default, + Optional YSide = default + ) => + Plotly.NET.Chart.Grid, IEnumerable>( + nRows: nRows, + nCols: nCols, + SubPlotTitles: SubPlotTitles.ToOption(), + SubPlotTitleFont: SubPlotTitleFont.ToOption(), + SubPlotTitleOffset: SubPlotTitleOffset.ToOption(), + SubPlots: SubPlots.ToOption(), + XAxes: XAxes.ToOption(), + YAxes: YAxes.ToOption(), + RowOrder: RowOrder.ToOption(), + Pattern: Pattern.ToOption(), + XGap: XGap.ToOption(), + YGap: YGap.ToOption(), + Domain: Domain.ToOption(), + XSide: XSide.ToOption(), + YSide: YSide.ToOption() + ).Invoke(gCharts); +} diff --git a/src/Plotly.NET.CSharp/ChartAPI/Chart/Invisible.cs b/src/Plotly.NET.CSharp/ChartAPI/Chart/Invisible.cs new file mode 100644 index 00000000..3289d74b --- /dev/null +++ b/src/Plotly.NET.CSharp/ChartAPI/Chart/Invisible.cs @@ -0,0 +1,12 @@ +using Plotly.NET; + +namespace Plotly.NET.CSharp; + +public static partial class Chart +{ + /// + /// Creates a chart that is completely invisible when rendered. The Chart object however is NOT empty! Combining this chart with other charts will have unforseen consequences (it has for example invisible axes that can override other axes if used in Chart.Combine) + /// + /// + public static GenericChart Invisible() => Plotly.NET.Chart.Invisible(); +} diff --git a/src/Plotly.NET.CSharp/ChartAPI/Chart/SingleStack.cs b/src/Plotly.NET.CSharp/ChartAPI/Chart/SingleStack.cs new file mode 100644 index 00000000..bdaf1b3f --- /dev/null +++ b/src/Plotly.NET.CSharp/ChartAPI/Chart/SingleStack.cs @@ -0,0 +1,58 @@ +using System; +using System.Collections.Generic; +using Plotly.NET; +using Plotly.NET.LayoutObjects; + +namespace Plotly.NET.CSharp; + +public static partial class Chart +{ + /// + /// Creates a chart stack (a subplot grid with one column) from the input charts. + /// + /// The charts to display. + /// A collection of titles for the individual subplots. + /// The font of the subplot titles + /// A vertical offset applied to each subplot title, moving it upwards if positive and vice versa + /// Used for freeform grids, where some axes may be shared across subplots but others are not. Each entry should be a cartesian subplot id, like "xy" or "x3y2", or "" to leave that cell empty. You may reuse x axes within the same column, and y axes within the same row. Non-cartesian subplots and traces that support `domain` can place themselves in this grid separately using the `gridcell` attribute. + /// Used with `yaxes` when the x and y axes are shared across columns and rows. Each entry should be an y axis id like "y", "y2", etc., or "" to not put a y axis in that row. Entries other than "" must be unique. Ignored if `subplots` is present. If missing but `xaxes` is present, will generate consecutive IDs. + /// Used with `yaxes` when the x and y axes are shared across columns and rows. Each entry should be an x axis id like "x", "x2", etc., or "" to not put an x axis in that column. Entries other than "" must be unique. Ignored if `subplots` is present. If missing but `yaxes` is present, will generate consecutive IDs. + /// Is the first row the top or the bottom? Note that columns are always enumerated from left to right. + /// If no `subplots`, `xaxes`, or `yaxes` are given but we do have `rows` and `columns`, we can generate defaults using consecutive axis IDs, in two ways: "coupled" gives one x axis per column and one y axis per row. "independent" uses a new xy pair for each cell, left-to-right across each row then iterating rows according to `roworder`. + /// Horizontal space between grid cells, expressed as a fraction of the total width available to one cell. Defaults to 0.1 for coupled-axes grids and 0.2 for independent grids. + /// Vertical space between grid cells, expressed as a fraction of the total height available to one cell. Defaults to 0.1 for coupled-axes grids and 0.3 for independent grids. + /// Sets the domains of this grid subplot (in plot fraction). The first and last cells end exactly at the domain edges, with no grout around the edges. + /// Sets where the x axis labels and titles go. "bottom" means the very bottom of the grid. "bottom plot" is the lowest plot that each x axis is used in. "top" and "top plot" are similar. + /// Sets where the y axis labels and titles go. "left" means the very left edge of the grid. "left plot" is the leftmost plot that each y axis is used in. "right" and "right plot" are similar. + public static GenericChart SingleStack( + IEnumerable gCharts, + Optional> SubPlotTitles = default, + Optional SubPlotTitleFont = default, + Optional SubPlotTitleOffset = default, + Optional[][]> SubPlots = default, + Optional XAxes = default, + Optional YAxes = default, + Optional RowOrder = default, + Optional Pattern = default, + Optional XGap = default, + Optional YGap = default, + Optional Domain = default, + Optional XSide = default, + Optional YSide = default + ) => + Plotly.NET.Chart.SingleStack, IEnumerable>( + SubPlotTitles: SubPlotTitles.ToOption(), + SubPlotTitleFont: SubPlotTitleFont.ToOption(), + SubPlotTitleOffset: SubPlotTitleOffset.ToOption(), + SubPlots: SubPlots.ToOption(), + XAxes: XAxes.ToOption(), + YAxes: YAxes.ToOption(), + RowOrder: RowOrder.ToOption(), + Pattern: Pattern.ToOption(), + XGap: XGap.ToOption(), + YGap: YGap.ToOption(), + Domain: Domain.ToOption(), + XSide: XSide.ToOption(), + YSide: YSide.ToOption() + ).Invoke(gCharts); +} diff --git a/src/Plotly.NET.CSharp/ChartAPI/Chart2D.cs b/src/Plotly.NET.CSharp/ChartAPI/Chart2D.cs deleted file mode 100644 index c8766e6b..00000000 --- a/src/Plotly.NET.CSharp/ChartAPI/Chart2D.cs +++ /dev/null @@ -1,2755 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Plotly.NET; -using Plotly.NET.LayoutObjects; -using Plotly.NET.TraceObjects; -using System.Runtime.InteropServices; -using static Plotly.NET.StyleParam; - -namespace Plotly.NET.CSharp -{ - public static partial class Chart - { - /// - /// Creates a Scatter plot. - /// - /// Scatter charts are the basis of Point, Line, and Bubble Charts, and can be customized as such. We also provide abstractions for those: Chart.Line, Chart.Point, Chart.Bubble - /// - /// Sets the x coordinates of the plotted data. - /// 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. - /// Sets the opactity of the trace - /// Sets the opactity of individual datum markers - /// Sets a text associated with each datum - /// Sets individual text for each datum - /// Sets the position of text associated with each datum - /// Sets the position of text associated with individual datum - /// Sets the color of the marker - /// Sets the colorscale of the marker - /// Sets the outline of the marker - /// Sets the marker symbol for each datum - /// Sets the marker symbol for each individual datum - /// Sets the marker (use this for more finegrained control than the other marker-associated arguments) - /// Sets the color of the line - /// Sets the colorscale of the line - /// Sets the width of the line - /// sets the drawing style of the line - /// Sets the line (use this for more finegrained control than the other line-associated arguments) - /// Set several traces linked to the same position axis or matching axes to the same alignmentgroup. This controls whether bars compute their positional range dependently or independently. - /// Set several traces linked to the same position axis or matching axes to the same offsetgroup where bars of the same position coordinate will line up. - /// Set several traces (on the same subplot) to the same stackgroup in order to add their y values (or their x values if `Orientation` is Horizontal). Stacking also turns `fill` on by default and sets the default `mode` to "lines" irrespective of point count. ou can only stack on a numeric (linear or log) axis. Traces in a `stackgroup` will only fill to (or be filled to) other traces in the same group. With multiple `stackgroup`s or some traces stacked and some not, if fill-linked traces are not already consecutive, the later ones will be pushed down in the drawing order - /// Sets the stacking direction. Only relevant when `stackgroup` is used, and only the first `orientation` found in the `stackgroup` will be used. - /// Sets the normalization for the sum of this `stackgroup. Only relevant when `stackgroup` is used, and only the first `groupnorm` found in the `stackgroup` will be used - /// Sets the area to fill with a solid color. Defaults to "none" unless this trace is stacked, then it gets "tonexty" ("tonextx") if `orientation` is "v" ("h") Use with `FillColor` if not "none". "tozerox" and "tozeroy" fill to x=0 and y=0 respectively. "tonextx" and "tonexty" fill between the endpoints of this trace and the endpoints of the trace before it, connecting those endpoints with straight lines (to make a stacked area graph); if there is no trace before it, they behave like "tozerox" and "tozeroy". "toself" connects the endpoints of the trace (or each segment of the trace if it has gaps) into a closed shape. "tonext" fills the space between two traces if one completely encloses the other (eg consecutive contour lines), and behaves like "toself" if there is no trace before it. "tonext" should not be used if one trace does not enclose the other. Traces in a `stackgroup` will only fill to (or be filled to) other traces in the same group. With multiple `stackgroup`s or some traces stacked and some not, if fill-linked traces are not already consecutive, the later ones will be pushed down in the drawing order. - /// Sets the fill color. Defaults to a half-transparent variant of the line color, marker color, or marker line color, whichever is available. - /// Sets the pattern within the marker. - /// If true, plotly.js will use the WebGL engine to render this chart. use this when you want to render many objects at once. - /// If set to false, ignore the global default settings set in `Defaults` - public static GenericChart Scatter( - IEnumerable x, - IEnumerable y, - StyleParam.Mode mode, - Optional Name = default, - Optional ShowLegend = default, - Optional Opacity = default, - Optional> MultiOpacity = default, - Optional Text = default, - Optional> MultiText = default, - Optional TextPosition = default, - Optional> MultiTextPosition = default, - Optional MarkerColor = default, - Optional MarkerColorScale = default, - Optional MarkerOutline = default, - Optional MarkerSymbol = default, - Optional> MultiMarkerSymbol = default, - Optional Marker = default, - Optional LineColor = default, - Optional LineColorScale = default, - Optional LineWidth = default, - Optional LineDash = default, - Optional Line = default, - Optional AlignmentGroup = default, - Optional OffsetGroup = default, - Optional StackGroup = default, - Optional Orientation = default, - Optional GroupNorm = default, - Optional Fill = default, - Optional FillColor = default, - Optional FillPattern = default, - Optional UseWebGL = default, - Optional UseDefaults = default - ) - where XType : IConvertible - where YType : IConvertible - where TextType : IConvertible - => - Plotly.NET.Chart2D_Scatter.Chart.Scatter( - x: x, - y: y, - mode: mode, - Name: Name.ToOption(), - ShowLegend: ShowLegend.ToOption(), - Opacity: Opacity.ToOption(), - MultiOpacity: MultiOpacity.ToOption(), - Text: Text.ToOption(), - MultiText: MultiText.ToOption(), - TextPosition: TextPosition.ToOption(), - MultiTextPosition: MultiTextPosition.ToOption(), - MarkerColor: MarkerColor.ToOption(), - MarkerColorScale: MarkerColorScale.ToOption(), - MarkerOutline: MarkerOutline.ToOption(), - MarkerSymbol: MarkerSymbol.ToOption(), - MultiMarkerSymbol: MultiMarkerSymbol.ToOption(), - Marker: Marker.ToOption(), - LineColor: LineColor.ToOption(), - LineColorScale: LineColorScale.ToOption(), - LineWidth: LineWidth.ToOption(), - LineDash: LineDash.ToOption(), - Line: Line.ToOption(), - AlignmentGroup: AlignmentGroup.ToOption(), - OffsetGroup: OffsetGroup.ToOption(), - StackGroup: StackGroup.ToOption(), - Orientation: Orientation.ToOption(), - GroupNorm: GroupNorm.ToOption(), - Fill: Fill.ToOption(), - FillColor: FillColor.ToOption(), - FillPattern: FillPattern.ToOption(), - UseWebGL: UseWebGL.ToOption(), - UseDefaults: UseDefaults.ToOption() - ); - - /// - /// Creates a Point chart, which uses Points in a 2D space to visualize data. - /// - /// 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. - /// Sets the opactity of the trace - /// Sets the opactity of individual datum markers - /// Sets a text associated with each datum - /// Sets individual text for each datum - /// Sets the position of text associated with each datum - /// Sets the position of text associated with individual datum - /// Sets the color of the marker - /// Sets the colorscale of the marker - /// Sets the outline of the marker - /// Sets the marker symbol for each datum - /// Sets the marker symbol for each individual datum - /// Sets the marker (use this for more finegrained control than the other marker-associated arguments) - /// Set several traces linked to the same position axis or matching axes to the same alignmentgroup. This controls whether bars compute their positional range dependently or independently. - /// Set several traces linked to the same position axis or matching axes to the same offsetgroup where bars of the same position coordinate will line up. - /// Set several traces (on the same subplot) to the same stackgroup in order to add their y values (or their x values if `Orientation` is Horizontal). Stacking also turns `fill` on by default and sets the default `mode` to "lines" irrespective of point count. ou can only stack on a numeric (linear or log) axis. Traces in a `stackgroup` will only fill to (or be filled to) other traces in the same group. With multiple `stackgroup`s or some traces stacked and some not, if fill-linked traces are not already consecutive, the later ones will be pushed down in the drawing order - /// Sets the stacking direction. Only relevant when `stackgroup` is used, and only the first `orientation` found in the `stackgroup` will be used. - /// Sets the normalization for the sum of this `stackgroup. Only relevant when `stackgroup` is used, and only the first `groupnorm` found in the `stackgroup` will be used - /// If true, plotly.js will use the WebGL engine to render this chart. use this when you want to render many objects at once. - /// If set to false, ignore the global default settings set in `Defaults` - public static GenericChart Point( - IEnumerable x, - IEnumerable y, - Optional Name = default, - Optional ShowLegend = default, - Optional Opacity = default, - Optional> MultiOpacity = default, - Optional Text = default, - Optional> MultiText = default, - Optional TextPosition = default, - Optional> MultiTextPosition = default, - Optional MarkerColor = default, - Optional MarkerColorScale = default, - Optional MarkerOutline = default, - Optional MarkerSymbol = default, - Optional> MultiMarkerSymbol = default, - Optional Marker = default, - Optional AlignmentGroup = default, - Optional OffsetGroup = default, - Optional StackGroup = default, - Optional Orientation = default, - Optional GroupNorm = default, - Optional UseWebGL = default, - Optional UseDefaults = default - ) - where XType : IConvertible - where YType : IConvertible - where TextType : IConvertible - => - Plotly.NET.Chart2D_Scatter.Chart.Point( - x: x, - y: y, - Name: Name.ToOption(), - ShowLegend: ShowLegend.ToOption(), - Opacity: Opacity.ToOption(), - MultiOpacity: MultiOpacity.ToOption(), - Text: Text.ToOption(), - MultiText: MultiText.ToOption(), - TextPosition: TextPosition.ToOption(), - MultiTextPosition: MultiTextPosition.ToOption(), - MarkerColor: MarkerColor.ToOption(), - MarkerColorScale: MarkerColorScale.ToOption(), - MarkerOutline: MarkerOutline.ToOption(), - MarkerSymbol: MarkerSymbol.ToOption(), - MultiMarkerSymbol: MultiMarkerSymbol.ToOption(), - Marker: Marker.ToOption(), - AlignmentGroup: AlignmentGroup.ToOption(), - OffsetGroup: OffsetGroup.ToOption(), - StackGroup: StackGroup.ToOption(), - Orientation: Orientation.ToOption(), - GroupNorm: GroupNorm.ToOption(), - UseWebGL: UseWebGL.ToOption(), - UseDefaults: UseDefaults.ToOption() - ); - - /// Creates a Line chart, which uses a Line plotted between the given datums in a 2D space to visualize typically an evolution of Y depending on X. - /// Sets the x coordinates of the plotted data. - /// Sets the y coordinates of the plotted data. - /// Whether to show markers for the individual data points - /// 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. - /// Sets the opactity of the trace - /// Sets the opactity of individual datum markers - /// Sets a text associated with each datum - /// Sets individual text for each datum - /// Sets the position of text associated with each datum - /// Sets the position of text associated with individual datum - /// Sets the color of the marker - /// Sets the colorscale of the marker - /// Sets the outline of the marker - /// Sets the marker symbol for each datum - /// Sets the marker symbol for each individual datum - /// Sets the marker (use this for more finegrained control than the other marker-associated arguments) - /// Sets the color of the line - /// Sets the colorscale of the line - /// Sets the width of the line - /// sets the drawing style of the line - /// Sets the line (use this for more finegrained control than the other line-associated arguments) - /// Set several traces linked to the same position axis or matching axes to the same alignmentgroup. This controls whether bars compute their positional range dependently or independently. - /// Set several traces linked to the same position axis or matching axes to the same offsetgroup where bars of the same position coordinate will line up. - /// Set several traces (on the same subplot) to the same stackgroup in order to add their y values (or their x values if `Orientation` is Horizontal). Stacking also turns `fill` on by default and sets the default `mode` to "lines" irrespective of point count. ou can only stack on a numeric (linear or log) axis. Traces in a `stackgroup` will only fill to (or be filled to) other traces in the same group. With multiple `stackgroup`s or some traces stacked and some not, if fill-linked traces are not already consecutive, the later ones will be pushed down in the drawing order - /// Sets the stacking direction. Only relevant when `stackgroup` is used, and only the first `orientation` found in the `stackgroup` will be used. - /// Sets the normalization for the sum of this `stackgroup. Only relevant when `stackgroup` is used, and only the first `groupnorm` found in the `stackgroup` will be used - /// Sets the area to fill with a solid color. Defaults to "none" unless this trace is stacked, then it gets "tonexty" ("tonextx") if `orientation` is "v" ("h") Use with `FillColor` if not "none". "tozerox" and "tozeroy" fill to x=0 and y=0 respectively. "tonextx" and "tonexty" fill between the endpoints of this trace and the endpoints of the trace before it, connecting those endpoints with straight lines (to make a stacked area graph); if there is no trace before it, they behave like "tozerox" and "tozeroy". "toself" connects the endpoints of the trace (or each segment of the trace if it has gaps) into a closed shape. "tonext" fills the space between two traces if one completely encloses the other (eg consecutive contour lines), and behaves like "toself" if there is no trace before it. "tonext" should not be used if one trace does not enclose the other. Traces in a `stackgroup` will only fill to (or be filled to) other traces in the same group. With multiple `stackgroup`s or some traces stacked and some not, if fill-linked traces are not already consecutive, the later ones will be pushed down in the drawing order. - /// Sets the fill color. Defaults to a half-transparent variant of the line color, marker color, or marker line color, whichever is available. - /// Sets the pattern within the marker. - /// If true, plotly.js will use the WebGL engine to render this chart. use this when you want to render many objects at once. - /// If set to false, ignore the global default settings set in `Defaults` - public static GenericChart Line( - IEnumerable x, - IEnumerable y, - Optional ShowMarkers = default, - Optional Name = default, - Optional ShowLegend = default, - Optional Opacity = default, - Optional> MultiOpacity = default, - Optional Text = default, - Optional> MultiText = default, - Optional TextPosition = default, - Optional> MultiTextPosition = default, - Optional MarkerColor = default, - Optional MarkerColorScale = default, - Optional MarkerOutline = default, - Optional MarkerSymbol = default, - Optional> MultiMarkerSymbol = default, - Optional Marker = default, - Optional LineColor = default, - Optional LineColorScale = default, - Optional LineWidth = default, - Optional LineDash = default, - Optional Line = default, - Optional AlignmentGroup = default, - Optional OffsetGroup = default, - Optional StackGroup = default, - Optional Orientation = default, - Optional GroupNorm = default, - Optional Fill = default, - Optional FillColor = default, - Optional FillPattern = default, - Optional UseWebGL = default, - Optional UseDefaults = default - ) - where XType : IConvertible - where YType : IConvertible - where TextType : IConvertible - => - Plotly.NET.Chart2D_Scatter.Chart.Line( - x: x, - y: y, - ShowMarkers: ShowMarkers.ToOption(), - Name: Name.ToOption(), - ShowLegend: ShowLegend.ToOption(), - Opacity: Opacity.ToOption(), - MultiOpacity: MultiOpacity.ToOption(), - Text: Text.ToOption(), - MultiText: MultiText.ToOption(), - TextPosition: TextPosition.ToOption(), - MultiTextPosition: MultiTextPosition.ToOption(), - MarkerColor: MarkerColor.ToOption(), - MarkerColorScale: MarkerColorScale.ToOption(), - MarkerOutline: MarkerOutline.ToOption(), - MarkerSymbol: MarkerSymbol.ToOption(), - MultiMarkerSymbol: MultiMarkerSymbol.ToOption(), - Marker: Marker.ToOption(), - LineColor: LineColor.ToOption(), - LineColorScale: LineColorScale.ToOption(), - LineWidth: LineWidth.ToOption(), - LineDash: LineDash.ToOption(), - Line: Line.ToOption(), - AlignmentGroup: AlignmentGroup.ToOption(), - OffsetGroup: OffsetGroup.ToOption(), - StackGroup: StackGroup.ToOption(), - Orientation: Orientation.ToOption(), - GroupNorm: GroupNorm.ToOption(), - Fill: Fill.ToOption(), - FillColor: FillColor.ToOption(), - FillPattern: FillPattern.ToOption(), - UseWebGL: UseWebGL.ToOption(), - UseDefaults: UseDefaults.ToOption() - ); - - /// Creates a Spline chart. A spline chart is a line chart in which data points are connected by smoothed curves: this modification is aimed to improve the design of a chart. - /// Very similar to Line Plots, spline charts are typically used to visualize an evolution of Y depending on X. - /// Sets the x coordinates of the plotted data. - /// Sets the y coordinates of the plotted data. - /// Whether to show markers for the individual data points - /// Sets the amount of smoothing. "0" corresponds to no smoothing (equivalent to a "linear" shape). Use values between 0. and 1.3 - /// 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. - /// Sets the opactity of the trace - /// Sets the opactity of individual datum markers - /// Sets a text associated with each datum - /// Sets individual text for each datum - /// Sets the position of text associated with each datum - /// Sets the position of text associated with individual datum - /// Sets the color of the marker - /// Sets the colorscale of the marker - /// Sets the outline of the marker - /// Sets the marker symbol for each datum - /// Sets the marker symbol for each individual datum - /// Sets the marker (use this for more finegrained control than the other marker-associated arguments) - /// Sets the color of the line - /// Sets the colorscale of the line - /// Sets the width of the line - /// sets the drawing style of the line - /// Sets the line (use this for more finegrained control than the other line-associated arguments) - /// Set several traces linked to the same position axis or matching axes to the same alignmentgroup. This controls whether bars compute their positional range dependently or independently. - /// Set several traces linked to the same position axis or matching axes to the same offsetgroup where bars of the same position coordinate will line up. - /// Set several traces (on the same subplot) to the same stackgroup in order to add their y values (or their x values if `Orientation` is Horizontal). Stacking also turns `fill` on by default and sets the default `mode` to "lines" irrespective of point count. ou can only stack on a numeric (linear or log) axis. Traces in a `stackgroup` will only fill to (or be filled to) other traces in the same group. With multiple `stackgroup`s or some traces stacked and some not, if fill-linked traces are not already consecutive, the later ones will be pushed down in the drawing order - /// Sets the stacking direction. Only relevant when `stackgroup` is used, and only the first `orientation` found in the `stackgroup` will be used. - /// Sets the normalization for the sum of this `stackgroup. Only relevant when `stackgroup` is used, and only the first `groupnorm` found in the `stackgroup` will be used - /// Sets the area to fill with a solid color. Defaults to "none" unless this trace is stacked, then it gets "tonexty" ("tonextx") if `orientation` is "v" ("h") Use with `FillColor` if not "none". "tozerox" and "tozeroy" fill to x=0 and y=0 respectively. "tonextx" and "tonexty" fill between the endpoints of this trace and the endpoints of the trace before it, connecting those endpoints with straight lines (to make a stacked area graph); if there is no trace before it, they behave like "tozerox" and "tozeroy". "toself" connects the endpoints of the trace (or each segment of the trace if it has gaps) into a closed shape. "tonext" fills the space between two traces if one completely encloses the other (eg consecutive contour lines), and behaves like "toself" if there is no trace before it. "tonext" should not be used if one trace does not enclose the other. Traces in a `stackgroup` will only fill to (or be filled to) other traces in the same group. With multiple `stackgroup`s or some traces stacked and some not, if fill-linked traces are not already consecutive, the later ones will be pushed down in the drawing order. - /// Sets the fill color. Defaults to a half-transparent variant of the line color, marker color, or marker line color, whichever is available. - /// Sets the pattern within the marker. - /// If true, plotly.js will use the WebGL engine to render this chart. use this when you want to render many objects at once. - /// If set to false, ignore the global default settings set in `Defaults` - public static GenericChart Spline( - IEnumerable x, - IEnumerable y, - Optional ShowMarkers = default, - Optional Smoothing = default, - Optional Name = default, - Optional ShowLegend = default, - Optional Opacity = default, - Optional> MultiOpacity = default, - Optional Text = default, - Optional> MultiText = default, - Optional TextPosition = default, - Optional> MultiTextPosition = default, - Optional MarkerColor = default, - Optional MarkerColorScale = default, - Optional MarkerOutline = default, - Optional MarkerSymbol = default, - Optional> MultiMarkerSymbol = default, - Optional Marker = default, - Optional LineColor = default, - Optional LineColorScale = default, - Optional LineWidth = default, - Optional LineDash = default, - Optional Line = default, - Optional AlignmentGroup = default, - Optional OffsetGroup = default, - Optional StackGroup = default, - Optional Orientation = default, - Optional GroupNorm = default, - Optional Fill = default, - Optional FillColor = default, - Optional FillPattern = default, - Optional UseWebGL = default, - Optional UseDefaults = default - ) - where XType : IConvertible - where YType : IConvertible - where TextType : IConvertible - => - Plotly.NET.Chart2D_Scatter.Chart.Spline( - x: x, - y: y, - ShowMarkers: ShowMarkers.ToOption(), - Smoothing: Smoothing.ToOption(), - Name: Name.ToOption(), - ShowLegend: ShowLegend.ToOption(), - Opacity: Opacity.ToOption(), - MultiOpacity: MultiOpacity.ToOption(), - Text: Text.ToOption(), - MultiText: MultiText.ToOption(), - TextPosition: TextPosition.ToOption(), - MultiTextPosition: MultiTextPosition.ToOption(), - MarkerColor: MarkerColor.ToOption(), - MarkerColorScale: MarkerColorScale.ToOption(), - MarkerOutline: MarkerOutline.ToOption(), - MarkerSymbol: MarkerSymbol.ToOption(), - MultiMarkerSymbol: MultiMarkerSymbol.ToOption(), - Marker: Marker.ToOption(), - LineColor: LineColor.ToOption(), - LineColorScale: LineColorScale.ToOption(), - LineWidth: LineWidth.ToOption(), - LineDash: LineDash.ToOption(), - Line: Line.ToOption(), - AlignmentGroup: AlignmentGroup.ToOption(), - OffsetGroup: OffsetGroup.ToOption(), - StackGroup: StackGroup.ToOption(), - Orientation: Orientation.ToOption(), - GroupNorm: GroupNorm.ToOption(), - Fill: Fill.ToOption(), - FillColor: FillColor.ToOption(), - FillPattern: FillPattern.ToOption(), - UseWebGL: UseWebGL.ToOption(), - UseDefaults: UseDefaults.ToOption() - ); - - /// 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 of the plotted data. - /// 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. - /// Sets the opactity of the trace - /// Sets the opactity of individual datum markers - /// Sets a text associated with each datum - /// Sets individual text for each datum - /// Sets the position of text associated with each datum - /// Sets the position of text associated with individual datum - /// Sets the color of the marker - /// Sets the colorscale of the marker - /// Sets the outline of the marker - /// Sets the marker symbol for each datum - /// Sets the marker symbol for each individual datum - /// Sets the marker (use this for more finegrained control than the other marker-associated arguments) - /// Sets the color of the line - /// Sets the colorscale of the line - /// Sets the width of the line - /// sets the drawing style of the line - /// Sets the line (use this for more finegrained control than the other line-associated arguments) - /// Set several traces linked to the same position axis or matching axes to the same alignmentgroup. This controls whether bars compute their positional range dependently or independently. - /// Set several traces linked to the same position axis or matching axes to the same offsetgroup where bars of the same position coordinate will line up. - /// Set several traces (on the same subplot) to the same stackgroup in order to add their y values (or their x values if `Orientation` is Horizontal). Stacking also turns `fill` on by default and sets the default `mode` to "lines" irrespective of point count. ou can only stack on a numeric (linear or log) axis. Traces in a `stackgroup` will only fill to (or be filled to) other traces in the same group. With multiple `stackgroup`s or some traces stacked and some not, if fill-linked traces are not already consecutive, the later ones will be pushed down in the drawing order - /// Sets the stacking direction. Only relevant when `stackgroup` is used, and only the first `orientation` found in the `stackgroup` will be used. - /// Sets the normalization for the sum of this `stackgroup. Only relevant when `stackgroup` is used, and only the first `groupnorm` found in the `stackgroup` will be used - /// If true, plotly.js will use the WebGL engine to render this chart. use this when you want to render many objects at once. - /// If set to false, ignore the global default settings set in `Defaults` - public static GenericChart Bubble( - IEnumerable x, - IEnumerable y, - IEnumerable sizes, - Optional Name = default, - Optional ShowLegend = default, - Optional Opacity = default, - Optional> MultiOpacity = default, - Optional Text = default, - Optional> MultiText = default, - Optional TextPosition = default, - Optional> MultiTextPosition = default, - Optional MarkerColor = default, - Optional MarkerColorScale = default, - Optional MarkerOutline = default, - Optional MarkerSymbol = default, - Optional> MultiMarkerSymbol = default, - Optional Marker = default, - Optional LineColor = default, - Optional LineColorScale = default, - Optional LineWidth = default, - Optional LineDash = default, - Optional Line = default, - Optional AlignmentGroup = default, - Optional OffsetGroup = default, - Optional StackGroup = default, - Optional Orientation = default, - Optional GroupNorm = default, - Optional UseWebGL = default, - Optional UseDefaults = default - ) - where XType : IConvertible - where YType : IConvertible - where TextType : IConvertible - => - Plotly.NET.Chart2D_Scatter.Chart.Bubble( - x: x, - y: y, - sizes: sizes, - Name: Name.ToOption(), - ShowLegend: ShowLegend.ToOption(), - Opacity: Opacity.ToOption(), - MultiOpacity: MultiOpacity.ToOption(), - Text: Text.ToOption(), - MultiText: MultiText.ToOption(), - TextPosition: TextPosition.ToOption(), - MultiTextPosition: MultiTextPosition.ToOption(), - MarkerColor: MarkerColor.ToOption(), - MarkerColorScale: MarkerColorScale.ToOption(), - MarkerOutline: MarkerOutline.ToOption(), - MarkerSymbol: MarkerSymbol.ToOption(), - MultiMarkerSymbol: MultiMarkerSymbol.ToOption(), - Marker: Marker.ToOption(), - LineColor: LineColor.ToOption(), - LineColorScale: LineColorScale.ToOption(), - LineWidth: LineWidth.ToOption(), - LineDash: LineDash.ToOption(), - Line: Line.ToOption(), - AlignmentGroup: AlignmentGroup.ToOption(), - OffsetGroup: OffsetGroup.ToOption(), - StackGroup: StackGroup.ToOption(), - Orientation: Orientation.ToOption(), - GroupNorm: GroupNorm.ToOption(), - UseWebGL: UseWebGL.ToOption(), - UseDefaults: UseDefaults.ToOption() - ); - - /// - /// Displays a range of data by plotting three Y values per data point (upper, mid, lower). - /// - /// The mid Y value usually resembles some kind of central tendency and the upper/lower Y values some kind of spread. - /// - /// Sets the x coordinates of the plotted data. - /// Sets the y coordinates of the plotted data for the mid Y value. - /// Sets the y coordinates of the plotted data for the upper Y value. - /// Sets the y coordinates of the plotted data for the lower Y value. - /// Determines the drawing mode for this scatter trace. - /// Sets the trace name of the mid Y values. The trace name appear as the legend item and on hover - /// Sets the name of the legendgroup for the three traces of this plot. - /// Determines whether or not an To show markers for each datum. - /// Determines whether or not an item corresponding to this trace is shown in the legend. - /// Sets a text associated with each datum for the mid Y values. - /// Sets individual text for each datum for the mid Y values. - /// Sets the position of text associated with each datum - /// Sets the position of text associated with individual datum - /// Sets the color of the marker for the mid Y values. - /// Sets the colorscale of the marker for the mid Y values. - /// Sets the outline of the marker for the mid Y values. - /// Sets the marker symbol for each datum for the mid Y values. - /// Sets the marker symbol for each individual datum for the mid Y values. - /// Sets the marker (use this for more finegrained control than the other marker-associated arguments) for the mid Y values. - /// Sets the color of the line for the mid Y values. - /// Sets the colorscale of the line for the mid Y values. - /// Sets the width of the line for the mid Y values. - /// sets the drawing style of the line for the mid Y values. - /// Sets the line (use this for more finegrained control than the other line-associated arguments) for the mid Y values. - /// Sets the color of the range between upper and lower Y values. - /// Sets the pattern of the range between upper and lower Y values. - /// Sets a text associated with each datum for the upper Y values. - /// Sets individual text for each datum for the upper Y values. - /// Sets a text associated with each datum for the lower Y values. - /// Sets individual text for each datum for the lower Y values. - /// Sets the text font for all Text items - /// Sets the name of the lower Y value trace. - /// Sets the line for the lower Y values. - /// Sets the marker for the lower Y values. - /// Sets the name of the uper Y value trace. - /// Sets the line for the upper Y values. - /// Sets the marker for the upper Y values. - /// If set to false, ignore the global default settings set in `Defaults` - public static GenericChart Range( - IEnumerable x, - IEnumerable y, - IEnumerable upper, - IEnumerable lower, - StyleParam.Mode mode, - Optional Name = default, - Optional GroupName = default, - Optional ShowMarkers = default, - Optional ShowLegend = default, - Optional Text = default, - Optional> MultiText = default, - Optional TextPosition = default, - Optional> MultiTextPosition = default, - Optional MarkerColor = default, - Optional MarkerColorScale = default, - Optional MarkerOutline = default, - Optional MarkerSymbol = default, - Optional> MultiMarkerSymbol = default, - Optional Marker = default, - Optional UpperMarker = default, - Optional LowerMarker = default, - Optional LineColor = default, - Optional LineColorScale = default, - Optional LineWidth = default, - Optional LineDash = default, - Optional Line = default, - Optional UpperLine = default, - Optional LowerLine = default, - Optional RangeColor = default, - Optional RangePattern = default, - Optional UpperText = default, - Optional> MultiUpperText = default, - Optional LowerText = default, - Optional> MultiLowerText = default, - Optional TextFont = default, - Optional LowerName = default, - Optional UpperName = default, - Optional UseDefaults = default - ) - where XType : IConvertible - where YType : IConvertible - where TextType : IConvertible - => - Plotly.NET.Chart2D_Scatter.Chart.Range( - x: x, - y: y, - upper: upper, - lower: lower, - mode: mode, - Name: Name.ToOption(), - GroupName: GroupName.ToOption(), - ShowMarkers: ShowMarkers.ToOption(), - ShowLegend: ShowLegend.ToOption(), - Text: Text.ToOption(), - MultiText: MultiText.ToOption(), - TextPosition: TextPosition.ToOption(), - MultiTextPosition: MultiTextPosition.ToOption(), - MarkerColor: MarkerColor.ToOption(), - MarkerColorScale: MarkerColorScale.ToOption(), - MarkerOutline: MarkerOutline.ToOption(), - MarkerSymbol: MarkerSymbol.ToOption(), - MultiMarkerSymbol: MultiMarkerSymbol.ToOption(), - Marker: Marker.ToOption(), - UpperMarker: UpperMarker.ToOption(), - LowerMarker: LowerMarker.ToOption(), - LineColor: LineColor.ToOption(), - LineColorScale: LineColorScale.ToOption(), - LineWidth: LineWidth.ToOption(), - LineDash: LineDash.ToOption(), - Line: Line.ToOption(), - UpperLine: UpperLine.ToOption(), - LowerLine: LowerLine.ToOption(), - RangeColor: RangeColor.ToOption(), - RangePattern: RangePattern.ToOption(), - UpperText: UpperText.ToOption(), - MultiUpperText: MultiUpperText.ToOption(), - LowerText: LowerText.ToOption(), - MultiLowerText: MultiLowerText.ToOption(), - TextFont: TextFont.ToOption(), - LowerName: LowerName.ToOption(), - UpperName: UpperName.ToOption(), - UseDefaults: UseDefaults.ToOption() - ); - - /// Creates a Pareto chart. - /// Sets the (key,value) pairs that are plotted as the size and key of each bar. - /// Sets the trace name. The trace name appear as the legend item and on hover - /// Sets the y axis label. - /// Determines whether or not grid lines are drawn. If "true", the grid lines are drawn for the pareto distribution figure; defaults to true. - public static GenericChart Pareto( - IEnumerable<(TLabel,double)> keysValues - , Optional Name - , Optional Label - , Optional ShowGrid - ) - where TLabel : IConvertible - => - Chart2D_Statistical.Chart.Pareto( - keysValues.Select(t => t.ToTuple()) - , Name: Name.ToOption() - , Label: Label.ToOption() - , ShowGrid: ShowGrid.ToOption() - ); - /// Creates a Pareto chart. - /// Sets the labels that are matching the . - /// Sets the values that are plotted as the size of each bar. - /// Sets the trace name. The trace name appear as the legend item and on hover - /// Sets the y axis label. - /// Determines whether or not grid lines are drawn. If "true", the grid lines are drawn for the pareto distribution figure; defaults to true. - public static GenericChart Pareto( - IEnumerable labels - , IEnumerable values - , Optional Name - , Optional Label - , Optional ShowGrid - ) - where TLabel : IConvertible - => - Chart2D_Statistical.Chart.Pareto( - labels - , values - , Name: Name.ToOption() - , Label: Label.ToOption() - , ShowGrid: ShowGrid.ToOption() - ); - - /// Creates an Area chart, which uses a Line plotted between the given datums in a 2D space, additionally colouring the area between the line and the Y Axis. - /// Sets the x coordinates of the plotted data. - /// Sets the y coordinates of the plotted data. - /// Whether to show markers for the individual data points - /// 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. - /// Sets the opactity of the trace - /// Sets the opactity of individual datum markers - /// Sets a text associated with each datum - /// Sets individual text for each datum - /// Sets the position of text associated with each datum - /// Sets the position of text associated with individual datum - /// Sets the color of the marker - /// Sets the colorscale of the marker - /// Sets the outline of the marker - /// Sets the marker symbol for each datum - /// Sets the marker symbol for each individual datum - /// Sets the marker (use this for more finegrained control than the other marker-associated arguments) - /// Sets the color of the line - /// Sets the colorscale of the line - /// Sets the width of the line - /// sets the drawing style of the line - /// Sets the line (use this for more finegrained control than the other line-associated arguments) - /// Set several traces linked to the same position axis or matching axes to the same alignmentgroup. This controls whether bars compute their positional range dependently or independently. - /// Set several traces linked to the same position axis or matching axes to the same offsetgroup where bars of the same position coordinate will line up. - /// Set several traces (on the same subplot) to the same stackgroup in order to add their y values (or their x values if `Orientation` is Horizontal). Stacking also turns `fill` on by default and sets the default `mode` to "lines" irrespective of point count. ou can only stack on a numeric (linear or log) axis. Traces in a `stackgroup` will only fill to (or be filled to) other traces in the same group. With multiple `stackgroup`s or some traces stacked and some not, if fill-linked traces are not already consecutive, the later ones will be pushed down in the drawing order - /// Sets the stacking direction. Only relevant when `stackgroup` is used, and only the first `orientation` found in the `stackgroup` will be used. - /// Sets the normalization for the sum of this `stackgroup. Only relevant when `stackgroup` is used, and only the first `groupnorm` found in the `stackgroup` will be used - /// Sets the fill color. Defaults to a half-transparent variant of the line color, marker color, or marker line color, whichever is available. - /// Sets a pattern shape for the area fill - /// Sets the pattern within the area. (use this for more finegrained control than the other fillpattern-associated arguments). - /// If true, plotly.js will use the WebGL engine to render this chart. use this when you want to render many objects at once. - /// If set to false, ignore the global default settings set in `Defaults` - public static GenericChart Area( - IEnumerable x, - IEnumerable y, - Optional ShowMarkers = default, - Optional Name = default, - Optional ShowLegend = default, - Optional Opacity = default, - Optional> MultiOpacity = default, - Optional Text = default, - Optional> MultiText = default, - Optional TextPosition = default, - Optional> MultiTextPosition = default, - Optional MarkerColor = default, - Optional MarkerColorScale = default, - Optional MarkerOutline = default, - Optional MarkerSymbol = default, - Optional> MultiMarkerSymbol = default, - Optional Marker = default, - Optional LineColor = default, - Optional LineColorScale = default, - Optional LineWidth = default, - Optional LineDash = default, - Optional Line = default, - Optional AlignmentGroup = default, - Optional OffsetGroup = default, - Optional StackGroup = default, - Optional Orientation = default, - Optional GroupNorm = default, - Optional FillColor = default, - Optional FillPatternShape = default, - Optional FillPattern = default, - Optional UseWebGL = default, - Optional UseDefaults = default - ) - where XType : IConvertible - where YType : IConvertible - where TextType : IConvertible - => - Plotly.NET.Chart2D_Area.Chart.Area( - x: x, - y: y, - ShowMarkers: ShowMarkers.ToOption(), - Name: Name.ToOption(), - ShowLegend: ShowLegend.ToOption(), - Opacity: Opacity.ToOption(), - MultiOpacity: MultiOpacity.ToOption(), - Text: Text.ToOption(), - MultiText: MultiText.ToOption(), - TextPosition: TextPosition.ToOption(), - MultiTextPosition: MultiTextPosition.ToOption(), - MarkerColor: MarkerColor.ToOption(), - MarkerColorScale: MarkerColorScale.ToOption(), - MarkerOutline: MarkerOutline.ToOption(), - MarkerSymbol: MarkerSymbol.ToOption(), - MultiMarkerSymbol: MultiMarkerSymbol.ToOption(), - Marker: Marker.ToOption(), - LineColor: LineColor.ToOption(), - LineColorScale: LineColorScale.ToOption(), - LineWidth: LineWidth.ToOption(), - LineDash: LineDash.ToOption(), - Line: Line.ToOption(), - AlignmentGroup: AlignmentGroup.ToOption(), - OffsetGroup: OffsetGroup.ToOption(), - StackGroup: StackGroup.ToOption(), - Orientation: Orientation.ToOption(), - GroupNorm: GroupNorm.ToOption(), - FillColor: FillColor.ToOption(), - FillPatternShape: FillPatternShape.ToOption(), - FillPattern: FillPattern.ToOption(), - UseWebGL: UseWebGL.ToOption(), - UseDefaults: UseDefaults.ToOption() - ); - - /// Creates a Spline area chart, which uses a smoothed Line plotted between the given datums in a 2D space, additionally colouring the area between the line and the Y Axis. - /// Sets the x coordinates of the plotted data. - /// Sets the y coordinates of the plotted data. - /// Whether to show markers for the individual data points - /// Sets the amount of smoothing. "0" corresponds to no smoothing (equivalent to a "linear" shape). Use values between 0. and 1.3 - /// 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. - /// Sets the opactity of the trace - /// Sets the opactity of individual datum markers - /// Sets a text associated with each datum - /// Sets individual text for each datum - /// Sets the position of text associated with each datum - /// Sets the position of text associated with individual datum - /// Sets the color of the marker - /// Sets the colorscale of the marker - /// Sets the outline of the marker - /// Sets the marker symbol for each datum - /// Sets the marker symbol for each individual datum - /// Sets the marker (use this for more finegrained control than the other marker-associated arguments) - /// Sets the color of the line - /// Sets the colorscale of the line - /// Sets the width of the line - /// sets the drawing style of the line - /// Sets the line (use this for more finegrained control than the other line-associated arguments) - /// Set several traces linked to the same position axis or matching axes to the same alignmentgroup. This controls whether bars compute their positional range dependently or independently. - /// Set several traces linked to the same position axis or matching axes to the same offsetgroup where bars of the same position coordinate will line up. - /// Set several traces (on the same subplot) to the same stackgroup in order to add their y values (or their x values if `Orientation` is Horizontal). Stacking also turns `fill` on by default and sets the default `mode` to "lines" irrespective of point count. ou can only stack on a numeric (linear or log) axis. Traces in a `stackgroup` will only fill to (or be filled to) other traces in the same group. With multiple `stackgroup`s or some traces stacked and some not, if fill-linked traces are not already consecutive, the later ones will be pushed down in the drawing order - /// Sets the stacking direction. Only relevant when `stackgroup` is used, and only the first `orientation` found in the `stackgroup` will be used. - /// Sets the normalization for the sum of this `stackgroup. Only relevant when `stackgroup` is used, and only the first `groupnorm` found in the `stackgroup` will be used - /// ets the fill color. Defaults to a half-transparent variant of the line color, marker color, or marker line color, whichever is available. - /// Sets a pattern shape for the area fill - /// Sets the pattern within the area. (use this for more finegrained control than the other fillpattern-associated arguments). - /// If true, plotly.js will use the WebGL engine to render this chart. use this when you want to render many objects at once. - /// If set to false, ignore the global default settings set in `Defaults` - public static GenericChart SplineArea( - IEnumerable x, - IEnumerable y, - Optional ShowMarkers = default, - Optional Smoothing = default, - Optional Name = default, - Optional ShowLegend = default, - Optional Opacity = default, - Optional> MultiOpacity = default, - Optional Text = default, - Optional> MultiText = default, - Optional TextPosition = default, - Optional> MultiTextPosition = default, - Optional MarkerColor = default, - Optional MarkerColorScale = default, - Optional MarkerOutline = default, - Optional MarkerSymbol = default, - Optional> MultiMarkerSymbol = default, - Optional Marker = default, - Optional LineColor = default, - Optional LineColorScale = default, - Optional LineWidth = default, - Optional LineDash = default, - Optional Line = default, - Optional AlignmentGroup = default, - Optional OffsetGroup = default, - Optional StackGroup = default, - Optional Orientation = default, - Optional GroupNorm = default, - Optional FillColor = default, - Optional FillPatternShape = default, - Optional FillPattern = default, - Optional UseWebGL = default, - Optional UseDefaults = default - ) - where XType : IConvertible - where YType : IConvertible - where TextType : IConvertible - => - Plotly.NET.Chart2D_Area.Chart.SplineArea( - x: x, - y: y, - ShowMarkers: ShowMarkers.ToOption(), - Smoothing: Smoothing.ToOption(), - Name: Name.ToOption(), - ShowLegend: ShowLegend.ToOption(), - Opacity: Opacity.ToOption(), - MultiOpacity: MultiOpacity.ToOption(), - Text: Text.ToOption(), - MultiText: MultiText.ToOption(), - TextPosition: TextPosition.ToOption(), - MultiTextPosition: MultiTextPosition.ToOption(), - MarkerColor: MarkerColor.ToOption(), - MarkerColorScale: MarkerColorScale.ToOption(), - MarkerOutline: MarkerOutline.ToOption(), - MarkerSymbol: MarkerSymbol.ToOption(), - MultiMarkerSymbol: MultiMarkerSymbol.ToOption(), - Marker: Marker.ToOption(), - LineColor: LineColor.ToOption(), - LineColorScale: LineColorScale.ToOption(), - LineWidth: LineWidth.ToOption(), - LineDash: LineDash.ToOption(), - Line: Line.ToOption(), - AlignmentGroup: AlignmentGroup.ToOption(), - OffsetGroup: OffsetGroup.ToOption(), - StackGroup: StackGroup.ToOption(), - Orientation: Orientation.ToOption(), - GroupNorm: GroupNorm.ToOption(), - FillColor: FillColor.ToOption(), - FillPatternShape: FillPatternShape.ToOption(), - FillPattern: FillPattern.ToOption(), - UseWebGL: UseWebGL.ToOption(), - UseDefaults: UseDefaults.ToOption() - ); - - /// Creates a stacked Area chart, which uses a Line plotted between the given datums in a 2D space, additionally colouring the area between the line and the Y Axis. Multiple Charts of this type are stacked on top of each others y dimensions - /// Sets the x coordinates of the plotted data. - /// Sets the y coordinates of the plotted data. - /// Whether to show markers for the individual data points - /// 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. - /// Sets the opactity of the trace - /// Sets the opactity of individual datum markers - /// Sets a text associated with each datum - /// Sets individual text for each datum - /// Sets the position of text associated with each datum - /// Sets the position of text associated with individual datum - /// Sets the color of the marker - /// Sets the colorscale of the marker - /// Sets the outline of the marker - /// Sets the marker symbol for each datum - /// Sets the marker symbol for each individual datum - /// Sets the marker (use this for more finegrained control than the other marker-associated arguments) - /// Sets the color of the line - /// Sets the colorscale of the line - /// Sets the width of the line - /// sets the drawing style of the line - /// Sets the line (use this for more finegrained control than the other line-associated arguments) - /// Sets the stacking direction. Only relevant when `stackgroup` is used, and only the first `orientation` found in the `stackgroup` will be used. - /// Sets the normalization for the sum of this `stackgroup. Only relevant when `stackgroup` is used, and only the first `groupnorm` found in the `stackgroup` will be used - /// ets the fill color. Defaults to a half-transparent variant of the line color, marker color, or marker line color, whichever is available. - /// Sets a pattern shape for the area fill - /// Sets the pattern within the area. (use this for more finegrained control than the other fillpattern-associated arguments). - /// If true, plotly.js will use the WebGL engine to render this chart. use this when you want to render many objects at once. - /// If set to false, ignore the global default settings set in `Defaults` - public static GenericChart StackedArea( - IEnumerable x, - IEnumerable y, - Optional ShowMarkers = default, - Optional Name = default, - Optional ShowLegend = default, - Optional Opacity = default, - Optional> MultiOpacity = default, - Optional Text = default, - Optional> MultiText = default, - Optional TextPosition = default, - Optional> MultiTextPosition = default, - Optional MarkerColor = default, - Optional MarkerColorScale = default, - Optional MarkerOutline = default, - Optional MarkerSymbol = default, - Optional> MultiMarkerSymbol = default, - Optional Marker = default, - Optional LineColor = default, - Optional LineColorScale = default, - Optional LineWidth = default, - Optional LineDash = default, - Optional Line = default, - Optional Orientation = default, - Optional GroupNorm = default, - Optional FillColor = default, - Optional FillPatternShape = default, - Optional FillPattern = default, - Optional UseWebGL = default, - Optional UseDefaults = default - ) - where XType : IConvertible - where YType : IConvertible - where TextType : IConvertible - => - Plotly.NET.Chart2D_Area.Chart.StackedArea( - x: x, - y: y, - ShowMarkers: ShowMarkers.ToOption(), - Name: Name.ToOption(), - ShowLegend: ShowLegend.ToOption(), - Opacity: Opacity.ToOption(), - MultiOpacity: MultiOpacity.ToOption(), - Text: Text.ToOption(), - MultiText: MultiText.ToOption(), - TextPosition: TextPosition.ToOption(), - MultiTextPosition: MultiTextPosition.ToOption(), - MarkerColor: MarkerColor.ToOption(), - MarkerColorScale: MarkerColorScale.ToOption(), - MarkerOutline: MarkerOutline.ToOption(), - MarkerSymbol: MarkerSymbol.ToOption(), - MultiMarkerSymbol: MultiMarkerSymbol.ToOption(), - Marker: Marker.ToOption(), - LineColor: LineColor.ToOption(), - LineColorScale: LineColorScale.ToOption(), - LineWidth: LineWidth.ToOption(), - LineDash: LineDash.ToOption(), - Line: Line.ToOption(), - Orientation: Orientation.ToOption(), - GroupNorm: GroupNorm.ToOption(), - FillColor: FillColor.ToOption(), - FillPatternShape: FillPatternShape.ToOption(), - FillPattern: FillPattern.ToOption(), - UseWebGL: UseWebGL.ToOption(), - UseDefaults: UseDefaults.ToOption() - ); - - /// - /// Creates a Funnel chart. - /// - /// Funnel charts visualize stages in a process using length-encoded bars. This trace can be used to show data in either a part-to-whole representation wherein each item appears in a single stage, or in a "drop-off" representation wherein each item appears in each stage it traversed. See also the "funnelarea" trace type for a different approach to visualizing funnel data. - /// - /// 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. - /// Sets the Opacity of the trace. - /// Sets the bar width (in position axis units). - /// Shifts the position where the bar is drawn (in position axis units). In "group" barmode, traces that set "offset" will be excluded and drawn in "overlay" mode instead. - /// Sets a text associated with each datum - /// Sets individual text for each datum - /// Sets the position of text associated with each datum - /// Sets the position of text associated with individual datum - /// Only relevant when `stackgroup` is used, and only the first `orientation` found in the `stackgroup` will be used - including if `visible` is "legendonly" but not if it is `false`. Sets the stacking direction. With "v" ("h"), the y (x) values of subsequent traces are added. Also affects the default value of `fill`. - /// Set several traces linked to the same position axis or matching axes to the same alignmentgroup. This controls whether bars compute their positional range dependently or independently. - /// Set several traces linked to the same position axis or matching axes to the same offsetgroup where bars of the same position coordinate will line up. - /// Sets the color of the bars. - /// Sets the color of the bar outline. - /// Sets the marker (use this for more finegrained control than the other marker-associated arguments) - /// Determines which trace information appear on the graph. In the case of having multiple funnels, percentages and totals are computed separately (per trace). - /// Sets the line color of the funnel connector - /// Sets the line style of the funnel connector - /// Sets the fill color of the funnel connector - /// Sets the line of the funnel connector (use this for more finegrained control than the other connector line associated arguments). - /// Sets the funnel connector (use this for more finegrained control than the other connector-associated arguments). - /// Sets the font used for `text` lying inside the bar. - /// Sets the font used for `text` lying outside the bar. - /// If set to false, ignore the global default settings set in `Defaults` - public static GenericChart Funnel( - IEnumerable x, - IEnumerable y, - Optional Name = default, - Optional ShowLegend = default, - Optional Opacity = default, - Optional Width = default, - Optional Offset = default, - Optional Text = default, - Optional> MultiText = default, - Optional TextPosition = default, - Optional> MultiTextPosition = default, - Optional Orientation = default, - Optional AlignmentGroup = default, - Optional OffsetGroup = default, - Optional MarkerColor = default, - Optional MarkerOutline = default, - Optional Marker = default, - Optional TextInfo = default, - Optional ConnectorLineColor = default, - Optional ConnectorLineStyle = default, - Optional ConnectorFillColor = default, - Optional ConnectorLine = default, - Optional Connector = default, - Optional InsideTextFont = default, - Optional OutsideTextFont = default, - Optional UseDefaults = default - ) - where XType : IConvertible - where YType : IConvertible - where TextType : IConvertible - => - Plotly.NET.Chart2D_Funnel.Chart.Funnel( - x: x, - y: y, - Name: Name.ToOption(), - ShowLegend: ShowLegend.ToOption(), - Opacity: Opacity.ToOption(), - Width: Width.ToOption(), - Offset: Offset.ToOption(), - Text: Text.ToOption(), - MultiText: MultiText.ToOption(), - TextPosition: TextPosition.ToOption(), - MultiTextPosition: MultiTextPosition.ToOption(), - Orientation: Orientation.ToOption(), - AlignmentGroup: AlignmentGroup.ToOption(), - OffsetGroup: OffsetGroup.ToOption(), - MarkerColor: MarkerColor.ToOption(), - MarkerOutline: MarkerOutline.ToOption(), - Marker: Marker.ToOption(), - TextInfo: TextInfo.ToOption(), - ConnectorLineColor: ConnectorLineColor.ToOption(), - ConnectorLineStyle: ConnectorLineStyle.ToOption(), - ConnectorFillColor: ConnectorFillColor.ToOption(), - ConnectorLine: ConnectorLine.ToOption(), - Connector: Connector.ToOption(), - InsideTextFont: InsideTextFont.ToOption(), - OutsideTextFont: OutsideTextFont.ToOption(), - UseDefaults: UseDefaults.ToOption() - ); - - /// - /// Creates a stacked Funnel chart, a variation of the funnel chart where multiple funnel bars of each stage are stacked on top of each other. - /// To create this type of chart, combine multiple of these charts via `Chart.combine`. - /// - /// Funnel charts visualize stages in a process using length-encoded bars. This trace can be used to show data in either a part-to-whole representation wherein each item appears in a single stage, or in a "drop-off" representation wherein each item appears in each stage it traversed. See also the "funnelarea" trace type for a different approach to visualizing funnel data. - /// - /// 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. - /// Sets the Opacity of the trace. - /// Sets the bar width (in position axis units). - /// Shifts the position where the bar is drawn (in position axis units). In "group" barmode, traces that set "offset" will be excluded and drawn in "overlay" mode instead. - /// Sets a text associated with each datum - /// Sets individual text for each datum - /// Sets the position of text associated with each datum - /// Sets the position of text associated with individual datum - /// Only relevant when `stackgroup` is used, and only the first `orientation` found in the `stackgroup` will be used - including if `visible` is "legendonly" but not if it is `false`. Sets the stacking direction. With "v" ("h"), the y (x) values of subsequent traces are added. Also affects the default value of `fill`. - /// Set several traces linked to the same position axis or matching axes to the same alignmentgroup. This controls whether bars compute their positional range dependently or independently. - /// Set several traces linked to the same position axis or matching axes to the same offsetgroup where bars of the same position coordinate will line up. - /// Sets the color of the bars. - /// Sets the color of the bar outline. - /// Sets the marker (use this for more finegrained control than the other marker-associated arguments) - /// Determines which trace information appear on the graph. In the case of having multiple funnels, percentages and totals are computed separately (per trace). - /// Sets the line color of the funnel connector - /// Sets the line style of the funnel connector - /// Sets the fill color of the funnel connector - /// Sets the line of the funnel connector (use this for more finegrained control than the other connector line associated arguments). - /// Sets the funnel connector (use this for more finegrained control than the other connector-associated arguments). - /// Sets the font used for `text` lying inside the bar. - /// Sets the font used for `text` lying outside the bar. - /// If set to false, ignore the global default settings set in `Defaults` - public static GenericChart StackedFunnel( - IEnumerable x, - IEnumerable y, - Optional Name = default, - Optional ShowLegend = default, - Optional Opacity = default, - Optional Width = default, - Optional Offset = default, - Optional Text = default, - Optional> MultiText = default, - Optional TextPosition = default, - Optional> MultiTextPosition = default, - Optional Orientation = default, - Optional AlignmentGroup = default, - Optional OffsetGroup = default, - Optional MarkerColor = default, - Optional MarkerOutline = default, - Optional Marker = default, - Optional TextInfo = default, - Optional ConnectorLineColor = default, - Optional ConnectorLineStyle = default, - Optional ConnectorFillColor = default, - Optional ConnectorLine = default, - Optional Connector = default, - Optional InsideTextFont = default, - Optional OutsideTextFont = default, - Optional UseDefaults = default - ) - where XType : IConvertible - where YType : IConvertible - where TextType : IConvertible - => - Plotly.NET.Chart2D_Funnel.Chart.StackedFunnel( - x: x, - y: y, - Name: Name.ToOption(), - ShowLegend: ShowLegend.ToOption(), - Opacity: Opacity.ToOption(), - Width: Width.ToOption(), - Offset: Offset.ToOption(), - Text: Text.ToOption(), - MultiText: MultiText.ToOption(), - TextPosition: TextPosition.ToOption(), - MultiTextPosition: MultiTextPosition.ToOption(), - Orientation: Orientation.ToOption(), - AlignmentGroup: AlignmentGroup.ToOption(), - OffsetGroup: OffsetGroup.ToOption(), - MarkerColor: MarkerColor.ToOption(), - MarkerOutline: MarkerOutline.ToOption(), - Marker: Marker.ToOption(), - TextInfo: TextInfo.ToOption(), - ConnectorLineColor: ConnectorLineColor.ToOption(), - ConnectorLineStyle: ConnectorLineStyle.ToOption(), - ConnectorFillColor: ConnectorFillColor.ToOption(), - ConnectorLine: ConnectorLine.ToOption(), - Connector: Connector.ToOption(), - InsideTextFont: InsideTextFont.ToOption(), - OutsideTextFont: OutsideTextFont.ToOption(), - UseDefaults: UseDefaults.ToOption() - ); - - /// - /// Creates a waterfall chart. - /// - /// Waterfall charts are special bar charts that help visualizing the cumulative effect of sequentially introduced positive or negative values - /// - /// 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. - /// Sets the color of increasing values - /// Sets the style options of increasing values (use this for more finegrained control than the other increasing-associated arguments). - /// Sets the color of decreasing values - /// Sets the style options of decreasing values (use this for more finegrained control than the other increasing-associated arguments). - /// Sets the color of total values - /// Sets the style options of total values (use this for more finegrained control than the other increasing-associated arguments). - /// Sets where the bar base is drawn (in position axis units). - /// Sets the bar width (in position axis units). - /// Sets the individual bar width of each datum (in position axis units). - /// Sets the opacity of the trace. - /// Sets a text associated with each datum - /// Sets individual text for each datum - /// Sets the position of text associated with each datum - /// Sets the position of text associated with individual datum - /// Sets the font used for `text`. - /// Sets the waterfall connector of this trace - /// An array containing types of measures. By default the values are considered as 'relative'. However; it is possible to use 'total' to compute the sums. Also 'absolute' could be applied to reset the computed total or to declare an initial value where needed. - /// Set several traces linked to the same position axis or matching axes to the same alignmentgroup. This controls whether bars compute their positional range dependently or independently. - /// Set several traces linked to the same position axis or matching axes to the same offsetgroup where bars of the same position coordinate will line up. - /// Only relevant when `stackgroup` is used, and only the first `orientation` found in the `stackgroup` will be used - including if `visible` is "legendonly" but not if it is `false`. Sets the stacking direction. With "v" ("h"), the y (x) values of subsequent traces are added. Also affects the default value of `fill`. - /// If set to false, ignore the global default settings set in `Defaults` - public static GenericChart Waterfall( - IEnumerable x, - IEnumerable y, - Optional Name = default, - Optional ShowLegend = default, - Optional IncreasingColor = default, - Optional Increasing = default, - Optional DecreasingColor = default, - Optional Decreasing = default, - Optional TotalsColor = default, - Optional Totals = default, - Optional Base = default, - Optional Width = default, - Optional> MultiWidth = default, - Optional Opacity = default, - Optional Text = default, - Optional> MultiText = default, - Optional TextPosition = default, - Optional> MultiTextPosition = default, - Optional TextFont = default, - Optional Connector = default, - Optional> Measure = default, - Optional AlignmentGroup = default, - Optional OffsetGroup = default, - Optional Orientation = default, - Optional UseDefaults = default - ) - where XType : IConvertible - where YType : IConvertible - where TextType : IConvertible - => - Plotly.NET.Chart2D_Funnel.Chart.Waterfall( - x: x, - y: y, - Name: Name.ToOption(), - ShowLegend: ShowLegend.ToOption(), - IncreasingColor: IncreasingColor.ToOption(), - Increasing: Increasing.ToOption(), - DecreasingColor: DecreasingColor.ToOption(), - Decreasing: Decreasing.ToOption(), - TotalsColor: TotalsColor.ToOption(), - Totals: Totals.ToOption(), - Base: Base.ToOption(), - Width: Width.ToOption(), - MultiWidth: MultiWidth.ToOption(), - Opacity: Opacity.ToOption(), - Text: Text.ToOption(), - MultiText: MultiText.ToOption(), - TextPosition: TextPosition.ToOption(), - MultiTextPosition: MultiTextPosition.ToOption(), - TextFont: TextFont.ToOption(), - Connector: Connector.ToOption(), - Measure: Measure.ToOption(), - AlignmentGroup: AlignmentGroup.ToOption(), - OffsetGroup: OffsetGroup.ToOption(), - Orientation: Orientation.ToOption(), - UseDefaults: UseDefaults.ToOption() - ); - - /// - /// Creates a bar chart, with bars plotted horizontally - /// - /// A bar chart is a chart that presents categorical data with rectangular bars with heights or lengths proportional to the values that they represent. - /// - /// Sets the values that are plotted as the size of each bar. - /// Sets the keys associated with each bar. - /// Sets the keys associated with each bar. Use two inner arrays here to plot multicategorial 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. - /// Sets the Opacity of the trace. - /// Sets the Opacity of each individual bar. - /// Sets a text associated with each datum - /// Sets individual text for each datum - /// Sets the color of the bars - /// Sets the colorscale for the bars. To have an effect, `MarkerColor` must map to color scale values. - /// Sets the color of the bar outlines - /// Sets a pattern shape for all bars - /// Sets an individual pattern shape for each bar - /// Sets the marker pattern (use this for more finegrained control than the other pattern-associated arguments). - /// Sets the marker for the bars (use this for more finegrained control than the other marker-associated arguments). - /// Sets where the bar base is drawn (in position axis units). - /// Sets the bar width (in position axis units) of all bars. - /// Sets the individual bar width (in position axis units) for each bar. - /// Sets the position of text associated with each datum - /// Sets the position of text associated with individual datum - /// If set to false, ignore the global default settings set in `Defaults` - public static GenericChart Bar( - IEnumerable values, - Optional> Keys = default, - Optional>> MultiKeys = default, - Optional Name = default, - Optional ShowLegend = default, - Optional Opacity = default, - Optional> MultiOpacity = default, - Optional Text = default, - Optional> MultiText = default, - Optional MarkerColor = default, - Optional MarkerColorScale = default, - Optional MarkerOutline = default, - Optional MarkerPatternShape = default, - Optional> MultiMarkerPatternShape = default, - Optional MarkerPattern = default, - Optional Marker = default, - Optional TextPosition = default, - Optional> MultiTextPosition = default, - Optional> MultiWidth = default, - Optional UseDefaults = default, - Optional Base = default, - Optional Width = default - ) - where ValuesType : IConvertible - where KeysType : IConvertible - where TextType: IConvertible - => - Plotly.NET.Chart2D_Bar.Chart.Bar( - values: values, - Keys: Keys.ToOption(), - MultiKeys: MultiKeys.ToOption(), - Name: Name.ToOption(), - ShowLegend: ShowLegend.ToOption(), - Opacity: Opacity.ToOption(), - MultiOpacity: MultiOpacity.ToOption(), - Text: Text.ToOption(), - MultiText: MultiText.ToOption(), - MarkerColor: MarkerColor.ToOption(), - MarkerColorScale: MarkerColorScale.ToOption(), - MarkerOutline: MarkerOutline.ToOption(), - MarkerPatternShape: MarkerPatternShape.ToOption(), - MultiMarkerPatternShape: MultiMarkerPatternShape.ToOption(), - MarkerPattern: MarkerPattern.ToOption(), - Marker: Marker.ToOption(), - Base: Base.ToOption(), - Width: Width.ToOption(), - MultiWidth: MultiWidth.ToOption(), - TextPosition: TextPosition.ToOption(), - MultiTextPosition: MultiTextPosition.ToOption(), - UseDefaults: UseDefaults.ToOption() - ); - - /// - /// Creates a stacked bar chart, with bars plotted horizontally. Values with the same key are stacked on top of each other in the X dimension. - /// To create this type of chart, combine multiple of these charts via `Chart.combine`. - /// - /// A bar chart is a chart that presents categorical data with rectangular bars with heights or lengths proportional to the values that they represent. - /// - /// Sets the values that are plotted as the size of each bar. - /// Sets the keys associated with each bar. - /// Sets the keys associated with each bar. Use two inner arrays here to plot multicategorial 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. - /// Sets the Opacity of the trace. - /// Sets the Opacity of each individual bar. - /// Sets a text associated with each datum - /// Sets individual text for each datum - /// Sets the color of the bars - /// Sets the colorscale for the bars. To have an effect, `MarkerColor` must map to color scale values. - /// Sets the color of the bar outlines - /// Sets a pattern shape for all bars - /// Sets an individual pattern shape for each bar - /// Sets the marker pattern (use this for more finegrained control than the other pattern-associated arguments). - /// Sets the marker for the bars (use this for more finegrained control than the other marker-associated arguments). - /// Sets where the bar base is drawn (in position axis units). - /// Sets the bar width (in position axis units) of all bars. - /// Sets the individual bar width (in position axis units) for each bar. - /// Sets the position of text associated with each datum - /// Sets the position of text associated with individual datum - /// If set to false, ignore the global default settings set in `Defaults` - public static GenericChart StackedBar( - IEnumerable values, - Optional> Keys = default, - Optional>> MultiKeys = default, - Optional Name = default, - Optional ShowLegend = default, - Optional Opacity = default, - Optional> MultiOpacity = default, - Optional Text = default, - Optional> MultiText = default, - Optional MarkerColor = default, - Optional MarkerColorScale = default, - Optional MarkerOutline = default, - Optional MarkerPatternShape = default, - Optional> MultiMarkerPatternShape = default, - Optional MarkerPattern = default, - Optional Marker = default, - Optional TextPosition = default, - Optional> MultiTextPosition = default, - Optional> MultiWidth = default, - Optional UseDefaults = default, - Optional Base = default, - Optional Width = default - ) - where ValuesType : IConvertible - where KeysType : IConvertible - where TextType : IConvertible - => - Plotly.NET.Chart2D_Bar.Chart.StackedBar( - values: values, - Keys: Keys.ToOption(), - MultiKeys: MultiKeys.ToOption(), - Name: Name.ToOption(), - ShowLegend: ShowLegend.ToOption(), - Opacity: Opacity.ToOption(), - MultiOpacity: MultiOpacity.ToOption(), - Text: Text.ToOption(), - MultiText: MultiText.ToOption(), - MarkerColor: MarkerColor.ToOption(), - MarkerColorScale: MarkerColorScale.ToOption(), - MarkerOutline: MarkerOutline.ToOption(), - MarkerPatternShape: MarkerPatternShape.ToOption(), - MultiMarkerPatternShape: MultiMarkerPatternShape.ToOption(), - MarkerPattern: MarkerPattern.ToOption(), - Marker: Marker.ToOption(), - Base: Base.ToOption(), - Width: Width.ToOption(), - MultiWidth: MultiWidth.ToOption(), - TextPosition: TextPosition.ToOption(), - MultiTextPosition: MultiTextPosition.ToOption(), - UseDefaults: UseDefaults.ToOption() - ); - - /// - /// Creates a column chart, with bars plotted vertically - /// - /// A column chart is a chart that presents categorical data with rectangular bars with heights or lengths proportional to the values that they represent. - /// - /// Sets the values that are plotted as the size of each bar. - /// Sets the keys associated with each bar. - /// Sets the keys associated with each bar. Use two inner arrays here to plot multicategorial 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. - /// Sets the Opacity of the trace. - /// Sets the Opacity of each individual bar. - /// Sets a text associated with each datum - /// Sets individual text for each datum - /// Sets the color of the bars - /// Sets the colorscale for the bars. To have an effect, `MarkerColor` must map to color scale values. - /// Sets the color of the bar outlines - /// Sets a pattern shape for all bars - /// Sets an individual pattern shape for each bar - /// Sets the marker pattern (use this for more finegrained control than the other pattern-associated arguments). - /// Sets the marker for the bars (use this for more finegrained control than the other marker-associated arguments). - /// Sets where the bar base is drawn (in position axis units). - /// Sets the bar width (in position axis units) of all bars. - /// Sets the individual bar width (in position axis units) for each bar. - /// Sets the position of text associated with each datum - /// Sets the position of text associated with individual datum - /// If set to false, ignore the global default settings set in `Defaults` - public static GenericChart Column( - IEnumerable values, - Optional> Keys = default, - Optional>> MultiKeys = default, - Optional Name = default, - Optional ShowLegend = default, - Optional Opacity = default, - Optional> MultiOpacity = default, - Optional Text = default, - Optional> MultiText = default, - Optional MarkerColor = default, - Optional MarkerColorScale = default, - Optional MarkerOutline = default, - Optional MarkerPatternShape = default, - Optional> MultiMarkerPatternShape = default, - Optional MarkerPattern = default, - Optional Marker = default, - Optional TextPosition = default, - Optional> MultiTextPosition = default, - Optional> MultiWidth = default, - Optional UseDefaults = default, - Optional Base = default, - Optional Width = default - ) - where ValuesType : IConvertible - where KeysType : IConvertible - where TextType : IConvertible - => - Plotly.NET.Chart2D_Bar.Chart.Column( - values: values, - Keys: Keys.ToOption(), - MultiKeys: MultiKeys.ToOption(), - Name: Name.ToOption(), - ShowLegend: ShowLegend.ToOption(), - Opacity: Opacity.ToOption(), - MultiOpacity: MultiOpacity.ToOption(), - Text: Text.ToOption(), - MultiText: MultiText.ToOption(), - MarkerColor: MarkerColor.ToOption(), - MarkerColorScale: MarkerColorScale.ToOption(), - MarkerOutline: MarkerOutline.ToOption(), - MarkerPatternShape: MarkerPatternShape.ToOption(), - MultiMarkerPatternShape: MultiMarkerPatternShape.ToOption(), - MarkerPattern: MarkerPattern.ToOption(), - Marker: Marker.ToOption(), - Base: Base.ToOption(), - Width: Width.ToOption(), - MultiWidth: MultiWidth.ToOption(), - TextPosition: TextPosition.ToOption(), - MultiTextPosition: MultiTextPosition.ToOption(), - UseDefaults: UseDefaults.ToOption() - ); - - /// - /// Creates a stacked column chart, with bars plotted vertically. Values with the same key are stacked on top of each other in the Y dimension. - /// To create this type of chart, combine multiple of these charts via `Chart.combine`. - /// - /// A bar chart is a chart that presents categorical data with rectangular bars with heights or lengths proportional to the values that they represent. - /// - /// Sets the values that are plotted as the size of each bar. - /// Sets the keys associated with each bar. - /// Sets the keys associated with each bar. Use two inner arrays here to plot multicategorial 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. - /// Sets the Opacity of the trace. - /// Sets the Opacity of each individual bar. - /// Sets a text associated with each datum - /// Sets individual text for each datum - /// Sets the color of the bars - /// Sets the colorscale for the bars. To have an effect, `MarkerColor` must map to color scale values. - /// Sets the color of the bar outlines - /// Sets a pattern shape for all bars - /// Sets an individual pattern shape for each bar - /// Sets the marker pattern (use this for more finegrained control than the other pattern-associated arguments). - /// Sets the marker for the bars (use this for more finegrained control than the other marker-associated arguments). - /// Sets where the bar base is drawn (in position axis units). - /// Sets the bar width (in position axis units) of all bars. - /// Sets the individual bar width (in position axis units) for each bar. - /// Sets the position of text associated with each datum - /// Sets the position of text associated with individual datum - /// If set to false, ignore the global default settings set in `Defaults` - public static GenericChart StackedColumn( - IEnumerable values, - Optional> Keys = default, - Optional>> MultiKeys = default, - Optional Name = default, - Optional ShowLegend = default, - Optional Opacity = default, - Optional> MultiOpacity = default, - Optional Text = default, - Optional> MultiText = default, - Optional MarkerColor = default, - Optional MarkerColorScale = default, - Optional MarkerOutline = default, - Optional MarkerPatternShape = default, - Optional> MultiMarkerPatternShape = default, - Optional MarkerPattern = default, - Optional Marker = default, - Optional TextPosition = default, - Optional> MultiTextPosition = default, - Optional> MultiWidth = default, - Optional UseDefaults = default, - Optional Base = default, - Optional Width = default - ) - where ValuesType : IConvertible - where KeysType : IConvertible - where TextType : IConvertible - => - Plotly.NET.Chart2D_Bar.Chart.StackedColumn( - values: values, - Keys: Keys.ToOption(), - MultiKeys: MultiKeys.ToOption(), - Name: Name.ToOption(), - ShowLegend: ShowLegend.ToOption(), - Opacity: Opacity.ToOption(), - MultiOpacity: MultiOpacity.ToOption(), - Text: Text.ToOption(), - MultiText: MultiText.ToOption(), - MarkerColor: MarkerColor.ToOption(), - MarkerColorScale: MarkerColorScale.ToOption(), - MarkerOutline: MarkerOutline.ToOption(), - MarkerPatternShape: MarkerPatternShape.ToOption(), - MultiMarkerPatternShape: MultiMarkerPatternShape.ToOption(), - MarkerPattern: MarkerPattern.ToOption(), - Marker: Marker.ToOption(), - Base: Base.ToOption(), - Width: Width.ToOption(), - MultiWidth: MultiWidth.ToOption(), - TextPosition: TextPosition.ToOption(), - MultiTextPosition: MultiTextPosition.ToOption(), - UseDefaults: UseDefaults.ToOption() - ); - - /// - /// Visualizes the distribution of the input data as a histogram. - /// - /// A histogram is an approximate representation of the distribution of numerical data. To construct a histogram, the first step is to "bin" the range of values - that is, divide the entire range of values into a series of intervals - and then count how many values fall into each interval. - /// The bins are usually specified as consecutive, non-overlapping intervals of a variable. - /// - /// The sample data from which statistics are computed is set in `x` for vertically spanning histograms and in `y` for horizontally spanning histograms. Binning options are set `xbins` and `ybins` respectively if no aggregation data is provided. - /// - /// Sets the sample data to be binned on the x axis. - /// Sets the sample data to be binned on the x axis. Use two inner arrays here to plot multicategorial data - /// Sets the sample data to be binned on the y axis. - /// Sets the sample data to be binned on the y axis. Use two inner arrays here to plot multicategorial data - /// Sets the orientation of the bars. With "v" ("h"), the value of the each bar spans along the vertical (horizontal). - /// 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. - /// Sets the Opacity of the trace. - /// Sets a text associated with each datum - /// Sets individual text for each datum - /// Sets the position of text associated with each datum - /// Specifies the binning function used for this histogram trace. If "count", the histogram values are computed by counting the number of values lying inside each bin. If "sum", "avg", "min", "max", the histogram values are computed using the sum, the average, the minimum or the maximum of the values lying inside each bin respectively. - /// Specifies the type of normalization used for this histogram trace. If "", the span of each bar corresponds to the number of occurrences (i.e. the number of data points lying inside the bins). If "percent" / "probability", the span of each bar corresponds to the percentage / fraction of occurrences with respect to the total number of sample points (here, the sum of all bin HEIGHTS equals 100% / 1). If "density", the span of each bar corresponds to the number of occurrences in a bin divided by the size of the bin interval (here, the sum of all bin AREAS equals the total number of sample points). If "probability density", the area of each bar corresponds to the probability that an event will fall into the corresponding bin (here, the sum of all bin AREAS equals 1). - /// Set several traces linked to the same position axis or matching axes to the same alignmentgroup. This controls whether bars compute their positional range dependently or independently. - /// Set several traces linked to the same position axis or matching axes to the same offsetgroup where bars of the same position coordinate will line up. - /// Specifies the maximum number of desired bins. This value will be used in an algorithm that will decide the optimal bin size such that the histogram best visualizes the distribution of the data. Ignored if `xbins.size` is provided. - /// Specifies the maximum number of desired bins. This value will be used in an algorithm that will decide the optimal bin size such that the histogram best visualizes the distribution of the data. Ignored if `ybins.size` is provided. - /// Set a group of histogram traces which will have compatible bin settings. Note that traces on the same subplot and with the same "orientation" under `barmode` "stack", "relative" and "group" are forced into the same bingroup, Using `bingroup`, traces under `barmode` "overlay" and on different axes (of the same axis type) can have compatible bin settings. Note that histogram and histogram2d" trace can share the same `bingroup` - /// Sets the binning across the x dimension - /// Sets the binning across the y dimension - /// Sets the color of the bars - /// Sets the colorscale for the bars. To have an effect, `MarkerColor` must map to color scale values. - /// Sets the color of the bar outlines - /// Sets a pattern shape for all bars - /// Sets an individual pattern shape for each bar - /// Sets the marker pattern (use this for more finegrained control than the other pattern-associated arguments). - /// Sets the marker of this trace. - /// Sets the outline of the histogram's bars. - /// Sets the x error of this trace. - /// Sets the y error of this trace. - /// Sets whether and how the cumulative distribution is displayed - /// Sets the style of the hoverlabels of this trace. - /// If set to false, ignore the global default settings set in `Defaults` - public static GenericChart Histogram( - Optional> X = default, - Optional>> MultiX = default, - Optional> Y = default, - Optional>> MultiY = default, - Optional Orientation = default, - Optional Name = default, - Optional ShowLegend = default, - Optional Opacity = default, - Optional Text = default, - Optional> MultiText = default, - Optional TextPosition = default, - Optional HistFunc = default, - Optional HistNorm = default, - Optional AlignmentGroup = default, - Optional OffsetGroup = default, - Optional NBinsX = default, - Optional NBinsY = default, - Optional BinGroup = default, - Optional XBins = default, - Optional YBins = default, - Optional MarkerColor = default, - Optional MarkerColorScale = default, - Optional MarkerOutline = default, - Optional MarkerPatternShape = default, - Optional> MultiMarkerPatternShape = default, - Optional MarkerPattern = default, - Optional Marker = default, - Optional Line = default, - Optional XError = default, - Optional YError = default, - Optional Cumulative = default, - Optional HoverLabel = default, - Optional UseDefaults = default - ) - where XType : IConvertible - where YType : IConvertible - where TextType : IConvertible - => - Plotly.NET.Chart2D_Histogram.Chart.Histogram( - X: X.ToOption(), - MultiX: MultiX.ToOption(), - Y: Y.ToOption(), - MultiY: MultiY.ToOption(), - Orientation: Orientation.ToOption(), - Name: Name.ToOption(), - ShowLegend: ShowLegend.ToOption(), - Opacity: Opacity.ToOption(), - Text: Text.ToOption(), - MultiText: MultiText.ToOption(), - TextPosition: TextPosition.ToOption(), - HistFunc: HistFunc.ToOption(), - HistNorm: HistNorm.ToOption(), - AlignmentGroup: AlignmentGroup.ToOption(), - OffsetGroup: OffsetGroup.ToOption(), - NBinsX: NBinsX.ToOption(), - NBinsY: NBinsY.ToOption(), - BinGroup: BinGroup.ToOption(), - XBins: XBins.ToOption(), - YBins: YBins.ToOption(), - MarkerColor: MarkerColor.ToOption(), - MarkerColorScale: MarkerColorScale.ToOption(), - MarkerOutline: MarkerOutline.ToOption(), - MarkerPatternShape: MarkerPatternShape.ToOption(), - MultiMarkerPatternShape: MultiMarkerPatternShape.ToOption(), - MarkerPattern: MarkerPattern.ToOption(), - Marker: Marker.ToOption(), - Line: Line.ToOption(), - XError: XError.ToOption(), - YError: YError.ToOption(), - Cumulative: Cumulative.ToOption(), - HoverLabel: HoverLabel.ToOption(), - UseDefaults: UseDefaults.ToOption() - ); - - /// - /// Visualizes the distribution of the 2-dimensional input data as 2D Histogram. - /// - ///The sample data from which statistics are computed is set in `x` and `y` (where `x` and `y` represent marginal distributions, binning is set in `xbins` and `ybins` in this case) or `z` (where `z` represent the 2D distribution and binning set, binning is set by `x` and `y` in this case). The resulting distribution is visualized as a heatmap. - /// - /// Sets the sample data to be binned on the x axis. - /// Sets the sample data to be binned on the y axis. - /// Sets the aggregation 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. - /// Sets the Opacity of the trace. - /// Sets the horizontal gap (in pixels) between bricks. - /// Sets the vertical gap (in pixels) between bricks. - /// Specifies the binning function used for this histogram trace. If "count", the histogram values are computed by counting the number of values lying inside each bin. If "sum", "avg", "min", "max", the histogram values are computed using the sum, the average, the minimum or the maximum of the values lying inside each bin respectively. - /// Specifies the type of normalization used for this histogram trace. If "", the span of each bar corresponds to the number of occurrences (i.e. the number of data points lying inside the bins). If "percent" / "probability", the span of each bar corresponds to the percentage / fraction of occurrences with respect to the total number of sample points (here, the sum of all bin HEIGHTS equals 100% / 1). If "density", the span of each bar corresponds to the number of occurrences in a bin divided by the size of the bin interval (here, the sum of all bin AREAS equals the total number of sample points). If "probability density", the area of each bar corresponds to the probability that an event will fall into the corresponding bin (here, the sum of all bin AREAS equals 1). - /// Specifies the maximum number of desired bins. This value will be used in an algorithm that will decide the optimal bin size such that the histogram best visualizes the distribution of the data. Ignored if `xbins.size` is provided. - /// Specifies the maximum number of desired bins. This value will be used in an algorithm that will decide the optimal bin size such that the histogram best visualizes the distribution of the data. Ignored if `ybins.size` is provided. - /// Sets the binning across the x dimension - /// Sets the binning across the y dimension - /// Sets the styles of the colorbar for this trace. - /// Sets the colorscale for this trace. - /// Whether or not to show the colorscale/colorbar - /// Reverses the color mapping if true. If true, `zmin` will correspond to the last color in the array and `zmax` will correspond to the first color. - /// Picks a smoothing algorithm use to smooth `z` data. - /// If set to false, ignore the global default settings set in `Defaults` - public static GenericChart Histogram2D( - IEnumerable x, - IEnumerable y, - Optional>> Z = default, - Optional Name = default, - Optional ShowLegend = default, - Optional Opacity = default, - Optional XGap = default, - Optional YGap = default, - Optional HistFunc = default, - Optional HistNorm = default, - Optional NBinsX = default, - Optional NBinsY = default, - Optional XBins = default, - Optional YBins = default, - Optional ColorBar = default, - Optional ColorScale = default, - Optional ShowScale = default, - Optional ReverseScale = default, - Optional ZSmooth = default, - Optional UseDefaults = default - ) - where XType : IConvertible - where YType : IConvertible - where ZType : IConvertible - => - Plotly.NET.Chart2D_Histogram.Chart.Histogram2D, ZType>( - x: x, - y: y, - Z: Z.ToOption(), - Name: Name.ToOption(), - ShowLegend: ShowLegend.ToOption(), - Opacity: Opacity.ToOption(), - XGap: XGap.ToOption(), - YGap: YGap.ToOption(), - HistFunc: HistFunc.ToOption(), - HistNorm: HistNorm.ToOption(), - NBinsX: NBinsX.ToOption(), - NBinsY: NBinsY.ToOption(), - XBins: XBins.ToOption(), - YBins: YBins.ToOption(), - ColorBar: ColorBar.ToOption(), - ColorScale: ColorScale.ToOption(), - ShowScale: ShowScale.ToOption(), - ReverseScale: ReverseScale.ToOption(), - ZSmooth: ZSmooth.ToOption(), - UseDefaults: UseDefaults.ToOption() - ); - - /// - /// Visualizes the distribution of the input data as a box plot. - /// - /// A box plot is a method for graphically demonstrating the locality, spread and skewness groups of numerical data through their quartiles. - /// The default style is based on the five number summary: minimum, first quartile, median, third quartile, and maximum. - /// - /// The sample data from which statistics are computed is set in `x` for vertically spanning boxes and in `y` for horizontally spanning boxes. - /// - /// Sets the x sample data or coordinates - /// Sets the x sample data or coordinates. Use two inner arrays here to plot multicategorial data - /// Sets the y sample data or coordinates - /// Sets the y sample data or coordinates. Use two inner arrays here to plot multicategorial 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. - /// Sets a text associated with each datum - /// Sets individual text for each datum - /// Sets the fill color. Defaults to a half-transparent variant of the line color, marker color, or marker line color, whichever is available. - /// Sets the marker color. - /// Sets the marker for the box (use this for more finegrained control than the other marker-associated arguments).// Sets the opacity of this trace. - /// Sets the width of the whiskers relative to the box' width. For example, with 1, the whiskers are as wide as the box(es). - /// If "outliers", only the sample points lying outside the whiskers are shown If "suspectedoutliers", the outlier points are shown and points either less than 4"Q1-3"Q3 or greater than 4"Q3-3"Q1 are highlighted (see `outliercolor`) If "all", all sample points are shown If "false", only the box(es) are shown with no sample points Defaults to "suspectedoutliers" when `marker.outliercolor` or `marker.line.outliercolor` is set. Defaults to "all" under the q1/median/q3 signature. Otherwise defaults to "outliers". - /// If "true", the mean of the box(es)' underlying distribution is drawn as a dashed line inside the box(es). If "sd" the standard deviation is also drawn. Defaults to "true" when `mean` is set. Defaults to "sd" when `sd` is set Otherwise defaults to "false". - /// Sets the amount of jitter in the sample points drawn. If "0", the sample points align along the distribution axis. If "1", the sample points are drawn in a random jitter of width equal to the width of the box(es). - /// Sets the position of the sample points in relation to the box(es). If "0", the sample points are places over the center of the box(es). Positive (negative) values correspond to positions to the right (left) for vertical boxes and above (below) for horizontal boxes - /// Sets the orientation of the box(es). If "v" ("h"), the distribution is visualized along the vertical (horizontal). - /// Sets the color of the box outline - /// Sets the width of the box outline - /// Sets the box outline (use this for more finegrained control than the other outline-associated arguments). - /// Set several traces linked to the same position axis or matching axes to the same alignmentgroup. This controls whether bars compute their positional range dependently or independently. - /// Set several traces linked to the same position axis or matching axes to the same offsetgroup where bars of the same position coordinate will line up. - /// Determines whether or not notches are drawn. Notches displays a confidence interval around the median. We compute the confidence interval as median +/- 1.57 " IQR / sqrt(N), where IQR is the interquartile range and N is the sample size. If two boxes' notches do not overlap there is 95% confidence their medians differ. See https://sites.google.com/site/davidsstatistics/home/notched-box-plots for more info. Defaults to "false" unless `notchwidth` or `notchspan` is set. - /// Sets the width of the notches relative to the box' width. For example, with 0, the notches are as wide as the box(es). - /// Sets the method used to compute the sample's Q1 and Q3 quartiles. The "linear" method uses the 25th percentile for Q1 and 75th percentile for Q3 as computed using method #10 (listed on http://www.amstat.org/publications/jse/v14n3/langford.html). The "exclusive" method uses the median to divide the ordered dataset into two halves if the sample is odd, it does not include the median in either half - Q1 is then the median of the lower half and Q3 the median of the upper half. The "inclusive" method also uses the median to divide the ordered dataset into two halves but if the sample is odd, it includes the median in both halves - Q1 is then the median of the lower half and Q3 the median of the upper half. - /// Sets the upper and lower bound for the boxes quartiles means box is drawn between Q1 and Q3 SD means the box is drawn between Mean +- Standard Deviation Argument sdmultiple (default 1) to scale the box size So it could be drawn 1-stddev, 3-stddev etc - /// If set to false, ignore the global default settings set in `Defaults` - public static GenericChart BoxPlot( - Optional> X = default, - Optional>> MultiX = default, - Optional> Y = default, - Optional>> MultiY = default, - Optional Name = default, - Optional ShowLegend = default, - Optional Text = default, - Optional> MultiText = default, - Optional FillColor = default, - Optional MarkerColor = default, - Optional Marker = default, - Optional Opacity = default, - Optional WhiskerWidth = default, - Optional BoxPoints = default, - Optional BoxMean = default, - Optional Jitter = default, - Optional PointPos = default, - Optional Orientation = default, - Optional OutlineColor = default, - Optional OutlineWidth = default, - Optional Outline = default, - Optional AlignmentGroup = default, - Optional OffsetGroup = default, - Optional Notched = default, - Optional NotchWidth = default, - Optional QuartileMethod = default, - Optional SizeMode = default, - Optional UseDefaults = default - ) - where XType : IConvertible - where YType : IConvertible - where TextType : IConvertible - => - Plotly.NET.Chart2D_Distribution.Chart.BoxPlot( - X: X.ToOption(), - MultiX: MultiX.ToOption(), - Y: Y.ToOption(), - MultiY: MultiY.ToOption(), - Name: Name.ToOption(), - ShowLegend: ShowLegend.ToOption(), - Text: Text.ToOption(), - MultiText: MultiText.ToOption(), - FillColor: FillColor.ToOption(), - MarkerColor: MarkerColor.ToOption(), - Marker: Marker.ToOption(), - Opacity: Opacity.ToOption(), - WhiskerWidth: WhiskerWidth.ToOption(), - BoxPoints: BoxPoints.ToOption(), - BoxMean: BoxMean.ToOption(), - Jitter: Jitter.ToOption(), - PointPos: PointPos.ToOption(), - Orientation: Orientation.ToOption(), - OutlineColor: OutlineColor.ToOption(), - OutlineWidth: OutlineWidth.ToOption(), - Outline: Outline.ToOption(), - AlignmentGroup: AlignmentGroup.ToOption(), - OffsetGroup: OffsetGroup.ToOption(), - Notched: Notched.ToOption(), - NotchWidth: NotchWidth.ToOption(), - QuartileMethod: QuartileMethod.ToOption(), - SizeMode: SizeMode.ToOption(), - UseDefaults: UseDefaults.ToOption() - ); - - /// - /// Visualizes the distribution of the input data as a violin plot. - /// - /// A violin plot is a method of plotting numeric data. It is similar to a box plot, except that they also show the probability density of the data at different values, usually smoothed by a kernel density estimator. - /// - /// In vertical (horizontal) violin plots, statistics are computed using `y` (`x`) values. By supplying an `x` (`y`) array, one violin per distinct x (y) value is drawn If no `x` (`y`) array is provided, a single violin is drawn. That violin position is then positioned with with `name` or with `x0` (`y0`) if provided. - /// - /// Sets the x sample data or coordinates - /// Sets the x sample data or coordinates. Use two inner arrays here to plot multicategorial data - /// Sets the y sample data or coordinates - /// Sets the y sample data or coordinates. Use two inner arrays here to plot multicategorial 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. - /// Sets a text associated with each datum - /// Sets individual text for each datum - /// Sets the fill color. Defaults to a half-transparent variant of the line color, marker color, or marker line color, whichever is available. - /// Sets the Opacity otf the trace. - /// If "outliers", only the sample points lying outside the whiskers are shown If "suspectedoutliers", the outlier points are shown and points either less than 4"Q1-3"Q3 or greater than 4"Q3-3"Q1 are highlighted (see `outliercolor`) If "all", all sample points are shown If "false", only the violins are shown with no sample points. Defaults to "suspectedoutliers" when `marker.outliercolor` or `marker.line.outliercolor` is set, otherwise defaults to "outliers". - /// Sets the amount of jitter in the sample points drawn. If "0", the sample points align along the distribution axis. If "1", the sample points are drawn in a random jitter of width equal to the width of the box(es). - /// Sets the position of the sample points in relation to the box(es). If "0", the sample points are places over the center of the box(es). Positive (negative) values correspond to positions to the right (left) for vertical boxes and above (below) for horizontal boxes - /// Sets the orientation of the violin(s). If "v" ("h"), the distribution is visualized along the vertical (horizontal). - /// Sets the width of the violin in data coordinates. If "0" (default value) the width is automatically selected based on the positions of other violin traces in the same subplot. - /// Sets the marker color. - /// Sets the marker for the violin (use this for more finegrained control than the other marker-associated arguments). - /// Sets the color of the box outline - /// Sets the width of the box outline - /// Sets the box outline (use this for more finegrained control than the other outline-associated arguments). - /// Set several traces linked to the same position axis or matching axes to the same alignmentgroup. This controls whether bars compute their positional range dependently or independently. - /// Set several traces linked to the same position axis or matching axes to the same offsetgroup where bars of the same position coordinate will line up. - /// Whether and how to draw a miniature box plot - /// Sets the width of the miniature box plot - /// Sets the fill color of the miniature box plot - /// Sets the styles of the miniature box plot (use this for more finegrained control than the other box-associated arguments) - /// Sets the bandwidth used to compute the kernel density estimate. By default, the bandwidth is determined by Silverman's rule of thumb. - /// Whether and how to draw the meanline - /// If there are multiple violins that should be sized according to to some metric (see `scalemode`), link them by providing a non-empty group id here shared by every trace in the same group. If a violin's `width` is undefined, `scalegroup` will default to the trace's name. In this case, violins with the same names will be linked together - /// Sets the metric by which the width of each violin is determined."width" means each violin has the same (max) width"count" means the violins are scaled by the number of sample points makingup each violin. - /// Determines on which side of the position value the density function making up one half of a violin is plotted. Useful when comparing two violin traces under "overlay" mode, where one trace has `side` set to "positive" and the other to "negative". - /// Sets the span in data space for which the density function will be computed. Has an effect only when `spanmode` is set to "manual". - /// Sets the method by which the span in data space where the density function will be computed. "soft" means the span goes from the sample's minimum value minus two bandwidths to the sample's maximum value plus two bandwidths. "hard" means the span goes from the sample's minimum to its maximum value. For custom span settings, use mode "manual" and fill in the `span` attribute. - /// If set to false, ignore the global default settings set in `Defaults` - public static GenericChart Violin( - Optional> X = default, - Optional>> MultiX = default, - Optional> Y = default, - Optional>> MultiY = default, - Optional Name = default, - Optional ShowLegend = default, - Optional Text = default, - Optional> MultiText = default, - Optional FillColor = default, - Optional Opacity = default, - Optional Points = default, - Optional Jitter = default, - Optional PointPos = default, - Optional Orientation = default, - Optional Width = default, - Optional MarkerColor = default, - Optional Marker = default, - Optional OutlineColor = default, - Optional OutlineWidth = default, - Optional Outline = default, - Optional AlignmentGroup = default, - Optional OffsetGroup = default, - Optional ShowBox = default, - Optional BoxWidth = default, - Optional BoxFillColor = default, - Optional Box = default, - Optional BandWidth = default, - Optional MeanLine = default, - Optional ScaleGroup = default, - Optional ScaleMode = default, - Optional Side = default, - Optional Span = default, - Optional SpanMode = default, - Optional UseDefaults = default - ) - where XType : IConvertible - where YType : IConvertible - where TextType : IConvertible - => - Plotly.NET.Chart2D_Distribution.Chart.Violin( - X: X.ToOption(), - MultiX: MultiX.ToOption(), - Y: Y.ToOption(), - MultiY: MultiY.ToOption(), - Name: Name.ToOption(), - ShowLegend: ShowLegend.ToOption(), - Text: Text.ToOption(), - MultiText: MultiText.ToOption(), - FillColor: FillColor.ToOption(), - Opacity: Opacity.ToOption(), - Points: Points.ToOption(), - Jitter: Jitter.ToOption(), - PointPos: PointPos.ToOption(), - Orientation: Orientation.ToOption(), - Width: Width.ToOption(), - MarkerColor: MarkerColor.ToOption(), - Marker: Marker.ToOption(), - OutlineColor: OutlineColor.ToOption(), - OutlineWidth: OutlineWidth.ToOption(), - Outline: Outline.ToOption(), - AlignmentGroup: AlignmentGroup.ToOption(), - OffsetGroup: OffsetGroup.ToOption(), - ShowBox: ShowBox.ToOption(), - BoxWidth: BoxWidth.ToOption(), - BoxFillColor: BoxFillColor.ToOption(), - Box: Box.ToOption(), - BandWidth: BandWidth.ToOption(), - MeanLine: MeanLine.ToOption(), - ScaleGroup: ScaleGroup.ToOption(), - ScaleMode: ScaleMode.ToOption(), - Side: Side.ToOption(), - Span: Span.ToOption(), - SpanMode: SpanMode.ToOption(), - UseDefaults: UseDefaults.ToOption() - ); - - /// - /// Computes a 2D histogram contour plot, also known as a density contour plot, which is a 2-dimensional generalization of a histogram which resembles a contour plot but is computed by grouping a set of points specified by their x and y coordinates into bins, and applying an aggregation function such as count or sum (if z is provided) to compute the value to be used to compute contours. - /// - /// The sample data from which statistics are computed is set in `x` and `y` (where `x` and `y` represent marginal distributions, binning is set in `xbins` and `ybins` in this case) or `z` (where `z` represent the 2D distribution and binning set, binning is set by `x` and `y` in this case). The resulting distribution is visualized as a contour plot. - /// - /// Sets the sample data to be binned on the x axis. - /// Sets the sample data to be binned on the x axis. Use two inner arrays here to plot multicategorial data - /// Sets the sample data to be binned on the y axis. - /// Sets the sample data to be binned on the y axis. Use two inner arrays here to plot multicategorial 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. - /// Sets the Opacity otf the trace. - /// Sets the aggregation data. - /// Specifies the binning function used for this histogram trace. If "count", the histogram values are computed by counting the number of values lying inside each bin. If "sum", "avg", "min", "max", the histogram values are computed using the sum, the average, the minimum or the maximum of the values lying inside each bin respectively. - /// Specifies the type of normalization used for this histogram trace. If "", the span of each bar corresponds to the number of occurrences (i.e. the number of data points lying inside the bins). If "percent" / "probability", the span of each bar corresponds to the percentage / fraction of occurrences with respect to the total number of sample points (here, the sum of all bin HEIGHTS equals 100% / 1). If "density", the span of each bar corresponds to the number of occurrences in a bin divided by the size of the bin interval (here, the sum of all bin AREAS equals the total number of sample points). If "probability density", the area of each bar corresponds to the probability that an event will fall into the corresponding bin (here, the sum of all bin AREAS equals 1). - /// Specifies the maximum number of desired bins. This value will be used in an algorithm that will decide the optimal bin size such that the histogram best visualizes the distribution of the data. Ignored if `xbins.size` is provided. - /// Specifies the maximum number of desired bins. This value will be used in an algorithm that will decide the optimal bin size such that the histogram best visualizes the distribution of the data. Ignored if `ybins.size` is provided. - /// Set the `xbingroup` and `ybingroup` default prefix For example, setting a `bingroup` of "1" on two histogram2d traces will make them their x-bins and y-bins match separately. - /// Set a group of histogram traces which will have compatible x-bin settings. Using `xbingroup`, histogram2d and histogram2dcontour traces (on axes of the same axis type) can have compatible x-bin settings. Note that the same `xbingroup` value can be used to set (1D) histogram `bingroup` - /// Sets the binning across the x dimension - /// Set a group of histogram traces which will have compatible y-bin settings. Using `ybingroup`, histogram2d and histogram2dcontour traces (on axes of the same axis type) can have compatible y-bin settings. Note that the same `ybingroup` value can be used to set (1D) histogram `bingroup` - /// Sets the binning across the y dimension - /// Sets the marker of this trace. - /// Sets the contour line dash style - /// Sets the contour line color - /// Sets the amount of smoothing for the contour lines, where "0" corresponds to no smoothing. - /// Sets the width of the contour lines - /// Sets the contour lines (use this for more finegrained control than the other contourline-associated arguments). - /// Wether or not to show the contour line - /// Determines the coloring method showing the contour values. If "fill", coloring is done evenly between each contour level If "heatmap", a heatmap gradient coloring is applied between each contour level. If "lines", coloring is done on the contour lines. If "none", no coloring is applied on this trace. - /// Sets the constraint operation. "=" keeps regions equal to `value` "<" and "<=" keep regions less than `value` ">" and ">=" keep regions greater than `value` "[]", "()", "[)", and "(]" keep regions inside `value[0]` to `value[1]` "][", ")(", "](", ")[" keep regions outside `value[0]` to value[1]` Open vs. closed intervals make no difference to constraint display, but all versions are allowed for consistency with filter transforms. - /// If `levels`, the data is represented as a contour plot with multiple levels displayed. If `constraint`, the data is represented as constraints with the invalid region shaded as specified by the `operation` and `value` parameters. - /// Determines whether to label the contour lines with their values. - /// Sets the font used for labeling the contour levels. The default color comes from the lines, if shown. The default family and size come from `layout.font`. - /// Sets the starting contour level value. Must be less than `contours.end` - /// Sets the end contour level value. Must be more than `contours.start` - /// Sets the styles of the contours (use this for more finegrained control than the other contour-associated arguments). - /// Sets the styles of the colorbar for this trace. - /// Sets the colorscale for this trace. - /// Whether or not to show the colorscale/colorbar - /// Reverses the color mapping if true. If true, `zmin` will correspond to the last color in the array and `zmax` will correspond to the first color. - /// Sets the maximum number of contour levels. The actual number of contours will be chosen automatically to be less than or equal to the value of `ncontours`. Has an effect only if `autocontour` is "true" or if `contours.size` is missing. - /// If set to false, ignore the global default settings set in `Defaults` - public static GenericChart Histogram2DContour( - Optional> X, - Optional>> MultiX, - Optional> Y, - Optional>> MultiY, - Optional Name = default, - Optional ShowLegend = default, - Optional Opacity = default, - Optional>> Z = default, - Optional HistFunc = default, - Optional HistNorm = default, - Optional NBinsX = default, - Optional NBinsY = default, - Optional BinGroup = default, - Optional XBinGroup = default, - Optional XBins = default, - Optional YBinGroup = default, - Optional YBins = default, - Optional Marker = default, - Optional ContourLinesDash = default, - Optional ContourLinesColor = default, - Optional ContourLinesSmoothing = default, - Optional ContourLinesWidth = default, - Optional ContourLines = default, - Optional ShowContourLines = default, - Optional ContoursColoring = default, - Optional ContoursOperation = default, - Optional ContoursType = default, - Optional ShowContoursLabels = default, - Optional ContourLabelFont = default, - Optional ContoursStart = default, - Optional ContoursEnd = default, - Optional Contours = default, - Optional ColorBar = default, - Optional ColorScale = default, - Optional ShowScale = default, - Optional ReverseScale = default, - Optional NContours = default, - Optional UseDefaults = default - ) - where XType : IConvertible - where YType : IConvertible - where ZType : IConvertible - => - Plotly.NET.Chart2D_Histogram.Chart.Histogram2DContour, ZType>( - X: X.ToOption(), - MultiX: MultiX.ToOption(), - Y: Y.ToOption(), - MultiY: MultiY.ToOption(), - Name: Name.ToOption(), - ShowLegend: ShowLegend.ToOption(), - Opacity: Opacity.ToOption(), - Z: Z.ToOption(), - HistFunc: HistFunc.ToOption(), - HistNorm: HistNorm.ToOption(), - NBinsX: NBinsX.ToOption(), - NBinsY: NBinsY.ToOption(), - BinGroup: BinGroup.ToOption(), - XBinGroup: XBinGroup.ToOption(), - XBins: XBins.ToOption(), - YBinGroup: YBinGroup.ToOption(), - YBins: YBins.ToOption(), - Marker: Marker.ToOption(), - ContourLinesDash: ContourLinesDash.ToOption(), - ContourLinesColor: ContourLinesColor.ToOption(), - ContourLinesSmoothing: ContourLinesSmoothing.ToOption(), - ContourLinesWidth: ContourLinesWidth.ToOption(), - ContourLines: ContourLines.ToOption(), - ShowContourLines: ShowContourLines.ToOption(), - ContoursColoring: ContoursColoring.ToOption(), - ContoursOperation: ContoursOperation.ToOption(), - ContoursType: ContoursType.ToOption(), - ShowContoursLabels: ShowContoursLabels.ToOption(), - ContoursLabelFont: ContourLabelFont.ToOption(), - ContoursStart: ContoursStart.ToOption(), - ContoursEnd: ContoursEnd.ToOption(), - Contours: Contours.ToOption(), - ColorBar: ColorBar.ToOption(), - ColorScale: ColorScale.ToOption(), - ShowScale: ShowScale.ToOption(), - ReverseScale: ReverseScale.ToOption(), - NContours: NContours.ToOption(), - UseDefaults: UseDefaults.ToOption() - ); - - /// - /// Creates a heatmap. - /// - /// A heatmap is a data visualization technique that shows magnitude of a phenomenon as color in two dimensions. - /// - /// Sets the 2-dimensional z data, which will be visualized with the color scale. - /// Sets the x coordinates - /// Sets the x coordinates. Use two inner arrays here to plot multicategorial data - /// Sets the y coordinates - /// Sets the y coordinates. Use two inner arrays here to plot multicategorial 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. - /// Sets the Opacity otf the trace. - /// Sets the horizontal gap (in pixels) between bricks. - /// Sets the vertical gap (in pixels) between bricks. - /// Sets a text associated with each datum - /// Sets individual text for each datum - /// Sets the styles of the colorbar for this trace. - /// Sets the colorscale for this trace. - /// Whether or not to show the colorscale/colorbar - /// Reverses the color mapping if true. If true, `zmin` will correspond to the last color in the array and `zmax` will correspond to the first color. - /// Picks a smoothing algorithm use to smooth `z` data. - /// Transposes the z data. - /// Whether or not to use WebGL to render this trace - /// Whether or not to reverse the y axis. If true, (0,0) will lie on the top left and increase downwards. - /// If set to false, ignore the global default settings set in `Defaults` - public static GenericChart Heatmap( - IEnumerable> zData, - Optional> X = default, - Optional>> MultiX = default, - Optional> Y = default, - Optional>> MultiY = default, - Optional Name = default, - Optional ShowLegend = default, - Optional Opacity = default, - Optional XGap = default, - Optional YGap = default, - Optional Text = default, - Optional> MultiText = default, - Optional ColorBar = default, - Optional ColorScale = default, - Optional ShowScale = default, - Optional ReverseScale = default, - Optional ZSmooth = default, - Optional Transpose = default, - Optional UseWebGL = default, - Optional ReverseYAxis = default, - Optional UseDefaults = default - ) - where ZType : IConvertible - where XType : IConvertible - where YType : IConvertible - where TextType : IConvertible - => - Plotly.NET.Chart2D_Heatmap.Chart.Heatmap, ZType, XType, YType, TextType>( - zData: zData, - X: X.ToOption(), - MultiX: MultiX.ToOption(), - Y: Y.ToOption(), - MultiY: MultiY.ToOption(), - Name: Name.ToOption(), - ShowLegend: ShowLegend.ToOption(), - Opacity: Opacity.ToOption(), - XGap: XGap.ToOption(), - YGap: YGap.ToOption(), - Text: Text.ToOption(), - MultiText: MultiText.ToOption(), - ColorBar: ColorBar.ToOption(), - ColorScale: ColorScale.ToOption(), - ShowScale: ShowScale.ToOption(), - ReverseScale: ReverseScale.ToOption(), - ZSmooth: ZSmooth.ToOption(), - Transpose: Transpose.ToOption(), - UseWebGL: UseWebGL.ToOption(), - ReverseYAxis: ReverseYAxis.ToOption(), - UseDefaults: UseDefaults.ToOption() - ); - - /// - /// Creates a annotated heatmap. - /// - /// A heatmap is a data visualization technique that shows magnitude of a phenomenon as color in two dimensions. - /// - /// The annotated heatmap additionally contains annotation text on each datum. - /// - /// Sets the 2-dimensional z data, which will be visualized with the color scale. - /// Sets the text to display as annotation for each datum. - /// 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. - /// Sets the Opacity otf the trace. - /// Sets the x coordinates. - /// Sets the x coordinates. Use two inner arrays here to plot multicategorial data - /// Sets the horizontal gap (in pixels) between bricks. - /// Sets the y coordinates. - /// Sets the y coordinates. Use two inner arrays here to plot multicategorial data - /// Sets the vertical gap (in pixels) between bricks. - /// Sets a text associated with each datum - /// Sets individual text for each datum - /// Sets the styles of the colorbar for this trace. - /// Sets the colorscale for this trace. - /// Whether or not to show the colorscale/colorbar - /// Reverses the color mapping if true. If true, `zmin` will correspond to the last color in the array and `zmax` will correspond to the first color. - /// Picks a smoothing algorithm use to smooth `z` data. - /// Transposes the z data. - /// Whether or not to use WebGL to render this trace - /// Whether or not to reverse the y axis. If true, (0,0) will lie on the top left and increase downwards. - /// If set to false, ignore the global default settings set in `Defaults` - public static GenericChart AnnotatedHeatmap( - IEnumerable> zData, - IEnumerable> annotationText, - Optional Name = default, - Optional ShowLegend = default, - Optional Opacity = default, - Optional> X = default, - Optional>> MultiX = default, - Optional XGap = default, - Optional> Y = default, - Optional>> MultiY = default, - Optional YGap = default, - Optional Text = default, - Optional> MultiText = default, - Optional ColorBar = default, - Optional ColorScale = default, - Optional ShowScale = default, - Optional ReverseScale = default, - Optional ZSmooth = default, - Optional Transpose = default, - Optional UseWebGL = default, - Optional ReverseYAxis = default, - Optional UseDefaults = default - ) - where ZType : IConvertible - where XType : IConvertible - where YType : IConvertible - where TextType : IConvertible - => - Plotly.NET.Chart2D_Heatmap.Chart.AnnotatedHeatmap, ZType, IEnumerable, XType, YType, TextType>( - zData: zData, - annotationText: annotationText, - Name: Name.ToOption(), - ShowLegend: ShowLegend.ToOption(), - Opacity: Opacity.ToOption(), - X: X.ToOption(), - MultiX: MultiX.ToOption(), - XGap: XGap.ToOption(), - Y: Y.ToOption(), - MultiY: MultiY.ToOption(), - YGap: YGap.ToOption(), - Text: Text.ToOption(), - MultiText: MultiText.ToOption(), - ColorBar: ColorBar.ToOption(), - ColorScale: ColorScale.ToOption(), - ShowScale: ShowScale.ToOption(), - ReverseScale: ReverseScale.ToOption(), - ZSmooth: ZSmooth.ToOption(), - Transpose: Transpose.ToOption(), - UseWebGL: UseWebGL.ToOption(), - ReverseYAxis: ReverseYAxis.ToOption(), - UseDefaults: UseDefaults.ToOption() - ); - - /// - /// Display an image, i.e. data on a 2D regular raster. By default, when an image is displayed in a subplot, its y axis will be reversed (ie. `autorange: 'reversed'`), constrained to the domain (ie. `constrain: 'domain'`) and it will have the same scale as its x axis (ie. `scaleanchor: 'x,`) in order for pixels to be rendered as squares. - /// - /// A 2-dimensional array in which each element is an array of 3 or 4 numbers representing a color. - /// Specifies the data URI of the image to be visualized. The URI consists of "data:image/[<media subtype>][;base64],<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. - /// Sets the Opacity otf the trace. - /// Assigns id labels to each datum. These ids for object constancy of data points during animation. Should be an array of strings, not numbers or any other type. - /// Color model used to map the numerical color components described in `z` into colors. If `source` is specified, this attribute will be set to `rgba256` otherwise it defaults to `rgb`. - /// Sets the upper bound of the color domain. Value should have the same units as in `z` and if set, `zmin` must be set as well. - /// Sets the lower bound of the color domain. Value should have the same units as in `z` and if set, `zmax` must be set as well. - /// Picks a smoothing algorithm use to smooth `z` data. - /// If set to false, ignore the global default settings set in `Defaults` - public static GenericChart Image( - Optional>>> Z = default, - Optional Source = default, - Optional Name = default, - Optional ShowLegend = default, - Optional Opacity = default, - Optional> Ids = default, - Optional ColorModel = default, - Optional ZMax = default, - Optional ZMin = default, - Optional ZSmooth = default, - Optional UseDefaults = default - ) - where IdType : IConvertible - => - Plotly.NET.Chart2D_Heatmap.Chart.Image>, IEnumerable, IdType>( - Z: Z.ToOption(), - Source: Source.ToOption(), - Name: Name.ToOption(), - ShowLegend: ShowLegend.ToOption(), - Opacity: Opacity.ToOption(), - Ids: Ids.ToOption(), - ColorModel: ColorModel.ToOption(), - ZMax: ZMax.ToOption(), - ZMin: ZMin.ToOption(), - ZSmooth: ZSmooth.ToOption(), - UseDefaults: UseDefaults.ToOption() - ); - - /// - /// Creates a 2D contour plot, which shows the contour lines of a 2D numerical array z, i.e. interpolated lines of isovalues of z. - /// - /// A contour line (also isoline, isopleth, or isarithm) of a function of two variables is a curve along which the function has a constant value, so that the curve joins points of equal value - /// - /// The data from which contour lines are computed is set in `z`. Data in `z` must be a 2D array of numbers. Say that `z` has N rows and M columns, then by default, these N rows correspond to N y coordinates (set in `y` or auto-generated) and the M columns correspond to M x coordinates (set in `x` or auto-generated). By setting `transpose` to "true", the above behavior is flipped. - /// - /// Sets the z data which is used for computing the contour lines. - /// 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. - /// Sets the Opacity otf the trace. - /// Sets the x coordinates. - /// Sets the x coordinates. Use two inner arrays here to plot multicategorial data - /// Sets the y coordinates. - /// Sets the y coordinates. Use two inner arrays here to plot multicategorial data - /// Sets a text associated with each datum - /// Sets individual text for each datum - /// Sets the styles of the colorbar for this trace. - /// Sets the colorscale for this trace. - /// Whether or not to show the colorscale/colorbar - /// Reverses the color mapping if true. If true, `zmin` will correspond to the last color in the array and `zmax` will correspond to the first color. - /// Transposes the z data. - /// Sets the contour line dash style - /// Sets the contour line color - /// Sets the amount of smoothing for the contour lines, where "0" corresponds to no smoothing. - /// Sets the width of the contour lines - /// Sets the contour lines (use this for more finegrained control than the other contourline-associated arguments). - /// Wether or not to show the contour line - /// Determines the coloring method showing the contour values. If "fill", coloring is done evenly between each contour level If "heatmap", a heatmap gradient coloring is applied between each contour level. If "lines", coloring is done on the contour lines. If "none", no coloring is applied on this trace. - /// Sets the constraint operation. "=" keeps regions equal to `value` "<" and "<=" keep regions less than `value` ">" and ">=" keep regions greater than `value` "[]", "()", "[)", and "(]" keep regions inside `value[0]` to `value[1]` "][", ")(", "](", ")[" keep regions outside `value[0]` to value[1]` Open vs. closed intervals make no difference to constraint display, but all versions are allowed for consistency with filter transforms. - /// If `levels`, the data is represented as a contour plot with multiple levels displayed. If `constraint`, the data is represented as constraints with the invalid region shaded as specified by the `operation` and `value` parameters. - /// Determines whether to label the contour lines with their values. - /// Sets the font used for labeling the contour levels. The default color comes from the lines, if shown. The default family and size come from `layout.font`. - /// Sets the starting contour level value. Must be less than `contours.end` - /// Sets the end contour level value. Must be more than `contours.start` - /// Sets the styles of the contours (use this for more finegrained control than the other contour-associated arguments). - /// Sets the fill color if `contours.type` is "constraint". Defaults to a half-transparent variant of the line color, marker color, or marker line color, whichever is available. - /// Sets the maximum number of contour levels. The actual number of contours will be chosen automatically to be less than or equal to the value of `ncontours`. Has an effect only if `autocontour` is "true" or if `contours.size` is missing. - /// If set to false, ignore the global default settings set in `Defaults` - public static GenericChart Contour( - IEnumerable> zData, - Optional Name = default, - Optional ShowLegend = default, - Optional Opacity = default, - Optional> X = default, - Optional>> MultiX = default, - Optional> Y = default, - Optional>> MultiY = default, - Optional Text = default, - Optional> MultiText = default, - Optional ColorBar = default, - Optional ColorScale = default, - Optional ShowScale = default, - Optional ReverseScale = default, - Optional Transpose = default, - Optional ContourLinesDash = default, - Optional ContourLinesColor = default, - Optional ContourLinesSmoothing = default, - Optional ContourLinesWidth = default, - Optional ContourLines = default, - Optional ShowContourLines = default, - Optional ContoursColoring = default, - Optional ContoursOperation = default, - Optional ContoursType = default, - Optional ShowContoursLabels = default, - Optional ContourLabelFont = default, - Optional ContoursStart = default, - Optional ContoursEnd = default, - Optional Contours = default, - Optional FillColor = default, - Optional NContours = default, - Optional UseDefaults = default - ) - where ZType : IConvertible - where XType : IConvertible - where YType : IConvertible - where TextType : IConvertible - => - Plotly.NET.Chart2D_Heatmap.Chart.Contour, ZType, XType, YType, TextType>( - zData: zData, - Name: Name.ToOption(), - ShowLegend: ShowLegend.ToOption(), - Opacity: Opacity.ToOption(), - X: X.ToOption(), - MultiX: MultiX.ToOption(), - Y: Y.ToOption(), - MultiY: MultiY.ToOption(), - Text: Text.ToOption(), - MultiText: MultiText.ToOption(), - ColorBar: ColorBar.ToOption(), - ColorScale: ColorScale.ToOption(), - ShowScale: ShowScale.ToOption(), - ReverseScale: ReverseScale.ToOption(), - Transpose: Transpose.ToOption(), - ContourLinesDash: ContourLinesDash.ToOption(), - ContourLinesColor: ContourLinesColor.ToOption(), - ContourLinesSmoothing: ContourLinesSmoothing.ToOption(), - ContourLinesWidth: ContourLinesWidth.ToOption(), - ContourLines: ContourLines.ToOption(), - ShowContourLines: ShowContourLines.ToOption(), - ContoursColoring: ContoursColoring.ToOption(), - ContoursOperation: ContoursOperation.ToOption(), - ContoursType: ContoursType.ToOption(), - ShowContoursLabels: ShowContoursLabels.ToOption(), - ContoursLabelFont: ContourLabelFont.ToOption(), - ContoursStart: ContoursStart.ToOption(), - ContoursEnd: ContoursEnd.ToOption(), - Contours: Contours.ToOption(), - FillColor: FillColor.ToOption(), - NContours: NContours.ToOption(), - UseDefaults: UseDefaults.ToOption() - ); - - - /// - /// Creates an OHLC chart. - /// - /// The ohlc (short for Open-High-Low-Close) is a style of financial chart describing open, high, low and close for a given `x` coordinate (most likely time). The tip of the lines represent the `low` and `high` values and the horizontal segments represent the `open` and `close` values. Sample points where the close value is higher (lower) then the open value are called increasing (decreasing). By default, increasing items are drawn in green whereas decreasing are drawn in red. - /// - /// Sets the open values. - /// Sets the high values. - /// Sets the low values. - /// Sets the close values. - /// Sets the x coordinates. If absent, linear coordinate will be generated. - /// Sets the x coordinates. If absent, linear coordinate will be generated. Use two inner arrays here to plot multicategorial 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. - /// Sets the Opacity otf the trace. - /// Sets a text associated with each datum - /// Sets individual text for each datum - /// Sets the line of this trace. - /// Sets the color of increasing values - /// Sets the style options of increasing values (use this for more finegrained control than the other increasing-associated arguments). - /// Sets the color of decreasing values - /// Sets the style options of decreasing values (use this for more finegrained control than the other increasing-associated arguments). - /// Sets the width of the open/close tick marks relative to the "x" minimal interval. - /// Whether or not to show a rangeslider for the xaxis - /// If set to false, ignore the global default settings set in `Defaults` - public static GenericChart OHLC( - IEnumerable open, - IEnumerable high, - IEnumerable low, - IEnumerable close, - Optional> X, - Optional>> MultiX, - Optional Name = default, - Optional ShowLegend = default, - Optional Opacity = default, - Optional Text = default, - Optional> MultiText = default, - Optional Line = default, - Optional IncreasingColor = default, - Optional Increasing = default, - Optional DecreasingColor = default, - Optional Decreasing = default, - Optional TickWidth = default, - Optional ShowXAxisRangeSlider = default, - Optional UseDefaults = default - ) - where OHLCType : IConvertible - where XType : IConvertible - where TextType : IConvertible - => - Plotly.NET.Chart2D_Finance.Chart.OHLC( - open: open, - high: high, - low: low, - close: close, - X: X.ToOption(), - MultiX: MultiX.ToOption(), - Name: Name.ToOption(), - ShowLegend: ShowLegend.ToOption(), - Opacity: Opacity.ToOption(), - Text: Text.ToOption(), - MultiText: MultiText.ToOption(), - Line: Line.ToOption(), - IncreasingColor: IncreasingColor.ToOption(), - Increasing: Increasing.ToOption(), - DecreasingColor: DecreasingColor.ToOption(), - Decreasing: Decreasing.ToOption(), - TickWidth: TickWidth.ToOption(), - ShowXAxisRangeSlider: ShowXAxisRangeSlider.ToOption(), - UseDefaults: UseDefaults.ToOption() - ); - - /// - /// Creates a candlestick chart. - /// - /// The candlestick is a style of financial chart describing open, high, low and close for a given `x` coordinate (most likely time). The boxes represent the spread between the `open` and `close` values and the lines represent the spread between the `low` and `high` values Sample points where the close value is higher (lower) then the open value are called increasing (decreasing). By default, increasing candles are drawn in green whereas decreasing are drawn in red. - /// - /// Sets the open values. - /// Sets the high values. - /// Sets the low values. - /// Sets the close values. - /// Sets the x coordinates. If absent, linear coordinate will be generated. - /// Sets the x coordinates. If absent, linear coordinate will be generated. Use two inner arrays here to plot multicategorial 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. - /// Sets the Opacity otf the trace. - /// Sets a text associated with each datum - /// Sets individual text for each datum - /// Sets the line of this trace. - /// Sets the color of increasing values - /// Sets the style options of increasing values (use this for more finegrained control than the other increasing-associated arguments). - /// Sets the color of decreasing values - /// Sets the style options of decreasing values (use this for more finegrained control than the other increasing-associated arguments). - /// Sets the width of the whiskers relative to the box' width. For example, with 1, the whiskers are as wide as the box(es). - /// Whether or not to show a rangeslider for the xaxis - /// If set to false, ignore the global default settings set in `Defaults` - public static GenericChart Candlestick( - IEnumerable open, - IEnumerable high, - IEnumerable low, - IEnumerable close, - Optional> X, - Optional>> MultiX, - Optional Name = default, - Optional ShowLegend = default, - Optional Opacity = default, - Optional Text = default, - Optional> MultiText = default, - Optional Line = default, - Optional IncreasingColor = default, - Optional Increasing = default, - Optional DecreasingColor = default, - Optional Decreasing = default, - Optional WhiskerWidth = default, - Optional ShowXAxisRangeSlider = default, - Optional UseDefaults = default - ) - where OHLCType : IConvertible - where XType : IConvertible - where TextType : IConvertible - => - Plotly.NET.Chart2D_Finance.Chart.Candlestick( - open: open, - high: high, - low: low, - close: close, - X: X.ToOption(), - MultiX: MultiX.ToOption(), - Name: Name.ToOption(), - ShowLegend: ShowLegend.ToOption(), - Opacity: Opacity.ToOption(), - Text: Text.ToOption(), - MultiText: MultiText.ToOption(), - Line: Line.ToOption(), - IncreasingColor: IncreasingColor.ToOption(), - Increasing: Increasing.ToOption(), - DecreasingColor: DecreasingColor.ToOption(), - Decreasing: Decreasing.ToOption(), - WhiskerWidth: WhiskerWidth.ToOption(), - ShowXAxisRangeSlider: ShowXAxisRangeSlider.ToOption(), - UseDefaults: UseDefaults.ToOption() - ); - - /// - /// Creates a scatter plot matrix (SPLOM) from multiple input dimensions. - /// - /// Each splom `dimensions` items correspond to a generated axis. Values for each of those dimensions are set in `dimensions[i].values`. Splom traces support all `scattergl` marker style attributes. Specify `layout.grid` attributes and/or layout x-axis and y-axis attributes for more control over the axis positioning and style. - /// - /// Sets the dimensions of the scatter plot matrix, where each item corresponds to a generated axis. - /// 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. - /// Sets the Opacity otf the trace. - /// Sets a text associated with each datum - /// Sets individual text for each datum - /// Sets the color of the marker. - /// Sets the colorscale of the marker. Use `Color.fromColorScaleValues` to map marker colors to a colorscale. - /// Sets the outline of the marker - /// Sets the symbol of all marker - /// Sets the symbol of each individual marker - /// Sets the markers (use this for more finegrained control than the other marker-associated arguments). - /// Whether or not to show the matrix diagional - /// Sets the styles applied to the scatter plot matrix diagonal - /// Determines whether or not subplots on the lower half from the diagonal are displayed. - /// Determines whether or not subplots on the upper half from the diagonal are displayed. - /// If set to false, ignore the global default settings set in `Defaults` - public static GenericChart Splom( - IEnumerable dimensions, - Optional Name = default, - Optional ShowLegend = default, - Optional Opacity = default, - Optional Text = default, - Optional> MultiText = default, - Optional MarkerColor = default, - Optional MarkerColorScale = default, - Optional MarkerOutline = default, - Optional MarkerSymbol = default, - Optional> MultiMarkerSymbol = default, - Optional Marker = default, - Optional ShowDiagonal = default, - Optional Diagonal = default, - Optional ShowLowerHalf = default, - Optional ShowUpperHalf = default, - Optional UseDefaults = default - ) - where TextType : IConvertible - => - Plotly.NET.Chart2D_Splom.Chart.Splom( - dimensions: dimensions, - Name: Name.ToOption(), - ShowLegend: ShowLegend.ToOption(), - Opacity: Opacity.ToOption(), - Text: Text.ToOption(), - MultiText: MultiText.ToOption(), - MarkerColor: MarkerColor.ToOption(), - MarkerColorScale: MarkerColorScale.ToOption(), - MarkerOutline: MarkerOutline.ToOption(), - MarkerSymbol: MarkerSymbol.ToOption(), - MultiMarkerSymbol: MultiMarkerSymbol.ToOption(), - Marker: Marker.ToOption(), - ShowDiagonal: ShowDiagonal.ToOption(), - Diagonal: Diagonal.ToOption(), - ShowLowerHalf: ShowLowerHalf.ToOption(), - ShowUpperHalf: ShowUpperHalf.ToOption(), - UseDefaults: UseDefaults.ToOption() - ); - - /// - /// Creates a point density plot - a combination of a Scatter plot and Histogram2DContour. - /// - /// Additionally to plotting the (x,y) data as points on a 2D plane, a density contour plot is computed by grouping a set of points specified by their x and y coordinates into bins, and applying a count aggregation function to compute the value to be used to compute contours. - /// The sample data from which statistics are computed is set in `x` and `y` (where `x` and `y` represent marginal distributions, binning is set in `xbins` and `ybins` in this case). The resulting distribution is visualized as a contour plot. - /// - /// - /// Sets the x coordinates of the plotted data as well as the sample data to be binned on the x axis. - /// Sets the y coordinates of the plotted data as well as the sample data to be binned on the y axis. - /// Sets the opacity of the point trace. - /// Sets the marker color of the point trace. - /// Sets the marker symbol of the point trace. - /// Sets the marker size of the point trace. - /// Sets the contour line dash style - /// Sets the contour line color - /// Sets the amount of smoothing for the contour lines, where "0" corresponds to no smoothing. - /// Sets the width of the contour lines - /// Sets the contour lines (use this for more finegrained control than the other contourline-associated arguments). - /// Wether or not to show the contour line - /// Determines the coloring method showing the contour values. If "fill", coloring is done evenly between each contour level If "heatmap", a heatmap gradient coloring is applied between each contour level. If "lines", coloring is done on the contour lines. If "none", no coloring is applied on this trace. - /// Sets the constraint operation. "=" keeps regions equal to `value` "<" and "<=" keep regions less than `value` ">" and ">=" keep regions greater than `value` "[]", "()", "[)", and "(]" keep regions inside `value[0]` to `value[1]` "][", ")(", "](", ")[" keep regions outside `value[0]` to value[1]` Open vs. closed intervals make no difference to constraint display, but all versions are allowed for consistency with filter transforms. - /// If `levels`, the data is represented as a contour plot with multiple levels displayed. If `constraint`, the data is represented as constraints with the invalid region shaded as specified by the `operation` and `value` parameters. - /// Determines whether to label the contour lines with their values. - /// Sets the font used for labeling the contour levels. The default color comes from the lines, if shown. The default family and size come from `layout.font`. - /// Sets the starting contour level value. Must be less than `contours.end` - /// Sets the end contour level value. Must be more than `contours.start` - /// Sets the styles of the contours (use this for more finegrained control than the other contour-associated arguments). - /// Sets the maximum number of contour levels. The actual number of contours will be chosen automatically to be less than or equal to the value of `ncontours`. Has an effect only if `autocontour` is "true" or if `contours.size` is missing. - /// Specifies the type of normalization used for this histogram trace. If "", the span of each bar corresponds to the number of occurrences (i.e. the number of data points lying inside the bins). If "percent" / "probability", the span of each bar corresponds to the percentage / fraction of occurrences with respect to the total number of sample points (here, the sum of all bin HEIGHTS equals 100% / 1). If "density", the span of each bar corresponds to the number of occurrences in a bin divided by the size of the bin interval (here, the sum of all bin AREAS equals the total number of sample points). If "probability density", the area of each bar corresponds to the probability that an event will fall into the corresponding bin (here, the sum of all bin AREAS equals 1). - /// Sets the opacity of the histogram2dcontour trace. - /// Sets the color bar. - /// Sets the colorscale of the histogram2dcontour trace. - /// whether or not to show the colorbar - /// If set to false, ignore the global default settings set in `Defaults` - public static GenericChart PointDensity( - IEnumerable x, - IEnumerable y, - Optional PointOpacity = default, - Optional PointMarkerColor = default, - Optional PointMarkerSymbol = default, - Optional PointMarkerSize = default, - Optional ContourLinesDash = default, - Optional ContourLinesColor = default, - Optional ContourLinesSmoothing = default, - Optional ContourLinesWidth = default, - Optional ContourLines = default, - Optional ShowContourLines = default, - Optional ContoursColoring = default, - Optional ContoursOperation = default, - Optional ContoursType = default, - Optional ShowContoursLabels = default, - Optional ContourLabelFont = default, - Optional ContoursStart = default, - Optional ContoursEnd = default, - Optional Contours = default, - Optional NContours = default, - Optional HistNorm = default, - Optional ContourOpacity = default, - Optional ColorBar = default, - Optional ColorScale = default, - Optional ShowScale = default, - Optional UseDefaults = default - ) - where XType : IConvertible - where YType : IConvertible - => - Plotly.NET.Chart2D_Splom.Chart.PointDensity( - x: x, - y: y, - PointOpacity: PointOpacity.ToOption(), - PointMarkerColor: PointMarkerColor.ToOption(), - PointMarkerSymbol: PointMarkerSymbol.ToOption(), - PointMarkerSize: PointMarkerSize.ToOption(), - ContourLinesDash: ContourLinesDash.ToOption(), - ContourLinesColor: ContourLinesColor.ToOption(), - ContourLinesSmoothing: ContourLinesSmoothing.ToOption(), - ContourLinesWidth: ContourLinesWidth.ToOption(), - ContourLines: ContourLines.ToOption(), - ShowContourLines: ShowContourLines.ToOption(), - ContoursColoring: ContoursColoring.ToOption(), - ContoursOperation: ContoursOperation.ToOption(), - ContoursType: ContoursType.ToOption(), - ShowContoursLabels: ShowContoursLabels.ToOption(), - ContoursLabelFont: ContourLabelFont.ToOption(), - ContoursStart: ContoursStart.ToOption(), - ContoursEnd: ContoursEnd.ToOption(), - Contours: Contours.ToOption(), - NContours: NContours.ToOption(), - HistNorm: HistNorm.ToOption(), - ContourOpacity: ContourOpacity.ToOption(), - ColorBar: ColorBar.ToOption(), - ColorScale: ColorScale.ToOption(), - ShowScale: ShowScale.ToOption(), - UseDefaults: UseDefaults.ToOption() - ); - - }; - -} diff --git a/src/Plotly.NET.CSharp/ChartAPI/Chart2D/AnnotatedHeatmap.cs b/src/Plotly.NET.CSharp/ChartAPI/Chart2D/AnnotatedHeatmap.cs new file mode 100644 index 00000000..0397e21f --- /dev/null +++ b/src/Plotly.NET.CSharp/ChartAPI/Chart2D/AnnotatedHeatmap.cs @@ -0,0 +1,94 @@ +using System; +using System.Collections.Generic; +using Plotly.NET; +using Plotly.NET.LayoutObjects; +using Plotly.NET.TraceObjects; +using static Plotly.NET.StyleParam; + +namespace Plotly.NET.CSharp; + +public static partial class Chart +{ + /// + /// Creates a annotated heatmap. + /// + /// A heatmap is a data visualization technique that shows magnitude of a phenomenon as color in two dimensions. + /// + /// The annotated heatmap additionally contains annotation text on each datum. + /// + /// Sets the 2-dimensional z data, which will be visualized with the color scale. + /// Sets the text to display as annotation for each datum. + /// 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. + /// Sets the Opacity otf the trace. + /// Sets the x coordinates. + /// Sets the x coordinates. Use two inner arrays here to plot multicategorial data + /// Sets the horizontal gap (in pixels) between bricks. + /// Sets the y coordinates. + /// Sets the y coordinates. Use two inner arrays here to plot multicategorial data + /// Sets the vertical gap (in pixels) between bricks. + /// Sets a text associated with each datum + /// Sets individual text for each datum + /// Sets the styles of the colorbar for this trace. + /// Sets the colorscale for this trace. + /// Whether or not to show the colorscale/colorbar + /// Reverses the color mapping if true. If true, `zmin` will correspond to the last color in the array and `zmax` will correspond to the first color. + /// Picks a smoothing algorithm use to smooth `z` data. + /// Transposes the z data. + /// Whether or not to use WebGL to render this trace + /// Whether or not to reverse the y axis. If true, (0,0) will lie on the top left and increase downwards. + /// If set to false, ignore the global default settings set in `Defaults` + public static GenericChart AnnotatedHeatmap( + IEnumerable> zData, + IEnumerable> annotationText, + Optional Name = default, + Optional ShowLegend = default, + Optional Opacity = default, + Optional> X = default, + Optional>> MultiX = default, + Optional XGap = default, + Optional> Y = default, + Optional>> MultiY = default, + Optional YGap = default, + Optional Text = default, + Optional> MultiText = default, + Optional ColorBar = default, + Optional ColorScale = default, + Optional ShowScale = default, + Optional ReverseScale = default, + Optional ZSmooth = default, + Optional Transpose = default, + Optional UseWebGL = default, + Optional ReverseYAxis = default, + Optional UseDefaults = default + ) + where ZType : IConvertible + where XType : IConvertible + where YType : IConvertible + where TextType : IConvertible + => + Plotly.NET.Chart2D_Heatmap.Chart.AnnotatedHeatmap, ZType, IEnumerable, XType, YType, TextType>( + zData: zData, + annotationText: annotationText, + Name: Name.ToOption(), + ShowLegend: ShowLegend.ToOption(), + Opacity: Opacity.ToOption(), + X: X.ToOption(), + MultiX: MultiX.ToOption(), + XGap: XGap.ToOption(), + Y: Y.ToOption(), + MultiY: MultiY.ToOption(), + YGap: YGap.ToOption(), + Text: Text.ToOption(), + MultiText: MultiText.ToOption(), + ColorBar: ColorBar.ToOption(), + ColorScale: ColorScale.ToOption(), + ShowScale: ShowScale.ToOption(), + ReverseScale: ReverseScale.ToOption(), + ZSmooth: ZSmooth.ToOption(), + Transpose: Transpose.ToOption(), + UseWebGL: UseWebGL.ToOption(), + ReverseYAxis: ReverseYAxis.ToOption(), + UseDefaults: UseDefaults.ToOption() + ); +} diff --git a/src/Plotly.NET.CSharp/ChartAPI/Chart2D/Area.cs b/src/Plotly.NET.CSharp/ChartAPI/Chart2D/Area.cs new file mode 100644 index 00000000..7302b20d --- /dev/null +++ b/src/Plotly.NET.CSharp/ChartAPI/Chart2D/Area.cs @@ -0,0 +1,117 @@ +using System; +using System.Collections.Generic; +using Plotly.NET; +using Plotly.NET.LayoutObjects; +using Plotly.NET.TraceObjects; +using static Plotly.NET.StyleParam; + +namespace Plotly.NET.CSharp; + +public static partial class Chart +{ + /// Creates an Area chart, which uses a Line plotted between the given datums in a 2D space, additionally colouring the area between the line and the Y Axis. + /// Sets the x coordinates of the plotted data. + /// Sets the y coordinates of the plotted data. + /// Whether to show markers for the individual data points + /// 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. + /// Sets the opactity of the trace + /// Sets the opactity of individual datum markers + /// Sets a text associated with each datum + /// Sets individual text for each datum + /// Sets the position of text associated with each datum + /// Sets the position of text associated with individual datum + /// Sets the color of the marker + /// Sets the colorscale of the marker + /// Sets the outline of the marker + /// Sets the marker symbol for each datum + /// Sets the marker symbol for each individual datum + /// Sets the marker (use this for more finegrained control than the other marker-associated arguments) + /// Sets the color of the line + /// Sets the colorscale of the line + /// Sets the width of the line + /// sets the drawing style of the line + /// Sets the line (use this for more finegrained control than the other line-associated arguments) + /// Set several traces linked to the same position axis or matching axes to the same alignmentgroup. This controls whether bars compute their positional range dependently or independently. + /// Set several traces linked to the same position axis or matching axes to the same offsetgroup where bars of the same position coordinate will line up. + /// Set several traces (on the same subplot) to the same stackgroup in order to add their y values (or their x values if `Orientation` is Horizontal). Stacking also turns `fill` on by default and sets the default `mode` to "lines" irrespective of point count. ou can only stack on a numeric (linear or log) axis. Traces in a `stackgroup` will only fill to (or be filled to) other traces in the same group. With multiple `stackgroup`s or some traces stacked and some not, if fill-linked traces are not already consecutive, the later ones will be pushed down in the drawing order + /// Sets the stacking direction. Only relevant when `stackgroup` is used, and only the first `orientation` found in the `stackgroup` will be used. + /// Sets the normalization for the sum of this `stackgroup. Only relevant when `stackgroup` is used, and only the first `groupnorm` found in the `stackgroup` will be used + /// Sets the fill color. Defaults to a half-transparent variant of the line color, marker color, or marker line color, whichever is available. + /// Sets a pattern shape for the area fill + /// Sets the pattern within the area. (use this for more finegrained control than the other fillpattern-associated arguments). + /// If true, plotly.js will use the WebGL engine to render this chart. use this when you want to render many objects at once. + /// If set to false, ignore the global default settings set in `Defaults` + public static GenericChart Area( + IEnumerable x, + IEnumerable y, + Optional ShowMarkers = default, + Optional Name = default, + Optional ShowLegend = default, + Optional Opacity = default, + Optional> MultiOpacity = default, + Optional Text = default, + Optional> MultiText = default, + Optional TextPosition = default, + Optional> MultiTextPosition = default, + Optional MarkerColor = default, + Optional MarkerColorScale = default, + Optional MarkerOutline = default, + Optional MarkerSymbol = default, + Optional> MultiMarkerSymbol = default, + Optional Marker = default, + Optional LineColor = default, + Optional LineColorScale = default, + Optional LineWidth = default, + Optional LineDash = default, + Optional Line = default, + Optional AlignmentGroup = default, + Optional OffsetGroup = default, + Optional StackGroup = default, + Optional Orientation = default, + Optional GroupNorm = default, + Optional FillColor = default, + Optional FillPatternShape = default, + Optional FillPattern = default, + Optional UseWebGL = default, + Optional UseDefaults = default + ) + where XType : IConvertible + where YType : IConvertible + where TextType : IConvertible + => + Plotly.NET.Chart2D_Area.Chart.Area( + x: x, + y: y, + ShowMarkers: ShowMarkers.ToOption(), + Name: Name.ToOption(), + ShowLegend: ShowLegend.ToOption(), + Opacity: Opacity.ToOption(), + MultiOpacity: MultiOpacity.ToOption(), + Text: Text.ToOption(), + MultiText: MultiText.ToOption(), + TextPosition: TextPosition.ToOption(), + MultiTextPosition: MultiTextPosition.ToOption(), + MarkerColor: MarkerColor.ToOption(), + MarkerColorScale: MarkerColorScale.ToOption(), + MarkerOutline: MarkerOutline.ToOption(), + MarkerSymbol: MarkerSymbol.ToOption(), + MultiMarkerSymbol: MultiMarkerSymbol.ToOption(), + Marker: Marker.ToOption(), + LineColor: LineColor.ToOption(), + LineColorScale: LineColorScale.ToOption(), + LineWidth: LineWidth.ToOption(), + LineDash: LineDash.ToOption(), + Line: Line.ToOption(), + AlignmentGroup: AlignmentGroup.ToOption(), + OffsetGroup: OffsetGroup.ToOption(), + StackGroup: StackGroup.ToOption(), + Orientation: Orientation.ToOption(), + GroupNorm: GroupNorm.ToOption(), + FillColor: FillColor.ToOption(), + FillPatternShape: FillPatternShape.ToOption(), + FillPattern: FillPattern.ToOption(), + UseWebGL: UseWebGL.ToOption(), + UseDefaults: UseDefaults.ToOption() + ); +} diff --git a/src/Plotly.NET.CSharp/ChartAPI/Chart2D/Bar.cs b/src/Plotly.NET.CSharp/ChartAPI/Chart2D/Bar.cs new file mode 100644 index 00000000..6df927de --- /dev/null +++ b/src/Plotly.NET.CSharp/ChartAPI/Chart2D/Bar.cs @@ -0,0 +1,91 @@ +using System; +using System.Collections.Generic; +using Plotly.NET; +using Plotly.NET.LayoutObjects; +using Plotly.NET.TraceObjects; +using static Plotly.NET.StyleParam; + +namespace Plotly.NET.CSharp; + +public static partial class Chart +{ + /// + /// Creates a bar chart, with bars plotted horizontally + /// + /// A bar chart is a chart that presents categorical data with rectangular bars with heights or lengths proportional to the values that they represent. + /// + /// Sets the values that are plotted as the size of each bar. + /// Sets the keys associated with each bar. + /// Sets the keys associated with each bar. Use two inner arrays here to plot multicategorial 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. + /// Sets the Opacity of the trace. + /// Sets the Opacity of each individual bar. + /// Sets a text associated with each datum + /// Sets individual text for each datum + /// Sets the color of the bars + /// Sets the colorscale for the bars. To have an effect, `MarkerColor` must map to color scale values. + /// Sets the color of the bar outlines + /// Sets a pattern shape for all bars + /// Sets an individual pattern shape for each bar + /// Sets the marker pattern (use this for more finegrained control than the other pattern-associated arguments). + /// Sets the marker for the bars (use this for more finegrained control than the other marker-associated arguments). + /// Sets where the bar base is drawn (in position axis units). + /// Sets the bar width (in position axis units) of all bars. + /// Sets the individual bar width (in position axis units) for each bar. + /// Sets the position of text associated with each datum + /// Sets the position of text associated with individual datum + /// If set to false, ignore the global default settings set in `Defaults` + public static GenericChart Bar( + IEnumerable values, + Optional> Keys = default, + Optional>> MultiKeys = default, + Optional Name = default, + Optional ShowLegend = default, + Optional Opacity = default, + Optional> MultiOpacity = default, + Optional Text = default, + Optional> MultiText = default, + Optional MarkerColor = default, + Optional MarkerColorScale = default, + Optional MarkerOutline = default, + Optional MarkerPatternShape = default, + Optional> MultiMarkerPatternShape = default, + Optional MarkerPattern = default, + Optional Marker = default, + Optional TextPosition = default, + Optional> MultiTextPosition = default, + Optional> MultiWidth = default, + Optional UseDefaults = default, + Optional Base = default, + Optional Width = default + ) + where ValuesType : IConvertible + where KeysType : IConvertible + where TextType: IConvertible + => + Plotly.NET.Chart2D_Bar.Chart.Bar( + values: values, + Keys: Keys.ToOption(), + MultiKeys: MultiKeys.ToOption(), + Name: Name.ToOption(), + ShowLegend: ShowLegend.ToOption(), + Opacity: Opacity.ToOption(), + MultiOpacity: MultiOpacity.ToOption(), + Text: Text.ToOption(), + MultiText: MultiText.ToOption(), + MarkerColor: MarkerColor.ToOption(), + MarkerColorScale: MarkerColorScale.ToOption(), + MarkerOutline: MarkerOutline.ToOption(), + MarkerPatternShape: MarkerPatternShape.ToOption(), + MultiMarkerPatternShape: MultiMarkerPatternShape.ToOption(), + MarkerPattern: MarkerPattern.ToOption(), + Marker: Marker.ToOption(), + Base: Base.ToOption(), + Width: Width.ToOption(), + MultiWidth: MultiWidth.ToOption(), + TextPosition: TextPosition.ToOption(), + MultiTextPosition: MultiTextPosition.ToOption(), + UseDefaults: UseDefaults.ToOption() + ); +} diff --git a/src/Plotly.NET.CSharp/ChartAPI/Chart2D/BoxPlot.cs b/src/Plotly.NET.CSharp/ChartAPI/Chart2D/BoxPlot.cs new file mode 100644 index 00000000..f16ff6aa --- /dev/null +++ b/src/Plotly.NET.CSharp/ChartAPI/Chart2D/BoxPlot.cs @@ -0,0 +1,111 @@ +using System; +using System.Collections.Generic; +using Plotly.NET; +using Plotly.NET.LayoutObjects; +using Plotly.NET.TraceObjects; +using static Plotly.NET.StyleParam; + +namespace Plotly.NET.CSharp; + +public static partial class Chart +{ + /// + /// Visualizes the distribution of the input data as a box plot. + /// + /// A box plot is a method for graphically demonstrating the locality, spread and skewness groups of numerical data through their quartiles. + /// The default style is based on the five number summary: minimum, first quartile, median, third quartile, and maximum. + /// + /// The sample data from which statistics are computed is set in `x` for vertically spanning boxes and in `y` for horizontally spanning boxes. + /// + /// Sets the x sample data or coordinates + /// Sets the x sample data or coordinates. Use two inner arrays here to plot multicategorial data + /// Sets the y sample data or coordinates + /// Sets the y sample data or coordinates. Use two inner arrays here to plot multicategorial 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. + /// Sets a text associated with each datum + /// Sets individual text for each datum + /// Sets the fill color. Defaults to a half-transparent variant of the line color, marker color, or marker line color, whichever is available. + /// Sets the marker color. + /// Sets the marker for the box (use this for more finegrained control than the other marker-associated arguments).// Sets the opacity of this trace. + /// Sets the width of the whiskers relative to the box' width. For example, with 1, the whiskers are as wide as the box(es). + /// If "outliers", only the sample points lying outside the whiskers are shown If "suspectedoutliers", the outlier points are shown and points either less than 4"Q1-3"Q3 or greater than 4"Q3-3"Q1 are highlighted (see `outliercolor`) If "all", all sample points are shown If "false", only the box(es) are shown with no sample points Defaults to "suspectedoutliers" when `marker.outliercolor` or `marker.line.outliercolor` is set. Defaults to "all" under the q1/median/q3 signature. Otherwise defaults to "outliers". + /// If "true", the mean of the box(es)' underlying distribution is drawn as a dashed line inside the box(es). If "sd" the standard deviation is also drawn. Defaults to "true" when `mean` is set. Defaults to "sd" when `sd` is set Otherwise defaults to "false". + /// Sets the amount of jitter in the sample points drawn. If "0", the sample points align along the distribution axis. If "1", the sample points are drawn in a random jitter of width equal to the width of the box(es). + /// Sets the position of the sample points in relation to the box(es). If "0", the sample points are places over the center of the box(es). Positive (negative) values correspond to positions to the right (left) for vertical boxes and above (below) for horizontal boxes + /// Sets the orientation of the box(es). If "v" ("h"), the distribution is visualized along the vertical (horizontal). + /// Sets the color of the box outline + /// Sets the width of the box outline + /// Sets the box outline (use this for more finegrained control than the other outline-associated arguments). + /// Set several traces linked to the same position axis or matching axes to the same alignmentgroup. This controls whether bars compute their positional range dependently or independently. + /// Set several traces linked to the same position axis or matching axes to the same offsetgroup where bars of the same position coordinate will line up. + /// Determines whether or not notches are drawn. Notches displays a confidence interval around the median. We compute the confidence interval as median +/- 1.57 " IQR / sqrt(N), where IQR is the interquartile range and N is the sample size. If two boxes' notches do not overlap there is 95% confidence their medians differ. See https://sites.google.com/site/davidsstatistics/home/notched-box-plots for more info. Defaults to "false" unless `notchwidth` or `notchspan` is set. + /// Sets the width of the notches relative to the box' width. For example, with 0, the notches are as wide as the box(es). + /// Sets the method used to compute the sample's Q1 and Q3 quartiles. The "linear" method uses the 25th percentile for Q1 and 75th percentile for Q3 as computed using method #10 (listed on http://www.amstat.org/publications/jse/v14n3/langford.html). The "exclusive" method uses the median to divide the ordered dataset into two halves if the sample is odd, it does not include the median in either half - Q1 is then the median of the lower half and Q3 the median of the upper half. The "inclusive" method also uses the median to divide the ordered dataset into two halves but if the sample is odd, it includes the median in both halves - Q1 is then the median of the lower half and Q3 the median of the upper half. + /// Sets the upper and lower bound for the boxes quartiles means box is drawn between Q1 and Q3 SD means the box is drawn between Mean +- Standard Deviation Argument sdmultiple (default 1) to scale the box size So it could be drawn 1-stddev, 3-stddev etc + /// If set to false, ignore the global default settings set in `Defaults` + public static GenericChart BoxPlot( + Optional> X = default, + Optional>> MultiX = default, + Optional> Y = default, + Optional>> MultiY = default, + Optional Name = default, + Optional ShowLegend = default, + Optional Text = default, + Optional> MultiText = default, + Optional FillColor = default, + Optional MarkerColor = default, + Optional Marker = default, + Optional Opacity = default, + Optional WhiskerWidth = default, + Optional BoxPoints = default, + Optional BoxMean = default, + Optional Jitter = default, + Optional PointPos = default, + Optional Orientation = default, + Optional OutlineColor = default, + Optional OutlineWidth = default, + Optional Outline = default, + Optional AlignmentGroup = default, + Optional OffsetGroup = default, + Optional Notched = default, + Optional NotchWidth = default, + Optional QuartileMethod = default, + Optional SizeMode = default, + Optional UseDefaults = default + ) + where XType : IConvertible + where YType : IConvertible + where TextType : IConvertible + => + Plotly.NET.Chart2D_Distribution.Chart.BoxPlot( + X: X.ToOption(), + MultiX: MultiX.ToOption(), + Y: Y.ToOption(), + MultiY: MultiY.ToOption(), + Name: Name.ToOption(), + ShowLegend: ShowLegend.ToOption(), + Text: Text.ToOption(), + MultiText: MultiText.ToOption(), + FillColor: FillColor.ToOption(), + MarkerColor: MarkerColor.ToOption(), + Marker: Marker.ToOption(), + Opacity: Opacity.ToOption(), + WhiskerWidth: WhiskerWidth.ToOption(), + BoxPoints: BoxPoints.ToOption(), + BoxMean: BoxMean.ToOption(), + Jitter: Jitter.ToOption(), + PointPos: PointPos.ToOption(), + Orientation: Orientation.ToOption(), + OutlineColor: OutlineColor.ToOption(), + OutlineWidth: OutlineWidth.ToOption(), + Outline: Outline.ToOption(), + AlignmentGroup: AlignmentGroup.ToOption(), + OffsetGroup: OffsetGroup.ToOption(), + Notched: Notched.ToOption(), + NotchWidth: NotchWidth.ToOption(), + QuartileMethod: QuartileMethod.ToOption(), + SizeMode: SizeMode.ToOption(), + UseDefaults: UseDefaults.ToOption() + ); +} diff --git a/src/Plotly.NET.CSharp/ChartAPI/Chart2D/Bubble.cs b/src/Plotly.NET.CSharp/ChartAPI/Chart2D/Bubble.cs new file mode 100644 index 00000000..16e5394a --- /dev/null +++ b/src/Plotly.NET.CSharp/ChartAPI/Chart2D/Bubble.cs @@ -0,0 +1,108 @@ +using System; +using System.Collections.Generic; +using Plotly.NET; +using Plotly.NET.LayoutObjects; +using Plotly.NET.TraceObjects; +using static Plotly.NET.StyleParam; + +namespace Plotly.NET.CSharp; + +public static partial class Chart +{ + /// 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 of the plotted data. + /// 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. + /// Sets the opactity of the trace + /// Sets the opactity of individual datum markers + /// Sets a text associated with each datum + /// Sets individual text for each datum + /// Sets the position of text associated with each datum + /// Sets the position of text associated with individual datum + /// Sets the color of the marker + /// Sets the colorscale of the marker + /// Sets the outline of the marker + /// Sets the marker symbol for each datum + /// Sets the marker symbol for each individual datum + /// Sets the marker (use this for more finegrained control than the other marker-associated arguments) + /// Sets the color of the line + /// Sets the colorscale of the line + /// Sets the width of the line + /// sets the drawing style of the line + /// Sets the line (use this for more finegrained control than the other line-associated arguments) + /// Set several traces linked to the same position axis or matching axes to the same alignmentgroup. This controls whether bars compute their positional range dependently or independently. + /// Set several traces linked to the same position axis or matching axes to the same offsetgroup where bars of the same position coordinate will line up. + /// Set several traces (on the same subplot) to the same stackgroup in order to add their y values (or their x values if `Orientation` is Horizontal). Stacking also turns `fill` on by default and sets the default `mode` to "lines" irrespective of point count. ou can only stack on a numeric (linear or log) axis. Traces in a `stackgroup` will only fill to (or be filled to) other traces in the same group. With multiple `stackgroup`s or some traces stacked and some not, if fill-linked traces are not already consecutive, the later ones will be pushed down in the drawing order + /// Sets the stacking direction. Only relevant when `stackgroup` is used, and only the first `orientation` found in the `stackgroup` will be used. + /// Sets the normalization for the sum of this `stackgroup. Only relevant when `stackgroup` is used, and only the first `groupnorm` found in the `stackgroup` will be used + /// If true, plotly.js will use the WebGL engine to render this chart. use this when you want to render many objects at once. + /// If set to false, ignore the global default settings set in `Defaults` + public static GenericChart Bubble( + IEnumerable x, + IEnumerable y, + IEnumerable sizes, + Optional Name = default, + Optional ShowLegend = default, + Optional Opacity = default, + Optional> MultiOpacity = default, + Optional Text = default, + Optional> MultiText = default, + Optional TextPosition = default, + Optional> MultiTextPosition = default, + Optional MarkerColor = default, + Optional MarkerColorScale = default, + Optional MarkerOutline = default, + Optional MarkerSymbol = default, + Optional> MultiMarkerSymbol = default, + Optional Marker = default, + Optional LineColor = default, + Optional LineColorScale = default, + Optional LineWidth = default, + Optional LineDash = default, + Optional Line = default, + Optional AlignmentGroup = default, + Optional OffsetGroup = default, + Optional StackGroup = default, + Optional Orientation = default, + Optional GroupNorm = default, + Optional UseWebGL = default, + Optional UseDefaults = default + ) + where XType : IConvertible + where YType : IConvertible + where TextType : IConvertible + => + Plotly.NET.Chart2D_Scatter.Chart.Bubble( + x: x, + y: y, + sizes: sizes, + Name: Name.ToOption(), + ShowLegend: ShowLegend.ToOption(), + Opacity: Opacity.ToOption(), + MultiOpacity: MultiOpacity.ToOption(), + Text: Text.ToOption(), + MultiText: MultiText.ToOption(), + TextPosition: TextPosition.ToOption(), + MultiTextPosition: MultiTextPosition.ToOption(), + MarkerColor: MarkerColor.ToOption(), + MarkerColorScale: MarkerColorScale.ToOption(), + MarkerOutline: MarkerOutline.ToOption(), + MarkerSymbol: MarkerSymbol.ToOption(), + MultiMarkerSymbol: MultiMarkerSymbol.ToOption(), + Marker: Marker.ToOption(), + LineColor: LineColor.ToOption(), + LineColorScale: LineColorScale.ToOption(), + LineWidth: LineWidth.ToOption(), + LineDash: LineDash.ToOption(), + Line: Line.ToOption(), + AlignmentGroup: AlignmentGroup.ToOption(), + OffsetGroup: OffsetGroup.ToOption(), + StackGroup: StackGroup.ToOption(), + Orientation: Orientation.ToOption(), + GroupNorm: GroupNorm.ToOption(), + UseWebGL: UseWebGL.ToOption(), + UseDefaults: UseDefaults.ToOption() + ); +} diff --git a/src/Plotly.NET.CSharp/ChartAPI/Chart2D/Candlestick.cs b/src/Plotly.NET.CSharp/ChartAPI/Chart2D/Candlestick.cs new file mode 100644 index 00000000..84ff81f9 --- /dev/null +++ b/src/Plotly.NET.CSharp/ChartAPI/Chart2D/Candlestick.cs @@ -0,0 +1,82 @@ +using System; +using System.Collections.Generic; +using Plotly.NET; +using Plotly.NET.LayoutObjects; +using Plotly.NET.TraceObjects; +using static Plotly.NET.StyleParam; + +namespace Plotly.NET.CSharp; + +public static partial class Chart +{ + /// + /// Creates a candlestick chart. + /// + /// The candlestick is a style of financial chart describing open, high, low and close for a given `x` coordinate (most likely time). The boxes represent the spread between the `open` and `close` values and the lines represent the spread between the `low` and `high` values Sample points where the close value is higher (lower) then the open value are called increasing (decreasing). By default, increasing candles are drawn in green whereas decreasing are drawn in red. + /// + /// Sets the open values. + /// Sets the high values. + /// Sets the low values. + /// Sets the close values. + /// Sets the x coordinates. If absent, linear coordinate will be generated. + /// Sets the x coordinates. If absent, linear coordinate will be generated. Use two inner arrays here to plot multicategorial 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. + /// Sets the Opacity otf the trace. + /// Sets a text associated with each datum + /// Sets individual text for each datum + /// Sets the line of this trace. + /// Sets the color of increasing values + /// Sets the style options of increasing values (use this for more finegrained control than the other increasing-associated arguments). + /// Sets the color of decreasing values + /// Sets the style options of decreasing values (use this for more finegrained control than the other increasing-associated arguments). + /// Sets the width of the whiskers relative to the box' width. For example, with 1, the whiskers are as wide as the box(es). + /// Whether or not to show a rangeslider for the xaxis + /// If set to false, ignore the global default settings set in `Defaults` + public static GenericChart Candlestick( + IEnumerable open, + IEnumerable high, + IEnumerable low, + IEnumerable close, + Optional> X, + Optional>> MultiX, + Optional Name = default, + Optional ShowLegend = default, + Optional Opacity = default, + Optional Text = default, + Optional> MultiText = default, + Optional Line = default, + Optional IncreasingColor = default, + Optional Increasing = default, + Optional DecreasingColor = default, + Optional Decreasing = default, + Optional WhiskerWidth = default, + Optional ShowXAxisRangeSlider = default, + Optional UseDefaults = default + ) + where OHLCType : IConvertible + where XType : IConvertible + where TextType : IConvertible + => + Plotly.NET.Chart2D_Finance.Chart.Candlestick( + open: open, + high: high, + low: low, + close: close, + X: X.ToOption(), + MultiX: MultiX.ToOption(), + Name: Name.ToOption(), + ShowLegend: ShowLegend.ToOption(), + Opacity: Opacity.ToOption(), + Text: Text.ToOption(), + MultiText: MultiText.ToOption(), + Line: Line.ToOption(), + IncreasingColor: IncreasingColor.ToOption(), + Increasing: Increasing.ToOption(), + DecreasingColor: DecreasingColor.ToOption(), + Decreasing: Decreasing.ToOption(), + WhiskerWidth: WhiskerWidth.ToOption(), + ShowXAxisRangeSlider: ShowXAxisRangeSlider.ToOption(), + UseDefaults: UseDefaults.ToOption() + ); +} diff --git a/src/Plotly.NET.CSharp/ChartAPI/Chart2D/Column.cs b/src/Plotly.NET.CSharp/ChartAPI/Chart2D/Column.cs new file mode 100644 index 00000000..7cd3e5f1 --- /dev/null +++ b/src/Plotly.NET.CSharp/ChartAPI/Chart2D/Column.cs @@ -0,0 +1,91 @@ +using System; +using System.Collections.Generic; +using Plotly.NET; +using Plotly.NET.LayoutObjects; +using Plotly.NET.TraceObjects; +using static Plotly.NET.StyleParam; + +namespace Plotly.NET.CSharp; + +public static partial class Chart +{ + /// + /// Creates a column chart, with bars plotted vertically + /// + /// A column chart is a chart that presents categorical data with rectangular bars with heights or lengths proportional to the values that they represent. + /// + /// Sets the values that are plotted as the size of each bar. + /// Sets the keys associated with each bar. + /// Sets the keys associated with each bar. Use two inner arrays here to plot multicategorial 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. + /// Sets the Opacity of the trace. + /// Sets the Opacity of each individual bar. + /// Sets a text associated with each datum + /// Sets individual text for each datum + /// Sets the color of the bars + /// Sets the colorscale for the bars. To have an effect, `MarkerColor` must map to color scale values. + /// Sets the color of the bar outlines + /// Sets a pattern shape for all bars + /// Sets an individual pattern shape for each bar + /// Sets the marker pattern (use this for more finegrained control than the other pattern-associated arguments). + /// Sets the marker for the bars (use this for more finegrained control than the other marker-associated arguments). + /// Sets where the bar base is drawn (in position axis units). + /// Sets the bar width (in position axis units) of all bars. + /// Sets the individual bar width (in position axis units) for each bar. + /// Sets the position of text associated with each datum + /// Sets the position of text associated with individual datum + /// If set to false, ignore the global default settings set in `Defaults` + public static GenericChart Column( + IEnumerable values, + Optional> Keys = default, + Optional>> MultiKeys = default, + Optional Name = default, + Optional ShowLegend = default, + Optional Opacity = default, + Optional> MultiOpacity = default, + Optional Text = default, + Optional> MultiText = default, + Optional MarkerColor = default, + Optional MarkerColorScale = default, + Optional MarkerOutline = default, + Optional MarkerPatternShape = default, + Optional> MultiMarkerPatternShape = default, + Optional MarkerPattern = default, + Optional Marker = default, + Optional TextPosition = default, + Optional> MultiTextPosition = default, + Optional> MultiWidth = default, + Optional UseDefaults = default, + Optional Base = default, + Optional Width = default + ) + where ValuesType : IConvertible + where KeysType : IConvertible + where TextType : IConvertible + => + Plotly.NET.Chart2D_Bar.Chart.Column( + values: values, + Keys: Keys.ToOption(), + MultiKeys: MultiKeys.ToOption(), + Name: Name.ToOption(), + ShowLegend: ShowLegend.ToOption(), + Opacity: Opacity.ToOption(), + MultiOpacity: MultiOpacity.ToOption(), + Text: Text.ToOption(), + MultiText: MultiText.ToOption(), + MarkerColor: MarkerColor.ToOption(), + MarkerColorScale: MarkerColorScale.ToOption(), + MarkerOutline: MarkerOutline.ToOption(), + MarkerPatternShape: MarkerPatternShape.ToOption(), + MultiMarkerPatternShape: MultiMarkerPatternShape.ToOption(), + MarkerPattern: MarkerPattern.ToOption(), + Marker: Marker.ToOption(), + Base: Base.ToOption(), + Width: Width.ToOption(), + MultiWidth: MultiWidth.ToOption(), + TextPosition: TextPosition.ToOption(), + MultiTextPosition: MultiTextPosition.ToOption(), + UseDefaults: UseDefaults.ToOption() + ); +} diff --git a/src/Plotly.NET.CSharp/ChartAPI/Chart2D/Contour.cs b/src/Plotly.NET.CSharp/ChartAPI/Chart2D/Contour.cs new file mode 100644 index 00000000..571adeb1 --- /dev/null +++ b/src/Plotly.NET.CSharp/ChartAPI/Chart2D/Contour.cs @@ -0,0 +1,124 @@ +using System; +using System.Collections.Generic; +using Plotly.NET; +using Plotly.NET.LayoutObjects; +using Plotly.NET.TraceObjects; +using static Plotly.NET.StyleParam; + +namespace Plotly.NET.CSharp; + +public static partial class Chart +{ + /// + /// Creates a 2D contour plot, which shows the contour lines of a 2D numerical array z, i.e. interpolated lines of isovalues of z. + /// + /// A contour line (also isoline, isopleth, or isarithm) of a function of two variables is a curve along which the function has a constant value, so that the curve joins points of equal value + /// + /// The data from which contour lines are computed is set in `z`. Data in `z` must be a 2D array of numbers. Say that `z` has N rows and M columns, then by default, these N rows correspond to N y coordinates (set in `y` or auto-generated) and the M columns correspond to M x coordinates (set in `x` or auto-generated). By setting `transpose` to "true", the above behavior is flipped. + /// + /// Sets the z data which is used for computing the contour lines. + /// 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. + /// Sets the Opacity otf the trace. + /// Sets the x coordinates. + /// Sets the x coordinates. Use two inner arrays here to plot multicategorial data + /// Sets the y coordinates. + /// Sets the y coordinates. Use two inner arrays here to plot multicategorial data + /// Sets a text associated with each datum + /// Sets individual text for each datum + /// Sets the styles of the colorbar for this trace. + /// Sets the colorscale for this trace. + /// Whether or not to show the colorscale/colorbar + /// Reverses the color mapping if true. If true, `zmin` will correspond to the last color in the array and `zmax` will correspond to the first color. + /// Transposes the z data. + /// Sets the contour line dash style + /// Sets the contour line color + /// Sets the amount of smoothing for the contour lines, where "0" corresponds to no smoothing. + /// Sets the width of the contour lines + /// Sets the contour lines (use this for more finegrained control than the other contourline-associated arguments). + /// Wether or not to show the contour line + /// Determines the coloring method showing the contour values. If "fill", coloring is done evenly between each contour level If "heatmap", a heatmap gradient coloring is applied between each contour level. If "lines", coloring is done on the contour lines. If "none", no coloring is applied on this trace. + /// Sets the constraint operation. "=" keeps regions equal to `value` "<" and "<=" keep regions less than `value` ">" and ">=" keep regions greater than `value` "[]", "()", "[)", and "(]" keep regions inside `value[0]` to `value[1]` "][", ")(", "](", ")[" keep regions outside `value[0]` to value[1]` Open vs. closed intervals make no difference to constraint display, but all versions are allowed for consistency with filter transforms. + /// If `levels`, the data is represented as a contour plot with multiple levels displayed. If `constraint`, the data is represented as constraints with the invalid region shaded as specified by the `operation` and `value` parameters. + /// Determines whether to label the contour lines with their values. + /// Sets the font used for labeling the contour levels. The default color comes from the lines, if shown. The default family and size come from `layout.font`. + /// Sets the starting contour level value. Must be less than `contours.end` + /// Sets the end contour level value. Must be more than `contours.start` + /// Sets the styles of the contours (use this for more finegrained control than the other contour-associated arguments). + /// Sets the fill color if `contours.type` is "constraint". Defaults to a half-transparent variant of the line color, marker color, or marker line color, whichever is available. + /// Sets the maximum number of contour levels. The actual number of contours will be chosen automatically to be less than or equal to the value of `ncontours`. Has an effect only if `autocontour` is "true" or if `contours.size` is missing. + /// If set to false, ignore the global default settings set in `Defaults` + public static GenericChart Contour( + IEnumerable> zData, + Optional Name = default, + Optional ShowLegend = default, + Optional Opacity = default, + Optional> X = default, + Optional>> MultiX = default, + Optional> Y = default, + Optional>> MultiY = default, + Optional Text = default, + Optional> MultiText = default, + Optional ColorBar = default, + Optional ColorScale = default, + Optional ShowScale = default, + Optional ReverseScale = default, + Optional Transpose = default, + Optional ContourLinesDash = default, + Optional ContourLinesColor = default, + Optional ContourLinesSmoothing = default, + Optional ContourLinesWidth = default, + Optional ContourLines = default, + Optional ShowContourLines = default, + Optional ContoursColoring = default, + Optional ContoursOperation = default, + Optional ContoursType = default, + Optional ShowContoursLabels = default, + Optional ContourLabelFont = default, + Optional ContoursStart = default, + Optional ContoursEnd = default, + Optional Contours = default, + Optional FillColor = default, + Optional NContours = default, + Optional UseDefaults = default + ) + where ZType : IConvertible + where XType : IConvertible + where YType : IConvertible + where TextType : IConvertible + => + Plotly.NET.Chart2D_Heatmap.Chart.Contour, ZType, XType, YType, TextType>( + zData: zData, + Name: Name.ToOption(), + ShowLegend: ShowLegend.ToOption(), + Opacity: Opacity.ToOption(), + X: X.ToOption(), + MultiX: MultiX.ToOption(), + Y: Y.ToOption(), + MultiY: MultiY.ToOption(), + Text: Text.ToOption(), + MultiText: MultiText.ToOption(), + ColorBar: ColorBar.ToOption(), + ColorScale: ColorScale.ToOption(), + ShowScale: ShowScale.ToOption(), + ReverseScale: ReverseScale.ToOption(), + Transpose: Transpose.ToOption(), + ContourLinesDash: ContourLinesDash.ToOption(), + ContourLinesColor: ContourLinesColor.ToOption(), + ContourLinesSmoothing: ContourLinesSmoothing.ToOption(), + ContourLinesWidth: ContourLinesWidth.ToOption(), + ContourLines: ContourLines.ToOption(), + ShowContourLines: ShowContourLines.ToOption(), + ContoursColoring: ContoursColoring.ToOption(), + ContoursOperation: ContoursOperation.ToOption(), + ContoursType: ContoursType.ToOption(), + ShowContoursLabels: ShowContoursLabels.ToOption(), + ContoursLabelFont: ContourLabelFont.ToOption(), + ContoursStart: ContoursStart.ToOption(), + ContoursEnd: ContoursEnd.ToOption(), + Contours: Contours.ToOption(), + FillColor: FillColor.ToOption(), + NContours: NContours.ToOption(), + UseDefaults: UseDefaults.ToOption() + ); +} diff --git a/src/Plotly.NET.CSharp/ChartAPI/Chart2D/Funnel.cs b/src/Plotly.NET.CSharp/ChartAPI/Chart2D/Funnel.cs new file mode 100644 index 00000000..79182546 --- /dev/null +++ b/src/Plotly.NET.CSharp/ChartAPI/Chart2D/Funnel.cs @@ -0,0 +1,103 @@ +using System; +using System.Collections.Generic; +using Plotly.NET; +using Plotly.NET.LayoutObjects; +using Plotly.NET.TraceObjects; +using static Plotly.NET.StyleParam; + +namespace Plotly.NET.CSharp; + +public static partial class Chart +{ + /// + /// Creates a Funnel chart. + /// + /// Funnel charts visualize stages in a process using length-encoded bars. This trace can be used to show data in either a part-to-whole representation wherein each item appears in a single stage, or in a "drop-off" representation wherein each item appears in each stage it traversed. See also the "funnelarea" trace type for a different approach to visualizing funnel data. + /// + /// 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. + /// Sets the Opacity of the trace. + /// Sets the bar width (in position axis units). + /// Shifts the position where the bar is drawn (in position axis units). In "group" barmode, traces that set "offset" will be excluded and drawn in "overlay" mode instead. + /// Sets a text associated with each datum + /// Sets individual text for each datum + /// Sets the position of text associated with each datum + /// Sets the position of text associated with individual datum + /// Only relevant when `stackgroup` is used, and only the first `orientation` found in the `stackgroup` will be used - including if `visible` is "legendonly" but not if it is `false`. Sets the stacking direction. With "v" ("h"), the y (x) values of subsequent traces are added. Also affects the default value of `fill`. + /// Set several traces linked to the same position axis or matching axes to the same alignmentgroup. This controls whether bars compute their positional range dependently or independently. + /// Set several traces linked to the same position axis or matching axes to the same offsetgroup where bars of the same position coordinate will line up. + /// Sets the color of the bars. + /// Sets the color of the bar outline. + /// Sets the marker (use this for more finegrained control than the other marker-associated arguments) + /// Determines which trace information appear on the graph. In the case of having multiple funnels, percentages and totals are computed separately (per trace). + /// Sets the line color of the funnel connector + /// Sets the line style of the funnel connector + /// Sets the fill color of the funnel connector + /// Sets the line of the funnel connector (use this for more finegrained control than the other connector line associated arguments). + /// Sets the funnel connector (use this for more finegrained control than the other connector-associated arguments). + /// Sets the font used for `text` lying inside the bar. + /// Sets the font used for `text` lying outside the bar. + /// If set to false, ignore the global default settings set in `Defaults` + public static GenericChart Funnel( + IEnumerable x, + IEnumerable y, + Optional Name = default, + Optional ShowLegend = default, + Optional Opacity = default, + Optional Width = default, + Optional Offset = default, + Optional Text = default, + Optional> MultiText = default, + Optional TextPosition = default, + Optional> MultiTextPosition = default, + Optional Orientation = default, + Optional AlignmentGroup = default, + Optional OffsetGroup = default, + Optional MarkerColor = default, + Optional MarkerOutline = default, + Optional Marker = default, + Optional TextInfo = default, + Optional ConnectorLineColor = default, + Optional ConnectorLineStyle = default, + Optional ConnectorFillColor = default, + Optional ConnectorLine = default, + Optional Connector = default, + Optional InsideTextFont = default, + Optional OutsideTextFont = default, + Optional UseDefaults = default + ) + where XType : IConvertible + where YType : IConvertible + where TextType : IConvertible + => + Plotly.NET.Chart2D_Funnel.Chart.Funnel( + x: x, + y: y, + Name: Name.ToOption(), + ShowLegend: ShowLegend.ToOption(), + Opacity: Opacity.ToOption(), + Width: Width.ToOption(), + Offset: Offset.ToOption(), + Text: Text.ToOption(), + MultiText: MultiText.ToOption(), + TextPosition: TextPosition.ToOption(), + MultiTextPosition: MultiTextPosition.ToOption(), + Orientation: Orientation.ToOption(), + AlignmentGroup: AlignmentGroup.ToOption(), + OffsetGroup: OffsetGroup.ToOption(), + MarkerColor: MarkerColor.ToOption(), + MarkerOutline: MarkerOutline.ToOption(), + Marker: Marker.ToOption(), + TextInfo: TextInfo.ToOption(), + ConnectorLineColor: ConnectorLineColor.ToOption(), + ConnectorLineStyle: ConnectorLineStyle.ToOption(), + ConnectorFillColor: ConnectorFillColor.ToOption(), + ConnectorLine: ConnectorLine.ToOption(), + Connector: Connector.ToOption(), + InsideTextFont: InsideTextFont.ToOption(), + OutsideTextFont: OutsideTextFont.ToOption(), + UseDefaults: UseDefaults.ToOption() + ); +} diff --git a/src/Plotly.NET.CSharp/ChartAPI/Chart2D/Heatmap.cs b/src/Plotly.NET.CSharp/ChartAPI/Chart2D/Heatmap.cs new file mode 100644 index 00000000..412c8f52 --- /dev/null +++ b/src/Plotly.NET.CSharp/ChartAPI/Chart2D/Heatmap.cs @@ -0,0 +1,89 @@ +using System; +using System.Collections.Generic; +using Plotly.NET; +using Plotly.NET.LayoutObjects; +using Plotly.NET.TraceObjects; +using static Plotly.NET.StyleParam; + +namespace Plotly.NET.CSharp; + +public static partial class Chart +{ + /// + /// Creates a heatmap. + /// + /// A heatmap is a data visualization technique that shows magnitude of a phenomenon as color in two dimensions. + /// + /// Sets the 2-dimensional z data, which will be visualized with the color scale. + /// Sets the x coordinates + /// Sets the x coordinates. Use two inner arrays here to plot multicategorial data + /// Sets the y coordinates + /// Sets the y coordinates. Use two inner arrays here to plot multicategorial 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. + /// Sets the Opacity otf the trace. + /// Sets the horizontal gap (in pixels) between bricks. + /// Sets the vertical gap (in pixels) between bricks. + /// Sets a text associated with each datum + /// Sets individual text for each datum + /// Sets the styles of the colorbar for this trace. + /// Sets the colorscale for this trace. + /// Whether or not to show the colorscale/colorbar + /// Reverses the color mapping if true. If true, `zmin` will correspond to the last color in the array and `zmax` will correspond to the first color. + /// Picks a smoothing algorithm use to smooth `z` data. + /// Transposes the z data. + /// Whether or not to use WebGL to render this trace + /// Whether or not to reverse the y axis. If true, (0,0) will lie on the top left and increase downwards. + /// If set to false, ignore the global default settings set in `Defaults` + public static GenericChart Heatmap( + IEnumerable> zData, + Optional> X = default, + Optional>> MultiX = default, + Optional> Y = default, + Optional>> MultiY = default, + Optional Name = default, + Optional ShowLegend = default, + Optional Opacity = default, + Optional XGap = default, + Optional YGap = default, + Optional Text = default, + Optional> MultiText = default, + Optional ColorBar = default, + Optional ColorScale = default, + Optional ShowScale = default, + Optional ReverseScale = default, + Optional ZSmooth = default, + Optional Transpose = default, + Optional UseWebGL = default, + Optional ReverseYAxis = default, + Optional UseDefaults = default + ) + where ZType : IConvertible + where XType : IConvertible + where YType : IConvertible + where TextType : IConvertible + => + Plotly.NET.Chart2D_Heatmap.Chart.Heatmap, ZType, XType, YType, TextType>( + zData: zData, + X: X.ToOption(), + MultiX: MultiX.ToOption(), + Y: Y.ToOption(), + MultiY: MultiY.ToOption(), + Name: Name.ToOption(), + ShowLegend: ShowLegend.ToOption(), + Opacity: Opacity.ToOption(), + XGap: XGap.ToOption(), + YGap: YGap.ToOption(), + Text: Text.ToOption(), + MultiText: MultiText.ToOption(), + ColorBar: ColorBar.ToOption(), + ColorScale: ColorScale.ToOption(), + ShowScale: ShowScale.ToOption(), + ReverseScale: ReverseScale.ToOption(), + ZSmooth: ZSmooth.ToOption(), + Transpose: Transpose.ToOption(), + UseWebGL: UseWebGL.ToOption(), + ReverseYAxis: ReverseYAxis.ToOption(), + UseDefaults: UseDefaults.ToOption() + ); +} diff --git a/src/Plotly.NET.CSharp/ChartAPI/Chart2D/Histogram.cs b/src/Plotly.NET.CSharp/ChartAPI/Chart2D/Histogram.cs new file mode 100644 index 00000000..12112887 --- /dev/null +++ b/src/Plotly.NET.CSharp/ChartAPI/Chart2D/Histogram.cs @@ -0,0 +1,127 @@ +using System; +using System.Collections.Generic; +using Plotly.NET; +using Plotly.NET.LayoutObjects; +using Plotly.NET.TraceObjects; +using static Plotly.NET.StyleParam; + +namespace Plotly.NET.CSharp; + +public static partial class Chart +{ + /// + /// Visualizes the distribution of the input data as a histogram. + /// + /// A histogram is an approximate representation of the distribution of numerical data. To construct a histogram, the first step is to "bin" the range of values - that is, divide the entire range of values into a series of intervals - and then count how many values fall into each interval. + /// The bins are usually specified as consecutive, non-overlapping intervals of a variable. + /// + /// The sample data from which statistics are computed is set in `x` for vertically spanning histograms and in `y` for horizontally spanning histograms. Binning options are set `xbins` and `ybins` respectively if no aggregation data is provided. + /// + /// Sets the sample data to be binned on the x axis. + /// Sets the sample data to be binned on the x axis. Use two inner arrays here to plot multicategorial data + /// Sets the sample data to be binned on the y axis. + /// Sets the sample data to be binned on the y axis. Use two inner arrays here to plot multicategorial data + /// Sets the orientation of the bars. With "v" ("h"), the value of the each bar spans along the vertical (horizontal). + /// 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. + /// Sets the Opacity of the trace. + /// Sets a text associated with each datum + /// Sets individual text for each datum + /// Sets the position of text associated with each datum + /// Specifies the binning function used for this histogram trace. If "count", the histogram values are computed by counting the number of values lying inside each bin. If "sum", "avg", "min", "max", the histogram values are computed using the sum, the average, the minimum or the maximum of the values lying inside each bin respectively. + /// Specifies the type of normalization used for this histogram trace. If "", the span of each bar corresponds to the number of occurrences (i.e. the number of data points lying inside the bins). If "percent" / "probability", the span of each bar corresponds to the percentage / fraction of occurrences with respect to the total number of sample points (here, the sum of all bin HEIGHTS equals 100% / 1). If "density", the span of each bar corresponds to the number of occurrences in a bin divided by the size of the bin interval (here, the sum of all bin AREAS equals the total number of sample points). If "probability density", the area of each bar corresponds to the probability that an event will fall into the corresponding bin (here, the sum of all bin AREAS equals 1). + /// Set several traces linked to the same position axis or matching axes to the same alignmentgroup. This controls whether bars compute their positional range dependently or independently. + /// Set several traces linked to the same position axis or matching axes to the same offsetgroup where bars of the same position coordinate will line up. + /// Specifies the maximum number of desired bins. This value will be used in an algorithm that will decide the optimal bin size such that the histogram best visualizes the distribution of the data. Ignored if `xbins.size` is provided. + /// Specifies the maximum number of desired bins. This value will be used in an algorithm that will decide the optimal bin size such that the histogram best visualizes the distribution of the data. Ignored if `ybins.size` is provided. + /// Set a group of histogram traces which will have compatible bin settings. Note that traces on the same subplot and with the same "orientation" under `barmode` "stack", "relative" and "group" are forced into the same bingroup, Using `bingroup`, traces under `barmode` "overlay" and on different axes (of the same axis type) can have compatible bin settings. Note that histogram and histogram2d" trace can share the same `bingroup` + /// Sets the binning across the x dimension + /// Sets the binning across the y dimension + /// Sets the color of the bars + /// Sets the colorscale for the bars. To have an effect, `MarkerColor` must map to color scale values. + /// Sets the color of the bar outlines + /// Sets a pattern shape for all bars + /// Sets an individual pattern shape for each bar + /// Sets the marker pattern (use this for more finegrained control than the other pattern-associated arguments). + /// Sets the marker of this trace. + /// Sets the outline of the histogram's bars. + /// Sets the x error of this trace. + /// Sets the y error of this trace. + /// Sets whether and how the cumulative distribution is displayed + /// Sets the style of the hoverlabels of this trace. + /// If set to false, ignore the global default settings set in `Defaults` + public static GenericChart Histogram( + Optional> X = default, + Optional>> MultiX = default, + Optional> Y = default, + Optional>> MultiY = default, + Optional Orientation = default, + Optional Name = default, + Optional ShowLegend = default, + Optional Opacity = default, + Optional Text = default, + Optional> MultiText = default, + Optional TextPosition = default, + Optional HistFunc = default, + Optional HistNorm = default, + Optional AlignmentGroup = default, + Optional OffsetGroup = default, + Optional NBinsX = default, + Optional NBinsY = default, + Optional BinGroup = default, + Optional XBins = default, + Optional YBins = default, + Optional MarkerColor = default, + Optional MarkerColorScale = default, + Optional MarkerOutline = default, + Optional MarkerPatternShape = default, + Optional> MultiMarkerPatternShape = default, + Optional MarkerPattern = default, + Optional Marker = default, + Optional Line = default, + Optional XError = default, + Optional YError = default, + Optional Cumulative = default, + Optional HoverLabel = default, + Optional UseDefaults = default + ) + where XType : IConvertible + where YType : IConvertible + where TextType : IConvertible + => + Plotly.NET.Chart2D_Histogram.Chart.Histogram( + X: X.ToOption(), + MultiX: MultiX.ToOption(), + Y: Y.ToOption(), + MultiY: MultiY.ToOption(), + Orientation: Orientation.ToOption(), + Name: Name.ToOption(), + ShowLegend: ShowLegend.ToOption(), + Opacity: Opacity.ToOption(), + Text: Text.ToOption(), + MultiText: MultiText.ToOption(), + TextPosition: TextPosition.ToOption(), + HistFunc: HistFunc.ToOption(), + HistNorm: HistNorm.ToOption(), + AlignmentGroup: AlignmentGroup.ToOption(), + OffsetGroup: OffsetGroup.ToOption(), + NBinsX: NBinsX.ToOption(), + NBinsY: NBinsY.ToOption(), + BinGroup: BinGroup.ToOption(), + XBins: XBins.ToOption(), + YBins: YBins.ToOption(), + MarkerColor: MarkerColor.ToOption(), + MarkerColorScale: MarkerColorScale.ToOption(), + MarkerOutline: MarkerOutline.ToOption(), + MarkerPatternShape: MarkerPatternShape.ToOption(), + MultiMarkerPatternShape: MultiMarkerPatternShape.ToOption(), + MarkerPattern: MarkerPattern.ToOption(), + Marker: Marker.ToOption(), + Line: Line.ToOption(), + XError: XError.ToOption(), + YError: YError.ToOption(), + Cumulative: Cumulative.ToOption(), + HoverLabel: HoverLabel.ToOption(), + UseDefaults: UseDefaults.ToOption() + ); +} diff --git a/src/Plotly.NET.CSharp/ChartAPI/Chart2D/Histogram2D.cs b/src/Plotly.NET.CSharp/ChartAPI/Chart2D/Histogram2D.cs new file mode 100644 index 00000000..f3c1c164 --- /dev/null +++ b/src/Plotly.NET.CSharp/ChartAPI/Chart2D/Histogram2D.cs @@ -0,0 +1,85 @@ +using System; +using System.Collections.Generic; +using Plotly.NET; +using Plotly.NET.LayoutObjects; +using Plotly.NET.TraceObjects; +using static Plotly.NET.StyleParam; + +namespace Plotly.NET.CSharp; + +public static partial class Chart +{ + /// + /// Visualizes the distribution of the 2-dimensional input data as 2D Histogram. + /// + ///The sample data from which statistics are computed is set in `x` and `y` (where `x` and `y` represent marginal distributions, binning is set in `xbins` and `ybins` in this case) or `z` (where `z` represent the 2D distribution and binning set, binning is set by `x` and `y` in this case). The resulting distribution is visualized as a heatmap. + /// + /// Sets the sample data to be binned on the x axis. + /// Sets the sample data to be binned on the y axis. + /// Sets the aggregation 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. + /// Sets the Opacity of the trace. + /// Sets the horizontal gap (in pixels) between bricks. + /// Sets the vertical gap (in pixels) between bricks. + /// Specifies the binning function used for this histogram trace. If "count", the histogram values are computed by counting the number of values lying inside each bin. If "sum", "avg", "min", "max", the histogram values are computed using the sum, the average, the minimum or the maximum of the values lying inside each bin respectively. + /// Specifies the type of normalization used for this histogram trace. If "", the span of each bar corresponds to the number of occurrences (i.e. the number of data points lying inside the bins). If "percent" / "probability", the span of each bar corresponds to the percentage / fraction of occurrences with respect to the total number of sample points (here, the sum of all bin HEIGHTS equals 100% / 1). If "density", the span of each bar corresponds to the number of occurrences in a bin divided by the size of the bin interval (here, the sum of all bin AREAS equals the total number of sample points). If "probability density", the area of each bar corresponds to the probability that an event will fall into the corresponding bin (here, the sum of all bin AREAS equals 1). + /// Specifies the maximum number of desired bins. This value will be used in an algorithm that will decide the optimal bin size such that the histogram best visualizes the distribution of the data. Ignored if `xbins.size` is provided. + /// Specifies the maximum number of desired bins. This value will be used in an algorithm that will decide the optimal bin size such that the histogram best visualizes the distribution of the data. Ignored if `ybins.size` is provided. + /// Sets the binning across the x dimension + /// Sets the binning across the y dimension + /// Sets the styles of the colorbar for this trace. + /// Sets the colorscale for this trace. + /// Whether or not to show the colorscale/colorbar + /// Reverses the color mapping if true. If true, `zmin` will correspond to the last color in the array and `zmax` will correspond to the first color. + /// Picks a smoothing algorithm use to smooth `z` data. + /// If set to false, ignore the global default settings set in `Defaults` + public static GenericChart Histogram2D( + IEnumerable x, + IEnumerable y, + Optional>> Z = default, + Optional Name = default, + Optional ShowLegend = default, + Optional Opacity = default, + Optional XGap = default, + Optional YGap = default, + Optional HistFunc = default, + Optional HistNorm = default, + Optional NBinsX = default, + Optional NBinsY = default, + Optional XBins = default, + Optional YBins = default, + Optional ColorBar = default, + Optional ColorScale = default, + Optional ShowScale = default, + Optional ReverseScale = default, + Optional ZSmooth = default, + Optional UseDefaults = default + ) + where XType : IConvertible + where YType : IConvertible + where ZType : IConvertible + => + Plotly.NET.Chart2D_Histogram.Chart.Histogram2D, ZType>( + x: x, + y: y, + Z: Z.ToOption(), + Name: Name.ToOption(), + ShowLegend: ShowLegend.ToOption(), + Opacity: Opacity.ToOption(), + XGap: XGap.ToOption(), + YGap: YGap.ToOption(), + HistFunc: HistFunc.ToOption(), + HistNorm: HistNorm.ToOption(), + NBinsX: NBinsX.ToOption(), + NBinsY: NBinsY.ToOption(), + XBins: XBins.ToOption(), + YBins: YBins.ToOption(), + ColorBar: ColorBar.ToOption(), + ColorScale: ColorScale.ToOption(), + ShowScale: ShowScale.ToOption(), + ReverseScale: ReverseScale.ToOption(), + ZSmooth: ZSmooth.ToOption(), + UseDefaults: UseDefaults.ToOption() + ); +} diff --git a/src/Plotly.NET.CSharp/ChartAPI/Chart2D/Histogram2DContour.cs b/src/Plotly.NET.CSharp/ChartAPI/Chart2D/Histogram2DContour.cs new file mode 100644 index 00000000..f42a0b30 --- /dev/null +++ b/src/Plotly.NET.CSharp/ChartAPI/Chart2D/Histogram2DContour.cs @@ -0,0 +1,139 @@ +using System; +using System.Collections.Generic; +using Plotly.NET; +using Plotly.NET.LayoutObjects; +using Plotly.NET.TraceObjects; +using static Plotly.NET.StyleParam; + +namespace Plotly.NET.CSharp; + +public static partial class Chart +{ + /// + /// Computes a 2D histogram contour plot, also known as a density contour plot, which is a 2-dimensional generalization of a histogram which resembles a contour plot but is computed by grouping a set of points specified by their x and y coordinates into bins, and applying an aggregation function such as count or sum (if z is provided) to compute the value to be used to compute contours. + /// + /// The sample data from which statistics are computed is set in `x` and `y` (where `x` and `y` represent marginal distributions, binning is set in `xbins` and `ybins` in this case) or `z` (where `z` represent the 2D distribution and binning set, binning is set by `x` and `y` in this case). The resulting distribution is visualized as a contour plot. + /// + /// Sets the sample data to be binned on the x axis. + /// Sets the sample data to be binned on the x axis. Use two inner arrays here to plot multicategorial data + /// Sets the sample data to be binned on the y axis. + /// Sets the sample data to be binned on the y axis. Use two inner arrays here to plot multicategorial 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. + /// Sets the Opacity otf the trace. + /// Sets the aggregation data. + /// Specifies the binning function used for this histogram trace. If "count", the histogram values are computed by counting the number of values lying inside each bin. If "sum", "avg", "min", "max", the histogram values are computed using the sum, the average, the minimum or the maximum of the values lying inside each bin respectively. + /// Specifies the type of normalization used for this histogram trace. If "", the span of each bar corresponds to the number of occurrences (i.e. the number of data points lying inside the bins). If "percent" / "probability", the span of each bar corresponds to the percentage / fraction of occurrences with respect to the total number of sample points (here, the sum of all bin HEIGHTS equals 100% / 1). If "density", the span of each bar corresponds to the number of occurrences in a bin divided by the size of the bin interval (here, the sum of all bin AREAS equals the total number of sample points). If "probability density", the area of each bar corresponds to the probability that an event will fall into the corresponding bin (here, the sum of all bin AREAS equals 1). + /// Specifies the maximum number of desired bins. This value will be used in an algorithm that will decide the optimal bin size such that the histogram best visualizes the distribution of the data. Ignored if `xbins.size` is provided. + /// Specifies the maximum number of desired bins. This value will be used in an algorithm that will decide the optimal bin size such that the histogram best visualizes the distribution of the data. Ignored if `ybins.size` is provided. + /// Set the `xbingroup` and `ybingroup` default prefix For example, setting a `bingroup` of "1" on two histogram2d traces will make them their x-bins and y-bins match separately. + /// Set a group of histogram traces which will have compatible x-bin settings. Using `xbingroup`, histogram2d and histogram2dcontour traces (on axes of the same axis type) can have compatible x-bin settings. Note that the same `xbingroup` value can be used to set (1D) histogram `bingroup` + /// Sets the binning across the x dimension + /// Set a group of histogram traces which will have compatible y-bin settings. Using `ybingroup`, histogram2d and histogram2dcontour traces (on axes of the same axis type) can have compatible y-bin settings. Note that the same `ybingroup` value can be used to set (1D) histogram `bingroup` + /// Sets the binning across the y dimension + /// Sets the marker of this trace. + /// Sets the contour line dash style + /// Sets the contour line color + /// Sets the amount of smoothing for the contour lines, where "0" corresponds to no smoothing. + /// Sets the width of the contour lines + /// Sets the contour lines (use this for more finegrained control than the other contourline-associated arguments). + /// Wether or not to show the contour line + /// Determines the coloring method showing the contour values. If "fill", coloring is done evenly between each contour level If "heatmap", a heatmap gradient coloring is applied between each contour level. If "lines", coloring is done on the contour lines. If "none", no coloring is applied on this trace. + /// Sets the constraint operation. "=" keeps regions equal to `value` "<" and "<=" keep regions less than `value` ">" and ">=" keep regions greater than `value` "[]", "()", "[)", and "(]" keep regions inside `value[0]` to `value[1]` "][", ")(", "](", ")[" keep regions outside `value[0]` to value[1]` Open vs. closed intervals make no difference to constraint display, but all versions are allowed for consistency with filter transforms. + /// If `levels`, the data is represented as a contour plot with multiple levels displayed. If `constraint`, the data is represented as constraints with the invalid region shaded as specified by the `operation` and `value` parameters. + /// Determines whether to label the contour lines with their values. + /// Sets the font used for labeling the contour levels. The default color comes from the lines, if shown. The default family and size come from `layout.font`. + /// Sets the starting contour level value. Must be less than `contours.end` + /// Sets the end contour level value. Must be more than `contours.start` + /// Sets the styles of the contours (use this for more finegrained control than the other contour-associated arguments). + /// Sets the styles of the colorbar for this trace. + /// Sets the colorscale for this trace. + /// Whether or not to show the colorscale/colorbar + /// Reverses the color mapping if true. If true, `zmin` will correspond to the last color in the array and `zmax` will correspond to the first color. + /// Sets the maximum number of contour levels. The actual number of contours will be chosen automatically to be less than or equal to the value of `ncontours`. Has an effect only if `autocontour` is "true" or if `contours.size` is missing. + /// If set to false, ignore the global default settings set in `Defaults` + public static GenericChart Histogram2DContour( + Optional> X, + Optional>> MultiX, + Optional> Y, + Optional>> MultiY, + Optional Name = default, + Optional ShowLegend = default, + Optional Opacity = default, + Optional>> Z = default, + Optional HistFunc = default, + Optional HistNorm = default, + Optional NBinsX = default, + Optional NBinsY = default, + Optional BinGroup = default, + Optional XBinGroup = default, + Optional XBins = default, + Optional YBinGroup = default, + Optional YBins = default, + Optional Marker = default, + Optional ContourLinesDash = default, + Optional ContourLinesColor = default, + Optional ContourLinesSmoothing = default, + Optional ContourLinesWidth = default, + Optional ContourLines = default, + Optional ShowContourLines = default, + Optional ContoursColoring = default, + Optional ContoursOperation = default, + Optional ContoursType = default, + Optional ShowContoursLabels = default, + Optional ContourLabelFont = default, + Optional ContoursStart = default, + Optional ContoursEnd = default, + Optional Contours = default, + Optional ColorBar = default, + Optional ColorScale = default, + Optional ShowScale = default, + Optional ReverseScale = default, + Optional NContours = default, + Optional UseDefaults = default + ) + where XType : IConvertible + where YType : IConvertible + where ZType : IConvertible + => + Plotly.NET.Chart2D_Histogram.Chart.Histogram2DContour, ZType>( + X: X.ToOption(), + MultiX: MultiX.ToOption(), + Y: Y.ToOption(), + MultiY: MultiY.ToOption(), + Name: Name.ToOption(), + ShowLegend: ShowLegend.ToOption(), + Opacity: Opacity.ToOption(), + Z: Z.ToOption(), + HistFunc: HistFunc.ToOption(), + HistNorm: HistNorm.ToOption(), + NBinsX: NBinsX.ToOption(), + NBinsY: NBinsY.ToOption(), + BinGroup: BinGroup.ToOption(), + XBinGroup: XBinGroup.ToOption(), + XBins: XBins.ToOption(), + YBinGroup: YBinGroup.ToOption(), + YBins: YBins.ToOption(), + Marker: Marker.ToOption(), + ContourLinesDash: ContourLinesDash.ToOption(), + ContourLinesColor: ContourLinesColor.ToOption(), + ContourLinesSmoothing: ContourLinesSmoothing.ToOption(), + ContourLinesWidth: ContourLinesWidth.ToOption(), + ContourLines: ContourLines.ToOption(), + ShowContourLines: ShowContourLines.ToOption(), + ContoursColoring: ContoursColoring.ToOption(), + ContoursOperation: ContoursOperation.ToOption(), + ContoursType: ContoursType.ToOption(), + ShowContoursLabels: ShowContoursLabels.ToOption(), + ContoursLabelFont: ContourLabelFont.ToOption(), + ContoursStart: ContoursStart.ToOption(), + ContoursEnd: ContoursEnd.ToOption(), + Contours: Contours.ToOption(), + ColorBar: ColorBar.ToOption(), + ColorScale: ColorScale.ToOption(), + ShowScale: ShowScale.ToOption(), + ReverseScale: ReverseScale.ToOption(), + NContours: NContours.ToOption(), + UseDefaults: UseDefaults.ToOption() + ); +} diff --git a/src/Plotly.NET.CSharp/ChartAPI/Chart2D/Image.cs b/src/Plotly.NET.CSharp/ChartAPI/Chart2D/Image.cs new file mode 100644 index 00000000..be8b65fd --- /dev/null +++ b/src/Plotly.NET.CSharp/ChartAPI/Chart2D/Image.cs @@ -0,0 +1,54 @@ +using System; +using System.Collections.Generic; +using Plotly.NET; +using Plotly.NET.LayoutObjects; +using Plotly.NET.TraceObjects; +using static Plotly.NET.StyleParam; + +namespace Plotly.NET.CSharp; + +public static partial class Chart +{ + /// + /// Display an image, i.e. data on a 2D regular raster. By default, when an image is displayed in a subplot, its y axis will be reversed (ie. `autorange: 'reversed'`), constrained to the domain (ie. `constrain: 'domain'`) and it will have the same scale as its x axis (ie. `scaleanchor: 'x,`) in order for pixels to be rendered as squares. + /// + /// A 2-dimensional array in which each element is an array of 3 or 4 numbers representing a color. + /// Specifies the data URI of the image to be visualized. The URI consists of "data:image/[<media subtype>][;base64],<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. + /// Sets the Opacity otf the trace. + /// Assigns id labels to each datum. These ids for object constancy of data points during animation. Should be an array of strings, not numbers or any other type. + /// Color model used to map the numerical color components described in `z` into colors. If `source` is specified, this attribute will be set to `rgba256` otherwise it defaults to `rgb`. + /// Sets the upper bound of the color domain. Value should have the same units as in `z` and if set, `zmin` must be set as well. + /// Sets the lower bound of the color domain. Value should have the same units as in `z` and if set, `zmax` must be set as well. + /// Picks a smoothing algorithm use to smooth `z` data. + /// If set to false, ignore the global default settings set in `Defaults` + public static GenericChart Image( + Optional>>> Z = default, + Optional Source = default, + Optional Name = default, + Optional ShowLegend = default, + Optional Opacity = default, + Optional> Ids = default, + Optional ColorModel = default, + Optional ZMax = default, + Optional ZMin = default, + Optional ZSmooth = default, + Optional UseDefaults = default + ) + where IdType : IConvertible + => + Plotly.NET.Chart2D_Heatmap.Chart.Image>, IEnumerable, IdType>( + Z: Z.ToOption(), + Source: Source.ToOption(), + Name: Name.ToOption(), + ShowLegend: ShowLegend.ToOption(), + Opacity: Opacity.ToOption(), + Ids: Ids.ToOption(), + ColorModel: ColorModel.ToOption(), + ZMax: ZMax.ToOption(), + ZMin: ZMin.ToOption(), + ZSmooth: ZSmooth.ToOption(), + UseDefaults: UseDefaults.ToOption() + ); +} diff --git a/src/Plotly.NET.CSharp/ChartAPI/Chart2D/Line.cs b/src/Plotly.NET.CSharp/ChartAPI/Chart2D/Line.cs new file mode 100644 index 00000000..5aa6632e --- /dev/null +++ b/src/Plotly.NET.CSharp/ChartAPI/Chart2D/Line.cs @@ -0,0 +1,117 @@ +using System; +using System.Collections.Generic; +using Plotly.NET; +using Plotly.NET.LayoutObjects; +using Plotly.NET.TraceObjects; +using static Plotly.NET.StyleParam; + +namespace Plotly.NET.CSharp; + +public static partial class Chart +{ + /// Creates a Line chart, which uses a Line plotted between the given datums in a 2D space to visualize typically an evolution of Y depending on X. + /// Sets the x coordinates of the plotted data. + /// Sets the y coordinates of the plotted data. + /// Whether to show markers for the individual data points + /// 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. + /// Sets the opactity of the trace + /// Sets the opactity of individual datum markers + /// Sets a text associated with each datum + /// Sets individual text for each datum + /// Sets the position of text associated with each datum + /// Sets the position of text associated with individual datum + /// Sets the color of the marker + /// Sets the colorscale of the marker + /// Sets the outline of the marker + /// Sets the marker symbol for each datum + /// Sets the marker symbol for each individual datum + /// Sets the marker (use this for more finegrained control than the other marker-associated arguments) + /// Sets the color of the line + /// Sets the colorscale of the line + /// Sets the width of the line + /// sets the drawing style of the line + /// Sets the line (use this for more finegrained control than the other line-associated arguments) + /// Set several traces linked to the same position axis or matching axes to the same alignmentgroup. This controls whether bars compute their positional range dependently or independently. + /// Set several traces linked to the same position axis or matching axes to the same offsetgroup where bars of the same position coordinate will line up. + /// Set several traces (on the same subplot) to the same stackgroup in order to add their y values (or their x values if `Orientation` is Horizontal). Stacking also turns `fill` on by default and sets the default `mode` to "lines" irrespective of point count. ou can only stack on a numeric (linear or log) axis. Traces in a `stackgroup` will only fill to (or be filled to) other traces in the same group. With multiple `stackgroup`s or some traces stacked and some not, if fill-linked traces are not already consecutive, the later ones will be pushed down in the drawing order + /// Sets the stacking direction. Only relevant when `stackgroup` is used, and only the first `orientation` found in the `stackgroup` will be used. + /// Sets the normalization for the sum of this `stackgroup. Only relevant when `stackgroup` is used, and only the first `groupnorm` found in the `stackgroup` will be used + /// Sets the area to fill with a solid color. Defaults to "none" unless this trace is stacked, then it gets "tonexty" ("tonextx") if `orientation` is "v" ("h") Use with `FillColor` if not "none". "tozerox" and "tozeroy" fill to x=0 and y=0 respectively. "tonextx" and "tonexty" fill between the endpoints of this trace and the endpoints of the trace before it, connecting those endpoints with straight lines (to make a stacked area graph); if there is no trace before it, they behave like "tozerox" and "tozeroy". "toself" connects the endpoints of the trace (or each segment of the trace if it has gaps) into a closed shape. "tonext" fills the space between two traces if one completely encloses the other (eg consecutive contour lines), and behaves like "toself" if there is no trace before it. "tonext" should not be used if one trace does not enclose the other. Traces in a `stackgroup` will only fill to (or be filled to) other traces in the same group. With multiple `stackgroup`s or some traces stacked and some not, if fill-linked traces are not already consecutive, the later ones will be pushed down in the drawing order. + /// Sets the fill color. Defaults to a half-transparent variant of the line color, marker color, or marker line color, whichever is available. + /// Sets the pattern within the marker. + /// If true, plotly.js will use the WebGL engine to render this chart. use this when you want to render many objects at once. + /// If set to false, ignore the global default settings set in `Defaults` + public static GenericChart Line( + IEnumerable x, + IEnumerable y, + Optional ShowMarkers = default, + Optional Name = default, + Optional ShowLegend = default, + Optional Opacity = default, + Optional> MultiOpacity = default, + Optional Text = default, + Optional> MultiText = default, + Optional TextPosition = default, + Optional> MultiTextPosition = default, + Optional MarkerColor = default, + Optional MarkerColorScale = default, + Optional MarkerOutline = default, + Optional MarkerSymbol = default, + Optional> MultiMarkerSymbol = default, + Optional Marker = default, + Optional LineColor = default, + Optional LineColorScale = default, + Optional LineWidth = default, + Optional LineDash = default, + Optional Line = default, + Optional AlignmentGroup = default, + Optional OffsetGroup = default, + Optional StackGroup = default, + Optional Orientation = default, + Optional GroupNorm = default, + Optional Fill = default, + Optional FillColor = default, + Optional FillPattern = default, + Optional UseWebGL = default, + Optional UseDefaults = default + ) + where XType : IConvertible + where YType : IConvertible + where TextType : IConvertible + => + Plotly.NET.Chart2D_Scatter.Chart.Line( + x: x, + y: y, + ShowMarkers: ShowMarkers.ToOption(), + Name: Name.ToOption(), + ShowLegend: ShowLegend.ToOption(), + Opacity: Opacity.ToOption(), + MultiOpacity: MultiOpacity.ToOption(), + Text: Text.ToOption(), + MultiText: MultiText.ToOption(), + TextPosition: TextPosition.ToOption(), + MultiTextPosition: MultiTextPosition.ToOption(), + MarkerColor: MarkerColor.ToOption(), + MarkerColorScale: MarkerColorScale.ToOption(), + MarkerOutline: MarkerOutline.ToOption(), + MarkerSymbol: MarkerSymbol.ToOption(), + MultiMarkerSymbol: MultiMarkerSymbol.ToOption(), + Marker: Marker.ToOption(), + LineColor: LineColor.ToOption(), + LineColorScale: LineColorScale.ToOption(), + LineWidth: LineWidth.ToOption(), + LineDash: LineDash.ToOption(), + Line: Line.ToOption(), + AlignmentGroup: AlignmentGroup.ToOption(), + OffsetGroup: OffsetGroup.ToOption(), + StackGroup: StackGroup.ToOption(), + Orientation: Orientation.ToOption(), + GroupNorm: GroupNorm.ToOption(), + Fill: Fill.ToOption(), + FillColor: FillColor.ToOption(), + FillPattern: FillPattern.ToOption(), + UseWebGL: UseWebGL.ToOption(), + UseDefaults: UseDefaults.ToOption() + ); +} diff --git a/src/Plotly.NET.CSharp/ChartAPI/Chart2D/OHLC.cs b/src/Plotly.NET.CSharp/ChartAPI/Chart2D/OHLC.cs new file mode 100644 index 00000000..be5f354b --- /dev/null +++ b/src/Plotly.NET.CSharp/ChartAPI/Chart2D/OHLC.cs @@ -0,0 +1,82 @@ +using System; +using System.Collections.Generic; +using Plotly.NET; +using Plotly.NET.LayoutObjects; +using Plotly.NET.TraceObjects; +using static Plotly.NET.StyleParam; + +namespace Plotly.NET.CSharp; + +public static partial class Chart +{ + /// + /// Creates an OHLC chart. + /// + /// The ohlc (short for Open-High-Low-Close) is a style of financial chart describing open, high, low and close for a given `x` coordinate (most likely time). The tip of the lines represent the `low` and `high` values and the horizontal segments represent the `open` and `close` values. Sample points where the close value is higher (lower) then the open value are called increasing (decreasing). By default, increasing items are drawn in green whereas decreasing are drawn in red. + /// + /// Sets the open values. + /// Sets the high values. + /// Sets the low values. + /// Sets the close values. + /// Sets the x coordinates. If absent, linear coordinate will be generated. + /// Sets the x coordinates. If absent, linear coordinate will be generated. Use two inner arrays here to plot multicategorial 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. + /// Sets the Opacity otf the trace. + /// Sets a text associated with each datum + /// Sets individual text for each datum + /// Sets the line of this trace. + /// Sets the color of increasing values + /// Sets the style options of increasing values (use this for more finegrained control than the other increasing-associated arguments). + /// Sets the color of decreasing values + /// Sets the style options of decreasing values (use this for more finegrained control than the other increasing-associated arguments). + /// Sets the width of the open/close tick marks relative to the "x" minimal interval. + /// Whether or not to show a rangeslider for the xaxis + /// If set to false, ignore the global default settings set in `Defaults` + public static GenericChart OHLC( + IEnumerable open, + IEnumerable high, + IEnumerable low, + IEnumerable close, + Optional> X, + Optional>> MultiX, + Optional Name = default, + Optional ShowLegend = default, + Optional Opacity = default, + Optional Text = default, + Optional> MultiText = default, + Optional Line = default, + Optional IncreasingColor = default, + Optional Increasing = default, + Optional DecreasingColor = default, + Optional Decreasing = default, + Optional TickWidth = default, + Optional ShowXAxisRangeSlider = default, + Optional UseDefaults = default + ) + where OHLCType : IConvertible + where XType : IConvertible + where TextType : IConvertible + => + Plotly.NET.Chart2D_Finance.Chart.OHLC( + open: open, + high: high, + low: low, + close: close, + X: X.ToOption(), + MultiX: MultiX.ToOption(), + Name: Name.ToOption(), + ShowLegend: ShowLegend.ToOption(), + Opacity: Opacity.ToOption(), + Text: Text.ToOption(), + MultiText: MultiText.ToOption(), + Line: Line.ToOption(), + IncreasingColor: IncreasingColor.ToOption(), + Increasing: Increasing.ToOption(), + DecreasingColor: DecreasingColor.ToOption(), + Decreasing: Decreasing.ToOption(), + TickWidth: TickWidth.ToOption(), + ShowXAxisRangeSlider: ShowXAxisRangeSlider.ToOption(), + UseDefaults: UseDefaults.ToOption() + ); +} diff --git a/src/Plotly.NET.CSharp/ChartAPI/Chart2D/Pareto.cs b/src/Plotly.NET.CSharp/ChartAPI/Chart2D/Pareto.cs new file mode 100644 index 00000000..b2b5973a --- /dev/null +++ b/src/Plotly.NET.CSharp/ChartAPI/Chart2D/Pareto.cs @@ -0,0 +1,55 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using Plotly.NET; +using Plotly.NET.LayoutObjects; +using Plotly.NET.TraceObjects; +using static Plotly.NET.StyleParam; + +namespace Plotly.NET.CSharp; + +public static partial class Chart +{ + /// Creates a Pareto chart. + /// Sets the (key,value) pairs that are plotted as the size and key of each bar. + /// Sets the trace name. The trace name appear as the legend item and on hover + /// Sets the y axis label. + /// Determines whether or not grid lines are drawn. If "true", the grid lines are drawn for the pareto distribution figure; defaults to true. + public static GenericChart Pareto( + IEnumerable<(TLabel, double)> keysValues + , Optional Name + , Optional Label + , Optional ShowGrid + ) + where TLabel : IConvertible + => + Chart2D_Statistical.Chart.Pareto( + keysValues.Select(t => t.ToTuple()) + , Name: Name.ToOption() + , Label: Label.ToOption() + , ShowGrid: ShowGrid.ToOption() + ); + + /// Creates a Pareto chart. + /// Sets the labels that are matching the . + /// Sets the values that are plotted as the size of each bar. + /// Sets the trace name. The trace name appear as the legend item and on hover + /// Sets the y axis label. + /// Determines whether or not grid lines are drawn. If "true", the grid lines are drawn for the pareto distribution figure; defaults to true. + public static GenericChart Pareto( + IEnumerable labels + , IEnumerable values + , Optional Name + , Optional Label + , Optional ShowGrid + ) + where TLabel : IConvertible + => + Chart2D_Statistical.Chart.Pareto( + labels + , values + , Name: Name.ToOption() + , Label: Label.ToOption() + , ShowGrid: ShowGrid.ToOption() + ); +} diff --git a/src/Plotly.NET.CSharp/ChartAPI/Chart2D/Point.cs b/src/Plotly.NET.CSharp/ChartAPI/Chart2D/Point.cs new file mode 100644 index 00000000..32dece8d --- /dev/null +++ b/src/Plotly.NET.CSharp/ChartAPI/Chart2D/Point.cs @@ -0,0 +1,92 @@ +using System; +using System.Collections.Generic; +using Plotly.NET; +using Plotly.NET.LayoutObjects; +using Plotly.NET.TraceObjects; +using static Plotly.NET.StyleParam; + +namespace Plotly.NET.CSharp; + +public static partial class Chart +{ + /// + /// Creates a Point chart, which uses Points in a 2D space to visualize data. + /// + /// 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. + /// Sets the opactity of the trace + /// Sets the opactity of individual datum markers + /// Sets a text associated with each datum + /// Sets individual text for each datum + /// Sets the position of text associated with each datum + /// Sets the position of text associated with individual datum + /// Sets the color of the marker + /// Sets the colorscale of the marker + /// Sets the outline of the marker + /// Sets the marker symbol for each datum + /// Sets the marker symbol for each individual datum + /// Sets the marker (use this for more finegrained control than the other marker-associated arguments) + /// Set several traces linked to the same position axis or matching axes to the same alignmentgroup. This controls whether bars compute their positional range dependently or independently. + /// Set several traces linked to the same position axis or matching axes to the same offsetgroup where bars of the same position coordinate will line up. + /// Set several traces (on the same subplot) to the same stackgroup in order to add their y values (or their x values if `Orientation` is Horizontal). Stacking also turns `fill` on by default and sets the default `mode` to "lines" irrespective of point count. ou can only stack on a numeric (linear or log) axis. Traces in a `stackgroup` will only fill to (or be filled to) other traces in the same group. With multiple `stackgroup`s or some traces stacked and some not, if fill-linked traces are not already consecutive, the later ones will be pushed down in the drawing order + /// Sets the stacking direction. Only relevant when `stackgroup` is used, and only the first `orientation` found in the `stackgroup` will be used. + /// Sets the normalization for the sum of this `stackgroup. Only relevant when `stackgroup` is used, and only the first `groupnorm` found in the `stackgroup` will be used + /// If true, plotly.js will use the WebGL engine to render this chart. use this when you want to render many objects at once. + /// If set to false, ignore the global default settings set in `Defaults` + public static GenericChart Point( + IEnumerable x, + IEnumerable y, + Optional Name = default, + Optional ShowLegend = default, + Optional Opacity = default, + Optional> MultiOpacity = default, + Optional Text = default, + Optional> MultiText = default, + Optional TextPosition = default, + Optional> MultiTextPosition = default, + Optional MarkerColor = default, + Optional MarkerColorScale = default, + Optional MarkerOutline = default, + Optional MarkerSymbol = default, + Optional> MultiMarkerSymbol = default, + Optional Marker = default, + Optional AlignmentGroup = default, + Optional OffsetGroup = default, + Optional StackGroup = default, + Optional Orientation = default, + Optional GroupNorm = default, + Optional UseWebGL = default, + Optional UseDefaults = default + ) + where XType : IConvertible + where YType : IConvertible + where TextType : IConvertible + => + Plotly.NET.Chart2D_Scatter.Chart.Point( + x: x, + y: y, + Name: Name.ToOption(), + ShowLegend: ShowLegend.ToOption(), + Opacity: Opacity.ToOption(), + MultiOpacity: MultiOpacity.ToOption(), + Text: Text.ToOption(), + MultiText: MultiText.ToOption(), + TextPosition: TextPosition.ToOption(), + MultiTextPosition: MultiTextPosition.ToOption(), + MarkerColor: MarkerColor.ToOption(), + MarkerColorScale: MarkerColorScale.ToOption(), + MarkerOutline: MarkerOutline.ToOption(), + MarkerSymbol: MarkerSymbol.ToOption(), + MultiMarkerSymbol: MultiMarkerSymbol.ToOption(), + Marker: Marker.ToOption(), + AlignmentGroup: AlignmentGroup.ToOption(), + OffsetGroup: OffsetGroup.ToOption(), + StackGroup: StackGroup.ToOption(), + Orientation: Orientation.ToOption(), + GroupNorm: GroupNorm.ToOption(), + UseWebGL: UseWebGL.ToOption(), + UseDefaults: UseDefaults.ToOption() + ); +} diff --git a/src/Plotly.NET.CSharp/ChartAPI/Chart2D/PointDensity.cs b/src/Plotly.NET.CSharp/ChartAPI/Chart2D/PointDensity.cs new file mode 100644 index 00000000..929141cc --- /dev/null +++ b/src/Plotly.NET.CSharp/ChartAPI/Chart2D/PointDensity.cs @@ -0,0 +1,107 @@ +using System; +using System.Collections.Generic; +using Plotly.NET; +using Plotly.NET.LayoutObjects; +using Plotly.NET.TraceObjects; +using static Plotly.NET.StyleParam; + +namespace Plotly.NET.CSharp; + +public static partial class Chart +{ + /// + /// Creates a point density plot - a combination of a Scatter plot and Histogram2DContour. + /// + /// Additionally to plotting the (x,y) data as points on a 2D plane, a density contour plot is computed by grouping a set of points specified by their x and y coordinates into bins, and applying a count aggregation function to compute the value to be used to compute contours. + /// The sample data from which statistics are computed is set in `x` and `y` (where `x` and `y` represent marginal distributions, binning is set in `xbins` and `ybins` in this case). The resulting distribution is visualized as a contour plot. + /// + /// + /// Sets the x coordinates of the plotted data as well as the sample data to be binned on the x axis. + /// Sets the y coordinates of the plotted data as well as the sample data to be binned on the y axis. + /// Sets the opacity of the point trace. + /// Sets the marker color of the point trace. + /// Sets the marker symbol of the point trace. + /// Sets the marker size of the point trace. + /// Sets the contour line dash style + /// Sets the contour line color + /// Sets the amount of smoothing for the contour lines, where "0" corresponds to no smoothing. + /// Sets the width of the contour lines + /// Sets the contour lines (use this for more finegrained control than the other contourline-associated arguments). + /// Wether or not to show the contour line + /// Determines the coloring method showing the contour values. If "fill", coloring is done evenly between each contour level If "heatmap", a heatmap gradient coloring is applied between each contour level. If "lines", coloring is done on the contour lines. If "none", no coloring is applied on this trace. + /// Sets the constraint operation. "=" keeps regions equal to `value` "<" and "<=" keep regions less than `value` ">" and ">=" keep regions greater than `value` "[]", "()", "[)", and "(]" keep regions inside `value[0]` to `value[1]` "][", ")(", "](", ")[" keep regions outside `value[0]` to value[1]` Open vs. closed intervals make no difference to constraint display, but all versions are allowed for consistency with filter transforms. + /// If `levels`, the data is represented as a contour plot with multiple levels displayed. If `constraint`, the data is represented as constraints with the invalid region shaded as specified by the `operation` and `value` parameters. + /// Determines whether to label the contour lines with their values. + /// Sets the font used for labeling the contour levels. The default color comes from the lines, if shown. The default family and size come from `layout.font`. + /// Sets the starting contour level value. Must be less than `contours.end` + /// Sets the end contour level value. Must be more than `contours.start` + /// Sets the styles of the contours (use this for more finegrained control than the other contour-associated arguments). + /// Sets the maximum number of contour levels. The actual number of contours will be chosen automatically to be less than or equal to the value of `ncontours`. Has an effect only if `autocontour` is "true" or if `contours.size` is missing. + /// Specifies the type of normalization used for this histogram trace. If "", the span of each bar corresponds to the number of occurrences (i.e. the number of data points lying inside the bins). If "percent" / "probability", the span of each bar corresponds to the percentage / fraction of occurrences with respect to the total number of sample points (here, the sum of all bin HEIGHTS equals 100% / 1). If "density", the span of each bar corresponds to the number of occurrences in a bin divided by the size of the bin interval (here, the sum of all bin AREAS equals the total number of sample points). If "probability density", the area of each bar corresponds to the probability that an event will fall into the corresponding bin (here, the sum of all bin AREAS equals 1). + /// Sets the opacity of the histogram2dcontour trace. + /// Sets the color bar. + /// Sets the colorscale of the histogram2dcontour trace. + /// whether or not to show the colorbar + /// If set to false, ignore the global default settings set in `Defaults` + public static GenericChart PointDensity( + IEnumerable x, + IEnumerable y, + Optional PointOpacity = default, + Optional PointMarkerColor = default, + Optional PointMarkerSymbol = default, + Optional PointMarkerSize = default, + Optional ContourLinesDash = default, + Optional ContourLinesColor = default, + Optional ContourLinesSmoothing = default, + Optional ContourLinesWidth = default, + Optional ContourLines = default, + Optional ShowContourLines = default, + Optional ContoursColoring = default, + Optional ContoursOperation = default, + Optional ContoursType = default, + Optional ShowContoursLabels = default, + Optional ContourLabelFont = default, + Optional ContoursStart = default, + Optional ContoursEnd = default, + Optional Contours = default, + Optional NContours = default, + Optional HistNorm = default, + Optional ContourOpacity = default, + Optional ColorBar = default, + Optional ColorScale = default, + Optional ShowScale = default, + Optional UseDefaults = default + ) + where XType : IConvertible + where YType : IConvertible + => + Plotly.NET.Chart2D_Splom.Chart.PointDensity( + x: x, + y: y, + PointOpacity: PointOpacity.ToOption(), + PointMarkerColor: PointMarkerColor.ToOption(), + PointMarkerSymbol: PointMarkerSymbol.ToOption(), + PointMarkerSize: PointMarkerSize.ToOption(), + ContourLinesDash: ContourLinesDash.ToOption(), + ContourLinesColor: ContourLinesColor.ToOption(), + ContourLinesSmoothing: ContourLinesSmoothing.ToOption(), + ContourLinesWidth: ContourLinesWidth.ToOption(), + ContourLines: ContourLines.ToOption(), + ShowContourLines: ShowContourLines.ToOption(), + ContoursColoring: ContoursColoring.ToOption(), + ContoursOperation: ContoursOperation.ToOption(), + ContoursType: ContoursType.ToOption(), + ShowContoursLabels: ShowContoursLabels.ToOption(), + ContoursLabelFont: ContourLabelFont.ToOption(), + ContoursStart: ContoursStart.ToOption(), + ContoursEnd: ContoursEnd.ToOption(), + Contours: Contours.ToOption(), + NContours: NContours.ToOption(), + HistNorm: HistNorm.ToOption(), + ContourOpacity: ContourOpacity.ToOption(), + ColorBar: ColorBar.ToOption(), + ColorScale: ColorScale.ToOption(), + ShowScale: ShowScale.ToOption(), + UseDefaults: UseDefaults.ToOption() + ); +} diff --git a/src/Plotly.NET.CSharp/ChartAPI/Chart2D/Range.cs b/src/Plotly.NET.CSharp/ChartAPI/Chart2D/Range.cs new file mode 100644 index 00000000..4642900b --- /dev/null +++ b/src/Plotly.NET.CSharp/ChartAPI/Chart2D/Range.cs @@ -0,0 +1,139 @@ +using System; +using System.Collections.Generic; +using Plotly.NET; +using Plotly.NET.LayoutObjects; +using Plotly.NET.TraceObjects; +using static Plotly.NET.StyleParam; + +namespace Plotly.NET.CSharp; + +public static partial class Chart +{ + /// + /// Displays a range of data by plotting three Y values per data point (upper, mid, lower). + /// + /// The mid Y value usually resembles some kind of central tendency and the upper/lower Y values some kind of spread. + /// + /// Sets the x coordinates of the plotted data. + /// Sets the y coordinates of the plotted data for the mid Y value. + /// Sets the y coordinates of the plotted data for the upper Y value. + /// Sets the y coordinates of the plotted data for the lower Y value. + /// Determines the drawing mode for this scatter trace. + /// Sets the trace name of the mid Y values. The trace name appear as the legend item and on hover + /// Sets the name of the legendgroup for the three traces of this plot. + /// Determines whether or not an To show markers for each datum. + /// Determines whether or not an item corresponding to this trace is shown in the legend. + /// Sets a text associated with each datum for the mid Y values. + /// Sets individual text for each datum for the mid Y values. + /// Sets the position of text associated with each datum + /// Sets the position of text associated with individual datum + /// Sets the color of the marker for the mid Y values. + /// Sets the colorscale of the marker for the mid Y values. + /// Sets the outline of the marker for the mid Y values. + /// Sets the marker symbol for each datum for the mid Y values. + /// Sets the marker symbol for each individual datum for the mid Y values. + /// Sets the marker (use this for more finegrained control than the other marker-associated arguments) for the mid Y values. + /// Sets the color of the line for the mid Y values. + /// Sets the colorscale of the line for the mid Y values. + /// Sets the width of the line for the mid Y values. + /// sets the drawing style of the line for the mid Y values. + /// Sets the line (use this for more finegrained control than the other line-associated arguments) for the mid Y values. + /// Sets the color of the range between upper and lower Y values. + /// Sets the pattern of the range between upper and lower Y values. + /// Sets a text associated with each datum for the upper Y values. + /// Sets individual text for each datum for the upper Y values. + /// Sets a text associated with each datum for the lower Y values. + /// Sets individual text for each datum for the lower Y values. + /// Sets the text font for all Text items + /// Sets the name of the lower Y value trace. + /// Sets the line for the lower Y values. + /// Sets the marker for the lower Y values. + /// Sets the name of the uper Y value trace. + /// Sets the line for the upper Y values. + /// Sets the marker for the upper Y values. + /// If set to false, ignore the global default settings set in `Defaults` + public static GenericChart Range( + IEnumerable x, + IEnumerable y, + IEnumerable upper, + IEnumerable lower, + StyleParam.Mode mode, + Optional Name = default, + Optional GroupName = default, + Optional ShowMarkers = default, + Optional ShowLegend = default, + Optional Text = default, + Optional> MultiText = default, + Optional TextPosition = default, + Optional> MultiTextPosition = default, + Optional MarkerColor = default, + Optional MarkerColorScale = default, + Optional MarkerOutline = default, + Optional MarkerSymbol = default, + Optional> MultiMarkerSymbol = default, + Optional Marker = default, + Optional UpperMarker = default, + Optional LowerMarker = default, + Optional LineColor = default, + Optional LineColorScale = default, + Optional LineWidth = default, + Optional LineDash = default, + Optional Line = default, + Optional UpperLine = default, + Optional LowerLine = default, + Optional RangeColor = default, + Optional RangePattern = default, + Optional UpperText = default, + Optional> MultiUpperText = default, + Optional LowerText = default, + Optional> MultiLowerText = default, + Optional TextFont = default, + Optional LowerName = default, + Optional UpperName = default, + Optional UseDefaults = default + ) + where XType : IConvertible + where YType : IConvertible + where TextType : IConvertible + => + Plotly.NET.Chart2D_Scatter.Chart.Range( + x: x, + y: y, + upper: upper, + lower: lower, + mode: mode, + Name: Name.ToOption(), + GroupName: GroupName.ToOption(), + ShowMarkers: ShowMarkers.ToOption(), + ShowLegend: ShowLegend.ToOption(), + Text: Text.ToOption(), + MultiText: MultiText.ToOption(), + TextPosition: TextPosition.ToOption(), + MultiTextPosition: MultiTextPosition.ToOption(), + MarkerColor: MarkerColor.ToOption(), + MarkerColorScale: MarkerColorScale.ToOption(), + MarkerOutline: MarkerOutline.ToOption(), + MarkerSymbol: MarkerSymbol.ToOption(), + MultiMarkerSymbol: MultiMarkerSymbol.ToOption(), + Marker: Marker.ToOption(), + UpperMarker: UpperMarker.ToOption(), + LowerMarker: LowerMarker.ToOption(), + LineColor: LineColor.ToOption(), + LineColorScale: LineColorScale.ToOption(), + LineWidth: LineWidth.ToOption(), + LineDash: LineDash.ToOption(), + Line: Line.ToOption(), + UpperLine: UpperLine.ToOption(), + LowerLine: LowerLine.ToOption(), + RangeColor: RangeColor.ToOption(), + RangePattern: RangePattern.ToOption(), + UpperText: UpperText.ToOption(), + MultiUpperText: MultiUpperText.ToOption(), + LowerText: LowerText.ToOption(), + MultiLowerText: MultiLowerText.ToOption(), + TextFont: TextFont.ToOption(), + LowerName: LowerName.ToOption(), + UpperName: UpperName.ToOption(), + UseDefaults: UseDefaults.ToOption() + ); +} diff --git a/src/Plotly.NET.CSharp/ChartAPI/Chart2D/Scatter.cs b/src/Plotly.NET.CSharp/ChartAPI/Chart2D/Scatter.cs new file mode 100644 index 00000000..dae44c71 --- /dev/null +++ b/src/Plotly.NET.CSharp/ChartAPI/Chart2D/Scatter.cs @@ -0,0 +1,121 @@ +using System; +using System.Collections.Generic; +using Plotly.NET; +using Plotly.NET.LayoutObjects; +using Plotly.NET.TraceObjects; +using static Plotly.NET.StyleParam; + +namespace Plotly.NET.CSharp; + +public static partial class Chart +{ + /// + /// Creates a Scatter plot. + /// + /// Scatter charts are the basis of Point, Line, and Bubble Charts, and can be customized as such. We also provide abstractions for those: Chart.Line, Chart.Point, Chart.Bubble + /// + /// Sets the x coordinates of the plotted data. + /// 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. + /// Sets the opactity of the trace + /// Sets the opactity of individual datum markers + /// Sets a text associated with each datum + /// Sets individual text for each datum + /// Sets the position of text associated with each datum + /// Sets the position of text associated with individual datum + /// Sets the color of the marker + /// Sets the colorscale of the marker + /// Sets the outline of the marker + /// Sets the marker symbol for each datum + /// Sets the marker symbol for each individual datum + /// Sets the marker (use this for more finegrained control than the other marker-associated arguments) + /// Sets the color of the line + /// Sets the colorscale of the line + /// Sets the width of the line + /// sets the drawing style of the line + /// Sets the line (use this for more finegrained control than the other line-associated arguments) + /// Set several traces linked to the same position axis or matching axes to the same alignmentgroup. This controls whether bars compute their positional range dependently or independently. + /// Set several traces linked to the same position axis or matching axes to the same offsetgroup where bars of the same position coordinate will line up. + /// Set several traces (on the same subplot) to the same stackgroup in order to add their y values (or their x values if `Orientation` is Horizontal). Stacking also turns `fill` on by default and sets the default `mode` to "lines" irrespective of point count. ou can only stack on a numeric (linear or log) axis. Traces in a `stackgroup` will only fill to (or be filled to) other traces in the same group. With multiple `stackgroup`s or some traces stacked and some not, if fill-linked traces are not already consecutive, the later ones will be pushed down in the drawing order + /// Sets the stacking direction. Only relevant when `stackgroup` is used, and only the first `orientation` found in the `stackgroup` will be used. + /// Sets the normalization for the sum of this `stackgroup. Only relevant when `stackgroup` is used, and only the first `groupnorm` found in the `stackgroup` will be used + /// Sets the area to fill with a solid color. Defaults to "none" unless this trace is stacked, then it gets "tonexty" ("tonextx") if `orientation` is "v" ("h") Use with `FillColor` if not "none". "tozerox" and "tozeroy" fill to x=0 and y=0 respectively. "tonextx" and "tonexty" fill between the endpoints of this trace and the endpoints of the trace before it, connecting those endpoints with straight lines (to make a stacked area graph); if there is no trace before it, they behave like "tozerox" and "tozeroy". "toself" connects the endpoints of the trace (or each segment of the trace if it has gaps) into a closed shape. "tonext" fills the space between two traces if one completely encloses the other (eg consecutive contour lines), and behaves like "toself" if there is no trace before it. "tonext" should not be used if one trace does not enclose the other. Traces in a `stackgroup` will only fill to (or be filled to) other traces in the same group. With multiple `stackgroup`s or some traces stacked and some not, if fill-linked traces are not already consecutive, the later ones will be pushed down in the drawing order. + /// Sets the fill color. Defaults to a half-transparent variant of the line color, marker color, or marker line color, whichever is available. + /// Sets the pattern within the marker. + /// If true, plotly.js will use the WebGL engine to render this chart. use this when you want to render many objects at once. + /// If set to false, ignore the global default settings set in `Defaults` + public static GenericChart Scatter( + IEnumerable x, + IEnumerable y, + StyleParam.Mode mode, + Optional Name = default, + Optional ShowLegend = default, + Optional Opacity = default, + Optional> MultiOpacity = default, + Optional Text = default, + Optional> MultiText = default, + Optional TextPosition = default, + Optional> MultiTextPosition = default, + Optional MarkerColor = default, + Optional MarkerColorScale = default, + Optional MarkerOutline = default, + Optional MarkerSymbol = default, + Optional> MultiMarkerSymbol = default, + Optional Marker = default, + Optional LineColor = default, + Optional LineColorScale = default, + Optional LineWidth = default, + Optional LineDash = default, + Optional Line = default, + Optional AlignmentGroup = default, + Optional OffsetGroup = default, + Optional StackGroup = default, + Optional Orientation = default, + Optional GroupNorm = default, + Optional Fill = default, + Optional FillColor = default, + Optional FillPattern = default, + Optional UseWebGL = default, + Optional UseDefaults = default + ) + where XType : IConvertible + where YType : IConvertible + where TextType : IConvertible + => + Plotly.NET.Chart2D_Scatter.Chart.Scatter( + x: x, + y: y, + mode: mode, + Name: Name.ToOption(), + ShowLegend: ShowLegend.ToOption(), + Opacity: Opacity.ToOption(), + MultiOpacity: MultiOpacity.ToOption(), + Text: Text.ToOption(), + MultiText: MultiText.ToOption(), + TextPosition: TextPosition.ToOption(), + MultiTextPosition: MultiTextPosition.ToOption(), + MarkerColor: MarkerColor.ToOption(), + MarkerColorScale: MarkerColorScale.ToOption(), + MarkerOutline: MarkerOutline.ToOption(), + MarkerSymbol: MarkerSymbol.ToOption(), + MultiMarkerSymbol: MultiMarkerSymbol.ToOption(), + Marker: Marker.ToOption(), + LineColor: LineColor.ToOption(), + LineColorScale: LineColorScale.ToOption(), + LineWidth: LineWidth.ToOption(), + LineDash: LineDash.ToOption(), + Line: Line.ToOption(), + AlignmentGroup: AlignmentGroup.ToOption(), + OffsetGroup: OffsetGroup.ToOption(), + StackGroup: StackGroup.ToOption(), + Orientation: Orientation.ToOption(), + GroupNorm: GroupNorm.ToOption(), + Fill: Fill.ToOption(), + FillColor: FillColor.ToOption(), + FillPattern: FillPattern.ToOption(), + UseWebGL: UseWebGL.ToOption(), + UseDefaults: UseDefaults.ToOption() + ); +} diff --git a/src/Plotly.NET.CSharp/ChartAPI/Chart2D/Spline.cs b/src/Plotly.NET.CSharp/ChartAPI/Chart2D/Spline.cs new file mode 100644 index 00000000..7e8c178a --- /dev/null +++ b/src/Plotly.NET.CSharp/ChartAPI/Chart2D/Spline.cs @@ -0,0 +1,121 @@ +using System; +using System.Collections.Generic; +using Plotly.NET; +using Plotly.NET.LayoutObjects; +using Plotly.NET.TraceObjects; +using static Plotly.NET.StyleParam; + +namespace Plotly.NET.CSharp; + +public static partial class Chart +{ + /// Creates a Spline chart. A spline chart is a line chart in which data points are connected by smoothed curves: this modification is aimed to improve the design of a chart. + /// Very similar to Line Plots, spline charts are typically used to visualize an evolution of Y depending on X. + /// Sets the x coordinates of the plotted data. + /// Sets the y coordinates of the plotted data. + /// Whether to show markers for the individual data points + /// Sets the amount of smoothing. "0" corresponds to no smoothing (equivalent to a "linear" shape). Use values between 0. and 1.3 + /// 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. + /// Sets the opactity of the trace + /// Sets the opactity of individual datum markers + /// Sets a text associated with each datum + /// Sets individual text for each datum + /// Sets the position of text associated with each datum + /// Sets the position of text associated with individual datum + /// Sets the color of the marker + /// Sets the colorscale of the marker + /// Sets the outline of the marker + /// Sets the marker symbol for each datum + /// Sets the marker symbol for each individual datum + /// Sets the marker (use this for more finegrained control than the other marker-associated arguments) + /// Sets the color of the line + /// Sets the colorscale of the line + /// Sets the width of the line + /// sets the drawing style of the line + /// Sets the line (use this for more finegrained control than the other line-associated arguments) + /// Set several traces linked to the same position axis or matching axes to the same alignmentgroup. This controls whether bars compute their positional range dependently or independently. + /// Set several traces linked to the same position axis or matching axes to the same offsetgroup where bars of the same position coordinate will line up. + /// Set several traces (on the same subplot) to the same stackgroup in order to add their y values (or their x values if `Orientation` is Horizontal). Stacking also turns `fill` on by default and sets the default `mode` to "lines" irrespective of point count. ou can only stack on a numeric (linear or log) axis. Traces in a `stackgroup` will only fill to (or be filled to) other traces in the same group. With multiple `stackgroup`s or some traces stacked and some not, if fill-linked traces are not already consecutive, the later ones will be pushed down in the drawing order + /// Sets the stacking direction. Only relevant when `stackgroup` is used, and only the first `orientation` found in the `stackgroup` will be used. + /// Sets the normalization for the sum of this `stackgroup. Only relevant when `stackgroup` is used, and only the first `groupnorm` found in the `stackgroup` will be used + /// Sets the area to fill with a solid color. Defaults to "none" unless this trace is stacked, then it gets "tonexty" ("tonextx") if `orientation` is "v" ("h") Use with `FillColor` if not "none". "tozerox" and "tozeroy" fill to x=0 and y=0 respectively. "tonextx" and "tonexty" fill between the endpoints of this trace and the endpoints of the trace before it, connecting those endpoints with straight lines (to make a stacked area graph); if there is no trace before it, they behave like "tozerox" and "tozeroy". "toself" connects the endpoints of the trace (or each segment of the trace if it has gaps) into a closed shape. "tonext" fills the space between two traces if one completely encloses the other (eg consecutive contour lines), and behaves like "toself" if there is no trace before it. "tonext" should not be used if one trace does not enclose the other. Traces in a `stackgroup` will only fill to (or be filled to) other traces in the same group. With multiple `stackgroup`s or some traces stacked and some not, if fill-linked traces are not already consecutive, the later ones will be pushed down in the drawing order. + /// Sets the fill color. Defaults to a half-transparent variant of the line color, marker color, or marker line color, whichever is available. + /// Sets the pattern within the marker. + /// If true, plotly.js will use the WebGL engine to render this chart. use this when you want to render many objects at once. + /// If set to false, ignore the global default settings set in `Defaults` + public static GenericChart Spline( + IEnumerable x, + IEnumerable y, + Optional ShowMarkers = default, + Optional Smoothing = default, + Optional Name = default, + Optional ShowLegend = default, + Optional Opacity = default, + Optional> MultiOpacity = default, + Optional Text = default, + Optional> MultiText = default, + Optional TextPosition = default, + Optional> MultiTextPosition = default, + Optional MarkerColor = default, + Optional MarkerColorScale = default, + Optional MarkerOutline = default, + Optional MarkerSymbol = default, + Optional> MultiMarkerSymbol = default, + Optional Marker = default, + Optional LineColor = default, + Optional LineColorScale = default, + Optional LineWidth = default, + Optional LineDash = default, + Optional Line = default, + Optional AlignmentGroup = default, + Optional OffsetGroup = default, + Optional StackGroup = default, + Optional Orientation = default, + Optional GroupNorm = default, + Optional Fill = default, + Optional FillColor = default, + Optional FillPattern = default, + Optional UseWebGL = default, + Optional UseDefaults = default + ) + where XType : IConvertible + where YType : IConvertible + where TextType : IConvertible + => + Plotly.NET.Chart2D_Scatter.Chart.Spline( + x: x, + y: y, + ShowMarkers: ShowMarkers.ToOption(), + Smoothing: Smoothing.ToOption(), + Name: Name.ToOption(), + ShowLegend: ShowLegend.ToOption(), + Opacity: Opacity.ToOption(), + MultiOpacity: MultiOpacity.ToOption(), + Text: Text.ToOption(), + MultiText: MultiText.ToOption(), + TextPosition: TextPosition.ToOption(), + MultiTextPosition: MultiTextPosition.ToOption(), + MarkerColor: MarkerColor.ToOption(), + MarkerColorScale: MarkerColorScale.ToOption(), + MarkerOutline: MarkerOutline.ToOption(), + MarkerSymbol: MarkerSymbol.ToOption(), + MultiMarkerSymbol: MultiMarkerSymbol.ToOption(), + Marker: Marker.ToOption(), + LineColor: LineColor.ToOption(), + LineColorScale: LineColorScale.ToOption(), + LineWidth: LineWidth.ToOption(), + LineDash: LineDash.ToOption(), + Line: Line.ToOption(), + AlignmentGroup: AlignmentGroup.ToOption(), + OffsetGroup: OffsetGroup.ToOption(), + StackGroup: StackGroup.ToOption(), + Orientation: Orientation.ToOption(), + GroupNorm: GroupNorm.ToOption(), + Fill: Fill.ToOption(), + FillColor: FillColor.ToOption(), + FillPattern: FillPattern.ToOption(), + UseWebGL: UseWebGL.ToOption(), + UseDefaults: UseDefaults.ToOption() + ); +} diff --git a/src/Plotly.NET.CSharp/ChartAPI/Chart2D/SplineArea.cs b/src/Plotly.NET.CSharp/ChartAPI/Chart2D/SplineArea.cs new file mode 100644 index 00000000..7ffe9cfc --- /dev/null +++ b/src/Plotly.NET.CSharp/ChartAPI/Chart2D/SplineArea.cs @@ -0,0 +1,120 @@ +using System; +using System.Collections.Generic; +using Plotly.NET; +using Plotly.NET.LayoutObjects; +using Plotly.NET.TraceObjects; +using static Plotly.NET.StyleParam; + +namespace Plotly.NET.CSharp; + +public static partial class Chart +{ + /// Creates a Spline area chart, which uses a smoothed Line plotted between the given datums in a 2D space, additionally colouring the area between the line and the Y Axis. + /// Sets the x coordinates of the plotted data. + /// Sets the y coordinates of the plotted data. + /// Whether to show markers for the individual data points + /// Sets the amount of smoothing. "0" corresponds to no smoothing (equivalent to a "linear" shape). Use values between 0. and 1.3 + /// 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. + /// Sets the opactity of the trace + /// Sets the opactity of individual datum markers + /// Sets a text associated with each datum + /// Sets individual text for each datum + /// Sets the position of text associated with each datum + /// Sets the position of text associated with individual datum + /// Sets the color of the marker + /// Sets the colorscale of the marker + /// Sets the outline of the marker + /// Sets the marker symbol for each datum + /// Sets the marker symbol for each individual datum + /// Sets the marker (use this for more finegrained control than the other marker-associated arguments) + /// Sets the color of the line + /// Sets the colorscale of the line + /// Sets the width of the line + /// sets the drawing style of the line + /// Sets the line (use this for more finegrained control than the other line-associated arguments) + /// Set several traces linked to the same position axis or matching axes to the same alignmentgroup. This controls whether bars compute their positional range dependently or independently. + /// Set several traces linked to the same position axis or matching axes to the same offsetgroup where bars of the same position coordinate will line up. + /// Set several traces (on the same subplot) to the same stackgroup in order to add their y values (or their x values if `Orientation` is Horizontal). Stacking also turns `fill` on by default and sets the default `mode` to "lines" irrespective of point count. ou can only stack on a numeric (linear or log) axis. Traces in a `stackgroup` will only fill to (or be filled to) other traces in the same group. With multiple `stackgroup`s or some traces stacked and some not, if fill-linked traces are not already consecutive, the later ones will be pushed down in the drawing order + /// Sets the stacking direction. Only relevant when `stackgroup` is used, and only the first `orientation` found in the `stackgroup` will be used. + /// Sets the normalization for the sum of this `stackgroup. Only relevant when `stackgroup` is used, and only the first `groupnorm` found in the `stackgroup` will be used + /// ets the fill color. Defaults to a half-transparent variant of the line color, marker color, or marker line color, whichever is available. + /// Sets a pattern shape for the area fill + /// Sets the pattern within the area. (use this for more finegrained control than the other fillpattern-associated arguments). + /// If true, plotly.js will use the WebGL engine to render this chart. use this when you want to render many objects at once. + /// If set to false, ignore the global default settings set in `Defaults` + public static GenericChart SplineArea( + IEnumerable x, + IEnumerable y, + Optional ShowMarkers = default, + Optional Smoothing = default, + Optional Name = default, + Optional ShowLegend = default, + Optional Opacity = default, + Optional> MultiOpacity = default, + Optional Text = default, + Optional> MultiText = default, + Optional TextPosition = default, + Optional> MultiTextPosition = default, + Optional MarkerColor = default, + Optional MarkerColorScale = default, + Optional MarkerOutline = default, + Optional MarkerSymbol = default, + Optional> MultiMarkerSymbol = default, + Optional Marker = default, + Optional LineColor = default, + Optional LineColorScale = default, + Optional LineWidth = default, + Optional LineDash = default, + Optional Line = default, + Optional AlignmentGroup = default, + Optional OffsetGroup = default, + Optional StackGroup = default, + Optional Orientation = default, + Optional GroupNorm = default, + Optional FillColor = default, + Optional FillPatternShape = default, + Optional FillPattern = default, + Optional UseWebGL = default, + Optional UseDefaults = default + ) + where XType : IConvertible + where YType : IConvertible + where TextType : IConvertible + => + Plotly.NET.Chart2D_Area.Chart.SplineArea( + x: x, + y: y, + ShowMarkers: ShowMarkers.ToOption(), + Smoothing: Smoothing.ToOption(), + Name: Name.ToOption(), + ShowLegend: ShowLegend.ToOption(), + Opacity: Opacity.ToOption(), + MultiOpacity: MultiOpacity.ToOption(), + Text: Text.ToOption(), + MultiText: MultiText.ToOption(), + TextPosition: TextPosition.ToOption(), + MultiTextPosition: MultiTextPosition.ToOption(), + MarkerColor: MarkerColor.ToOption(), + MarkerColorScale: MarkerColorScale.ToOption(), + MarkerOutline: MarkerOutline.ToOption(), + MarkerSymbol: MarkerSymbol.ToOption(), + MultiMarkerSymbol: MultiMarkerSymbol.ToOption(), + Marker: Marker.ToOption(), + LineColor: LineColor.ToOption(), + LineColorScale: LineColorScale.ToOption(), + LineWidth: LineWidth.ToOption(), + LineDash: LineDash.ToOption(), + Line: Line.ToOption(), + AlignmentGroup: AlignmentGroup.ToOption(), + OffsetGroup: OffsetGroup.ToOption(), + StackGroup: StackGroup.ToOption(), + Orientation: Orientation.ToOption(), + GroupNorm: GroupNorm.ToOption(), + FillColor: FillColor.ToOption(), + FillPatternShape: FillPatternShape.ToOption(), + FillPattern: FillPattern.ToOption(), + UseWebGL: UseWebGL.ToOption(), + UseDefaults: UseDefaults.ToOption() + ); +} diff --git a/src/Plotly.NET.CSharp/ChartAPI/Chart2D/Splom.cs b/src/Plotly.NET.CSharp/ChartAPI/Chart2D/Splom.cs new file mode 100644 index 00000000..1108de69 --- /dev/null +++ b/src/Plotly.NET.CSharp/ChartAPI/Chart2D/Splom.cs @@ -0,0 +1,74 @@ +using System; +using System.Collections.Generic; +using Plotly.NET; +using Plotly.NET.LayoutObjects; +using Plotly.NET.TraceObjects; +using static Plotly.NET.StyleParam; + +namespace Plotly.NET.CSharp; + +public static partial class Chart +{ + /// + /// Creates a scatter plot matrix (SPLOM) from multiple input dimensions. + /// + /// Each splom `dimensions` items correspond to a generated axis. Values for each of those dimensions are set in `dimensions[i].values`. Splom traces support all `scattergl` marker style attributes. Specify `layout.grid` attributes and/or layout x-axis and y-axis attributes for more control over the axis positioning and style. + /// + /// Sets the dimensions of the scatter plot matrix, where each item corresponds to a generated axis. + /// 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. + /// Sets the Opacity otf the trace. + /// Sets a text associated with each datum + /// Sets individual text for each datum + /// Sets the color of the marker. + /// Sets the colorscale of the marker. Use `Color.fromColorScaleValues` to map marker colors to a colorscale. + /// Sets the outline of the marker + /// Sets the symbol of all marker + /// Sets the symbol of each individual marker + /// Sets the markers (use this for more finegrained control than the other marker-associated arguments). + /// Whether or not to show the matrix diagional + /// Sets the styles applied to the scatter plot matrix diagonal + /// Determines whether or not subplots on the lower half from the diagonal are displayed. + /// Determines whether or not subplots on the upper half from the diagonal are displayed. + /// If set to false, ignore the global default settings set in `Defaults` + public static GenericChart Splom( + IEnumerable dimensions, + Optional Name = default, + Optional ShowLegend = default, + Optional Opacity = default, + Optional Text = default, + Optional> MultiText = default, + Optional MarkerColor = default, + Optional MarkerColorScale = default, + Optional MarkerOutline = default, + Optional MarkerSymbol = default, + Optional> MultiMarkerSymbol = default, + Optional Marker = default, + Optional ShowDiagonal = default, + Optional Diagonal = default, + Optional ShowLowerHalf = default, + Optional ShowUpperHalf = default, + Optional UseDefaults = default + ) + where TextType : IConvertible + => + Plotly.NET.Chart2D_Splom.Chart.Splom( + dimensions: dimensions, + Name: Name.ToOption(), + ShowLegend: ShowLegend.ToOption(), + Opacity: Opacity.ToOption(), + Text: Text.ToOption(), + MultiText: MultiText.ToOption(), + MarkerColor: MarkerColor.ToOption(), + MarkerColorScale: MarkerColorScale.ToOption(), + MarkerOutline: MarkerOutline.ToOption(), + MarkerSymbol: MarkerSymbol.ToOption(), + MultiMarkerSymbol: MultiMarkerSymbol.ToOption(), + Marker: Marker.ToOption(), + ShowDiagonal: ShowDiagonal.ToOption(), + Diagonal: Diagonal.ToOption(), + ShowLowerHalf: ShowLowerHalf.ToOption(), + ShowUpperHalf: ShowUpperHalf.ToOption(), + UseDefaults: UseDefaults.ToOption() + ); +} diff --git a/src/Plotly.NET.CSharp/ChartAPI/Chart2D/StackedArea.cs b/src/Plotly.NET.CSharp/ChartAPI/Chart2D/StackedArea.cs new file mode 100644 index 00000000..a468e4ef --- /dev/null +++ b/src/Plotly.NET.CSharp/ChartAPI/Chart2D/StackedArea.cs @@ -0,0 +1,108 @@ +using System; +using System.Collections.Generic; +using Plotly.NET; +using Plotly.NET.LayoutObjects; +using Plotly.NET.TraceObjects; +using static Plotly.NET.StyleParam; + +namespace Plotly.NET.CSharp; + +public static partial class Chart +{ + /// Creates a stacked Area chart, which uses a Line plotted between the given datums in a 2D space, additionally colouring the area between the line and the Y Axis. Multiple Charts of this type are stacked on top of each others y dimensions + /// Sets the x coordinates of the plotted data. + /// Sets the y coordinates of the plotted data. + /// Whether to show markers for the individual data points + /// 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. + /// Sets the opactity of the trace + /// Sets the opactity of individual datum markers + /// Sets a text associated with each datum + /// Sets individual text for each datum + /// Sets the position of text associated with each datum + /// Sets the position of text associated with individual datum + /// Sets the color of the marker + /// Sets the colorscale of the marker + /// Sets the outline of the marker + /// Sets the marker symbol for each datum + /// Sets the marker symbol for each individual datum + /// Sets the marker (use this for more finegrained control than the other marker-associated arguments) + /// Sets the color of the line + /// Sets the colorscale of the line + /// Sets the width of the line + /// sets the drawing style of the line + /// Sets the line (use this for more finegrained control than the other line-associated arguments) + /// Sets the stacking direction. Only relevant when `stackgroup` is used, and only the first `orientation` found in the `stackgroup` will be used. + /// Sets the normalization for the sum of this `stackgroup. Only relevant when `stackgroup` is used, and only the first `groupnorm` found in the `stackgroup` will be used + /// ets the fill color. Defaults to a half-transparent variant of the line color, marker color, or marker line color, whichever is available. + /// Sets a pattern shape for the area fill + /// Sets the pattern within the area. (use this for more finegrained control than the other fillpattern-associated arguments). + /// If true, plotly.js will use the WebGL engine to render this chart. use this when you want to render many objects at once. + /// If set to false, ignore the global default settings set in `Defaults` + public static GenericChart StackedArea( + IEnumerable x, + IEnumerable y, + Optional ShowMarkers = default, + Optional Name = default, + Optional ShowLegend = default, + Optional Opacity = default, + Optional> MultiOpacity = default, + Optional Text = default, + Optional> MultiText = default, + Optional TextPosition = default, + Optional> MultiTextPosition = default, + Optional MarkerColor = default, + Optional MarkerColorScale = default, + Optional MarkerOutline = default, + Optional MarkerSymbol = default, + Optional> MultiMarkerSymbol = default, + Optional Marker = default, + Optional LineColor = default, + Optional LineColorScale = default, + Optional LineWidth = default, + Optional LineDash = default, + Optional Line = default, + Optional Orientation = default, + Optional GroupNorm = default, + Optional FillColor = default, + Optional FillPatternShape = default, + Optional FillPattern = default, + Optional UseWebGL = default, + Optional UseDefaults = default + ) + where XType : IConvertible + where YType : IConvertible + where TextType : IConvertible + => + Plotly.NET.Chart2D_Area.Chart.StackedArea( + x: x, + y: y, + ShowMarkers: ShowMarkers.ToOption(), + Name: Name.ToOption(), + ShowLegend: ShowLegend.ToOption(), + Opacity: Opacity.ToOption(), + MultiOpacity: MultiOpacity.ToOption(), + Text: Text.ToOption(), + MultiText: MultiText.ToOption(), + TextPosition: TextPosition.ToOption(), + MultiTextPosition: MultiTextPosition.ToOption(), + MarkerColor: MarkerColor.ToOption(), + MarkerColorScale: MarkerColorScale.ToOption(), + MarkerOutline: MarkerOutline.ToOption(), + MarkerSymbol: MarkerSymbol.ToOption(), + MultiMarkerSymbol: MultiMarkerSymbol.ToOption(), + Marker: Marker.ToOption(), + LineColor: LineColor.ToOption(), + LineColorScale: LineColorScale.ToOption(), + LineWidth: LineWidth.ToOption(), + LineDash: LineDash.ToOption(), + Line: Line.ToOption(), + Orientation: Orientation.ToOption(), + GroupNorm: GroupNorm.ToOption(), + FillColor: FillColor.ToOption(), + FillPatternShape: FillPatternShape.ToOption(), + FillPattern: FillPattern.ToOption(), + UseWebGL: UseWebGL.ToOption(), + UseDefaults: UseDefaults.ToOption() + ); +} diff --git a/src/Plotly.NET.CSharp/ChartAPI/Chart2D/StackedBar.cs b/src/Plotly.NET.CSharp/ChartAPI/Chart2D/StackedBar.cs new file mode 100644 index 00000000..f947f254 --- /dev/null +++ b/src/Plotly.NET.CSharp/ChartAPI/Chart2D/StackedBar.cs @@ -0,0 +1,92 @@ +using System; +using System.Collections.Generic; +using Plotly.NET; +using Plotly.NET.LayoutObjects; +using Plotly.NET.TraceObjects; +using static Plotly.NET.StyleParam; + +namespace Plotly.NET.CSharp; + +public static partial class Chart +{ + /// + /// Creates a stacked bar chart, with bars plotted horizontally. Values with the same key are stacked on top of each other in the X dimension. + /// To create this type of chart, combine multiple of these charts via `Chart.combine`. + /// + /// A bar chart is a chart that presents categorical data with rectangular bars with heights or lengths proportional to the values that they represent. + /// + /// Sets the values that are plotted as the size of each bar. + /// Sets the keys associated with each bar. + /// Sets the keys associated with each bar. Use two inner arrays here to plot multicategorial 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. + /// Sets the Opacity of the trace. + /// Sets the Opacity of each individual bar. + /// Sets a text associated with each datum + /// Sets individual text for each datum + /// Sets the color of the bars + /// Sets the colorscale for the bars. To have an effect, `MarkerColor` must map to color scale values. + /// Sets the color of the bar outlines + /// Sets a pattern shape for all bars + /// Sets an individual pattern shape for each bar + /// Sets the marker pattern (use this for more finegrained control than the other pattern-associated arguments). + /// Sets the marker for the bars (use this for more finegrained control than the other marker-associated arguments). + /// Sets where the bar base is drawn (in position axis units). + /// Sets the bar width (in position axis units) of all bars. + /// Sets the individual bar width (in position axis units) for each bar. + /// Sets the position of text associated with each datum + /// Sets the position of text associated with individual datum + /// If set to false, ignore the global default settings set in `Defaults` + public static GenericChart StackedBar( + IEnumerable values, + Optional> Keys = default, + Optional>> MultiKeys = default, + Optional Name = default, + Optional ShowLegend = default, + Optional Opacity = default, + Optional> MultiOpacity = default, + Optional Text = default, + Optional> MultiText = default, + Optional MarkerColor = default, + Optional MarkerColorScale = default, + Optional MarkerOutline = default, + Optional MarkerPatternShape = default, + Optional> MultiMarkerPatternShape = default, + Optional MarkerPattern = default, + Optional Marker = default, + Optional TextPosition = default, + Optional> MultiTextPosition = default, + Optional> MultiWidth = default, + Optional UseDefaults = default, + Optional Base = default, + Optional Width = default + ) + where ValuesType : IConvertible + where KeysType : IConvertible + where TextType : IConvertible + => + Plotly.NET.Chart2D_Bar.Chart.StackedBar( + values: values, + Keys: Keys.ToOption(), + MultiKeys: MultiKeys.ToOption(), + Name: Name.ToOption(), + ShowLegend: ShowLegend.ToOption(), + Opacity: Opacity.ToOption(), + MultiOpacity: MultiOpacity.ToOption(), + Text: Text.ToOption(), + MultiText: MultiText.ToOption(), + MarkerColor: MarkerColor.ToOption(), + MarkerColorScale: MarkerColorScale.ToOption(), + MarkerOutline: MarkerOutline.ToOption(), + MarkerPatternShape: MarkerPatternShape.ToOption(), + MultiMarkerPatternShape: MultiMarkerPatternShape.ToOption(), + MarkerPattern: MarkerPattern.ToOption(), + Marker: Marker.ToOption(), + Base: Base.ToOption(), + Width: Width.ToOption(), + MultiWidth: MultiWidth.ToOption(), + TextPosition: TextPosition.ToOption(), + MultiTextPosition: MultiTextPosition.ToOption(), + UseDefaults: UseDefaults.ToOption() + ); +} diff --git a/src/Plotly.NET.CSharp/ChartAPI/Chart2D/StackedColumn.cs b/src/Plotly.NET.CSharp/ChartAPI/Chart2D/StackedColumn.cs new file mode 100644 index 00000000..49be4f91 --- /dev/null +++ b/src/Plotly.NET.CSharp/ChartAPI/Chart2D/StackedColumn.cs @@ -0,0 +1,92 @@ +using System; +using System.Collections.Generic; +using Plotly.NET; +using Plotly.NET.LayoutObjects; +using Plotly.NET.TraceObjects; +using static Plotly.NET.StyleParam; + +namespace Plotly.NET.CSharp; + +public static partial class Chart +{ + /// + /// Creates a stacked column chart, with bars plotted vertically. Values with the same key are stacked on top of each other in the Y dimension. + /// To create this type of chart, combine multiple of these charts via `Chart.combine`. + /// + /// A bar chart is a chart that presents categorical data with rectangular bars with heights or lengths proportional to the values that they represent. + /// + /// Sets the values that are plotted as the size of each bar. + /// Sets the keys associated with each bar. + /// Sets the keys associated with each bar. Use two inner arrays here to plot multicategorial 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. + /// Sets the Opacity of the trace. + /// Sets the Opacity of each individual bar. + /// Sets a text associated with each datum + /// Sets individual text for each datum + /// Sets the color of the bars + /// Sets the colorscale for the bars. To have an effect, `MarkerColor` must map to color scale values. + /// Sets the color of the bar outlines + /// Sets a pattern shape for all bars + /// Sets an individual pattern shape for each bar + /// Sets the marker pattern (use this for more finegrained control than the other pattern-associated arguments). + /// Sets the marker for the bars (use this for more finegrained control than the other marker-associated arguments). + /// Sets where the bar base is drawn (in position axis units). + /// Sets the bar width (in position axis units) of all bars. + /// Sets the individual bar width (in position axis units) for each bar. + /// Sets the position of text associated with each datum + /// Sets the position of text associated with individual datum + /// If set to false, ignore the global default settings set in `Defaults` + public static GenericChart StackedColumn( + IEnumerable values, + Optional> Keys = default, + Optional>> MultiKeys = default, + Optional Name = default, + Optional ShowLegend = default, + Optional Opacity = default, + Optional> MultiOpacity = default, + Optional Text = default, + Optional> MultiText = default, + Optional MarkerColor = default, + Optional MarkerColorScale = default, + Optional MarkerOutline = default, + Optional MarkerPatternShape = default, + Optional> MultiMarkerPatternShape = default, + Optional MarkerPattern = default, + Optional Marker = default, + Optional TextPosition = default, + Optional> MultiTextPosition = default, + Optional> MultiWidth = default, + Optional UseDefaults = default, + Optional Base = default, + Optional Width = default + ) + where ValuesType : IConvertible + where KeysType : IConvertible + where TextType : IConvertible + => + Plotly.NET.Chart2D_Bar.Chart.StackedColumn( + values: values, + Keys: Keys.ToOption(), + MultiKeys: MultiKeys.ToOption(), + Name: Name.ToOption(), + ShowLegend: ShowLegend.ToOption(), + Opacity: Opacity.ToOption(), + MultiOpacity: MultiOpacity.ToOption(), + Text: Text.ToOption(), + MultiText: MultiText.ToOption(), + MarkerColor: MarkerColor.ToOption(), + MarkerColorScale: MarkerColorScale.ToOption(), + MarkerOutline: MarkerOutline.ToOption(), + MarkerPatternShape: MarkerPatternShape.ToOption(), + MultiMarkerPatternShape: MultiMarkerPatternShape.ToOption(), + MarkerPattern: MarkerPattern.ToOption(), + Marker: Marker.ToOption(), + Base: Base.ToOption(), + Width: Width.ToOption(), + MultiWidth: MultiWidth.ToOption(), + TextPosition: TextPosition.ToOption(), + MultiTextPosition: MultiTextPosition.ToOption(), + UseDefaults: UseDefaults.ToOption() + ); +} diff --git a/src/Plotly.NET.CSharp/ChartAPI/Chart2D/StackedFunnel.cs b/src/Plotly.NET.CSharp/ChartAPI/Chart2D/StackedFunnel.cs new file mode 100644 index 00000000..162e0ffe --- /dev/null +++ b/src/Plotly.NET.CSharp/ChartAPI/Chart2D/StackedFunnel.cs @@ -0,0 +1,104 @@ +using System; +using System.Collections.Generic; +using Plotly.NET; +using Plotly.NET.LayoutObjects; +using Plotly.NET.TraceObjects; +using static Plotly.NET.StyleParam; + +namespace Plotly.NET.CSharp; + +public static partial class Chart +{ + /// + /// Creates a stacked Funnel chart, a variation of the funnel chart where multiple funnel bars of each stage are stacked on top of each other. + /// To create this type of chart, combine multiple of these charts via `Chart.combine`. + /// + /// Funnel charts visualize stages in a process using length-encoded bars. This trace can be used to show data in either a part-to-whole representation wherein each item appears in a single stage, or in a "drop-off" representation wherein each item appears in each stage it traversed. See also the "funnelarea" trace type for a different approach to visualizing funnel data. + /// + /// 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. + /// Sets the Opacity of the trace. + /// Sets the bar width (in position axis units). + /// Shifts the position where the bar is drawn (in position axis units). In "group" barmode, traces that set "offset" will be excluded and drawn in "overlay" mode instead. + /// Sets a text associated with each datum + /// Sets individual text for each datum + /// Sets the position of text associated with each datum + /// Sets the position of text associated with individual datum + /// Only relevant when `stackgroup` is used, and only the first `orientation` found in the `stackgroup` will be used - including if `visible` is "legendonly" but not if it is `false`. Sets the stacking direction. With "v" ("h"), the y (x) values of subsequent traces are added. Also affects the default value of `fill`. + /// Set several traces linked to the same position axis or matching axes to the same alignmentgroup. This controls whether bars compute their positional range dependently or independently. + /// Set several traces linked to the same position axis or matching axes to the same offsetgroup where bars of the same position coordinate will line up. + /// Sets the color of the bars. + /// Sets the color of the bar outline. + /// Sets the marker (use this for more finegrained control than the other marker-associated arguments) + /// Determines which trace information appear on the graph. In the case of having multiple funnels, percentages and totals are computed separately (per trace). + /// Sets the line color of the funnel connector + /// Sets the line style of the funnel connector + /// Sets the fill color of the funnel connector + /// Sets the line of the funnel connector (use this for more finegrained control than the other connector line associated arguments). + /// Sets the funnel connector (use this for more finegrained control than the other connector-associated arguments). + /// Sets the font used for `text` lying inside the bar. + /// Sets the font used for `text` lying outside the bar. + /// If set to false, ignore the global default settings set in `Defaults` + public static GenericChart StackedFunnel( + IEnumerable x, + IEnumerable y, + Optional Name = default, + Optional ShowLegend = default, + Optional Opacity = default, + Optional Width = default, + Optional Offset = default, + Optional Text = default, + Optional> MultiText = default, + Optional TextPosition = default, + Optional> MultiTextPosition = default, + Optional Orientation = default, + Optional AlignmentGroup = default, + Optional OffsetGroup = default, + Optional MarkerColor = default, + Optional MarkerOutline = default, + Optional Marker = default, + Optional TextInfo = default, + Optional ConnectorLineColor = default, + Optional ConnectorLineStyle = default, + Optional ConnectorFillColor = default, + Optional ConnectorLine = default, + Optional Connector = default, + Optional InsideTextFont = default, + Optional OutsideTextFont = default, + Optional UseDefaults = default + ) + where XType : IConvertible + where YType : IConvertible + where TextType : IConvertible + => + Plotly.NET.Chart2D_Funnel.Chart.StackedFunnel( + x: x, + y: y, + Name: Name.ToOption(), + ShowLegend: ShowLegend.ToOption(), + Opacity: Opacity.ToOption(), + Width: Width.ToOption(), + Offset: Offset.ToOption(), + Text: Text.ToOption(), + MultiText: MultiText.ToOption(), + TextPosition: TextPosition.ToOption(), + MultiTextPosition: MultiTextPosition.ToOption(), + Orientation: Orientation.ToOption(), + AlignmentGroup: AlignmentGroup.ToOption(), + OffsetGroup: OffsetGroup.ToOption(), + MarkerColor: MarkerColor.ToOption(), + MarkerOutline: MarkerOutline.ToOption(), + Marker: Marker.ToOption(), + TextInfo: TextInfo.ToOption(), + ConnectorLineColor: ConnectorLineColor.ToOption(), + ConnectorLineStyle: ConnectorLineStyle.ToOption(), + ConnectorFillColor: ConnectorFillColor.ToOption(), + ConnectorLine: ConnectorLine.ToOption(), + Connector: Connector.ToOption(), + InsideTextFont: InsideTextFont.ToOption(), + OutsideTextFont: OutsideTextFont.ToOption(), + UseDefaults: UseDefaults.ToOption() + ); +} diff --git a/src/Plotly.NET.CSharp/ChartAPI/Chart2D/Violin.cs b/src/Plotly.NET.CSharp/ChartAPI/Chart2D/Violin.cs new file mode 100644 index 00000000..2b01f0ad --- /dev/null +++ b/src/Plotly.NET.CSharp/ChartAPI/Chart2D/Violin.cs @@ -0,0 +1,129 @@ +using System; +using System.Collections.Generic; +using Plotly.NET; +using Plotly.NET.LayoutObjects; +using Plotly.NET.TraceObjects; +using static Plotly.NET.StyleParam; + +namespace Plotly.NET.CSharp; + +public static partial class Chart +{ + /// + /// Visualizes the distribution of the input data as a violin plot. + /// + /// A violin plot is a method of plotting numeric data. It is similar to a box plot, except that they also show the probability density of the data at different values, usually smoothed by a kernel density estimator. + /// + /// In vertical (horizontal) violin plots, statistics are computed using `y` (`x`) values. By supplying an `x` (`y`) array, one violin per distinct x (y) value is drawn If no `x` (`y`) array is provided, a single violin is drawn. That violin position is then positioned with with `name` or with `x0` (`y0`) if provided. + /// + /// Sets the x sample data or coordinates + /// Sets the x sample data or coordinates. Use two inner arrays here to plot multicategorial data + /// Sets the y sample data or coordinates + /// Sets the y sample data or coordinates. Use two inner arrays here to plot multicategorial 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. + /// Sets a text associated with each datum + /// Sets individual text for each datum + /// Sets the fill color. Defaults to a half-transparent variant of the line color, marker color, or marker line color, whichever is available. + /// Sets the Opacity otf the trace. + /// If "outliers", only the sample points lying outside the whiskers are shown If "suspectedoutliers", the outlier points are shown and points either less than 4"Q1-3"Q3 or greater than 4"Q3-3"Q1 are highlighted (see `outliercolor`) If "all", all sample points are shown If "false", only the violins are shown with no sample points. Defaults to "suspectedoutliers" when `marker.outliercolor` or `marker.line.outliercolor` is set, otherwise defaults to "outliers". + /// Sets the amount of jitter in the sample points drawn. If "0", the sample points align along the distribution axis. If "1", the sample points are drawn in a random jitter of width equal to the width of the box(es). + /// Sets the position of the sample points in relation to the box(es). If "0", the sample points are places over the center of the box(es). Positive (negative) values correspond to positions to the right (left) for vertical boxes and above (below) for horizontal boxes + /// Sets the orientation of the violin(s). If "v" ("h"), the distribution is visualized along the vertical (horizontal). + /// Sets the width of the violin in data coordinates. If "0" (default value) the width is automatically selected based on the positions of other violin traces in the same subplot. + /// Sets the marker color. + /// Sets the marker for the violin (use this for more finegrained control than the other marker-associated arguments). + /// Sets the color of the box outline + /// Sets the width of the box outline + /// Sets the box outline (use this for more finegrained control than the other outline-associated arguments). + /// Set several traces linked to the same position axis or matching axes to the same alignmentgroup. This controls whether bars compute their positional range dependently or independently. + /// Set several traces linked to the same position axis or matching axes to the same offsetgroup where bars of the same position coordinate will line up. + /// Whether and how to draw a miniature box plot + /// Sets the width of the miniature box plot + /// Sets the fill color of the miniature box plot + /// Sets the styles of the miniature box plot (use this for more finegrained control than the other box-associated arguments) + /// Sets the bandwidth used to compute the kernel density estimate. By default, the bandwidth is determined by Silverman's rule of thumb. + /// Whether and how to draw the meanline + /// If there are multiple violins that should be sized according to to some metric (see `scalemode`), link them by providing a non-empty group id here shared by every trace in the same group. If a violin's `width` is undefined, `scalegroup` will default to the trace's name. In this case, violins with the same names will be linked together + /// Sets the metric by which the width of each violin is determined."width" means each violin has the same (max) width"count" means the violins are scaled by the number of sample points makingup each violin. + /// Determines on which side of the position value the density function making up one half of a violin is plotted. Useful when comparing two violin traces under "overlay" mode, where one trace has `side` set to "positive" and the other to "negative". + /// Sets the span in data space for which the density function will be computed. Has an effect only when `spanmode` is set to "manual". + /// Sets the method by which the span in data space where the density function will be computed. "soft" means the span goes from the sample's minimum value minus two bandwidths to the sample's maximum value plus two bandwidths. "hard" means the span goes from the sample's minimum to its maximum value. For custom span settings, use mode "manual" and fill in the `span` attribute. + /// If set to false, ignore the global default settings set in `Defaults` + public static GenericChart Violin( + Optional> X = default, + Optional>> MultiX = default, + Optional> Y = default, + Optional>> MultiY = default, + Optional Name = default, + Optional ShowLegend = default, + Optional Text = default, + Optional> MultiText = default, + Optional FillColor = default, + Optional Opacity = default, + Optional Points = default, + Optional Jitter = default, + Optional PointPos = default, + Optional Orientation = default, + Optional Width = default, + Optional MarkerColor = default, + Optional Marker = default, + Optional OutlineColor = default, + Optional OutlineWidth = default, + Optional Outline = default, + Optional AlignmentGroup = default, + Optional OffsetGroup = default, + Optional ShowBox = default, + Optional BoxWidth = default, + Optional BoxFillColor = default, + Optional Box = default, + Optional BandWidth = default, + Optional MeanLine = default, + Optional ScaleGroup = default, + Optional ScaleMode = default, + Optional Side = default, + Optional Span = default, + Optional SpanMode = default, + Optional UseDefaults = default + ) + where XType : IConvertible + where YType : IConvertible + where TextType : IConvertible + => + Plotly.NET.Chart2D_Distribution.Chart.Violin( + X: X.ToOption(), + MultiX: MultiX.ToOption(), + Y: Y.ToOption(), + MultiY: MultiY.ToOption(), + Name: Name.ToOption(), + ShowLegend: ShowLegend.ToOption(), + Text: Text.ToOption(), + MultiText: MultiText.ToOption(), + FillColor: FillColor.ToOption(), + Opacity: Opacity.ToOption(), + Points: Points.ToOption(), + Jitter: Jitter.ToOption(), + PointPos: PointPos.ToOption(), + Orientation: Orientation.ToOption(), + Width: Width.ToOption(), + MarkerColor: MarkerColor.ToOption(), + Marker: Marker.ToOption(), + OutlineColor: OutlineColor.ToOption(), + OutlineWidth: OutlineWidth.ToOption(), + Outline: Outline.ToOption(), + AlignmentGroup: AlignmentGroup.ToOption(), + OffsetGroup: OffsetGroup.ToOption(), + ShowBox: ShowBox.ToOption(), + BoxWidth: BoxWidth.ToOption(), + BoxFillColor: BoxFillColor.ToOption(), + Box: Box.ToOption(), + BandWidth: BandWidth.ToOption(), + MeanLine: MeanLine.ToOption(), + ScaleGroup: ScaleGroup.ToOption(), + ScaleMode: ScaleMode.ToOption(), + Side: Side.ToOption(), + Span: Span.ToOption(), + SpanMode: SpanMode.ToOption(), + UseDefaults: UseDefaults.ToOption() + ); +} diff --git a/src/Plotly.NET.CSharp/ChartAPI/Chart2D/Waterfall.cs b/src/Plotly.NET.CSharp/ChartAPI/Chart2D/Waterfall.cs new file mode 100644 index 00000000..4db4201a --- /dev/null +++ b/src/Plotly.NET.CSharp/ChartAPI/Chart2D/Waterfall.cs @@ -0,0 +1,100 @@ +using System; +using System.Collections.Generic; +using Plotly.NET; +using Plotly.NET.LayoutObjects; +using Plotly.NET.TraceObjects; +using static Plotly.NET.StyleParam; + +namespace Plotly.NET.CSharp; + +public static partial class Chart +{ + /// + /// Creates a waterfall chart. + /// + /// Waterfall charts are special bar charts that help visualizing the cumulative effect of sequentially introduced positive or negative values + /// + /// 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. + /// Sets the color of increasing values + /// Sets the style options of increasing values (use this for more finegrained control than the other increasing-associated arguments). + /// Sets the color of decreasing values + /// Sets the style options of decreasing values (use this for more finegrained control than the other increasing-associated arguments). + /// Sets the color of total values + /// Sets the style options of total values (use this for more finegrained control than the other increasing-associated arguments). + /// Sets where the bar base is drawn (in position axis units). + /// Sets the bar width (in position axis units). + /// Sets the individual bar width of each datum (in position axis units). + /// Sets the opacity of the trace. + /// Sets a text associated with each datum + /// Sets individual text for each datum + /// Sets the position of text associated with each datum + /// Sets the position of text associated with individual datum + /// Sets the font used for `text`. + /// Sets the waterfall connector of this trace + /// An array containing types of measures. By default the values are considered as 'relative'. However; it is possible to use 'total' to compute the sums. Also 'absolute' could be applied to reset the computed total or to declare an initial value where needed. + /// Set several traces linked to the same position axis or matching axes to the same alignmentgroup. This controls whether bars compute their positional range dependently or independently. + /// Set several traces linked to the same position axis or matching axes to the same offsetgroup where bars of the same position coordinate will line up. + /// Only relevant when `stackgroup` is used, and only the first `orientation` found in the `stackgroup` will be used - including if `visible` is "legendonly" but not if it is `false`. Sets the stacking direction. With "v" ("h"), the y (x) values of subsequent traces are added. Also affects the default value of `fill`. + /// If set to false, ignore the global default settings set in `Defaults` + public static GenericChart Waterfall( + IEnumerable x, + IEnumerable y, + Optional Name = default, + Optional ShowLegend = default, + Optional IncreasingColor = default, + Optional Increasing = default, + Optional DecreasingColor = default, + Optional Decreasing = default, + Optional TotalsColor = default, + Optional Totals = default, + Optional Base = default, + Optional Width = default, + Optional> MultiWidth = default, + Optional Opacity = default, + Optional Text = default, + Optional> MultiText = default, + Optional TextPosition = default, + Optional> MultiTextPosition = default, + Optional TextFont = default, + Optional Connector = default, + Optional> Measure = default, + Optional AlignmentGroup = default, + Optional OffsetGroup = default, + Optional Orientation = default, + Optional UseDefaults = default + ) + where XType : IConvertible + where YType : IConvertible + where TextType : IConvertible + => + Plotly.NET.Chart2D_Funnel.Chart.Waterfall( + x: x, + y: y, + Name: Name.ToOption(), + ShowLegend: ShowLegend.ToOption(), + IncreasingColor: IncreasingColor.ToOption(), + Increasing: Increasing.ToOption(), + DecreasingColor: DecreasingColor.ToOption(), + Decreasing: Decreasing.ToOption(), + TotalsColor: TotalsColor.ToOption(), + Totals: Totals.ToOption(), + Base: Base.ToOption(), + Width: Width.ToOption(), + MultiWidth: MultiWidth.ToOption(), + Opacity: Opacity.ToOption(), + Text: Text.ToOption(), + MultiText: MultiText.ToOption(), + TextPosition: TextPosition.ToOption(), + MultiTextPosition: MultiTextPosition.ToOption(), + TextFont: TextFont.ToOption(), + Connector: Connector.ToOption(), + Measure: Measure.ToOption(), + AlignmentGroup: AlignmentGroup.ToOption(), + OffsetGroup: OffsetGroup.ToOption(), + Orientation: Orientation.ToOption(), + UseDefaults: UseDefaults.ToOption() + ); +} diff --git a/src/Plotly.NET.CSharp/ChartAPI/Chart3D.cs b/src/Plotly.NET.CSharp/ChartAPI/Chart3D.cs deleted file mode 100644 index a5b78bd4..00000000 --- a/src/Plotly.NET.CSharp/ChartAPI/Chart3D.cs +++ /dev/null @@ -1,850 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Plotly.NET; -using Plotly.NET.LayoutObjects; -using Plotly.NET.TraceObjects; -using System.Runtime.InteropServices; -using static Plotly.NET.StyleParam; - - -namespace Plotly.NET.CSharp -{ - public static partial class Chart - { - /// - /// Creates a Scatter3D plot. - /// - /// In general, Scatter3D Plots plot three-dimensional data on 3 cartesian position scales in the X, Y, and Z dimension. - /// - /// Scatter3D charts are the basis of Point3D, Line3D, and Bubble3D Charts, and can be customized as such. We also provide abstractions for those: Chart.Line3D, Chart.Point3D, Chart.Bubble3D - /// - /// Sets the x coordinates of the plotted data. - /// Sets the y coordinates of the plotted data. - /// Sets the z 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. - /// Sets the opactity of the trace - /// Sets the opactity of individual datum markers - /// Sets a text associated with each datum - /// Sets individual text for each datum - /// Sets the position of text associated with each datum - /// Sets the position of text associated with individual datum - /// Sets the color of the marker - /// Sets the colorscale of the marker - /// Sets the outline of the marker - /// Sets the marker symbol for each datum - /// Sets the marker symbol for each individual datum - /// Sets the marker (use this for more finegrained control than the other marker-associated arguments) - /// Sets the color of the line - /// Sets the colorscale of the line - /// Sets the width of the line - /// sets the drawing style of the line - /// Sets the line (use this for more finegrained control than the other line-associated arguments) - /// Sets the camera projection type of this trace. - /// Sets the camera of this trace. - /// Sets the projection of this trace. - /// If set to false, ignore the global default settings set in `Defaults` - public static GenericChart Scatter3D( - IEnumerable x, - IEnumerable y, - IEnumerable z, - StyleParam.Mode mode, - Optional Name = default, - Optional ShowLegend = default, - Optional Opacity = default, - Optional> MultiOpacity = default, - Optional Text = default, - Optional> MultiText = default, - Optional TextPosition = default, - Optional> MultiTextPosition = default, - Optional MarkerColor = default, - Optional MarkerColorScale = default, - Optional MarkerOutline = default, - Optional MarkerSymbol = default, - Optional> MultiMarkerSymbol = default, - Optional Marker = default, - Optional LineColor = default, - Optional LineColorScale = default, - Optional LineWidth = default, - Optional LineDash = default, - Optional Line = default, - Optional CameraProjectionType = default , - Optional Camera = default, - Optional Projection = default, - Optional UseDefaults = default - ) - where XType: IConvertible - where YType: IConvertible - where ZType : IConvertible - where TextType : IConvertible - - => Plotly.NET.Chart3D_Scatter.Chart.Scatter3D( - x: x, - y: y, - z: z, - mode: mode, - Name: Name.ToOption(), - ShowLegend: ShowLegend.ToOption(), - Opacity: Opacity.ToOption(), - MultiOpacity: MultiOpacity.ToOption(), - Text: Text.ToOption(), - MultiText: MultiText.ToOption(), - TextPosition: TextPosition.ToOption(), - MultiTextPosition: MultiTextPosition.ToOption(), - MarkerColor: MarkerColor.ToOption(), - MarkerColorScale: MarkerColorScale.ToOption(), - MarkerOutline: MarkerOutline.ToOption(), - MarkerSymbol: MarkerSymbol.ToOption(), - MultiMarkerSymbol: MultiMarkerSymbol.ToOption(), - Marker: Marker.ToOption(), - LineColor: LineColor.ToOption(), - LineColorScale: LineColorScale.ToOption(), - LineWidth: LineWidth.ToOption(), - LineDash: LineDash.ToOption(), - Line: Line.ToOption(), - Projection: Projection.ToOption(), - CameraProjectionType: CameraProjectionType.ToOption(), - Camera: Camera.ToOption(), - UseDefaults: UseDefaults.ToOption() - ); - - /// - /// Creates a Point3D plot. - /// - /// Point3D Plots plot three-dimensional data on 3 cartesian position scales in the X, Y, and Z dimension as points. - /// - /// Sets the x coordinates of the plotted data. - /// Sets the y coordinates of the plotted data. - /// Sets the z 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. - /// Sets the opactity of the trace - /// Sets the opactity of individual datum markers - /// Sets a text associated with each datum - /// Sets individual text for each datum - /// Sets the position of text associated with each datum - /// Sets the position of text associated with individual datum - /// Sets the color of the marker - /// Sets the colorscale of the marker - /// Sets the outline of the marker - /// Sets the marker symbol for each datum - /// Sets the marker symbol for each individual datum - /// Sets the marker (use this for more finegrained control than the other marker-associated arguments) - /// Sets the camera projection type of this trace. - /// Sets the camera of this trace. - /// Sets the projection of this trace. - /// If set to false, ignore the global default settings set in `Defaults` - public static GenericChart Point3D( - IEnumerable x, - IEnumerable y, - IEnumerable z, - Optional Name = default, - Optional ShowLegend = default, - Optional Opacity = default, - Optional> MultiOpacity = default, - Optional Text = default, - Optional> MultiText = default, - Optional TextPosition = default, - Optional> MultiTextPosition = default, - Optional MarkerColor = default, - Optional MarkerColorScale = default, - Optional MarkerOutline = default, - Optional MarkerSymbol = default, - Optional> MultiMarkerSymbol = default, - Optional Marker = default, - Optional CameraProjectionType = default, - Optional Camera = default, - Optional Projection = default, - Optional UseDefaults = default - ) - where XType : IConvertible - where YType : IConvertible - where ZType : IConvertible - where TextType : IConvertible - - => Plotly.NET.Chart3D_Scatter.Chart.Point3D( - x: x, - y: y, - z: z, - Name: Name.ToOption(), - ShowLegend: ShowLegend.ToOption(), - Opacity: Opacity.ToOption(), - MultiOpacity: MultiOpacity.ToOption(), - Text: Text.ToOption(), - MultiText: MultiText.ToOption(), - TextPosition: TextPosition.ToOption(), - MultiTextPosition: MultiTextPosition.ToOption(), - MarkerColor: MarkerColor.ToOption(), - MarkerColorScale: MarkerColorScale.ToOption(), - MarkerOutline: MarkerOutline.ToOption(), - MarkerSymbol: MarkerSymbol.ToOption(), - MultiMarkerSymbol: MultiMarkerSymbol.ToOption(), - Marker: Marker.ToOption(), - CameraProjectionType: CameraProjectionType.ToOption(), - Camera: Camera.ToOption(), - Projection: Projection.ToOption(), - UseDefaults: UseDefaults.ToOption() - ); - - /// - /// Creates a Line3D plot. - /// - /// Line3D Plots plot three-dimensional data on 3 cartesian position scales in the X, Y, and Z dimension as a line connecting the individual datums. - /// - /// Sets the x coordinates of the plotted data. - /// Sets the y coordinates of the plotted data. - /// Sets the z coordinates of the plotted data. - /// Whether to show markers for the datums additionally to the line - /// 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. - /// Sets the opactity of the trace - /// Sets the opactity of individual datum markers - /// Sets a text associated with each datum - /// Sets individual text for each datum - /// Sets the position of text associated with each datum - /// Sets the position of text associated with individual datum - /// Sets the color of the marker - /// Sets the colorscale of the marker - /// Sets the outline of the marker - /// Sets the marker symbol for each datum - /// Sets the marker symbol for each individual datum - /// Sets the marker (use this for more finegrained control than the other marker-associated arguments) - /// Sets the color of the line - /// Sets the colorscale of the line - /// Sets the width of the line - /// sets the drawing style of the line - /// Sets the line (use this for more finegrained control than the other line-associated arguments) - /// Sets the camera projection type of this trace. - /// Sets the camera of this trace. - /// Sets the projection of this trace. - /// If set to false, ignore the global default settings set in `Defaults` - public static GenericChart Line3D( - IEnumerable x, - IEnumerable y, - IEnumerable z, - Optional ShowMarkers = default, - Optional Name = default, - Optional ShowLegend = default, - Optional Opacity = default, - Optional> MultiOpacity = default, - Optional Text = default, - Optional> MultiText = default, - Optional TextPosition = default, - Optional> MultiTextPosition = default, - Optional MarkerColor = default, - Optional MarkerColorScale = default, - Optional MarkerOutline = default, - Optional MarkerSymbol = default, - Optional> MultiMarkerSymbol = default, - Optional Marker = default, - Optional LineColor = default, - Optional LineColorScale = default, - Optional LineWidth = default, - Optional LineDash = default, - Optional Line = default, - Optional CameraProjectionType = default, - Optional Camera = default, - Optional Projection = default, - Optional UseDefaults = default - ) - where XType : IConvertible - where YType : IConvertible - where ZType : IConvertible - where TextType : IConvertible - - => Plotly.NET.Chart3D_Scatter.Chart.Line3D( - x: x, - y: y, - z: z, - ShowMarkers: ShowMarkers.ToOption(), - Name: Name.ToOption(), - ShowLegend: ShowLegend.ToOption(), - Opacity: Opacity.ToOption(), - MultiOpacity: MultiOpacity.ToOption(), - Text: Text.ToOption(), - MultiText: MultiText.ToOption(), - TextPosition: TextPosition.ToOption(), - MultiTextPosition: MultiTextPosition.ToOption(), - MarkerColor: MarkerColor.ToOption(), - MarkerColorScale: MarkerColorScale.ToOption(), - MarkerOutline: MarkerOutline.ToOption(), - MarkerSymbol: MarkerSymbol.ToOption(), - MultiMarkerSymbol: MultiMarkerSymbol.ToOption(), - Marker: Marker.ToOption(), - LineColor: LineColor.ToOption(), - LineColorScale: LineColorScale.ToOption(), - LineWidth: LineWidth.ToOption(), - LineDash: LineDash.ToOption(), - Line: Line.ToOption(), - CameraProjectionType: CameraProjectionType.ToOption(), - Camera: Camera.ToOption(), - Projection: Projection.ToOption(), - UseDefaults: UseDefaults.ToOption() - ); - - /// - /// Creates a Bubble3D plot. - /// - /// Bubble3D Plots plot three-dimensional data on 3 cartesian position scales in the X, Y, and Z dimension as points, additionally using the points size as a 4th dimension. - /// - /// Sets the x coordinates of the plotted data. - /// Sets the y coordinates of the plotted data. - /// Sets the z coordinates of the plotted data. - /// Sets the size of the points - /// 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. - /// Sets the opactity of the trace - /// Sets the opactity of individual datum markers - /// Sets a text associated with each datum - /// Sets individual text for each datum - /// Sets the position of text associated with each datum - /// Sets the position of text associated with individual datum - /// Sets the color of the marker - /// Sets the colorscale of the marker - /// Sets the outline of the marker - /// Sets the marker symbol for each datum - /// Sets the marker symbol for each individual datum - /// Sets the marker (use this for more finegrained control than the other marker-associated arguments) - /// Sets the camera projection type of this trace. - /// Sets the camera of this trace. - /// Sets the projection of this trace. - /// If set to false, ignore the global default settings set in `Defaults` - public static GenericChart Bubble3D( - IEnumerable x, - IEnumerable y, - IEnumerable z, - IEnumerable sizes, - Optional Name = default, - Optional ShowLegend = default, - Optional Opacity = default, - Optional> MultiOpacity = default, - Optional Text = default, - Optional> MultiText = default, - Optional TextPosition = default, - Optional> MultiTextPosition = default, - Optional MarkerColor = default, - Optional MarkerColorScale = default, - Optional MarkerOutline = default, - Optional MarkerSymbol = default, - Optional> MultiMarkerSymbol = default, - Optional Marker = default, - Optional CameraProjectionType = default, - Optional Camera = default, - Optional Projection = default, - Optional UseDefaults = default - ) - where XType : IConvertible - where YType : IConvertible - where ZType : IConvertible - where TextType : IConvertible - - => Plotly.NET.Chart3D_Scatter.Chart.Bubble3D( - x: x, - y: y, - z: z, - sizes: sizes, - Name: Name.ToOption(), - ShowLegend: ShowLegend.ToOption(), - Opacity: Opacity.ToOption(), - MultiOpacity: MultiOpacity.ToOption(), - Text: Text.ToOption(), - MultiText: MultiText.ToOption(), - TextPosition: TextPosition.ToOption(), - MultiTextPosition: MultiTextPosition.ToOption(), - MarkerColor: MarkerColor.ToOption(), - MarkerColorScale: MarkerColorScale.ToOption(), - MarkerOutline: MarkerOutline.ToOption(), - MarkerSymbol: MarkerSymbol.ToOption(), - MultiMarkerSymbol: MultiMarkerSymbol.ToOption(), - Marker: Marker.ToOption(), - CameraProjectionType: CameraProjectionType.ToOption(), - Camera: Camera.ToOption(), - Projection: Projection.ToOption(), - UseDefaults: UseDefaults.ToOption() - ); - - /// - /// Creates a surface plot. - /// - /// Surface plots plot a z value as a function of x and y, creating a three-dimensional surface. - /// - /// The data the describes the coordinates of the surface is set in `z`. Data in `z` should be a 2D array. - /// Coordinates in `x` and `y` can either be 1D arrays or 2D arrays (e.g. to graph parametric surfaces). If not provided in `x` and `y`, the x and y coordinates are assumed to be linear starting at 0 with a unit step. - /// The color scale corresponds to the `z` values by default. For custom color scales, use `surfacecolor` which should be a 2D array, where its bounds can be controlled using `cmin` and `cmax`. - /// - /// Two-dimensional data array representing the surface's z values - /// Sets the x coordinates. - /// Sets the y coordinates. - /// 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. - /// Sets the opactity of the trace - /// Sets a text associated with each datum - /// Sets individual text for each datum - /// Sets the contours on the surface - /// Sets the colorscale of the surface - /// Whether or not to show the colorbar/colorscale - /// Sets the camera projection type of this trace. - /// Sets the camera of this trace. - /// If set to false, ignore the global default settings set in `Defaults` - public static GenericChart Surface( - IEnumerable> zData, - Optional> X = default, - Optional> Y = default, - Optional Name = default, - Optional ShowLegend = default, - Optional Opacity = default, - Optional Text = default, - Optional> MultiText = default, - Optional Contours = default, - Optional ColorScale = default, - Optional CameraProjectionType = default, - Optional Camera = default, - Optional ShowScale = default, - - Optional UseDefaults = default - ) - where ZType : IConvertible - where XType : IConvertible - where YType : IConvertible - where TextType : IConvertible - => - Plotly.NET.Chart3D_Surface.Chart.Surface, ZType, XType, YType, TextType>( - zData: zData, - X: X.ToOption(), - Y: Y.ToOption(), - Name: Name.ToOption(), - ShowLegend: ShowLegend.ToOption(), - Opacity: Opacity.ToOption(), - Text: Text.ToOption(), - MultiText: MultiText.ToOption(), - Contours: Contours.ToOption(), - ColorScale: ColorScale.ToOption(), - ShowScale: ShowScale.ToOption(), - CameraProjectionType: CameraProjectionType.ToOption(), - Camera: Camera.ToOption(), - UseDefaults: UseDefaults.ToOption() - ); - - /// - /// Visualizes a 3D mesh. - /// - /// Draws sets of triangles with coordinates given by three 1-dimensional arrays in `x`, `y`, `z` and - /// - /// (1) a sets of `i`, `j`, `k` indices or - /// - /// (2) Delaunay triangulation or - /// - /// (3) the Alpha-shape algorithm or - /// - /// (4) the Convex-hull algorithm - /// - /// Sets the X coordinates of the vertices. The nth element of vectors `x`, `y` and `z` jointly represent the X, Y and Z coordinates of the nth vertex. - /// Sets the Y coordinates of the vertices. The nth element of vectors `x`, `y` and `z` jointly represent the X, Y and Z coordinates of the nth vertex. - /// Sets the Z coordinates of the vertices. The nth element of vectors `x`, `y` and `z` jointly represent the X, Y and Z coordinates of the nth vertex. - /// A vector of vertex indices, i.e. integer values between 0 and the length of the vertex vectors, representing the "first" vertex of a triangle. For example, `{i[m], j[m], k[m]}` together represent face m (triangle m) in the mesh, where `i[m] = n` points to the triplet `{x[n], y[n], z[n]}` in the vertex arrays. Therefore, each element in `i` represents a point in space, which is the first vertex of a triangle. - /// A vector of vertex indices, i.e. integer values between 0 and the length of the vertex vectors, representing the "second" vertex of a triangle. For example, `{i[m], j[m], k[m]}` together represent face m (triangle m) in the mesh, where `j[m] = n` points to the triplet `{x[n], y[n], z[n]}` in the vertex arrays. Therefore, each element in `j` represents a point in space, which is the second vertex of a triangle. - /// A vector of vertex indices, i.e. integer values between 0 and the length of the vertex vectors, representing the "third" vertex of a triangle. For example, `{i[m], j[m], k[m]}` together represent face m (triangle m) in the mesh, where `k[m] = n` points to the triplet `{x[n], y[n], z[n]}` in the vertex arrays. Therefore, each element in `k` represents a point in space, which is the third vertex of a triangle. - /// 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. - /// Sets the opactity of the trace - /// Sets a text associated with each datum - /// Sets individual text for each datum - /// Sets the color of the whole mesh - /// Sets the style and visibility of contours - /// Sets the colorscale - /// Whether or not to show the colorbar/colorscale - /// Sets the colorbar - /// Determines whether or not normal smoothing is applied to the meshes, creating meshes with an angular, low-poly look via flat reflections. - /// Determines how the mesh surface triangles are derived from the set of vertices (points) represented by the `x`, `y` and `z` arrays, if the `i`, `j`, `k` arrays are not supplied. - /// Sets the camera projection type of this trace. - /// Sets the camera of this trace. - /// If set to false, ignore the global default settings set in `Defaults` - public static GenericChart Mesh3D( - IEnumerable x, - IEnumerable y, - IEnumerable z, - Optional> I = default, - Optional> J = default, - Optional> K = default, - Optional Name = default, - Optional ShowLegend = default, - Optional Opacity = default, - Optional Text = default, - Optional> MultiText = default, - Optional Color = default, - Optional Contour = default, - Optional ColorScale = default, - Optional ShowScale = default, - Optional ColorBar = default, - Optional FlatShading = default, - Optional TriangulationAlgorithm = default, - Optional CameraProjectionType = default, - Optional Camera = default, - Optional UseDefaults = default - ) - where XType : IConvertible - where YType : IConvertible - where ZType : IConvertible - where IType : IConvertible - where JType : IConvertible - where KType : IConvertible - where TextType : IConvertible - => - Plotly.NET.Chart3D_Surface.Chart.Mesh3D( - x: x, - y: y, - z: z, - I: I.ToOption(), - J: J.ToOption(), - K: K.ToOption(), - Name: Name.ToOption(), - ShowLegend: ShowLegend.ToOption(), - Opacity: Opacity.ToOption(), - Text: Text.ToOption(), - MultiText: MultiText.ToOption(), - Color: Color.ToOption(), - Contour: Contour.ToOption(), - ColorScale: ColorScale.ToOption(), - ShowScale: ShowScale.ToOption(), - ColorBar: ColorBar.ToOption(), - FlatShading: FlatShading.ToOption(), - TriangulationAlgorithm: TriangulationAlgorithm.ToOption(), - CameraProjectionType: CameraProjectionType.ToOption(), - Camera: Camera.ToOption(), - UseDefaults: UseDefaults.ToOption() - ); - - /// - /// Creates a cone plot, typically used to visualize vector fields. - /// - /// Specify a vector field using 6 1D arrays: - /// - /// 3 position arrays `x`, `y` and `z` and - /// - /// 3 vector component arrays `u`, `v`, `w`. - /// - /// The cones are drawn exactly at the positions given by `x`, `y` and `z`. - /// - /// Sets the x coordinates of the vector field and of the displayed cones. - /// Sets the y coordinates of the vector field and of the displayed cones. - /// Sets the z coordinates of the vector field and of the displayed cones. - /// Sets the x components of the vector field. - /// Sets the y components of the vector field. - /// Sets the z components of the vector field. - /// 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. - /// Sets the opactity of the trace - /// Sets a text associated with each datum - /// Sets individual text for each datum - /// Sets the colorscale - /// Whether or not to show the colorbar/colorscale - /// Sets the colorbar - /// Determines whether `sizeref` is set as a "scaled" (i.e unitless) scalar (normalized by the max u/v/w norm in the vector field) or as "absolute" value (in the same units as the vector field). - /// Sets the cones' anchor with respect to their x/y/z positions. Note that "cm" denote the cone's center of mass which corresponds to 1/4 from the tail to tip. - /// Sets the camera projection type of this trace. - /// Sets the camera of this trace. - /// If set to false, ignore the global default settings set in `Defaults` - public static GenericChart Cone( - IEnumerable x, - IEnumerable y, - IEnumerable z, - IEnumerable u, - IEnumerable v, - IEnumerable w, - Optional Name = default, - Optional ShowLegend = default, - Optional Opacity = default, - Optional Text = default, - Optional> MultiText = default, - Optional ColorScale = default, - Optional ShowScale = default, - Optional ColorBar = default, - Optional SizeMode = default, - Optional ConeAnchor = default, - Optional CameraProjectionType = default, - Optional Camera = default, - Optional UseDefaults = default - ) - where XType : IConvertible - where YType : IConvertible - where ZType : IConvertible - where UType : IConvertible - where VType : IConvertible - where WType : IConvertible - where TextType : IConvertible - => - Plotly.NET.Chart3D_VectorField.Chart.Cone( - x: x, - y: y, - z: z, - u: u, - v: v, - w: w, - Name: Name.ToOption(), - ShowLegend: ShowLegend.ToOption(), - Opacity: Opacity.ToOption(), - Text: Text.ToOption(), - MultiText: MultiText.ToOption(), - ColorScale: ColorScale.ToOption(), - ShowScale: ShowScale.ToOption(), - ColorBar: ColorBar.ToOption(), - SizeMode: SizeMode.ToOption(), - ConeAnchor: ConeAnchor.ToOption(), - CameraProjectionType: CameraProjectionType.ToOption(), - Camera: Camera.ToOption(), - UseDefaults: UseDefaults.ToOption() - ); - - /// - /// Creates a streamtube plot, typically used to visualize flow in a vector field. - /// - /// Specify a vector field using 6 1D arrays of equal length: - /// - /// 3 position arrays `x`, `y` and `z` and - /// - /// 3 vector component arrays `u`, `v`, and `w`. - /// - /// By default, the tubes' starting positions will be cut from the vector field's x-z plane at its minimum y value. - /// To specify your own starting position, use `TubeStarts`. - /// The color is encoded by the norm of (u, v, w), and the local radius by the divergence of (u, v, w). - /// - /// Sets the x coordinates of the vector field and of the displayed cones. - /// Sets the y coordinates of the vector field and of the displayed cones. - /// Sets the z coordinates of the vector field and of the displayed cones. - /// Sets the x components of the vector field. - /// Sets the y components of the vector field. - /// Sets the z components of the vector field. - /// 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. - /// Sets the opactity of the trace - /// Sets a text associated with each datum - /// Sets individual text for each datum - /// Sets the colorscale - /// Whether or not to show the colorbar/colorscale - /// Sets the colorbar - /// The maximum number of displayed segments in a streamtube. - /// Use this object to specify custom tube start positions - /// Sets the camera projection type of this trace. - /// Sets the camera of this trace. - /// If set to false, ignore the global default settings set in `Defaults` - public static GenericChart StreamTube( - IEnumerable x, - IEnumerable y, - IEnumerable z, - IEnumerable u, - IEnumerable v, - IEnumerable w, - Optional Name = default, - Optional ShowLegend = default, - Optional Opacity = default, - Optional Text = default, - Optional> MultiText = default, - Optional ColorScale = default, - Optional ShowScale = default, - Optional ColorBar = default, - Optional MaxDisplayed = default, - Optional TubeStarts = default, - Optional CameraProjectionType = default, - Optional Camera = default, - Optional UseDefaults = default - ) - where XType : IConvertible - where YType : IConvertible - where ZType : IConvertible - where UType : IConvertible - where VType : IConvertible - where WType : IConvertible - where TextType : IConvertible - => - Plotly.NET.Chart3D_VectorField.Chart.StreamTube( - x: x, - y: y, - z: z, - u: u, - v: v, - w: w, - Name: Name.ToOption(), - ShowLegend: ShowLegend.ToOption(), - Opacity: Opacity.ToOption(), - Text: Text.ToOption(), - MultiText: MultiText.ToOption(), - ColorScale: ColorScale.ToOption(), - ShowScale: ShowScale.ToOption(), - ColorBar: ColorBar.ToOption(), - MaxDisplayed: MaxDisplayed.ToOption(), - TubeStarts: TubeStarts.ToOption(), - CameraProjectionType: CameraProjectionType.ToOption(), - Camera: Camera.ToOption(), - UseDefaults: UseDefaults.ToOption() - ); - - /// - /// Creates a volume plot to visualize the volume of a 3D shape. - /// - /// Draws volume trace between iso-min and iso-max values with coordinates given by four 1-dimensional arrays containing the `value`, `x`, `y` and `z` of every vertex of a uniform or non-uniform 3-D grid. - /// Horizontal or vertical slices, caps as well as spaceframe between iso-min and iso-max values could also be drawn using this trace. - /// - /// This plot is very similar to the `IsoSurface` plot. However, whereas isosurface plots show all surfaces with the same opacity, tweaking the opacityscale parameter of Volume plots results in a depth effect and better volume rendering. - /// - /// Sets the X coordinates of the vertices on X axis. - /// Sets the Y coordinates of the vertices on Y axis. - /// Sets the Z coordinates of the vertices on Z axis. - /// Sets the 4th dimension (value) of the vertices. - /// 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. - /// Sets the opactity of the trace - /// Sets a text associated with each datum - /// Sets individual text for each datum - /// Sets the colorscale - /// Whether or not to show the colorbar/colorscale - /// Sets the colorbar - /// Sets the minimum boundary for iso-surface plot. - /// Sets the maximum boundary for iso-surface plot. - /// Sets the caps (color-coded surfaces on the sides of the visualization domain) - /// Adds Slices through the volume - /// Sets the surface. - /// Sets the opacityscale. The opacityscale must be an array containing arrays mapping a normalized value to an opacity value. At minimum, a mapping for the lowest (0) and highest (1) values are required. For example, `[[0, 1], [0.5, 0.2], [1, 1]]` means that higher/lower values would have higher opacity values and those in the middle would be more transparent Alternatively, `opacityscale` may be a palette name string of the following list: 'min', 'max', 'extremes' and 'uniform'. The default is 'uniform'. - /// Sets the camera projection type of this trace. - /// Sets the camera of this trace. - /// If set to false, ignore the global default settings set in `Defaults` - public static GenericChart Volume( - IEnumerable x, - IEnumerable y, - IEnumerable z, - IEnumerable value, - Optional Name = default, - Optional ShowLegend = default, - Optional Opacity = default, - Optional Text = default, - Optional> MultiText = default, - Optional ColorScale = default, - Optional ShowScale = default, - Optional ColorBar = default, - Optional IsoMin = default, - Optional IsoMax = default, - Optional Caps = default, - Optional Slices = default, - Optional Surface = default, - Optional>> OpacityScale = default, - Optional CameraProjectionType = default, - Optional Camera = default, - Optional UseDefaults = default - ) - where XType : IConvertible - where YType : IConvertible - where ZType : IConvertible - where ValueType : IConvertible - where TextType : IConvertible - where OpacityScaleType : IConvertible - => - Plotly.NET.Chart3D_Volume.Chart.Volume, OpacityScaleType>( - x: x, - y: y, - z: z, - value: value, - Name: Name.ToOption(), - ShowLegend: ShowLegend.ToOption(), - Opacity: Opacity.ToOption(), - Text: Text.ToOption(), - MultiText: MultiText.ToOption(), - ColorScale: ColorScale.ToOption(), - ShowScale: ShowScale.ToOption(), - ColorBar: ColorBar.ToOption(), - IsoMin: IsoMin.ToOption(), - IsoMax: IsoMax.ToOption(), - Caps: Caps.ToOption(), - Slices: Slices.ToOption(), - Surface: Surface.ToOption(), - OpacityScale: OpacityScale.ToOption(), - CameraProjectionType: CameraProjectionType.ToOption(), - Camera: Camera.ToOption(), - UseDefaults: UseDefaults.ToOption() - ); - - /// - /// Creates a isosurface plot to visualize the volume of a 3D shape. - /// - /// An isosurface is a surface that represents points of a constant value (e.g. pressure, temperature, velocity, density) within a volume of space. - /// - /// Draws isosurfaces between iso-min and iso-max values with coordinates given by four 1-dimensional arrays containing the `value`, `x`, `y` and `z` of every vertex of a uniform or non-uniform 3-D grid. - /// Horizontal or vertical slices, caps as well as spaceframe between iso-min and iso-max values could also be drawn using this trace. - /// - /// This plot is very similar to the `Volume` plot. However it shows all surfaces with the same opacity. - /// - /// Sets the X coordinates of the vertices on X axis. - /// Sets the Y coordinates of the vertices on Y axis. - /// Sets the Z coordinates of the vertices on Z axis. - /// Sets the 4th dimension (value) of the vertices. - /// 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. - /// Sets the opactity of the trace - /// Sets a text associated with each datum - /// Sets individual text for each datum - /// Sets the colorscale - /// Whether or not to show the colorbar/colorscale - /// Sets the colorbar - /// Sets the minimum boundary for iso-surface plot. - /// Sets the maximum boundary for iso-surface plot. - /// Sets the caps (color-coded surfaces on the sides of the visualization domain) - /// Adds Slices through the volume - /// Sets the surface. - /// Sets the camera projection type of this trace. - /// Sets the camera of this trace. - /// If set to false, ignore the global default settings set in `Defaults` - public static GenericChart IsoSurface( - IEnumerable x, - IEnumerable y, - IEnumerable z, - IEnumerable value, - Optional Name = default, - Optional ShowLegend = default, - Optional Opacity = default, - Optional Text = default, - Optional> MultiText = default, - Optional ColorScale = default, - Optional ShowScale = default, - Optional ColorBar = default, - Optional IsoMin = default, - Optional IsoMax = default, - Optional Caps = default, - Optional Slices = default, - Optional Surface = default, - Optional CameraProjectionType = default, - Optional Camera = default, - Optional UseDefaults = default - ) - where XType : IConvertible - where YType : IConvertible - where ZType : IConvertible - where ValueType : IConvertible - where TextType : IConvertible - => - Plotly.NET.Chart3D_Volume.Chart.IsoSurface( - x: x, - y: y, - z: z, - value: value, - Name: Name.ToOption(), - ShowLegend: ShowLegend.ToOption(), - Opacity: Opacity.ToOption(), - Text: Text.ToOption(), - MultiText: MultiText.ToOption(), - ColorScale: ColorScale.ToOption(), - ShowScale: ShowScale.ToOption(), - ColorBar: ColorBar.ToOption(), - IsoMin: IsoMin.ToOption(), - IsoMax: IsoMax.ToOption(), - Caps: Caps.ToOption(), - Slices: Slices.ToOption(), - Surface: Surface.ToOption(), - CameraProjectionType: CameraProjectionType.ToOption(), - Camera: Camera.ToOption(), - UseDefaults: UseDefaults.ToOption() - ); - } -} - diff --git a/src/Plotly.NET.CSharp/ChartAPI/Chart3D/Bubble3D.cs b/src/Plotly.NET.CSharp/ChartAPI/Chart3D/Bubble3D.cs new file mode 100644 index 00000000..9991c024 --- /dev/null +++ b/src/Plotly.NET.CSharp/ChartAPI/Chart3D/Bubble3D.cs @@ -0,0 +1,92 @@ +using System; +using System.Collections.Generic; +using Plotly.NET; +using Plotly.NET.LayoutObjects; +using Plotly.NET.TraceObjects; +using static Plotly.NET.StyleParam; + +namespace Plotly.NET.CSharp; + +public static partial class Chart +{ + /// + /// Creates a Bubble3D plot. + /// + /// Bubble3D Plots plot three-dimensional data on 3 cartesian position scales in the X, Y, and Z dimension as points, additionally using the points size as a 4th dimension. + /// + /// Sets the x coordinates of the plotted data. + /// Sets the y coordinates of the plotted data. + /// Sets the z coordinates of the plotted data. + /// Sets the size of the points + /// 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. + /// Sets the opactity of the trace + /// Sets the opactity of individual datum markers + /// Sets a text associated with each datum + /// Sets individual text for each datum + /// Sets the position of text associated with each datum + /// Sets the position of text associated with individual datum + /// Sets the color of the marker + /// Sets the colorscale of the marker + /// Sets the outline of the marker + /// Sets the marker symbol for each datum + /// Sets the marker symbol for each individual datum + /// Sets the marker (use this for more finegrained control than the other marker-associated arguments) + /// Sets the camera projection type of this trace. + /// Sets the camera of this trace. + /// Sets the projection of this trace. + /// If set to false, ignore the global default settings set in `Defaults` + public static GenericChart Bubble3D( + IEnumerable x, + IEnumerable y, + IEnumerable z, + IEnumerable sizes, + Optional Name = default, + Optional ShowLegend = default, + Optional Opacity = default, + Optional> MultiOpacity = default, + Optional Text = default, + Optional> MultiText = default, + Optional TextPosition = default, + Optional> MultiTextPosition = default, + Optional MarkerColor = default, + Optional MarkerColorScale = default, + Optional MarkerOutline = default, + Optional MarkerSymbol = default, + Optional> MultiMarkerSymbol = default, + Optional Marker = default, + Optional CameraProjectionType = default, + Optional Camera = default, + Optional Projection = default, + Optional UseDefaults = default + ) + where XType : IConvertible + where YType : IConvertible + where ZType : IConvertible + where TextType : IConvertible + + => Plotly.NET.Chart3D_Scatter.Chart.Bubble3D( + x: x, + y: y, + z: z, + sizes: sizes, + Name: Name.ToOption(), + ShowLegend: ShowLegend.ToOption(), + Opacity: Opacity.ToOption(), + MultiOpacity: MultiOpacity.ToOption(), + Text: Text.ToOption(), + MultiText: MultiText.ToOption(), + TextPosition: TextPosition.ToOption(), + MultiTextPosition: MultiTextPosition.ToOption(), + MarkerColor: MarkerColor.ToOption(), + MarkerColorScale: MarkerColorScale.ToOption(), + MarkerOutline: MarkerOutline.ToOption(), + MarkerSymbol: MarkerSymbol.ToOption(), + MultiMarkerSymbol: MultiMarkerSymbol.ToOption(), + Marker: Marker.ToOption(), + CameraProjectionType: CameraProjectionType.ToOption(), + Camera: Camera.ToOption(), + Projection: Projection.ToOption(), + UseDefaults: UseDefaults.ToOption() + ); +} diff --git a/src/Plotly.NET.CSharp/ChartAPI/Chart3D/Cone.cs b/src/Plotly.NET.CSharp/ChartAPI/Chart3D/Cone.cs new file mode 100644 index 00000000..02734e82 --- /dev/null +++ b/src/Plotly.NET.CSharp/ChartAPI/Chart3D/Cone.cs @@ -0,0 +1,92 @@ +using System; +using System.Collections.Generic; +using Plotly.NET; +using Plotly.NET.LayoutObjects; +using Plotly.NET.TraceObjects; +using static Plotly.NET.StyleParam; + +namespace Plotly.NET.CSharp; + +public static partial class Chart +{ + /// + /// Creates a cone plot, typically used to visualize vector fields. + /// + /// Specify a vector field using 6 1D arrays: + /// + /// 3 position arrays `x`, `y` and `z` and + /// + /// 3 vector component arrays `u`, `v`, `w`. + /// + /// The cones are drawn exactly at the positions given by `x`, `y` and `z`. + /// + /// Sets the x coordinates of the vector field and of the displayed cones. + /// Sets the y coordinates of the vector field and of the displayed cones. + /// Sets the z coordinates of the vector field and of the displayed cones. + /// Sets the x components of the vector field. + /// Sets the y components of the vector field. + /// Sets the z components of the vector field. + /// 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. + /// Sets the opactity of the trace + /// Sets a text associated with each datum + /// Sets individual text for each datum + /// Sets the colorscale + /// Whether or not to show the colorbar/colorscale + /// Sets the colorbar + /// Determines whether `sizeref` is set as a "scaled" (i.e unitless) scalar (normalized by the max u/v/w norm in the vector field) or as "absolute" value (in the same units as the vector field). + /// Sets the cones' anchor with respect to their x/y/z positions. Note that "cm" denote the cone's center of mass which corresponds to 1/4 from the tail to tip. + /// Sets the camera projection type of this trace. + /// Sets the camera of this trace. + /// If set to false, ignore the global default settings set in `Defaults` + public static GenericChart Cone( + IEnumerable x, + IEnumerable y, + IEnumerable z, + IEnumerable u, + IEnumerable v, + IEnumerable w, + Optional Name = default, + Optional ShowLegend = default, + Optional Opacity = default, + Optional Text = default, + Optional> MultiText = default, + Optional ColorScale = default, + Optional ShowScale = default, + Optional ColorBar = default, + Optional SizeMode = default, + Optional ConeAnchor = default, + Optional CameraProjectionType = default, + Optional Camera = default, + Optional UseDefaults = default + ) + where XType : IConvertible + where YType : IConvertible + where ZType : IConvertible + where UType : IConvertible + where VType : IConvertible + where WType : IConvertible + where TextType : IConvertible + => + Plotly.NET.Chart3D_VectorField.Chart.Cone( + x: x, + y: y, + z: z, + u: u, + v: v, + w: w, + Name: Name.ToOption(), + ShowLegend: ShowLegend.ToOption(), + Opacity: Opacity.ToOption(), + Text: Text.ToOption(), + MultiText: MultiText.ToOption(), + ColorScale: ColorScale.ToOption(), + ShowScale: ShowScale.ToOption(), + ColorBar: ColorBar.ToOption(), + SizeMode: SizeMode.ToOption(), + ConeAnchor: ConeAnchor.ToOption(), + CameraProjectionType: CameraProjectionType.ToOption(), + Camera: Camera.ToOption(), + UseDefaults: UseDefaults.ToOption() + ); +} diff --git a/src/Plotly.NET.CSharp/ChartAPI/Chart3D/IsoSurface.cs b/src/Plotly.NET.CSharp/ChartAPI/Chart3D/IsoSurface.cs new file mode 100644 index 00000000..965d0dca --- /dev/null +++ b/src/Plotly.NET.CSharp/ChartAPI/Chart3D/IsoSurface.cs @@ -0,0 +1,92 @@ +using System; +using System.Collections.Generic; +using Plotly.NET; +using Plotly.NET.LayoutObjects; +using Plotly.NET.TraceObjects; +using static Plotly.NET.StyleParam; + +namespace Plotly.NET.CSharp; + +public static partial class Chart +{ + /// + /// Creates a isosurface plot to visualize the volume of a 3D shape. + /// + /// An isosurface is a surface that represents points of a constant value (e.g. pressure, temperature, velocity, density) within a volume of space. + /// + /// Draws isosurfaces between iso-min and iso-max values with coordinates given by four 1-dimensional arrays containing the `value`, `x`, `y` and `z` of every vertex of a uniform or non-uniform 3-D grid. + /// Horizontal or vertical slices, caps as well as spaceframe between iso-min and iso-max values could also be drawn using this trace. + /// + /// This plot is very similar to the `Volume` plot. However it shows all surfaces with the same opacity. + /// + /// Sets the X coordinates of the vertices on X axis. + /// Sets the Y coordinates of the vertices on Y axis. + /// Sets the Z coordinates of the vertices on Z axis. + /// Sets the 4th dimension (value) of the vertices. + /// 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. + /// Sets the opactity of the trace + /// Sets a text associated with each datum + /// Sets individual text for each datum + /// Sets the colorscale + /// Whether or not to show the colorbar/colorscale + /// Sets the colorbar + /// Sets the minimum boundary for iso-surface plot. + /// Sets the maximum boundary for iso-surface plot. + /// Sets the caps (color-coded surfaces on the sides of the visualization domain) + /// Adds Slices through the volume + /// Sets the surface. + /// Sets the camera projection type of this trace. + /// Sets the camera of this trace. + /// If set to false, ignore the global default settings set in `Defaults` + public static GenericChart IsoSurface( + IEnumerable x, + IEnumerable y, + IEnumerable z, + IEnumerable value, + Optional Name = default, + Optional ShowLegend = default, + Optional Opacity = default, + Optional Text = default, + Optional> MultiText = default, + Optional ColorScale = default, + Optional ShowScale = default, + Optional ColorBar = default, + Optional IsoMin = default, + Optional IsoMax = default, + Optional Caps = default, + Optional Slices = default, + Optional Surface = default, + Optional CameraProjectionType = default, + Optional Camera = default, + Optional UseDefaults = default + ) + where XType : IConvertible + where YType : IConvertible + where ZType : IConvertible + where ValueType : IConvertible + where TextType : IConvertible + => + Plotly.NET.Chart3D_Volume.Chart.IsoSurface( + x: x, + y: y, + z: z, + value: value, + Name: Name.ToOption(), + ShowLegend: ShowLegend.ToOption(), + Opacity: Opacity.ToOption(), + Text: Text.ToOption(), + MultiText: MultiText.ToOption(), + ColorScale: ColorScale.ToOption(), + ShowScale: ShowScale.ToOption(), + ColorBar: ColorBar.ToOption(), + IsoMin: IsoMin.ToOption(), + IsoMax: IsoMax.ToOption(), + Caps: Caps.ToOption(), + Slices: Slices.ToOption(), + Surface: Surface.ToOption(), + CameraProjectionType: CameraProjectionType.ToOption(), + Camera: Camera.ToOption(), + UseDefaults: UseDefaults.ToOption() + ); +} diff --git a/src/Plotly.NET.CSharp/ChartAPI/Chart3D/Line3D.cs b/src/Plotly.NET.CSharp/ChartAPI/Chart3D/Line3D.cs new file mode 100644 index 00000000..4ba1eebb --- /dev/null +++ b/src/Plotly.NET.CSharp/ChartAPI/Chart3D/Line3D.cs @@ -0,0 +1,107 @@ +using System; +using System.Collections.Generic; +using Plotly.NET; +using Plotly.NET.LayoutObjects; +using Plotly.NET.TraceObjects; +using static Plotly.NET.StyleParam; + +namespace Plotly.NET.CSharp; + +public static partial class Chart +{ + /// + /// Creates a Line3D plot. + /// + /// Line3D Plots plot three-dimensional data on 3 cartesian position scales in the X, Y, and Z dimension as a line connecting the individual datums. + /// + /// Sets the x coordinates of the plotted data. + /// Sets the y coordinates of the plotted data. + /// Sets the z coordinates of the plotted data. + /// Whether to show markers for the datums additionally to the line + /// 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. + /// Sets the opactity of the trace + /// Sets the opactity of individual datum markers + /// Sets a text associated with each datum + /// Sets individual text for each datum + /// Sets the position of text associated with each datum + /// Sets the position of text associated with individual datum + /// Sets the color of the marker + /// Sets the colorscale of the marker + /// Sets the outline of the marker + /// Sets the marker symbol for each datum + /// Sets the marker symbol for each individual datum + /// Sets the marker (use this for more finegrained control than the other marker-associated arguments) + /// Sets the color of the line + /// Sets the colorscale of the line + /// Sets the width of the line + /// sets the drawing style of the line + /// Sets the line (use this for more finegrained control than the other line-associated arguments) + /// Sets the camera projection type of this trace. + /// Sets the camera of this trace. + /// Sets the projection of this trace. + /// If set to false, ignore the global default settings set in `Defaults` + public static GenericChart Line3D( + IEnumerable x, + IEnumerable y, + IEnumerable z, + Optional ShowMarkers = default, + Optional Name = default, + Optional ShowLegend = default, + Optional Opacity = default, + Optional> MultiOpacity = default, + Optional Text = default, + Optional> MultiText = default, + Optional TextPosition = default, + Optional> MultiTextPosition = default, + Optional MarkerColor = default, + Optional MarkerColorScale = default, + Optional MarkerOutline = default, + Optional MarkerSymbol = default, + Optional> MultiMarkerSymbol = default, + Optional Marker = default, + Optional LineColor = default, + Optional LineColorScale = default, + Optional LineWidth = default, + Optional LineDash = default, + Optional Line = default, + Optional CameraProjectionType = default, + Optional Camera = default, + Optional Projection = default, + Optional UseDefaults = default + ) + where XType : IConvertible + where YType : IConvertible + where ZType : IConvertible + where TextType : IConvertible + + => Plotly.NET.Chart3D_Scatter.Chart.Line3D( + x: x, + y: y, + z: z, + ShowMarkers: ShowMarkers.ToOption(), + Name: Name.ToOption(), + ShowLegend: ShowLegend.ToOption(), + Opacity: Opacity.ToOption(), + MultiOpacity: MultiOpacity.ToOption(), + Text: Text.ToOption(), + MultiText: MultiText.ToOption(), + TextPosition: TextPosition.ToOption(), + MultiTextPosition: MultiTextPosition.ToOption(), + MarkerColor: MarkerColor.ToOption(), + MarkerColorScale: MarkerColorScale.ToOption(), + MarkerOutline: MarkerOutline.ToOption(), + MarkerSymbol: MarkerSymbol.ToOption(), + MultiMarkerSymbol: MultiMarkerSymbol.ToOption(), + Marker: Marker.ToOption(), + LineColor: LineColor.ToOption(), + LineColorScale: LineColorScale.ToOption(), + LineWidth: LineWidth.ToOption(), + LineDash: LineDash.ToOption(), + Line: Line.ToOption(), + CameraProjectionType: CameraProjectionType.ToOption(), + Camera: Camera.ToOption(), + Projection: Projection.ToOption(), + UseDefaults: UseDefaults.ToOption() + ); +} diff --git a/src/Plotly.NET.CSharp/ChartAPI/Chart3D/Mesh3D.cs b/src/Plotly.NET.CSharp/ChartAPI/Chart3D/Mesh3D.cs new file mode 100644 index 00000000..311c8428 --- /dev/null +++ b/src/Plotly.NET.CSharp/ChartAPI/Chart3D/Mesh3D.cs @@ -0,0 +1,100 @@ +using System; +using System.Collections.Generic; +using Plotly.NET; +using Plotly.NET.LayoutObjects; +using Plotly.NET.TraceObjects; +using static Plotly.NET.StyleParam; + +namespace Plotly.NET.CSharp; + +public static partial class Chart +{ + /// + /// Visualizes a 3D mesh. + /// + /// Draws sets of triangles with coordinates given by three 1-dimensional arrays in `x`, `y`, `z` and + /// + /// (1) a sets of `i`, `j`, `k` indices or + /// + /// (2) Delaunay triangulation or + /// + /// (3) the Alpha-shape algorithm or + /// + /// (4) the Convex-hull algorithm + /// + /// Sets the X coordinates of the vertices. The nth element of vectors `x`, `y` and `z` jointly represent the X, Y and Z coordinates of the nth vertex. + /// Sets the Y coordinates of the vertices. The nth element of vectors `x`, `y` and `z` jointly represent the X, Y and Z coordinates of the nth vertex. + /// Sets the Z coordinates of the vertices. The nth element of vectors `x`, `y` and `z` jointly represent the X, Y and Z coordinates of the nth vertex. + /// A vector of vertex indices, i.e. integer values between 0 and the length of the vertex vectors, representing the "first" vertex of a triangle. For example, `{i[m], j[m], k[m]}` together represent face m (triangle m) in the mesh, where `i[m] = n` points to the triplet `{x[n], y[n], z[n]}` in the vertex arrays. Therefore, each element in `i` represents a point in space, which is the first vertex of a triangle. + /// A vector of vertex indices, i.e. integer values between 0 and the length of the vertex vectors, representing the "second" vertex of a triangle. For example, `{i[m], j[m], k[m]}` together represent face m (triangle m) in the mesh, where `j[m] = n` points to the triplet `{x[n], y[n], z[n]}` in the vertex arrays. Therefore, each element in `j` represents a point in space, which is the second vertex of a triangle. + /// A vector of vertex indices, i.e. integer values between 0 and the length of the vertex vectors, representing the "third" vertex of a triangle. For example, `{i[m], j[m], k[m]}` together represent face m (triangle m) in the mesh, where `k[m] = n` points to the triplet `{x[n], y[n], z[n]}` in the vertex arrays. Therefore, each element in `k` represents a point in space, which is the third vertex of a triangle. + /// 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. + /// Sets the opactity of the trace + /// Sets a text associated with each datum + /// Sets individual text for each datum + /// Sets the color of the whole mesh + /// Sets the style and visibility of contours + /// Sets the colorscale + /// Whether or not to show the colorbar/colorscale + /// Sets the colorbar + /// Determines whether or not normal smoothing is applied to the meshes, creating meshes with an angular, low-poly look via flat reflections. + /// Determines how the mesh surface triangles are derived from the set of vertices (points) represented by the `x`, `y` and `z` arrays, if the `i`, `j`, `k` arrays are not supplied. + /// Sets the camera projection type of this trace. + /// Sets the camera of this trace. + /// If set to false, ignore the global default settings set in `Defaults` + public static GenericChart Mesh3D( + IEnumerable x, + IEnumerable y, + IEnumerable z, + Optional> I = default, + Optional> J = default, + Optional> K = default, + Optional Name = default, + Optional ShowLegend = default, + Optional Opacity = default, + Optional Text = default, + Optional> MultiText = default, + Optional Color = default, + Optional Contour = default, + Optional ColorScale = default, + Optional ShowScale = default, + Optional ColorBar = default, + Optional FlatShading = default, + Optional TriangulationAlgorithm = default, + Optional CameraProjectionType = default, + Optional Camera = default, + Optional UseDefaults = default + ) + where XType : IConvertible + where YType : IConvertible + where ZType : IConvertible + where IType : IConvertible + where JType : IConvertible + where KType : IConvertible + where TextType : IConvertible + => + Plotly.NET.Chart3D_Surface.Chart.Mesh3D( + x: x, + y: y, + z: z, + I: I.ToOption(), + J: J.ToOption(), + K: K.ToOption(), + Name: Name.ToOption(), + ShowLegend: ShowLegend.ToOption(), + Opacity: Opacity.ToOption(), + Text: Text.ToOption(), + MultiText: MultiText.ToOption(), + Color: Color.ToOption(), + Contour: Contour.ToOption(), + ColorScale: ColorScale.ToOption(), + ShowScale: ShowScale.ToOption(), + ColorBar: ColorBar.ToOption(), + FlatShading: FlatShading.ToOption(), + TriangulationAlgorithm: TriangulationAlgorithm.ToOption(), + CameraProjectionType: CameraProjectionType.ToOption(), + Camera: Camera.ToOption(), + UseDefaults: UseDefaults.ToOption() + ); +} diff --git a/src/Plotly.NET.CSharp/ChartAPI/Chart3D/Point3D.cs b/src/Plotly.NET.CSharp/ChartAPI/Chart3D/Point3D.cs new file mode 100644 index 00000000..9d271e95 --- /dev/null +++ b/src/Plotly.NET.CSharp/ChartAPI/Chart3D/Point3D.cs @@ -0,0 +1,89 @@ +using System; +using System.Collections.Generic; +using Plotly.NET; +using Plotly.NET.LayoutObjects; +using Plotly.NET.TraceObjects; +using static Plotly.NET.StyleParam; + +namespace Plotly.NET.CSharp; + +public static partial class Chart +{ + /// + /// Creates a Point3D plot. + /// + /// Point3D Plots plot three-dimensional data on 3 cartesian position scales in the X, Y, and Z dimension as points. + /// + /// Sets the x coordinates of the plotted data. + /// Sets the y coordinates of the plotted data. + /// Sets the z 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. + /// Sets the opactity of the trace + /// Sets the opactity of individual datum markers + /// Sets a text associated with each datum + /// Sets individual text for each datum + /// Sets the position of text associated with each datum + /// Sets the position of text associated with individual datum + /// Sets the color of the marker + /// Sets the colorscale of the marker + /// Sets the outline of the marker + /// Sets the marker symbol for each datum + /// Sets the marker symbol for each individual datum + /// Sets the marker (use this for more finegrained control than the other marker-associated arguments) + /// Sets the camera projection type of this trace. + /// Sets the camera of this trace. + /// Sets the projection of this trace. + /// If set to false, ignore the global default settings set in `Defaults` + public static GenericChart Point3D( + IEnumerable x, + IEnumerable y, + IEnumerable z, + Optional Name = default, + Optional ShowLegend = default, + Optional Opacity = default, + Optional> MultiOpacity = default, + Optional Text = default, + Optional> MultiText = default, + Optional TextPosition = default, + Optional> MultiTextPosition = default, + Optional MarkerColor = default, + Optional MarkerColorScale = default, + Optional MarkerOutline = default, + Optional MarkerSymbol = default, + Optional> MultiMarkerSymbol = default, + Optional Marker = default, + Optional CameraProjectionType = default, + Optional Camera = default, + Optional Projection = default, + Optional UseDefaults = default + ) + where XType : IConvertible + where YType : IConvertible + where ZType : IConvertible + where TextType : IConvertible + + => Plotly.NET.Chart3D_Scatter.Chart.Point3D( + x: x, + y: y, + z: z, + Name: Name.ToOption(), + ShowLegend: ShowLegend.ToOption(), + Opacity: Opacity.ToOption(), + MultiOpacity: MultiOpacity.ToOption(), + Text: Text.ToOption(), + MultiText: MultiText.ToOption(), + TextPosition: TextPosition.ToOption(), + MultiTextPosition: MultiTextPosition.ToOption(), + MarkerColor: MarkerColor.ToOption(), + MarkerColorScale: MarkerColorScale.ToOption(), + MarkerOutline: MarkerOutline.ToOption(), + MarkerSymbol: MarkerSymbol.ToOption(), + MultiMarkerSymbol: MultiMarkerSymbol.ToOption(), + Marker: Marker.ToOption(), + CameraProjectionType: CameraProjectionType.ToOption(), + Camera: Camera.ToOption(), + Projection: Projection.ToOption(), + UseDefaults: UseDefaults.ToOption() + ); +} diff --git a/src/Plotly.NET.CSharp/ChartAPI/Chart3D/Scatter3D.cs b/src/Plotly.NET.CSharp/ChartAPI/Chart3D/Scatter3D.cs new file mode 100644 index 00000000..fcd6934b --- /dev/null +++ b/src/Plotly.NET.CSharp/ChartAPI/Chart3D/Scatter3D.cs @@ -0,0 +1,109 @@ +using System; +using System.Collections.Generic; +using Plotly.NET; +using Plotly.NET.LayoutObjects; +using Plotly.NET.TraceObjects; +using static Plotly.NET.StyleParam; + +namespace Plotly.NET.CSharp; + +public static partial class Chart +{ + /// + /// Creates a Scatter3D plot. + /// + /// In general, Scatter3D Plots plot three-dimensional data on 3 cartesian position scales in the X, Y, and Z dimension. + /// + /// Scatter3D charts are the basis of Point3D, Line3D, and Bubble3D Charts, and can be customized as such. We also provide abstractions for those: Chart.Line3D, Chart.Point3D, Chart.Bubble3D + /// + /// Sets the x coordinates of the plotted data. + /// Sets the y coordinates of the plotted data. + /// Sets the z 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. + /// Sets the opactity of the trace + /// Sets the opactity of individual datum markers + /// Sets a text associated with each datum + /// Sets individual text for each datum + /// Sets the position of text associated with each datum + /// Sets the position of text associated with individual datum + /// Sets the color of the marker + /// Sets the colorscale of the marker + /// Sets the outline of the marker + /// Sets the marker symbol for each datum + /// Sets the marker symbol for each individual datum + /// Sets the marker (use this for more finegrained control than the other marker-associated arguments) + /// Sets the color of the line + /// Sets the colorscale of the line + /// Sets the width of the line + /// sets the drawing style of the line + /// Sets the line (use this for more finegrained control than the other line-associated arguments) + /// Sets the camera projection type of this trace. + /// Sets the camera of this trace. + /// Sets the projection of this trace. + /// If set to false, ignore the global default settings set in `Defaults` + public static GenericChart Scatter3D( + IEnumerable x, + IEnumerable y, + IEnumerable z, + StyleParam.Mode mode, + Optional Name = default, + Optional ShowLegend = default, + Optional Opacity = default, + Optional> MultiOpacity = default, + Optional Text = default, + Optional> MultiText = default, + Optional TextPosition = default, + Optional> MultiTextPosition = default, + Optional MarkerColor = default, + Optional MarkerColorScale = default, + Optional MarkerOutline = default, + Optional MarkerSymbol = default, + Optional> MultiMarkerSymbol = default, + Optional Marker = default, + Optional LineColor = default, + Optional LineColorScale = default, + Optional LineWidth = default, + Optional LineDash = default, + Optional Line = default, + Optional CameraProjectionType = default , + Optional Camera = default, + Optional Projection = default, + Optional UseDefaults = default + ) + where XType: IConvertible + where YType: IConvertible + where ZType : IConvertible + where TextType : IConvertible + + => Plotly.NET.Chart3D_Scatter.Chart.Scatter3D( + x: x, + y: y, + z: z, + mode: mode, + Name: Name.ToOption(), + ShowLegend: ShowLegend.ToOption(), + Opacity: Opacity.ToOption(), + MultiOpacity: MultiOpacity.ToOption(), + Text: Text.ToOption(), + MultiText: MultiText.ToOption(), + TextPosition: TextPosition.ToOption(), + MultiTextPosition: MultiTextPosition.ToOption(), + MarkerColor: MarkerColor.ToOption(), + MarkerColorScale: MarkerColorScale.ToOption(), + MarkerOutline: MarkerOutline.ToOption(), + MarkerSymbol: MarkerSymbol.ToOption(), + MultiMarkerSymbol: MultiMarkerSymbol.ToOption(), + Marker: Marker.ToOption(), + LineColor: LineColor.ToOption(), + LineColorScale: LineColorScale.ToOption(), + LineWidth: LineWidth.ToOption(), + LineDash: LineDash.ToOption(), + Line: Line.ToOption(), + Projection: Projection.ToOption(), + CameraProjectionType: CameraProjectionType.ToOption(), + Camera: Camera.ToOption(), + UseDefaults: UseDefaults.ToOption() + ); +} diff --git a/src/Plotly.NET.CSharp/ChartAPI/Chart3D/StreamTube.cs b/src/Plotly.NET.CSharp/ChartAPI/Chart3D/StreamTube.cs new file mode 100644 index 00000000..ffa8b344 --- /dev/null +++ b/src/Plotly.NET.CSharp/ChartAPI/Chart3D/StreamTube.cs @@ -0,0 +1,94 @@ +using System; +using System.Collections.Generic; +using Plotly.NET; +using Plotly.NET.LayoutObjects; +using Plotly.NET.TraceObjects; +using static Plotly.NET.StyleParam; + +namespace Plotly.NET.CSharp; + +public static partial class Chart +{ + /// + /// Creates a streamtube plot, typically used to visualize flow in a vector field. + /// + /// Specify a vector field using 6 1D arrays of equal length: + /// + /// 3 position arrays `x`, `y` and `z` and + /// + /// 3 vector component arrays `u`, `v`, and `w`. + /// + /// By default, the tubes' starting positions will be cut from the vector field's x-z plane at its minimum y value. + /// To specify your own starting position, use `TubeStarts`. + /// The color is encoded by the norm of (u, v, w), and the local radius by the divergence of (u, v, w). + /// + /// Sets the x coordinates of the vector field and of the displayed cones. + /// Sets the y coordinates of the vector field and of the displayed cones. + /// Sets the z coordinates of the vector field and of the displayed cones. + /// Sets the x components of the vector field. + /// Sets the y components of the vector field. + /// Sets the z components of the vector field. + /// 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. + /// Sets the opactity of the trace + /// Sets a text associated with each datum + /// Sets individual text for each datum + /// Sets the colorscale + /// Whether or not to show the colorbar/colorscale + /// Sets the colorbar + /// The maximum number of displayed segments in a streamtube. + /// Use this object to specify custom tube start positions + /// Sets the camera projection type of this trace. + /// Sets the camera of this trace. + /// If set to false, ignore the global default settings set in `Defaults` + public static GenericChart StreamTube( + IEnumerable x, + IEnumerable y, + IEnumerable z, + IEnumerable u, + IEnumerable v, + IEnumerable w, + Optional Name = default, + Optional ShowLegend = default, + Optional Opacity = default, + Optional Text = default, + Optional> MultiText = default, + Optional ColorScale = default, + Optional ShowScale = default, + Optional ColorBar = default, + Optional MaxDisplayed = default, + Optional TubeStarts = default, + Optional CameraProjectionType = default, + Optional Camera = default, + Optional UseDefaults = default + ) + where XType : IConvertible + where YType : IConvertible + where ZType : IConvertible + where UType : IConvertible + where VType : IConvertible + where WType : IConvertible + where TextType : IConvertible + => + Plotly.NET.Chart3D_VectorField.Chart.StreamTube( + x: x, + y: y, + z: z, + u: u, + v: v, + w: w, + Name: Name.ToOption(), + ShowLegend: ShowLegend.ToOption(), + Opacity: Opacity.ToOption(), + Text: Text.ToOption(), + MultiText: MultiText.ToOption(), + ColorScale: ColorScale.ToOption(), + ShowScale: ShowScale.ToOption(), + ColorBar: ColorBar.ToOption(), + MaxDisplayed: MaxDisplayed.ToOption(), + TubeStarts: TubeStarts.ToOption(), + CameraProjectionType: CameraProjectionType.ToOption(), + Camera: Camera.ToOption(), + UseDefaults: UseDefaults.ToOption() + ); +} diff --git a/src/Plotly.NET.CSharp/ChartAPI/Chart3D/Surface.cs b/src/Plotly.NET.CSharp/ChartAPI/Chart3D/Surface.cs new file mode 100644 index 00000000..3c8542b2 --- /dev/null +++ b/src/Plotly.NET.CSharp/ChartAPI/Chart3D/Surface.cs @@ -0,0 +1,73 @@ +using System; +using System.Collections.Generic; +using Plotly.NET; +using Plotly.NET.LayoutObjects; +using Plotly.NET.TraceObjects; +using static Plotly.NET.StyleParam; + +namespace Plotly.NET.CSharp; + +public static partial class Chart +{ + /// + /// Creates a surface plot. + /// + /// Surface plots plot a z value as a function of x and y, creating a three-dimensional surface. + /// + /// The data the describes the coordinates of the surface is set in `z`. Data in `z` should be a 2D array. + /// Coordinates in `x` and `y` can either be 1D arrays or 2D arrays (e.g. to graph parametric surfaces). If not provided in `x` and `y`, the x and y coordinates are assumed to be linear starting at 0 with a unit step. + /// The color scale corresponds to the `z` values by default. For custom color scales, use `surfacecolor` which should be a 2D array, where its bounds can be controlled using `cmin` and `cmax`. + /// + /// Two-dimensional data array representing the surface's z values + /// Sets the x coordinates. + /// Sets the y coordinates. + /// 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. + /// Sets the opactity of the trace + /// Sets a text associated with each datum + /// Sets individual text for each datum + /// Sets the contours on the surface + /// Sets the colorscale of the surface + /// Whether or not to show the colorbar/colorscale + /// Sets the camera projection type of this trace. + /// Sets the camera of this trace. + /// If set to false, ignore the global default settings set in `Defaults` + public static GenericChart Surface( + IEnumerable> zData, + Optional> X = default, + Optional> Y = default, + Optional Name = default, + Optional ShowLegend = default, + Optional Opacity = default, + Optional Text = default, + Optional> MultiText = default, + Optional Contours = default, + Optional ColorScale = default, + Optional CameraProjectionType = default, + Optional Camera = default, + Optional ShowScale = default, + + Optional UseDefaults = default + ) + where ZType : IConvertible + where XType : IConvertible + where YType : IConvertible + where TextType : IConvertible + => + Plotly.NET.Chart3D_Surface.Chart.Surface, ZType, XType, YType, TextType>( + zData: zData, + X: X.ToOption(), + Y: Y.ToOption(), + Name: Name.ToOption(), + ShowLegend: ShowLegend.ToOption(), + Opacity: Opacity.ToOption(), + Text: Text.ToOption(), + MultiText: MultiText.ToOption(), + Contours: Contours.ToOption(), + ColorScale: ColorScale.ToOption(), + ShowScale: ShowScale.ToOption(), + CameraProjectionType: CameraProjectionType.ToOption(), + Camera: Camera.ToOption(), + UseDefaults: UseDefaults.ToOption() + ); +} diff --git a/src/Plotly.NET.CSharp/ChartAPI/Chart3D/Volume.cs b/src/Plotly.NET.CSharp/ChartAPI/Chart3D/Volume.cs new file mode 100644 index 00000000..e60af8b3 --- /dev/null +++ b/src/Plotly.NET.CSharp/ChartAPI/Chart3D/Volume.cs @@ -0,0 +1,94 @@ +using System; +using System.Collections.Generic; +using Plotly.NET; +using Plotly.NET.LayoutObjects; +using Plotly.NET.TraceObjects; +using static Plotly.NET.StyleParam; + +namespace Plotly.NET.CSharp; + +public static partial class Chart +{ + /// + /// Creates a volume plot to visualize the volume of a 3D shape. + /// + /// Draws volume trace between iso-min and iso-max values with coordinates given by four 1-dimensional arrays containing the `value`, `x`, `y` and `z` of every vertex of a uniform or non-uniform 3-D grid. + /// Horizontal or vertical slices, caps as well as spaceframe between iso-min and iso-max values could also be drawn using this trace. + /// + /// This plot is very similar to the `IsoSurface` plot. However, whereas isosurface plots show all surfaces with the same opacity, tweaking the opacityscale parameter of Volume plots results in a depth effect and better volume rendering. + /// + /// Sets the X coordinates of the vertices on X axis. + /// Sets the Y coordinates of the vertices on Y axis. + /// Sets the Z coordinates of the vertices on Z axis. + /// Sets the 4th dimension (value) of the vertices. + /// 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. + /// Sets the opactity of the trace + /// Sets a text associated with each datum + /// Sets individual text for each datum + /// Sets the colorscale + /// Whether or not to show the colorbar/colorscale + /// Sets the colorbar + /// Sets the minimum boundary for iso-surface plot. + /// Sets the maximum boundary for iso-surface plot. + /// Sets the caps (color-coded surfaces on the sides of the visualization domain) + /// Adds Slices through the volume + /// Sets the surface. + /// Sets the opacityscale. The opacityscale must be an array containing arrays mapping a normalized value to an opacity value. At minimum, a mapping for the lowest (0) and highest (1) values are required. For example, `[[0, 1], [0.5, 0.2], [1, 1]]` means that higher/lower values would have higher opacity values and those in the middle would be more transparent Alternatively, `opacityscale` may be a palette name string of the following list: 'min', 'max', 'extremes' and 'uniform'. The default is 'uniform'. + /// Sets the camera projection type of this trace. + /// Sets the camera of this trace. + /// If set to false, ignore the global default settings set in `Defaults` + public static GenericChart Volume( + IEnumerable x, + IEnumerable y, + IEnumerable z, + IEnumerable value, + Optional Name = default, + Optional ShowLegend = default, + Optional Opacity = default, + Optional Text = default, + Optional> MultiText = default, + Optional ColorScale = default, + Optional ShowScale = default, + Optional ColorBar = default, + Optional IsoMin = default, + Optional IsoMax = default, + Optional Caps = default, + Optional Slices = default, + Optional Surface = default, + Optional>> OpacityScale = default, + Optional CameraProjectionType = default, + Optional Camera = default, + Optional UseDefaults = default + ) + where XType : IConvertible + where YType : IConvertible + where ZType : IConvertible + where ValueType : IConvertible + where TextType : IConvertible + where OpacityScaleType : IConvertible + => + Plotly.NET.Chart3D_Volume.Chart.Volume, OpacityScaleType>( + x: x, + y: y, + z: z, + value: value, + Name: Name.ToOption(), + ShowLegend: ShowLegend.ToOption(), + Opacity: Opacity.ToOption(), + Text: Text.ToOption(), + MultiText: MultiText.ToOption(), + ColorScale: ColorScale.ToOption(), + ShowScale: ShowScale.ToOption(), + ColorBar: ColorBar.ToOption(), + IsoMin: IsoMin.ToOption(), + IsoMax: IsoMax.ToOption(), + Caps: Caps.ToOption(), + Slices: Slices.ToOption(), + Surface: Surface.ToOption(), + OpacityScale: OpacityScale.ToOption(), + CameraProjectionType: CameraProjectionType.ToOption(), + Camera: Camera.ToOption(), + UseDefaults: UseDefaults.ToOption() + ); +} diff --git a/src/Plotly.NET.CSharp/ChartAPI/ChartCarpet.cs b/src/Plotly.NET.CSharp/ChartAPI/ChartCarpet.cs deleted file mode 100644 index 43d8e98e..00000000 --- a/src/Plotly.NET.CSharp/ChartAPI/ChartCarpet.cs +++ /dev/null @@ -1,615 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Plotly.NET.LayoutObjects; -using Plotly.NET.TraceObjects; -using System.Runtime.InteropServices; - -namespace Plotly.NET.CSharp -{ - public static partial class Chart - { - /// - /// Creates a carpet in a 2D coordinate system to be used as additional coordinate system in a carpet plot. - /// - /// A carpet plot illustrates the interaction between two or more independent variables and one or more dependent variables in a two-dimensional plot. - /// Besides the ability to incorporate more variables, another feature that distinguishes a carpet plot from an equivalent contour plot or 3D surface plot is that a carpet plot can be used to more accurately interpolate data points. - /// A conventional carpet plot can capture the interaction of up to three independent variables and three dependent variables and still be easily read and interpolated. - /// - /// Three-variable carpet plot (cheater plot): - /// - /// A carpet plot with two independent variables and one dependent variable is often called a cheater plot for the use of a phantom "cheater" axis instead of the horizontal axis. As a result of this missing axis, the values can be shifted horizontally such that the intersections line up vertically. This allows easy interpolation by having fixed horizontal intervals correspond to fixed intervals in both independent variables. - /// - /// Four-variable carpet plot (true carpet plot) - /// - /// Instead of using the horizontal axis to adjust the plot perspective and align carpet intersections vertically, the horizontal axis can be used to show the effects on an additional dependent variable.[5] In this case the perspective is fixed, and any overlapping cannot be adjusted. Because a true carpet plot represents two independent variables and two dependent variables simultaneously, there is no corresponding way to show the information on a conventional contour plot or 3D surface plot. - /// - /// (from https://en.wikipedia.org/wiki/Carpet_plot @ 1/11/2021) - /// - /// An identifier for this carpet, so that `scattercarpet` and `contourcarpet` traces can specify a carpet plot on which they lie. - /// 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. - /// Sets the opactity of the trace - /// A one dimensional array of x coordinates matching the dimensions of `a` and `b`. - /// A two dimensional array of x coordinates at each carpet point. If omitted, the plot is a cheater plot and the xaxis is hidden by default. - /// A one dimensional array of y coordinates matching the dimensions of `a` and `b`. - /// A two dimensional array of y coordinates at each carpet point. - /// An array containing values of the first parameter value - /// An array containing values of the second parameter value - /// Sets this carpet's a axis. - /// Sets this carpet's b axis. - /// Sets a reference between this trace's x coordinates and a 2D cartesian x axis. If "x" (the default value), the x coordinates refer to `layout.xaxis`. If "x2", the x coordinates refer to `layout.xaxis2`, and so on. - /// Sets a reference between this trace's y coordinates and a 2D cartesian y axis. If "y" (the default value), the y coordinates refer to `layout.yaxis`. If "y2", the y coordinates refer to `layout.yaxis2`, and so on. - /// Sets default for all colors associated with this axis all at once: line, font, tick, and grid colors. Grid color is lightened by blending this with the plot background Individual pieces can override this. - /// The shift applied to each successive row of data in creating a cheater plot. Only used if `x` is been omitted. - /// If set to false, ignore the global default settings set in `Defaults` - public static GenericChart Carpet( - string carpetId, - Optional Name = default, - Optional ShowLegend = default, - Optional Opacity = default, - Optional> X = default, - Optional>> MultiX = default, - Optional> Y = default, - Optional>> MultiY = default, - Optional> A = default, - Optional> B = default, - Optional AAxis = default, - Optional BAxis = default, - Optional XAxis = default, - Optional YAxis = default, - Optional Color = default, - Optional CheaterSlope = default, - Optional UseDefaults = default - ) - where XType : IConvertible - where MultiXType : IConvertible - where YType : IConvertible - where MultiYType : IConvertible - where AType : IConvertible - where BType : IConvertible - => - Plotly.NET.ChartCarpet_Base.Chart.Carpet, MultiXType, YType, IEnumerable, MultiYType, AType, BType>( - carpetId: carpetId, - Name: Name.ToOption(), - ShowLegend: ShowLegend.ToOption(), - Opacity: Opacity.ToOption(), - X: X.ToOption(), - MultiX: MultiX.ToOption(), - Y: Y.ToOption(), - MultiY: MultiY.ToOption(), - A: A.ToOption(), - B: B.ToOption(), - AAxis: AAxis.ToOption(), - BAxis: BAxis.ToOption(), - XAxis: XAxis.ToOption(), - YAxis: YAxis.ToOption(), - Color: Color.ToOption(), - CheaterSlope: CheaterSlope.ToOption(), - UseDefaults: UseDefaults.ToOption() - ); - - /// - /// Creates a scatter plot that lies on a specified carpet. - /// - /// In general, ScatterCarpet creates a plot that uses the given carpet identifier as coordinate system. - /// - /// Whether the resulting plot is a cheater or true carpet plot depends on the referenced carpet. - /// - /// ScatterCarpet charts are the basis of PointCarpet, LineCarpet, and BubbleCarpet Charts, and can be customized as such. We also provide abstractions for those: Chart.LineCarpet, Chart.PointCarpet, Chart.BubbleCarpet - /// - /// Sets the a-axis coordinates on the carpet. - /// Sets the b-axis coordinates on the carpet. - /// Determines the drawing mode for this scatter trace. If the provided `mode` includes "text" then the `text` elements appear at the coordinates. Otherwise, the `text` elements appear on hover. If there are less than 20 points and the trace is not stacked then the default is "lines+markers". Otherwise, "lines". - /// The identifier of the carpet that this trace will lie on. - /// 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. - /// Sets the opactity of the trace - /// Sets the opactity of individual datum markers - /// Sets a text associated with each datum - /// Sets individual text for each datum - /// Sets the position of text associated with each datum - /// Sets the position of text associated with individual datum - /// Sets the color of the marker - /// Sets the colorscale of the marker - /// Sets the outline of the marker - /// Sets the marker symbol for each datum - /// Sets the marker symbol for each individual datum - /// Sets the marker (use this for more finegrained control than the other marker-associated arguments) - /// Sets the color of the line - /// Sets the colorscale of the line - /// Sets the width of the line - /// sets the drawing style of the line - /// Sets the line (use this for more finegrained control than the other line-associated arguments) - /// If set to false, ignore the global default settings set in `Defaults` - public static GenericChart ScatterCarpet( - IEnumerable a, - IEnumerable b, - StyleParam.Mode mode, - string carpetAnchorId, - Optional Name = default, - Optional ShowLegend = default, - Optional Opacity = default, - Optional> MultiOpacity = default, - Optional Text = default, - Optional> MultiText = default, - Optional TextPosition = default, - Optional> MultiTextPosition = default, - Optional MarkerColor = default, - Optional MarkerColorScale = default, - Optional MarkerOutline = default, - Optional MarkerSymbol = default, - Optional> MultiMarkerSymbol = default, - Optional Marker = default, - Optional LineColor = default, - Optional LineColorScale = default, - Optional LineWidth = default, - Optional LineDash = default, - Optional Line = default, - Optional UseDefaults = default - ) - where AType : IConvertible - where BType : IConvertible - where TextType : IConvertible - => - Plotly.NET.ChartCarpet_Scatter.Chart.ScatterCarpet( - a: a, - b: b, - mode: mode, - carpetAnchorId: carpetAnchorId, - Name: Name.ToOption(), - ShowLegend: ShowLegend.ToOption(), - Opacity: Opacity.ToOption(), - MultiOpacity: MultiOpacity.ToOption(), - Text: Text.ToOption(), - MultiText: MultiText.ToOption(), - TextPosition: TextPosition.ToOption(), - MultiTextPosition: MultiTextPosition.ToOption(), - MarkerColor: MarkerColor.ToOption(), - MarkerColorScale: MarkerColorScale.ToOption(), - MarkerOutline: MarkerOutline.ToOption(), - MarkerSymbol: MarkerSymbol.ToOption(), - MultiMarkerSymbol: MultiMarkerSymbol.ToOption(), - Marker: Marker.ToOption(), - LineColor: LineColor.ToOption(), - LineColorScale: LineColorScale.ToOption(), - LineWidth: LineWidth.ToOption(), - LineDash: LineDash.ToOption(), - Line: Line.ToOption(), - UseDefaults: UseDefaults.ToOption() - ); - - /// - /// Creates a point plot that lies on a specified carpet. - /// - /// In general, PointCarpet creates a point plot that uses the given carpet identifier as coordinate system. - /// - /// Whether the resulting plot is a cheater or true carpet plot depends on the referenced carpet. - /// - /// Sets the a-axis coordinates on the carpet. - /// Sets the b-axis coordinates on the carpet. - /// The identifier of the carpet that this trace will lie on. - /// 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. - /// Sets the opactity of the trace - /// Sets the opactity of individual datum markers - /// Sets a text associated with each datum - /// Sets individual text for each datum - /// Sets the position of text associated with each datum - /// Sets the position of text associated with individual datum - /// Sets the color of the marker - /// Sets the colorscale of the marker - /// Sets the outline of the marker - /// Sets the marker symbol for each datum - /// Sets the marker symbol for each individual datum - /// Sets the marker (use this for more finegrained control than the other marker-associated arguments) - /// If set to false, ignore the global default settings set in `Defaults` - public static GenericChart PointCarpet( - IEnumerable a, - IEnumerable b, - string carpetAnchorId, - Optional Name = default, - Optional ShowLegend = default, - Optional Opacity = default, - Optional> MultiOpacity = default, - Optional Text = default, - Optional> MultiText = default, - Optional TextPosition = default, - Optional> MultiTextPosition = default, - Optional MarkerColor = default, - Optional MarkerColorScale = default, - Optional MarkerOutline = default, - Optional MarkerSymbol = default, - Optional> MultiMarkerSymbol = default, - Optional Marker = default, - Optional UseDefaults = default - ) - where AType : IConvertible - where BType : IConvertible - where TextType : IConvertible - => - Plotly.NET.ChartCarpet_Scatter.Chart.PointCarpet( - a: a, - b: b, - carpetAnchorId: carpetAnchorId, - Name: Name.ToOption(), - ShowLegend: ShowLegend.ToOption(), - Opacity: Opacity.ToOption(), - MultiOpacity: MultiOpacity.ToOption(), - Text: Text.ToOption(), - MultiText: MultiText.ToOption(), - TextPosition: TextPosition.ToOption(), - MultiTextPosition: MultiTextPosition.ToOption(), - MarkerColor: MarkerColor.ToOption(), - MarkerColorScale: MarkerColorScale.ToOption(), - MarkerOutline: MarkerOutline.ToOption(), - MarkerSymbol: MarkerSymbol.ToOption(), - MultiMarkerSymbol: MultiMarkerSymbol.ToOption(), - Marker: Marker.ToOption(), - UseDefaults: UseDefaults.ToOption() - ); - - /// - /// Creates a line plot that lies on a specified carpet. - /// - /// In general, LineCarpet creates a line plot that uses the given carpet identifier as coordinate system. - /// - /// Whether the resulting plot is a cheater or true carpet plot depends on the referenced carpet. - /// - /// Sets the a-axis coordinates on the carpet. - /// Sets the b-axis coordinates on the carpet. - /// The identifier of the carpet that this trace will lie on. - /// Whether to show markers for the individual data points - /// 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. - /// Sets the opactity of the trace - /// Sets the opactity of individual datum markers - /// Sets a text associated with each datum - /// Sets individual text for each datum - /// Sets the position of text associated with each datum - /// Sets the position of text associated with individual datum - /// Sets the color of the marker - /// Sets the colorscale of the marker - /// Sets the outline of the marker - /// Sets the marker symbol for each datum - /// Sets the marker symbol for each individual datum - /// Sets the marker (use this for more finegrained control than the other marker-associated arguments) - /// Sets the color of the line - /// Sets the colorscale of the line - /// Sets the width of the line - /// sets the drawing style of the line - /// Sets the line (use this for more finegrained control than the other line-associated arguments) - /// If set to false, ignore the global default settings set in `Defaults` - public static GenericChart LineCarpet( - IEnumerable a, - IEnumerable b, - string carpetAnchorId, - Optional ShowMarkers = default, - Optional Name = default, - Optional ShowLegend = default, - Optional Opacity = default, - Optional> MultiOpacity = default, - Optional Text = default, - Optional> MultiText = default, - Optional TextPosition = default, - Optional> MultiTextPosition = default, - Optional MarkerColor = default, - Optional MarkerColorScale = default, - Optional MarkerOutline = default, - Optional MarkerSymbol = default, - Optional> MultiMarkerSymbol = default, - Optional Marker = default, - Optional LineColor = default, - Optional LineColorScale = default, - Optional LineWidth = default, - Optional LineDash = default, - Optional Line = default, - Optional UseDefaults = default - ) - where AType : IConvertible - where BType : IConvertible - where TextType : IConvertible - => - Plotly.NET.ChartCarpet_Scatter.Chart.LineCarpet( - a: a, - b: b, - carpetAnchorId: carpetAnchorId, - ShowMarkers: ShowMarkers.ToOption(), - Name: Name.ToOption(), - ShowLegend: ShowLegend.ToOption(), - Opacity: Opacity.ToOption(), - MultiOpacity: MultiOpacity.ToOption(), - Text: Text.ToOption(), - MultiText: MultiText.ToOption(), - TextPosition: TextPosition.ToOption(), - MultiTextPosition: MultiTextPosition.ToOption(), - MarkerColor: MarkerColor.ToOption(), - MarkerColorScale: MarkerColorScale.ToOption(), - MarkerOutline: MarkerOutline.ToOption(), - MarkerSymbol: MarkerSymbol.ToOption(), - MultiMarkerSymbol: MultiMarkerSymbol.ToOption(), - Marker: Marker.ToOption(), - LineColor: LineColor.ToOption(), - LineColorScale: LineColorScale.ToOption(), - LineWidth: LineWidth.ToOption(), - LineDash: LineDash.ToOption(), - Line: Line.ToOption(), - UseDefaults: UseDefaults.ToOption() - ); - - /// - /// Creates a spline plot that lies on a specified carpet. - /// - /// In general, SplineCarpet creates a spline plot that uses the given carpet identifier as coordinate system. - /// A spline chart is a line chart in which data points are connected by smoothed curves. - /// - /// Whether the resulting plot is a cheater or true carpet plot depends on the referenced carpet. - /// - /// Sets the a-axis coordinates on the carpet. - /// Sets the b-axis coordinates on the carpet. - /// The identifier of the carpet that this trace will lie on. - /// Whether to show markers for the individual data points - /// Sets the amount of smoothing. "0" corresponds to no smoothing (equivalent to a "linear" shape). Use values between 0. and 1.3 - /// 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. - /// Sets the opactity of the trace - /// Sets the opactity of individual datum markers - /// Sets a text associated with each datum - /// Sets individual text for each datum - /// Sets the position of text associated with each datum - /// Sets the position of text associated with individual datum - /// Sets the color of the marker - /// Sets the colorscale of the marker - /// Sets the outline of the marker - /// Sets the marker symbol for each datum - /// Sets the marker symbol for each individual datum - /// Sets the marker (use this for more finegrained control than the other marker-associated arguments) - /// Sets the color of the line - /// Sets the colorscale of the line - /// Sets the width of the line - /// sets the drawing style of the line - /// Sets the line (use this for more finegrained control than the other line-associated arguments) - /// If set to false, ignore the global default settings set in `Defaults` - public static GenericChart SplineCarpet( - IEnumerable a, - IEnumerable b, - string carpetAnchorId, - Optional ShowMarkers = default, - Optional Smoothing = default, - Optional Name = default, - Optional ShowLegend = default, - Optional Opacity = default, - Optional> MultiOpacity = default, - Optional Text = default, - Optional> MultiText = default, - Optional TextPosition = default, - Optional> MultiTextPosition = default, - Optional MarkerColor = default, - Optional MarkerColorScale = default, - Optional MarkerOutline = default, - Optional MarkerSymbol = default, - Optional> MultiMarkerSymbol = default, - Optional Marker = default, - Optional LineColor = default, - Optional LineColorScale = default, - Optional LineWidth = default, - Optional LineDash = default, - Optional Line = default, - Optional UseDefaults = default - ) - where AType : IConvertible - where BType : IConvertible - where TextType : IConvertible - => - Plotly.NET.ChartCarpet_Scatter.Chart.SplineCarpet( - a: a, - b: b, - carpetAnchorId: carpetAnchorId, - ShowMarkers: ShowMarkers.ToOption(), - Smoothing: Smoothing.ToOption(), - Name: Name.ToOption(), - ShowLegend: ShowLegend.ToOption(), - Opacity: Opacity.ToOption(), - MultiOpacity: MultiOpacity.ToOption(), - Text: Text.ToOption(), - MultiText: MultiText.ToOption(), - TextPosition: TextPosition.ToOption(), - MultiTextPosition: MultiTextPosition.ToOption(), - MarkerColor: MarkerColor.ToOption(), - MarkerColorScale: MarkerColorScale.ToOption(), - MarkerOutline: MarkerOutline.ToOption(), - MarkerSymbol: MarkerSymbol.ToOption(), - MultiMarkerSymbol: MultiMarkerSymbol.ToOption(), - Marker: Marker.ToOption(), - LineColor: LineColor.ToOption(), - LineColorScale: LineColorScale.ToOption(), - LineWidth: LineWidth.ToOption(), - LineDash: LineDash.ToOption(), - Line: Line.ToOption(), - UseDefaults: UseDefaults.ToOption() - ); - - /// - /// Creates a bubble chart that lies on a specified carpet. - /// - /// In general, BubbleCarpet creates a bubble chart that uses the given carpet identifier as coordinate system. - /// - /// 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. - /// - /// Whether the resulting plot is a cheater or true carpet plot depends on the referenced carpet. - /// - /// Sets the a-axis coordinates on the carpet. - /// Sets the b-axis coordinates on the carpet. - /// Sets the bubble size of the plotted data - /// The identifier of the carpet that this trace will lie on. - /// 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. - /// Sets the opactity of the trace - /// Sets the opactity of individual datum markers - /// Sets a text associated with each datum - /// Sets individual text for each datum - /// Sets the position of text associated with each datum - /// Sets the position of text associated with individual datum - /// Sets the color of the marker - /// Sets the colorscale of the marker - /// Sets the outline of the marker - /// Sets the marker symbol for each datum - /// Sets the marker symbol for each individual datum - /// Sets the marker (use this for more finegrained control than the other marker-associated arguments) - /// Sets the color of the line - /// Sets the colorscale of the line - /// Sets the width of the line - /// sets the drawing style of the line - /// Sets the line (use this for more finegrained control than the other line-associated arguments) - /// If set to false, ignore the global default settings set in `Defaults` - public static GenericChart BubbleCarpet( - IEnumerable a, - IEnumerable b, - IEnumerable sizes, - string carpetAnchorId, - Optional Name = default, - Optional ShowLegend = default, - Optional Opacity = default, - Optional> MultiOpacity = default, - Optional Text = default, - Optional> MultiText = default, - Optional TextPosition = default, - Optional> MultiTextPosition = default, - Optional MarkerColor = default, - Optional MarkerColorScale = default, - Optional MarkerOutline = default, - Optional MarkerSymbol = default, - Optional> MultiMarkerSymbol = default, - Optional Marker = default, - Optional LineColor = default, - Optional LineColorScale = default, - Optional LineWidth = default, - Optional LineDash = default, - Optional Line = default, - Optional UseDefaults = default - ) - where AType : IConvertible - where BType : IConvertible - where TextType : IConvertible - => - Plotly.NET.ChartCarpet_Scatter.Chart.BubbleCarpet( - a: a, - b: b, - sizes: sizes, - carpetAnchorId: carpetAnchorId, - Name: Name.ToOption(), - ShowLegend: ShowLegend.ToOption(), - Opacity: Opacity.ToOption(), - MultiOpacity: MultiOpacity.ToOption(), - Text: Text.ToOption(), - MultiText: MultiText.ToOption(), - TextPosition: TextPosition.ToOption(), - MultiTextPosition: MultiTextPosition.ToOption(), - MarkerColor: MarkerColor.ToOption(), - MarkerColorScale: MarkerColorScale.ToOption(), - MarkerOutline: MarkerOutline.ToOption(), - MarkerSymbol: MarkerSymbol.ToOption(), - MultiMarkerSymbol: MultiMarkerSymbol.ToOption(), - Marker: Marker.ToOption(), - LineColor: LineColor.ToOption(), - LineColorScale: LineColorScale.ToOption(), - LineWidth: LineWidth.ToOption(), - LineDash: LineDash.ToOption(), - Line: Line.ToOption(), - UseDefaults: UseDefaults.ToOption() - ); - - /// - /// Creates a contour chart that lies on a specified carpet. - /// - /// Plots contours on either the first carpet axis or the carpet axis with a matching `carpet` attribute. Data `z` is interpreted as matching that of the corresponding carpet axis. - /// - /// The identifier of the carpet that this trace will lie on. - /// Sets the z 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. - /// Sets the opactity of the trace - /// Sets the a coordinates. - /// Sets the b coordinates. - /// Sets a text associated with each datum - /// Sets individual text for each datum - /// Sets the colorbar of this trace. - /// Sets the colorscale of this trace. - /// Determines whether or not a colorbar is displayed for this trace. - /// Reverses the color mapping if true. If true, `zmin` will correspond to the last color in the array and `zmax` will correspond to the first color. - /// Transposes the z data. - /// Sets the contour line dash style - /// Sets the contour line color - /// Sets the amount of smoothing for the contour lines, where "0" corresponds to no smoothing. - /// Sets the contour lines (use this for more finegrained control than the other contourline-associated arguments). - /// Determines the coloring method showing the contour values. If "fill", coloring is done evenly between each contour level If "heatmap", a heatmap gradient coloring is applied between each contour level. If "lines", coloring is done on the contour lines. If "none", no coloring is applied on this trace. - /// Sets the constraint operation. "=" keeps regions equal to `value` "<" and "<=" keep regions less than `value` ">" and ">=" keep regions greater than `value` "[]", "()", "[)", and "(]" keep regions inside `value[0]` to `value[1]` "][", ")(", "](", ")[" keep regions outside `value[0]` to value[1]` Open vs. closed intervals make no difference to constraint display, but all versions are allowed for consistency with filter transforms. - /// If `levels`, the data is represented as a contour plot with multiple levels displayed. If `constraint`, the data is represented as constraints with the invalid region shaded as specified by the `operation` and `value` parameters. - /// Determines whether to label the contour lines with their values. - /// Sets the font used for labeling the contour levels. The default color comes from the lines, if shown. The default family and size come from `layout.font`. - /// Sets the styles of the contours (use this for more finegrained control than the other contour-associated arguments). - /// If set to false, ignore the global default settings set in `Defaults` - public static GenericChart ContourCarpet( - IEnumerable z, - string carpetAnchorId, - Optional Name = default, - Optional ShowLegend = default, - Optional Opacity = default, - Optional> A = default, - Optional> B = default, - Optional Text = default, - Optional> MultiText = default, - Optional ColorBar = default, - Optional ColorScale = default, - Optional ShowScale = default, - Optional ReverseScale = default, - Optional Transpose = default, - Optional ContourLineColor = default, - Optional ContourLineDash = default, - Optional ContourLineSmoothing = default, - Optional ContourLine = default, - Optional ContoursColoring = default, - Optional ContoursOperation = default, - Optional ContoursType = default, - Optional ShowContourLabels = default, - Optional ContourLabelFont = default, - Optional Contours = default, - Optional UseDefaults = default - ) - where ZType : IConvertible - where AType : IConvertible - where BType : IConvertible - where TextType : IConvertible - => - Plotly.NET.ChartCarpet_Contour.Chart.ContourCarpet( - z: z, - carpetAnchorId: carpetAnchorId, - Name: Name.ToOption(), - ShowLegend: ShowLegend.ToOption(), - Opacity: Opacity.ToOption(), - A: A.ToOption(), - B: B.ToOption(), - Text: Text.ToOption(), - MultiText: MultiText.ToOption(), - ColorBar: ColorBar.ToOption(), - ColorScale: ColorScale.ToOption(), - ShowScale: ShowScale.ToOption(), - ReverseScale: ReverseScale.ToOption(), - Transpose: Transpose.ToOption(), - ContourLineColor: ContourLineColor.ToOption(), - ContourLineDash: ContourLineDash.ToOption(), - ContourLineSmoothing: ContourLineSmoothing.ToOption(), - ContourLine: ContourLine.ToOption(), - ContoursColoring: ContoursColoring.ToOption(), - ContoursOperation: ContoursOperation.ToOption(), - ContoursType: ContoursType.ToOption(), - ShowContourLabels: ShowContourLabels.ToOption(), - ContourLabelFont: ContourLabelFont.ToOption(), - Contours: Contours.ToOption(), - UseDefaults: UseDefaults.ToOption() - ); - } -} - diff --git a/src/Plotly.NET.CSharp/ChartAPI/ChartCarpet/BubbleCarpet.cs b/src/Plotly.NET.CSharp/ChartAPI/ChartCarpet/BubbleCarpet.cs new file mode 100644 index 00000000..b9ebb40a --- /dev/null +++ b/src/Plotly.NET.CSharp/ChartAPI/ChartCarpet/BubbleCarpet.cs @@ -0,0 +1,101 @@ +using System; +using System.Collections.Generic; +using Plotly.NET; +using Plotly.NET.LayoutObjects; +using Plotly.NET.TraceObjects; +using static Plotly.NET.StyleParam; + +namespace Plotly.NET.CSharp; + +public static partial class Chart +{ + /// + /// Creates a bubble chart that lies on a specified carpet. + /// + /// In general, BubbleCarpet creates a bubble chart that uses the given carpet identifier as coordinate system. + /// + /// 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. + /// + /// Whether the resulting plot is a cheater or true carpet plot depends on the referenced carpet. + /// + /// Sets the a-axis coordinates on the carpet. + /// Sets the b-axis coordinates on the carpet. + /// Sets the bubble size of the plotted data + /// The identifier of the carpet that this trace will lie on. + /// 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. + /// Sets the opactity of the trace + /// Sets the opactity of individual datum markers + /// Sets a text associated with each datum + /// Sets individual text for each datum + /// Sets the position of text associated with each datum + /// Sets the position of text associated with individual datum + /// Sets the color of the marker + /// Sets the colorscale of the marker + /// Sets the outline of the marker + /// Sets the marker symbol for each datum + /// Sets the marker symbol for each individual datum + /// Sets the marker (use this for more finegrained control than the other marker-associated arguments) + /// Sets the color of the line + /// Sets the colorscale of the line + /// Sets the width of the line + /// sets the drawing style of the line + /// Sets the line (use this for more finegrained control than the other line-associated arguments) + /// If set to false, ignore the global default settings set in `Defaults` + public static GenericChart BubbleCarpet( + IEnumerable a, + IEnumerable b, + IEnumerable sizes, + string carpetAnchorId, + Optional Name = default, + Optional ShowLegend = default, + Optional Opacity = default, + Optional> MultiOpacity = default, + Optional Text = default, + Optional> MultiText = default, + Optional TextPosition = default, + Optional> MultiTextPosition = default, + Optional MarkerColor = default, + Optional MarkerColorScale = default, + Optional MarkerOutline = default, + Optional MarkerSymbol = default, + Optional> MultiMarkerSymbol = default, + Optional Marker = default, + Optional LineColor = default, + Optional LineColorScale = default, + Optional LineWidth = default, + Optional LineDash = default, + Optional Line = default, + Optional UseDefaults = default + ) + where AType : IConvertible + where BType : IConvertible + where TextType : IConvertible + => + Plotly.NET.ChartCarpet_Scatter.Chart.BubbleCarpet( + a: a, + b: b, + sizes: sizes, + carpetAnchorId: carpetAnchorId, + Name: Name.ToOption(), + ShowLegend: ShowLegend.ToOption(), + Opacity: Opacity.ToOption(), + MultiOpacity: MultiOpacity.ToOption(), + Text: Text.ToOption(), + MultiText: MultiText.ToOption(), + TextPosition: TextPosition.ToOption(), + MultiTextPosition: MultiTextPosition.ToOption(), + MarkerColor: MarkerColor.ToOption(), + MarkerColorScale: MarkerColorScale.ToOption(), + MarkerOutline: MarkerOutline.ToOption(), + MarkerSymbol: MarkerSymbol.ToOption(), + MultiMarkerSymbol: MultiMarkerSymbol.ToOption(), + Marker: Marker.ToOption(), + LineColor: LineColor.ToOption(), + LineColorScale: LineColorScale.ToOption(), + LineWidth: LineWidth.ToOption(), + LineDash: LineDash.ToOption(), + Line: Line.ToOption(), + UseDefaults: UseDefaults.ToOption() + ); +} diff --git a/src/Plotly.NET.CSharp/ChartAPI/ChartCarpet/Carpet.cs b/src/Plotly.NET.CSharp/ChartAPI/ChartCarpet/Carpet.cs new file mode 100644 index 00000000..2fee244f --- /dev/null +++ b/src/Plotly.NET.CSharp/ChartAPI/ChartCarpet/Carpet.cs @@ -0,0 +1,91 @@ +using System; +using System.Collections.Generic; +using Plotly.NET; +using Plotly.NET.LayoutObjects; +using Plotly.NET.TraceObjects; +using static Plotly.NET.StyleParam; + +namespace Plotly.NET.CSharp; + +public static partial class Chart +{ + /// + /// Creates a carpet in a 2D coordinate system to be used as additional coordinate system in a carpet plot. + /// + /// A carpet plot illustrates the interaction between two or more independent variables and one or more dependent variables in a two-dimensional plot. + /// Besides the ability to incorporate more variables, another feature that distinguishes a carpet plot from an equivalent contour plot or 3D surface plot is that a carpet plot can be used to more accurately interpolate data points. + /// A conventional carpet plot can capture the interaction of up to three independent variables and three dependent variables and still be easily read and interpolated. + /// + /// Three-variable carpet plot (cheater plot): + /// + /// A carpet plot with two independent variables and one dependent variable is often called a cheater plot for the use of a phantom "cheater" axis instead of the horizontal axis. As a result of this missing axis, the values can be shifted horizontally such that the intersections line up vertically. This allows easy interpolation by having fixed horizontal intervals correspond to fixed intervals in both independent variables. + /// + /// Four-variable carpet plot (true carpet plot) + /// + /// Instead of using the horizontal axis to adjust the plot perspective and align carpet intersections vertically, the horizontal axis can be used to show the effects on an additional dependent variable.[5] In this case the perspective is fixed, and any overlapping cannot be adjusted. Because a true carpet plot represents two independent variables and two dependent variables simultaneously, there is no corresponding way to show the information on a conventional contour plot or 3D surface plot. + /// + /// (from https://en.wikipedia.org/wiki/Carpet_plot @ 1/11/2021) + /// + /// An identifier for this carpet, so that `scattercarpet` and `contourcarpet` traces can specify a carpet plot on which they lie. + /// 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. + /// Sets the opactity of the trace + /// A one dimensional array of x coordinates matching the dimensions of `a` and `b`. + /// A two dimensional array of x coordinates at each carpet point. If omitted, the plot is a cheater plot and the xaxis is hidden by default. + /// A one dimensional array of y coordinates matching the dimensions of `a` and `b`. + /// A two dimensional array of y coordinates at each carpet point. + /// An array containing values of the first parameter value + /// An array containing values of the second parameter value + /// Sets this carpet's a axis. + /// Sets this carpet's b axis. + /// Sets a reference between this trace's x coordinates and a 2D cartesian x axis. If "x" (the default value), the x coordinates refer to `layout.xaxis`. If "x2", the x coordinates refer to `layout.xaxis2`, and so on. + /// Sets a reference between this trace's y coordinates and a 2D cartesian y axis. If "y" (the default value), the y coordinates refer to `layout.yaxis`. If "y2", the y coordinates refer to `layout.yaxis2`, and so on. + /// Sets default for all colors associated with this axis all at once: line, font, tick, and grid colors. Grid color is lightened by blending this with the plot background Individual pieces can override this. + /// The shift applied to each successive row of data in creating a cheater plot. Only used if `x` is been omitted. + /// If set to false, ignore the global default settings set in `Defaults` + public static GenericChart Carpet( + string carpetId, + Optional Name = default, + Optional ShowLegend = default, + Optional Opacity = default, + Optional> X = default, + Optional>> MultiX = default, + Optional> Y = default, + Optional>> MultiY = default, + Optional> A = default, + Optional> B = default, + Optional AAxis = default, + Optional BAxis = default, + Optional XAxis = default, + Optional YAxis = default, + Optional Color = default, + Optional CheaterSlope = default, + Optional UseDefaults = default + ) + where XType : IConvertible + where MultiXType : IConvertible + where YType : IConvertible + where MultiYType : IConvertible + where AType : IConvertible + where BType : IConvertible + => + Plotly.NET.ChartCarpet_Base.Chart.Carpet, MultiXType, YType, IEnumerable, MultiYType, AType, BType>( + carpetId: carpetId, + Name: Name.ToOption(), + ShowLegend: ShowLegend.ToOption(), + Opacity: Opacity.ToOption(), + X: X.ToOption(), + MultiX: MultiX.ToOption(), + Y: Y.ToOption(), + MultiY: MultiY.ToOption(), + A: A.ToOption(), + B: B.ToOption(), + AAxis: AAxis.ToOption(), + BAxis: BAxis.ToOption(), + XAxis: XAxis.ToOption(), + YAxis: YAxis.ToOption(), + Color: Color.ToOption(), + CheaterSlope: CheaterSlope.ToOption(), + UseDefaults: UseDefaults.ToOption() + ); +} diff --git a/src/Plotly.NET.CSharp/ChartAPI/ChartCarpet/ContourCarpet.cs b/src/Plotly.NET.CSharp/ChartAPI/ChartCarpet/ContourCarpet.cs new file mode 100644 index 00000000..525885b8 --- /dev/null +++ b/src/Plotly.NET.CSharp/ChartAPI/ChartCarpet/ContourCarpet.cs @@ -0,0 +1,101 @@ +using System; +using System.Collections.Generic; +using Plotly.NET; +using Plotly.NET.LayoutObjects; +using Plotly.NET.TraceObjects; +using static Plotly.NET.StyleParam; + +namespace Plotly.NET.CSharp; + +public static partial class Chart +{ + /// + /// Creates a contour chart that lies on a specified carpet. + /// + /// Plots contours on either the first carpet axis or the carpet axis with a matching `carpet` attribute. Data `z` is interpreted as matching that of the corresponding carpet axis. + /// + /// The identifier of the carpet that this trace will lie on. + /// Sets the z 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. + /// Sets the opactity of the trace + /// Sets the a coordinates. + /// Sets the b coordinates. + /// Sets a text associated with each datum + /// Sets individual text for each datum + /// Sets the colorbar of this trace. + /// Sets the colorscale of this trace. + /// Determines whether or not a colorbar is displayed for this trace. + /// Reverses the color mapping if true. If true, `zmin` will correspond to the last color in the array and `zmax` will correspond to the first color. + /// Transposes the z data. + /// Sets the contour line dash style + /// Sets the contour line color + /// Sets the amount of smoothing for the contour lines, where "0" corresponds to no smoothing. + /// Sets the contour lines (use this for more finegrained control than the other contourline-associated arguments). + /// Determines the coloring method showing the contour values. If "fill", coloring is done evenly between each contour level If "heatmap", a heatmap gradient coloring is applied between each contour level. If "lines", coloring is done on the contour lines. If "none", no coloring is applied on this trace. + /// Sets the constraint operation. "=" keeps regions equal to `value` "<" and "<=" keep regions less than `value` ">" and ">=" keep regions greater than `value` "[]", "()", "[)", and "(]" keep regions inside `value[0]` to `value[1]` "][", ")(", "](", ")[" keep regions outside `value[0]` to value[1]` Open vs. closed intervals make no difference to constraint display, but all versions are allowed for consistency with filter transforms. + /// If `levels`, the data is represented as a contour plot with multiple levels displayed. If `constraint`, the data is represented as constraints with the invalid region shaded as specified by the `operation` and `value` parameters. + /// Determines whether to label the contour lines with their values. + /// Sets the font used for labeling the contour levels. The default color comes from the lines, if shown. The default family and size come from `layout.font`. + /// Sets the styles of the contours (use this for more finegrained control than the other contour-associated arguments). + /// If set to false, ignore the global default settings set in `Defaults` + public static GenericChart ContourCarpet( + IEnumerable z, + string carpetAnchorId, + Optional Name = default, + Optional ShowLegend = default, + Optional Opacity = default, + Optional> A = default, + Optional> B = default, + Optional Text = default, + Optional> MultiText = default, + Optional ColorBar = default, + Optional ColorScale = default, + Optional ShowScale = default, + Optional ReverseScale = default, + Optional Transpose = default, + Optional ContourLineColor = default, + Optional ContourLineDash = default, + Optional ContourLineSmoothing = default, + Optional ContourLine = default, + Optional ContoursColoring = default, + Optional ContoursOperation = default, + Optional ContoursType = default, + Optional ShowContourLabels = default, + Optional ContourLabelFont = default, + Optional Contours = default, + Optional UseDefaults = default + ) + where ZType : IConvertible + where AType : IConvertible + where BType : IConvertible + where TextType : IConvertible + => + Plotly.NET.ChartCarpet_Contour.Chart.ContourCarpet( + z: z, + carpetAnchorId: carpetAnchorId, + Name: Name.ToOption(), + ShowLegend: ShowLegend.ToOption(), + Opacity: Opacity.ToOption(), + A: A.ToOption(), + B: B.ToOption(), + Text: Text.ToOption(), + MultiText: MultiText.ToOption(), + ColorBar: ColorBar.ToOption(), + ColorScale: ColorScale.ToOption(), + ShowScale: ShowScale.ToOption(), + ReverseScale: ReverseScale.ToOption(), + Transpose: Transpose.ToOption(), + ContourLineColor: ContourLineColor.ToOption(), + ContourLineDash: ContourLineDash.ToOption(), + ContourLineSmoothing: ContourLineSmoothing.ToOption(), + ContourLine: ContourLine.ToOption(), + ContoursColoring: ContoursColoring.ToOption(), + ContoursOperation: ContoursOperation.ToOption(), + ContoursType: ContoursType.ToOption(), + ShowContourLabels: ShowContourLabels.ToOption(), + ContourLabelFont: ContourLabelFont.ToOption(), + Contours: Contours.ToOption(), + UseDefaults: UseDefaults.ToOption() + ); +} diff --git a/src/Plotly.NET.CSharp/ChartAPI/ChartCarpet/LineCarpet.cs b/src/Plotly.NET.CSharp/ChartAPI/ChartCarpet/LineCarpet.cs new file mode 100644 index 00000000..a86ccce2 --- /dev/null +++ b/src/Plotly.NET.CSharp/ChartAPI/ChartCarpet/LineCarpet.cs @@ -0,0 +1,99 @@ +using System; +using System.Collections.Generic; +using Plotly.NET; +using Plotly.NET.LayoutObjects; +using Plotly.NET.TraceObjects; +using static Plotly.NET.StyleParam; + +namespace Plotly.NET.CSharp; + +public static partial class Chart +{ + /// + /// Creates a line plot that lies on a specified carpet. + /// + /// In general, LineCarpet creates a line plot that uses the given carpet identifier as coordinate system. + /// + /// Whether the resulting plot is a cheater or true carpet plot depends on the referenced carpet. + /// + /// Sets the a-axis coordinates on the carpet. + /// Sets the b-axis coordinates on the carpet. + /// The identifier of the carpet that this trace will lie on. + /// Whether to show markers for the individual data points + /// 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. + /// Sets the opactity of the trace + /// Sets the opactity of individual datum markers + /// Sets a text associated with each datum + /// Sets individual text for each datum + /// Sets the position of text associated with each datum + /// Sets the position of text associated with individual datum + /// Sets the color of the marker + /// Sets the colorscale of the marker + /// Sets the outline of the marker + /// Sets the marker symbol for each datum + /// Sets the marker symbol for each individual datum + /// Sets the marker (use this for more finegrained control than the other marker-associated arguments) + /// Sets the color of the line + /// Sets the colorscale of the line + /// Sets the width of the line + /// sets the drawing style of the line + /// Sets the line (use this for more finegrained control than the other line-associated arguments) + /// If set to false, ignore the global default settings set in `Defaults` + public static GenericChart LineCarpet( + IEnumerable a, + IEnumerable b, + string carpetAnchorId, + Optional ShowMarkers = default, + Optional Name = default, + Optional ShowLegend = default, + Optional Opacity = default, + Optional> MultiOpacity = default, + Optional Text = default, + Optional> MultiText = default, + Optional TextPosition = default, + Optional> MultiTextPosition = default, + Optional MarkerColor = default, + Optional MarkerColorScale = default, + Optional MarkerOutline = default, + Optional MarkerSymbol = default, + Optional> MultiMarkerSymbol = default, + Optional Marker = default, + Optional LineColor = default, + Optional LineColorScale = default, + Optional LineWidth = default, + Optional LineDash = default, + Optional Line = default, + Optional UseDefaults = default + ) + where AType : IConvertible + where BType : IConvertible + where TextType : IConvertible + => + Plotly.NET.ChartCarpet_Scatter.Chart.LineCarpet( + a: a, + b: b, + carpetAnchorId: carpetAnchorId, + ShowMarkers: ShowMarkers.ToOption(), + Name: Name.ToOption(), + ShowLegend: ShowLegend.ToOption(), + Opacity: Opacity.ToOption(), + MultiOpacity: MultiOpacity.ToOption(), + Text: Text.ToOption(), + MultiText: MultiText.ToOption(), + TextPosition: TextPosition.ToOption(), + MultiTextPosition: MultiTextPosition.ToOption(), + MarkerColor: MarkerColor.ToOption(), + MarkerColorScale: MarkerColorScale.ToOption(), + MarkerOutline: MarkerOutline.ToOption(), + MarkerSymbol: MarkerSymbol.ToOption(), + MultiMarkerSymbol: MultiMarkerSymbol.ToOption(), + Marker: Marker.ToOption(), + LineColor: LineColor.ToOption(), + LineColorScale: LineColorScale.ToOption(), + LineWidth: LineWidth.ToOption(), + LineDash: LineDash.ToOption(), + Line: Line.ToOption(), + UseDefaults: UseDefaults.ToOption() + ); +} diff --git a/src/Plotly.NET.CSharp/ChartAPI/ChartCarpet/PointCarpet.cs b/src/Plotly.NET.CSharp/ChartAPI/ChartCarpet/PointCarpet.cs new file mode 100644 index 00000000..3fa13859 --- /dev/null +++ b/src/Plotly.NET.CSharp/ChartAPI/ChartCarpet/PointCarpet.cs @@ -0,0 +1,81 @@ +using System; +using System.Collections.Generic; +using Plotly.NET; +using Plotly.NET.LayoutObjects; +using Plotly.NET.TraceObjects; +using static Plotly.NET.StyleParam; + +namespace Plotly.NET.CSharp; + +public static partial class Chart +{ + /// + /// Creates a point plot that lies on a specified carpet. + /// + /// In general, PointCarpet creates a point plot that uses the given carpet identifier as coordinate system. + /// + /// Whether the resulting plot is a cheater or true carpet plot depends on the referenced carpet. + /// + /// Sets the a-axis coordinates on the carpet. + /// Sets the b-axis coordinates on the carpet. + /// The identifier of the carpet that this trace will lie on. + /// 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. + /// Sets the opactity of the trace + /// Sets the opactity of individual datum markers + /// Sets a text associated with each datum + /// Sets individual text for each datum + /// Sets the position of text associated with each datum + /// Sets the position of text associated with individual datum + /// Sets the color of the marker + /// Sets the colorscale of the marker + /// Sets the outline of the marker + /// Sets the marker symbol for each datum + /// Sets the marker symbol for each individual datum + /// Sets the marker (use this for more finegrained control than the other marker-associated arguments) + /// If set to false, ignore the global default settings set in `Defaults` + public static GenericChart PointCarpet( + IEnumerable a, + IEnumerable b, + string carpetAnchorId, + Optional Name = default, + Optional ShowLegend = default, + Optional Opacity = default, + Optional> MultiOpacity = default, + Optional Text = default, + Optional> MultiText = default, + Optional TextPosition = default, + Optional> MultiTextPosition = default, + Optional MarkerColor = default, + Optional MarkerColorScale = default, + Optional MarkerOutline = default, + Optional MarkerSymbol = default, + Optional> MultiMarkerSymbol = default, + Optional Marker = default, + Optional UseDefaults = default + ) + where AType : IConvertible + where BType : IConvertible + where TextType : IConvertible + => + Plotly.NET.ChartCarpet_Scatter.Chart.PointCarpet( + a: a, + b: b, + carpetAnchorId: carpetAnchorId, + Name: Name.ToOption(), + ShowLegend: ShowLegend.ToOption(), + Opacity: Opacity.ToOption(), + MultiOpacity: MultiOpacity.ToOption(), + Text: Text.ToOption(), + MultiText: MultiText.ToOption(), + TextPosition: TextPosition.ToOption(), + MultiTextPosition: MultiTextPosition.ToOption(), + MarkerColor: MarkerColor.ToOption(), + MarkerColorScale: MarkerColorScale.ToOption(), + MarkerOutline: MarkerOutline.ToOption(), + MarkerSymbol: MarkerSymbol.ToOption(), + MultiMarkerSymbol: MultiMarkerSymbol.ToOption(), + Marker: Marker.ToOption(), + UseDefaults: UseDefaults.ToOption() + ); +} diff --git a/src/Plotly.NET.CSharp/ChartAPI/ChartCarpet/ScatterCarpet.cs b/src/Plotly.NET.CSharp/ChartAPI/ChartCarpet/ScatterCarpet.cs new file mode 100644 index 00000000..8f86a682 --- /dev/null +++ b/src/Plotly.NET.CSharp/ChartAPI/ChartCarpet/ScatterCarpet.cs @@ -0,0 +1,101 @@ +using System; +using System.Collections.Generic; +using Plotly.NET; +using Plotly.NET.LayoutObjects; +using Plotly.NET.TraceObjects; +using static Plotly.NET.StyleParam; + +namespace Plotly.NET.CSharp; + +public static partial class Chart +{ + /// + /// Creates a scatter plot that lies on a specified carpet. + /// + /// In general, ScatterCarpet creates a plot that uses the given carpet identifier as coordinate system. + /// + /// Whether the resulting plot is a cheater or true carpet plot depends on the referenced carpet. + /// + /// ScatterCarpet charts are the basis of PointCarpet, LineCarpet, and BubbleCarpet Charts, and can be customized as such. We also provide abstractions for those: Chart.LineCarpet, Chart.PointCarpet, Chart.BubbleCarpet + /// + /// Sets the a-axis coordinates on the carpet. + /// Sets the b-axis coordinates on the carpet. + /// Determines the drawing mode for this scatter trace. If the provided `mode` includes "text" then the `text` elements appear at the coordinates. Otherwise, the `text` elements appear on hover. If there are less than 20 points and the trace is not stacked then the default is "lines+markers". Otherwise, "lines". + /// The identifier of the carpet that this trace will lie on. + /// 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. + /// Sets the opactity of the trace + /// Sets the opactity of individual datum markers + /// Sets a text associated with each datum + /// Sets individual text for each datum + /// Sets the position of text associated with each datum + /// Sets the position of text associated with individual datum + /// Sets the color of the marker + /// Sets the colorscale of the marker + /// Sets the outline of the marker + /// Sets the marker symbol for each datum + /// Sets the marker symbol for each individual datum + /// Sets the marker (use this for more finegrained control than the other marker-associated arguments) + /// Sets the color of the line + /// Sets the colorscale of the line + /// Sets the width of the line + /// sets the drawing style of the line + /// Sets the line (use this for more finegrained control than the other line-associated arguments) + /// If set to false, ignore the global default settings set in `Defaults` + public static GenericChart ScatterCarpet( + IEnumerable a, + IEnumerable b, + StyleParam.Mode mode, + string carpetAnchorId, + Optional Name = default, + Optional ShowLegend = default, + Optional Opacity = default, + Optional> MultiOpacity = default, + Optional Text = default, + Optional> MultiText = default, + Optional TextPosition = default, + Optional> MultiTextPosition = default, + Optional MarkerColor = default, + Optional MarkerColorScale = default, + Optional MarkerOutline = default, + Optional MarkerSymbol = default, + Optional> MultiMarkerSymbol = default, + Optional Marker = default, + Optional LineColor = default, + Optional LineColorScale = default, + Optional LineWidth = default, + Optional LineDash = default, + Optional Line = default, + Optional UseDefaults = default + ) + where AType : IConvertible + where BType : IConvertible + where TextType : IConvertible + => + Plotly.NET.ChartCarpet_Scatter.Chart.ScatterCarpet( + a: a, + b: b, + mode: mode, + carpetAnchorId: carpetAnchorId, + Name: Name.ToOption(), + ShowLegend: ShowLegend.ToOption(), + Opacity: Opacity.ToOption(), + MultiOpacity: MultiOpacity.ToOption(), + Text: Text.ToOption(), + MultiText: MultiText.ToOption(), + TextPosition: TextPosition.ToOption(), + MultiTextPosition: MultiTextPosition.ToOption(), + MarkerColor: MarkerColor.ToOption(), + MarkerColorScale: MarkerColorScale.ToOption(), + MarkerOutline: MarkerOutline.ToOption(), + MarkerSymbol: MarkerSymbol.ToOption(), + MultiMarkerSymbol: MultiMarkerSymbol.ToOption(), + Marker: Marker.ToOption(), + LineColor: LineColor.ToOption(), + LineColorScale: LineColorScale.ToOption(), + LineWidth: LineWidth.ToOption(), + LineDash: LineDash.ToOption(), + Line: Line.ToOption(), + UseDefaults: UseDefaults.ToOption() + ); +} diff --git a/src/Plotly.NET.CSharp/ChartAPI/ChartCarpet/SplineCarpet.cs b/src/Plotly.NET.CSharp/ChartAPI/ChartCarpet/SplineCarpet.cs new file mode 100644 index 00000000..6bc5a1de --- /dev/null +++ b/src/Plotly.NET.CSharp/ChartAPI/ChartCarpet/SplineCarpet.cs @@ -0,0 +1,103 @@ +using System; +using System.Collections.Generic; +using Plotly.NET; +using Plotly.NET.LayoutObjects; +using Plotly.NET.TraceObjects; +using static Plotly.NET.StyleParam; + +namespace Plotly.NET.CSharp; + +public static partial class Chart +{ + /// + /// Creates a spline plot that lies on a specified carpet. + /// + /// In general, SplineCarpet creates a spline plot that uses the given carpet identifier as coordinate system. + /// A spline chart is a line chart in which data points are connected by smoothed curves. + /// + /// Whether the resulting plot is a cheater or true carpet plot depends on the referenced carpet. + /// + /// Sets the a-axis coordinates on the carpet. + /// Sets the b-axis coordinates on the carpet. + /// The identifier of the carpet that this trace will lie on. + /// Whether to show markers for the individual data points + /// Sets the amount of smoothing. "0" corresponds to no smoothing (equivalent to a "linear" shape). Use values between 0. and 1.3 + /// 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. + /// Sets the opactity of the trace + /// Sets the opactity of individual datum markers + /// Sets a text associated with each datum + /// Sets individual text for each datum + /// Sets the position of text associated with each datum + /// Sets the position of text associated with individual datum + /// Sets the color of the marker + /// Sets the colorscale of the marker + /// Sets the outline of the marker + /// Sets the marker symbol for each datum + /// Sets the marker symbol for each individual datum + /// Sets the marker (use this for more finegrained control than the other marker-associated arguments) + /// Sets the color of the line + /// Sets the colorscale of the line + /// Sets the width of the line + /// sets the drawing style of the line + /// Sets the line (use this for more finegrained control than the other line-associated arguments) + /// If set to false, ignore the global default settings set in `Defaults` + public static GenericChart SplineCarpet( + IEnumerable a, + IEnumerable b, + string carpetAnchorId, + Optional ShowMarkers = default, + Optional Smoothing = default, + Optional Name = default, + Optional ShowLegend = default, + Optional Opacity = default, + Optional> MultiOpacity = default, + Optional Text = default, + Optional> MultiText = default, + Optional TextPosition = default, + Optional> MultiTextPosition = default, + Optional MarkerColor = default, + Optional MarkerColorScale = default, + Optional MarkerOutline = default, + Optional MarkerSymbol = default, + Optional> MultiMarkerSymbol = default, + Optional Marker = default, + Optional LineColor = default, + Optional LineColorScale = default, + Optional LineWidth = default, + Optional LineDash = default, + Optional Line = default, + Optional UseDefaults = default + ) + where AType : IConvertible + where BType : IConvertible + where TextType : IConvertible + => + Plotly.NET.ChartCarpet_Scatter.Chart.SplineCarpet( + a: a, + b: b, + carpetAnchorId: carpetAnchorId, + ShowMarkers: ShowMarkers.ToOption(), + Smoothing: Smoothing.ToOption(), + Name: Name.ToOption(), + ShowLegend: ShowLegend.ToOption(), + Opacity: Opacity.ToOption(), + MultiOpacity: MultiOpacity.ToOption(), + Text: Text.ToOption(), + MultiText: MultiText.ToOption(), + TextPosition: TextPosition.ToOption(), + MultiTextPosition: MultiTextPosition.ToOption(), + MarkerColor: MarkerColor.ToOption(), + MarkerColorScale: MarkerColorScale.ToOption(), + MarkerOutline: MarkerOutline.ToOption(), + MarkerSymbol: MarkerSymbol.ToOption(), + MultiMarkerSymbol: MultiMarkerSymbol.ToOption(), + Marker: Marker.ToOption(), + LineColor: LineColor.ToOption(), + LineColorScale: LineColorScale.ToOption(), + LineWidth: LineWidth.ToOption(), + LineDash: LineDash.ToOption(), + Line: Line.ToOption(), + UseDefaults: UseDefaults.ToOption() + ); +} diff --git a/src/Plotly.NET.CSharp/ChartAPI/ChartDomain.cs b/src/Plotly.NET.CSharp/ChartAPI/ChartDomain.cs deleted file mode 100644 index d4805812..00000000 --- a/src/Plotly.NET.CSharp/ChartAPI/ChartDomain.cs +++ /dev/null @@ -1,889 +0,0 @@ -using Microsoft.FSharp.Core; -using Plotly.NET; -using Plotly.NET.LayoutObjects; -using Plotly.NET.TraceObjects; -using System; -using System.Collections.Generic; -using System.Runtime.InteropServices; - - -namespace Plotly.NET.CSharp -{ - public static partial class Chart - { - /// - /// Creates a pie chart. - /// - /// A pie chart (or a circle chart) is a circular statistical graphic, which is divided into slices to illustrate numerical proportion. - /// In a pie chart, the arc length of each slice (and consequently its central angle and area), is proportional to the quantity it represents. - /// - /// Sets the values of the sectors - /// 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. - /// Sets the opactity of the trace - /// Sets the opactity of individual datum markers - /// Sets the sector labels. If `labels` entries are duplicated, the associated `values` are summed. - /// Sets the fraction of larger radius to pull the sectors out from the center. This can be a constant to pull all slices apart from each other equally or an array to highlight one or more slices. - /// Sets the fraction of larger radius to pull the sectors out from the center. This can be a constant to pull all slices apart from each other equally or an array to highlight one or more slices. - /// Sets text elements associated with each (x,y) pair. If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace's (x,y) coordinates. If trace `hoverinfo` contains a "text" flag and "hovertext" is not set, these elements will be seen in the hover labels. - /// Sets text elements associated with each (x,y) pair. If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace's (x,y) coordinates. If trace `hoverinfo` contains a "text" flag and "hovertext" is not set, these elements will be seen in the hover labels. - /// Sets the positions of the `text` elements with respects to the (x,y) coordinates. - /// Sets the positions of the `text` elements with respects to the (x,y) coordinates. - /// Sets the colors associated with each section. - /// Sets the color of the section outline. - /// Sets the width of the section outline. - /// Sets the width of each individual section outline. - /// Sets the section outline (use this for more finegrained control than the other section outline-associated arguments). - /// Sets a pattern shape for all sections - /// Sets an individual pattern shape for each bar - /// Sets the marker pattern (use this for more finegrained control than the other pattern-associated arguments). - /// Sets the marker for the sections (use this for more finegrained control than the other marker-associated arguments). - /// Determines which trace information appear on the graph. - /// Specifies the direction at which succeeding sectors follow one another. - /// Sets the fraction of the radius to cut out of the pie. Use this to make a donut chart. - /// Instead of the first slice starting at 12 o'clock, rotate to some other angle. - /// Determines whether or not the sectors are reordered from largest to smallest. - /// If set to false, ignore the global default settings set in `Defaults` - public static GenericChart Pie( - IEnumerable values, - Optional Name = default, - Optional ShowLegend = default, - Optional Opacity = default, - Optional> MultiOpacity = default, - Optional> Labels = default, - Optional Pull = default, - Optional> MultiPull = default, - Optional Text = default, - Optional> MultiText = default, - Optional TextPosition = default, - Optional> MultiTextPosition = default, - Optional> SectionColors = default, - Optional SectionOutlineColor = default, - Optional SectionOutlineWidth = default, - Optional> SectionOutlineMultiWidth = default, - Optional SectionOutline = default, - Optional MarkerPatternShape = default, - Optional> MultiMarkerPatternShape = default, - Optional MarkerPattern = default, - Optional Marker = default, - Optional TextInfo = default, - Optional Direction = default, - Optional Hole = default, - Optional Rotation = default, - Optional Sort = default, - Optional UseDefaults = default - ) - where ValuesType : IConvertible - where LabelsType : IConvertible - where TextType : IConvertible - => - Plotly.NET.ChartDomain_Pie.Chart.Pie( - values: values, - Name: Name.ToOption(), - ShowLegend: ShowLegend.ToOption(), - Opacity: Opacity.ToOption(), - MultiOpacity: MultiOpacity.ToOption(), - Labels: Labels.ToOption(), - Pull: Pull.ToOption(), - MultiPull: MultiPull.ToOption(), - Text: Text.ToOption(), - MultiText: MultiText.ToOption(), - TextPosition: TextPosition.ToOption(), - MultiTextPosition: MultiTextPosition.ToOption(), - SectionColors: SectionColors.ToOption(), - SectionOutlineColor: SectionOutlineColor.ToOption(), - SectionOutlineWidth: SectionOutlineWidth.ToOption(), - SectionOutlineMultiWidth: SectionOutlineMultiWidth.ToOption(), - SectionOutline: SectionOutline.ToOption(), - MarkerPatternShape: MarkerPatternShape.ToOption(), - MultiMarkerPatternShape: MultiMarkerPatternShape.ToOption(), - MarkerPattern: MarkerPattern.ToOption(), - Marker: Marker.ToOption(), - TextInfo: TextInfo.ToOption(), - Direction: Direction.ToOption(), - Hole: Hole.ToOption(), - Rotation: Rotation.ToOption(), - Sort: Sort.ToOption(), - UseDefaults: UseDefaults.ToOption() - ); - - /// - /// Creates a doughnut chart. - /// - /// A doughnut chart is a variation of the pie chart that has a fraction cut from the center of the slices. - /// - /// Sets the values of the sectors - /// Sets the trace name. The trace name appear as the legend item and on hover - /// Sets the fraction of the radius to cut out of the pie. Use this to make a donut chart. - /// Determines whether or not an item corresponding to this trace is shown in the legend. - /// Sets the opactity of the trace - /// Sets the opactity of individual datum markers - /// Sets the sector labels. If `labels` entries are duplicated, the associated `values` are summed. - /// Sets the fraction of larger radius to pull the sectors out from the center. This can be a constant to pull all slices apart from each other equally or an array to highlight one or more slices. - /// Sets the fraction of larger radius to pull the sectors out from the center. This can be a constant to pull all slices apart from each other equally or an array to highlight one or more slices. - /// Sets text elements associated with each (x,y) pair. If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace's (x,y) coordinates. If trace `hoverinfo` contains a "text" flag and "hovertext" is not set, these elements will be seen in the hover labels. - /// Sets text elements associated with each (x,y) pair. If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace's (x,y) coordinates. If trace `hoverinfo` contains a "text" flag and "hovertext" is not set, these elements will be seen in the hover labels. - /// Sets the positions of the `text` elements with respects to the (x,y) coordinates. - /// Sets the positions of the `text` elements with respects to the (x,y) coordinates. - /// Sets the colors associated with each section. - /// Sets the color of the section outline. - /// Sets the width of the section outline. - /// Sets the width of each individual section outline. - /// Sets the section outline (use this for more finegrained control than the other section outline-associated arguments). - /// Sets a pattern shape for all sections - /// Sets an individual pattern shape for each section - /// Sets the marker pattern (use this for more finegrained control than the other pattern-associated arguments). - /// Sets the marker for the sections (use this for more finegrained control than the other marker-associated arguments). - /// Determines which trace information appear on the graph. - /// Specifies the direction at which succeeding sectors follow one another. - /// Instead of the first slice starting at 12 o'clock, rotate to some other angle. - /// Determines whether or not the sectors are reordered from largest to smallest. - /// If set to false, ignore the global default settings set in `Defaults` - public static GenericChart Doughnut( - IEnumerable values, - Optional Name = default, - Optional ShowLegend = default, - Optional Opacity = default, - Optional> MultiOpacity = default, - Optional> Labels = default, - Optional Pull = default, - Optional> MultiPull = default, - Optional Text = default, - Optional> MultiText = default, - Optional TextPosition = default, - Optional> MultiTextPosition = default, - Optional> SectionColors = default, - Optional SectionOutlineColor = default, - Optional SectionOutlineWidth = default, - Optional> SectionOutlineMultiWidth = default, - Optional SectionOutline = default, - Optional MarkerPatternShape = default, - Optional> MultiMarkerPatternShape = default, - Optional MarkerPattern = default, - Optional Marker = default, - Optional TextInfo = default, - Optional Direction = default, - Optional Hole = default, - Optional Rotation = default, - Optional Sort = default, - Optional UseDefaults = default - ) - where ValuesType : IConvertible - where LabelsType : IConvertible - where TextType : IConvertible - => - Plotly.NET.ChartDomain_Pie.Chart.Doughnut( - values: values, - Name: Name.ToOption(), - ShowLegend: ShowLegend.ToOption(), - Opacity: Opacity.ToOption(), - MultiOpacity: MultiOpacity.ToOption(), - Labels: Labels.ToOption(), - Pull: Pull.ToOption(), - MultiPull: MultiPull.ToOption(), - Text: Text.ToOption(), - MultiText: MultiText.ToOption(), - TextPosition: TextPosition.ToOption(), - MultiTextPosition: MultiTextPosition.ToOption(), - SectionColors: SectionColors.ToOption(), - SectionOutlineColor: SectionOutlineColor.ToOption(), - SectionOutlineWidth: SectionOutlineWidth.ToOption(), - SectionOutlineMultiWidth: SectionOutlineMultiWidth.ToOption(), - SectionOutline: SectionOutline.ToOption(), - MarkerPatternShape: MarkerPatternShape.ToOption(), - MultiMarkerPatternShape: MultiMarkerPatternShape.ToOption(), - MarkerPattern: MarkerPattern.ToOption(), - Marker: Marker.ToOption(), - TextInfo: TextInfo.ToOption(), - Direction: Direction.ToOption(), - Hole: Hole.ToOption(), - Rotation: Rotation.ToOption(), - Sort: Sort.ToOption(), - UseDefaults: UseDefaults.ToOption() - ); - - /// - /// Creates a FunnelArea chart. - /// - /// FunnelArea charts visualize stages in a process using area-encoded trapezoids, which can be used to show data in a part-to-whole representation similar to a piechart, - /// wherein each item appears in a single stage. See also the "funnel" chart for a different approach to visualizing funnel data. - /// - /// Sets the values of the sectors - /// 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. - /// Sets the opactity of the trace - /// Sets the opactity of individual datum markers - /// Sets the sector labels. If `labels` entries are duplicated, the associated `values` are summed. - /// Sets text elements associated with each (x,y) pair. If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace's (x,y) coordinates. If trace `hoverinfo` contains a "text" flag and "hovertext" is not set, these elements will be seen in the hover labels. - /// Sets text elements associated with each (x,y) pair. If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace's (x,y) coordinates. If trace `hoverinfo` contains a "text" flag and "hovertext" is not set, these elements will be seen in the hover labels. - /// Sets the positions of the `text` elements with respects to the (x,y) coordinates. - /// Sets the positions of the `text` elements with respects to the (x,y) coordinates. - /// Sets the colors associated with each section. - /// Sets the color of the section outline. - /// Sets the width of the section outline. - /// Sets the width of each individual section outline. - /// Sets the section outline (use this for more finegrained control than the other section outline-associated arguments). - /// Sets a pattern shape for all sections - /// Sets an individual pattern shape for each section - /// Sets the marker pattern (use this for more finegrained control than the other pattern-associated arguments). - /// Sets the marker for the sections (use this for more finegrained control than the other marker-associated arguments). - /// Determines which trace information appear on the graph. - /// - /// - /// If set to false, ignore the global default settings set in `Defaults` - public static GenericChart FunnelArea( - IEnumerable values, - Optional Name = default, - Optional ShowLegend = default, - Optional Opacity = default, - Optional> MultiOpacity = default, - Optional> Labels = default, - Optional Text = default, - Optional> MultiText = default, - Optional TextPosition = default, - Optional> MultiTextPosition = default, - Optional> SectionColors = default, - Optional SectionOutlineColor = default, - Optional SectionOutlineWidth = default, - Optional> SectionOutlineMultiWidth = default, - Optional SectionOutline = default, - Optional MarkerPatternShape = default, - Optional> MultiMarkerPatternShape = default, - Optional MarkerPattern = default, - Optional Marker = default, - Optional TextInfo = default, - Optional AspectRatio = default, - Optional BaseRatio = default, - Optional UseDefaults = default - ) - where ValuesType : IConvertible - where LabelsType : IConvertible - where TextType : IConvertible - => - Plotly.NET.ChartDomain_Pie.Chart.FunnelArea( - values: values, - Name: Name.ToOption(), - ShowLegend: ShowLegend.ToOption(), - Opacity: Opacity.ToOption(), - MultiOpacity: MultiOpacity.ToOption(), - Labels: Labels.ToOption(), - Text: Text.ToOption(), - MultiText: MultiText.ToOption(), - TextPosition: TextPosition.ToOption(), - MultiTextPosition: MultiTextPosition.ToOption(), - SectionColors: SectionColors.ToOption(), - SectionOutlineColor: SectionOutlineColor.ToOption(), - SectionOutlineWidth: SectionOutlineWidth.ToOption(), - SectionOutlineMultiWidth: SectionOutlineMultiWidth.ToOption(), - SectionOutline: SectionOutline.ToOption(), - MarkerPatternShape: MarkerPatternShape.ToOption(), - MultiMarkerPatternShape: MultiMarkerPatternShape.ToOption(), - MarkerPattern: MarkerPattern.ToOption(), - Marker: Marker.ToOption(), - TextInfo: TextInfo.ToOption(), - AspectRatio: AspectRatio.ToOption(), - BaseRatio: BaseRatio.ToOption(), - UseDefaults: UseDefaults.ToOption() - ); - - /// - /// Creates a sunburst chart, which visualizes hierarchical data spanning outward radially from root to leaves. - /// - /// The hierarchy is defined by labels and parents attributes. The root starts from the center and children are added to the outer rings. - /// - /// Sets the labels of each of the sectors. - /// Sets the parent sectors for each of the sectors. Empty string items '' are understood to reference the root node in the hierarchy. If `ids` is filled, `parents` items are understood to be "ids" themselves. When `ids` is not set, plotly attempts to find matching items in `labels`, but beware they must be unique. - /// Sets the values associated with each of the sectors. - /// Assigns id labels to each datum. These ids for object constancy of data points during animation. - /// 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. - /// Sets the opactity of the trace - /// Sets the opactity of individual datum markers - /// Sets text elements associated with each (x,y) pair. If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace's (x,y) coordinates. If trace `hoverinfo` contains a "text" flag and "hovertext" is not set, these elements will be seen in the hover labels. - /// Sets text elements associated with each (x,y) pair. If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace's (x,y) coordinates. If trace `hoverinfo` contains a "text" flag and "hovertext" is not set, these elements will be seen in the hover labels. - /// Sets the colors associated with each section. - /// Sets the colorscale for the section values - /// Whether or not to show the section colorbar - /// Whether or not to show the section colorscale - /// Sets the color of the section outline. - /// Sets the width of the section outline. - /// Sets the width of each individual section outline. - /// Sets the section outline (use this for more finegrained control than the other section outline-associated arguments). - /// Sets a pattern shape for all sections - /// Sets an individual pattern shape for each section - /// Sets the marker pattern (use this for more finegrained control than the other pattern-associated arguments). - /// Sets the marker for the sections (use this for more finegrained control than the other marker-associated arguments). - /// Determines which trace information appear on the graph. - /// Determines how the items in `values` are summed. When set to "total", items in `values` are taken to be value of all its descendants. When set to "remainder", items in `values` corresponding to the root and the branches sectors are taken to be the extra part not part of the sum of the values at their leaves. - /// Determines default for `values` when it is not provided, by inferring a 1 for each of the "leaves" and/or "branches", otherwise 0. - /// Sets the styles for the root of this trace. - /// Sets the styles for the leaves of this trace. - /// Sets the level from which this trace hierarchy is rendered. Set `level` to `''` to start from the root node in the hierarchy. Must be an "id" if `ids` is filled in, otherwise plotly attempts to find a matching item in `labels`. - /// Sets the number of rendered sectors from any given `level`. Set `maxdepth` to "-1" to render all the levels in the hierarchy. - /// Rotates the whole diagram counterclockwise by some angle. By default the first slice starts at 3 o'clock. - /// Determines whether or not the sectors are reordered from largest to smallest. - /// If set to false, ignore the global default settings set in `Defaults` - public static GenericChart Sunburst( - IEnumerable labels, - IEnumerable parents, - Optional> Values = default, - Optional> Ids = default, - Optional Name = default, - Optional ShowLegend = default, - Optional Opacity = default, - Optional> MultiOpacity = default, - Optional Text = default, - Optional> MultiText = default, - Optional> SectionColors = default, - Optional SectionColorScale = default, - Optional ShowSectionColorScale = default, - Optional ReverseSectionColorScale = default, - Optional SectionOutlineColor = default, - Optional SectionOutlineWidth = default, - Optional> SectionOutlineMultiWidth = default, - Optional SectionOutline = default, - Optional MarkerPatternShape = default, - Optional> MultiMarkerPatternShape = default, - Optional MarkerPattern = default, - Optional Marker = default, - Optional TextInfo = default, - Optional BranchValues = default, - Optional Count = default, - Optional Root = default, - Optional Leaf = default, - Optional Level = default, - Optional MaxDepth = default, - Optional Rotation = default, - Optional Sort = default, - Optional UseDefaults = default - ) - where LabelsType : IConvertible - where ParentsType : IConvertible - where ValuesType : IConvertible - where IdsType : IConvertible - where TextType : IConvertible - => - Plotly.NET.ChartDomain_Hierarchy.Chart.Sunburst( - labels: labels, - parents: parents, - Values: Values.ToOption(), - Ids: Ids.ToOption(), - Name: Name.ToOption(), - ShowLegend: ShowLegend.ToOption(), - Opacity: Opacity.ToOption(), - MultiOpacity: MultiOpacity.ToOption(), - Text: Text.ToOption(), - MultiText: MultiText.ToOption(), - SectionColors: SectionColors.ToOption(), - SectionColorScale: SectionColorScale.ToOption(), - ShowSectionColorScale: ShowSectionColorScale.ToOption(), - ReverseSectionColorScale: ReverseSectionColorScale.ToOption(), - SectionOutlineColor: SectionOutlineColor.ToOption(), - SectionOutlineWidth: SectionOutlineWidth.ToOption(), - SectionOutlineMultiWidth: SectionOutlineMultiWidth.ToOption(), - SectionOutline: SectionOutline.ToOption(), - MarkerPatternShape: MarkerPatternShape.ToOption(), - MultiMarkerPatternShape: MultiMarkerPatternShape.ToOption(), - MarkerPattern: MarkerPattern.ToOption(), - Marker: Marker.ToOption(), - TextInfo: TextInfo.ToOption(), - BranchValues: BranchValues.ToOption(), - Count: Count.ToOption(), - Root: Root.ToOption(), - Leaf: Leaf.ToOption(), - Level: Level.ToOption(), - MaxDepth: MaxDepth.ToOption(), - Rotation: Rotation.ToOption(), - Sort: Sort.ToOption(), - UseDefaults: UseDefaults.ToOption() - ); - - /// - /// Creates a treemap chart. - /// Treemap charts visualize hierarchical data using nested rectangles. - /// - /// Same as Sunburst the hierarchy is defined by labels and parents attributes. - /// Click on one sector to zoom in/out, which also displays a pathbar in the upper-left corner of your treemap. To zoom out you can use the path bar as well. - /// - /// Sets the labels of each of the sectors. - /// Sets the parent sectors for each of the sectors. Empty string items '' are understood to reference the root node in the hierarchy. If `ids` is filled, `parents` items are understood to be "ids" themselves. When `ids` is not set, plotly attempts to find matching items in `labels`, but beware they must be unique. - /// Sets the values associated with each of the sectors. - /// Assigns id labels to each datum. These ids for object constancy of data points during animation. - /// 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. - /// Sets the opactity of the trace - /// Sets the opactity of individual datum markers - /// Sets text elements associated with each (x,y) pair. If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace's (x,y) coordinates. If trace `hoverinfo` contains a "text" flag and "hovertext" is not set, these elements will be seen in the hover labels. - /// Sets text elements associated with each (x,y) pair. If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace's (x,y) coordinates. If trace `hoverinfo` contains a "text" flag and "hovertext" is not set, these elements will be seen in the hover labels. - /// Sets the positions of the `text` elements with respects to the (x,y) coordinates. - /// Sets the positions of the `text` elements with respects to the (x,y) coordinates. - /// Sets the colors associated with each section. - /// Sets the colorscale for the section values - /// Whether or not to show the section colorbar - /// Whether or not to show the section colorscale - /// Sets the color of the section outline. - /// Sets the width of the section outline. - /// Sets the width of each individual section outline. - /// Sets the section outline (use this for more finegrained control than the other section outline-associated arguments). - /// Sets a pattern shape for all sections - /// Sets an individual pattern shape for each section - /// Sets the marker pattern (use this for more finegrained control than the other pattern-associated arguments). - /// Sets the marker for the sections (use this for more finegrained control than the other marker-associated arguments). - /// Determines which trace information appear on the graph. - /// Determines how the items in `values` are summed. When set to "total", items in `values` are taken to be value of all its descendants. When set to "remainder", items in `values` corresponding to the root and the branches sectors are taken to be the extra part not part of the sum of the values at their leaves. - /// Determines default for `values` when it is not provided, by inferring a 1 for each of the "leaves" and/or "branches", otherwise 0. - /// Sets the tiling for this trace. - /// Sets the path bar for this trace. - /// Sets the styles for the root of this trace. - /// Sets the level from which this trace hierarchy is rendered. Set `level` to `''` to start from the root node in the hierarchy. Must be an "id" if `ids` is filled in, otherwise plotly attempts to find a matching item in `labels`. - /// Sets the number of rendered sectors from any given `level`. Set `maxdepth` to "-1" to render all the levels in the hierarchy. - /// If set to false, ignore the global default settings set in `Defaults` - public static GenericChart Treemap( - IEnumerable labels, - IEnumerable parents, - Optional> Values = default, - Optional> Ids = default, - Optional Name = default, - Optional ShowLegend = default, - Optional Opacity = default, - Optional> MultiOpacity = default, - Optional Text = default, - Optional> MultiText = default, - Optional TextPosition = default, - Optional> MultiTextPosition = default, - Optional> SectionColors = default, - Optional SectionColorScale = default, - Optional ShowSectionColorScale = default, - Optional ReverseSectionColorScale = default, - Optional SectionOutlineColor = default, - Optional SectionOutlineWidth = default, - Optional> SectionOutlineMultiWidth = default, - Optional SectionOutline = default, - Optional MarkerPatternShape = default, - Optional> MultiMarkerPatternShape = default, - Optional MarkerPattern = default, - Optional Marker = default, - Optional TextInfo = default, - Optional BranchValues = default, - Optional Count = default, - Optional Tiling = default, - Optional PathBar = default, - Optional Root = default, - Optional Level = default, - Optional MaxDepth = default, - Optional UseDefaults = default - ) - where LabelsType : IConvertible - where ParentsType : IConvertible - where ValuesType : IConvertible - where IdsType : IConvertible - where TextType : IConvertible - => - Plotly.NET.ChartDomain_Hierarchy.Chart.Treemap( - labels: labels, - parents: parents, - Values: Values.ToOption(), - Ids: Ids.ToOption(), - Name: Name.ToOption(), - ShowLegend: ShowLegend.ToOption(), - Opacity: Opacity.ToOption(), - MultiOpacity: MultiOpacity.ToOption(), - Text: Text.ToOption(), - MultiText: MultiText.ToOption(), - TextPosition: TextPosition.ToOption(), - MultiTextPosition: MultiTextPosition.ToOption(), - SectionColors: SectionColors.ToOption(), - SectionColorScale: SectionColorScale.ToOption(), - ShowSectionColorScale: ShowSectionColorScale.ToOption(), - ReverseSectionColorScale: ReverseSectionColorScale.ToOption(), - SectionOutlineColor: SectionOutlineColor.ToOption(), - SectionOutlineWidth: SectionOutlineWidth.ToOption(), - SectionOutlineMultiWidth: SectionOutlineMultiWidth.ToOption(), - SectionOutline: SectionOutline.ToOption(), - MarkerPatternShape: MarkerPatternShape.ToOption(), - MultiMarkerPatternShape: MultiMarkerPatternShape.ToOption(), - MarkerPattern: MarkerPattern.ToOption(), - Marker: Marker.ToOption(), - TextInfo: TextInfo.ToOption(), - BranchValues: BranchValues.ToOption(), - Count: Count.ToOption(), - Tiling: Tiling.ToOption(), - PathBar: PathBar.ToOption(), - Root: Root.ToOption(), - Level: Level.ToOption(), - MaxDepth: MaxDepth.ToOption(), - UseDefaults: UseDefaults.ToOption() - ); - - /// - /// Creates a parallel coordinates plot. - /// - /// Parallel coordinates are a common way of visualizing and analyzing high-dimensional datasets. - /// - /// To show a set of points in an n-dimensional space, a backdrop is drawn consisting of n parallel lines, typically vertical and equally spaced. A point in n-dimensional space is represented as a polyline with vertices on the parallel axes; the position of the vertex on the i-th axis corresponds to the i-th coordinate of the point. - /// - /// This visualization is closely related to time series visualization, except that it is applied to data where the axes do not correspond to points in time, and therefore do not have a natural order. Therefore, different axis arrangements may be of interest. - /// - /// the dimensions of the plot, containing both dimension backdrop information and the associated data - /// Sets the trace name. The trace name appear as the legend item and on hover - /// Sets the color of the lines that are connecting the datums on the dimensions - /// Sets the colorscale of the lines that are connecting the datums on the dimensions - /// Whether or not to show the colorbar of the lines that are connecting the datums on the dimensions - /// Whether or not to reverse the colorscale of the lines that are connecting the datums on the dimensions - /// Sets the lines that are connecting the datums on the dimensions (use this for more finegrained control than the other line-associated arguments). - /// Sets the angle of the labels with respect to the horizontal. For example, a `tickangle` of -90 draws the labels vertically. Tilted labels with "labelangle" may be positioned better inside margins when `labelposition` is set to "bottom". - /// Sets the label font of this trace. - /// Specifies the location of the `label`. "top" positions labels above, next to the title "bottom" positions labels below the graph Tilted labels with "labelangle" may be positioned better inside margins when `labelposition` is set to "bottom". - /// Sets the range font of this trace. - /// Sets the tick font of this trace. - /// If set to false, ignore the global default settings set in `Defaults` - public static GenericChart ParallelCoord( - IEnumerable dimensions, - Optional Name = default, - Optional LineColor = default, - Optional LineColorScale = default, - Optional ShowLineColorScale = default, - Optional ReverseLineColorScale = default, - Optional Line = default, - Optional LabelAngle = default, - Optional LabelFont = default, - Optional LabelSide = default, - Optional RangeFont = default, - Optional TickFont = default, - Optional UseDefaults = default - ) - => - Plotly.NET.ChartDomain_Relations.Chart.ParallelCoord( - dimensions: dimensions, - Name: Name.ToOption(), - LineColor: LineColor.ToOption(), - LineColorScale: LineColorScale.ToOption(), - ShowLineColorScale: ShowLineColorScale.ToOption(), - ReverseLineColorScale: ReverseLineColorScale.ToOption(), - Line: Line.ToOption(), - LabelAngle: LabelAngle.ToOption(), - LabelFont: LabelFont.ToOption(), - LabelSide: LabelSide.ToOption(), - RangeFont: RangeFont.ToOption(), - TickFont: TickFont.ToOption(), - UseDefaults: UseDefaults.ToOption() - ); - - /// - /// Creates a parallel categories plot. - /// - /// The parallel categories diagram (also known as parallel sets or alluvial diagram) is a visualization of - /// multi-dimensional categorical data sets. Each variable in the data set is represented by a column of rectangles, - /// where each rectangle corresponds to a discrete value taken on by that variable. - /// The relative heights of the rectangles reflect the relative frequency of occurrence of the corresponding value. - /// - /// the dimensions of the plot, containing both dimension backdrop information and the associated data - /// Sets the trace name. The trace name appear as the legend item and on hover - /// The number of observations represented by each state. Defaults to 1 so that each state represents one observation - /// Sets the color of the lines that are connecting the datums on the dimensions - /// Sets the shape of the lines that are connecting the datums on the dimensions - /// Sets the colorscale of the lines that are connecting the datums on the dimensions - /// Whether or not to show the colorbar of the lines that are connecting the datums on the dimensions - /// Whether or not to reverse the colorscale of the lines that are connecting the datums on the dimensions - /// Sets the lines that are connecting the datums on the dimensions (use this for more finegrained control than the other line-associated arguments). - /// Sets the drag interaction mode for categories and dimensions. If `perpendicular`, the categories can only move along a line perpendicular to the paths. If `freeform`, the categories can freely move on the plane. If `fixed`, the categories and dimensions are stationary. - /// Sort paths so that like colors are bundled together within each category. - /// Sets the path sorting algorithm. If `forward`, sort paths based on dimension categories from left to right. If `backward`, sort paths based on dimensions categories from right to left. - /// Sets the label font of this trace. - /// Sets the tick font of this trace. - /// If set to false, ignore the global default settings set in `Defaults` - public static GenericChart ParallelCategories( - IEnumerable dimensions, - Optional Name = default, - Optional Counts = default, - Optional LineColor = default, - Optional LineShape = default, - Optional LineColorScale = default, - Optional ShowLineColorScale = default, - Optional ReverseLineColorScale = default, - Optional Line = default, - Optional Arrangement = default, - Optional BundleColors = default, - Optional SortPaths = default, - Optional LabelFont = default, - Optional TickFont = default, - Optional UseDefaults = default - ) - => - Plotly.NET.ChartDomain_Relations.Chart.ParallelCategories( - dimensions: dimensions, - Name: Name.ToOption(), - Counts: Counts.ToOption(), - LineColor: LineColor.ToOption(), - LineShape: LineShape.ToOption(), - LineColorScale: LineColorScale.ToOption(), - ShowLineColorScale: ShowLineColorScale.ToOption(), - ReverseLineColorScale: ReverseLineColorScale.ToOption(), - Line: Line.ToOption(), - Arrangement: Arrangement.ToOption(), - BundleColors: BundleColors.ToOption(), - SortPaths: SortPaths.ToOption(), - LabelFont: LabelFont.ToOption(), - TickFont: TickFont.ToOption(), - UseDefaults: UseDefaults.ToOption() - ); - - /// - /// Creates a sankey diagram. - /// - /// A Sankey diagram is a flow diagram, in which the width of arrows is proportional to the flow quantity. - /// - /// Sankey diagrams visualize the contributions to a flow by defining source to represent the source node, target for the target node, value to set the flow volume, and label that shows the node name. - /// - /// Sets the nodes of the Sankey plot. - /// Sets the links between nodes of the Sankey plot. - /// Sets the trace name. The trace name appear as the legend item and on hover. - /// Assigns id labels to each datum. - /// Sets the orientation of the Sankey diagram. - /// Sets the text font of this trace. - /// If value is `snap` (the default), the node arrangement is assisted by automatic snapping of elements to preserve space between nodes specified via `nodepad`. If value is `perpendicular`, the nodes can only move along a line perpendicular to the flow. If value is `freeform`, the nodes can freely move on the plane. If value is `fixed`, the nodes are stationary. - /// Sets the value formatting rule using d3 formatting mini-languages which are very similar to those in Python. For numbers, see: https://github.com/d3/d3-format/tree/v1.4.5#d3-format. - /// Adds a unit to follow the value in the hover tooltip. Add a space if a separation is necessary from the value. - /// If set to false, ignore the global default settings set in `Defaults` - public static GenericChart Sankey( - SankeyNodes nodes, - SankeyLinks links, - Optional Name = default, - Optional> Ids = default, - Optional Orientation = default, - Optional TextFont = default, - Optional Arrangement = default, - Optional ValueFormat = default, - Optional ValueSuffix = default, - Optional UseDefaults = default - ) - where IdsType : IConvertible - => - Plotly.NET.ChartDomain_Relations.Chart.Sankey( - nodes: nodes, - links: links, - Name: Name.ToOption(), - Ids: Ids.ToOption(), - Orientation: Orientation.ToOption(), - TextFont: TextFont.ToOption(), - Arrangement: Arrangement.ToOption(), - ValueFormat: ValueFormat.ToOption(), - ValueSuffix: ValueSuffix.ToOption(), - UseDefaults: UseDefaults.ToOption() - ); - - /// - /// Creates a table. - /// - /// The data are arranged in a grid of rows and columns. Most styling can be specified for columns, rows or individual cells. Table is using a row-major order by default, ie. the grid is represented as a vector of row vectors. - /// - /// Sets the header of the table - /// Sets the cells of the table - /// Sets the trace name. The trace name appear as the legend item and on hover. - /// Specifies the rendered order of the data columns; for example, a value `2` at position `0` means that column index `0` in the data will be rendered as the third column, as columns have an index base of zero. - /// The width of columns expressed as a ratio. Columns fill the available width in proportion of their specified column widths. - /// The width of columns expressed as a ratio. Columns fill the available width in proportion of their specified column widths. - /// If set to false, ignore the global default settings set in `Defaults` - public static GenericChart Table( - TableCells header, - TableCells cells, - Optional Name = default, - Optional> ColumnOrder = default, - Optional ColumnWidth = default, - Optional> MultiColumnWidth = default, - Optional UseDefaults = default - ) - => - Plotly.NET.ChartDomain_Table.Chart.Table( - header: header, - cells: cells, - Name: Name.ToOption(), - ColumnOrder: ColumnOrder.ToOption(), - ColumnWidth: ColumnWidth.ToOption(), - MultiColumnWidth: MultiColumnWidth.ToOption(), - UseDefaults: UseDefaults.ToOption() - ); - - /// - /// Creates an Indicator chart. - /// - /// An indicator is used to visualize a single `value` along with some contextual information such as `steps` or a `threshold`, using a combination of three visual elements: a number, a delta, and/or a gauge. - /// Deltas are taken with respect to a `reference`. - /// Gauges can be either angular or bullet (aka linear) gauges. - /// - /// Sets the number to be displayed. - /// Determines how the value is displayed on the graph. `number` displays the value numerically in text. `delta` displays the difference to a reference value in text. Finally, `gauge` displays the value graphically on an axis. - /// Sets the Range of the Gauge axis - /// Sets the trace name. The trace name appear as the legend item and on hover. - /// Sets the title of this trace. - /// Sets the domain of this trace. - /// Sets the horizontal alignment of the `text` within the box. Note that this attribute has no effect if an angular gauge is displayed: in this case, it is always centered - /// - /// Sets how the delta to the delta reference is displayed - /// Sets the styles of the displayed number - /// Sets the shape of the gauge - /// Sets the styles of the gauge - /// Whether or not to show the gauge axis - /// Sets the gauge axis - /// - public static GenericChart Indicator( - ValueType value, - StyleParam.IndicatorMode mode, - Optional Range = default, - Optional Name = default, - Optional Title = default, - Optional Domain = default, - Optional Align = default, - Optional DeltaReference = default, - Optional Delta = default, - Optional Number = default, - Optional GaugeShape = default, - Optional Gauge = default, - Optional ShowGaugeAxis = default, - Optional GaugeAxis = default, - Optional UseDefaults = default - ) - where ValueType : IConvertible - => - Plotly.NET.ChartDomain_Table.Chart.Indicator( - value: value, - mode: mode, - Range: Range.ToOption(), - Name: Name.ToOption(), - Title: Title.ToOption(), - Domain: Domain.ToOption(), - Align: Align.ToOption(), - DeltaReference: DeltaReference.ToOption(), - Delta: Delta.ToOption(), - Number: Number.ToOption(), - GaugeShape: GaugeShape.ToOption(), - Gauge: Gauge.ToOption(), - ShowGaugeAxis: ShowGaugeAxis.ToOption(), - GaugeAxis: GaugeAxis.ToOption(), - UseDefaults: UseDefaults.ToOption() - ); - - /// - /// Creates an icicle chart. - /// - /// Icicle charts visualize hierarchal data from leaves (and/or outer branches) towards root with rectangles. - /// The icicle sectors are determined by the entries in "labels" or "ids" and in "parents". - /// - /// Sets the labels of each of the sectors. - /// Sets the parent sectors for each of the sectors. Empty string items '' are understood to reference the root node in the hierarchy. If `ids` is filled, `parents` items are understood to be "ids" themselves. When `ids` is not set, plotly attempts to find matching items in `labels`, but beware they must be unique. - /// Sets the values associated with each of the sectors. - /// Assigns id labels to each datum. These ids for object constancy of data points during animation. - /// Sets the trace name. The trace name appear as the legend item and on hover - /// Sets the opactity of the trace - /// Sets the opactity of individual datum markers - /// Sets text elements associated with each (x,y) pair. If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace's (x,y) coordinates. If trace `hoverinfo` contains a "text" flag and "hovertext" is not set, these elements will be seen in the hover labels. - /// Sets text elements associated with each (x,y) pair. If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace's (x,y) coordinates. If trace `hoverinfo` contains a "text" flag and "hovertext" is not set, these elements will be seen in the hover labels. - /// Sets the positions of the `text` elements with respects to the (x,y) coordinates. - /// Sets the positions of the `text` elements with respects to the (x,y) coordinates. - /// Sets the colors associated with each section. - /// Sets the colorscale for the section values - /// Whether or not to show the section colorbar - /// Whether or not to show the section colorscale - /// Sets the color of the section outline. - /// Sets the width of the section outline. - /// Sets the width of each individual section outline. - /// Sets the section outline (use this for more finegrained control than the other section outline-associated arguments). - /// Sets a pattern shape for all sections - /// Sets an individual pattern shape for each section - /// Sets the marker pattern (use this for more finegrained control than the other pattern-associated arguments). - /// Sets the marker for the sections (use this for more finegrained control than the other marker-associated arguments). - /// Determines how the items in `values` are summed. When set to "total", items in `values` are taken to be value of all its descendants. When set to "remainder", items in `values` corresponding to the root and the branches sectors are taken to be the extra part not part of the sum of the values at their leaves. - /// Determines default for `values` when it is not provided, by inferring a 1 for each of the "leaves" and/or "branches", otherwise 0. - /// Sets the orientation of the tiling. - /// Sets the flip of the tiling: Determines if the positions obtained from solver are flipped on each axis. - /// Sets the styles for the icicle tiling - /// Sets the edge shape of the pathbar. - /// Sets the pathbar - /// Determines which trace information appear on the graph. - /// Sets the styles for the root of this trace. - /// Sets the level from which this trace hierarchy is rendered. Set `level` to `''` to start from the root node in the hierarchy. Must be an "id" if `ids` is filled in, otherwise plotly attempts to find a matching item in `labels`. - /// Sets the number of rendered sectors from any given `level`. Set `maxdepth` to "-1" to render all the levels in the hierarchy. - /// If set to false, ignore the global default settings set in `Defaults` - public static GenericChart Icicle( - IEnumerable labels, - IEnumerable parents, - Optional> Values = default, - Optional> Ids = default, - Optional Name = default, - Optional Opacity = default, - Optional> MultiOpacity = default, - Optional Text = default, - Optional> MultiText = default, - Optional TextPosition = default, - Optional> MultiTextPosition = default, - Optional> SectionColors = default, - Optional SectionColorScale = default, - Optional ShowSectionColorScale = default, - Optional ReverseSectionColorScale = default, - Optional SectionOutlineColor = default, - Optional SectionOutlineWidth = default, - Optional> SectionOutlineMultiWidth = default, - Optional SectionOutline = default, - Optional MarkerPatternShape = default, - Optional> MultiMarkerPatternShape = default, - Optional MarkerPattern = default, - Optional Marker = default, - Optional TextInfo = default, - Optional BranchValues = default, - Optional Count = default, - Optional TilingOrientation = default, - Optional TilingFlip = default, - Optional Tiling = default, - Optional PathBarEdgeShape = default, - Optional PathBar = default, - Optional Root = default, - Optional Level = default, - Optional MaxDepth = default, - Optional UseDefaults = default - ) - where LabelsType : IConvertible - where ParentsType : IConvertible - where ValuesType : IConvertible - where IdsType : IConvertible - where TextType : IConvertible - => - Plotly.NET.ChartDomain_Icicle.Chart.Icicle( - labels: labels, - parents: parents, - Values: Values.ToOption(), - Ids: Ids.ToOption(), - Name: Name.ToOption(), - Opacity: Opacity.ToOption(), - MultiOpacity: MultiOpacity.ToOption(), - Text: Text.ToOption(), - MultiText: MultiText.ToOption(), - TextPosition: TextPosition.ToOption(), - MultiTextPosition: MultiTextPosition.ToOption(), - SectionColors: SectionColors.ToOption(), - SectionColorScale: SectionColorScale.ToOption(), - ShowSectionColorScale: ShowSectionColorScale.ToOption(), - ReverseSectionColorScale: ReverseSectionColorScale.ToOption(), - SectionOutlineColor: SectionOutlineColor.ToOption(), - SectionOutlineWidth: SectionOutlineWidth.ToOption(), - SectionOutlineMultiWidth: SectionOutlineMultiWidth.ToOption(), - SectionOutline: SectionOutline.ToOption(), - MarkerPatternShape: MarkerPatternShape.ToOption(), - MultiMarkerPatternShape: MultiMarkerPatternShape.ToOption(), - MarkerPattern: MarkerPattern.ToOption(), - Marker: Marker.ToOption(), - TextInfo: TextInfo.ToOption(), - BranchValues: BranchValues.ToOption(), - Count: Count.ToOption(), - TilingOrientation: TilingOrientation.ToOption(), - TilingFlip: TilingFlip.ToOption(), - Tiling: Tiling.ToOption(), - PathBarEdgeShape: PathBarEdgeShape.ToOption(), - PathBar: PathBar.ToOption(), - Root: Root.ToOption(), - Level: Level.ToOption(), - MaxDepth: MaxDepth.ToOption(), - UseDefaults: UseDefaults.ToOption() - ); - } -} - diff --git a/src/Plotly.NET.CSharp/ChartAPI/ChartDomain/Doughnut.cs b/src/Plotly.NET.CSharp/ChartAPI/ChartDomain/Doughnut.cs new file mode 100644 index 00000000..ae1133c5 --- /dev/null +++ b/src/Plotly.NET.CSharp/ChartAPI/ChartDomain/Doughnut.cs @@ -0,0 +1,106 @@ +using System; +using System.Collections.Generic; +using Plotly.NET; +using Plotly.NET.LayoutObjects; +using Plotly.NET.TraceObjects; +using static Plotly.NET.StyleParam; + +namespace Plotly.NET.CSharp; + +public static partial class Chart +{ + /// + /// Creates a doughnut chart. + /// + /// A doughnut chart is a variation of the pie chart that has a fraction cut from the center of the slices. + /// + /// Sets the values of the sectors + /// Sets the trace name. The trace name appear as the legend item and on hover + /// Sets the fraction of the radius to cut out of the pie. Use this to make a donut chart. + /// Determines whether or not an item corresponding to this trace is shown in the legend. + /// Sets the opactity of the trace + /// Sets the opactity of individual datum markers + /// Sets the sector labels. If `labels` entries are duplicated, the associated `values` are summed. + /// Sets the fraction of larger radius to pull the sectors out from the center. This can be a constant to pull all slices apart from each other equally or an array to highlight one or more slices. + /// Sets the fraction of larger radius to pull the sectors out from the center. This can be a constant to pull all slices apart from each other equally or an array to highlight one or more slices. + /// Sets text elements associated with each (x,y) pair. If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace's (x,y) coordinates. If trace `hoverinfo` contains a "text" flag and "hovertext" is not set, these elements will be seen in the hover labels. + /// Sets text elements associated with each (x,y) pair. If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace's (x,y) coordinates. If trace `hoverinfo` contains a "text" flag and "hovertext" is not set, these elements will be seen in the hover labels. + /// Sets the positions of the `text` elements with respects to the (x,y) coordinates. + /// Sets the positions of the `text` elements with respects to the (x,y) coordinates. + /// Sets the colors associated with each section. + /// Sets the color of the section outline. + /// Sets the width of the section outline. + /// Sets the width of each individual section outline. + /// Sets the section outline (use this for more finegrained control than the other section outline-associated arguments). + /// Sets a pattern shape for all sections + /// Sets an individual pattern shape for each section + /// Sets the marker pattern (use this for more finegrained control than the other pattern-associated arguments). + /// Sets the marker for the sections (use this for more finegrained control than the other marker-associated arguments). + /// Determines which trace information appear on the graph. + /// Specifies the direction at which succeeding sectors follow one another. + /// Instead of the first slice starting at 12 o'clock, rotate to some other angle. + /// Determines whether or not the sectors are reordered from largest to smallest. + /// If set to false, ignore the global default settings set in `Defaults` + public static GenericChart Doughnut( + IEnumerable values, + Optional Name = default, + Optional ShowLegend = default, + Optional Opacity = default, + Optional> MultiOpacity = default, + Optional> Labels = default, + Optional Pull = default, + Optional> MultiPull = default, + Optional Text = default, + Optional> MultiText = default, + Optional TextPosition = default, + Optional> MultiTextPosition = default, + Optional> SectionColors = default, + Optional SectionOutlineColor = default, + Optional SectionOutlineWidth = default, + Optional> SectionOutlineMultiWidth = default, + Optional SectionOutline = default, + Optional MarkerPatternShape = default, + Optional> MultiMarkerPatternShape = default, + Optional MarkerPattern = default, + Optional Marker = default, + Optional TextInfo = default, + Optional Direction = default, + Optional Hole = default, + Optional Rotation = default, + Optional Sort = default, + Optional UseDefaults = default + ) + where ValuesType : IConvertible + where LabelsType : IConvertible + where TextType : IConvertible + => + Plotly.NET.ChartDomain_Pie.Chart.Doughnut( + values: values, + Name: Name.ToOption(), + ShowLegend: ShowLegend.ToOption(), + Opacity: Opacity.ToOption(), + MultiOpacity: MultiOpacity.ToOption(), + Labels: Labels.ToOption(), + Pull: Pull.ToOption(), + MultiPull: MultiPull.ToOption(), + Text: Text.ToOption(), + MultiText: MultiText.ToOption(), + TextPosition: TextPosition.ToOption(), + MultiTextPosition: MultiTextPosition.ToOption(), + SectionColors: SectionColors.ToOption(), + SectionOutlineColor: SectionOutlineColor.ToOption(), + SectionOutlineWidth: SectionOutlineWidth.ToOption(), + SectionOutlineMultiWidth: SectionOutlineMultiWidth.ToOption(), + SectionOutline: SectionOutline.ToOption(), + MarkerPatternShape: MarkerPatternShape.ToOption(), + MultiMarkerPatternShape: MultiMarkerPatternShape.ToOption(), + MarkerPattern: MarkerPattern.ToOption(), + Marker: Marker.ToOption(), + TextInfo: TextInfo.ToOption(), + Direction: Direction.ToOption(), + Hole: Hole.ToOption(), + Rotation: Rotation.ToOption(), + Sort: Sort.ToOption(), + UseDefaults: UseDefaults.ToOption() + ); +} diff --git a/src/Plotly.NET.CSharp/ChartAPI/ChartDomain/FunnelArea.cs b/src/Plotly.NET.CSharp/ChartAPI/ChartDomain/FunnelArea.cs new file mode 100644 index 00000000..fe987448 --- /dev/null +++ b/src/Plotly.NET.CSharp/ChartAPI/ChartDomain/FunnelArea.cs @@ -0,0 +1,95 @@ +using System; +using System.Collections.Generic; +using Plotly.NET; +using Plotly.NET.LayoutObjects; +using Plotly.NET.TraceObjects; +using static Plotly.NET.StyleParam; + +namespace Plotly.NET.CSharp; + +public static partial class Chart +{ + /// + /// Creates a FunnelArea chart. + /// + /// FunnelArea charts visualize stages in a process using area-encoded trapezoids, which can be used to show data in a part-to-whole representation similar to a piechart, + /// wherein each item appears in a single stage. See also the "funnel" chart for a different approach to visualizing funnel data. + /// + /// Sets the values of the sectors + /// 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. + /// Sets the opactity of the trace + /// Sets the opactity of individual datum markers + /// Sets the sector labels. If `labels` entries are duplicated, the associated `values` are summed. + /// Sets text elements associated with each (x,y) pair. If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace's (x,y) coordinates. If trace `hoverinfo` contains a "text" flag and "hovertext" is not set, these elements will be seen in the hover labels. + /// Sets text elements associated with each (x,y) pair. If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace's (x,y) coordinates. If trace `hoverinfo` contains a "text" flag and "hovertext" is not set, these elements will be seen in the hover labels. + /// Sets the positions of the `text` elements with respects to the (x,y) coordinates. + /// Sets the positions of the `text` elements with respects to the (x,y) coordinates. + /// Sets the colors associated with each section. + /// Sets the color of the section outline. + /// Sets the width of the section outline. + /// Sets the width of each individual section outline. + /// Sets the section outline (use this for more finegrained control than the other section outline-associated arguments). + /// Sets a pattern shape for all sections + /// Sets an individual pattern shape for each section + /// Sets the marker pattern (use this for more finegrained control than the other pattern-associated arguments). + /// Sets the marker for the sections (use this for more finegrained control than the other marker-associated arguments). + /// Determines which trace information appear on the graph. + /// + /// + /// If set to false, ignore the global default settings set in `Defaults` + public static GenericChart FunnelArea( + IEnumerable values, + Optional Name = default, + Optional ShowLegend = default, + Optional Opacity = default, + Optional> MultiOpacity = default, + Optional> Labels = default, + Optional Text = default, + Optional> MultiText = default, + Optional TextPosition = default, + Optional> MultiTextPosition = default, + Optional> SectionColors = default, + Optional SectionOutlineColor = default, + Optional SectionOutlineWidth = default, + Optional> SectionOutlineMultiWidth = default, + Optional SectionOutline = default, + Optional MarkerPatternShape = default, + Optional> MultiMarkerPatternShape = default, + Optional MarkerPattern = default, + Optional Marker = default, + Optional TextInfo = default, + Optional AspectRatio = default, + Optional BaseRatio = default, + Optional UseDefaults = default + ) + where ValuesType : IConvertible + where LabelsType : IConvertible + where TextType : IConvertible + => + Plotly.NET.ChartDomain_Pie.Chart.FunnelArea( + values: values, + Name: Name.ToOption(), + ShowLegend: ShowLegend.ToOption(), + Opacity: Opacity.ToOption(), + MultiOpacity: MultiOpacity.ToOption(), + Labels: Labels.ToOption(), + Text: Text.ToOption(), + MultiText: MultiText.ToOption(), + TextPosition: TextPosition.ToOption(), + MultiTextPosition: MultiTextPosition.ToOption(), + SectionColors: SectionColors.ToOption(), + SectionOutlineColor: SectionOutlineColor.ToOption(), + SectionOutlineWidth: SectionOutlineWidth.ToOption(), + SectionOutlineMultiWidth: SectionOutlineMultiWidth.ToOption(), + SectionOutline: SectionOutline.ToOption(), + MarkerPatternShape: MarkerPatternShape.ToOption(), + MultiMarkerPatternShape: MultiMarkerPatternShape.ToOption(), + MarkerPattern: MarkerPattern.ToOption(), + Marker: Marker.ToOption(), + TextInfo: TextInfo.ToOption(), + AspectRatio: AspectRatio.ToOption(), + BaseRatio: BaseRatio.ToOption(), + UseDefaults: UseDefaults.ToOption() + ); +} diff --git a/src/Plotly.NET.CSharp/ChartAPI/ChartDomain/Icicle.cs b/src/Plotly.NET.CSharp/ChartAPI/ChartDomain/Icicle.cs new file mode 100644 index 00000000..56f56c76 --- /dev/null +++ b/src/Plotly.NET.CSharp/ChartAPI/ChartDomain/Icicle.cs @@ -0,0 +1,133 @@ +using System; +using System.Collections.Generic; +using Plotly.NET; +using Plotly.NET.LayoutObjects; +using Plotly.NET.TraceObjects; +using static Plotly.NET.StyleParam; + +namespace Plotly.NET.CSharp; + +public static partial class Chart +{ + /// + /// Creates an icicle chart. + /// + /// Icicle charts visualize hierarchal data from leaves (and/or outer branches) towards root with rectangles. + /// The icicle sectors are determined by the entries in "labels" or "ids" and in "parents". + /// + /// Sets the labels of each of the sectors. + /// Sets the parent sectors for each of the sectors. Empty string items '' are understood to reference the root node in the hierarchy. If `ids` is filled, `parents` items are understood to be "ids" themselves. When `ids` is not set, plotly attempts to find matching items in `labels`, but beware they must be unique. + /// Sets the values associated with each of the sectors. + /// Assigns id labels to each datum. These ids for object constancy of data points during animation. + /// Sets the trace name. The trace name appear as the legend item and on hover + /// Sets the opactity of the trace + /// Sets the opactity of individual datum markers + /// Sets text elements associated with each (x,y) pair. If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace's (x,y) coordinates. If trace `hoverinfo` contains a "text" flag and "hovertext" is not set, these elements will be seen in the hover labels. + /// Sets text elements associated with each (x,y) pair. If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace's (x,y) coordinates. If trace `hoverinfo` contains a "text" flag and "hovertext" is not set, these elements will be seen in the hover labels. + /// Sets the positions of the `text` elements with respects to the (x,y) coordinates. + /// Sets the positions of the `text` elements with respects to the (x,y) coordinates. + /// Sets the colors associated with each section. + /// Sets the colorscale for the section values + /// Whether or not to show the section colorbar + /// Whether or not to show the section colorscale + /// Sets the color of the section outline. + /// Sets the width of the section outline. + /// Sets the width of each individual section outline. + /// Sets the section outline (use this for more finegrained control than the other section outline-associated arguments). + /// Sets a pattern shape for all sections + /// Sets an individual pattern shape for each section + /// Sets the marker pattern (use this for more finegrained control than the other pattern-associated arguments). + /// Sets the marker for the sections (use this for more finegrained control than the other marker-associated arguments). + /// Determines how the items in `values` are summed. When set to "total", items in `values` are taken to be value of all its descendants. When set to "remainder", items in `values` corresponding to the root and the branches sectors are taken to be the extra part not part of the sum of the values at their leaves. + /// Determines default for `values` when it is not provided, by inferring a 1 for each of the "leaves" and/or "branches", otherwise 0. + /// Sets the orientation of the tiling. + /// Sets the flip of the tiling: Determines if the positions obtained from solver are flipped on each axis. + /// Sets the styles for the icicle tiling + /// Sets the edge shape of the pathbar. + /// Sets the pathbar + /// Determines which trace information appear on the graph. + /// Sets the styles for the root of this trace. + /// Sets the level from which this trace hierarchy is rendered. Set `level` to `''` to start from the root node in the hierarchy. Must be an "id" if `ids` is filled in, otherwise plotly attempts to find a matching item in `labels`. + /// Sets the number of rendered sectors from any given `level`. Set `maxdepth` to "-1" to render all the levels in the hierarchy. + /// If set to false, ignore the global default settings set in `Defaults` + public static GenericChart Icicle( + IEnumerable labels, + IEnumerable parents, + Optional> Values = default, + Optional> Ids = default, + Optional Name = default, + Optional Opacity = default, + Optional> MultiOpacity = default, + Optional Text = default, + Optional> MultiText = default, + Optional TextPosition = default, + Optional> MultiTextPosition = default, + Optional> SectionColors = default, + Optional SectionColorScale = default, + Optional ShowSectionColorScale = default, + Optional ReverseSectionColorScale = default, + Optional SectionOutlineColor = default, + Optional SectionOutlineWidth = default, + Optional> SectionOutlineMultiWidth = default, + Optional SectionOutline = default, + Optional MarkerPatternShape = default, + Optional> MultiMarkerPatternShape = default, + Optional MarkerPattern = default, + Optional Marker = default, + Optional TextInfo = default, + Optional BranchValues = default, + Optional Count = default, + Optional TilingOrientation = default, + Optional TilingFlip = default, + Optional Tiling = default, + Optional PathBarEdgeShape = default, + Optional PathBar = default, + Optional Root = default, + Optional Level = default, + Optional MaxDepth = default, + Optional UseDefaults = default + ) + where LabelsType : IConvertible + where ParentsType : IConvertible + where ValuesType : IConvertible + where IdsType : IConvertible + where TextType : IConvertible + => + Plotly.NET.ChartDomain_Icicle.Chart.Icicle( + labels: labels, + parents: parents, + Values: Values.ToOption(), + Ids: Ids.ToOption(), + Name: Name.ToOption(), + Opacity: Opacity.ToOption(), + MultiOpacity: MultiOpacity.ToOption(), + Text: Text.ToOption(), + MultiText: MultiText.ToOption(), + TextPosition: TextPosition.ToOption(), + MultiTextPosition: MultiTextPosition.ToOption(), + SectionColors: SectionColors.ToOption(), + SectionColorScale: SectionColorScale.ToOption(), + ShowSectionColorScale: ShowSectionColorScale.ToOption(), + ReverseSectionColorScale: ReverseSectionColorScale.ToOption(), + SectionOutlineColor: SectionOutlineColor.ToOption(), + SectionOutlineWidth: SectionOutlineWidth.ToOption(), + SectionOutlineMultiWidth: SectionOutlineMultiWidth.ToOption(), + SectionOutline: SectionOutline.ToOption(), + MarkerPatternShape: MarkerPatternShape.ToOption(), + MultiMarkerPatternShape: MultiMarkerPatternShape.ToOption(), + MarkerPattern: MarkerPattern.ToOption(), + Marker: Marker.ToOption(), + TextInfo: TextInfo.ToOption(), + BranchValues: BranchValues.ToOption(), + Count: Count.ToOption(), + TilingOrientation: TilingOrientation.ToOption(), + TilingFlip: TilingFlip.ToOption(), + Tiling: Tiling.ToOption(), + PathBarEdgeShape: PathBarEdgeShape.ToOption(), + PathBar: PathBar.ToOption(), + Root: Root.ToOption(), + Level: Level.ToOption(), + MaxDepth: MaxDepth.ToOption(), + UseDefaults: UseDefaults.ToOption() + ); +} diff --git a/src/Plotly.NET.CSharp/ChartAPI/ChartDomain/Indicator.cs b/src/Plotly.NET.CSharp/ChartAPI/ChartDomain/Indicator.cs new file mode 100644 index 00000000..abbf7d87 --- /dev/null +++ b/src/Plotly.NET.CSharp/ChartAPI/ChartDomain/Indicator.cs @@ -0,0 +1,70 @@ +using System; +using System.Collections.Generic; +using Plotly.NET; +using Plotly.NET.LayoutObjects; +using Plotly.NET.TraceObjects; +using static Plotly.NET.StyleParam; + +namespace Plotly.NET.CSharp; + +public static partial class Chart +{ + /// + /// Creates an Indicator chart. + /// + /// An indicator is used to visualize a single `value` along with some contextual information such as `steps` or a `threshold`, using a combination of three visual elements: a number, a delta, and/or a gauge. + /// Deltas are taken with respect to a `reference`. + /// Gauges can be either angular or bullet (aka linear) gauges. + /// + /// Sets the number to be displayed. + /// Determines how the value is displayed on the graph. `number` displays the value numerically in text. `delta` displays the difference to a reference value in text. Finally, `gauge` displays the value graphically on an axis. + /// Sets the Range of the Gauge axis + /// Sets the trace name. The trace name appear as the legend item and on hover. + /// Sets the title of this trace. + /// Sets the domain of this trace. + /// Sets the horizontal alignment of the `text` within the box. Note that this attribute has no effect if an angular gauge is displayed: in this case, it is always centered + /// + /// Sets how the delta to the delta reference is displayed + /// Sets the styles of the displayed number + /// Sets the shape of the gauge + /// Sets the styles of the gauge + /// Whether or not to show the gauge axis + /// Sets the gauge axis + /// + public static GenericChart Indicator( + ValueType value, + StyleParam.IndicatorMode mode, + Optional Range = default, + Optional Name = default, + Optional Title = default, + Optional Domain = default, + Optional Align = default, + Optional DeltaReference = default, + Optional Delta = default, + Optional Number = default, + Optional GaugeShape = default, + Optional Gauge = default, + Optional ShowGaugeAxis = default, + Optional GaugeAxis = default, + Optional UseDefaults = default + ) + where ValueType : IConvertible + => + Plotly.NET.ChartDomain_Table.Chart.Indicator( + value: value, + mode: mode, + Range: Range.ToOption(), + Name: Name.ToOption(), + Title: Title.ToOption(), + Domain: Domain.ToOption(), + Align: Align.ToOption(), + DeltaReference: DeltaReference.ToOption(), + Delta: Delta.ToOption(), + Number: Number.ToOption(), + GaugeShape: GaugeShape.ToOption(), + Gauge: Gauge.ToOption(), + ShowGaugeAxis: ShowGaugeAxis.ToOption(), + GaugeAxis: GaugeAxis.ToOption(), + UseDefaults: UseDefaults.ToOption() + ); +} diff --git a/src/Plotly.NET.CSharp/ChartAPI/ChartDomain/ParallelCategories.cs b/src/Plotly.NET.CSharp/ChartAPI/ChartDomain/ParallelCategories.cs new file mode 100644 index 00000000..64afc17a --- /dev/null +++ b/src/Plotly.NET.CSharp/ChartAPI/ChartDomain/ParallelCategories.cs @@ -0,0 +1,70 @@ +using System; +using System.Collections.Generic; +using Plotly.NET; +using Plotly.NET.LayoutObjects; +using Plotly.NET.TraceObjects; +using static Plotly.NET.StyleParam; + +namespace Plotly.NET.CSharp; + +public static partial class Chart +{ + /// + /// Creates a parallel categories plot. + /// + /// The parallel categories diagram (also known as parallel sets or alluvial diagram) is a visualization of + /// multi-dimensional categorical data sets. Each variable in the data set is represented by a column of rectangles, + /// where each rectangle corresponds to a discrete value taken on by that variable. + /// The relative heights of the rectangles reflect the relative frequency of occurrence of the corresponding value. + /// + /// the dimensions of the plot, containing both dimension backdrop information and the associated data + /// Sets the trace name. The trace name appear as the legend item and on hover + /// The number of observations represented by each state. Defaults to 1 so that each state represents one observation + /// Sets the color of the lines that are connecting the datums on the dimensions + /// Sets the shape of the lines that are connecting the datums on the dimensions + /// Sets the colorscale of the lines that are connecting the datums on the dimensions + /// Whether or not to show the colorbar of the lines that are connecting the datums on the dimensions + /// Whether or not to reverse the colorscale of the lines that are connecting the datums on the dimensions + /// Sets the lines that are connecting the datums on the dimensions (use this for more finegrained control than the other line-associated arguments). + /// Sets the drag interaction mode for categories and dimensions. If `perpendicular`, the categories can only move along a line perpendicular to the paths. If `freeform`, the categories can freely move on the plane. If `fixed`, the categories and dimensions are stationary. + /// Sort paths so that like colors are bundled together within each category. + /// Sets the path sorting algorithm. If `forward`, sort paths based on dimension categories from left to right. If `backward`, sort paths based on dimensions categories from right to left. + /// Sets the label font of this trace. + /// Sets the tick font of this trace. + /// If set to false, ignore the global default settings set in `Defaults` + public static GenericChart ParallelCategories( + IEnumerable dimensions, + Optional Name = default, + Optional Counts = default, + Optional LineColor = default, + Optional LineShape = default, + Optional LineColorScale = default, + Optional ShowLineColorScale = default, + Optional ReverseLineColorScale = default, + Optional Line = default, + Optional Arrangement = default, + Optional BundleColors = default, + Optional SortPaths = default, + Optional LabelFont = default, + Optional TickFont = default, + Optional UseDefaults = default + ) + => + Plotly.NET.ChartDomain_Relations.Chart.ParallelCategories( + dimensions: dimensions, + Name: Name.ToOption(), + Counts: Counts.ToOption(), + LineColor: LineColor.ToOption(), + LineShape: LineShape.ToOption(), + LineColorScale: LineColorScale.ToOption(), + ShowLineColorScale: ShowLineColorScale.ToOption(), + ReverseLineColorScale: ReverseLineColorScale.ToOption(), + Line: Line.ToOption(), + Arrangement: Arrangement.ToOption(), + BundleColors: BundleColors.ToOption(), + SortPaths: SortPaths.ToOption(), + LabelFont: LabelFont.ToOption(), + TickFont: TickFont.ToOption(), + UseDefaults: UseDefaults.ToOption() + ); +} diff --git a/src/Plotly.NET.CSharp/ChartAPI/ChartDomain/ParallelCoord.cs b/src/Plotly.NET.CSharp/ChartAPI/ChartDomain/ParallelCoord.cs new file mode 100644 index 00000000..ed873977 --- /dev/null +++ b/src/Plotly.NET.CSharp/ChartAPI/ChartDomain/ParallelCoord.cs @@ -0,0 +1,65 @@ +using System; +using System.Collections.Generic; +using Plotly.NET; +using Plotly.NET.LayoutObjects; +using Plotly.NET.TraceObjects; +using static Plotly.NET.StyleParam; + +namespace Plotly.NET.CSharp; + +public static partial class Chart +{ + /// + /// Creates a parallel coordinates plot. + /// + /// Parallel coordinates are a common way of visualizing and analyzing high-dimensional datasets. + /// + /// To show a set of points in an n-dimensional space, a backdrop is drawn consisting of n parallel lines, typically vertical and equally spaced. A point in n-dimensional space is represented as a polyline with vertices on the parallel axes; the position of the vertex on the i-th axis corresponds to the i-th coordinate of the point. + /// + /// This visualization is closely related to time series visualization, except that it is applied to data where the axes do not correspond to points in time, and therefore do not have a natural order. Therefore, different axis arrangements may be of interest. + /// + /// the dimensions of the plot, containing both dimension backdrop information and the associated data + /// Sets the trace name. The trace name appear as the legend item and on hover + /// Sets the color of the lines that are connecting the datums on the dimensions + /// Sets the colorscale of the lines that are connecting the datums on the dimensions + /// Whether or not to show the colorbar of the lines that are connecting the datums on the dimensions + /// Whether or not to reverse the colorscale of the lines that are connecting the datums on the dimensions + /// Sets the lines that are connecting the datums on the dimensions (use this for more finegrained control than the other line-associated arguments). + /// Sets the angle of the labels with respect to the horizontal. For example, a `tickangle` of -90 draws the labels vertically. Tilted labels with "labelangle" may be positioned better inside margins when `labelposition` is set to "bottom". + /// Sets the label font of this trace. + /// Specifies the location of the `label`. "top" positions labels above, next to the title "bottom" positions labels below the graph Tilted labels with "labelangle" may be positioned better inside margins when `labelposition` is set to "bottom". + /// Sets the range font of this trace. + /// Sets the tick font of this trace. + /// If set to false, ignore the global default settings set in `Defaults` + public static GenericChart ParallelCoord( + IEnumerable dimensions, + Optional Name = default, + Optional LineColor = default, + Optional LineColorScale = default, + Optional ShowLineColorScale = default, + Optional ReverseLineColorScale = default, + Optional Line = default, + Optional LabelAngle = default, + Optional LabelFont = default, + Optional LabelSide = default, + Optional RangeFont = default, + Optional TickFont = default, + Optional UseDefaults = default + ) + => + Plotly.NET.ChartDomain_Relations.Chart.ParallelCoord( + dimensions: dimensions, + Name: Name.ToOption(), + LineColor: LineColor.ToOption(), + LineColorScale: LineColorScale.ToOption(), + ShowLineColorScale: ShowLineColorScale.ToOption(), + ReverseLineColorScale: ReverseLineColorScale.ToOption(), + Line: Line.ToOption(), + LabelAngle: LabelAngle.ToOption(), + LabelFont: LabelFont.ToOption(), + LabelSide: LabelSide.ToOption(), + RangeFont: RangeFont.ToOption(), + TickFont: TickFont.ToOption(), + UseDefaults: UseDefaults.ToOption() + ); +} diff --git a/src/Plotly.NET.CSharp/ChartAPI/ChartDomain/Pie.cs b/src/Plotly.NET.CSharp/ChartAPI/ChartDomain/Pie.cs new file mode 100644 index 00000000..148bd25b --- /dev/null +++ b/src/Plotly.NET.CSharp/ChartAPI/ChartDomain/Pie.cs @@ -0,0 +1,107 @@ +using System; +using System.Collections.Generic; +using Plotly.NET; +using Plotly.NET.LayoutObjects; +using Plotly.NET.TraceObjects; +using static Plotly.NET.StyleParam; + +namespace Plotly.NET.CSharp; + +public static partial class Chart +{ + /// + /// Creates a pie chart. + /// + /// A pie chart (or a circle chart) is a circular statistical graphic, which is divided into slices to illustrate numerical proportion. + /// In a pie chart, the arc length of each slice (and consequently its central angle and area), is proportional to the quantity it represents. + /// + /// Sets the values of the sectors + /// 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. + /// Sets the opactity of the trace + /// Sets the opactity of individual datum markers + /// Sets the sector labels. If `labels` entries are duplicated, the associated `values` are summed. + /// Sets the fraction of larger radius to pull the sectors out from the center. This can be a constant to pull all slices apart from each other equally or an array to highlight one or more slices. + /// Sets the fraction of larger radius to pull the sectors out from the center. This can be a constant to pull all slices apart from each other equally or an array to highlight one or more slices. + /// Sets text elements associated with each (x,y) pair. If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace's (x,y) coordinates. If trace `hoverinfo` contains a "text" flag and "hovertext" is not set, these elements will be seen in the hover labels. + /// Sets text elements associated with each (x,y) pair. If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace's (x,y) coordinates. If trace `hoverinfo` contains a "text" flag and "hovertext" is not set, these elements will be seen in the hover labels. + /// Sets the positions of the `text` elements with respects to the (x,y) coordinates. + /// Sets the positions of the `text` elements with respects to the (x,y) coordinates. + /// Sets the colors associated with each section. + /// Sets the color of the section outline. + /// Sets the width of the section outline. + /// Sets the width of each individual section outline. + /// Sets the section outline (use this for more finegrained control than the other section outline-associated arguments). + /// Sets a pattern shape for all sections + /// Sets an individual pattern shape for each bar + /// Sets the marker pattern (use this for more finegrained control than the other pattern-associated arguments). + /// Sets the marker for the sections (use this for more finegrained control than the other marker-associated arguments). + /// Determines which trace information appear on the graph. + /// Specifies the direction at which succeeding sectors follow one another. + /// Sets the fraction of the radius to cut out of the pie. Use this to make a donut chart. + /// Instead of the first slice starting at 12 o'clock, rotate to some other angle. + /// Determines whether or not the sectors are reordered from largest to smallest. + /// If set to false, ignore the global default settings set in `Defaults` + public static GenericChart Pie( + IEnumerable values, + Optional Name = default, + Optional ShowLegend = default, + Optional Opacity = default, + Optional> MultiOpacity = default, + Optional> Labels = default, + Optional Pull = default, + Optional> MultiPull = default, + Optional Text = default, + Optional> MultiText = default, + Optional TextPosition = default, + Optional> MultiTextPosition = default, + Optional> SectionColors = default, + Optional SectionOutlineColor = default, + Optional SectionOutlineWidth = default, + Optional> SectionOutlineMultiWidth = default, + Optional SectionOutline = default, + Optional MarkerPatternShape = default, + Optional> MultiMarkerPatternShape = default, + Optional MarkerPattern = default, + Optional Marker = default, + Optional TextInfo = default, + Optional Direction = default, + Optional Hole = default, + Optional Rotation = default, + Optional Sort = default, + Optional UseDefaults = default + ) + where ValuesType : IConvertible + where LabelsType : IConvertible + where TextType : IConvertible + => + Plotly.NET.ChartDomain_Pie.Chart.Pie( + values: values, + Name: Name.ToOption(), + ShowLegend: ShowLegend.ToOption(), + Opacity: Opacity.ToOption(), + MultiOpacity: MultiOpacity.ToOption(), + Labels: Labels.ToOption(), + Pull: Pull.ToOption(), + MultiPull: MultiPull.ToOption(), + Text: Text.ToOption(), + MultiText: MultiText.ToOption(), + TextPosition: TextPosition.ToOption(), + MultiTextPosition: MultiTextPosition.ToOption(), + SectionColors: SectionColors.ToOption(), + SectionOutlineColor: SectionOutlineColor.ToOption(), + SectionOutlineWidth: SectionOutlineWidth.ToOption(), + SectionOutlineMultiWidth: SectionOutlineMultiWidth.ToOption(), + SectionOutline: SectionOutline.ToOption(), + MarkerPatternShape: MarkerPatternShape.ToOption(), + MultiMarkerPatternShape: MultiMarkerPatternShape.ToOption(), + MarkerPattern: MarkerPattern.ToOption(), + Marker: Marker.ToOption(), + TextInfo: TextInfo.ToOption(), + Direction: Direction.ToOption(), + Hole: Hole.ToOption(), + Rotation: Rotation.ToOption(), + Sort: Sort.ToOption(), + UseDefaults: UseDefaults.ToOption() + ); +} diff --git a/src/Plotly.NET.CSharp/ChartAPI/ChartDomain/Sankey.cs b/src/Plotly.NET.CSharp/ChartAPI/ChartDomain/Sankey.cs new file mode 100644 index 00000000..ef35be2e --- /dev/null +++ b/src/Plotly.NET.CSharp/ChartAPI/ChartDomain/Sankey.cs @@ -0,0 +1,55 @@ +using System; +using System.Collections.Generic; +using Plotly.NET; +using Plotly.NET.LayoutObjects; +using Plotly.NET.TraceObjects; +using static Plotly.NET.StyleParam; + +namespace Plotly.NET.CSharp; + +public static partial class Chart +{ + /// + /// Creates a sankey diagram. + /// + /// A Sankey diagram is a flow diagram, in which the width of arrows is proportional to the flow quantity. + /// + /// Sankey diagrams visualize the contributions to a flow by defining source to represent the source node, target for the target node, value to set the flow volume, and label that shows the node name. + /// + /// Sets the nodes of the Sankey plot. + /// Sets the links between nodes of the Sankey plot. + /// Sets the trace name. The trace name appear as the legend item and on hover. + /// Assigns id labels to each datum. + /// Sets the orientation of the Sankey diagram. + /// Sets the text font of this trace. + /// If value is `snap` (the default), the node arrangement is assisted by automatic snapping of elements to preserve space between nodes specified via `nodepad`. If value is `perpendicular`, the nodes can only move along a line perpendicular to the flow. If value is `freeform`, the nodes can freely move on the plane. If value is `fixed`, the nodes are stationary. + /// Sets the value formatting rule using d3 formatting mini-languages which are very similar to those in Python. For numbers, see: https://github.com/d3/d3-format/tree/v1.4.5#d3-format. + /// Adds a unit to follow the value in the hover tooltip. Add a space if a separation is necessary from the value. + /// If set to false, ignore the global default settings set in `Defaults` + public static GenericChart Sankey( + SankeyNodes nodes, + SankeyLinks links, + Optional Name = default, + Optional> Ids = default, + Optional Orientation = default, + Optional TextFont = default, + Optional Arrangement = default, + Optional ValueFormat = default, + Optional ValueSuffix = default, + Optional UseDefaults = default + ) + where IdsType : IConvertible + => + Plotly.NET.ChartDomain_Relations.Chart.Sankey( + nodes: nodes, + links: links, + Name: Name.ToOption(), + Ids: Ids.ToOption(), + Orientation: Orientation.ToOption(), + TextFont: TextFont.ToOption(), + Arrangement: Arrangement.ToOption(), + ValueFormat: ValueFormat.ToOption(), + ValueSuffix: ValueSuffix.ToOption(), + UseDefaults: UseDefaults.ToOption() + ); +} diff --git a/src/Plotly.NET.CSharp/ChartAPI/ChartDomain/Sunburst.cs b/src/Plotly.NET.CSharp/ChartAPI/ChartDomain/Sunburst.cs new file mode 100644 index 00000000..86b932d0 --- /dev/null +++ b/src/Plotly.NET.CSharp/ChartAPI/ChartDomain/Sunburst.cs @@ -0,0 +1,123 @@ +using System; +using System.Collections.Generic; +using Plotly.NET; +using Plotly.NET.LayoutObjects; +using Plotly.NET.TraceObjects; +using static Plotly.NET.StyleParam; + +namespace Plotly.NET.CSharp; + +public static partial class Chart +{ + /// + /// Creates a sunburst chart, which visualizes hierarchical data spanning outward radially from root to leaves. + /// + /// The hierarchy is defined by labels and parents attributes. The root starts from the center and children are added to the outer rings. + /// + /// Sets the labels of each of the sectors. + /// Sets the parent sectors for each of the sectors. Empty string items '' are understood to reference the root node in the hierarchy. If `ids` is filled, `parents` items are understood to be "ids" themselves. When `ids` is not set, plotly attempts to find matching items in `labels`, but beware they must be unique. + /// Sets the values associated with each of the sectors. + /// Assigns id labels to each datum. These ids for object constancy of data points during animation. + /// 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. + /// Sets the opactity of the trace + /// Sets the opactity of individual datum markers + /// Sets text elements associated with each (x,y) pair. If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace's (x,y) coordinates. If trace `hoverinfo` contains a "text" flag and "hovertext" is not set, these elements will be seen in the hover labels. + /// Sets text elements associated with each (x,y) pair. If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace's (x,y) coordinates. If trace `hoverinfo` contains a "text" flag and "hovertext" is not set, these elements will be seen in the hover labels. + /// Sets the colors associated with each section. + /// Sets the colorscale for the section values + /// Whether or not to show the section colorbar + /// Whether or not to show the section colorscale + /// Sets the color of the section outline. + /// Sets the width of the section outline. + /// Sets the width of each individual section outline. + /// Sets the section outline (use this for more finegrained control than the other section outline-associated arguments). + /// Sets a pattern shape for all sections + /// Sets an individual pattern shape for each section + /// Sets the marker pattern (use this for more finegrained control than the other pattern-associated arguments). + /// Sets the marker for the sections (use this for more finegrained control than the other marker-associated arguments). + /// Determines which trace information appear on the graph. + /// Determines how the items in `values` are summed. When set to "total", items in `values` are taken to be value of all its descendants. When set to "remainder", items in `values` corresponding to the root and the branches sectors are taken to be the extra part not part of the sum of the values at their leaves. + /// Determines default for `values` when it is not provided, by inferring a 1 for each of the "leaves" and/or "branches", otherwise 0. + /// Sets the styles for the root of this trace. + /// Sets the styles for the leaves of this trace. + /// Sets the level from which this trace hierarchy is rendered. Set `level` to `''` to start from the root node in the hierarchy. Must be an "id" if `ids` is filled in, otherwise plotly attempts to find a matching item in `labels`. + /// Sets the number of rendered sectors from any given `level`. Set `maxdepth` to "-1" to render all the levels in the hierarchy. + /// Rotates the whole diagram counterclockwise by some angle. By default the first slice starts at 3 o'clock. + /// Determines whether or not the sectors are reordered from largest to smallest. + /// If set to false, ignore the global default settings set in `Defaults` + public static GenericChart Sunburst( + IEnumerable labels, + IEnumerable parents, + Optional> Values = default, + Optional> Ids = default, + Optional Name = default, + Optional ShowLegend = default, + Optional Opacity = default, + Optional> MultiOpacity = default, + Optional Text = default, + Optional> MultiText = default, + Optional> SectionColors = default, + Optional SectionColorScale = default, + Optional ShowSectionColorScale = default, + Optional ReverseSectionColorScale = default, + Optional SectionOutlineColor = default, + Optional SectionOutlineWidth = default, + Optional> SectionOutlineMultiWidth = default, + Optional SectionOutline = default, + Optional MarkerPatternShape = default, + Optional> MultiMarkerPatternShape = default, + Optional MarkerPattern = default, + Optional Marker = default, + Optional TextInfo = default, + Optional BranchValues = default, + Optional Count = default, + Optional Root = default, + Optional Leaf = default, + Optional Level = default, + Optional MaxDepth = default, + Optional Rotation = default, + Optional Sort = default, + Optional UseDefaults = default + ) + where LabelsType : IConvertible + where ParentsType : IConvertible + where ValuesType : IConvertible + where IdsType : IConvertible + where TextType : IConvertible + => + Plotly.NET.ChartDomain_Hierarchy.Chart.Sunburst( + labels: labels, + parents: parents, + Values: Values.ToOption(), + Ids: Ids.ToOption(), + Name: Name.ToOption(), + ShowLegend: ShowLegend.ToOption(), + Opacity: Opacity.ToOption(), + MultiOpacity: MultiOpacity.ToOption(), + Text: Text.ToOption(), + MultiText: MultiText.ToOption(), + SectionColors: SectionColors.ToOption(), + SectionColorScale: SectionColorScale.ToOption(), + ShowSectionColorScale: ShowSectionColorScale.ToOption(), + ReverseSectionColorScale: ReverseSectionColorScale.ToOption(), + SectionOutlineColor: SectionOutlineColor.ToOption(), + SectionOutlineWidth: SectionOutlineWidth.ToOption(), + SectionOutlineMultiWidth: SectionOutlineMultiWidth.ToOption(), + SectionOutline: SectionOutline.ToOption(), + MarkerPatternShape: MarkerPatternShape.ToOption(), + MultiMarkerPatternShape: MultiMarkerPatternShape.ToOption(), + MarkerPattern: MarkerPattern.ToOption(), + Marker: Marker.ToOption(), + TextInfo: TextInfo.ToOption(), + BranchValues: BranchValues.ToOption(), + Count: Count.ToOption(), + Root: Root.ToOption(), + Leaf: Leaf.ToOption(), + Level: Level.ToOption(), + MaxDepth: MaxDepth.ToOption(), + Rotation: Rotation.ToOption(), + Sort: Sort.ToOption(), + UseDefaults: UseDefaults.ToOption() + ); +} diff --git a/src/Plotly.NET.CSharp/ChartAPI/ChartDomain/Table.cs b/src/Plotly.NET.CSharp/ChartAPI/ChartDomain/Table.cs new file mode 100644 index 00000000..df1133d9 --- /dev/null +++ b/src/Plotly.NET.CSharp/ChartAPI/ChartDomain/Table.cs @@ -0,0 +1,43 @@ +using System; +using System.Collections.Generic; +using Plotly.NET; +using Plotly.NET.LayoutObjects; +using Plotly.NET.TraceObjects; +using static Plotly.NET.StyleParam; + +namespace Plotly.NET.CSharp; + +public static partial class Chart +{ + /// + /// Creates a table. + /// + /// The data are arranged in a grid of rows and columns. Most styling can be specified for columns, rows or individual cells. Table is using a row-major order by default, ie. the grid is represented as a vector of row vectors. + /// + /// Sets the header of the table + /// Sets the cells of the table + /// Sets the trace name. The trace name appear as the legend item and on hover. + /// Specifies the rendered order of the data columns; for example, a value `2` at position `0` means that column index `0` in the data will be rendered as the third column, as columns have an index base of zero. + /// The width of columns expressed as a ratio. Columns fill the available width in proportion of their specified column widths. + /// The width of columns expressed as a ratio. Columns fill the available width in proportion of their specified column widths. + /// If set to false, ignore the global default settings set in `Defaults` + public static GenericChart Table( + TableCells header, + TableCells cells, + Optional Name = default, + Optional> ColumnOrder = default, + Optional ColumnWidth = default, + Optional> MultiColumnWidth = default, + Optional UseDefaults = default + ) + => + Plotly.NET.ChartDomain_Table.Chart.Table( + header: header, + cells: cells, + Name: Name.ToOption(), + ColumnOrder: ColumnOrder.ToOption(), + ColumnWidth: ColumnWidth.ToOption(), + MultiColumnWidth: MultiColumnWidth.ToOption(), + UseDefaults: UseDefaults.ToOption() + ); +} diff --git a/src/Plotly.NET.CSharp/ChartAPI/ChartDomain/Treemap.cs b/src/Plotly.NET.CSharp/ChartAPI/ChartDomain/Treemap.cs new file mode 100644 index 00000000..b1e1410d --- /dev/null +++ b/src/Plotly.NET.CSharp/ChartAPI/ChartDomain/Treemap.cs @@ -0,0 +1,128 @@ +using System; +using System.Collections.Generic; +using Plotly.NET; +using Plotly.NET.LayoutObjects; +using Plotly.NET.TraceObjects; +using static Plotly.NET.StyleParam; + +namespace Plotly.NET.CSharp; + +public static partial class Chart +{ + /// + /// Creates a treemap chart. + /// Treemap charts visualize hierarchical data using nested rectangles. + /// + /// Same as Sunburst the hierarchy is defined by labels and parents attributes. + /// Click on one sector to zoom in/out, which also displays a pathbar in the upper-left corner of your treemap. To zoom out you can use the path bar as well. + /// + /// Sets the labels of each of the sectors. + /// Sets the parent sectors for each of the sectors. Empty string items '' are understood to reference the root node in the hierarchy. If `ids` is filled, `parents` items are understood to be "ids" themselves. When `ids` is not set, plotly attempts to find matching items in `labels`, but beware they must be unique. + /// Sets the values associated with each of the sectors. + /// Assigns id labels to each datum. These ids for object constancy of data points during animation. + /// 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. + /// Sets the opactity of the trace + /// Sets the opactity of individual datum markers + /// Sets text elements associated with each (x,y) pair. If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace's (x,y) coordinates. If trace `hoverinfo` contains a "text" flag and "hovertext" is not set, these elements will be seen in the hover labels. + /// Sets text elements associated with each (x,y) pair. If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace's (x,y) coordinates. If trace `hoverinfo` contains a "text" flag and "hovertext" is not set, these elements will be seen in the hover labels. + /// Sets the positions of the `text` elements with respects to the (x,y) coordinates. + /// Sets the positions of the `text` elements with respects to the (x,y) coordinates. + /// Sets the colors associated with each section. + /// Sets the colorscale for the section values + /// Whether or not to show the section colorbar + /// Whether or not to show the section colorscale + /// Sets the color of the section outline. + /// Sets the width of the section outline. + /// Sets the width of each individual section outline. + /// Sets the section outline (use this for more finegrained control than the other section outline-associated arguments). + /// Sets a pattern shape for all sections + /// Sets an individual pattern shape for each section + /// Sets the marker pattern (use this for more finegrained control than the other pattern-associated arguments). + /// Sets the marker for the sections (use this for more finegrained control than the other marker-associated arguments). + /// Determines which trace information appear on the graph. + /// Determines how the items in `values` are summed. When set to "total", items in `values` are taken to be value of all its descendants. When set to "remainder", items in `values` corresponding to the root and the branches sectors are taken to be the extra part not part of the sum of the values at their leaves. + /// Determines default for `values` when it is not provided, by inferring a 1 for each of the "leaves" and/or "branches", otherwise 0. + /// Sets the tiling for this trace. + /// Sets the path bar for this trace. + /// Sets the styles for the root of this trace. + /// Sets the level from which this trace hierarchy is rendered. Set `level` to `''` to start from the root node in the hierarchy. Must be an "id" if `ids` is filled in, otherwise plotly attempts to find a matching item in `labels`. + /// Sets the number of rendered sectors from any given `level`. Set `maxdepth` to "-1" to render all the levels in the hierarchy. + /// If set to false, ignore the global default settings set in `Defaults` + public static GenericChart Treemap( + IEnumerable labels, + IEnumerable parents, + Optional> Values = default, + Optional> Ids = default, + Optional Name = default, + Optional ShowLegend = default, + Optional Opacity = default, + Optional> MultiOpacity = default, + Optional Text = default, + Optional> MultiText = default, + Optional TextPosition = default, + Optional> MultiTextPosition = default, + Optional> SectionColors = default, + Optional SectionColorScale = default, + Optional ShowSectionColorScale = default, + Optional ReverseSectionColorScale = default, + Optional SectionOutlineColor = default, + Optional SectionOutlineWidth = default, + Optional> SectionOutlineMultiWidth = default, + Optional SectionOutline = default, + Optional MarkerPatternShape = default, + Optional> MultiMarkerPatternShape = default, + Optional MarkerPattern = default, + Optional Marker = default, + Optional TextInfo = default, + Optional BranchValues = default, + Optional Count = default, + Optional Tiling = default, + Optional PathBar = default, + Optional Root = default, + Optional Level = default, + Optional MaxDepth = default, + Optional UseDefaults = default + ) + where LabelsType : IConvertible + where ParentsType : IConvertible + where ValuesType : IConvertible + where IdsType : IConvertible + where TextType : IConvertible + => + Plotly.NET.ChartDomain_Hierarchy.Chart.Treemap( + labels: labels, + parents: parents, + Values: Values.ToOption(), + Ids: Ids.ToOption(), + Name: Name.ToOption(), + ShowLegend: ShowLegend.ToOption(), + Opacity: Opacity.ToOption(), + MultiOpacity: MultiOpacity.ToOption(), + Text: Text.ToOption(), + MultiText: MultiText.ToOption(), + TextPosition: TextPosition.ToOption(), + MultiTextPosition: MultiTextPosition.ToOption(), + SectionColors: SectionColors.ToOption(), + SectionColorScale: SectionColorScale.ToOption(), + ShowSectionColorScale: ShowSectionColorScale.ToOption(), + ReverseSectionColorScale: ReverseSectionColorScale.ToOption(), + SectionOutlineColor: SectionOutlineColor.ToOption(), + SectionOutlineWidth: SectionOutlineWidth.ToOption(), + SectionOutlineMultiWidth: SectionOutlineMultiWidth.ToOption(), + SectionOutline: SectionOutline.ToOption(), + MarkerPatternShape: MarkerPatternShape.ToOption(), + MultiMarkerPatternShape: MultiMarkerPatternShape.ToOption(), + MarkerPattern: MarkerPattern.ToOption(), + Marker: Marker.ToOption(), + TextInfo: TextInfo.ToOption(), + BranchValues: BranchValues.ToOption(), + Count: Count.ToOption(), + Tiling: Tiling.ToOption(), + PathBar: PathBar.ToOption(), + Root: Root.ToOption(), + Level: Level.ToOption(), + MaxDepth: MaxDepth.ToOption(), + UseDefaults: UseDefaults.ToOption() + ); +} diff --git a/src/Plotly.NET.CSharp/ChartAPI/ChartMap.cs b/src/Plotly.NET.CSharp/ChartAPI/ChartMap.cs deleted file mode 100644 index fe578050..00000000 --- a/src/Plotly.NET.CSharp/ChartAPI/ChartMap.cs +++ /dev/null @@ -1,883 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Plotly.NET; -using Plotly.NET.LayoutObjects; -using Plotly.NET.TraceObjects; -using System.Runtime.InteropServices; -using static Plotly.NET.StyleParam; - -namespace Plotly.NET.CSharp -{ - public static partial class Chart - { - /// - /// Creates a choropleth map using plotly's base geo map. - /// - /// A choropleth map is a type of thematic map in which a set of pre-defined areas is colored or patterned in proportion to a statistical variable that represents an aggregate summary of a geographic characteristic within each area, such as population density or per-capita income. - /// - /// Sets the locations which will be colored. See LocationMode for more info. - /// The color values for each location - /// 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. - /// Sets optional GeoJSON data associated with this trace. If not given, the features on the base map are used. It can be set as a valid GeoJSON object or as a URL string. Note that we only accept GeoJSONs of type "FeatureCollection" or "Feature" with geometries of type "Polygon" or "MultiPolygon". - /// Sets the key in GeoJSON features which is used as id to match the items included in the `locations` array. Only has an effect when `geojson` is set. Support nested property, for example "properties.name". - /// Sets the text elements associated with each location. - /// Sets the text elements associated with each location. - /// Sets the colorbar. - /// Sets the colorscale. - /// Determines whether or not a colorbar is displayed for this trace. - /// Reverses the color mapping if true. - /// Determines the set of locations used to match entries in `locations` to regions on the map. Values "ISO-3", "USA-states", "country names" correspond to features on the base map and value "geojson-id" corresponds to features from a custom GeoJSON linked to the `geojson` attribute. - /// If set to false, ignore the global default settings set in `Defaults` - public static GenericChart ChoroplethMap( - IEnumerable locations, - IEnumerable z, - Optional Name = default, - Optional ShowLegend = default, - Optional GeoJson = default, - Optional FeatureIdKey = default, - Optional Text = default, - Optional> MultiText = default, - Optional ColorBar = default, - Optional ColorScale = default, - Optional ShowScale = default, - Optional ReverseScale = default, - Optional LocationMode = default, - Optional UseDefaults = default - ) - where ZType: IConvertible - where TextType : IConvertible - => - Plotly.NET.ChartMap_Geo.Chart.ChoroplethMap( - locations: locations, - z: z, - Name: Name.ToOption(), - ShowLegend: ShowLegend.ToOption(), - GeoJson: GeoJson.ToOption(), - FeatureIdKey: FeatureIdKey.ToOption(), - Text: Text.ToOption(), - MultiText: MultiText.ToOption(), - ColorBar: ColorBar.ToOption(), - ColorScale: ColorScale.ToOption(), - ShowScale: ShowScale.ToOption(), - ReverseScale: ReverseScale.ToOption(), - LocationMode: LocationMode.ToOption(), - UseDefaults: UseDefaults.ToOption() - ); - - /// - /// Creates a ScatterGeo chart, where data is visualized using plotly's base geo map. - /// - /// In general, ScatterGeo Plots plot two-dimensional data on a geo map via (lat,lon) coordinates. - /// - /// ScatterGeo charts are the basis of PointGeo, LineGeo, and BubbleGeo Charts, and can be customized as such. We also provide abstractions for those: Chart.PointGeo, Chart.LineGeo, Chart.BubbleGeo - /// - /// Sets the longitude coordinates (in degrees East). - /// Sets the latitude coordinates (in degrees North). - /// 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. - /// Sets the opactity of the trace - /// Sets the opactity of individual datum markers - /// Sets a text associated with each datum - /// Sets individual text for each datum - /// Sets the position of text associated with each datum - /// Sets the position of text associated with individual datum - /// Sets the color of the marker - /// Sets the colorscale of the marker - /// Sets the outline of the marker - /// Sets the marker symbol for each datum - /// Sets the marker symbol for each individual datum - /// Sets the marker (use this for more finegrained control than the other marker-associated arguments) - /// Sets the color of the line - /// Sets the colorscale of the line - /// Sets the width of the line - /// sets the drawing style of the line - /// Sets the line (use this for more finegrained control than the other line-associated arguments) - /// Determines the set of locations used to match entries in `locations` to regions on the map. Values "ISO-3", "USA-states", "country names" correspond to features on the base map and value "geojson-id" corresponds to features from a custom GeoJSON linked to the `geojson` attribute. - /// Sets optional GeoJSON data associated with this trace. If not given, the features on the base map are used. It can be set as a valid GeoJSON object or as a URL string. Note that we only accept GeoJSONs of type "FeatureCollection" or "Feature" with geometries of type "Polygon" or "MultiPolygon". - /// Sets the key in GeoJSON features which is used as id to match the items included in the `locations` array. Only has an effect when `geojson` is set. Support nested property, for example "properties.name". - /// If set to false, ignore the global default settings set in `Defaults` - public static GenericChart ScatterGeo( - IEnumerable longitudes, - IEnumerable latitudes, - StyleParam.Mode mode, - Optional Name = default, - Optional ShowLegend = default, - Optional Opacity = default, - Optional> MultiOpacity = default, - Optional Text = default, - Optional> MultiText = default, - Optional TextPosition = default, - Optional> MultiTextPosition = default, - Optional MarkerColor = default, - Optional MarkerColorScale = default, - Optional MarkerOutline = default, - Optional MarkerSymbol = default, - Optional> MultiMarkerSymbol = default, - Optional Marker = default, - Optional LineColor = default, - Optional LineColorScale = default, - Optional LineWidth = default, - Optional LineDash = default, - Optional Line = default, - Optional LocationMode = default, - Optional GeoJson = default, - Optional FeatureIdKey = default, - Optional UseDefaults = default - ) - where LongitudesType : IConvertible - where LatitudesType : IConvertible - where TextType : IConvertible - => - Plotly.NET.ChartMap_Geo.Chart.ScatterGeo( - longitudes: longitudes, - latitudes: latitudes, - mode: mode, - Name: Name.ToOption(), - ShowLegend: ShowLegend.ToOption(), - Opacity: Opacity.ToOption(), - MultiOpacity: MultiOpacity.ToOption(), - Text: Text.ToOption(), - MultiText: MultiText.ToOption(), - TextPosition: TextPosition.ToOption(), - MultiTextPosition: MultiTextPosition.ToOption(), - MarkerColor: MarkerColor.ToOption(), - MarkerColorScale: MarkerColorScale.ToOption(), - MarkerOutline: MarkerOutline.ToOption(), - MarkerSymbol: MarkerSymbol.ToOption(), - MultiMarkerSymbol: MultiMarkerSymbol.ToOption(), - Marker: Marker.ToOption(), - LineColor: LineColor.ToOption(), - LineColorScale: LineColorScale.ToOption(), - LineWidth: LineWidth.ToOption(), - LineDash: LineDash.ToOption(), - Line: Line.ToOption(), - LocationMode: LocationMode.ToOption(), - GeoJson: GeoJson.ToOption(), - FeatureIdKey: FeatureIdKey.ToOption(), - UseDefaults: UseDefaults.ToOption() - ); - - /// - /// Creates a PointGeo chart. - /// - /// In general, PointGeo Plots plot two-dimensional data as points using plotly's base geo map. - /// - /// Sets the longitude coordinates (in degrees East). - /// Sets the latitude coordinates (in degrees North). - /// 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. - /// Sets the opactity of the trace - /// Sets the opactity of individual datum markers - /// Sets a text associated with each datum - /// Sets individual text for each datum - /// Sets the position of text associated with each datum - /// Sets the position of text associated with individual datum - /// Sets the color of the marker - /// Sets the colorscale of the marker - /// Sets the outline of the marker - /// Sets the marker symbol for each datum - /// Sets the marker symbol for each individual datum - /// Sets the marker (use this for more finegrained control than the other marker-associated arguments) - /// Determines the set of locations used to match entries in `locations` to regions on the map. Values "ISO-3", "USA-states", "country names" correspond to features on the base map and value "geojson-id" corresponds to features from a custom GeoJSON linked to the `geojson` attribute. - /// Sets optional GeoJSON data associated with this trace. If not given, the features on the base map are used. It can be set as a valid GeoJSON object or as a URL string. Note that we only accept GeoJSONs of type "FeatureCollection" or "Feature" with geometries of type "Polygon" or "MultiPolygon". - /// Sets the key in GeoJSON features which is used as id to match the items included in the `locations` array. Only has an effect when `geojson` is set. Support nested property, for example "properties.name". - /// If set to false, ignore the global default settings set in `Defaults` - public static GenericChart PointGeo( - IEnumerable longitudes, - IEnumerable latitudes, - Optional Name = default, - Optional ShowLegend = default, - Optional Opacity = default, - Optional> MultiOpacity = default, - Optional Text = default, - Optional> MultiText = default, - Optional TextPosition = default, - Optional> MultiTextPosition = default, - Optional MarkerColor = default, - Optional MarkerColorScale = default, - Optional MarkerOutline = default, - Optional MarkerSymbol = default, - Optional> MultiMarkerSymbol = default, - Optional Marker = default, - Optional LocationMode = default, - Optional GeoJson = default, - Optional FeatureIdKey = default, - Optional UseDefaults = default - ) - where LongitudesType : IConvertible - where LatitudesType : IConvertible - where TextType : IConvertible - => - Plotly.NET.ChartMap_Geo.Chart.PointGeo( - longitudes: longitudes, - latitudes: latitudes, - Name: Name.ToOption(), - ShowLegend: ShowLegend.ToOption(), - Opacity: Opacity.ToOption(), - MultiOpacity: MultiOpacity.ToOption(), - Text: Text.ToOption(), - MultiText: MultiText.ToOption(), - TextPosition: TextPosition.ToOption(), - MultiTextPosition: MultiTextPosition.ToOption(), - MarkerColor: MarkerColor.ToOption(), - MarkerColorScale: MarkerColorScale.ToOption(), - MarkerOutline: MarkerOutline.ToOption(), - MarkerSymbol: MarkerSymbol.ToOption(), - MultiMarkerSymbol: MultiMarkerSymbol.ToOption(), - Marker: Marker.ToOption(), - LocationMode: LocationMode.ToOption(), - GeoJson: GeoJson.ToOption(), - FeatureIdKey: FeatureIdKey.ToOption(), - UseDefaults: UseDefaults.ToOption() - ); - - /// - /// Creates a LineGeo chart. - /// - /// In general, LineGeo Plots plot two-dimensional data connected by lines using plotly's base geo map. - /// - /// Sets the longitude coordinates (in degrees East). - /// Sets the latitude coordinates (in degrees North). - /// - /// 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. - /// Sets the opactity of the trace - /// Sets the opactity of individual datum markers - /// Sets a text associated with each datum - /// Sets individual text for each datum - /// Sets the position of text associated with each datum - /// Sets the position of text associated with individual datum - /// Sets the color of the marker - /// Sets the colorscale of the marker - /// Sets the outline of the marker - /// Sets the marker symbol for each datum - /// Sets the marker symbol for each individual datum - /// Sets the marker (use this for more finegrained control than the other marker-associated arguments) - /// Sets the color of the line - /// Sets the colorscale of the line - /// Sets the width of the line - /// sets the drawing style of the line - /// Sets the line (use this for more finegrained control than the other line-associated arguments) - /// Determines the set of locations used to match entries in `locations` to regions on the map. Values "ISO-3", "USA-states", "country names" correspond to features on the base map and value "geojson-id" corresponds to features from a custom GeoJSON linked to the `geojson` attribute. - /// Sets optional GeoJSON data associated with this trace. If not given, the features on the base map are used. It can be set as a valid GeoJSON object or as a URL string. Note that we only accept GeoJSONs of type "FeatureCollection" or "Feature" with geometries of type "Polygon" or "MultiPolygon". - /// Sets the key in GeoJSON features which is used as id to match the items included in the `locations` array. Only has an effect when `geojson` is set. Support nested property, for example "properties.name". - /// If set to false, ignore the global default settings set in `Defaults` - public static GenericChart LineGeo( - IEnumerable longitudes, - IEnumerable latitudes, - Optional ShowMarkers = default, - Optional Name = default, - Optional ShowLegend = default, - Optional Opacity = default, - Optional> MultiOpacity = default, - Optional Text = default, - Optional> MultiText = default, - Optional TextPosition = default, - Optional> MultiTextPosition = default, - Optional MarkerColor = default, - Optional MarkerColorScale = default, - Optional MarkerOutline = default, - Optional MarkerSymbol = default, - Optional> MultiMarkerSymbol = default, - Optional Marker = default, - Optional LineColor = default, - Optional LineColorScale = default, - Optional LineWidth = default, - Optional LineDash = default, - Optional Line = default, - Optional LocationMode = default, - Optional GeoJson = default, - Optional FeatureIdKey = default, - Optional UseDefaults = default - ) - where LongitudesType : IConvertible - where LatitudesType : IConvertible - where TextType : IConvertible - => - Plotly.NET.ChartMap_Geo.Chart.LineGeo( - longitudes: longitudes, - latitudes: latitudes, - ShowMarkers: ShowMarkers.ToOption(), - Name: Name.ToOption(), - ShowLegend: ShowLegend.ToOption(), - Opacity: Opacity.ToOption(), - MultiOpacity: MultiOpacity.ToOption(), - Text: Text.ToOption(), - MultiText: MultiText.ToOption(), - TextPosition: TextPosition.ToOption(), - MultiTextPosition: MultiTextPosition.ToOption(), - MarkerColor: MarkerColor.ToOption(), - MarkerColorScale: MarkerColorScale.ToOption(), - MarkerOutline: MarkerOutline.ToOption(), - MarkerSymbol: MarkerSymbol.ToOption(), - MultiMarkerSymbol: MultiMarkerSymbol.ToOption(), - Marker: Marker.ToOption(), - LineColor: LineColor.ToOption(), - LineColorScale: LineColorScale.ToOption(), - LineWidth: LineWidth.ToOption(), - LineDash: LineDash.ToOption(), - Line: Line.ToOption(), - LocationMode: LocationMode.ToOption(), - GeoJson: GeoJson.ToOption(), - FeatureIdKey: FeatureIdKey.ToOption(), - UseDefaults: UseDefaults.ToOption() - ); - - /// - /// Creates a BubbleGeo chart. - /// - /// In general, BubbleGeo Plots plot two-dimensional data as points using plotly's base geo map, additionally using the point size as a third dimension. - /// - /// Sets the longitude coordinates (in degrees East). - /// Sets the latitude coordinates (in degrees North). - /// Sets the size of the points. - /// 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. - /// Sets the opactity of the trace - /// Sets the opactity of individual datum markers - /// Sets a text associated with each datum - /// Sets individual text for each datum - /// Sets the position of text associated with each datum - /// Sets the position of text associated with individual datum - /// Sets the color of the marker - /// Sets the colorscale of the marker - /// Sets the outline of the marker - /// Sets the marker symbol for each datum - /// Sets the marker symbol for each individual datum - /// Sets the marker (use this for more finegrained control than the other marker-associated arguments) - /// Determines the set of locations used to match entries in `locations` to regions on the map. Values "ISO-3", "USA-states", "country names" correspond to features on the base map and value "geojson-id" corresponds to features from a custom GeoJSON linked to the `geojson` attribute. - /// Sets optional GeoJSON data associated with this trace. If not given, the features on the base map are used. It can be set as a valid GeoJSON object or as a URL string. Note that we only accept GeoJSONs of type "FeatureCollection" or "Feature" with geometries of type "Polygon" or "MultiPolygon". - /// Sets the key in GeoJSON features which is used as id to match the items included in the `locations` array. Only has an effect when `geojson` is set. Support nested property, for example "properties.name". - /// If set to false, ignore the global default settings set in `Defaults` - public static GenericChart BubbleGeo( - IEnumerable longitudes, - IEnumerable latitudes, - IEnumerable sizes, - Optional Name = default, - Optional ShowLegend = default, - Optional Opacity = default, - Optional> MultiOpacity = default, - Optional Text = default, - Optional> MultiText = default, - Optional TextPosition = default, - Optional> MultiTextPosition = default, - Optional MarkerColor = default, - Optional MarkerColorScale = default, - Optional MarkerOutline = default, - Optional MarkerSymbol = default, - Optional> MultiMarkerSymbol = default, - Optional Marker = default, - Optional LocationMode = default, - Optional GeoJson = default, - Optional FeatureIdKey = default, - Optional UseDefaults = default - ) - where LongitudesType : IConvertible - where LatitudesType : IConvertible - where TextType : IConvertible - => - Plotly.NET.ChartMap_Geo.Chart.BubbleGeo( - longitudes: longitudes, - latitudes: latitudes, - sizes: sizes, - Name: Name.ToOption(), - ShowLegend: ShowLegend.ToOption(), - Opacity: Opacity.ToOption(), - MultiOpacity: MultiOpacity.ToOption(), - Text: Text.ToOption(), - MultiText: MultiText.ToOption(), - TextPosition: TextPosition.ToOption(), - MultiTextPosition: MultiTextPosition.ToOption(), - MarkerColor: MarkerColor.ToOption(), - MarkerColorScale: MarkerColorScale.ToOption(), - MarkerOutline: MarkerOutline.ToOption(), - MarkerSymbol: MarkerSymbol.ToOption(), - MultiMarkerSymbol: MultiMarkerSymbol.ToOption(), - Marker: Marker.ToOption(), - LocationMode: LocationMode.ToOption(), - GeoJson: GeoJson.ToOption(), - FeatureIdKey: FeatureIdKey.ToOption(), - UseDefaults: UseDefaults.ToOption() - ); - - /// - /// Creates a ScatterMapbox chart, where data is visualized on a geographic map using mapbox. - /// - /// Customize the mapbox layers, style, etc. by using Chart.withMapbox. - /// - /// You might need a Mapbox token, which you can also configure with Chart.withMapbox. - /// - /// ScatterMapbox charts are the basis of PointMapbox, LineMapbox, and BubbleMapbox Charts, and can be customized as such. We also provide abstractions for those: Chart.PointMapbox, Chart.LineMapbox, Chart.BubbleMapbox - /// - /// Sets the longitude coordinates (in degrees East). - /// Sets the latitude coordinates (in degrees North). - /// Determines the drawing mode for this scatter trace. - /// Sets the base mapbox layer. Default is `OpenStreetMap`. Note that you will need an access token for some Mapbox presets. - /// 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. - /// Sets the opactity of the trace - /// Sets the opactity of individual datum markers - /// Sets a text associated with each datum - /// Sets individual text for each datum - /// Sets the position of text associated with each datum - /// Sets the position of text associated with individual datum - /// Sets the color of the marker - /// Sets the colorscale of the marker - /// Sets the outline of the marker - /// Sets the marker symbol for each datum - /// Sets the marker symbol for each individual datum - /// Sets the marker (use this for more finegrained control than the other marker-associated arguments) - /// Sets the color of the line - /// Sets the colorscale of the line - /// Sets the width of the line - /// sets the drawing style of the line - /// Sets the line (use this for more finegrained control than the other line-associated arguments) - /// Determines if this scattermapbox trace's layers are to be inserted before the layer with the specified ID. By default, scattermapbox layers are inserted above all the base layers. To place the scattermapbox layers above every other layer, set `below` to "''". - /// Whether or not to enable clustering for points - /// Sets the clustering options (use this for more finegrained control than the other cluster-associated arguments) - /// If set to false, ignore the global default settings set in `Defaults` - public static GenericChart ScatterMapbox( - IEnumerable longitudes, - IEnumerable latitudes, - StyleParam.Mode mode, - Optional MapboxStyle = default, - Optional Name = default, - Optional ShowLegend = default, - Optional Opacity = default, - Optional> MultiOpacity = default, - Optional Text = default, - Optional> MultiText = default, - Optional TextPosition = default, - Optional> MultiTextPosition = default, - Optional MarkerColor = default, - Optional MarkerColorScale = default, - Optional MarkerOutline = default, - Optional MarkerSymbol = default, - Optional> MultiMarkerSymbol = default, - Optional Marker = default, - Optional LineColor = default, - Optional LineColorScale = default, - Optional LineWidth = default, - Optional LineDash = default, - Optional Line = default, - Optional Below = default, - Optional EnableClustering = default, - Optional Cluster = default, - Optional UseDefaults = default - ) - where LongitudesType : IConvertible - where LatitudesType : IConvertible - where TextType : IConvertible - => - Plotly.NET.ChartMap_Mapbox.Chart.ScatterMapbox( - longitudes: longitudes, - latitudes: latitudes, - mode: mode, - MapboxStyle: MapboxStyle.ToOption(), - Name: Name.ToOption(), - ShowLegend: ShowLegend.ToOption(), - Opacity: Opacity.ToOption(), - MultiOpacity: MultiOpacity.ToOption(), - Text: Text.ToOption(), - MultiText: MultiText.ToOption(), - TextPosition: TextPosition.ToOption(), - MultiTextPosition: MultiTextPosition.ToOption(), - MarkerColor: MarkerColor.ToOption(), - MarkerColorScale: MarkerColorScale.ToOption(), - MarkerOutline: MarkerOutline.ToOption(), - MarkerSymbol: MarkerSymbol.ToOption(), - MultiMarkerSymbol: MultiMarkerSymbol.ToOption(), - Marker: Marker.ToOption(), - LineColor: LineColor.ToOption(), - LineColorScale: LineColorScale.ToOption(), - LineWidth: LineWidth.ToOption(), - LineDash: LineDash.ToOption(), - Line: Line.ToOption(), - Below: Below.ToOption(), - EnableClustering: EnableClustering.ToOption(), - Cluster: Cluster.ToOption(), - UseDefaults: UseDefaults.ToOption() - ); - - /// - /// Creates a PointMapbox chart, where data is visualized on a geographic map as points using mapbox. - /// - /// Customize the mapbox layers, style, etc. by using Chart.withMapbox. - /// - /// You might need a Mapbox token, which you can also configure with Chart.withMapbox. - /// - /// Sets the longitude coordinates (in degrees East). - /// Sets the latitude coordinates (in degrees North). - /// Sets the trace name. The trace name appear as the legend item and on hover - /// Sets the base mapbox layer. Default is `OpenStreetMap`. Note that you will need an access token for some Mapbox presets. - /// Determines whether or not an item corresponding to this trace is shown in the legend. - /// Sets the opactity of the trace - /// Sets the opactity of individual datum markers - /// Sets a text associated with each datum - /// Sets individual text for each datum - /// Sets the position of text associated with each datum - /// Sets the position of text associated with individual datum - /// Sets the color of the marker - /// Sets the colorscale of the marker - /// Sets the outline of the marker - /// Sets the marker symbol for each datum - /// Sets the marker symbol for each individual datum - /// Sets the marker (use this for more finegrained control than the other marker-associated arguments) - /// Determines if this scattermapbox trace's layers are to be inserted before the layer with the specified ID. By default, scattermapbox layers are inserted above all the base layers. To place the scattermapbox layers above every other layer, set `below` to "''". - /// Whether or not to enable clustering for points - /// Sets the clustering options (use this for more finegrained control than the other cluster-associated arguments) - /// If set to false, ignore the global default settings set in `Defaults` - public static GenericChart PointMapbox( - IEnumerable longitudes, - IEnumerable latitudes, - Optional Name = default, - Optional MapboxStyle = default, - Optional ShowLegend = default, - Optional Opacity = default, - Optional> MultiOpacity = default, - Optional Text = default, - Optional> MultiText = default, - Optional TextPosition = default, - Optional> MultiTextPosition = default, - Optional MarkerColor = default, - Optional MarkerColorScale = default, - Optional MarkerOutline = default, - Optional MarkerSymbol = default, - Optional> MultiMarkerSymbol = default, - Optional Marker = default, - Optional Below = default, - Optional EnableClustering = default, - Optional Cluster = default, - Optional UseDefaults = default - ) - where LongitudesType : IConvertible - where LatitudesType : IConvertible - where TextType : IConvertible - => - Plotly.NET.ChartMap_Mapbox.Chart.PointMapbox( - longitudes: longitudes, - latitudes: latitudes, - Name: Name.ToOption(), - MapboxStyle: MapboxStyle.ToOption(), - ShowLegend: ShowLegend.ToOption(), - Opacity: Opacity.ToOption(), - MultiOpacity: MultiOpacity.ToOption(), - Text: Text.ToOption(), - MultiText: MultiText.ToOption(), - TextPosition: TextPosition.ToOption(), - MultiTextPosition: MultiTextPosition.ToOption(), - MarkerColor: MarkerColor.ToOption(), - MarkerColorScale: MarkerColorScale.ToOption(), - MarkerOutline: MarkerOutline.ToOption(), - MarkerSymbol: MarkerSymbol.ToOption(), - MultiMarkerSymbol: MultiMarkerSymbol.ToOption(), - Marker: Marker.ToOption(), - Below: Below.ToOption(), - EnableClustering: EnableClustering.ToOption(), - Cluster: Cluster.ToOption(), - UseDefaults: UseDefaults.ToOption() - ); - - /// - /// Creates a LineMapbox chart, where data is visualized on a geographic map connected by a line using mapbox. - /// - /// Customize the mapbox layers, style, etc. by using Chart.withMapbox. - /// - /// You might need a Mapbox token, which you can also configure with Chart.withMapbox. - /// - /// Sets the longitude coordinates (in degrees East). - /// Sets the latitude coordinates (in degrees North). - /// - /// Sets the trace name. The trace name appear as the legend item and on hover - /// Sets the base mapbox layer. Default is `OpenStreetMap`. Note that you will need an access token for some Mapbox presets. - /// Determines whether or not an item corresponding to this trace is shown in the legend. - /// Sets the opactity of the trace - /// Sets the opactity of individual datum markers - /// Sets a text associated with each datum - /// Sets individual text for each datum - /// Sets the position of text associated with each datum - /// Sets the position of text associated with individual datum - /// Sets the color of the marker - /// Sets the colorscale of the marker - /// Sets the outline of the marker - /// Sets the marker symbol for each datum - /// Sets the marker symbol for each individual datum - /// Sets the marker (use this for more finegrained control than the other marker-associated arguments) - /// Sets the color of the line - /// Sets the colorscale of the line - /// Sets the width of the line - /// sets the drawing style of the line - /// Sets the line (use this for more finegrained control than the other line-associated arguments) - /// Determines if this scattermapbox trace's layers are to be inserted before the layer with the specified ID. By default, scattermapbox layers are inserted above all the base layers. To place the scattermapbox layers above every other layer, set `below` to "''". - /// If set to false, ignore the global default settings set in `Defaults` - public static GenericChart LineMapbox( - IEnumerable longitudes, - IEnumerable latitudes, - Optional ShowMarkers = default, - Optional Name = default, - Optional MapboxStyle = default, - Optional ShowLegend = default, - Optional Opacity = default, - Optional> MultiOpacity = default, - Optional Text = default, - Optional> MultiText = default, - Optional TextPosition = default, - Optional> MultiTextPosition = default, - Optional MarkerColor = default, - Optional MarkerColorScale = default, - Optional MarkerOutline = default, - Optional MarkerSymbol = default, - Optional> MultiMarkerSymbol = default, - Optional Marker = default, - Optional LineColor = default, - Optional LineColorScale = default, - Optional LineWidth = default, - Optional LineDash = default, - Optional Line = default, - Optional Below = default, - Optional UseDefaults = default - ) - where LongitudesType : IConvertible - where LatitudesType : IConvertible - where TextType : IConvertible - => - Plotly.NET.ChartMap_Mapbox.Chart.LineMapbox( - longitudes: longitudes, - latitudes: latitudes, - ShowMarkers: ShowMarkers.ToOption(), - Name: Name.ToOption(), - MapboxStyle: MapboxStyle.ToOption(), - ShowLegend: ShowLegend.ToOption(), - Opacity: Opacity.ToOption(), - MultiOpacity: MultiOpacity.ToOption(), - Text: Text.ToOption(), - MultiText: MultiText.ToOption(), - TextPosition: TextPosition.ToOption(), - MultiTextPosition: MultiTextPosition.ToOption(), - MarkerColor: MarkerColor.ToOption(), - MarkerColorScale: MarkerColorScale.ToOption(), - MarkerOutline: MarkerOutline.ToOption(), - MarkerSymbol: MarkerSymbol.ToOption(), - MultiMarkerSymbol: MultiMarkerSymbol.ToOption(), - Marker: Marker.ToOption(), - LineColor: LineColor.ToOption(), - LineColorScale: LineColorScale.ToOption(), - LineWidth: LineWidth.ToOption(), - LineDash: LineDash.ToOption(), - Line: Line.ToOption(), - Below: Below.ToOption(), - UseDefaults: UseDefaults.ToOption() - ); - - /// - /// Creates a BubbleMapbox chart, where data is visualized on a geographic map as points using mapbox, additionally using the point size as a third dimension. - /// - /// Customize the mapbox layers, style, etc. by using Chart.withMapbox. - /// - /// You might need a Mapbox token, which you can also configure with Chart.withMapbox. - /// - /// Sets the longitude coordinates (in degrees East). - /// Sets the latitude coordinates (in degrees North). - /// Sets the size of the points. - /// Sets the trace name. The trace name appear as the legend item and on hover - /// Sets the base mapbox layer. Default is `OpenStreetMap`. Note that you will need an access token for some Mapbox presets. - /// Determines whether or not an item corresponding to this trace is shown in the legend. - /// Sets the opactity of the trace - /// Sets the opactity of individual datum markers - /// Sets a text associated with each datum - /// Sets individual text for each datum - /// Sets the position of text associated with each datum - /// Sets the position of text associated with individual datum - /// Sets the color of the marker - /// Sets the colorscale of the marker - /// Sets the outline of the marker - /// Sets the marker symbol for each datum - /// Sets the marker symbol for each individual datum - /// Sets the marker (use this for more finegrained control than the other marker-associated arguments) - /// Determines if this scattermapbox trace's layers are to be inserted before the layer with the specified ID. By default, scattermapbox layers are inserted above all the base layers. To place the scattermapbox layers above every other layer, set `below` to "''". - /// If set to false, ignore the global default settings set in `Defaults` - public static GenericChart BubbleMapbox( - IEnumerable longitudes, - IEnumerable latitudes, - IEnumerable sizes, - Optional Name = default, - Optional MapboxStyle = default, - Optional ShowLegend = default, - Optional Opacity = default, - Optional> MultiOpacity = default, - Optional Text = default, - Optional> MultiText = default, - Optional TextPosition = default, - Optional> MultiTextPosition = default, - Optional MarkerColor = default, - Optional MarkerColorScale = default, - Optional MarkerOutline = default, - Optional MarkerSymbol = default, - Optional> MultiMarkerSymbol = default, - Optional Marker = default, - Optional Below = default, - Optional UseDefaults = default - ) - where LongitudesType : IConvertible - where LatitudesType : IConvertible - where TextType : IConvertible - => - Plotly.NET.ChartMap_Mapbox.Chart.BubbleMapbox( - longitudes: longitudes, - latitudes: latitudes, - sizes: sizes, - Name: Name.ToOption(), - MapboxStyle: MapboxStyle.ToOption(), - ShowLegend: ShowLegend.ToOption(), - Opacity: Opacity.ToOption(), - MultiOpacity: MultiOpacity.ToOption(), - Text: Text.ToOption(), - MultiText: MultiText.ToOption(), - TextPosition: TextPosition.ToOption(), - MultiTextPosition: MultiTextPosition.ToOption(), - MarkerColor: MarkerColor.ToOption(), - MarkerColorScale: MarkerColorScale.ToOption(), - MarkerOutline: MarkerOutline.ToOption(), - MarkerSymbol: MarkerSymbol.ToOption(), - MultiMarkerSymbol: MultiMarkerSymbol.ToOption(), - Marker: Marker.ToOption(), - Below: Below.ToOption(), - UseDefaults: UseDefaults.ToOption() - ); - - /// - /// Creates a choropleth map using mapbox. - /// - /// A choropleth map is a type of thematic map in which a set of pre-defined areas is colored or patterned in proportion to a statistical variable that represents an aggregate summary of a geographic characteristic within each area, such as population density or per-capita income. - /// - /// GeoJSON features to be filled are set in `geojson` The data that describes the choropleth value-to-color mapping is set in `locations` and `z`. - /// - /// Customize the mapbox layers, style, etc. by using Chart.withMapbox. - /// - /// You might need a Mapbox token, which you can also configure with Chart.withMapbox. - /// - /// Sets the coordinates via location IDs or names. Coordinates correspond to the centroid of each location given. See `locationmode` for more info. - /// The color values for each location - /// Sets the GeoJSON data associated with this trace. It can be set as a valid GeoJSON object or as a URL string. Note that we only accept GeoJSONs of type "FeatureCollection" or "Feature" with geometries of type "Polygon" or "MultiPolygon". - /// Sets the trace name. The trace name appear as the legend item and on hover. - /// Sets the base mapbox layer. Default is `OpenStreetMap`. Note that you will need an access token for some Mapbox presets. - /// Determines whether or not an item corresponding to this trace is shown in the legend. - /// Sets the key in GeoJSON features which is used as id to match the items included in the `locations` array. Support nested property, for example "properties.name". - /// Sets a text associated with each datum - /// Sets individual text for each datum - /// Sets the colorbar. - /// Sets the colorscale. - /// Determines whether or not a colorbar is displayed for this trace. - /// Reverses the color mapping if true. - /// Determines if this scattermapbox trace's layers are to be inserted before the layer with the specified ID. By default, scattermapbox layers are inserted above all the base layers. To place the scattermapbox layers above every other layer, set `below` to "''". - /// If set to false, ignore the global default settings set in `Defaults` - public static GenericChart ChoroplethMapbox( - IEnumerable locations, - IEnumerable z, - object geoJson, - Optional Name = default, - Optional MapboxStyle = default, - Optional ShowLegend = default, - Optional FeatureIdKey = default, - Optional Text = default, - Optional> MultiText = default, - Optional ColorBar = default, - Optional ColorScale = default, - Optional ShowScale = default, - Optional ReverseScale = default, - Optional Below = default, - Optional UseDefaults = default - ) - where ZType : IConvertible - where TextType : IConvertible - => - Plotly.NET.ChartMap_Density.Chart.ChoroplethMapbox( - locations: locations, - z: z, - Name: Name.ToOption(), - MapboxStyle: MapboxStyle.ToOption(), - ShowLegend: ShowLegend.ToOption(), - geoJson: geoJson, - FeatureIdKey: FeatureIdKey.ToOption(), - Text: Text.ToOption(), - MultiText: MultiText.ToOption(), - ColorBar: ColorBar.ToOption(), - ColorScale: ColorScale.ToOption(), - ShowScale: ShowScale.ToOption(), - ReverseScale: ReverseScale.ToOption(), - Below: Below.ToOption(), - UseDefaults: UseDefaults.ToOption() - ); - - /// - /// Creates a DensityMapbox Chart that draws a bivariate kernel density estimation with a Gaussian kernel from `lon` and `lat` coordinates and optional `z` values using a colorscale. - /// - /// Customize the mapbox layers, style, etc. by using Chart.withMapbox. - /// - /// You might need a Mapbox token, which you can also configure with Chart.withMapbox. - /// - /// Sets the longitude coordinates (in degrees East). - /// Sets the latitude coordinates (in degrees North). - /// Sets the trace name. The trace name appear as the legend item and on hover. - /// Sets the base mapbox layer. Default is `OpenStreetMap`. Note that you will need an access token for some Mapbox presets. - /// Determines whether or not an item corresponding to this trace is shown in the legend. - /// Sets the opacity of the trace - /// Sets the points' weight. For example, a value of 10 would be equivalent to having 10 points of weight 1 in the same spot - /// Sets the radius of influence of one `lon` / `lat` point in pixels. Increasing the value makes the densitymapbox trace smoother, but less detailed. - /// Sets a text associated with each datum - /// Sets individual text for each datum - /// Sets the colorbar. - /// Sets the colorscale. - /// Determines whether or not a colorbar is displayed for this trace. - /// Reverses the color mapping if true. - /// Determines if this scattermapbox trace's layers are to be inserted before the layer with the specified ID. By default, scattermapbox layers are inserted above all the base layers. To place the scattermapbox layers above every other layer, set `below` to "''". - /// If set to false, ignore the global default settings set in `Defaults` - public static GenericChart DensityMapbox( - IEnumerable longitudes, - IEnumerable latitudes, - Optional Name = default, - Optional MapboxStyle = default, - Optional ShowLegend = default, - Optional Opacity = default, - Optional> Z = default, - Optional Radius = default, - Optional Text = default, - Optional> MultiText = default, - Optional ColorBar = default, - Optional ColorScale = default, - Optional ShowScale = default, - Optional ReverseScale = default, - Optional Below = default, - Optional UseDefaults = default - ) - where LongitudesType: IConvertible - where LatitudesType: IConvertible - where ZType: IConvertible - where TextType: IConvertible - => - Plotly.NET.ChartMap_Density.Chart.DensityMapbox( - longitudes: longitudes, - latitudes: latitudes, - Name: Name.ToOption(), - MapboxStyle: MapboxStyle.ToOption(), - ShowLegend: ShowLegend.ToOption(), - Opacity: Opacity.ToOption(), - Z: Z.ToOption(), - Radius: Radius.ToOption(), - Text: Text.ToOption(), - MultiText: MultiText.ToOption(), - ColorBar: ColorBar.ToOption(), - ColorScale: ColorScale.ToOption(), - ShowScale: ShowScale.ToOption(), - ReverseScale: ReverseScale.ToOption(), - Below: Below.ToOption(), - UseDefaults: UseDefaults.ToOption() - ); - } -} - diff --git a/src/Plotly.NET.CSharp/ChartAPI/ChartMap/BubbleGeo.cs b/src/Plotly.NET.CSharp/ChartAPI/ChartMap/BubbleGeo.cs new file mode 100644 index 00000000..0d5038bd --- /dev/null +++ b/src/Plotly.NET.CSharp/ChartAPI/ChartMap/BubbleGeo.cs @@ -0,0 +1,88 @@ +using System; +using System.Collections.Generic; +using Plotly.NET; +using Plotly.NET.LayoutObjects; +using Plotly.NET.TraceObjects; +using static Plotly.NET.StyleParam; + +namespace Plotly.NET.CSharp; + +public static partial class Chart +{ + /// + /// Creates a BubbleGeo chart. + /// + /// In general, BubbleGeo Plots plot two-dimensional data as points using plotly's base geo map, additionally using the point size as a third dimension. + /// + /// Sets the longitude coordinates (in degrees East). + /// Sets the latitude coordinates (in degrees North). + /// Sets the size of the points. + /// 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. + /// Sets the opactity of the trace + /// Sets the opactity of individual datum markers + /// Sets a text associated with each datum + /// Sets individual text for each datum + /// Sets the position of text associated with each datum + /// Sets the position of text associated with individual datum + /// Sets the color of the marker + /// Sets the colorscale of the marker + /// Sets the outline of the marker + /// Sets the marker symbol for each datum + /// Sets the marker symbol for each individual datum + /// Sets the marker (use this for more finegrained control than the other marker-associated arguments) + /// Determines the set of locations used to match entries in `locations` to regions on the map. Values "ISO-3", "USA-states", "country names" correspond to features on the base map and value "geojson-id" corresponds to features from a custom GeoJSON linked to the `geojson` attribute. + /// Sets optional GeoJSON data associated with this trace. If not given, the features on the base map are used. It can be set as a valid GeoJSON object or as a URL string. Note that we only accept GeoJSONs of type "FeatureCollection" or "Feature" with geometries of type "Polygon" or "MultiPolygon". + /// Sets the key in GeoJSON features which is used as id to match the items included in the `locations` array. Only has an effect when `geojson` is set. Support nested property, for example "properties.name". + /// If set to false, ignore the global default settings set in `Defaults` + public static GenericChart BubbleGeo( + IEnumerable longitudes, + IEnumerable latitudes, + IEnumerable sizes, + Optional Name = default, + Optional ShowLegend = default, + Optional Opacity = default, + Optional> MultiOpacity = default, + Optional Text = default, + Optional> MultiText = default, + Optional TextPosition = default, + Optional> MultiTextPosition = default, + Optional MarkerColor = default, + Optional MarkerColorScale = default, + Optional MarkerOutline = default, + Optional MarkerSymbol = default, + Optional> MultiMarkerSymbol = default, + Optional Marker = default, + Optional LocationMode = default, + Optional GeoJson = default, + Optional FeatureIdKey = default, + Optional UseDefaults = default + ) + where LongitudesType : IConvertible + where LatitudesType : IConvertible + where TextType : IConvertible + => + Plotly.NET.ChartMap_Geo.Chart.BubbleGeo( + longitudes: longitudes, + latitudes: latitudes, + sizes: sizes, + Name: Name.ToOption(), + ShowLegend: ShowLegend.ToOption(), + Opacity: Opacity.ToOption(), + MultiOpacity: MultiOpacity.ToOption(), + Text: Text.ToOption(), + MultiText: MultiText.ToOption(), + TextPosition: TextPosition.ToOption(), + MultiTextPosition: MultiTextPosition.ToOption(), + MarkerColor: MarkerColor.ToOption(), + MarkerColorScale: MarkerColorScale.ToOption(), + MarkerOutline: MarkerOutline.ToOption(), + MarkerSymbol: MarkerSymbol.ToOption(), + MultiMarkerSymbol: MultiMarkerSymbol.ToOption(), + Marker: Marker.ToOption(), + LocationMode: LocationMode.ToOption(), + GeoJson: GeoJson.ToOption(), + FeatureIdKey: FeatureIdKey.ToOption(), + UseDefaults: UseDefaults.ToOption() + ); +} diff --git a/src/Plotly.NET.CSharp/ChartAPI/ChartMap/BubbleMapbox.cs b/src/Plotly.NET.CSharp/ChartAPI/ChartMap/BubbleMapbox.cs new file mode 100644 index 00000000..3f06777d --- /dev/null +++ b/src/Plotly.NET.CSharp/ChartAPI/ChartMap/BubbleMapbox.cs @@ -0,0 +1,87 @@ +using System; +using System.Collections.Generic; +using Plotly.NET; +using Plotly.NET.LayoutObjects; +using Plotly.NET.TraceObjects; +using static Plotly.NET.StyleParam; + +namespace Plotly.NET.CSharp; + +public static partial class Chart +{ + /// + /// Creates a BubbleMapbox chart, where data is visualized on a geographic map as points using mapbox, additionally using the point size as a third dimension. + /// + /// Customize the mapbox layers, style, etc. by using Chart.withMapbox. + /// + /// You might need a Mapbox token, which you can also configure with Chart.withMapbox. + /// + /// Sets the longitude coordinates (in degrees East). + /// Sets the latitude coordinates (in degrees North). + /// Sets the size of the points. + /// Sets the trace name. The trace name appear as the legend item and on hover + /// Sets the base mapbox layer. Default is `OpenStreetMap`. Note that you will need an access token for some Mapbox presets. + /// Determines whether or not an item corresponding to this trace is shown in the legend. + /// Sets the opactity of the trace + /// Sets the opactity of individual datum markers + /// Sets a text associated with each datum + /// Sets individual text for each datum + /// Sets the position of text associated with each datum + /// Sets the position of text associated with individual datum + /// Sets the color of the marker + /// Sets the colorscale of the marker + /// Sets the outline of the marker + /// Sets the marker symbol for each datum + /// Sets the marker symbol for each individual datum + /// Sets the marker (use this for more finegrained control than the other marker-associated arguments) + /// Determines if this scattermapbox trace's layers are to be inserted before the layer with the specified ID. By default, scattermapbox layers are inserted above all the base layers. To place the scattermapbox layers above every other layer, set `below` to "''". + /// If set to false, ignore the global default settings set in `Defaults` + public static GenericChart BubbleMapbox( + IEnumerable longitudes, + IEnumerable latitudes, + IEnumerable sizes, + Optional Name = default, + Optional MapboxStyle = default, + Optional ShowLegend = default, + Optional Opacity = default, + Optional> MultiOpacity = default, + Optional Text = default, + Optional> MultiText = default, + Optional TextPosition = default, + Optional> MultiTextPosition = default, + Optional MarkerColor = default, + Optional MarkerColorScale = default, + Optional MarkerOutline = default, + Optional MarkerSymbol = default, + Optional> MultiMarkerSymbol = default, + Optional Marker = default, + Optional Below = default, + Optional UseDefaults = default + ) + where LongitudesType : IConvertible + where LatitudesType : IConvertible + where TextType : IConvertible + => + Plotly.NET.ChartMap_Mapbox.Chart.BubbleMapbox( + longitudes: longitudes, + latitudes: latitudes, + sizes: sizes, + Name: Name.ToOption(), + MapboxStyle: MapboxStyle.ToOption(), + ShowLegend: ShowLegend.ToOption(), + Opacity: Opacity.ToOption(), + MultiOpacity: MultiOpacity.ToOption(), + Text: Text.ToOption(), + MultiText: MultiText.ToOption(), + TextPosition: TextPosition.ToOption(), + MultiTextPosition: MultiTextPosition.ToOption(), + MarkerColor: MarkerColor.ToOption(), + MarkerColorScale: MarkerColorScale.ToOption(), + MarkerOutline: MarkerOutline.ToOption(), + MarkerSymbol: MarkerSymbol.ToOption(), + MultiMarkerSymbol: MultiMarkerSymbol.ToOption(), + Marker: Marker.ToOption(), + Below: Below.ToOption(), + UseDefaults: UseDefaults.ToOption() + ); +} diff --git a/src/Plotly.NET.CSharp/ChartAPI/ChartMap/ChoroplethMap.cs b/src/Plotly.NET.CSharp/ChartAPI/ChartMap/ChoroplethMap.cs new file mode 100644 index 00000000..12e7e059 --- /dev/null +++ b/src/Plotly.NET.CSharp/ChartAPI/ChartMap/ChoroplethMap.cs @@ -0,0 +1,66 @@ +using System; +using System.Collections.Generic; +using Plotly.NET; +using Plotly.NET.LayoutObjects; +using Plotly.NET.TraceObjects; +using static Plotly.NET.StyleParam; + +namespace Plotly.NET.CSharp; + +public static partial class Chart +{ + /// + /// Creates a choropleth map using plotly's base geo map. + /// + /// A choropleth map is a type of thematic map in which a set of pre-defined areas is colored or patterned in proportion to a statistical variable that represents an aggregate summary of a geographic characteristic within each area, such as population density or per-capita income. + /// + /// Sets the locations which will be colored. See LocationMode for more info. + /// The color values for each location + /// 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. + /// Sets optional GeoJSON data associated with this trace. If not given, the features on the base map are used. It can be set as a valid GeoJSON object or as a URL string. Note that we only accept GeoJSONs of type "FeatureCollection" or "Feature" with geometries of type "Polygon" or "MultiPolygon". + /// Sets the key in GeoJSON features which is used as id to match the items included in the `locations` array. Only has an effect when `geojson` is set. Support nested property, for example "properties.name". + /// Sets the text elements associated with each location. + /// Sets the text elements associated with each location. + /// Sets the colorbar. + /// Sets the colorscale. + /// Determines whether or not a colorbar is displayed for this trace. + /// Reverses the color mapping if true. + /// Determines the set of locations used to match entries in `locations` to regions on the map. Values "ISO-3", "USA-states", "country names" correspond to features on the base map and value "geojson-id" corresponds to features from a custom GeoJSON linked to the `geojson` attribute. + /// If set to false, ignore the global default settings set in `Defaults` + public static GenericChart ChoroplethMap( + IEnumerable locations, + IEnumerable z, + Optional Name = default, + Optional ShowLegend = default, + Optional GeoJson = default, + Optional FeatureIdKey = default, + Optional Text = default, + Optional> MultiText = default, + Optional ColorBar = default, + Optional ColorScale = default, + Optional ShowScale = default, + Optional ReverseScale = default, + Optional LocationMode = default, + Optional UseDefaults = default + ) + where ZType: IConvertible + where TextType : IConvertible + => + Plotly.NET.ChartMap_Geo.Chart.ChoroplethMap( + locations: locations, + z: z, + Name: Name.ToOption(), + ShowLegend: ShowLegend.ToOption(), + GeoJson: GeoJson.ToOption(), + FeatureIdKey: FeatureIdKey.ToOption(), + Text: Text.ToOption(), + MultiText: MultiText.ToOption(), + ColorBar: ColorBar.ToOption(), + ColorScale: ColorScale.ToOption(), + ShowScale: ShowScale.ToOption(), + ReverseScale: ReverseScale.ToOption(), + LocationMode: LocationMode.ToOption(), + UseDefaults: UseDefaults.ToOption() + ); +} diff --git a/src/Plotly.NET.CSharp/ChartAPI/ChartMap/ChoroplethMapbox.cs b/src/Plotly.NET.CSharp/ChartAPI/ChartMap/ChoroplethMapbox.cs new file mode 100644 index 00000000..5c3af898 --- /dev/null +++ b/src/Plotly.NET.CSharp/ChartAPI/ChartMap/ChoroplethMapbox.cs @@ -0,0 +1,75 @@ +using System; +using System.Collections.Generic; +using Plotly.NET; +using Plotly.NET.LayoutObjects; +using Plotly.NET.TraceObjects; +using static Plotly.NET.StyleParam; + +namespace Plotly.NET.CSharp; + +public static partial class Chart +{ + /// + /// Creates a choropleth map using mapbox. + /// + /// A choropleth map is a type of thematic map in which a set of pre-defined areas is colored or patterned in proportion to a statistical variable that represents an aggregate summary of a geographic characteristic within each area, such as population density or per-capita income. + /// + /// GeoJSON features to be filled are set in `geojson` The data that describes the choropleth value-to-color mapping is set in `locations` and `z`. + /// + /// Customize the mapbox layers, style, etc. by using Chart.withMapbox. + /// + /// You might need a Mapbox token, which you can also configure with Chart.withMapbox. + /// + /// Sets the coordinates via location IDs or names. Coordinates correspond to the centroid of each location given. See `locationmode` for more info. + /// The color values for each location + /// Sets the GeoJSON data associated with this trace. It can be set as a valid GeoJSON object or as a URL string. Note that we only accept GeoJSONs of type "FeatureCollection" or "Feature" with geometries of type "Polygon" or "MultiPolygon". + /// Sets the trace name. The trace name appear as the legend item and on hover. + /// Sets the base mapbox layer. Default is `OpenStreetMap`. Note that you will need an access token for some Mapbox presets. + /// Determines whether or not an item corresponding to this trace is shown in the legend. + /// Sets the key in GeoJSON features which is used as id to match the items included in the `locations` array. Support nested property, for example "properties.name". + /// Sets a text associated with each datum + /// Sets individual text for each datum + /// Sets the colorbar. + /// Sets the colorscale. + /// Determines whether or not a colorbar is displayed for this trace. + /// Reverses the color mapping if true. + /// Determines if this scattermapbox trace's layers are to be inserted before the layer with the specified ID. By default, scattermapbox layers are inserted above all the base layers. To place the scattermapbox layers above every other layer, set `below` to "''". + /// If set to false, ignore the global default settings set in `Defaults` + public static GenericChart ChoroplethMapbox( + IEnumerable locations, + IEnumerable z, + object geoJson, + Optional Name = default, + Optional MapboxStyle = default, + Optional ShowLegend = default, + Optional FeatureIdKey = default, + Optional Text = default, + Optional> MultiText = default, + Optional ColorBar = default, + Optional ColorScale = default, + Optional ShowScale = default, + Optional ReverseScale = default, + Optional Below = default, + Optional UseDefaults = default + ) + where ZType : IConvertible + where TextType : IConvertible + => + Plotly.NET.ChartMap_Density.Chart.ChoroplethMapbox( + locations: locations, + z: z, + Name: Name.ToOption(), + MapboxStyle: MapboxStyle.ToOption(), + ShowLegend: ShowLegend.ToOption(), + geoJson: geoJson, + FeatureIdKey: FeatureIdKey.ToOption(), + Text: Text.ToOption(), + MultiText: MultiText.ToOption(), + ColorBar: ColorBar.ToOption(), + ColorScale: ColorScale.ToOption(), + ShowScale: ShowScale.ToOption(), + ReverseScale: ReverseScale.ToOption(), + Below: Below.ToOption(), + UseDefaults: UseDefaults.ToOption() + ); +} diff --git a/src/Plotly.NET.CSharp/ChartAPI/ChartMap/DensityMapbox.cs b/src/Plotly.NET.CSharp/ChartAPI/ChartMap/DensityMapbox.cs new file mode 100644 index 00000000..e71faa33 --- /dev/null +++ b/src/Plotly.NET.CSharp/ChartAPI/ChartMap/DensityMapbox.cs @@ -0,0 +1,76 @@ +using System; +using System.Collections.Generic; +using Plotly.NET; +using Plotly.NET.LayoutObjects; +using Plotly.NET.TraceObjects; +using static Plotly.NET.StyleParam; + +namespace Plotly.NET.CSharp; + +public static partial class Chart +{ + /// + /// Creates a DensityMapbox Chart that draws a bivariate kernel density estimation with a Gaussian kernel from `lon` and `lat` coordinates and optional `z` values using a colorscale. + /// + /// Customize the mapbox layers, style, etc. by using Chart.withMapbox. + /// + /// You might need a Mapbox token, which you can also configure with Chart.withMapbox. + /// + /// Sets the longitude coordinates (in degrees East). + /// Sets the latitude coordinates (in degrees North). + /// Sets the trace name. The trace name appear as the legend item and on hover. + /// Sets the base mapbox layer. Default is `OpenStreetMap`. Note that you will need an access token for some Mapbox presets. + /// Determines whether or not an item corresponding to this trace is shown in the legend. + /// Sets the opacity of the trace + /// Sets the points' weight. For example, a value of 10 would be equivalent to having 10 points of weight 1 in the same spot + /// Sets the radius of influence of one `lon` / `lat` point in pixels. Increasing the value makes the densitymapbox trace smoother, but less detailed. + /// Sets a text associated with each datum + /// Sets individual text for each datum + /// Sets the colorbar. + /// Sets the colorscale. + /// Determines whether or not a colorbar is displayed for this trace. + /// Reverses the color mapping if true. + /// Determines if this scattermapbox trace's layers are to be inserted before the layer with the specified ID. By default, scattermapbox layers are inserted above all the base layers. To place the scattermapbox layers above every other layer, set `below` to "''". + /// If set to false, ignore the global default settings set in `Defaults` + public static GenericChart DensityMapbox( + IEnumerable longitudes, + IEnumerable latitudes, + Optional Name = default, + Optional MapboxStyle = default, + Optional ShowLegend = default, + Optional Opacity = default, + Optional> Z = default, + Optional Radius = default, + Optional Text = default, + Optional> MultiText = default, + Optional ColorBar = default, + Optional ColorScale = default, + Optional ShowScale = default, + Optional ReverseScale = default, + Optional Below = default, + Optional UseDefaults = default + ) + where LongitudesType: IConvertible + where LatitudesType: IConvertible + where ZType: IConvertible + where TextType: IConvertible + => + Plotly.NET.ChartMap_Density.Chart.DensityMapbox( + longitudes: longitudes, + latitudes: latitudes, + Name: Name.ToOption(), + MapboxStyle: MapboxStyle.ToOption(), + ShowLegend: ShowLegend.ToOption(), + Opacity: Opacity.ToOption(), + Z: Z.ToOption(), + Radius: Radius.ToOption(), + Text: Text.ToOption(), + MultiText: MultiText.ToOption(), + ColorBar: ColorBar.ToOption(), + ColorScale: ColorScale.ToOption(), + ShowScale: ShowScale.ToOption(), + ReverseScale: ReverseScale.ToOption(), + Below: Below.ToOption(), + UseDefaults: UseDefaults.ToOption() + ); +} diff --git a/src/Plotly.NET.CSharp/ChartAPI/ChartMap/LineGeo.cs b/src/Plotly.NET.CSharp/ChartAPI/ChartMap/LineGeo.cs new file mode 100644 index 00000000..5a611c02 --- /dev/null +++ b/src/Plotly.NET.CSharp/ChartAPI/ChartMap/LineGeo.cs @@ -0,0 +1,103 @@ +using System; +using System.Collections.Generic; +using Plotly.NET; +using Plotly.NET.LayoutObjects; +using Plotly.NET.TraceObjects; +using static Plotly.NET.StyleParam; + +namespace Plotly.NET.CSharp; + +public static partial class Chart +{ + /// + /// Creates a LineGeo chart. + /// + /// In general, LineGeo Plots plot two-dimensional data connected by lines using plotly's base geo map. + /// + /// Sets the longitude coordinates (in degrees East). + /// Sets the latitude coordinates (in degrees North). + /// + /// 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. + /// Sets the opactity of the trace + /// Sets the opactity of individual datum markers + /// Sets a text associated with each datum + /// Sets individual text for each datum + /// Sets the position of text associated with each datum + /// Sets the position of text associated with individual datum + /// Sets the color of the marker + /// Sets the colorscale of the marker + /// Sets the outline of the marker + /// Sets the marker symbol for each datum + /// Sets the marker symbol for each individual datum + /// Sets the marker (use this for more finegrained control than the other marker-associated arguments) + /// Sets the color of the line + /// Sets the colorscale of the line + /// Sets the width of the line + /// sets the drawing style of the line + /// Sets the line (use this for more finegrained control than the other line-associated arguments) + /// Determines the set of locations used to match entries in `locations` to regions on the map. Values "ISO-3", "USA-states", "country names" correspond to features on the base map and value "geojson-id" corresponds to features from a custom GeoJSON linked to the `geojson` attribute. + /// Sets optional GeoJSON data associated with this trace. If not given, the features on the base map are used. It can be set as a valid GeoJSON object or as a URL string. Note that we only accept GeoJSONs of type "FeatureCollection" or "Feature" with geometries of type "Polygon" or "MultiPolygon". + /// Sets the key in GeoJSON features which is used as id to match the items included in the `locations` array. Only has an effect when `geojson` is set. Support nested property, for example "properties.name". + /// If set to false, ignore the global default settings set in `Defaults` + public static GenericChart LineGeo( + IEnumerable longitudes, + IEnumerable latitudes, + Optional ShowMarkers = default, + Optional Name = default, + Optional ShowLegend = default, + Optional Opacity = default, + Optional> MultiOpacity = default, + Optional Text = default, + Optional> MultiText = default, + Optional TextPosition = default, + Optional> MultiTextPosition = default, + Optional MarkerColor = default, + Optional MarkerColorScale = default, + Optional MarkerOutline = default, + Optional MarkerSymbol = default, + Optional> MultiMarkerSymbol = default, + Optional Marker = default, + Optional LineColor = default, + Optional LineColorScale = default, + Optional LineWidth = default, + Optional LineDash = default, + Optional Line = default, + Optional LocationMode = default, + Optional GeoJson = default, + Optional FeatureIdKey = default, + Optional UseDefaults = default + ) + where LongitudesType : IConvertible + where LatitudesType : IConvertible + where TextType : IConvertible + => + Plotly.NET.ChartMap_Geo.Chart.LineGeo( + longitudes: longitudes, + latitudes: latitudes, + ShowMarkers: ShowMarkers.ToOption(), + Name: Name.ToOption(), + ShowLegend: ShowLegend.ToOption(), + Opacity: Opacity.ToOption(), + MultiOpacity: MultiOpacity.ToOption(), + Text: Text.ToOption(), + MultiText: MultiText.ToOption(), + TextPosition: TextPosition.ToOption(), + MultiTextPosition: MultiTextPosition.ToOption(), + MarkerColor: MarkerColor.ToOption(), + MarkerColorScale: MarkerColorScale.ToOption(), + MarkerOutline: MarkerOutline.ToOption(), + MarkerSymbol: MarkerSymbol.ToOption(), + MultiMarkerSymbol: MultiMarkerSymbol.ToOption(), + Marker: Marker.ToOption(), + LineColor: LineColor.ToOption(), + LineColorScale: LineColorScale.ToOption(), + LineWidth: LineWidth.ToOption(), + LineDash: LineDash.ToOption(), + Line: Line.ToOption(), + LocationMode: LocationMode.ToOption(), + GeoJson: GeoJson.ToOption(), + FeatureIdKey: FeatureIdKey.ToOption(), + UseDefaults: UseDefaults.ToOption() + ); +} diff --git a/src/Plotly.NET.CSharp/ChartAPI/ChartMap/LineMapbox.cs b/src/Plotly.NET.CSharp/ChartAPI/ChartMap/LineMapbox.cs new file mode 100644 index 00000000..ff3ada0f --- /dev/null +++ b/src/Plotly.NET.CSharp/ChartAPI/ChartMap/LineMapbox.cs @@ -0,0 +1,102 @@ +using System; +using System.Collections.Generic; +using Plotly.NET; +using Plotly.NET.LayoutObjects; +using Plotly.NET.TraceObjects; +using static Plotly.NET.StyleParam; + +namespace Plotly.NET.CSharp; + +public static partial class Chart +{ + /// + /// Creates a LineMapbox chart, where data is visualized on a geographic map connected by a line using mapbox. + /// + /// Customize the mapbox layers, style, etc. by using Chart.withMapbox. + /// + /// You might need a Mapbox token, which you can also configure with Chart.withMapbox. + /// + /// Sets the longitude coordinates (in degrees East). + /// Sets the latitude coordinates (in degrees North). + /// + /// Sets the trace name. The trace name appear as the legend item and on hover + /// Sets the base mapbox layer. Default is `OpenStreetMap`. Note that you will need an access token for some Mapbox presets. + /// Determines whether or not an item corresponding to this trace is shown in the legend. + /// Sets the opactity of the trace + /// Sets the opactity of individual datum markers + /// Sets a text associated with each datum + /// Sets individual text for each datum + /// Sets the position of text associated with each datum + /// Sets the position of text associated with individual datum + /// Sets the color of the marker + /// Sets the colorscale of the marker + /// Sets the outline of the marker + /// Sets the marker symbol for each datum + /// Sets the marker symbol for each individual datum + /// Sets the marker (use this for more finegrained control than the other marker-associated arguments) + /// Sets the color of the line + /// Sets the colorscale of the line + /// Sets the width of the line + /// sets the drawing style of the line + /// Sets the line (use this for more finegrained control than the other line-associated arguments) + /// Determines if this scattermapbox trace's layers are to be inserted before the layer with the specified ID. By default, scattermapbox layers are inserted above all the base layers. To place the scattermapbox layers above every other layer, set `below` to "''". + /// If set to false, ignore the global default settings set in `Defaults` + public static GenericChart LineMapbox( + IEnumerable longitudes, + IEnumerable latitudes, + Optional ShowMarkers = default, + Optional Name = default, + Optional MapboxStyle = default, + Optional ShowLegend = default, + Optional Opacity = default, + Optional> MultiOpacity = default, + Optional Text = default, + Optional> MultiText = default, + Optional TextPosition = default, + Optional> MultiTextPosition = default, + Optional MarkerColor = default, + Optional MarkerColorScale = default, + Optional MarkerOutline = default, + Optional MarkerSymbol = default, + Optional> MultiMarkerSymbol = default, + Optional Marker = default, + Optional LineColor = default, + Optional LineColorScale = default, + Optional LineWidth = default, + Optional LineDash = default, + Optional Line = default, + Optional Below = default, + Optional UseDefaults = default + ) + where LongitudesType : IConvertible + where LatitudesType : IConvertible + where TextType : IConvertible + => + Plotly.NET.ChartMap_Mapbox.Chart.LineMapbox( + longitudes: longitudes, + latitudes: latitudes, + ShowMarkers: ShowMarkers.ToOption(), + Name: Name.ToOption(), + MapboxStyle: MapboxStyle.ToOption(), + ShowLegend: ShowLegend.ToOption(), + Opacity: Opacity.ToOption(), + MultiOpacity: MultiOpacity.ToOption(), + Text: Text.ToOption(), + MultiText: MultiText.ToOption(), + TextPosition: TextPosition.ToOption(), + MultiTextPosition: MultiTextPosition.ToOption(), + MarkerColor: MarkerColor.ToOption(), + MarkerColorScale: MarkerColorScale.ToOption(), + MarkerOutline: MarkerOutline.ToOption(), + MarkerSymbol: MarkerSymbol.ToOption(), + MultiMarkerSymbol: MultiMarkerSymbol.ToOption(), + Marker: Marker.ToOption(), + LineColor: LineColor.ToOption(), + LineColorScale: LineColorScale.ToOption(), + LineWidth: LineWidth.ToOption(), + LineDash: LineDash.ToOption(), + Line: Line.ToOption(), + Below: Below.ToOption(), + UseDefaults: UseDefaults.ToOption() + ); +} diff --git a/src/Plotly.NET.CSharp/ChartAPI/ChartMap/PointGeo.cs b/src/Plotly.NET.CSharp/ChartAPI/ChartMap/PointGeo.cs new file mode 100644 index 00000000..29b4ac6e --- /dev/null +++ b/src/Plotly.NET.CSharp/ChartAPI/ChartMap/PointGeo.cs @@ -0,0 +1,85 @@ +using System; +using System.Collections.Generic; +using Plotly.NET; +using Plotly.NET.LayoutObjects; +using Plotly.NET.TraceObjects; +using static Plotly.NET.StyleParam; + +namespace Plotly.NET.CSharp; + +public static partial class Chart +{ + /// + /// Creates a PointGeo chart. + /// + /// In general, PointGeo Plots plot two-dimensional data as points using plotly's base geo map. + /// + /// Sets the longitude coordinates (in degrees East). + /// Sets the latitude coordinates (in degrees North). + /// 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. + /// Sets the opactity of the trace + /// Sets the opactity of individual datum markers + /// Sets a text associated with each datum + /// Sets individual text for each datum + /// Sets the position of text associated with each datum + /// Sets the position of text associated with individual datum + /// Sets the color of the marker + /// Sets the colorscale of the marker + /// Sets the outline of the marker + /// Sets the marker symbol for each datum + /// Sets the marker symbol for each individual datum + /// Sets the marker (use this for more finegrained control than the other marker-associated arguments) + /// Determines the set of locations used to match entries in `locations` to regions on the map. Values "ISO-3", "USA-states", "country names" correspond to features on the base map and value "geojson-id" corresponds to features from a custom GeoJSON linked to the `geojson` attribute. + /// Sets optional GeoJSON data associated with this trace. If not given, the features on the base map are used. It can be set as a valid GeoJSON object or as a URL string. Note that we only accept GeoJSONs of type "FeatureCollection" or "Feature" with geometries of type "Polygon" or "MultiPolygon". + /// Sets the key in GeoJSON features which is used as id to match the items included in the `locations` array. Only has an effect when `geojson` is set. Support nested property, for example "properties.name". + /// If set to false, ignore the global default settings set in `Defaults` + public static GenericChart PointGeo( + IEnumerable longitudes, + IEnumerable latitudes, + Optional Name = default, + Optional ShowLegend = default, + Optional Opacity = default, + Optional> MultiOpacity = default, + Optional Text = default, + Optional> MultiText = default, + Optional TextPosition = default, + Optional> MultiTextPosition = default, + Optional MarkerColor = default, + Optional MarkerColorScale = default, + Optional MarkerOutline = default, + Optional MarkerSymbol = default, + Optional> MultiMarkerSymbol = default, + Optional Marker = default, + Optional LocationMode = default, + Optional GeoJson = default, + Optional FeatureIdKey = default, + Optional UseDefaults = default + ) + where LongitudesType : IConvertible + where LatitudesType : IConvertible + where TextType : IConvertible + => + Plotly.NET.ChartMap_Geo.Chart.PointGeo( + longitudes: longitudes, + latitudes: latitudes, + Name: Name.ToOption(), + ShowLegend: ShowLegend.ToOption(), + Opacity: Opacity.ToOption(), + MultiOpacity: MultiOpacity.ToOption(), + Text: Text.ToOption(), + MultiText: MultiText.ToOption(), + TextPosition: TextPosition.ToOption(), + MultiTextPosition: MultiTextPosition.ToOption(), + MarkerColor: MarkerColor.ToOption(), + MarkerColorScale: MarkerColorScale.ToOption(), + MarkerOutline: MarkerOutline.ToOption(), + MarkerSymbol: MarkerSymbol.ToOption(), + MultiMarkerSymbol: MultiMarkerSymbol.ToOption(), + Marker: Marker.ToOption(), + LocationMode: LocationMode.ToOption(), + GeoJson: GeoJson.ToOption(), + FeatureIdKey: FeatureIdKey.ToOption(), + UseDefaults: UseDefaults.ToOption() + ); +} diff --git a/src/Plotly.NET.CSharp/ChartAPI/ChartMap/PointMapbox.cs b/src/Plotly.NET.CSharp/ChartAPI/ChartMap/PointMapbox.cs new file mode 100644 index 00000000..65ac3cff --- /dev/null +++ b/src/Plotly.NET.CSharp/ChartAPI/ChartMap/PointMapbox.cs @@ -0,0 +1,90 @@ +using System; +using System.Collections.Generic; +using Plotly.NET; +using Plotly.NET.LayoutObjects; +using Plotly.NET.TraceObjects; +using static Plotly.NET.StyleParam; + +namespace Plotly.NET.CSharp; + +public static partial class Chart +{ + /// + /// Creates a PointMapbox chart, where data is visualized on a geographic map as points using mapbox. + /// + /// Customize the mapbox layers, style, etc. by using Chart.withMapbox. + /// + /// You might need a Mapbox token, which you can also configure with Chart.withMapbox. + /// + /// Sets the longitude coordinates (in degrees East). + /// Sets the latitude coordinates (in degrees North). + /// Sets the trace name. The trace name appear as the legend item and on hover + /// Sets the base mapbox layer. Default is `OpenStreetMap`. Note that you will need an access token for some Mapbox presets. + /// Determines whether or not an item corresponding to this trace is shown in the legend. + /// Sets the opactity of the trace + /// Sets the opactity of individual datum markers + /// Sets a text associated with each datum + /// Sets individual text for each datum + /// Sets the position of text associated with each datum + /// Sets the position of text associated with individual datum + /// Sets the color of the marker + /// Sets the colorscale of the marker + /// Sets the outline of the marker + /// Sets the marker symbol for each datum + /// Sets the marker symbol for each individual datum + /// Sets the marker (use this for more finegrained control than the other marker-associated arguments) + /// Determines if this scattermapbox trace's layers are to be inserted before the layer with the specified ID. By default, scattermapbox layers are inserted above all the base layers. To place the scattermapbox layers above every other layer, set `below` to "''". + /// Whether or not to enable clustering for points + /// Sets the clustering options (use this for more finegrained control than the other cluster-associated arguments) + /// If set to false, ignore the global default settings set in `Defaults` + public static GenericChart PointMapbox( + IEnumerable longitudes, + IEnumerable latitudes, + Optional Name = default, + Optional MapboxStyle = default, + Optional ShowLegend = default, + Optional Opacity = default, + Optional> MultiOpacity = default, + Optional Text = default, + Optional> MultiText = default, + Optional TextPosition = default, + Optional> MultiTextPosition = default, + Optional MarkerColor = default, + Optional MarkerColorScale = default, + Optional MarkerOutline = default, + Optional MarkerSymbol = default, + Optional> MultiMarkerSymbol = default, + Optional Marker = default, + Optional Below = default, + Optional EnableClustering = default, + Optional Cluster = default, + Optional UseDefaults = default + ) + where LongitudesType : IConvertible + where LatitudesType : IConvertible + where TextType : IConvertible + => + Plotly.NET.ChartMap_Mapbox.Chart.PointMapbox( + longitudes: longitudes, + latitudes: latitudes, + Name: Name.ToOption(), + MapboxStyle: MapboxStyle.ToOption(), + ShowLegend: ShowLegend.ToOption(), + Opacity: Opacity.ToOption(), + MultiOpacity: MultiOpacity.ToOption(), + Text: Text.ToOption(), + MultiText: MultiText.ToOption(), + TextPosition: TextPosition.ToOption(), + MultiTextPosition: MultiTextPosition.ToOption(), + MarkerColor: MarkerColor.ToOption(), + MarkerColorScale: MarkerColorScale.ToOption(), + MarkerOutline: MarkerOutline.ToOption(), + MarkerSymbol: MarkerSymbol.ToOption(), + MultiMarkerSymbol: MultiMarkerSymbol.ToOption(), + Marker: Marker.ToOption(), + Below: Below.ToOption(), + EnableClustering: EnableClustering.ToOption(), + Cluster: Cluster.ToOption(), + UseDefaults: UseDefaults.ToOption() + ); +} diff --git a/src/Plotly.NET.CSharp/ChartAPI/ChartMap/ScatterGeo.cs b/src/Plotly.NET.CSharp/ChartAPI/ChartMap/ScatterGeo.cs new file mode 100644 index 00000000..ff3528dd --- /dev/null +++ b/src/Plotly.NET.CSharp/ChartAPI/ChartMap/ScatterGeo.cs @@ -0,0 +1,105 @@ +using System; +using System.Collections.Generic; +using Plotly.NET; +using Plotly.NET.LayoutObjects; +using Plotly.NET.TraceObjects; +using static Plotly.NET.StyleParam; + +namespace Plotly.NET.CSharp; + +public static partial class Chart +{ + /// + /// Creates a ScatterGeo chart, where data is visualized using plotly's base geo map. + /// + /// In general, ScatterGeo Plots plot two-dimensional data on a geo map via (lat,lon) coordinates. + /// + /// ScatterGeo charts are the basis of PointGeo, LineGeo, and BubbleGeo Charts, and can be customized as such. We also provide abstractions for those: Chart.PointGeo, Chart.LineGeo, Chart.BubbleGeo + /// + /// Sets the longitude coordinates (in degrees East). + /// Sets the latitude coordinates (in degrees North). + /// 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. + /// Sets the opactity of the trace + /// Sets the opactity of individual datum markers + /// Sets a text associated with each datum + /// Sets individual text for each datum + /// Sets the position of text associated with each datum + /// Sets the position of text associated with individual datum + /// Sets the color of the marker + /// Sets the colorscale of the marker + /// Sets the outline of the marker + /// Sets the marker symbol for each datum + /// Sets the marker symbol for each individual datum + /// Sets the marker (use this for more finegrained control than the other marker-associated arguments) + /// Sets the color of the line + /// Sets the colorscale of the line + /// Sets the width of the line + /// sets the drawing style of the line + /// Sets the line (use this for more finegrained control than the other line-associated arguments) + /// Determines the set of locations used to match entries in `locations` to regions on the map. Values "ISO-3", "USA-states", "country names" correspond to features on the base map and value "geojson-id" corresponds to features from a custom GeoJSON linked to the `geojson` attribute. + /// Sets optional GeoJSON data associated with this trace. If not given, the features on the base map are used. It can be set as a valid GeoJSON object or as a URL string. Note that we only accept GeoJSONs of type "FeatureCollection" or "Feature" with geometries of type "Polygon" or "MultiPolygon". + /// Sets the key in GeoJSON features which is used as id to match the items included in the `locations` array. Only has an effect when `geojson` is set. Support nested property, for example "properties.name". + /// If set to false, ignore the global default settings set in `Defaults` + public static GenericChart ScatterGeo( + IEnumerable longitudes, + IEnumerable latitudes, + StyleParam.Mode mode, + Optional Name = default, + Optional ShowLegend = default, + Optional Opacity = default, + Optional> MultiOpacity = default, + Optional Text = default, + Optional> MultiText = default, + Optional TextPosition = default, + Optional> MultiTextPosition = default, + Optional MarkerColor = default, + Optional MarkerColorScale = default, + Optional MarkerOutline = default, + Optional MarkerSymbol = default, + Optional> MultiMarkerSymbol = default, + Optional Marker = default, + Optional LineColor = default, + Optional LineColorScale = default, + Optional LineWidth = default, + Optional LineDash = default, + Optional Line = default, + Optional LocationMode = default, + Optional GeoJson = default, + Optional FeatureIdKey = default, + Optional UseDefaults = default + ) + where LongitudesType : IConvertible + where LatitudesType : IConvertible + where TextType : IConvertible + => + Plotly.NET.ChartMap_Geo.Chart.ScatterGeo( + longitudes: longitudes, + latitudes: latitudes, + mode: mode, + Name: Name.ToOption(), + ShowLegend: ShowLegend.ToOption(), + Opacity: Opacity.ToOption(), + MultiOpacity: MultiOpacity.ToOption(), + Text: Text.ToOption(), + MultiText: MultiText.ToOption(), + TextPosition: TextPosition.ToOption(), + MultiTextPosition: MultiTextPosition.ToOption(), + MarkerColor: MarkerColor.ToOption(), + MarkerColorScale: MarkerColorScale.ToOption(), + MarkerOutline: MarkerOutline.ToOption(), + MarkerSymbol: MarkerSymbol.ToOption(), + MultiMarkerSymbol: MultiMarkerSymbol.ToOption(), + Marker: Marker.ToOption(), + LineColor: LineColor.ToOption(), + LineColorScale: LineColorScale.ToOption(), + LineWidth: LineWidth.ToOption(), + LineDash: LineDash.ToOption(), + Line: Line.ToOption(), + LocationMode: LocationMode.ToOption(), + GeoJson: GeoJson.ToOption(), + FeatureIdKey: FeatureIdKey.ToOption(), + UseDefaults: UseDefaults.ToOption() + ); +} diff --git a/src/Plotly.NET.CSharp/ChartAPI/ChartMap/ScatterMapbox.cs b/src/Plotly.NET.CSharp/ChartAPI/ChartMap/ScatterMapbox.cs new file mode 100644 index 00000000..a1cbe72f --- /dev/null +++ b/src/Plotly.NET.CSharp/ChartAPI/ChartMap/ScatterMapbox.cs @@ -0,0 +1,110 @@ +using System; +using System.Collections.Generic; +using Plotly.NET; +using Plotly.NET.LayoutObjects; +using Plotly.NET.TraceObjects; +using static Plotly.NET.StyleParam; + +namespace Plotly.NET.CSharp; + +public static partial class Chart +{ + /// + /// Creates a ScatterMapbox chart, where data is visualized on a geographic map using mapbox. + /// + /// Customize the mapbox layers, style, etc. by using Chart.withMapbox. + /// + /// You might need a Mapbox token, which you can also configure with Chart.withMapbox. + /// + /// ScatterMapbox charts are the basis of PointMapbox, LineMapbox, and BubbleMapbox Charts, and can be customized as such. We also provide abstractions for those: Chart.PointMapbox, Chart.LineMapbox, Chart.BubbleMapbox + /// + /// Sets the longitude coordinates (in degrees East). + /// Sets the latitude coordinates (in degrees North). + /// Determines the drawing mode for this scatter trace. + /// Sets the base mapbox layer. Default is `OpenStreetMap`. Note that you will need an access token for some Mapbox presets. + /// 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. + /// Sets the opactity of the trace + /// Sets the opactity of individual datum markers + /// Sets a text associated with each datum + /// Sets individual text for each datum + /// Sets the position of text associated with each datum + /// Sets the position of text associated with individual datum + /// Sets the color of the marker + /// Sets the colorscale of the marker + /// Sets the outline of the marker + /// Sets the marker symbol for each datum + /// Sets the marker symbol for each individual datum + /// Sets the marker (use this for more finegrained control than the other marker-associated arguments) + /// Sets the color of the line + /// Sets the colorscale of the line + /// Sets the width of the line + /// sets the drawing style of the line + /// Sets the line (use this for more finegrained control than the other line-associated arguments) + /// Determines if this scattermapbox trace's layers are to be inserted before the layer with the specified ID. By default, scattermapbox layers are inserted above all the base layers. To place the scattermapbox layers above every other layer, set `below` to "''". + /// Whether or not to enable clustering for points + /// Sets the clustering options (use this for more finegrained control than the other cluster-associated arguments) + /// If set to false, ignore the global default settings set in `Defaults` + public static GenericChart ScatterMapbox( + IEnumerable longitudes, + IEnumerable latitudes, + StyleParam.Mode mode, + Optional MapboxStyle = default, + Optional Name = default, + Optional ShowLegend = default, + Optional Opacity = default, + Optional> MultiOpacity = default, + Optional Text = default, + Optional> MultiText = default, + Optional TextPosition = default, + Optional> MultiTextPosition = default, + Optional MarkerColor = default, + Optional MarkerColorScale = default, + Optional MarkerOutline = default, + Optional MarkerSymbol = default, + Optional> MultiMarkerSymbol = default, + Optional Marker = default, + Optional LineColor = default, + Optional LineColorScale = default, + Optional LineWidth = default, + Optional LineDash = default, + Optional Line = default, + Optional Below = default, + Optional EnableClustering = default, + Optional Cluster = default, + Optional UseDefaults = default + ) + where LongitudesType : IConvertible + where LatitudesType : IConvertible + where TextType : IConvertible + => + Plotly.NET.ChartMap_Mapbox.Chart.ScatterMapbox( + longitudes: longitudes, + latitudes: latitudes, + mode: mode, + MapboxStyle: MapboxStyle.ToOption(), + Name: Name.ToOption(), + ShowLegend: ShowLegend.ToOption(), + Opacity: Opacity.ToOption(), + MultiOpacity: MultiOpacity.ToOption(), + Text: Text.ToOption(), + MultiText: MultiText.ToOption(), + TextPosition: TextPosition.ToOption(), + MultiTextPosition: MultiTextPosition.ToOption(), + MarkerColor: MarkerColor.ToOption(), + MarkerColorScale: MarkerColorScale.ToOption(), + MarkerOutline: MarkerOutline.ToOption(), + MarkerSymbol: MarkerSymbol.ToOption(), + MultiMarkerSymbol: MultiMarkerSymbol.ToOption(), + Marker: Marker.ToOption(), + LineColor: LineColor.ToOption(), + LineColorScale: LineColorScale.ToOption(), + LineWidth: LineWidth.ToOption(), + LineDash: LineDash.ToOption(), + Line: Line.ToOption(), + Below: Below.ToOption(), + EnableClustering: EnableClustering.ToOption(), + Cluster: Cluster.ToOption(), + UseDefaults: UseDefaults.ToOption() + ); +} diff --git a/src/Plotly.NET.CSharp/ChartAPI/ChartPolar.cs b/src/Plotly.NET.CSharp/ChartAPI/ChartPolar.cs deleted file mode 100644 index efe1c959..00000000 --- a/src/Plotly.NET.CSharp/ChartAPI/ChartPolar.cs +++ /dev/null @@ -1,495 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Plotly.NET; -using Plotly.NET.LayoutObjects; -using Plotly.NET.TraceObjects; -using System.Runtime.InteropServices; - -namespace Plotly.NET.CSharp -{ - public static partial class Chart - { - /// - /// Creates a polar scatter plot. - /// - /// In general, ScatterPolar plots plot two-dimensional data on a polar coordinate system comprised of angular and radial position scales. - /// - /// ScatterPolar charts are the basis of PointPolar, LinePolar, SplinePolar, and BubblePolar Charts, and can be customized as such. We also provide abstractions for those: Chart.PointPolar, Chart.LinePolar, Chart.SplinePolar , Chart.BubblePolar - /// - /// Sets the radial coordinates of the plotted data - /// Sets the angular coordinates of the plotted data (in degrees) - /// 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. - /// Sets the opactity of the trace - /// Sets the opactity of individual datum markers - /// Sets a text associated with each datum - /// Sets individual text for each datum - /// Sets the position of text associated with each datum - /// Sets the position of text associated with individual datum - /// Sets the color of the marker - /// Sets the colorscale of the marker - /// Sets the outline of the marker - /// Sets the marker symbol for each datum - /// Sets the marker symbol for each individual datum - /// Sets the marker (use this for more finegrained control than the other marker-associated arguments) - /// Sets the color of the line - /// Sets the colorscale of the line - /// Sets the width of the line - /// sets the drawing style of the line - /// Sets the line (use this for more finegrained control than the other line-associated arguments) - /// If true, plotly.js will use the WebGL engine to render this chart. use this when you want to render many objects at once. - /// If set to false, ignore the global default settings set in `Defaults` - public static GenericChart ScatterPolar( - IEnumerable r, - IEnumerable theta, - StyleParam.Mode mode, - Optional Name = default, - Optional ShowLegend = default, - Optional Opacity = default, - Optional> MultiOpacity = default, - Optional Text = default, - Optional> MultiText = default, - Optional TextPosition = default, - Optional> MultiTextPosition = default, - Optional MarkerColor = default, - Optional MarkerColorScale = default, - Optional MarkerOutline = default, - Optional MarkerSymbol = default, - Optional> MultiMarkerSymbol = default, - Optional Marker = default, - Optional LineColor = default, - Optional LineColorScale = default, - Optional LineWidth = default, - Optional LineDash = default, - Optional Line = default, - Optional UseWebGL = default, - Optional UseDefaults = default - ) - where RType : IConvertible - where ThetaType : IConvertible - where TextType : IConvertible - - => - Plotly.NET.ChartPolar_Scatter.Chart.ScatterPolar( - r: r, - theta: theta, - mode: mode, - Name: Name.ToOption(), - ShowLegend: ShowLegend.ToOption(), - Opacity: Opacity.ToOption(), - MultiOpacity: MultiOpacity.ToOption(), - Text: Text.ToOption(), - MultiText: MultiText.ToOption(), - TextPosition: TextPosition.ToOption(), - MultiTextPosition: MultiTextPosition.ToOption(), - MarkerColor: MarkerColor.ToOption(), - MarkerColorScale: MarkerColorScale.ToOption(), - MarkerOutline: MarkerOutline.ToOption(), - MarkerSymbol: MarkerSymbol.ToOption(), - MultiMarkerSymbol: MultiMarkerSymbol.ToOption(), - Marker: Marker.ToOption(), - LineColor: LineColor.ToOption(), - LineColorScale: LineColorScale.ToOption(), - LineWidth: LineWidth.ToOption(), - LineDash: LineDash.ToOption(), - Line: Line.ToOption(), - UseWebGL: UseWebGL.ToOption(), - UseDefaults: UseDefaults.ToOption() - ); - - /// - /// Creates a polar point plot. - /// - /// PointPolar plots plot two-dimensional data on a polar coordinate system comprised of angular and radial position scales as points. - /// - /// Sets the radial coordinates of the plotted data - /// Sets the angular 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. - /// Sets the opactity of the trace - /// Sets the opactity of individual datum markers - /// Sets a text associated with each datum - /// Sets individual text for each datum - /// Sets the position of text associated with each datum - /// Sets the position of text associated with individual datum - /// Sets the color of the marker - /// Sets the colorscale of the marker - /// Sets the outline of the marker - /// Sets the marker symbol for each datum - /// Sets the marker symbol for each individual datum - /// Sets the marker (use this for more finegrained control than the other marker-associated arguments) - /// If true, plotly.js will use the WebGL engine to render this chart. use this when you want to render many objects at once. - /// If set to false, ignore the global default settings set in `Defaults` - public static GenericChart PointPolar( - IEnumerable r, - IEnumerable theta, - Optional Name = default, - Optional ShowLegend = default, - Optional Opacity = default, - Optional> MultiOpacity = default, - Optional Text = default, - Optional> MultiText = default, - Optional TextPosition = default, - Optional> MultiTextPosition = default, - Optional MarkerColor = default, - Optional MarkerColorScale = default, - Optional MarkerOutline = default, - Optional MarkerSymbol = default, - Optional> MultiMarkerSymbol = default, - Optional Marker = default, - Optional UseWebGL = default, - Optional UseDefaults = default - ) - where RType : IConvertible - where ThetaType : IConvertible - where TextType : IConvertible - - => - Plotly.NET.ChartPolar_Scatter.Chart.PointPolar( - r: r, - theta: theta, - Name: Name.ToOption(), - ShowLegend: ShowLegend.ToOption(), - Opacity: Opacity.ToOption(), - MultiOpacity: MultiOpacity.ToOption(), - Text: Text.ToOption(), - MultiText: MultiText.ToOption(), - TextPosition: TextPosition.ToOption(), - MultiTextPosition: MultiTextPosition.ToOption(), - MarkerColor: MarkerColor.ToOption(), - MarkerColorScale: MarkerColorScale.ToOption(), - MarkerOutline: MarkerOutline.ToOption(), - MarkerSymbol: MarkerSymbol.ToOption(), - MultiMarkerSymbol: MultiMarkerSymbol.ToOption(), - Marker: Marker.ToOption(), - UseWebGL: UseWebGL.ToOption(), - UseDefaults: UseDefaults.ToOption() - ); - - /// - /// Creates a polar line plot. - /// - /// LinePolar plots plot two-dimensional data on a polar coordinate system comprised of angular and radial position scales connected via a line. - /// - /// Sets the radial coordinates of the plotted data - /// Sets the angular coordinates of the plotted data - /// Whether to show markers for the datums additionally to the line - /// 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. - /// Sets the opactity of the trace - /// Sets the opactity of individual datum markers - /// Sets a text associated with each datum - /// Sets individual text for each datum - /// Sets the position of text associated with each datum - /// Sets the position of text associated with individual datum - /// Sets the color of the marker - /// Sets the colorscale of the marker - /// Sets the outline of the marker - /// Sets the marker symbol for each datum - /// Sets the marker symbol for each individual datum - /// Sets the marker (use this for more finegrained control than the other marker-associated arguments) - /// Sets the color of the line - /// Sets the colorscale of the line - /// Sets the width of the line - /// sets the drawing style of the line - /// Sets the line (use this for more finegrained control than the other line-associated arguments) - /// If true, plotly.js will use the WebGL engine to render this chart. use this when you want to render many objects at once. - /// If set to false, ignore the global default settings set in `Defaults` - public static GenericChart LinePolar( - IEnumerable r, - IEnumerable theta, - Optional ShowMarkers = default, - Optional Name = default, - Optional ShowLegend = default, - Optional Opacity = default, - Optional> MultiOpacity = default, - Optional Text = default, - Optional> MultiText = default, - Optional TextPosition = default, - Optional> MultiTextPosition = default, - Optional MarkerColor = default, - Optional MarkerColorScale = default, - Optional MarkerOutline = default, - Optional MarkerSymbol = default, - Optional> MultiMarkerSymbol = default, - Optional Marker = default, - Optional LineColor = default, - Optional LineColorScale = default, - Optional LineWidth = default, - Optional LineDash = default, - Optional Line = default, - Optional UseWebGL = default, - Optional UseDefaults = default - ) - where RType : IConvertible - where ThetaType : IConvertible - where TextType : IConvertible - - => - Plotly.NET.ChartPolar_Scatter.Chart.LinePolar( - r: r, - theta: theta, - ShowMarkers: ShowMarkers.ToOption(), - Name: Name.ToOption(), - ShowLegend: ShowLegend.ToOption(), - Opacity: Opacity.ToOption(), - MultiOpacity: MultiOpacity.ToOption(), - Text: Text.ToOption(), - MultiText: MultiText.ToOption(), - TextPosition: TextPosition.ToOption(), - MultiTextPosition: MultiTextPosition.ToOption(), - MarkerColor: MarkerColor.ToOption(), - MarkerColorScale: MarkerColorScale.ToOption(), - MarkerOutline: MarkerOutline.ToOption(), - MarkerSymbol: MarkerSymbol.ToOption(), - MultiMarkerSymbol: MultiMarkerSymbol.ToOption(), - Marker: Marker.ToOption(), - LineColor: LineColor.ToOption(), - LineColorScale: LineColorScale.ToOption(), - LineWidth: LineWidth.ToOption(), - LineDash: LineDash.ToOption(), - Line: Line.ToOption(), - UseWebGL: UseWebGL.ToOption(), - UseDefaults: UseDefaults.ToOption() - ); - - /// - /// Creates a polar spline plot. - /// - /// LinePolar plots plot two-dimensional data on a polar coordinate system comprised of angular and radial position scales connected via a smoothed line. - /// - /// Sets the radial coordinates of the plotted data - /// Sets the angular coordinates of the plotted data - /// Whether to show markers for the datums additionally to the line - /// Sets the amount of smoothing. "0" corresponds to no smoothing (equivalent to a "linear" shape). Use values between 0. and 1.3 - /// 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. - /// Sets the opactity of the trace - /// Sets the opactity of individual datum markers - /// Sets a text associated with each datum - /// Sets individual text for each datum - /// Sets the position of text associated with each datum - /// Sets the position of text associated with individual datum - /// Sets the color of the marker - /// Sets the colorscale of the marker - /// Sets the outline of the marker - /// Sets the marker symbol for each datum - /// Sets the marker symbol for each individual datum - /// Sets the marker (use this for more finegrained control than the other marker-associated arguments) - /// Sets the color of the line - /// Sets the colorscale of the line - /// Sets the width of the line - /// sets the drawing style of the line - /// Sets the line (use this for more finegrained control than the other line-associated arguments) - /// If true, plotly.js will use the WebGL engine to render this chart. use this when you want to render many objects at once. - /// If set to false, ignore the global default settings set in `Defaults` - public static GenericChart SplinePolar( - IEnumerable r, - IEnumerable theta, - Optional ShowMarkers = default, - Optional Smoothing = default, - Optional Name = default, - Optional ShowLegend = default, - Optional Opacity = default, - Optional> MultiOpacity = default, - Optional Text = default, - Optional> MultiText = default, - Optional TextPosition = default, - Optional> MultiTextPosition = default, - Optional MarkerColor = default, - Optional MarkerColorScale = default, - Optional MarkerOutline = default, - Optional MarkerSymbol = default, - Optional> MultiMarkerSymbol = default, - Optional Marker = default, - Optional LineColor = default, - Optional LineColorScale = default, - Optional LineWidth = default, - Optional LineDash = default, - Optional Line = default, - Optional UseWebGL = default, - Optional UseDefaults = default - ) - where RType : IConvertible - where ThetaType : IConvertible - where TextType : IConvertible - - => - Plotly.NET.ChartPolar_Scatter.Chart.SplinePolar( - r: r, - theta: theta, - ShowMarkers: ShowMarkers.ToOption(), - Smoothing: Smoothing.ToOption(), - Name: Name.ToOption(), - ShowLegend: ShowLegend.ToOption(), - Opacity: Opacity.ToOption(), - MultiOpacity: MultiOpacity.ToOption(), - Text: Text.ToOption(), - MultiText: MultiText.ToOption(), - TextPosition: TextPosition.ToOption(), - MultiTextPosition: MultiTextPosition.ToOption(), - MarkerColor: MarkerColor.ToOption(), - MarkerColorScale: MarkerColorScale.ToOption(), - MarkerOutline: MarkerOutline.ToOption(), - MarkerSymbol: MarkerSymbol.ToOption(), - MultiMarkerSymbol: MultiMarkerSymbol.ToOption(), - Marker: Marker.ToOption(), - LineColor: LineColor.ToOption(), - LineColorScale: LineColorScale.ToOption(), - LineWidth: LineWidth.ToOption(), - LineDash: LineDash.ToOption(), - Line: Line.ToOption(), - UseWebGL: UseWebGL.ToOption(), - UseDefaults: UseDefaults.ToOption() - ); - - /// - /// Creates a polar bubble chart. - /// - /// BubblePolar Plots plot two-dimensional data on on a polar coordinate system comprised of angular and radial position scales, additionally using the points size as a 4th dimension. - /// - /// Sets the radial coordinates of the plotted data - /// Sets the angular 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. - /// Sets the opactity of the trace - /// Sets the opactity of individual datum markers - /// Sets a text associated with each datum - /// Sets individual text for each datum - /// Sets the position of text associated with each datum - /// Sets the position of text associated with individual datum - /// Sets the color of the marker - /// Sets the colorscale of the marker - /// Sets the outline of the marker - /// Sets the marker symbol for each datum - /// Sets the marker symbol for each individual datum - /// Sets the marker (use this for more finegrained control than the other marker-associated arguments) - /// If true, plotly.js will use the WebGL engine to render this chart. use this when you want to render many objects at once. - /// If set to false, ignore the global default settings set in `Defaults` - public static GenericChart BubblePolar( - IEnumerable r, - IEnumerable theta, - IEnumerable sizes, - Optional Name = default, - Optional ShowLegend = default, - Optional Opacity = default, - Optional> MultiOpacity = default, - Optional Text = default, - Optional> MultiText = default, - Optional TextPosition = default, - Optional> MultiTextPosition = default, - Optional MarkerColor = default, - Optional MarkerColorScale = default, - Optional MarkerOutline = default, - Optional MarkerSymbol = default, - Optional> MultiMarkerSymbol = default, - Optional Marker = default, - Optional UseWebGL = default, - Optional UseDefaults = default - ) - where RType : IConvertible - where ThetaType : IConvertible - where TextType : IConvertible - - => - Plotly.NET.ChartPolar_Scatter.Chart.BubblePolar( - r: r, - theta: theta, - sizes: sizes, - Name: Name.ToOption(), - ShowLegend: ShowLegend.ToOption(), - Opacity: Opacity.ToOption(), - MultiOpacity: MultiOpacity.ToOption(), - Text: Text.ToOption(), - MultiText: MultiText.ToOption(), - TextPosition: TextPosition.ToOption(), - MultiTextPosition: MultiTextPosition.ToOption(), - MarkerColor: MarkerColor.ToOption(), - MarkerColorScale: MarkerColorScale.ToOption(), - MarkerOutline: MarkerOutline.ToOption(), - MarkerSymbol: MarkerSymbol.ToOption(), - MultiMarkerSymbol: MultiMarkerSymbol.ToOption(), - Marker: Marker.ToOption(), - UseWebGL: UseWebGL.ToOption(), - UseDefaults: UseDefaults.ToOption() - ); - - /// - /// Creates a polar bar chart. - /// - /// A polar bar chart is a chart that presents categorical data on a polar coordinate system with bars with radial height proportional to the values that they represent. - /// - /// Sets the radial height of the bars - /// sets the angular position of the bars - /// 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. - /// Sets the opactity of the trace - /// Sets the opactity of individual datum markers - /// Sets a text associated with each datum - /// Sets individual text for each datum - /// Sets the color of the bars - /// Sets the colorscale of the bars - /// Sets the color of the bar outline - /// Sets the pattern shape for all bars - /// Sets individual pattern shapes for the bars - /// Sets the marker pattern (use this for more finegrained control than the other pattern-associated arguments). - /// Sets the marker for the bars (use this for more finegrained control than the other marker-associated arguments). - /// Sets where the bar base is drawn (in position axis units). - /// Sets the bar width (in position axis units) of all bars. - /// Sets the individual bar width (in position axis units) for each bar. - /// If set to false, ignore the global default settings set in `Defaults` - public static GenericChart BarPolar( - IEnumerable r, - IEnumerable theta, - Optional Name = default, - Optional ShowLegend = default, - Optional Opacity = default, - Optional> MultiOpacity = default, - Optional Text = default, - Optional> MultiText = default, - Optional MarkerColor = default, - Optional MarkerColorScale = default, - Optional MarkerOutline = default, - Optional MarkerPatternShape = default, - Optional> MultiMarkerPatternShape = default, - Optional MarkerPattern = default, - Optional Marker = default, - Optional Base = default, - Optional Width = default, - Optional> MultiWidth = default, - Optional UseDefaults = default - ) - where RType : IConvertible - where ThetaType : IConvertible - where TextType : IConvertible - - => - Plotly.NET.ChartPolar_Bar.Chart.BarPolar( - r: r, - theta: theta, - Name: Name.ToOption(), - ShowLegend: ShowLegend.ToOption(), - Opacity: Opacity.ToOption(), - MultiOpacity: MultiOpacity.ToOption(), - Text: Text.ToOption(), - MultiText: MultiText.ToOption(), - MarkerColor: MarkerColor.ToOption(), - MarkerColorScale: MarkerColorScale.ToOption(), - MarkerOutline: MarkerOutline.ToOption(), - MarkerPatternShape: MarkerPatternShape.ToOption(), - MultiMarkerPatternShape: MultiMarkerPatternShape.ToOption(), - MarkerPattern: MarkerPattern.ToOption(), - Marker: Marker.ToOption(), - Base: Base.ToOption(), - Width: Width.ToOption(), - MultiWidth: MultiWidth.ToOption(), - UseDefaults: UseDefaults.ToOption() - ); - } -} - diff --git a/src/Plotly.NET.CSharp/ChartAPI/ChartPolar/BarPolar.cs b/src/Plotly.NET.CSharp/ChartAPI/ChartPolar/BarPolar.cs new file mode 100644 index 00000000..9b91e8d9 --- /dev/null +++ b/src/Plotly.NET.CSharp/ChartAPI/ChartPolar/BarPolar.cs @@ -0,0 +1,83 @@ +using System; +using System.Collections.Generic; +using Plotly.NET; +using Plotly.NET.LayoutObjects; +using Plotly.NET.TraceObjects; +using static Plotly.NET.StyleParam; + +namespace Plotly.NET.CSharp; + +public static partial class Chart +{ + /// + /// Creates a polar bar chart. + /// + /// A polar bar chart is a chart that presents categorical data on a polar coordinate system with bars with radial height proportional to the values that they represent. + /// + /// Sets the radial height of the bars + /// sets the angular position of the bars + /// 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. + /// Sets the opactity of the trace + /// Sets the opactity of individual datum markers + /// Sets a text associated with each datum + /// Sets individual text for each datum + /// Sets the color of the bars + /// Sets the colorscale of the bars + /// Sets the color of the bar outline + /// Sets the pattern shape for all bars + /// Sets individual pattern shapes for the bars + /// Sets the marker pattern (use this for more finegrained control than the other pattern-associated arguments). + /// Sets the marker for the bars (use this for more finegrained control than the other marker-associated arguments). + /// Sets where the bar base is drawn (in position axis units). + /// Sets the bar width (in position axis units) of all bars. + /// Sets the individual bar width (in position axis units) for each bar. + /// If set to false, ignore the global default settings set in `Defaults` + public static GenericChart BarPolar( + IEnumerable r, + IEnumerable theta, + Optional Name = default, + Optional ShowLegend = default, + Optional Opacity = default, + Optional> MultiOpacity = default, + Optional Text = default, + Optional> MultiText = default, + Optional MarkerColor = default, + Optional MarkerColorScale = default, + Optional MarkerOutline = default, + Optional MarkerPatternShape = default, + Optional> MultiMarkerPatternShape = default, + Optional MarkerPattern = default, + Optional Marker = default, + Optional Base = default, + Optional Width = default, + Optional> MultiWidth = default, + Optional UseDefaults = default + ) + where RType : IConvertible + where ThetaType : IConvertible + where TextType : IConvertible + + => + Plotly.NET.ChartPolar_Bar.Chart.BarPolar( + r: r, + theta: theta, + Name: Name.ToOption(), + ShowLegend: ShowLegend.ToOption(), + Opacity: Opacity.ToOption(), + MultiOpacity: MultiOpacity.ToOption(), + Text: Text.ToOption(), + MultiText: MultiText.ToOption(), + MarkerColor: MarkerColor.ToOption(), + MarkerColorScale: MarkerColorScale.ToOption(), + MarkerOutline: MarkerOutline.ToOption(), + MarkerPatternShape: MarkerPatternShape.ToOption(), + MultiMarkerPatternShape: MultiMarkerPatternShape.ToOption(), + MarkerPattern: MarkerPattern.ToOption(), + Marker: Marker.ToOption(), + Base: Base.ToOption(), + Width: Width.ToOption(), + MultiWidth: MultiWidth.ToOption(), + UseDefaults: UseDefaults.ToOption() + ); +} diff --git a/src/Plotly.NET.CSharp/ChartAPI/ChartPolar/BubblePolar.cs b/src/Plotly.NET.CSharp/ChartAPI/ChartPolar/BubblePolar.cs new file mode 100644 index 00000000..7d5fdd63 --- /dev/null +++ b/src/Plotly.NET.CSharp/ChartAPI/ChartPolar/BubblePolar.cs @@ -0,0 +1,83 @@ +using System; +using System.Collections.Generic; +using Plotly.NET; +using Plotly.NET.LayoutObjects; +using Plotly.NET.TraceObjects; +using static Plotly.NET.StyleParam; + +namespace Plotly.NET.CSharp; + +public static partial class Chart +{ + /// + /// Creates a polar bubble chart. + /// + /// BubblePolar Plots plot two-dimensional data on on a polar coordinate system comprised of angular and radial position scales, additionally using the points size as a 4th dimension. + /// + /// Sets the radial coordinates of the plotted data + /// Sets the angular 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. + /// Sets the opactity of the trace + /// Sets the opactity of individual datum markers + /// Sets a text associated with each datum + /// Sets individual text for each datum + /// Sets the position of text associated with each datum + /// Sets the position of text associated with individual datum + /// Sets the color of the marker + /// Sets the colorscale of the marker + /// Sets the outline of the marker + /// Sets the marker symbol for each datum + /// Sets the marker symbol for each individual datum + /// Sets the marker (use this for more finegrained control than the other marker-associated arguments) + /// If true, plotly.js will use the WebGL engine to render this chart. use this when you want to render many objects at once. + /// If set to false, ignore the global default settings set in `Defaults` + public static GenericChart BubblePolar( + IEnumerable r, + IEnumerable theta, + IEnumerable sizes, + Optional Name = default, + Optional ShowLegend = default, + Optional Opacity = default, + Optional> MultiOpacity = default, + Optional Text = default, + Optional> MultiText = default, + Optional TextPosition = default, + Optional> MultiTextPosition = default, + Optional MarkerColor = default, + Optional MarkerColorScale = default, + Optional MarkerOutline = default, + Optional MarkerSymbol = default, + Optional> MultiMarkerSymbol = default, + Optional Marker = default, + Optional UseWebGL = default, + Optional UseDefaults = default + ) + where RType : IConvertible + where ThetaType : IConvertible + where TextType : IConvertible + + => + Plotly.NET.ChartPolar_Scatter.Chart.BubblePolar( + r: r, + theta: theta, + sizes: sizes, + Name: Name.ToOption(), + ShowLegend: ShowLegend.ToOption(), + Opacity: Opacity.ToOption(), + MultiOpacity: MultiOpacity.ToOption(), + Text: Text.ToOption(), + MultiText: MultiText.ToOption(), + TextPosition: TextPosition.ToOption(), + MultiTextPosition: MultiTextPosition.ToOption(), + MarkerColor: MarkerColor.ToOption(), + MarkerColorScale: MarkerColorScale.ToOption(), + MarkerOutline: MarkerOutline.ToOption(), + MarkerSymbol: MarkerSymbol.ToOption(), + MultiMarkerSymbol: MultiMarkerSymbol.ToOption(), + Marker: Marker.ToOption(), + UseWebGL: UseWebGL.ToOption(), + UseDefaults: UseDefaults.ToOption() + ); +} diff --git a/src/Plotly.NET.CSharp/ChartAPI/ChartPolar/LinePolar.cs b/src/Plotly.NET.CSharp/ChartAPI/ChartPolar/LinePolar.cs new file mode 100644 index 00000000..1487e46f --- /dev/null +++ b/src/Plotly.NET.CSharp/ChartAPI/ChartPolar/LinePolar.cs @@ -0,0 +1,98 @@ +using System; +using System.Collections.Generic; +using Plotly.NET; +using Plotly.NET.LayoutObjects; +using Plotly.NET.TraceObjects; +using static Plotly.NET.StyleParam; + +namespace Plotly.NET.CSharp; + +public static partial class Chart +{ + /// + /// Creates a polar line plot. + /// + /// LinePolar plots plot two-dimensional data on a polar coordinate system comprised of angular and radial position scales connected via a line. + /// + /// Sets the radial coordinates of the plotted data + /// Sets the angular coordinates of the plotted data + /// Whether to show markers for the datums additionally to the line + /// 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. + /// Sets the opactity of the trace + /// Sets the opactity of individual datum markers + /// Sets a text associated with each datum + /// Sets individual text for each datum + /// Sets the position of text associated with each datum + /// Sets the position of text associated with individual datum + /// Sets the color of the marker + /// Sets the colorscale of the marker + /// Sets the outline of the marker + /// Sets the marker symbol for each datum + /// Sets the marker symbol for each individual datum + /// Sets the marker (use this for more finegrained control than the other marker-associated arguments) + /// Sets the color of the line + /// Sets the colorscale of the line + /// Sets the width of the line + /// sets the drawing style of the line + /// Sets the line (use this for more finegrained control than the other line-associated arguments) + /// If true, plotly.js will use the WebGL engine to render this chart. use this when you want to render many objects at once. + /// If set to false, ignore the global default settings set in `Defaults` + public static GenericChart LinePolar( + IEnumerable r, + IEnumerable theta, + Optional ShowMarkers = default, + Optional Name = default, + Optional ShowLegend = default, + Optional Opacity = default, + Optional> MultiOpacity = default, + Optional Text = default, + Optional> MultiText = default, + Optional TextPosition = default, + Optional> MultiTextPosition = default, + Optional MarkerColor = default, + Optional MarkerColorScale = default, + Optional MarkerOutline = default, + Optional MarkerSymbol = default, + Optional> MultiMarkerSymbol = default, + Optional Marker = default, + Optional LineColor = default, + Optional LineColorScale = default, + Optional LineWidth = default, + Optional LineDash = default, + Optional Line = default, + Optional UseWebGL = default, + Optional UseDefaults = default + ) + where RType : IConvertible + where ThetaType : IConvertible + where TextType : IConvertible + + => + Plotly.NET.ChartPolar_Scatter.Chart.LinePolar( + r: r, + theta: theta, + ShowMarkers: ShowMarkers.ToOption(), + Name: Name.ToOption(), + ShowLegend: ShowLegend.ToOption(), + Opacity: Opacity.ToOption(), + MultiOpacity: MultiOpacity.ToOption(), + Text: Text.ToOption(), + MultiText: MultiText.ToOption(), + TextPosition: TextPosition.ToOption(), + MultiTextPosition: MultiTextPosition.ToOption(), + MarkerColor: MarkerColor.ToOption(), + MarkerColorScale: MarkerColorScale.ToOption(), + MarkerOutline: MarkerOutline.ToOption(), + MarkerSymbol: MarkerSymbol.ToOption(), + MultiMarkerSymbol: MultiMarkerSymbol.ToOption(), + Marker: Marker.ToOption(), + LineColor: LineColor.ToOption(), + LineColorScale: LineColorScale.ToOption(), + LineWidth: LineWidth.ToOption(), + LineDash: LineDash.ToOption(), + Line: Line.ToOption(), + UseWebGL: UseWebGL.ToOption(), + UseDefaults: UseDefaults.ToOption() + ); +} diff --git a/src/Plotly.NET.CSharp/ChartAPI/ChartPolar/PointPolar.cs b/src/Plotly.NET.CSharp/ChartAPI/ChartPolar/PointPolar.cs new file mode 100644 index 00000000..10096e6d --- /dev/null +++ b/src/Plotly.NET.CSharp/ChartAPI/ChartPolar/PointPolar.cs @@ -0,0 +1,80 @@ +using System; +using System.Collections.Generic; +using Plotly.NET; +using Plotly.NET.LayoutObjects; +using Plotly.NET.TraceObjects; +using static Plotly.NET.StyleParam; + +namespace Plotly.NET.CSharp; + +public static partial class Chart +{ + /// + /// Creates a polar point plot. + /// + /// PointPolar plots plot two-dimensional data on a polar coordinate system comprised of angular and radial position scales as points. + /// + /// Sets the radial coordinates of the plotted data + /// Sets the angular 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. + /// Sets the opactity of the trace + /// Sets the opactity of individual datum markers + /// Sets a text associated with each datum + /// Sets individual text for each datum + /// Sets the position of text associated with each datum + /// Sets the position of text associated with individual datum + /// Sets the color of the marker + /// Sets the colorscale of the marker + /// Sets the outline of the marker + /// Sets the marker symbol for each datum + /// Sets the marker symbol for each individual datum + /// Sets the marker (use this for more finegrained control than the other marker-associated arguments) + /// If true, plotly.js will use the WebGL engine to render this chart. use this when you want to render many objects at once. + /// If set to false, ignore the global default settings set in `Defaults` + public static GenericChart PointPolar( + IEnumerable r, + IEnumerable theta, + Optional Name = default, + Optional ShowLegend = default, + Optional Opacity = default, + Optional> MultiOpacity = default, + Optional Text = default, + Optional> MultiText = default, + Optional TextPosition = default, + Optional> MultiTextPosition = default, + Optional MarkerColor = default, + Optional MarkerColorScale = default, + Optional MarkerOutline = default, + Optional MarkerSymbol = default, + Optional> MultiMarkerSymbol = default, + Optional Marker = default, + Optional UseWebGL = default, + Optional UseDefaults = default + ) + where RType : IConvertible + where ThetaType : IConvertible + where TextType : IConvertible + + => + Plotly.NET.ChartPolar_Scatter.Chart.PointPolar( + r: r, + theta: theta, + Name: Name.ToOption(), + ShowLegend: ShowLegend.ToOption(), + Opacity: Opacity.ToOption(), + MultiOpacity: MultiOpacity.ToOption(), + Text: Text.ToOption(), + MultiText: MultiText.ToOption(), + TextPosition: TextPosition.ToOption(), + MultiTextPosition: MultiTextPosition.ToOption(), + MarkerColor: MarkerColor.ToOption(), + MarkerColorScale: MarkerColorScale.ToOption(), + MarkerOutline: MarkerOutline.ToOption(), + MarkerSymbol: MarkerSymbol.ToOption(), + MultiMarkerSymbol: MultiMarkerSymbol.ToOption(), + Marker: Marker.ToOption(), + UseWebGL: UseWebGL.ToOption(), + UseDefaults: UseDefaults.ToOption() + ); +} diff --git a/src/Plotly.NET.CSharp/ChartAPI/ChartPolar/ScatterPolar.cs b/src/Plotly.NET.CSharp/ChartAPI/ChartPolar/ScatterPolar.cs new file mode 100644 index 00000000..ce64c75d --- /dev/null +++ b/src/Plotly.NET.CSharp/ChartAPI/ChartPolar/ScatterPolar.cs @@ -0,0 +1,100 @@ +using System; +using System.Collections.Generic; +using Plotly.NET; +using Plotly.NET.LayoutObjects; +using Plotly.NET.TraceObjects; +using static Plotly.NET.StyleParam; + +namespace Plotly.NET.CSharp; + +public static partial class Chart +{ + /// + /// Creates a polar scatter plot. + /// + /// In general, ScatterPolar plots plot two-dimensional data on a polar coordinate system comprised of angular and radial position scales. + /// + /// ScatterPolar charts are the basis of PointPolar, LinePolar, SplinePolar, and BubblePolar Charts, and can be customized as such. We also provide abstractions for those: Chart.PointPolar, Chart.LinePolar, Chart.SplinePolar , Chart.BubblePolar + /// + /// Sets the radial coordinates of the plotted data + /// Sets the angular coordinates of the plotted data (in degrees) + /// 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. + /// Sets the opactity of the trace + /// Sets the opactity of individual datum markers + /// Sets a text associated with each datum + /// Sets individual text for each datum + /// Sets the position of text associated with each datum + /// Sets the position of text associated with individual datum + /// Sets the color of the marker + /// Sets the colorscale of the marker + /// Sets the outline of the marker + /// Sets the marker symbol for each datum + /// Sets the marker symbol for each individual datum + /// Sets the marker (use this for more finegrained control than the other marker-associated arguments) + /// Sets the color of the line + /// Sets the colorscale of the line + /// Sets the width of the line + /// sets the drawing style of the line + /// Sets the line (use this for more finegrained control than the other line-associated arguments) + /// If true, plotly.js will use the WebGL engine to render this chart. use this when you want to render many objects at once. + /// If set to false, ignore the global default settings set in `Defaults` + public static GenericChart ScatterPolar( + IEnumerable r, + IEnumerable theta, + StyleParam.Mode mode, + Optional Name = default, + Optional ShowLegend = default, + Optional Opacity = default, + Optional> MultiOpacity = default, + Optional Text = default, + Optional> MultiText = default, + Optional TextPosition = default, + Optional> MultiTextPosition = default, + Optional MarkerColor = default, + Optional MarkerColorScale = default, + Optional MarkerOutline = default, + Optional MarkerSymbol = default, + Optional> MultiMarkerSymbol = default, + Optional Marker = default, + Optional LineColor = default, + Optional LineColorScale = default, + Optional LineWidth = default, + Optional LineDash = default, + Optional Line = default, + Optional UseWebGL = default, + Optional UseDefaults = default + ) + where RType : IConvertible + where ThetaType : IConvertible + where TextType : IConvertible + + => + Plotly.NET.ChartPolar_Scatter.Chart.ScatterPolar( + r: r, + theta: theta, + mode: mode, + Name: Name.ToOption(), + ShowLegend: ShowLegend.ToOption(), + Opacity: Opacity.ToOption(), + MultiOpacity: MultiOpacity.ToOption(), + Text: Text.ToOption(), + MultiText: MultiText.ToOption(), + TextPosition: TextPosition.ToOption(), + MultiTextPosition: MultiTextPosition.ToOption(), + MarkerColor: MarkerColor.ToOption(), + MarkerColorScale: MarkerColorScale.ToOption(), + MarkerOutline: MarkerOutline.ToOption(), + MarkerSymbol: MarkerSymbol.ToOption(), + MultiMarkerSymbol: MultiMarkerSymbol.ToOption(), + Marker: Marker.ToOption(), + LineColor: LineColor.ToOption(), + LineColorScale: LineColorScale.ToOption(), + LineWidth: LineWidth.ToOption(), + LineDash: LineDash.ToOption(), + Line: Line.ToOption(), + UseWebGL: UseWebGL.ToOption(), + UseDefaults: UseDefaults.ToOption() + ); +} diff --git a/src/Plotly.NET.CSharp/ChartAPI/ChartPolar/SplinePolar.cs b/src/Plotly.NET.CSharp/ChartAPI/ChartPolar/SplinePolar.cs new file mode 100644 index 00000000..32b3feb1 --- /dev/null +++ b/src/Plotly.NET.CSharp/ChartAPI/ChartPolar/SplinePolar.cs @@ -0,0 +1,101 @@ +using System; +using System.Collections.Generic; +using Plotly.NET; +using Plotly.NET.LayoutObjects; +using Plotly.NET.TraceObjects; +using static Plotly.NET.StyleParam; + +namespace Plotly.NET.CSharp; + +public static partial class Chart +{ + /// + /// Creates a polar spline plot. + /// + /// LinePolar plots plot two-dimensional data on a polar coordinate system comprised of angular and radial position scales connected via a smoothed line. + /// + /// Sets the radial coordinates of the plotted data + /// Sets the angular coordinates of the plotted data + /// Whether to show markers for the datums additionally to the line + /// Sets the amount of smoothing. "0" corresponds to no smoothing (equivalent to a "linear" shape). Use values between 0. and 1.3 + /// 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. + /// Sets the opactity of the trace + /// Sets the opactity of individual datum markers + /// Sets a text associated with each datum + /// Sets individual text for each datum + /// Sets the position of text associated with each datum + /// Sets the position of text associated with individual datum + /// Sets the color of the marker + /// Sets the colorscale of the marker + /// Sets the outline of the marker + /// Sets the marker symbol for each datum + /// Sets the marker symbol for each individual datum + /// Sets the marker (use this for more finegrained control than the other marker-associated arguments) + /// Sets the color of the line + /// Sets the colorscale of the line + /// Sets the width of the line + /// sets the drawing style of the line + /// Sets the line (use this for more finegrained control than the other line-associated arguments) + /// If true, plotly.js will use the WebGL engine to render this chart. use this when you want to render many objects at once. + /// If set to false, ignore the global default settings set in `Defaults` + public static GenericChart SplinePolar( + IEnumerable r, + IEnumerable theta, + Optional ShowMarkers = default, + Optional Smoothing = default, + Optional Name = default, + Optional ShowLegend = default, + Optional Opacity = default, + Optional> MultiOpacity = default, + Optional Text = default, + Optional> MultiText = default, + Optional TextPosition = default, + Optional> MultiTextPosition = default, + Optional MarkerColor = default, + Optional MarkerColorScale = default, + Optional MarkerOutline = default, + Optional MarkerSymbol = default, + Optional> MultiMarkerSymbol = default, + Optional Marker = default, + Optional LineColor = default, + Optional LineColorScale = default, + Optional LineWidth = default, + Optional LineDash = default, + Optional Line = default, + Optional UseWebGL = default, + Optional UseDefaults = default + ) + where RType : IConvertible + where ThetaType : IConvertible + where TextType : IConvertible + + => + Plotly.NET.ChartPolar_Scatter.Chart.SplinePolar( + r: r, + theta: theta, + ShowMarkers: ShowMarkers.ToOption(), + Smoothing: Smoothing.ToOption(), + Name: Name.ToOption(), + ShowLegend: ShowLegend.ToOption(), + Opacity: Opacity.ToOption(), + MultiOpacity: MultiOpacity.ToOption(), + Text: Text.ToOption(), + MultiText: MultiText.ToOption(), + TextPosition: TextPosition.ToOption(), + MultiTextPosition: MultiTextPosition.ToOption(), + MarkerColor: MarkerColor.ToOption(), + MarkerColorScale: MarkerColorScale.ToOption(), + MarkerOutline: MarkerOutline.ToOption(), + MarkerSymbol: MarkerSymbol.ToOption(), + MultiMarkerSymbol: MultiMarkerSymbol.ToOption(), + Marker: Marker.ToOption(), + LineColor: LineColor.ToOption(), + LineColorScale: LineColorScale.ToOption(), + LineWidth: LineWidth.ToOption(), + LineDash: LineDash.ToOption(), + Line: Line.ToOption(), + UseWebGL: UseWebGL.ToOption(), + UseDefaults: UseDefaults.ToOption() + ); +} diff --git a/src/Plotly.NET.CSharp/ChartAPI/ChartSmith.cs b/src/Plotly.NET.CSharp/ChartAPI/ChartSmith.cs deleted file mode 100644 index 8528c9d9..00000000 --- a/src/Plotly.NET.CSharp/ChartAPI/ChartSmith.cs +++ /dev/null @@ -1,338 +0,0 @@ -using Plotly.NET; -using Plotly.NET.LayoutObjects; -using Plotly.NET.TraceObjects; -using System.Runtime.InteropServices; - -namespace Plotly.NET.CSharp -{ - public static partial class Chart - { - /// - /// Creates a Scatter plot on a smith coordinate system. - /// - /// In general, ScatterSmith charts plot complex numbers on a transformed two-dimensional Cartesian complex plane. Complex numbers with positive real parts map inside the circle. Those with negative real parts map outside the circle. - /// - /// ScatterSmith charts are the basis of PointSmith, LineSmith, and BubbleSmith Charts, and can be customized as such. We also provide abstractions for those: Chart.LineSmith, Chart.PointSmith, Chart.BubbleSmith - /// - /// Sets the real component of the data, in units of normalized impedance such that real=1, imag=0 is the center of the chart. - /// Sets the imaginary component of the data, in units of normalized impedance such that real=1, imag=0 is the center of the chart. - /// 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. - /// Sets the opactity of the trace - /// Sets the opactity of individual datum markers - /// Sets a text associated with each datum - /// Sets individual text for each datum - /// Sets the position of text associated with each datum - /// Sets the position of text associated with individual datum - /// Sets the color of the marker - /// Sets the colorscale of the marker - /// Sets the outline of the marker - /// Sets the marker symbol for each datum - /// Sets the marker symbol for each individual datum - /// Sets the marker (use this for more finegrained control than the other marker-associated arguments) - /// Sets the color of the line - /// Sets the colorscale of the line - /// Sets the width of the line - /// sets the drawing style of the line - /// Sets the line (use this for more finegrained control than the other line-associated arguments) - /// Sets the area to fill with a solid color. Defaults to "none" unless this trace is stacked, then it gets "tonexty" ("tonextx") if `orientation` is "v" ("h") Use with `FillColor` if not "none". "tozerox" and "tozeroy" fill to x=0 and y=0 respectively. "tonextx" and "tonexty" fill between the endpoints of this trace and the endpoints of the trace before it, connecting those endpoints with straight lines (to make a stacked area graph); if there is no trace before it, they behave like "tozerox" and "tozeroy". "toself" connects the endpoints of the trace (or each segment of the trace if it has gaps) into a closed shape. "tonext" fills the space between two traces if one completely encloses the other (eg consecutive contour lines), and behaves like "toself" if there is no trace before it. "tonext" should not be used if one trace does not enclose the other. Traces in a `stackgroup` will only fill to (or be filled to) other traces in the same group. With multiple `stackgroup`s or some traces stacked and some not, if fill-linked traces are not already consecutive, the later ones will be pushed down in the drawing order. - /// ets the fill color. Defaults to a half-transparent variant of the line color, marker color, or marker line color, whichever is available. - /// If set to false, ignore the global default settings set in `Defaults` - public static GenericChart ScatterSmith( - IEnumerable real, - IEnumerable imag, - StyleParam.Mode mode, - Optional Name = default, - Optional ShowLegend = default, - Optional Opacity = default, - Optional> MultiOpacity = default, - Optional Text = default, - Optional> MultiText = default, - Optional TextPosition = default, - Optional> MultiTextPosition = default, - Optional MarkerColor = default, - Optional MarkerColorScale = default, - Optional MarkerOutline = default, - Optional MarkerSymbol = default, - Optional> MultiMarkerSymbol = default, - Optional Marker = default, - Optional LineColor = default, - Optional LineColorScale = default, - Optional LineWidth = default, - Optional LineDash = default, - Optional Line = default, - Optional Fill = default, - Optional FillColor = default, - Optional UseDefaults = default - ) - where RealType : IConvertible - where ImagType : IConvertible - where TextType : IConvertible - => - Plotly.NET.ChartSmith_Scatter.Chart.ScatterSmith( - real: real, - imag: imag, - mode: mode, - Name: Name.ToOption(), - ShowLegend: ShowLegend.ToOption(), - Opacity: Opacity.ToOption(), - MultiOpacity: MultiOpacity.ToOption(), - Text: Text.ToOption(), - MultiText: MultiText.ToOption(), - TextPosition: TextPosition.ToOption(), - MultiTextPosition: MultiTextPosition.ToOption(), - MarkerColor: MarkerColor.ToOption(), - MarkerColorScale: MarkerColorScale.ToOption(), - MarkerOutline: MarkerOutline.ToOption(), - MarkerSymbol: MarkerSymbol.ToOption(), - MultiMarkerSymbol: MultiMarkerSymbol.ToOption(), - Marker: Marker.ToOption(), - LineColor: LineColor.ToOption(), - LineColorScale: LineColorScale.ToOption(), - LineWidth: LineWidth.ToOption(), - LineDash: LineDash.ToOption(), - Line: Line.ToOption(), - Fill: Fill.ToOption(), - FillColor: FillColor.ToOption(), - UseDefaults: UseDefaults.ToOption() - ); - - /// - /// Creates a Point plot on a smith coordinate system. - /// - /// In general, ScatterPoint charts plot complex numbers on a transformed two-dimensional Cartesian complex plane as points. Complex numbers with positive real parts map inside the circle. Those with negative real parts map outside the circle. - /// - /// Sets the real component of the data, in units of normalized impedance such that real=1, imag=0 is the center of the chart. - /// Sets the imaginary component of the data, in units of normalized impedance such that real=1, imag=0 is the center of the chart. - /// 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. - /// Sets the opactity of the trace - /// Sets the opactity of individual datum markers - /// Sets a text associated with each datum - /// Sets individual text for each datum - /// Sets the position of text associated with each datum - /// Sets the position of text associated with individual datum - /// Sets the color of the marker - /// Sets the colorscale of the marker - /// Sets the outline of the marker - /// Sets the marker symbol for each datum - /// Sets the marker symbol for each individual datum - /// Sets the marker (use this for more finegrained control than the other marker-associated arguments) - /// If set to false, ignore the global default settings set in `Defaults` - public static GenericChart PointSmith( - IEnumerable real, - IEnumerable imag, - Optional Name = default, - Optional ShowLegend = default, - Optional Opacity = default, - Optional> MultiOpacity = default, - Optional Text = default, - Optional> MultiText = default, - Optional TextPosition = default, - Optional> MultiTextPosition = default, - Optional MarkerColor = default, - Optional MarkerColorScale = default, - Optional MarkerOutline = default, - Optional MarkerSymbol = default, - Optional> MultiMarkerSymbol = default, - Optional Marker = default, - Optional UseDefaults = default - ) - where RealType : IConvertible - where ImagType : IConvertible - where TextType : IConvertible - => - Plotly.NET.ChartSmith_Scatter.Chart.PointSmith( - real: real, - imag: imag, - Name: Name.ToOption(), - ShowLegend: ShowLegend.ToOption(), - Opacity: Opacity.ToOption(), - MultiOpacity: MultiOpacity.ToOption(), - Text: Text.ToOption(), - MultiText: MultiText.ToOption(), - TextPosition: TextPosition.ToOption(), - MultiTextPosition: MultiTextPosition.ToOption(), - MarkerColor: MarkerColor.ToOption(), - MarkerColorScale: MarkerColorScale.ToOption(), - MarkerOutline: MarkerOutline.ToOption(), - MarkerSymbol: MarkerSymbol.ToOption(), - MultiMarkerSymbol: MultiMarkerSymbol.ToOption(), - Marker: Marker.ToOption(), - UseDefaults: UseDefaults.ToOption() - ); - - /// - /// Creates a Line plot on a smith coordinate system. - /// - /// In general, LineSmith charts plot complex numbers on a transformed two-dimensional Cartesian complex plane as datums connected by a line. Complex numbers with positive real parts map inside the circle. Those with negative real parts map outside the circle. - /// - /// Sets the real component of the data, in units of normalized impedance such that real=1, imag=0 is the center of the chart. - /// Sets the imaginary component of the data, in units of normalized impedance such that real=1, imag=0 is the center of the chart. - /// Whether or not to show markers for each datum. - /// 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. - /// Sets the opactity of the trace - /// Sets the opactity of individual datum markers - /// Sets a text associated with each datum - /// Sets individual text for each datum - /// Sets the position of text associated with each datum - /// Sets the position of text associated with individual datum - /// Sets the color of the marker - /// Sets the colorscale of the marker - /// Sets the outline of the marker - /// Sets the marker symbol for each datum - /// Sets the marker symbol for each individual datum - /// Sets the marker (use this for more finegrained control than the other marker-associated arguments) - /// Sets the color of the line - /// Sets the colorscale of the line - /// Sets the width of the line - /// sets the drawing style of the line - /// Sets the line (use this for more finegrained control than the other line-associated arguments) - /// Sets the area to fill with a solid color. Defaults to "none" unless this trace is stacked, then it gets "tonexty" ("tonextx") if `orientation` is "v" ("h") Use with `FillColor` if not "none". "tozerox" and "tozeroy" fill to x=0 and y=0 respectively. "tonextx" and "tonexty" fill between the endpoints of this trace and the endpoints of the trace before it, connecting those endpoints with straight lines (to make a stacked area graph); if there is no trace before it, they behave like "tozerox" and "tozeroy". "toself" connects the endpoints of the trace (or each segment of the trace if it has gaps) into a closed shape. "tonext" fills the space between two traces if one completely encloses the other (eg consecutive contour lines), and behaves like "toself" if there is no trace before it. "tonext" should not be used if one trace does not enclose the other. Traces in a `stackgroup` will only fill to (or be filled to) other traces in the same group. With multiple `stackgroup`s or some traces stacked and some not, if fill-linked traces are not already consecutive, the later ones will be pushed down in the drawing order. - /// ets the fill color. Defaults to a half-transparent variant of the line color, marker color, or marker line color, whichever is available. - /// If set to false, ignore the global default settings set in `Defaults` - public static GenericChart LineSmith( - IEnumerable real, - IEnumerable imag, - Optional ShowMarkers = default, - Optional Name = default, - Optional ShowLegend = default, - Optional Opacity = default, - Optional> MultiOpacity = default, - Optional Text = default, - Optional> MultiText = default, - Optional TextPosition = default, - Optional> MultiTextPosition = default, - Optional MarkerColor = default, - Optional MarkerColorScale = default, - Optional MarkerOutline = default, - Optional MarkerSymbol = default, - Optional> MultiMarkerSymbol = default, - Optional Marker = default, - Optional LineColor = default, - Optional LineColorScale = default, - Optional LineWidth = default, - Optional LineDash = default, - Optional Line = default, - Optional Fill = default, - Optional FillColor = default, - Optional UseDefaults = default - ) - where RealType : IConvertible - where ImagType : IConvertible - where TextType : IConvertible - => - Plotly.NET.ChartSmith_Scatter.Chart.LineSmith( - real: real, - imag: imag, - ShowMarkers: ShowMarkers.ToOption(), - Name: Name.ToOption(), - ShowLegend: ShowLegend.ToOption(), - Opacity: Opacity.ToOption(), - MultiOpacity: MultiOpacity.ToOption(), - Text: Text.ToOption(), - MultiText: MultiText.ToOption(), - TextPosition: TextPosition.ToOption(), - MultiTextPosition: MultiTextPosition.ToOption(), - MarkerColor: MarkerColor.ToOption(), - MarkerColorScale: MarkerColorScale.ToOption(), - MarkerOutline: MarkerOutline.ToOption(), - MarkerSymbol: MarkerSymbol.ToOption(), - MultiMarkerSymbol: MultiMarkerSymbol.ToOption(), - Marker: Marker.ToOption(), - LineColor: LineColor.ToOption(), - LineColorScale: LineColorScale.ToOption(), - LineWidth: LineWidth.ToOption(), - LineDash: LineDash.ToOption(), - Line: Line.ToOption(), - Fill: Fill.ToOption(), - FillColor: FillColor.ToOption(), - UseDefaults: UseDefaults.ToOption() - ); - /// - /// Creates a Bubble plot on a smith coordinate system. 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. - /// - /// In general, BubbleSmith charts plot complex numbers on a transformed two-dimensional Cartesian complex plane as points of varying sizes. Complex numbers with positive real parts map inside the circle. Those with negative real parts map outside the circle. - /// - /// Sets the real component of the data, in units of normalized impedance such that real=1, imag=0 is the center of the chart. - /// Sets the imaginary component of the data, in units of normalized impedance such that real=1, imag=0 is the center of the chart. - /// Sets the size of the points - /// 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. - /// Sets the opactity of the trace - /// Sets the opactity of individual datum markers - /// Sets a text associated with each datum - /// Sets individual text for each datum - /// Sets the position of text associated with each datum - /// Sets the position of text associated with individual datum - /// Sets the color of the marker - /// Sets the colorscale of the marker - /// Sets the outline of the marker - /// Sets the marker symbol for each datum - /// Sets the marker symbol for each individual datum - /// Sets the marker (use this for more finegrained control than the other marker-associated arguments) - /// Sets the color of the line - /// Sets the colorscale of the line - /// Sets the width of the line - /// sets the drawing style of the line - /// Sets the line (use this for more finegrained control than the other line-associated arguments) - /// If set to false, ignore the global default settings set in `Defaults` - public static GenericChart BubbleSmith( - IEnumerable real, - IEnumerable imag, - IEnumerable sizes, - Optional Name = default, - Optional ShowLegend = default, - Optional Opacity = default, - Optional> MultiOpacity = default, - Optional Text = default, - Optional> MultiText = default, - Optional TextPosition = default, - Optional> MultiTextPosition = default, - Optional MarkerColor = default, - Optional MarkerColorScale = default, - Optional MarkerOutline = default, - Optional MarkerSymbol = default, - Optional> MultiMarkerSymbol = default, - Optional Marker = default, - Optional LineColor = default, - Optional LineColorScale = default, - Optional LineWidth = default, - Optional LineDash = default, - Optional Line = default, - Optional UseDefaults = default - ) - where RealType : IConvertible - where ImagType : IConvertible - where TextType : IConvertible - => - Plotly.NET.ChartSmith_Scatter.Chart.BubbleSmith( - real: real, - imag: imag, - sizes: sizes, - Name: Name.ToOption(), - ShowLegend: ShowLegend.ToOption(), - Opacity: Opacity.ToOption(), - MultiOpacity: MultiOpacity.ToOption(), - Text: Text.ToOption(), - MultiText: MultiText.ToOption(), - TextPosition: TextPosition.ToOption(), - MultiTextPosition: MultiTextPosition.ToOption(), - MarkerColor: MarkerColor.ToOption(), - MarkerColorScale: MarkerColorScale.ToOption(), - MarkerOutline: MarkerOutline.ToOption(), - MarkerSymbol: MarkerSymbol.ToOption(), - MultiMarkerSymbol: MultiMarkerSymbol.ToOption(), - Marker: Marker.ToOption(), - LineColor: LineColor.ToOption(), - LineColorScale: LineColorScale.ToOption(), - LineWidth: LineWidth.ToOption(), - LineDash: LineDash.ToOption(), - Line: Line.ToOption(), - UseDefaults: UseDefaults.ToOption() - ); - } -} - diff --git a/src/Plotly.NET.CSharp/ChartAPI/ChartSmith/BubbleSmith.cs b/src/Plotly.NET.CSharp/ChartAPI/ChartSmith/BubbleSmith.cs new file mode 100644 index 00000000..d5b97c7d --- /dev/null +++ b/src/Plotly.NET.CSharp/ChartAPI/ChartSmith/BubbleSmith.cs @@ -0,0 +1,94 @@ +using System; +using System.Collections.Generic; +using Plotly.NET; +using Plotly.NET.LayoutObjects; +using Plotly.NET.TraceObjects; +using static Plotly.NET.StyleParam; + +namespace Plotly.NET.CSharp; + +public static partial class Chart +{ + /// + /// Creates a Bubble plot on a smith coordinate system. 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. + /// + /// In general, BubbleSmith charts plot complex numbers on a transformed two-dimensional Cartesian complex plane as points of varying sizes. Complex numbers with positive real parts map inside the circle. Those with negative real parts map outside the circle. + /// + /// Sets the real component of the data, in units of normalized impedance such that real=1, imag=0 is the center of the chart. + /// Sets the imaginary component of the data, in units of normalized impedance such that real=1, imag=0 is the center of the chart. + /// Sets the size of the points + /// 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. + /// Sets the opactity of the trace + /// Sets the opactity of individual datum markers + /// Sets a text associated with each datum + /// Sets individual text for each datum + /// Sets the position of text associated with each datum + /// Sets the position of text associated with individual datum + /// Sets the color of the marker + /// Sets the colorscale of the marker + /// Sets the outline of the marker + /// Sets the marker symbol for each datum + /// Sets the marker symbol for each individual datum + /// Sets the marker (use this for more finegrained control than the other marker-associated arguments) + /// Sets the color of the line + /// Sets the colorscale of the line + /// Sets the width of the line + /// sets the drawing style of the line + /// Sets the line (use this for more finegrained control than the other line-associated arguments) + /// If set to false, ignore the global default settings set in `Defaults` + public static GenericChart BubbleSmith( + IEnumerable real, + IEnumerable imag, + IEnumerable sizes, + Optional Name = default, + Optional ShowLegend = default, + Optional Opacity = default, + Optional> MultiOpacity = default, + Optional Text = default, + Optional> MultiText = default, + Optional TextPosition = default, + Optional> MultiTextPosition = default, + Optional MarkerColor = default, + Optional MarkerColorScale = default, + Optional MarkerOutline = default, + Optional MarkerSymbol = default, + Optional> MultiMarkerSymbol = default, + Optional Marker = default, + Optional LineColor = default, + Optional LineColorScale = default, + Optional LineWidth = default, + Optional LineDash = default, + Optional Line = default, + Optional UseDefaults = default + ) + where RealType : IConvertible + where ImagType : IConvertible + where TextType : IConvertible + => + Plotly.NET.ChartSmith_Scatter.Chart.BubbleSmith( + real: real, + imag: imag, + sizes: sizes, + Name: Name.ToOption(), + ShowLegend: ShowLegend.ToOption(), + Opacity: Opacity.ToOption(), + MultiOpacity: MultiOpacity.ToOption(), + Text: Text.ToOption(), + MultiText: MultiText.ToOption(), + TextPosition: TextPosition.ToOption(), + MultiTextPosition: MultiTextPosition.ToOption(), + MarkerColor: MarkerColor.ToOption(), + MarkerColorScale: MarkerColorScale.ToOption(), + MarkerOutline: MarkerOutline.ToOption(), + MarkerSymbol: MarkerSymbol.ToOption(), + MultiMarkerSymbol: MultiMarkerSymbol.ToOption(), + Marker: Marker.ToOption(), + LineColor: LineColor.ToOption(), + LineColorScale: LineColorScale.ToOption(), + LineWidth: LineWidth.ToOption(), + LineDash: LineDash.ToOption(), + Line: Line.ToOption(), + UseDefaults: UseDefaults.ToOption() + ); +} diff --git a/src/Plotly.NET.CSharp/ChartAPI/ChartSmith/LineSmith.cs b/src/Plotly.NET.CSharp/ChartAPI/ChartSmith/LineSmith.cs new file mode 100644 index 00000000..ee06e3fc --- /dev/null +++ b/src/Plotly.NET.CSharp/ChartAPI/ChartSmith/LineSmith.cs @@ -0,0 +1,100 @@ +using System; +using System.Collections.Generic; +using Plotly.NET; +using Plotly.NET.LayoutObjects; +using Plotly.NET.TraceObjects; +using static Plotly.NET.StyleParam; + +namespace Plotly.NET.CSharp; + +public static partial class Chart +{ + /// + /// Creates a Line plot on a smith coordinate system. + /// + /// In general, LineSmith charts plot complex numbers on a transformed two-dimensional Cartesian complex plane as datums connected by a line. Complex numbers with positive real parts map inside the circle. Those with negative real parts map outside the circle. + /// + /// Sets the real component of the data, in units of normalized impedance such that real=1, imag=0 is the center of the chart. + /// Sets the imaginary component of the data, in units of normalized impedance such that real=1, imag=0 is the center of the chart. + /// Whether or not to show markers for each datum. + /// 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. + /// Sets the opactity of the trace + /// Sets the opactity of individual datum markers + /// Sets a text associated with each datum + /// Sets individual text for each datum + /// Sets the position of text associated with each datum + /// Sets the position of text associated with individual datum + /// Sets the color of the marker + /// Sets the colorscale of the marker + /// Sets the outline of the marker + /// Sets the marker symbol for each datum + /// Sets the marker symbol for each individual datum + /// Sets the marker (use this for more finegrained control than the other marker-associated arguments) + /// Sets the color of the line + /// Sets the colorscale of the line + /// Sets the width of the line + /// sets the drawing style of the line + /// Sets the line (use this for more finegrained control than the other line-associated arguments) + /// Sets the area to fill with a solid color. Defaults to "none" unless this trace is stacked, then it gets "tonexty" ("tonextx") if `orientation` is "v" ("h") Use with `FillColor` if not "none". "tozerox" and "tozeroy" fill to x=0 and y=0 respectively. "tonextx" and "tonexty" fill between the endpoints of this trace and the endpoints of the trace before it, connecting those endpoints with straight lines (to make a stacked area graph); if there is no trace before it, they behave like "tozerox" and "tozeroy". "toself" connects the endpoints of the trace (or each segment of the trace if it has gaps) into a closed shape. "tonext" fills the space between two traces if one completely encloses the other (eg consecutive contour lines), and behaves like "toself" if there is no trace before it. "tonext" should not be used if one trace does not enclose the other. Traces in a `stackgroup` will only fill to (or be filled to) other traces in the same group. With multiple `stackgroup`s or some traces stacked and some not, if fill-linked traces are not already consecutive, the later ones will be pushed down in the drawing order. + /// ets the fill color. Defaults to a half-transparent variant of the line color, marker color, or marker line color, whichever is available. + /// If set to false, ignore the global default settings set in `Defaults` + public static GenericChart LineSmith( + IEnumerable real, + IEnumerable imag, + Optional ShowMarkers = default, + Optional Name = default, + Optional ShowLegend = default, + Optional Opacity = default, + Optional> MultiOpacity = default, + Optional Text = default, + Optional> MultiText = default, + Optional TextPosition = default, + Optional> MultiTextPosition = default, + Optional MarkerColor = default, + Optional MarkerColorScale = default, + Optional MarkerOutline = default, + Optional MarkerSymbol = default, + Optional> MultiMarkerSymbol = default, + Optional Marker = default, + Optional LineColor = default, + Optional LineColorScale = default, + Optional LineWidth = default, + Optional LineDash = default, + Optional Line = default, + Optional Fill = default, + Optional FillColor = default, + Optional UseDefaults = default + ) + where RealType : IConvertible + where ImagType : IConvertible + where TextType : IConvertible + => + Plotly.NET.ChartSmith_Scatter.Chart.LineSmith( + real: real, + imag: imag, + ShowMarkers: ShowMarkers.ToOption(), + Name: Name.ToOption(), + ShowLegend: ShowLegend.ToOption(), + Opacity: Opacity.ToOption(), + MultiOpacity: MultiOpacity.ToOption(), + Text: Text.ToOption(), + MultiText: MultiText.ToOption(), + TextPosition: TextPosition.ToOption(), + MultiTextPosition: MultiTextPosition.ToOption(), + MarkerColor: MarkerColor.ToOption(), + MarkerColorScale: MarkerColorScale.ToOption(), + MarkerOutline: MarkerOutline.ToOption(), + MarkerSymbol: MarkerSymbol.ToOption(), + MultiMarkerSymbol: MultiMarkerSymbol.ToOption(), + Marker: Marker.ToOption(), + LineColor: LineColor.ToOption(), + LineColorScale: LineColorScale.ToOption(), + LineWidth: LineWidth.ToOption(), + LineDash: LineDash.ToOption(), + Line: Line.ToOption(), + Fill: Fill.ToOption(), + FillColor: FillColor.ToOption(), + UseDefaults: UseDefaults.ToOption() + ); +} diff --git a/src/Plotly.NET.CSharp/ChartAPI/ChartSmith/PointSmith.cs b/src/Plotly.NET.CSharp/ChartAPI/ChartSmith/PointSmith.cs new file mode 100644 index 00000000..4199c2de --- /dev/null +++ b/src/Plotly.NET.CSharp/ChartAPI/ChartSmith/PointSmith.cs @@ -0,0 +1,76 @@ +using System; +using System.Collections.Generic; +using Plotly.NET; +using Plotly.NET.LayoutObjects; +using Plotly.NET.TraceObjects; +using static Plotly.NET.StyleParam; + +namespace Plotly.NET.CSharp; + +public static partial class Chart +{ + /// + /// Creates a Point plot on a smith coordinate system. + /// + /// In general, ScatterPoint charts plot complex numbers on a transformed two-dimensional Cartesian complex plane as points. Complex numbers with positive real parts map inside the circle. Those with negative real parts map outside the circle. + /// + /// Sets the real component of the data, in units of normalized impedance such that real=1, imag=0 is the center of the chart. + /// Sets the imaginary component of the data, in units of normalized impedance such that real=1, imag=0 is the center of the chart. + /// 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. + /// Sets the opactity of the trace + /// Sets the opactity of individual datum markers + /// Sets a text associated with each datum + /// Sets individual text for each datum + /// Sets the position of text associated with each datum + /// Sets the position of text associated with individual datum + /// Sets the color of the marker + /// Sets the colorscale of the marker + /// Sets the outline of the marker + /// Sets the marker symbol for each datum + /// Sets the marker symbol for each individual datum + /// Sets the marker (use this for more finegrained control than the other marker-associated arguments) + /// If set to false, ignore the global default settings set in `Defaults` + public static GenericChart PointSmith( + IEnumerable real, + IEnumerable imag, + Optional Name = default, + Optional ShowLegend = default, + Optional Opacity = default, + Optional> MultiOpacity = default, + Optional Text = default, + Optional> MultiText = default, + Optional TextPosition = default, + Optional> MultiTextPosition = default, + Optional MarkerColor = default, + Optional MarkerColorScale = default, + Optional MarkerOutline = default, + Optional MarkerSymbol = default, + Optional> MultiMarkerSymbol = default, + Optional Marker = default, + Optional UseDefaults = default + ) + where RealType : IConvertible + where ImagType : IConvertible + where TextType : IConvertible + => + Plotly.NET.ChartSmith_Scatter.Chart.PointSmith( + real: real, + imag: imag, + Name: Name.ToOption(), + ShowLegend: ShowLegend.ToOption(), + Opacity: Opacity.ToOption(), + MultiOpacity: MultiOpacity.ToOption(), + Text: Text.ToOption(), + MultiText: MultiText.ToOption(), + TextPosition: TextPosition.ToOption(), + MultiTextPosition: MultiTextPosition.ToOption(), + MarkerColor: MarkerColor.ToOption(), + MarkerColorScale: MarkerColorScale.ToOption(), + MarkerOutline: MarkerOutline.ToOption(), + MarkerSymbol: MarkerSymbol.ToOption(), + MultiMarkerSymbol: MultiMarkerSymbol.ToOption(), + Marker: Marker.ToOption(), + UseDefaults: UseDefaults.ToOption() + ); +} diff --git a/src/Plotly.NET.CSharp/ChartAPI/ChartSmith/ScatterSmith.cs b/src/Plotly.NET.CSharp/ChartAPI/ChartSmith/ScatterSmith.cs new file mode 100644 index 00000000..1f3c755b --- /dev/null +++ b/src/Plotly.NET.CSharp/ChartAPI/ChartSmith/ScatterSmith.cs @@ -0,0 +1,102 @@ +using System; +using System.Collections.Generic; +using Plotly.NET; +using Plotly.NET.LayoutObjects; +using Plotly.NET.TraceObjects; +using static Plotly.NET.StyleParam; + +namespace Plotly.NET.CSharp; + +public static partial class Chart +{ + /// + /// Creates a Scatter plot on a smith coordinate system. + /// + /// In general, ScatterSmith charts plot complex numbers on a transformed two-dimensional Cartesian complex plane. Complex numbers with positive real parts map inside the circle. Those with negative real parts map outside the circle. + /// + /// ScatterSmith charts are the basis of PointSmith, LineSmith, and BubbleSmith Charts, and can be customized as such. We also provide abstractions for those: Chart.LineSmith, Chart.PointSmith, Chart.BubbleSmith + /// + /// Sets the real component of the data, in units of normalized impedance such that real=1, imag=0 is the center of the chart. + /// Sets the imaginary component of the data, in units of normalized impedance such that real=1, imag=0 is the center of the chart. + /// 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. + /// Sets the opactity of the trace + /// Sets the opactity of individual datum markers + /// Sets a text associated with each datum + /// Sets individual text for each datum + /// Sets the position of text associated with each datum + /// Sets the position of text associated with individual datum + /// Sets the color of the marker + /// Sets the colorscale of the marker + /// Sets the outline of the marker + /// Sets the marker symbol for each datum + /// Sets the marker symbol for each individual datum + /// Sets the marker (use this for more finegrained control than the other marker-associated arguments) + /// Sets the color of the line + /// Sets the colorscale of the line + /// Sets the width of the line + /// sets the drawing style of the line + /// Sets the line (use this for more finegrained control than the other line-associated arguments) + /// Sets the area to fill with a solid color. Defaults to "none" unless this trace is stacked, then it gets "tonexty" ("tonextx") if `orientation` is "v" ("h") Use with `FillColor` if not "none". "tozerox" and "tozeroy" fill to x=0 and y=0 respectively. "tonextx" and "tonexty" fill between the endpoints of this trace and the endpoints of the trace before it, connecting those endpoints with straight lines (to make a stacked area graph); if there is no trace before it, they behave like "tozerox" and "tozeroy". "toself" connects the endpoints of the trace (or each segment of the trace if it has gaps) into a closed shape. "tonext" fills the space between two traces if one completely encloses the other (eg consecutive contour lines), and behaves like "toself" if there is no trace before it. "tonext" should not be used if one trace does not enclose the other. Traces in a `stackgroup` will only fill to (or be filled to) other traces in the same group. With multiple `stackgroup`s or some traces stacked and some not, if fill-linked traces are not already consecutive, the later ones will be pushed down in the drawing order. + /// ets the fill color. Defaults to a half-transparent variant of the line color, marker color, or marker line color, whichever is available. + /// If set to false, ignore the global default settings set in `Defaults` + public static GenericChart ScatterSmith( + IEnumerable real, + IEnumerable imag, + StyleParam.Mode mode, + Optional Name = default, + Optional ShowLegend = default, + Optional Opacity = default, + Optional> MultiOpacity = default, + Optional Text = default, + Optional> MultiText = default, + Optional TextPosition = default, + Optional> MultiTextPosition = default, + Optional MarkerColor = default, + Optional MarkerColorScale = default, + Optional MarkerOutline = default, + Optional MarkerSymbol = default, + Optional> MultiMarkerSymbol = default, + Optional Marker = default, + Optional LineColor = default, + Optional LineColorScale = default, + Optional LineWidth = default, + Optional LineDash = default, + Optional Line = default, + Optional Fill = default, + Optional FillColor = default, + Optional UseDefaults = default + ) + where RealType : IConvertible + where ImagType : IConvertible + where TextType : IConvertible + => + Plotly.NET.ChartSmith_Scatter.Chart.ScatterSmith( + real: real, + imag: imag, + mode: mode, + Name: Name.ToOption(), + ShowLegend: ShowLegend.ToOption(), + Opacity: Opacity.ToOption(), + MultiOpacity: MultiOpacity.ToOption(), + Text: Text.ToOption(), + MultiText: MultiText.ToOption(), + TextPosition: TextPosition.ToOption(), + MultiTextPosition: MultiTextPosition.ToOption(), + MarkerColor: MarkerColor.ToOption(), + MarkerColorScale: MarkerColorScale.ToOption(), + MarkerOutline: MarkerOutline.ToOption(), + MarkerSymbol: MarkerSymbol.ToOption(), + MultiMarkerSymbol: MultiMarkerSymbol.ToOption(), + Marker: Marker.ToOption(), + LineColor: LineColor.ToOption(), + LineColorScale: LineColorScale.ToOption(), + LineWidth: LineWidth.ToOption(), + LineDash: LineDash.ToOption(), + Line: Line.ToOption(), + Fill: Fill.ToOption(), + FillColor: FillColor.ToOption(), + UseDefaults: UseDefaults.ToOption() + ); +} diff --git a/src/Plotly.NET.CSharp/ChartAPI/ChartTernary.cs b/src/Plotly.NET.CSharp/ChartAPI/ChartTernary.cs deleted file mode 100644 index b79b15ff..00000000 --- a/src/Plotly.NET.CSharp/ChartAPI/ChartTernary.cs +++ /dev/null @@ -1,366 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Plotly.NET.LayoutObjects; -using Plotly.NET.TraceObjects; -using System.Runtime.InteropServices; - -namespace Plotly.NET.CSharp -{ - public static partial class Chart - { - /// - /// Creates a Scatter plot on a ternary coordinate system - /// - /// In general, ScatterTernary creates a barycentric plot on three variables which sum to a constant, graphically depicting the ratios of the three variables as positions in an equilateral triangle. - /// - /// ScatterTernary charts are the basis of PointTernary, LineTernary, and BubbleTernary Charts, and can be customized as such. We also provide abstractions for those: Chart.LineTernary, Chart.PointTernary, Chart.BubbleTernary - /// - /// Sets the quantity of component `a` in each data point. If `a`, `b`, and `c` are all provided, they need not be normalized, only the relative values matter. If only two arrays are provided they must be normalized to match `ternary<i>.sum`. - /// Sets the quantity of component `b` in each data point. If `a`, `b`, and `c` are all provided, they need not be normalized, only the relative values matter. If only two arrays are provided they must be normalized to match `ternary<i>.sum`. - /// Sets the quantity of component `c` in each data point. If `a`, `b`, and `c` are all provided, they need not be normalized, only the relative values matter. If only two arrays are provided they must be normalized to match `ternary<i>.sum`. - /// The number each triplet should sum to, if only two of `a`, `b`, and `c` are provided. This overrides `ternary<i>.sum` to normalize this specific trace, but does not affect the values displayed on the axes. 0 (or missing) means to use `ternary<i>.sum` - /// 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. - /// Sets the opactity of the trace - /// Sets the opactity of individual datum markers - /// Sets a text associated with each datum - /// Sets individual text for each datum - /// Sets the position of text associated with each datum - /// Sets the position of text associated with individual datum - /// Sets the color of the marker - /// Sets the colorscale of the marker - /// Sets the outline of the marker - /// Sets the marker symbol for each datum - /// Sets the marker symbol for each individual datum - /// Sets the marker (use this for more finegrained control than the other marker-associated arguments) - /// Sets the color of the line - /// Sets the colorscale of the line - /// Sets the width of the line - /// sets the drawing style of the line - /// Sets the line (use this for more finegrained control than the other line-associated arguments) - /// If set to false, ignore the global default settings set in `Defaults` - public static GenericChart ScatterTernary( - Optional> A = default, - Optional> B = default, - Optional> C = default, - Optional Sum = default, - Optional Mode = default, - Optional Name = default, - Optional ShowLegend = default, - Optional Opacity = default, - Optional> MultiOpacity = default, - Optional Text = default, - Optional> MultiText = default, - Optional TextPosition = default, - Optional> MultiTextPosition = default, - Optional MarkerColor = default, - Optional MarkerColorScale = default, - Optional MarkerOutline = default, - Optional MarkerSymbol = default, - Optional> MultiMarkerSymbol = default, - Optional Marker = default, - Optional LineColor = default, - Optional LineColorScale = default, - Optional LineWidth = default, - Optional LineDash = default, - Optional Line = default, - Optional UseDefaults = default - ) - where AType : IConvertible - where BType : IConvertible - where CType : IConvertible - where SumType : IConvertible - where TextType : IConvertible - => - Plotly.NET.ChartTernary_Scatter.Chart.ScatterTernary( - A: A.ToOption(), - B: B.ToOption(), - C: C.ToOption(), - Sum: Sum.ToOption(), - Mode: Mode.ToOption(), - Name: Name.ToOption(), - ShowLegend: ShowLegend.ToOption(), - Opacity: Opacity.ToOption(), - MultiOpacity: MultiOpacity.ToOption(), - Text: Text.ToOption(), - MultiText: MultiText.ToOption(), - TextPosition: TextPosition.ToOption(), - MultiTextPosition: MultiTextPosition.ToOption(), - MarkerColor: MarkerColor.ToOption(), - MarkerColorScale: MarkerColorScale.ToOption(), - MarkerOutline: MarkerOutline.ToOption(), - MarkerSymbol: MarkerSymbol.ToOption(), - MultiMarkerSymbol: MultiMarkerSymbol.ToOption(), - Marker: Marker.ToOption(), - LineColor: LineColor.ToOption(), - LineColorScale: LineColorScale.ToOption(), - LineWidth: LineWidth.ToOption(), - LineDash: LineDash.ToOption(), - Line: Line.ToOption(), - UseDefaults: UseDefaults.ToOption() - ); - - /// - /// Creates a point plot on a ternary coordinate system - /// - /// In general, PointTernary creates a barycentric point plot on three variables which sum to a constant, graphically depicting the ratios of the three variables as positions in an equilateral triangle. - /// - /// Sets the quantity of component `a` in each data point. If `a`, `b`, and `c` are all provided, they need not be normalized, only the relative values matter. If only two arrays are provided they must be normalized to match `ternary<i>.sum`. - /// Sets the quantity of component `b` in each data point. If `a`, `b`, and `c` are all provided, they need not be normalized, only the relative values matter. If only two arrays are provided they must be normalized to match `ternary<i>.sum`. - /// Sets the quantity of component `c` in each data point. If `a`, `b`, and `c` are all provided, they need not be normalized, only the relative values matter. If only two arrays are provided they must be normalized to match `ternary<i>.sum`. - /// The number each triplet should sum to, if only two of `a`, `b`, and `c` are provided. This overrides `ternary<i>.sum` to normalize this specific trace, but does not affect the values displayed on the axes. 0 (or missing) means to use `ternary<i>.sum` - /// 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. - /// Sets the opactity of the trace - /// Sets the opactity of individual datum markers - /// Sets a text associated with each datum - /// Sets individual text for each datum - /// Sets the position of text associated with each datum - /// Sets the position of text associated with individual datum - /// Sets the color of the marker - /// Sets the colorscale of the marker - /// Sets the outline of the marker - /// Sets the marker symbol for each datum - /// Sets the marker symbol for each individual datum - /// Sets the marker (use this for more finegrained control than the other marker-associated arguments) - /// If set to false, ignore the global default settings set in `Defaults` - public static GenericChart PointTernary( - Optional> A = default, - Optional> B = default, - Optional> C = default, - Optional Sum = default, - Optional Name = default, - Optional ShowLegend = default, - Optional Opacity = default, - Optional> MultiOpacity = default, - Optional Text = default, - Optional> MultiText = default, - Optional TextPosition = default, - Optional> MultiTextPosition = default, - Optional MarkerColor = default, - Optional MarkerColorScale = default, - Optional MarkerOutline = default, - Optional MarkerSymbol = default, - Optional> MultiMarkerSymbol = default, - Optional Marker = default, - Optional UseDefaults = default - ) - where AType : IConvertible - where BType : IConvertible - where CType : IConvertible - where SumType : IConvertible - where TextType : IConvertible - => - Plotly.NET.ChartTernary_Scatter.Chart.PointTernary( - A: A.ToOption(), - B: B.ToOption(), - C: C.ToOption(), - Sum: Sum.ToOption(), - Name: Name.ToOption(), - ShowLegend: ShowLegend.ToOption(), - Opacity: Opacity.ToOption(), - MultiOpacity: MultiOpacity.ToOption(), - Text: Text.ToOption(), - MultiText: MultiText.ToOption(), - TextPosition: TextPosition.ToOption(), - MultiTextPosition: MultiTextPosition.ToOption(), - MarkerColor: MarkerColor.ToOption(), - MarkerColorScale: MarkerColorScale.ToOption(), - MarkerOutline: MarkerOutline.ToOption(), - MarkerSymbol: MarkerSymbol.ToOption(), - MultiMarkerSymbol: MultiMarkerSymbol.ToOption(), - Marker: Marker.ToOption(), - UseDefaults: UseDefaults.ToOption() - ); - - /// - /// Creates a line plot on a ternary coordinate system - /// - /// In general, LineTernary creates a barycentric line plot on three variables which sum to a constant, graphically depicting the ratios of the three variables as positions in an equilateral triangle. - /// - /// Sets the quantity of component `a` in each data point. If `a`, `b`, and `c` are all provided, they need not be normalized, only the relative values matter. If only two arrays are provided they must be normalized to match `ternary<i>.sum`. - /// Sets the quantity of component `b` in each data point. If `a`, `b`, and `c` are all provided, they need not be normalized, only the relative values matter. If only two arrays are provided they must be normalized to match `ternary<i>.sum`. - /// Sets the quantity of component `c` in each data point. If `a`, `b`, and `c` are all provided, they need not be normalized, only the relative values matter. If only two arrays are provided they must be normalized to match `ternary<i>.sum`. - /// The number each triplet should sum to, if only two of `a`, `b`, and `c` are provided. This overrides `ternary<i>.sum` to normalize this specific trace, but does not affect the values displayed on the axes. 0 (or missing) means to use `ternary<i>.sum` - /// Whether to show markers for the individual data points - /// 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. - /// Sets the opactity of the trace - /// Sets the opactity of individual datum markers - /// Sets a text associated with each datum - /// Sets individual text for each datum - /// Sets the position of text associated with each datum - /// Sets the position of text associated with individual datum - /// Sets the color of the marker - /// Sets the colorscale of the marker - /// Sets the outline of the marker - /// Sets the marker symbol for each datum - /// Sets the marker symbol for each individual datum - /// Sets the marker (use this for more finegrained control than the other marker-associated arguments) - /// Sets the color of the line - /// Sets the colorscale of the line - /// Sets the width of the line - /// sets the drawing style of the line - /// Sets the line (use this for more finegrained control than the other line-associated arguments) - /// If set to false, ignore the global default settings set in `Defaults` - public static GenericChart LineTernary( - Optional> A = default, - Optional> B = default, - Optional> C = default, - Optional Sum = default, - Optional ShowMarkers = default, - Optional Name = default, - Optional ShowLegend = default, - Optional Opacity = default, - Optional> MultiOpacity = default, - Optional Text = default, - Optional> MultiText = default, - Optional TextPosition = default, - Optional> MultiTextPosition = default, - Optional MarkerColor = default, - Optional MarkerColorScale = default, - Optional MarkerOutline = default, - Optional MarkerSymbol = default, - Optional> MultiMarkerSymbol = default, - Optional Marker = default, - Optional LineColor = default, - Optional LineColorScale = default, - Optional LineWidth = default, - Optional LineDash = default, - Optional Line = default, - Optional UseDefaults = default - ) - where AType : IConvertible - where BType : IConvertible - where CType : IConvertible - where SumType : IConvertible - where TextType : IConvertible - => - Plotly.NET.ChartTernary_Scatter.Chart.LineTernary( - A: A.ToOption(), - B: B.ToOption(), - C: C.ToOption(), - Sum: Sum.ToOption(), - ShowMarkers: ShowMarkers.ToOption(), - Name: Name.ToOption(), - ShowLegend: ShowLegend.ToOption(), - Opacity: Opacity.ToOption(), - MultiOpacity: MultiOpacity.ToOption(), - Text: Text.ToOption(), - MultiText: MultiText.ToOption(), - TextPosition: TextPosition.ToOption(), - MultiTextPosition: MultiTextPosition.ToOption(), - MarkerColor: MarkerColor.ToOption(), - MarkerColorScale: MarkerColorScale.ToOption(), - MarkerOutline: MarkerOutline.ToOption(), - MarkerSymbol: MarkerSymbol.ToOption(), - MultiMarkerSymbol: MultiMarkerSymbol.ToOption(), - Marker: Marker.ToOption(), - LineColor: LineColor.ToOption(), - LineColorScale: LineColorScale.ToOption(), - LineWidth: LineWidth.ToOption(), - LineDash: LineDash.ToOption(), - Line: Line.ToOption(), - UseDefaults: UseDefaults.ToOption() - ); - - /// - /// Creates a bubble plot on a ternary coordinate system - /// - /// 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. - /// - /// In general, BubbleTernary creates a barycentric point plot on three variables which sum to a constant, graphically depicting the ratios of the three variables as positions in an equilateral triangle. - /// A 4th data dimension is used to determine the size of the points. - /// - /// Sets the bubble size of the plotted data - /// Sets the quantity of component `a` in each data point. If `a`, `b`, and `c` are all provided, they need not be normalized, only the relative values matter. If only two arrays are provided they must be normalized to match `ternary<i>.sum`. - /// Sets the quantity of component `b` in each data point. If `a`, `b`, and `c` are all provided, they need not be normalized, only the relative values matter. If only two arrays are provided they must be normalized to match `ternary<i>.sum`. - /// Sets the quantity of component `c` in each data point. If `a`, `b`, and `c` are all provided, they need not be normalized, only the relative values matter. If only two arrays are provided they must be normalized to match `ternary<i>.sum`. - /// The number each triplet should sum to, if only two of `a`, `b`, and `c` are provided. This overrides `ternary<i>.sum` to normalize this specific trace, but does not affect the values displayed on the axes. 0 (or missing) means to use `ternary<i>.sum` - /// 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. - /// Sets the opactity of the trace - /// Sets the opactity of individual datum markers - /// Sets a text associated with each datum - /// Sets individual text for each datum - /// Sets the position of text associated with each datum - /// Sets the position of text associated with individual datum - /// Sets the color of the marker - /// Sets the colorscale of the marker - /// Sets the outline of the marker - /// Sets the marker symbol for each datum - /// Sets the marker symbol for each individual datum - /// Sets the marker (use this for more finegrained control than the other marker-associated arguments) - /// Sets the color of the line - /// Sets the colorscale of the line - /// Sets the width of the line - /// sets the drawing style of the line - /// Sets the line (use this for more finegrained control than the other line-associated arguments) - /// If set to false, ignore the global default settings set in `Defaults` - public static GenericChart BubbleTernary( - IEnumerable sizes, - Optional> A = default, - Optional> B = default, - Optional> C = default, - Optional Sum = default, - Optional Name = default, - Optional ShowLegend = default, - Optional Opacity = default, - Optional> MultiOpacity = default, - Optional Text = default, - Optional> MultiText = default, - Optional TextPosition = default, - Optional> MultiTextPosition = default, - Optional MarkerColor = default, - Optional MarkerColorScale = default, - Optional MarkerOutline = default, - Optional MarkerSymbol = default, - Optional> MultiMarkerSymbol = default, - Optional Marker = default, - Optional LineColor = default, - Optional LineColorScale = default, - Optional LineWidth = default, - Optional LineDash = default, - Optional Line = default, - Optional UseDefaults = default - ) - where AType : IConvertible - where BType : IConvertible - where CType : IConvertible - where SumType : IConvertible - where TextType : IConvertible - => - Plotly.NET.ChartTernary_Scatter.Chart.BubbleTernary( - sizes: sizes, - A: A.ToOption(), - B: B.ToOption(), - C: C.ToOption(), - Sum: Sum.ToOption(), - Name: Name.ToOption(), - ShowLegend: ShowLegend.ToOption(), - Opacity: Opacity.ToOption(), - MultiOpacity: MultiOpacity.ToOption(), - Text: Text.ToOption(), - MultiText: MultiText.ToOption(), - TextPosition: TextPosition.ToOption(), - MultiTextPosition: MultiTextPosition.ToOption(), - MarkerColor: MarkerColor.ToOption(), - MarkerColorScale: MarkerColorScale.ToOption(), - MarkerOutline: MarkerOutline.ToOption(), - MarkerSymbol: MarkerSymbol.ToOption(), - MultiMarkerSymbol: MultiMarkerSymbol.ToOption(), - Marker: Marker.ToOption(), - LineColor: LineColor.ToOption(), - LineColorScale: LineColorScale.ToOption(), - LineWidth: LineWidth.ToOption(), - LineDash: LineDash.ToOption(), - Line: Line.ToOption(), - UseDefaults: UseDefaults.ToOption() - ); - } -} - diff --git a/src/Plotly.NET.CSharp/ChartAPI/ChartTernary/BubbleTernary.cs b/src/Plotly.NET.CSharp/ChartAPI/ChartTernary/BubbleTernary.cs new file mode 100644 index 00000000..523e4976 --- /dev/null +++ b/src/Plotly.NET.CSharp/ChartAPI/ChartTernary/BubbleTernary.cs @@ -0,0 +1,105 @@ +using System; +using System.Collections.Generic; +using Plotly.NET; +using Plotly.NET.LayoutObjects; +using Plotly.NET.TraceObjects; +using static Plotly.NET.StyleParam; + +namespace Plotly.NET.CSharp; + +public static partial class Chart +{ + /// + /// Creates a bubble plot on a ternary coordinate system + /// + /// 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. + /// + /// In general, BubbleTernary creates a barycentric point plot on three variables which sum to a constant, graphically depicting the ratios of the three variables as positions in an equilateral triangle. + /// A 4th data dimension is used to determine the size of the points. + /// + /// Sets the bubble size of the plotted data + /// Sets the quantity of component `a` in each data point. If `a`, `b`, and `c` are all provided, they need not be normalized, only the relative values matter. If only two arrays are provided they must be normalized to match `ternary<i>.sum`. + /// Sets the quantity of component `b` in each data point. If `a`, `b`, and `c` are all provided, they need not be normalized, only the relative values matter. If only two arrays are provided they must be normalized to match `ternary<i>.sum`. + /// Sets the quantity of component `c` in each data point. If `a`, `b`, and `c` are all provided, they need not be normalized, only the relative values matter. If only two arrays are provided they must be normalized to match `ternary<i>.sum`. + /// The number each triplet should sum to, if only two of `a`, `b`, and `c` are provided. This overrides `ternary<i>.sum` to normalize this specific trace, but does not affect the values displayed on the axes. 0 (or missing) means to use `ternary<i>.sum` + /// 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. + /// Sets the opactity of the trace + /// Sets the opactity of individual datum markers + /// Sets a text associated with each datum + /// Sets individual text for each datum + /// Sets the position of text associated with each datum + /// Sets the position of text associated with individual datum + /// Sets the color of the marker + /// Sets the colorscale of the marker + /// Sets the outline of the marker + /// Sets the marker symbol for each datum + /// Sets the marker symbol for each individual datum + /// Sets the marker (use this for more finegrained control than the other marker-associated arguments) + /// Sets the color of the line + /// Sets the colorscale of the line + /// Sets the width of the line + /// sets the drawing style of the line + /// Sets the line (use this for more finegrained control than the other line-associated arguments) + /// If set to false, ignore the global default settings set in `Defaults` + public static GenericChart BubbleTernary( + IEnumerable sizes, + Optional> A = default, + Optional> B = default, + Optional> C = default, + Optional Sum = default, + Optional Name = default, + Optional ShowLegend = default, + Optional Opacity = default, + Optional> MultiOpacity = default, + Optional Text = default, + Optional> MultiText = default, + Optional TextPosition = default, + Optional> MultiTextPosition = default, + Optional MarkerColor = default, + Optional MarkerColorScale = default, + Optional MarkerOutline = default, + Optional MarkerSymbol = default, + Optional> MultiMarkerSymbol = default, + Optional Marker = default, + Optional LineColor = default, + Optional LineColorScale = default, + Optional LineWidth = default, + Optional LineDash = default, + Optional Line = default, + Optional UseDefaults = default + ) + where AType : IConvertible + where BType : IConvertible + where CType : IConvertible + where SumType : IConvertible + where TextType : IConvertible + => + Plotly.NET.ChartTernary_Scatter.Chart.BubbleTernary( + sizes: sizes, + A: A.ToOption(), + B: B.ToOption(), + C: C.ToOption(), + Sum: Sum.ToOption(), + Name: Name.ToOption(), + ShowLegend: ShowLegend.ToOption(), + Opacity: Opacity.ToOption(), + MultiOpacity: MultiOpacity.ToOption(), + Text: Text.ToOption(), + MultiText: MultiText.ToOption(), + TextPosition: TextPosition.ToOption(), + MultiTextPosition: MultiTextPosition.ToOption(), + MarkerColor: MarkerColor.ToOption(), + MarkerColorScale: MarkerColorScale.ToOption(), + MarkerOutline: MarkerOutline.ToOption(), + MarkerSymbol: MarkerSymbol.ToOption(), + MultiMarkerSymbol: MultiMarkerSymbol.ToOption(), + Marker: Marker.ToOption(), + LineColor: LineColor.ToOption(), + LineColorScale: LineColorScale.ToOption(), + LineWidth: LineWidth.ToOption(), + LineDash: LineDash.ToOption(), + Line: Line.ToOption(), + UseDefaults: UseDefaults.ToOption() + ); +} diff --git a/src/Plotly.NET.CSharp/ChartAPI/ChartTernary/LineTernary.cs b/src/Plotly.NET.CSharp/ChartAPI/ChartTernary/LineTernary.cs new file mode 100644 index 00000000..65a4281d --- /dev/null +++ b/src/Plotly.NET.CSharp/ChartAPI/ChartTernary/LineTernary.cs @@ -0,0 +1,102 @@ +using System; +using System.Collections.Generic; +using Plotly.NET; +using Plotly.NET.LayoutObjects; +using Plotly.NET.TraceObjects; +using static Plotly.NET.StyleParam; + +namespace Plotly.NET.CSharp; + +public static partial class Chart +{ + /// + /// Creates a line plot on a ternary coordinate system + /// + /// In general, LineTernary creates a barycentric line plot on three variables which sum to a constant, graphically depicting the ratios of the three variables as positions in an equilateral triangle. + /// + /// Sets the quantity of component `a` in each data point. If `a`, `b`, and `c` are all provided, they need not be normalized, only the relative values matter. If only two arrays are provided they must be normalized to match `ternary<i>.sum`. + /// Sets the quantity of component `b` in each data point. If `a`, `b`, and `c` are all provided, they need not be normalized, only the relative values matter. If only two arrays are provided they must be normalized to match `ternary<i>.sum`. + /// Sets the quantity of component `c` in each data point. If `a`, `b`, and `c` are all provided, they need not be normalized, only the relative values matter. If only two arrays are provided they must be normalized to match `ternary<i>.sum`. + /// The number each triplet should sum to, if only two of `a`, `b`, and `c` are provided. This overrides `ternary<i>.sum` to normalize this specific trace, but does not affect the values displayed on the axes. 0 (or missing) means to use `ternary<i>.sum` + /// Whether to show markers for the individual data points + /// 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. + /// Sets the opactity of the trace + /// Sets the opactity of individual datum markers + /// Sets a text associated with each datum + /// Sets individual text for each datum + /// Sets the position of text associated with each datum + /// Sets the position of text associated with individual datum + /// Sets the color of the marker + /// Sets the colorscale of the marker + /// Sets the outline of the marker + /// Sets the marker symbol for each datum + /// Sets the marker symbol for each individual datum + /// Sets the marker (use this for more finegrained control than the other marker-associated arguments) + /// Sets the color of the line + /// Sets the colorscale of the line + /// Sets the width of the line + /// sets the drawing style of the line + /// Sets the line (use this for more finegrained control than the other line-associated arguments) + /// If set to false, ignore the global default settings set in `Defaults` + public static GenericChart LineTernary( + Optional> A = default, + Optional> B = default, + Optional> C = default, + Optional Sum = default, + Optional ShowMarkers = default, + Optional Name = default, + Optional ShowLegend = default, + Optional Opacity = default, + Optional> MultiOpacity = default, + Optional Text = default, + Optional> MultiText = default, + Optional TextPosition = default, + Optional> MultiTextPosition = default, + Optional MarkerColor = default, + Optional MarkerColorScale = default, + Optional MarkerOutline = default, + Optional MarkerSymbol = default, + Optional> MultiMarkerSymbol = default, + Optional Marker = default, + Optional LineColor = default, + Optional LineColorScale = default, + Optional LineWidth = default, + Optional LineDash = default, + Optional Line = default, + Optional UseDefaults = default + ) + where AType : IConvertible + where BType : IConvertible + where CType : IConvertible + where SumType : IConvertible + where TextType : IConvertible + => + Plotly.NET.ChartTernary_Scatter.Chart.LineTernary( + A: A.ToOption(), + B: B.ToOption(), + C: C.ToOption(), + Sum: Sum.ToOption(), + ShowMarkers: ShowMarkers.ToOption(), + Name: Name.ToOption(), + ShowLegend: ShowLegend.ToOption(), + Opacity: Opacity.ToOption(), + MultiOpacity: MultiOpacity.ToOption(), + Text: Text.ToOption(), + MultiText: MultiText.ToOption(), + TextPosition: TextPosition.ToOption(), + MultiTextPosition: MultiTextPosition.ToOption(), + MarkerColor: MarkerColor.ToOption(), + MarkerColorScale: MarkerColorScale.ToOption(), + MarkerOutline: MarkerOutline.ToOption(), + MarkerSymbol: MarkerSymbol.ToOption(), + MultiMarkerSymbol: MultiMarkerSymbol.ToOption(), + Marker: Marker.ToOption(), + LineColor: LineColor.ToOption(), + LineColorScale: LineColorScale.ToOption(), + LineWidth: LineWidth.ToOption(), + LineDash: LineDash.ToOption(), + Line: Line.ToOption(), + UseDefaults: UseDefaults.ToOption() + ); +} diff --git a/src/Plotly.NET.CSharp/ChartAPI/ChartTernary/PointTernary.cs b/src/Plotly.NET.CSharp/ChartAPI/ChartTernary/PointTernary.cs new file mode 100644 index 00000000..03464fa8 --- /dev/null +++ b/src/Plotly.NET.CSharp/ChartAPI/ChartTernary/PointTernary.cs @@ -0,0 +1,84 @@ +using System; +using System.Collections.Generic; +using Plotly.NET; +using Plotly.NET.LayoutObjects; +using Plotly.NET.TraceObjects; +using static Plotly.NET.StyleParam; + +namespace Plotly.NET.CSharp; + +public static partial class Chart +{ + /// + /// Creates a point plot on a ternary coordinate system + /// + /// In general, PointTernary creates a barycentric point plot on three variables which sum to a constant, graphically depicting the ratios of the three variables as positions in an equilateral triangle. + /// + /// Sets the quantity of component `a` in each data point. If `a`, `b`, and `c` are all provided, they need not be normalized, only the relative values matter. If only two arrays are provided they must be normalized to match `ternary<i>.sum`. + /// Sets the quantity of component `b` in each data point. If `a`, `b`, and `c` are all provided, they need not be normalized, only the relative values matter. If only two arrays are provided they must be normalized to match `ternary<i>.sum`. + /// Sets the quantity of component `c` in each data point. If `a`, `b`, and `c` are all provided, they need not be normalized, only the relative values matter. If only two arrays are provided they must be normalized to match `ternary<i>.sum`. + /// The number each triplet should sum to, if only two of `a`, `b`, and `c` are provided. This overrides `ternary<i>.sum` to normalize this specific trace, but does not affect the values displayed on the axes. 0 (or missing) means to use `ternary<i>.sum` + /// 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. + /// Sets the opactity of the trace + /// Sets the opactity of individual datum markers + /// Sets a text associated with each datum + /// Sets individual text for each datum + /// Sets the position of text associated with each datum + /// Sets the position of text associated with individual datum + /// Sets the color of the marker + /// Sets the colorscale of the marker + /// Sets the outline of the marker + /// Sets the marker symbol for each datum + /// Sets the marker symbol for each individual datum + /// Sets the marker (use this for more finegrained control than the other marker-associated arguments) + /// If set to false, ignore the global default settings set in `Defaults` + public static GenericChart PointTernary( + Optional> A = default, + Optional> B = default, + Optional> C = default, + Optional Sum = default, + Optional Name = default, + Optional ShowLegend = default, + Optional Opacity = default, + Optional> MultiOpacity = default, + Optional Text = default, + Optional> MultiText = default, + Optional TextPosition = default, + Optional> MultiTextPosition = default, + Optional MarkerColor = default, + Optional MarkerColorScale = default, + Optional MarkerOutline = default, + Optional MarkerSymbol = default, + Optional> MultiMarkerSymbol = default, + Optional Marker = default, + Optional UseDefaults = default + ) + where AType : IConvertible + where BType : IConvertible + where CType : IConvertible + where SumType : IConvertible + where TextType : IConvertible + => + Plotly.NET.ChartTernary_Scatter.Chart.PointTernary( + A: A.ToOption(), + B: B.ToOption(), + C: C.ToOption(), + Sum: Sum.ToOption(), + Name: Name.ToOption(), + ShowLegend: ShowLegend.ToOption(), + Opacity: Opacity.ToOption(), + MultiOpacity: MultiOpacity.ToOption(), + Text: Text.ToOption(), + MultiText: MultiText.ToOption(), + TextPosition: TextPosition.ToOption(), + MultiTextPosition: MultiTextPosition.ToOption(), + MarkerColor: MarkerColor.ToOption(), + MarkerColorScale: MarkerColorScale.ToOption(), + MarkerOutline: MarkerOutline.ToOption(), + MarkerSymbol: MarkerSymbol.ToOption(), + MultiMarkerSymbol: MultiMarkerSymbol.ToOption(), + Marker: Marker.ToOption(), + UseDefaults: UseDefaults.ToOption() + ); +} diff --git a/src/Plotly.NET.CSharp/ChartAPI/ChartTernary/ScatterTernary.cs b/src/Plotly.NET.CSharp/ChartAPI/ChartTernary/ScatterTernary.cs new file mode 100644 index 00000000..f5c27375 --- /dev/null +++ b/src/Plotly.NET.CSharp/ChartAPI/ChartTernary/ScatterTernary.cs @@ -0,0 +1,104 @@ +using System; +using System.Collections.Generic; +using Plotly.NET; +using Plotly.NET.LayoutObjects; +using Plotly.NET.TraceObjects; +using static Plotly.NET.StyleParam; + +namespace Plotly.NET.CSharp; + +public static partial class Chart +{ + /// + /// Creates a Scatter plot on a ternary coordinate system + /// + /// In general, ScatterTernary creates a barycentric plot on three variables which sum to a constant, graphically depicting the ratios of the three variables as positions in an equilateral triangle. + /// + /// ScatterTernary charts are the basis of PointTernary, LineTernary, and BubbleTernary Charts, and can be customized as such. We also provide abstractions for those: Chart.LineTernary, Chart.PointTernary, Chart.BubbleTernary + /// + /// Sets the quantity of component `a` in each data point. If `a`, `b`, and `c` are all provided, they need not be normalized, only the relative values matter. If only two arrays are provided they must be normalized to match `ternary<i>.sum`. + /// Sets the quantity of component `b` in each data point. If `a`, `b`, and `c` are all provided, they need not be normalized, only the relative values matter. If only two arrays are provided they must be normalized to match `ternary<i>.sum`. + /// Sets the quantity of component `c` in each data point. If `a`, `b`, and `c` are all provided, they need not be normalized, only the relative values matter. If only two arrays are provided they must be normalized to match `ternary<i>.sum`. + /// The number each triplet should sum to, if only two of `a`, `b`, and `c` are provided. This overrides `ternary<i>.sum` to normalize this specific trace, but does not affect the values displayed on the axes. 0 (or missing) means to use `ternary<i>.sum` + /// 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. + /// Sets the opactity of the trace + /// Sets the opactity of individual datum markers + /// Sets a text associated with each datum + /// Sets individual text for each datum + /// Sets the position of text associated with each datum + /// Sets the position of text associated with individual datum + /// Sets the color of the marker + /// Sets the colorscale of the marker + /// Sets the outline of the marker + /// Sets the marker symbol for each datum + /// Sets the marker symbol for each individual datum + /// Sets the marker (use this for more finegrained control than the other marker-associated arguments) + /// Sets the color of the line + /// Sets the colorscale of the line + /// Sets the width of the line + /// sets the drawing style of the line + /// Sets the line (use this for more finegrained control than the other line-associated arguments) + /// If set to false, ignore the global default settings set in `Defaults` + public static GenericChart ScatterTernary( + Optional> A = default, + Optional> B = default, + Optional> C = default, + Optional Sum = default, + Optional Mode = default, + Optional Name = default, + Optional ShowLegend = default, + Optional Opacity = default, + Optional> MultiOpacity = default, + Optional Text = default, + Optional> MultiText = default, + Optional TextPosition = default, + Optional> MultiTextPosition = default, + Optional MarkerColor = default, + Optional MarkerColorScale = default, + Optional MarkerOutline = default, + Optional MarkerSymbol = default, + Optional> MultiMarkerSymbol = default, + Optional Marker = default, + Optional LineColor = default, + Optional LineColorScale = default, + Optional LineWidth = default, + Optional LineDash = default, + Optional Line = default, + Optional UseDefaults = default + ) + where AType : IConvertible + where BType : IConvertible + where CType : IConvertible + where SumType : IConvertible + where TextType : IConvertible + => + Plotly.NET.ChartTernary_Scatter.Chart.ScatterTernary( + A: A.ToOption(), + B: B.ToOption(), + C: C.ToOption(), + Sum: Sum.ToOption(), + Mode: Mode.ToOption(), + Name: Name.ToOption(), + ShowLegend: ShowLegend.ToOption(), + Opacity: Opacity.ToOption(), + MultiOpacity: MultiOpacity.ToOption(), + Text: Text.ToOption(), + MultiText: MultiText.ToOption(), + TextPosition: TextPosition.ToOption(), + MultiTextPosition: MultiTextPosition.ToOption(), + MarkerColor: MarkerColor.ToOption(), + MarkerColorScale: MarkerColorScale.ToOption(), + MarkerOutline: MarkerOutline.ToOption(), + MarkerSymbol: MarkerSymbol.ToOption(), + MultiMarkerSymbol: MultiMarkerSymbol.ToOption(), + Marker: Marker.ToOption(), + LineColor: LineColor.ToOption(), + LineColorScale: LineColorScale.ToOption(), + LineWidth: LineWidth.ToOption(), + LineDash: LineDash.ToOption(), + Line: Line.ToOption(), + UseDefaults: UseDefaults.ToOption() + ); +} diff --git a/tests/ConsoleApps/CSharpConsole/Program.cs b/tests/ConsoleApps/CSharpConsole/Program.cs index c363b57e..06db27a9 100644 --- a/tests/ConsoleApps/CSharpConsole/Program.cs +++ b/tests/ConsoleApps/CSharpConsole/Program.cs @@ -1,4 +1,5 @@ using System; +using System.IO; using Plotly.NET.CSharp; using static Plotly.NET.StyleParam; @@ -8,6 +9,26 @@ class Program { static void Main(string[] args) { + Directory.CreateDirectory("temp"); + + var scatter = Chart.Scatter( + x: new[] { 0.0, 1.0, 2.0, 3.0 }, + y: new[] { 1.0, 4.0, 9.0, 16.0 }, + mode: Mode.Lines_Markers, + Name: "scatter", + UseDefaults: false + ); + + var point = Chart.Point( + x: new[] { 0.0, 1.0, 2.0, 3.0 }, + y: new[] { 1.0, 4.0, 9.0, 16.0 }, + Name: "points", + UseDefaults: false + ); + + File.WriteAllText("temp/csharp-scatter.html", Plotly.NET.GenericChart.toChartHTML(scatter)); + File.WriteAllText("temp/csharp-point.html", Plotly.NET.GenericChart.toChartHTML(point)); + //Chart.Grid( // nRows: 10, // nCols: 7, diff --git a/tests/ExtensionLibsTests/CSharpTests/ExtensionMethodsTests.cs b/tests/ExtensionLibsTests/CSharpTests/ExtensionMethodsTests.cs deleted file mode 100644 index 108789a1..00000000 --- a/tests/ExtensionLibsTests/CSharpTests/ExtensionMethodsTests.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System; -using Xunit; -using Plotly.NET.CSharp; -using CSharp.Tests; - -namespace Plotly.NET.CSharp.Tests -{ - public class ExtensionMethodsTests - { - internal GenericChart chart = Chart.Point(x: new double[] { 1, 2 }, y: new double[] { 5, 10 }, UseDefaults: false); - - [Fact] - public void CanUseCSharpExtensionMethod() - { - Trace actual = - chart - .WithTraceInfo(Name: "Trace Name") - .GetTraces() - [0]; - - Assert.Equal("Trace Name", actual.GetPropertyValue("name")); - } - - [Fact] - public void WithLegendLayout() - { - TestUtils.ChartGeneratedContains( - chart.WithLegendStyle( - X: 0.5, - Orientation: Plotly.NET.StyleParam.Orientation.Horizontal, - XAnchor: Plotly.NET.StyleParam.XAnchorPosition.Center, - EntryWidth: 0, - EntryWidthMode: Plotly.NET.StyleParam.EntryWidthMode.Pixels - ), - "var layout = {\"legend\":{\"entrywidth\":0.0,\"entrywidthmode\":\"pixels\",\"orientation\":\"h\",\"x\":0.5,\"xanchor\":\"center\"}};" - ); - } - } -} diff --git a/tests/ExtensionLibsTests/CSharpTests/TestUtils.cs b/tests/ExtensionLibsTests/CSharpTests/TestUtils.cs index 50e31f6f..b0b11413 100644 --- a/tests/ExtensionLibsTests/CSharpTests/TestUtils.cs +++ b/tests/ExtensionLibsTests/CSharpTests/TestUtils.cs @@ -7,10 +7,19 @@ using Newtonsoft.Json; using System.Reflection; using System.IO; +using System.Text.RegularExpressions; using Xunit; namespace CSharp.Tests { + internal enum ChartMarkupSection + { + Data, + Layout, + Config, + PlotlyCall + } + internal class TestUtils { static string GetFullPlotlyJS() @@ -21,6 +30,25 @@ static string GetFullPlotlyJS() return r.ReadToEnd(); } + static string GetSectionPattern(ChartMarkupSection section) => + section switch + { + ChartMarkupSection.Data => @"var data = .*?;", + ChartMarkupSection.Layout => @"var layout = .*?;", + ChartMarkupSection.Config => @"var config = .*?;", + ChartMarkupSection.PlotlyCall => @"Plotly\.newPlot\(.*?\);", + _ => throw new ArgumentOutOfRangeException(nameof(section), section, null) + }; + + static string ExtractChartSection(string html, ChartMarkupSection section) + { + Match match = Regex.Match(html, GetSectionPattern(section), RegexOptions.Singleline); + + Assert.True(match.Success, $"Could not find {section} section in generated chart markup."); + + return match.Value.Trim(); + } + //A method that takes a Generic chart as input, transforms it with a delegate called 'htmlizer' into a string, for which it then should be tested wether another string is contained. internal static void SubstringIsInChart(Plotly.NET.GenericChart chart, Func htmlizer, string expected) { @@ -35,6 +63,15 @@ internal static void ChartGeneratedContains(Plotly.NET.GenericChart chart, strin SubstringIsInChart(chart, Plotly.NET.GenericChart.toEmbeddedHTML, expected); } + internal static void ChartGeneratedSectionEquals(Plotly.NET.GenericChart chart, ChartMarkupSection section, string expected) + { + string actualChartHtml = ExtractChartSection(Plotly.NET.GenericChart.toChartHTML(chart), section); + string actualEmbeddedHtml = ExtractChartSection(Plotly.NET.GenericChart.toEmbeddedHTML(chart), section); + + Assert.Equal(expected, actualChartHtml); + Assert.Equal(expected, actualEmbeddedHtml); + } + //C# version of the following F# code: //let substringListIsInChart chart htmlizer substringList = // for substring in substringList do diff --git a/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart/CombineTests.cs b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart/CombineTests.cs new file mode 100644 index 00000000..a1d29933 --- /dev/null +++ b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart/CombineTests.cs @@ -0,0 +1,38 @@ +using Plotly.NET.CSharp; +using Xunit; + +namespace CSharp.Tests.HtmlCodegen.RootChart; + +public class CombineTests +{ + private const string ExpectedData = """var data = [{"type":"scatter","name":"first","mode":"lines","x":[1.0,2.0,3.0,4.0],"y":[2.0,1.5,5.0,1.5],"marker":{},"line":{}},{"type":"scatter","name":"second","mode":"lines","x":[2.0,1.5,5.0,1.5],"y":[1.0,2.0,3.0,4.0],"marker":{},"line":{}}];"""; + + private static Plotly.NET.GenericChart CreateCombinedChart() => + Chart.Combine( + new[] + { + Chart.Line( + x: new[] { 1.0, 2.0, 3.0, 4.0 }, + y: new[] { 2.0, 1.5, 5.0, 1.5 }, + Name: "first", + UseDefaults: false + ), + Chart.Line( + x: new[] { 2.0, 1.5, 5.0, 1.5 }, + y: new[] { 1.0, 2.0, 3.0, 4.0 }, + Name: "second", + UseDefaults: false + ) + } + ); + + [Fact] + public void CombineDataMatchesExpectedMarkup() + { + TestUtils.ChartGeneratedSectionEquals( + CreateCombinedChart(), + ChartMarkupSection.Data, + ExpectedData + ); + } +} diff --git a/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart/GridTests.cs b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart/GridTests.cs new file mode 100644 index 00000000..61d3d6d1 --- /dev/null +++ b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart/GridTests.cs @@ -0,0 +1,72 @@ +using Plotly.NET.CSharp; +using Xunit; + +namespace CSharp.Tests.HtmlCodegen.RootChart; + +public class GridTests +{ + private const string ExpectedData = """var data = [{"type":"scatter","name":"1,1","mode":"markers","x":[1.0,2.0,3.0,4.0],"y":[2.0,1.5,5.0,1.5],"marker":{},"line":{},"xaxis":"x","yaxis":"y"},{"type":"scatter","name":"1,2","mode":"lines","x":[1.0,2.0,3.0,4.0],"y":[2.0,1.5,5.0,1.5],"marker":{},"line":{},"xaxis":"x2","yaxis":"y2"},{"type":"scatter","name":"2,1","mode":"lines","x":[1.0,2.0,3.0,4.0],"y":[2.0,1.5,5.0,1.5],"marker":{},"line":{"shape":"spline"},"xaxis":"x3","yaxis":"y3"},{"type":"scatter","name":"2,2","mode":"markers","x":[1.0,2.0,3.0,4.0],"y":[2.0,1.5,5.0,1.5],"marker":{},"line":{},"xaxis":"x4","yaxis":"y4"}];"""; + + private const string ExpectedLayout = """var layout = {"yaxis":{"title":{"text":"y1"}},"xaxis":{"title":{"text":"x1"}},"yaxis2":{"title":{"text":"y2"}},"xaxis2":{"title":{"text":"x2"}},"yaxis3":{"title":{"text":"y3"}},"xaxis3":{"title":{"text":"x3"}},"yaxis4":{"title":{"text":"y4"}},"xaxis4":{"title":{"text":"x4"}},"annotations":[],"grid":{"rows":2,"columns":2,"roworder":"top to bottom","pattern":"independent"}};"""; + + private static Plotly.NET.GenericChart CreateGridChart() => + Chart.Grid( + new[] + { + Chart.Point( + x: new[] { 1.0, 2.0, 3.0, 4.0 }, + y: new[] { 2.0, 1.5, 5.0, 1.5 }, + Name: "1,1", + UseDefaults: false + ) + .WithXAxisStyle(TitleText: "x1") + .WithYAxisStyle(TitleText: "y1"), + Chart.Line( + x: new[] { 1.0, 2.0, 3.0, 4.0 }, + y: new[] { 2.0, 1.5, 5.0, 1.5 }, + Name: "1,2", + UseDefaults: false + ) + .WithXAxisStyle(TitleText: "x2") + .WithYAxisStyle(TitleText: "y2"), + Chart.Spline( + x: new[] { 1.0, 2.0, 3.0, 4.0 }, + y: new[] { 2.0, 1.5, 5.0, 1.5 }, + Name: "2,1", + UseDefaults: false + ) + .WithXAxisStyle(TitleText: "x3") + .WithYAxisStyle(TitleText: "y3"), + Chart.Point( + x: new[] { 1.0, 2.0, 3.0, 4.0 }, + y: new[] { 2.0, 1.5, 5.0, 1.5 }, + Name: "2,2", + UseDefaults: false + ) + .WithXAxisStyle(TitleText: "x4") + .WithYAxisStyle(TitleText: "y4") + }, + nRows: 2, + nCols: 2 + ); + + [Fact] + public void GridDataMatchesExpectedMarkup() + { + TestUtils.ChartGeneratedSectionEquals( + CreateGridChart(), + ChartMarkupSection.Data, + ExpectedData + ); + } + + [Fact] + public void GridLayoutMatchesExpectedMarkup() + { + TestUtils.ChartGeneratedSectionEquals( + CreateGridChart(), + ChartMarkupSection.Layout, + ExpectedLayout + ); + } +} diff --git a/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart/InvisibleTests.cs b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart/InvisibleTests.cs new file mode 100644 index 00000000..b58c4c15 --- /dev/null +++ b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart/InvisibleTests.cs @@ -0,0 +1,31 @@ +using Plotly.NET.CSharp; +using Xunit; + +namespace CSharp.Tests.HtmlCodegen.RootChart; + +public class InvisibleTests +{ + private const string ExpectedData = """var data = [{"type":null}];"""; + + private const string ExpectedLayout = """var layout = {"xaxis":{"showticklabels":false,"showline":false,"showgrid":false,"zeroline":false},"yaxis":{"showticklabels":false,"showline":false,"showgrid":false,"zeroline":false}};"""; + + [Fact] + public void InvisibleDataMatchesExpectedMarkup() + { + TestUtils.ChartGeneratedSectionEquals( + Chart.Invisible(), + ChartMarkupSection.Data, + ExpectedData + ); + } + + [Fact] + public void InvisibleLayoutMatchesExpectedMarkup() + { + TestUtils.ChartGeneratedSectionEquals( + Chart.Invisible(), + ChartMarkupSection.Layout, + ExpectedLayout + ); + } +} diff --git a/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart/SingleStackTests.cs b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart/SingleStackTests.cs new file mode 100644 index 00000000..27741eb4 --- /dev/null +++ b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart/SingleStackTests.cs @@ -0,0 +1,60 @@ +using Plotly.NET.CSharp; +using Xunit; + +namespace CSharp.Tests.HtmlCodegen.RootChart; + +public class SingleStackTests +{ + private const string ExpectedData = """var data = [{"type":"scatter","mode":"markers","x":[1.0,2.0,3.0,4.0],"y":[2.0,1.5,5.0,1.5],"marker":{},"line":{},"xaxis":"x","yaxis":"y"},{"type":"scatter","mode":"lines","x":[1.0,2.0,3.0,4.0],"y":[2.0,1.5,5.0,1.5],"marker":{},"line":{},"xaxis":"x","yaxis":"y2"},{"type":"scatter","mode":"lines","x":[1.0,2.0,3.0,4.0],"y":[2.0,1.5,5.0,1.5],"marker":{},"line":{"shape":"spline"},"xaxis":"x","yaxis":"y3"}];"""; + + private const string ExpectedLayout = """var layout = {"xaxis":{"title":{"text":"im the shared xAxis"}},"yaxis":{"title":{"text":"This title must"}},"xaxis2":{},"yaxis2":{"title":{"text":"be set on the"},"zeroline":false},"xaxis3":{},"yaxis3":{"title":{"text":"respective subplots"},"zeroline":false},"annotations":[],"grid":{"rows":3,"columns":1,"roworder":"top to bottom","pattern":"coupled","ygap":0.1,"xside":"bottom"}};"""; + + private static Plotly.NET.GenericChart CreateSingleStackChart() => + Chart.SingleStack( + new[] + { + Chart.Point( + x: new[] { 1.0, 2.0, 3.0, 4.0 }, + y: new[] { 2.0, 1.5, 5.0, 1.5 }, + UseDefaults: false + ) + .WithYAxisStyle(TitleText: "This title must"), + Chart.Line( + x: new[] { 1.0, 2.0, 3.0, 4.0 }, + y: new[] { 2.0, 1.5, 5.0, 1.5 }, + UseDefaults: false + ) + .WithYAxisStyle(TitleText: "be set on the", ZeroLine: false), + Chart.Spline( + x: new[] { 1.0, 2.0, 3.0, 4.0 }, + y: new[] { 2.0, 1.5, 5.0, 1.5 }, + UseDefaults: false + ) + .WithYAxisStyle(TitleText: "respective subplots", ZeroLine: false) + }, + Pattern: Plotly.NET.StyleParam.LayoutGridPattern.Coupled, + XSide: Plotly.NET.StyleParam.LayoutGridXSide.Bottom, + YGap: 0.1 + ) + .WithXAxisStyle(TitleText: "im the shared xAxis"); + + [Fact] + public void SingleStackDataMatchesExpectedMarkup() + { + TestUtils.ChartGeneratedSectionEquals( + CreateSingleStackChart(), + ChartMarkupSection.Data, + ExpectedData + ); + } + + [Fact] + public void SingleStackLayoutMatchesExpectedMarkup() + { + TestUtils.ChartGeneratedSectionEquals( + CreateSingleStackChart(), + ChartMarkupSection.Layout, + ExpectedLayout + ); + } +} diff --git a/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart2D/AnnotatedHeatmapTests.cs b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart2D/AnnotatedHeatmapTests.cs new file mode 100644 index 00000000..83f8a18e --- /dev/null +++ b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart2D/AnnotatedHeatmapTests.cs @@ -0,0 +1,50 @@ +using Plotly.NET.CSharp; +using Xunit; + +namespace CSharp.Tests.HtmlCodegen.Chart2D; + +public class AnnotatedHeatmapTests +{ + private const string ExpectedData = """var data = [{"type":"heatmap","name":"annotatedHeatmap","x":["C1","C2","C3"],"y":["R1","R2"],"z":[[1,2,3],[4,5,6]]}];"""; + + private const string ExpectedLayout = """var layout = {"yaxis":{"autorange":"reversed"},"annotations":[{"x":0,"y":0,"showarrow":false,"text":"1,1"},{"x":1,"y":0,"showarrow":false,"text":"1,2"},{"x":2,"y":0,"showarrow":false,"text":"1,3"},{"x":0,"y":1,"showarrow":false,"text":"2,1"},{"x":1,"y":1,"showarrow":false,"text":"2,2"},{"x":2,"y":1,"showarrow":false,"text":"2,3"}]};"""; + + private static Plotly.NET.GenericChart CreateAnnotatedHeatmapChart() => + Chart.AnnotatedHeatmap( + zData: new[] + { + new[] { 1, 2, 3 }, + new[] { 4, 5, 6 } + }, + annotationText: new[] + { + new[] { "1,1", "1,2", "1,3" }, + new[] { "2,1", "2,2", "2,3" } + }, + X: new[] { "C1", "C2", "C3" }, + Y: new[] { "R1", "R2" }, + Name: "annotatedHeatmap", + ReverseYAxis: true, + UseDefaults: false + ); + + [Fact] + public void AnnotatedHeatmapChartDataMatchesExpectedMarkup() + { + TestUtils.ChartGeneratedSectionEquals( + CreateAnnotatedHeatmapChart(), + ChartMarkupSection.Data, + ExpectedData + ); + } + + [Fact] + public void AnnotatedHeatmapChartLayoutMatchesExpectedMarkup() + { + TestUtils.ChartGeneratedSectionEquals( + CreateAnnotatedHeatmapChart(), + ChartMarkupSection.Layout, + ExpectedLayout + ); + } +} diff --git a/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart2D/AreaTests.cs b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart2D/AreaTests.cs new file mode 100644 index 00000000..58572d6f --- /dev/null +++ b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart2D/AreaTests.cs @@ -0,0 +1,28 @@ +using System.Linq; +using Plotly.NET.CSharp; +using Xunit; + +namespace CSharp.Tests.HtmlCodegen.Chart2D; + +public class AreaTests +{ + private const string ExpectedData = """var data = [{"type":"scatter","name":"area","mode":"lines","x":[0.0,1.0,2.0,3.0],"y":[1.0,4.0,9.0,16.0],"marker":{},"line":{},"fill":"tozeroy","fillpattern":{}}];"""; + + private static Plotly.NET.GenericChart CreateAreaChart() => + Chart.Area( + x: Enumerable.Range(0, 4).Select(x => (double)x).ToArray(), + y: new[] { 1.0, 4.0, 9.0, 16.0 }, + Name: "area", + UseDefaults: false + ); + + [Fact] + public void AreaChartDataMatchesExpectedMarkup() + { + TestUtils.ChartGeneratedSectionEquals( + CreateAreaChart(), + ChartMarkupSection.Data, + ExpectedData + ); + } +} diff --git a/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart2D/BarTests.cs b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart2D/BarTests.cs new file mode 100644 index 00000000..a966e04f --- /dev/null +++ b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart2D/BarTests.cs @@ -0,0 +1,27 @@ +using Plotly.NET.CSharp; +using Xunit; + +namespace CSharp.Tests.HtmlCodegen.Chart2D; + +public class BarTests +{ + private const string ExpectedData = """var data = [{"type":"bar","name":"bar","x":[20,14,23],"y":["Product A","Product B","Product C"],"orientation":"h","marker":{"pattern":{}}}];"""; + + private static Plotly.NET.GenericChart CreateBarChart() => + Chart.Bar( + values: new[] { 20, 14, 23 }, + Keys: new[] { "Product A", "Product B", "Product C" }, + Name: "bar", + UseDefaults: false + ); + + [Fact] + public void BarChartDataMatchesExpectedMarkup() + { + TestUtils.ChartGeneratedSectionEquals( + CreateBarChart(), + ChartMarkupSection.Data, + ExpectedData + ); + } +} diff --git a/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart2D/BoxPlotTests.cs b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart2D/BoxPlotTests.cs new file mode 100644 index 00000000..0150ea34 --- /dev/null +++ b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart2D/BoxPlotTests.cs @@ -0,0 +1,30 @@ +using Plotly.NET.CSharp; +using static Plotly.NET.StyleParam; +using Xunit; + +namespace CSharp.Tests.HtmlCodegen.Chart2D; + +public class BoxPlotTests +{ + private const string ExpectedData = """var data = [{"type":"box","name":"boxplot","x":["bin1","bin1","bin2","bin2"],"y":[2.0,1.5,5.0,3.0],"marker":{},"line":{},"boxpoints":"all","jitter":0.1}];"""; + + private static Plotly.NET.GenericChart CreateBoxPlotChart() => + Chart.BoxPlot( + X: new[] { "bin1", "bin1", "bin2", "bin2" }, + Y: new[] { 2.0, 1.5, 5.0, 3.0 }, + Name: "boxplot", + Jitter: 0.1, + BoxPoints: BoxPoints.All, + UseDefaults: false + ); + + [Fact] + public void BoxPlotChartDataMatchesExpectedMarkup() + { + TestUtils.ChartGeneratedSectionEquals( + CreateBoxPlotChart(), + ChartMarkupSection.Data, + ExpectedData + ); + } +} diff --git a/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart2D/BubbleTests.cs b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart2D/BubbleTests.cs new file mode 100644 index 00000000..57d8b171 --- /dev/null +++ b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart2D/BubbleTests.cs @@ -0,0 +1,29 @@ +using System.Linq; +using Plotly.NET.CSharp; +using Xunit; + +namespace CSharp.Tests.HtmlCodegen.Chart2D; + +public class BubbleTests +{ + private const string ExpectedData = """var data = [{"type":"scatter","name":"bubble","mode":"markers","x":[0.0,1.0,2.0,3.0],"y":[1.0,4.0,9.0,16.0],"marker":{"size":[5,10,15,20]},"line":{}}];"""; + + private static Plotly.NET.GenericChart CreateBubbleChart() => + Chart.Bubble( + x: Enumerable.Range(0, 4).Select(x => (double)x).ToArray(), + y: new[] { 1.0, 4.0, 9.0, 16.0 }, + sizes: new[] { 5, 10, 15, 20 }, + Name: "bubble", + UseDefaults: false + ); + + [Fact] + public void BubbleChartDataMatchesExpectedMarkup() + { + TestUtils.ChartGeneratedSectionEquals( + CreateBubbleChart(), + ChartMarkupSection.Data, + ExpectedData + ); + } +} diff --git a/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart2D/CandlestickTests.cs b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart2D/CandlestickTests.cs new file mode 100644 index 00000000..7d2fec1c --- /dev/null +++ b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart2D/CandlestickTests.cs @@ -0,0 +1,43 @@ +using Plotly.NET.CSharp; +using Xunit; + +namespace CSharp.Tests.HtmlCodegen.Chart2D; + +public class CandlestickTests +{ + private const string ExpectedData = """var data = [{"type":"candlestick","name":"candlestick","x":["2020-01-17T13:40:00","2020-01-17T13:41:00","2020-01-17T13:42:00"],"close":[0.6888,0.68877,0.68886],"open":[0.68888,0.68883,0.68878],"high":[0.68888,0.68884,0.68889],"low":[0.68879,0.68875,0.68878],"increasing":{"line":{}},"decreasing":{"line":{}}}];"""; + + private const string ExpectedLayout = """var layout = {"xaxis":{"rangeslider":{"yaxis":{}}}};"""; + + private static Plotly.NET.GenericChart CreateCandlestickChart() => + Chart.Candlestick( + open: new[] { 0.68888, 0.68883, 0.68878 }, + high: new[] { 0.68888, 0.68884, 0.68889 }, + low: new[] { 0.68879, 0.68875, 0.68878 }, + close: new[] { 0.68880, 0.68877, 0.68886 }, + X: new[] { "2020-01-17T13:40:00", "2020-01-17T13:41:00", "2020-01-17T13:42:00" }, + MultiX: default, + Name: "candlestick", + UseDefaults: false + ); + + [Fact] + public void CandlestickChartDataMatchesExpectedMarkup() + { + TestUtils.ChartGeneratedSectionEquals( + CreateCandlestickChart(), + ChartMarkupSection.Data, + ExpectedData + ); + } + + [Fact] + public void CandlestickChartLayoutMatchesExpectedMarkup() + { + TestUtils.ChartGeneratedSectionEquals( + CreateCandlestickChart(), + ChartMarkupSection.Layout, + ExpectedLayout + ); + } +} diff --git a/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart2D/ColumnTests.cs b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart2D/ColumnTests.cs new file mode 100644 index 00000000..7d42765c --- /dev/null +++ b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart2D/ColumnTests.cs @@ -0,0 +1,27 @@ +using Plotly.NET.CSharp; +using Xunit; + +namespace CSharp.Tests.HtmlCodegen.Chart2D; + +public class ColumnTests +{ + private const string ExpectedData = """var data = [{"type":"bar","name":"column","x":["Product A","Product B","Product C"],"y":[20,14,23],"orientation":"v","marker":{"pattern":{}}}];"""; + + private static Plotly.NET.GenericChart CreateColumnChart() => + Chart.Column( + values: new[] { 20, 14, 23 }, + Keys: new[] { "Product A", "Product B", "Product C" }, + Name: "column", + UseDefaults: false + ); + + [Fact] + public void ColumnChartDataMatchesExpectedMarkup() + { + TestUtils.ChartGeneratedSectionEquals( + CreateColumnChart(), + ChartMarkupSection.Data, + ExpectedData + ); + } +} diff --git a/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart2D/ContourTests.cs b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart2D/ContourTests.cs new file mode 100644 index 00000000..aef34d68 --- /dev/null +++ b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart2D/ContourTests.cs @@ -0,0 +1,32 @@ +using Plotly.NET.CSharp; +using Xunit; + +namespace CSharp.Tests.HtmlCodegen.Chart2D; + +public class ContourTests +{ + private const string ExpectedData = """var data = [{"type":"contour","name":"contour","x":["Tp0","Tp30","Tp60"],"y":["p2","p1"],"z":[[1.0,1.5,0.7],[2.0,0.5,1.2]],"line":{"width":0.0},"contours":{}}];"""; + + private static Plotly.NET.GenericChart CreateContourChart() => + Chart.Contour( + zData: new[] + { + new[] { 1.0, 1.5, 0.7 }, + new[] { 2.0, 0.5, 1.2 } + }, + X: new[] { "Tp0", "Tp30", "Tp60" }, + Y: new[] { "p2", "p1" }, + Name: "contour", + UseDefaults: false + ); + + [Fact] + public void ContourChartDataMatchesExpectedMarkup() + { + TestUtils.ChartGeneratedSectionEquals( + CreateContourChart(), + ChartMarkupSection.Data, + ExpectedData + ); + } +} diff --git a/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart2D/FunnelTests.cs b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart2D/FunnelTests.cs new file mode 100644 index 00000000..4d133515 --- /dev/null +++ b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart2D/FunnelTests.cs @@ -0,0 +1,27 @@ +using Plotly.NET.CSharp; +using Xunit; + +namespace CSharp.Tests.HtmlCodegen.Chart2D; + +public class FunnelTests +{ + private const string ExpectedData = """var data = [{"type":"funnel","name":"funnel","x":[1200.0,909.4,600.6],"y":["Visitors","Leads","Qualified"],"marker":{},"connector":{}}];"""; + + private static Plotly.NET.GenericChart CreateFunnelChart() => + Chart.Funnel( + x: new[] { 1200.0, 909.4, 600.6 }, + y: new[] { "Visitors", "Leads", "Qualified" }, + Name: "funnel", + UseDefaults: false + ); + + [Fact] + public void FunnelChartDataMatchesExpectedMarkup() + { + TestUtils.ChartGeneratedSectionEquals( + CreateFunnelChart(), + ChartMarkupSection.Data, + ExpectedData + ); + } +} diff --git a/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart2D/HeatmapTests.cs b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart2D/HeatmapTests.cs new file mode 100644 index 00000000..aa45148c --- /dev/null +++ b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart2D/HeatmapTests.cs @@ -0,0 +1,32 @@ +using Plotly.NET.CSharp; +using Xunit; + +namespace CSharp.Tests.HtmlCodegen.Chart2D; + +public class HeatmapTests +{ + private const string ExpectedData = """var data = [{"type":"heatmap","name":"heatmap","x":["Tp0","Tp30","Tp60"],"y":["p2","p1"],"z":[[1.0,1.5,0.7],[2.0,0.5,1.2]]}];"""; + + private static Plotly.NET.GenericChart CreateHeatmapChart() => + Chart.Heatmap( + zData: new[] + { + new[] { 1.0, 1.5, 0.7 }, + new[] { 2.0, 0.5, 1.2 } + }, + X: new[] { "Tp0", "Tp30", "Tp60" }, + Y: new[] { "p2", "p1" }, + Name: "heatmap", + UseDefaults: false + ); + + [Fact] + public void HeatmapChartDataMatchesExpectedMarkup() + { + TestUtils.ChartGeneratedSectionEquals( + CreateHeatmapChart(), + ChartMarkupSection.Data, + ExpectedData + ); + } +} diff --git a/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart2D/Histogram2DContourTests.cs b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart2D/Histogram2DContourTests.cs new file mode 100644 index 00000000..fb2f51cf --- /dev/null +++ b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart2D/Histogram2DContourTests.cs @@ -0,0 +1,29 @@ +using Plotly.NET.CSharp; +using Xunit; + +namespace CSharp.Tests.HtmlCodegen.Chart2D; + +public class Histogram2DContourTests +{ + private const string ExpectedData = """var data = [{"type":"histogram2dcontour","name":"histogram2dcontour","x":[1.0,2.0,3.0,4.0],"y":[1.0,2.0,2.0,3.0],"line":{"width":0.0},"contours":{}}];"""; + + private static Plotly.NET.GenericChart CreateHistogram2DContourChart() => + Chart.Histogram2DContour( + X: new[] { 1.0, 2.0, 3.0, 4.0 }, + MultiX: default, + Y: new[] { 1.0, 2.0, 2.0, 3.0 }, + MultiY: default, + Name: "histogram2dcontour", + UseDefaults: false + ); + + [Fact] + public void Histogram2DContourChartDataMatchesExpectedMarkup() + { + TestUtils.ChartGeneratedSectionEquals( + CreateHistogram2DContourChart(), + ChartMarkupSection.Data, + ExpectedData + ); + } +} diff --git a/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart2D/Histogram2DTests.cs b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart2D/Histogram2DTests.cs new file mode 100644 index 00000000..4827e48b --- /dev/null +++ b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart2D/Histogram2DTests.cs @@ -0,0 +1,27 @@ +using Plotly.NET.CSharp; +using Xunit; + +namespace CSharp.Tests.HtmlCodegen.Chart2D; + +public class Histogram2DTests +{ + private const string ExpectedData = """var data = [{"type":"histogram2d","name":"histogram2d","x":[1.0,2.0,3.0,4.0],"y":[1.0,2.0,2.0,3.0]}];"""; + + private static Plotly.NET.GenericChart CreateHistogram2DChart() => + Chart.Histogram2D( + x: new[] { 1.0, 2.0, 3.0, 4.0 }, + y: new[] { 1.0, 2.0, 2.0, 3.0 }, + Name: "histogram2d", + UseDefaults: false + ); + + [Fact] + public void Histogram2DChartDataMatchesExpectedMarkup() + { + TestUtils.ChartGeneratedSectionEquals( + CreateHistogram2DChart(), + ChartMarkupSection.Data, + ExpectedData + ); + } +} diff --git a/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart2D/HistogramTests.cs b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart2D/HistogramTests.cs new file mode 100644 index 00000000..66cd378d --- /dev/null +++ b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart2D/HistogramTests.cs @@ -0,0 +1,26 @@ +using Plotly.NET.CSharp; +using Xunit; + +namespace CSharp.Tests.HtmlCodegen.Chart2D; + +public class HistogramTests +{ + private const string ExpectedData = """var data = [{"type":"histogram","name":"histogram","x":[1.0,1.5,2.0,2.5],"marker":{"pattern":{}}}];"""; + + private static Plotly.NET.GenericChart CreateHistogramChart() => + Chart.Histogram( + X: new[] { 1.0, 1.5, 2.0, 2.5 }, + Name: "histogram", + UseDefaults: false + ); + + [Fact] + public void HistogramChartDataMatchesExpectedMarkup() + { + TestUtils.ChartGeneratedSectionEquals( + CreateHistogramChart(), + ChartMarkupSection.Data, + ExpectedData + ); + } +} diff --git a/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart2D/ImageTests.cs b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart2D/ImageTests.cs new file mode 100644 index 00000000..057cdf0a --- /dev/null +++ b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart2D/ImageTests.cs @@ -0,0 +1,38 @@ +using Plotly.NET.CSharp; +using Xunit; + +namespace CSharp.Tests.HtmlCodegen.Chart2D; + +public class ImageTests +{ + private const string ExpectedData = """var data = [{"type":"image","name":"image","z":[[[0,0,255],[255,255,0]],[[255,0,0],[255,0,255]]]}];"""; + + private static Plotly.NET.GenericChart CreateImageChart() => + Chart.Image( + Z: new[] + { + new[] + { + new[] { 0, 0, 255 }, + new[] { 255, 255, 0 } + }, + new[] + { + new[] { 255, 0, 0 }, + new[] { 255, 0, 255 } + } + }, + Name: "image", + UseDefaults: false + ); + + [Fact] + public void ImageChartDataMatchesExpectedMarkup() + { + TestUtils.ChartGeneratedSectionEquals( + CreateImageChart(), + ChartMarkupSection.Data, + ExpectedData + ); + } +} diff --git a/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart2D/LineTests.cs b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart2D/LineTests.cs new file mode 100644 index 00000000..63e57520 --- /dev/null +++ b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart2D/LineTests.cs @@ -0,0 +1,28 @@ +using System.Linq; +using Plotly.NET.CSharp; +using Xunit; + +namespace CSharp.Tests.HtmlCodegen.Chart2D; + +public class LineTests +{ + private const string ExpectedData = """var data = [{"type":"scatter","name":"line","mode":"lines","x":[0.0,1.0,2.0,3.0],"y":[1.0,4.0,9.0,16.0],"marker":{},"line":{}}];"""; + + private static Plotly.NET.GenericChart CreateLineChart() => + Chart.Line( + x: Enumerable.Range(0, 4).Select(x => (double)x).ToArray(), + y: new[] { 1.0, 4.0, 9.0, 16.0 }, + Name: "line", + UseDefaults: false + ); + + [Fact] + public void LineChartDataMatchesExpectedMarkup() + { + TestUtils.ChartGeneratedSectionEquals( + CreateLineChart(), + ChartMarkupSection.Data, + ExpectedData + ); + } +} diff --git a/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart2D/OHLCTests.cs b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart2D/OHLCTests.cs new file mode 100644 index 00000000..73a98707 --- /dev/null +++ b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart2D/OHLCTests.cs @@ -0,0 +1,43 @@ +using Plotly.NET.CSharp; +using Xunit; + +namespace CSharp.Tests.HtmlCodegen.Chart2D; + +public class OHLCTests +{ + private const string ExpectedData = """var data = [{"type":"ohlc","name":"ohlc","x":["2020-01-17T13:40:00","2020-01-17T13:41:00","2020-01-17T13:42:00"],"close":[0.6888,0.68877,0.68886],"open":[0.68888,0.68883,0.68878],"high":[0.68888,0.68884,0.68889],"low":[0.68879,0.68875,0.68878],"increasing":{"line":{}},"decreasing":{"line":{}}}];"""; + + private const string ExpectedLayout = """var layout = {"xaxis":{"rangeslider":{"yaxis":{}}}};"""; + + private static Plotly.NET.GenericChart CreateOHLCChart() => + Chart.OHLC( + open: new[] { 0.68888, 0.68883, 0.68878 }, + high: new[] { 0.68888, 0.68884, 0.68889 }, + low: new[] { 0.68879, 0.68875, 0.68878 }, + close: new[] { 0.68880, 0.68877, 0.68886 }, + X: new[] { "2020-01-17T13:40:00", "2020-01-17T13:41:00", "2020-01-17T13:42:00" }, + MultiX: default, + Name: "ohlc", + UseDefaults: false + ); + + [Fact] + public void OHLCChartDataMatchesExpectedMarkup() + { + TestUtils.ChartGeneratedSectionEquals( + CreateOHLCChart(), + ChartMarkupSection.Data, + ExpectedData + ); + } + + [Fact] + public void OHLCChartLayoutMatchesExpectedMarkup() + { + TestUtils.ChartGeneratedSectionEquals( + CreateOHLCChart(), + ChartMarkupSection.Layout, + ExpectedLayout + ); + } +} diff --git a/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart2D/ParetoTests.cs b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart2D/ParetoTests.cs new file mode 100644 index 00000000..992ec8bc --- /dev/null +++ b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart2D/ParetoTests.cs @@ -0,0 +1,48 @@ +using Plotly.NET.CSharp; +using Xunit; + +namespace CSharp.Tests.HtmlCodegen.Chart2D; + +public class ParetoTests +{ + private const string ExpectedKeysValuesData = """var data = [{"type":"bar","name":"pareto-kv","x":["b","a","c"],"y":[7.0,3.0,2.0],"orientation":"v","marker":{"pattern":{}}},{"type":"scatter","name":"Cumulative %","showlegend":true,"mode":"lines+markers","x":["b","a","c"],"y":[58.333333333333336,83.33333333333334,100.0],"marker":{"angle":45.0,"size":8,"symbol":"3"},"line":{},"yaxis":"y2"}];"""; + + private const string ExpectedLabelsValuesData = """var data = [{"type":"bar","name":"pareto-lv","x":["b","a","c"],"y":[7.0,3.0,2.0],"orientation":"v","marker":{"pattern":{}}},{"type":"scatter","name":"Cumulative %","showlegend":true,"mode":"lines+markers","x":["b","a","c"],"y":[58.333333333333336,83.33333333333334,100.0],"marker":{"angle":45.0,"size":8,"symbol":"3"},"line":{},"yaxis":"y2"}];"""; + + private static Plotly.NET.GenericChart CreateParetoChartFromKeysValues() => + Chart.Pareto( + keysValues: new[] { ("a", 3.0), ("b", 7.0), ("c", 2.0) }, + Name: "pareto-kv", + Label: default, + ShowGrid: default + ); + + private static Plotly.NET.GenericChart CreateParetoChartFromLabelsValues() => + Chart.Pareto( + labels: new[] { "a", "b", "c" }, + values: new[] { 3.0, 7.0, 2.0 }, + Name: "pareto-lv", + Label: default, + ShowGrid: default + ); + + [Fact] + public void ParetoKeysValuesChartDataMatchesExpectedMarkup() + { + TestUtils.ChartGeneratedSectionEquals( + CreateParetoChartFromKeysValues(), + ChartMarkupSection.Data, + ExpectedKeysValuesData + ); + } + + [Fact] + public void ParetoLabelsValuesChartDataMatchesExpectedMarkup() + { + TestUtils.ChartGeneratedSectionEquals( + CreateParetoChartFromLabelsValues(), + ChartMarkupSection.Data, + ExpectedLabelsValuesData + ); + } +} diff --git a/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart2D/PointDensityTests.cs b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart2D/PointDensityTests.cs new file mode 100644 index 00000000..08f261ef --- /dev/null +++ b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart2D/PointDensityTests.cs @@ -0,0 +1,26 @@ +using Plotly.NET.CSharp; +using Xunit; + +namespace CSharp.Tests.HtmlCodegen.Chart2D; + +public class PointDensityTests +{ + private const string ExpectedData = """var data = [{"type":"histogram2dcontour","x":[1.0,2.0,3.0,4.0],"y":[1.0,1.5,2.5,3.0],"line":{"width":0.0},"contours":{"coloring":"fill"}},{"type":"scatter","opacity":0.3,"mode":"markers","x":[1.0,2.0,3.0,4.0],"y":[1.0,1.5,2.5,3.0],"marker":{}}];"""; + + private static Plotly.NET.GenericChart CreatePointDensityChart() => + Chart.PointDensity( + x: new[] { 1.0, 2.0, 3.0, 4.0 }, + y: new[] { 1.0, 1.5, 2.5, 3.0 }, + UseDefaults: false + ); + + [Fact] + public void PointDensityChartDataMatchesExpectedMarkup() + { + TestUtils.ChartGeneratedSectionEquals( + CreatePointDensityChart(), + ChartMarkupSection.Data, + ExpectedData + ); + } +} diff --git a/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart2D/PointTests.cs b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart2D/PointTests.cs new file mode 100644 index 00000000..292871c5 --- /dev/null +++ b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart2D/PointTests.cs @@ -0,0 +1,28 @@ +using System.Linq; +using Plotly.NET.CSharp; +using Xunit; + +namespace CSharp.Tests.HtmlCodegen.Chart2D; + +public class PointTests +{ + private const string ExpectedData = """var data = [{"type":"scatter","name":"points","mode":"markers","x":[0.0,1.0,2.0,3.0],"y":[1.0,4.0,9.0,16.0],"marker":{},"line":{}}];"""; + + private static Plotly.NET.GenericChart CreatePointChart() => + Chart.Point( + x: Enumerable.Range(0, 4).Select(x => (double)x).ToArray(), + y: new[] { 1.0, 4.0, 9.0, 16.0 }, + Name: "points", + UseDefaults: false + ); + + [Fact] + public void PointChartDataMatchesExpectedMarkup() + { + TestUtils.ChartGeneratedSectionEquals( + CreatePointChart(), + ChartMarkupSection.Data, + ExpectedData + ); + } +} diff --git a/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart2D/RangeTests.cs b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart2D/RangeTests.cs new file mode 100644 index 00000000..f2378db9 --- /dev/null +++ b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart2D/RangeTests.cs @@ -0,0 +1,31 @@ +using System.Linq; +using Plotly.NET.CSharp; +using Xunit; + +namespace CSharp.Tests.HtmlCodegen.Chart2D; + +public class RangeTests +{ + private const string ExpectedData = """var data = [{"type":"scatter","name":"lower","showlegend":true,"legendgroup":"Range","mode":"lines+markers","x":[0.0,1.0,2.0,3.0],"y":[0.0,3.0,8.0,15.0],"marker":{"color":"rgba(0,0,0,0.5)"}},{"type":"scatter","name":"upper","showlegend":true,"legendgroup":"Range","mode":"lines+markers","x":[0.0,1.0,2.0,3.0],"y":[2.0,5.0,10.0,17.0],"fill":"tonexty","marker":{"color":"rgba(0,0,0,0.5)"}},{"type":"scatter","name":"range","mode":"lines+markers","x":[0.0,1.0,2.0,3.0],"y":[1.0,4.0,9.0,16.0],"marker":{},"line":{},"legendgroup":"Range","legendgrouptitle":{"text":"Range"}}];"""; + + private static Plotly.NET.GenericChart CreateRangeChart() => + Chart.Range( + x: Enumerable.Range(0, 4).Select(x => (double)x).ToArray(), + y: new[] { 1.0, 4.0, 9.0, 16.0 }, + upper: new[] { 2.0, 5.0, 10.0, 17.0 }, + lower: new[] { 0.0, 3.0, 8.0, 15.0 }, + mode: Plotly.NET.StyleParam.Mode.Lines_Markers, + Name: "range", + UseDefaults: false + ); + + [Fact] + public void RangeChartDataMatchesExpectedMarkup() + { + TestUtils.ChartGeneratedSectionEquals( + CreateRangeChart(), + ChartMarkupSection.Data, + ExpectedData + ); + } +} diff --git a/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart2D/ScatterTests.cs b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart2D/ScatterTests.cs new file mode 100644 index 00000000..de2a1dc6 --- /dev/null +++ b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart2D/ScatterTests.cs @@ -0,0 +1,29 @@ +using System.Linq; +using Plotly.NET.CSharp; +using Xunit; + +namespace CSharp.Tests.HtmlCodegen.Chart2D; + +public class ScatterTests +{ + private const string ExpectedData = """var data = [{"type":"scatter","name":"scatter","mode":"lines+markers","x":[0.0,1.0,2.0,3.0],"y":[1.0,4.0,9.0,16.0],"marker":{},"line":{}}];"""; + + private static Plotly.NET.GenericChart CreateScatterChart() => + Chart.Scatter( + x: Enumerable.Range(0, 4).Select(x => (double)x).ToArray(), + y: new[] { 1.0, 4.0, 9.0, 16.0 }, + mode: Plotly.NET.StyleParam.Mode.Lines_Markers, + Name: "scatter", + UseDefaults: false + ); + + [Fact] + public void ScatterChartDataMatchesExpectedMarkup() + { + TestUtils.ChartGeneratedSectionEquals( + CreateScatterChart(), + ChartMarkupSection.Data, + ExpectedData + ); + } +} diff --git a/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/SimpleTests.cs b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart2D/SimpleTests.cs similarity index 76% rename from tests/ExtensionLibsTests/CSharpTests/htmlcodegen/SimpleTests.cs rename to tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart2D/SimpleTests.cs index 3a343c34..dc4f0e99 100644 --- a/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/SimpleTests.cs +++ b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart2D/SimpleTests.cs @@ -1,17 +1,17 @@ using System; -using System.Collections.Generic; using System.Linq; -using System.Text; -using System.Threading.Tasks; using Xunit; -using Xunit.Sdk; using Plotly.NET.CSharp; // avoid the namespace 'Plotly.NET', as we dont want to accidentally use F# type extensions instead of real C# bindings -namespace CSharp.Tests.HtmlCodegen +namespace CSharp.Tests.HtmlCodegen.Chart2D { public class SimpleTests { + private const string ExpectedData = """var data = [{"type":"scatter","mode":"markers","x":[0.0,1.0,2.0,3.0,4.0,5.0,6.0,7.0,8.0,9.0,10.0],"y":[0.0,1.0,2.0,3.0,4.0,5.0,6.0,7.0,8.0,9.0,10.0],"marker":{},"line":{}}];"""; + + private const string ExpectedLayout = """var layout = {"xaxis":{"title":{"text":"xAxis"}},"yaxis":{"title":{"text":"yAxis"}}};"""; + static Plotly.NET.GenericChart simpleChart = Chart.Point( x: Enumerable.Range(0, 11).Select(x => Convert.ToDouble(x)).ToArray(), @@ -36,18 +36,20 @@ public void PlotlyJsScriptInGeneratedHTMLDocument() [Fact] public void ExpectingData() { - TestUtils.ChartGeneratedContains( - simpleChart, - "var data = [{\"type\":\"scatter\",\"mode\":\"markers\",\"x\":[0.0,1.0,2.0,3.0,4.0,5.0,6.0,7.0,8.0,9.0,10.0],\"y\":[0.0,1.0,2.0,3.0,4.0,5.0,6.0,7.0,8.0,9.0,10.0],\"marker\":{},\"line\":{}}];" + TestUtils.ChartGeneratedSectionEquals( + simpleChart, + ChartMarkupSection.Data, + ExpectedData ); } [Fact] public void ExpectingLayoutInfo() { - TestUtils.ChartGeneratedContains( - simpleChart, - "var layout = {\"xaxis\":{\"title\":{\"text\":\"xAxis\"}},\"yaxis\":{\"title\":{\"text\":\"yAxis\"}}};" + TestUtils.ChartGeneratedSectionEquals( + simpleChart, + ChartMarkupSection.Layout, + ExpectedLayout ); } diff --git a/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart2D/SplineAreaTests.cs b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart2D/SplineAreaTests.cs new file mode 100644 index 00000000..16423d36 --- /dev/null +++ b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart2D/SplineAreaTests.cs @@ -0,0 +1,28 @@ +using System.Linq; +using Plotly.NET.CSharp; +using Xunit; + +namespace CSharp.Tests.HtmlCodegen.Chart2D; + +public class SplineAreaTests +{ + private const string ExpectedData = """var data = [{"type":"scatter","name":"splineArea","mode":"lines","x":[0.0,1.0,2.0,3.0],"y":[1.0,4.0,9.0,16.0],"marker":{},"line":{"shape":"spline"},"fill":"tozeroy","fillpattern":{}}];"""; + + private static Plotly.NET.GenericChart CreateSplineAreaChart() => + Chart.SplineArea( + x: Enumerable.Range(0, 4).Select(x => (double)x).ToArray(), + y: new[] { 1.0, 4.0, 9.0, 16.0 }, + Name: "splineArea", + UseDefaults: false + ); + + [Fact] + public void SplineAreaChartDataMatchesExpectedMarkup() + { + TestUtils.ChartGeneratedSectionEquals( + CreateSplineAreaChart(), + ChartMarkupSection.Data, + ExpectedData + ); + } +} diff --git a/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart2D/SplineTests.cs b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart2D/SplineTests.cs new file mode 100644 index 00000000..914d8496 --- /dev/null +++ b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart2D/SplineTests.cs @@ -0,0 +1,28 @@ +using System.Linq; +using Plotly.NET.CSharp; +using Xunit; + +namespace CSharp.Tests.HtmlCodegen.Chart2D; + +public class SplineTests +{ + private const string ExpectedData = """var data = [{"type":"scatter","name":"spline","mode":"lines","x":[0.0,1.0,2.0,3.0],"y":[1.0,4.0,9.0,16.0],"marker":{},"line":{"shape":"spline"}}];"""; + + private static Plotly.NET.GenericChart CreateSplineChart() => + Chart.Spline( + x: Enumerable.Range(0, 4).Select(x => (double)x).ToArray(), + y: new[] { 1.0, 4.0, 9.0, 16.0 }, + Name: "spline", + UseDefaults: false + ); + + [Fact] + public void SplineChartDataMatchesExpectedMarkup() + { + TestUtils.ChartGeneratedSectionEquals( + CreateSplineChart(), + ChartMarkupSection.Data, + ExpectedData + ); + } +} diff --git a/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart2D/SplomTests.cs b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart2D/SplomTests.cs new file mode 100644 index 00000000..6165b66c --- /dev/null +++ b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart2D/SplomTests.cs @@ -0,0 +1,59 @@ +using Plotly.NET.CSharp; +using Plotly.NET.TraceObjects; +using Xunit; + +namespace CSharp.Tests.HtmlCodegen.Chart2D; + +public class SplomTests +{ + private const string ExpectedData = """var data = [{"type":"splom","name":"splom","dimensions":[{"label":"A","values":[1.0,4.0,3.4,0.7],"axis":{}},{"label":"B","values":[3.0,1.5,1.7,2.3],"axis":{}},{"label":"C","values":[2.0,4.0,3.1,5.0],"axis":{}}],"marker":{},"diagonal":{}}];"""; + + private static Plotly.NET.GenericChart CreateSplomChart() => + Chart.Splom( + dimensions: new Dimension[] + { + Dimension.initSplom( + AxisMatches: default, + AxisType: default, + Label: "A", + Name: default, + TemplateItemName: default, + Values: new[] { 1.0, 4.0, 3.4, 0.7 }, + ValuesEncoded: default, + Visible: default + ), + Dimension.initSplom( + AxisMatches: default, + AxisType: default, + Label: "B", + Name: default, + TemplateItemName: default, + Values: new[] { 3.0, 1.5, 1.7, 2.3 }, + ValuesEncoded: default, + Visible: default + ), + Dimension.initSplom( + AxisMatches: default, + AxisType: default, + Label: "C", + Name: default, + TemplateItemName: default, + Values: new[] { 2.0, 4.0, 3.1, 5.0 }, + ValuesEncoded: default, + Visible: default + ) + }, + Name: "splom", + UseDefaults: false + ); + + [Fact] + public void SplomChartDataMatchesExpectedMarkup() + { + TestUtils.ChartGeneratedSectionEquals( + CreateSplomChart(), + ChartMarkupSection.Data, + ExpectedData + ); + } +} diff --git a/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart2D/StackedAreaTests.cs b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart2D/StackedAreaTests.cs new file mode 100644 index 00000000..d881b950 --- /dev/null +++ b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart2D/StackedAreaTests.cs @@ -0,0 +1,28 @@ +using System.Linq; +using Plotly.NET.CSharp; +using Xunit; + +namespace CSharp.Tests.HtmlCodegen.Chart2D; + +public class StackedAreaTests +{ + private const string ExpectedData = """var data = [{"type":"scatter","name":"stackedArea","mode":"lines","x":[0.0,1.0,2.0,3.0],"y":[1.0,4.0,9.0,16.0],"stackgroup":"stackedarea","marker":{},"line":{},"fill":"tonexty","fillpattern":{}}];"""; + + private static Plotly.NET.GenericChart CreateStackedAreaChart() => + Chart.StackedArea( + x: Enumerable.Range(0, 4).Select(x => (double)x).ToArray(), + y: new[] { 1.0, 4.0, 9.0, 16.0 }, + Name: "stackedArea", + UseDefaults: false + ); + + [Fact] + public void StackedAreaChartDataMatchesExpectedMarkup() + { + TestUtils.ChartGeneratedSectionEquals( + CreateStackedAreaChart(), + ChartMarkupSection.Data, + ExpectedData + ); + } +} diff --git a/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart2D/StackedBarTests.cs b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart2D/StackedBarTests.cs new file mode 100644 index 00000000..bf19b762 --- /dev/null +++ b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart2D/StackedBarTests.cs @@ -0,0 +1,50 @@ +using Plotly.NET.CSharp; +using Xunit; + +namespace CSharp.Tests.HtmlCodegen.Chart2D; + +public class StackedBarTests +{ + private const string ExpectedData = """var data = [{"type":"bar","name":"old","x":[20,14,23],"y":["Product A","Product B","Product C"],"orientation":"h","marker":{"pattern":{}}},{"type":"bar","name":"new","x":[8,21,13],"y":["Product A","Product B","Product C"],"orientation":"h","marker":{"pattern":{}}}];"""; + + private const string ExpectedLayout = """var layout = {"barmode":"stack"};"""; + + private static Plotly.NET.GenericChart CreateStackedBarChart() => + Chart.Combine( + new[] + { + Chart.StackedBar( + values: new[] { 20, 14, 23 }, + Keys: new[] { "Product A", "Product B", "Product C" }, + Name: "old", + UseDefaults: false + ), + Chart.StackedBar( + values: new[] { 8, 21, 13 }, + Keys: new[] { "Product A", "Product B", "Product C" }, + Name: "new", + UseDefaults: false + ) + } + ); + + [Fact] + public void StackedBarChartDataMatchesExpectedMarkup() + { + TestUtils.ChartGeneratedSectionEquals( + CreateStackedBarChart(), + ChartMarkupSection.Data, + ExpectedData + ); + } + + [Fact] + public void StackedBarChartLayoutMatchesExpectedMarkup() + { + TestUtils.ChartGeneratedSectionEquals( + CreateStackedBarChart(), + ChartMarkupSection.Layout, + ExpectedLayout + ); + } +} diff --git a/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart2D/StackedColumnTests.cs b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart2D/StackedColumnTests.cs new file mode 100644 index 00000000..47a97cda --- /dev/null +++ b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart2D/StackedColumnTests.cs @@ -0,0 +1,50 @@ +using Plotly.NET.CSharp; +using Xunit; + +namespace CSharp.Tests.HtmlCodegen.Chart2D; + +public class StackedColumnTests +{ + private const string ExpectedData = """var data = [{"type":"bar","name":"old","x":["Product A","Product B","Product C"],"y":[20,14,23],"orientation":"v","marker":{"pattern":{}}},{"type":"bar","name":"new","x":["Product A","Product B","Product C"],"y":[8,21,13],"orientation":"v","marker":{"pattern":{}}}];"""; + + private const string ExpectedLayout = """var layout = {"barmode":"stack"};"""; + + private static Plotly.NET.GenericChart CreateStackedColumnChart() => + Chart.Combine( + new[] + { + Chart.StackedColumn( + values: new[] { 20, 14, 23 }, + Keys: new[] { "Product A", "Product B", "Product C" }, + Name: "old", + UseDefaults: false + ), + Chart.StackedColumn( + values: new[] { 8, 21, 13 }, + Keys: new[] { "Product A", "Product B", "Product C" }, + Name: "new", + UseDefaults: false + ) + } + ); + + [Fact] + public void StackedColumnChartDataMatchesExpectedMarkup() + { + TestUtils.ChartGeneratedSectionEquals( + CreateStackedColumnChart(), + ChartMarkupSection.Data, + ExpectedData + ); + } + + [Fact] + public void StackedColumnChartLayoutMatchesExpectedMarkup() + { + TestUtils.ChartGeneratedSectionEquals( + CreateStackedColumnChart(), + ChartMarkupSection.Layout, + ExpectedLayout + ); + } +} diff --git a/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart2D/StackedFunnelTests.cs b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart2D/StackedFunnelTests.cs new file mode 100644 index 00000000..251df01c --- /dev/null +++ b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart2D/StackedFunnelTests.cs @@ -0,0 +1,50 @@ +using Plotly.NET.CSharp; +using Xunit; + +namespace CSharp.Tests.HtmlCodegen.Chart2D; + +public class StackedFunnelTests +{ + private const string ExpectedData = """var data = [{"type":"funnel","name":"old","x":[1200.0,909.4,600.6],"y":["Visitors","Leads","Qualified"],"marker":{},"connector":{}},{"type":"funnel","name":"new","x":[800.0,600.0,400.0],"y":["Visitors","Leads","Qualified"],"marker":{},"connector":{}}];"""; + + private const string ExpectedLayout = """var layout = {"funnelmode":"stack"};"""; + + private static Plotly.NET.GenericChart CreateStackedFunnelChart() => + Chart.Combine( + new[] + { + Chart.StackedFunnel( + x: new[] { 1200.0, 909.4, 600.6 }, + y: new[] { "Visitors", "Leads", "Qualified" }, + Name: "old", + UseDefaults: false + ), + Chart.StackedFunnel( + x: new[] { 800.0, 600.0, 400.0 }, + y: new[] { "Visitors", "Leads", "Qualified" }, + Name: "new", + UseDefaults: false + ) + } + ); + + [Fact] + public void StackedFunnelChartDataMatchesExpectedMarkup() + { + TestUtils.ChartGeneratedSectionEquals( + CreateStackedFunnelChart(), + ChartMarkupSection.Data, + ExpectedData + ); + } + + [Fact] + public void StackedFunnelChartLayoutMatchesExpectedMarkup() + { + TestUtils.ChartGeneratedSectionEquals( + CreateStackedFunnelChart(), + ChartMarkupSection.Layout, + ExpectedLayout + ); + } +} diff --git a/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart2D/ViolinTests.cs b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart2D/ViolinTests.cs new file mode 100644 index 00000000..285bb080 --- /dev/null +++ b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart2D/ViolinTests.cs @@ -0,0 +1,29 @@ +using Plotly.NET.CSharp; +using static Plotly.NET.StyleParam; +using Xunit; + +namespace CSharp.Tests.HtmlCodegen.Chart2D; + +public class ViolinTests +{ + private const string ExpectedData = """var data = [{"type":"violin","name":"violin","x":["bin1","bin1","bin2","bin2"],"y":[2.0,1.5,5.0,3.0],"marker":{},"line":{},"box":{},"points":"all"}];"""; + + private static Plotly.NET.GenericChart CreateViolinChart() => + Chart.Violin( + X: new[] { "bin1", "bin1", "bin2", "bin2" }, + Y: new[] { 2.0, 1.5, 5.0, 3.0 }, + Name: "violin", + Points: BoxPoints.All, + UseDefaults: false + ); + + [Fact] + public void ViolinChartDataMatchesExpectedMarkup() + { + TestUtils.ChartGeneratedSectionEquals( + CreateViolinChart(), + ChartMarkupSection.Data, + ExpectedData + ); + } +} diff --git a/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart2D/WaterfallTests.cs b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart2D/WaterfallTests.cs new file mode 100644 index 00000000..47ca4841 --- /dev/null +++ b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart2D/WaterfallTests.cs @@ -0,0 +1,29 @@ +using Plotly.NET.CSharp; +using static Plotly.NET.StyleParam; +using Xunit; + +namespace CSharp.Tests.HtmlCodegen.Chart2D; + +public class WaterfallTests +{ + private const string ExpectedData = """var data = [{"type":"waterfall","name":"waterfall","x":["Sales","Consulting","Net revenue"],"y":[60.0,80.0,0.0],"measure":["relative","relative","total"],"increasing":{"line":{}},"decreasing":{"line":{}},"totals":{"line":{}}}];"""; + + private static Plotly.NET.GenericChart CreateWaterfallChart() => + Chart.Waterfall( + x: new[] { "Sales", "Consulting", "Net revenue" }, + y: new[] { 60.0, 80.0, 0.0 }, + Name: "waterfall", + Measure: new[] { WaterfallMeasure.Relative, WaterfallMeasure.Relative, WaterfallMeasure.Total }, + UseDefaults: false + ); + + [Fact] + public void WaterfallChartDataMatchesExpectedMarkup() + { + TestUtils.ChartGeneratedSectionEquals( + CreateWaterfallChart(), + ChartMarkupSection.Data, + ExpectedData + ); + } +} diff --git a/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart3D/Bubble3DTests.cs b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart3D/Bubble3DTests.cs new file mode 100644 index 00000000..6b3884d4 --- /dev/null +++ b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart3D/Bubble3DTests.cs @@ -0,0 +1,31 @@ +using Plotly.NET.CSharp; +using Xunit; + +namespace CSharp.Tests.HtmlCodegen.Chart3D; + +public class Bubble3DTests +{ + private const string ExpectedData = """var data = [{"type":"scatter3d","name":"bubble3d","mode":"markers+text","x":[1,2,3],"y":[4,5,6],"z":[7,8,9],"text":["A","B","C"],"textposition":"top left","marker":{"size":[10,20,30]}}];"""; + + private static Plotly.NET.GenericChart CreateBubble3DChart() => + Chart.Bubble3D( + x: new[] { 1, 2, 3 }, + y: new[] { 4, 5, 6 }, + z: new[] { 7, 8, 9 }, + sizes: new[] { 10, 20, 30 }, + Name: "bubble3d", + MultiText: new[] { "A", "B", "C" }, + TextPosition: Plotly.NET.StyleParam.TextPosition.TopLeft, + UseDefaults: false + ); + + [Fact] + public void Bubble3DChartDataMatchesExpectedMarkup() + { + TestUtils.ChartGeneratedSectionEquals( + CreateBubble3DChart(), + ChartMarkupSection.Data, + ExpectedData + ); + } +} diff --git a/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart3D/ConeTests.cs b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart3D/ConeTests.cs new file mode 100644 index 00000000..07ceddee --- /dev/null +++ b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart3D/ConeTests.cs @@ -0,0 +1,31 @@ +using Plotly.NET.CSharp; +using Xunit; + +namespace CSharp.Tests.HtmlCodegen.Chart3D; + +public class ConeTests +{ + private const string ExpectedData = """var data = [{"type":"cone","x":[1,1,1],"y":[1,2,3],"z":[1,1,1],"u":[1,2,3],"v":[1,1,2],"w":[4,4,1],"colorscale":"Viridis"}];"""; + + private static Plotly.NET.GenericChart CreateConeChart() => + Chart.Cone( + x: new[] { 1, 1, 1 }, + y: new[] { 1, 2, 3 }, + z: new[] { 1, 1, 1 }, + u: new[] { 1, 2, 3 }, + v: new[] { 1, 1, 2 }, + w: new[] { 4, 4, 1 }, + ColorScale: Plotly.NET.StyleParam.Colorscale.Viridis, + UseDefaults: false + ); + + [Fact] + public void ConeChartDataMatchesExpectedMarkup() + { + TestUtils.ChartGeneratedSectionEquals( + CreateConeChart(), + ChartMarkupSection.Data, + ExpectedData + ); + } +} diff --git a/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart3D/IsoSurfaceTests.cs b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart3D/IsoSurfaceTests.cs new file mode 100644 index 00000000..6d15b2d4 --- /dev/null +++ b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart3D/IsoSurfaceTests.cs @@ -0,0 +1,29 @@ +using Plotly.NET.CSharp; +using Xunit; + +namespace CSharp.Tests.HtmlCodegen.Chart3D; + +public class IsoSurfaceTests +{ + private const string ExpectedData = """var data = [{"type":"isosurface","x":[0,1,0,1],"y":[0,0,1,1],"z":[0,0,1,1],"value":[1,2,3,4],"colorscale":"Viridis"}];"""; + + private static Plotly.NET.GenericChart CreateIsoSurfaceChart() => + Chart.IsoSurface( + x: new[] { 0, 1, 0, 1 }, + y: new[] { 0, 0, 1, 1 }, + z: new[] { 0, 0, 1, 1 }, + value: new[] { 1, 2, 3, 4 }, + ColorScale: Plotly.NET.StyleParam.Colorscale.Viridis, + UseDefaults: false + ); + + [Fact] + public void IsoSurfaceChartDataMatchesExpectedMarkup() + { + TestUtils.ChartGeneratedSectionEquals( + CreateIsoSurfaceChart(), + ChartMarkupSection.Data, + ExpectedData + ); + } +} diff --git a/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart3D/Line3DTests.cs b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart3D/Line3DTests.cs new file mode 100644 index 00000000..15055ac3 --- /dev/null +++ b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart3D/Line3DTests.cs @@ -0,0 +1,29 @@ +using Plotly.NET.CSharp; +using Xunit; + +namespace CSharp.Tests.HtmlCodegen.Chart3D; + +public class Line3DTests +{ + private const string ExpectedData = """var data = [{"type":"scatter3d","name":"line3d","mode":"lines+markers","x":[1,2,3],"y":[4,5,6],"z":[7,8,9],"marker":{},"line":{}}];"""; + + private static Plotly.NET.GenericChart CreateLine3DChart() => + Chart.Line3D( + x: new[] { 1, 2, 3 }, + y: new[] { 4, 5, 6 }, + z: new[] { 7, 8, 9 }, + ShowMarkers: true, + Name: "line3d", + UseDefaults: false + ); + + [Fact] + public void Line3DChartDataMatchesExpectedMarkup() + { + TestUtils.ChartGeneratedSectionEquals( + CreateLine3DChart(), + ChartMarkupSection.Data, + ExpectedData + ); + } +} diff --git a/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart3D/Mesh3DTests.cs b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart3D/Mesh3DTests.cs new file mode 100644 index 00000000..eb3432e7 --- /dev/null +++ b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart3D/Mesh3DTests.cs @@ -0,0 +1,30 @@ +using Plotly.NET.CSharp; +using Xunit; + +namespace CSharp.Tests.HtmlCodegen.Chart3D; + +public class Mesh3DTests +{ + private const string ExpectedData = """var data = [{"type":"mesh3d","x":[0,1,0,0],"y":[0,0,1,0],"z":[0,0,0,1],"i":[0],"j":[1],"k":[2]}];"""; + + private static Plotly.NET.GenericChart CreateMesh3DChart() => + Chart.Mesh3D( + x: new[] { 0, 1, 0, 0 }, + y: new[] { 0, 0, 1, 0 }, + z: new[] { 0, 0, 0, 1 }, + I: new[] { 0 }, + J: new[] { 1 }, + K: new[] { 2 }, + UseDefaults: false + ); + + [Fact] + public void Mesh3DChartDataMatchesExpectedMarkup() + { + TestUtils.ChartGeneratedSectionEquals( + CreateMesh3DChart(), + ChartMarkupSection.Data, + ExpectedData + ); + } +} diff --git a/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart3D/Point3DTests.cs b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart3D/Point3DTests.cs new file mode 100644 index 00000000..1ffe1abf --- /dev/null +++ b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart3D/Point3DTests.cs @@ -0,0 +1,28 @@ +using Plotly.NET.CSharp; +using Xunit; + +namespace CSharp.Tests.HtmlCodegen.Chart3D; + +public class Point3DTests +{ + private const string ExpectedData = """var data = [{"type":"scatter3d","name":"point3d","mode":"markers","x":[1,2,3],"y":[4,5,6],"z":[7,8,9],"marker":{},"line":{}}];"""; + + private static Plotly.NET.GenericChart CreatePoint3DChart() => + Chart.Point3D( + x: new[] { 1, 2, 3 }, + y: new[] { 4, 5, 6 }, + z: new[] { 7, 8, 9 }, + Name: "point3d", + UseDefaults: false + ); + + [Fact] + public void Point3DChartDataMatchesExpectedMarkup() + { + TestUtils.ChartGeneratedSectionEquals( + CreatePoint3DChart(), + ChartMarkupSection.Data, + ExpectedData + ); + } +} diff --git a/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart3D/Scatter3DTests.cs b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart3D/Scatter3DTests.cs new file mode 100644 index 00000000..1898b4b0 --- /dev/null +++ b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart3D/Scatter3DTests.cs @@ -0,0 +1,29 @@ +using Plotly.NET.CSharp; +using Xunit; + +namespace CSharp.Tests.HtmlCodegen.Chart3D; + +public class Scatter3DTests +{ + private const string ExpectedData = """var data = [{"type":"scatter3d","name":"scatter3d","mode":"lines+markers","x":[1,2,3],"y":[4,5,6],"z":[7,8,9],"marker":{},"line":{}}];"""; + + private static Plotly.NET.GenericChart CreateScatter3DChart() => + Chart.Scatter3D( + x: new[] { 1, 2, 3 }, + y: new[] { 4, 5, 6 }, + z: new[] { 7, 8, 9 }, + mode: Plotly.NET.StyleParam.Mode.Lines_Markers, + Name: "scatter3d", + UseDefaults: false + ); + + [Fact] + public void Scatter3DChartDataMatchesExpectedMarkup() + { + TestUtils.ChartGeneratedSectionEquals( + CreateScatter3DChart(), + ChartMarkupSection.Data, + ExpectedData + ); + } +} diff --git a/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart3D/StreamTubeTests.cs b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart3D/StreamTubeTests.cs new file mode 100644 index 00000000..92661498 --- /dev/null +++ b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart3D/StreamTubeTests.cs @@ -0,0 +1,31 @@ +using Plotly.NET.CSharp; +using Xunit; + +namespace CSharp.Tests.HtmlCodegen.Chart3D; + +public class StreamTubeTests +{ + private const string ExpectedData = """var data = [{"type":"streamtube","x":[0,0,0],"y":[0,1,2],"z":[0,0,0],"u":[0,0,0],"v":[1,1,1],"w":[0,0,0],"colorscale":"Viridis"}];"""; + + private static Plotly.NET.GenericChart CreateStreamTubeChart() => + Chart.StreamTube( + x: new[] { 0, 0, 0 }, + y: new[] { 0, 1, 2 }, + z: new[] { 0, 0, 0 }, + u: new[] { 0, 0, 0 }, + v: new[] { 1, 1, 1 }, + w: new[] { 0, 0, 0 }, + ColorScale: Plotly.NET.StyleParam.Colorscale.Viridis, + UseDefaults: false + ); + + [Fact] + public void StreamTubeChartDataMatchesExpectedMarkup() + { + TestUtils.ChartGeneratedSectionEquals( + CreateStreamTubeChart(), + ChartMarkupSection.Data, + ExpectedData + ); + } +} diff --git a/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart3D/SurfaceTests.cs b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart3D/SurfaceTests.cs new file mode 100644 index 00000000..8fcb391a --- /dev/null +++ b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart3D/SurfaceTests.cs @@ -0,0 +1,31 @@ +using Plotly.NET.CSharp; +using Xunit; + +namespace CSharp.Tests.HtmlCodegen.Chart3D; + +public class SurfaceTests +{ + private const string ExpectedData = """var data = [{"type":"surface","x":[0,1],"y":[0,1],"z":[[1,2],[3,4]]}];"""; + + private static Plotly.NET.GenericChart CreateSurfaceChart() => + Chart.Surface( + zData: new[] + { + new[] { 1, 2 }, + new[] { 3, 4 } + }, + X: new[] { 0, 1 }, + Y: new[] { 0, 1 }, + UseDefaults: false + ); + + [Fact] + public void SurfaceChartDataMatchesExpectedMarkup() + { + TestUtils.ChartGeneratedSectionEquals( + CreateSurfaceChart(), + ChartMarkupSection.Data, + ExpectedData + ); + } +} diff --git a/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart3D/VolumeTests.cs b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart3D/VolumeTests.cs new file mode 100644 index 00000000..a83cc7cd --- /dev/null +++ b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Chart3D/VolumeTests.cs @@ -0,0 +1,29 @@ +using Plotly.NET.CSharp; +using Xunit; + +namespace CSharp.Tests.HtmlCodegen.Chart3D; + +public class VolumeTests +{ + private const string ExpectedData = """var data = [{"type":"volume","x":[0,1,0,1],"y":[0,0,1,1],"z":[0,0,1,1],"value":[1,2,3,4],"colorscale":"Viridis"}];"""; + + private static Plotly.NET.GenericChart CreateVolumeChart() => + Chart.Volume( + x: new[] { 0, 1, 0, 1 }, + y: new[] { 0, 0, 1, 1 }, + z: new[] { 0, 0, 1, 1 }, + value: new[] { 1, 2, 3, 4 }, + ColorScale: Plotly.NET.StyleParam.Colorscale.Viridis, + UseDefaults: false + ); + + [Fact] + public void VolumeChartDataMatchesExpectedMarkup() + { + TestUtils.ChartGeneratedSectionEquals( + CreateVolumeChart(), + ChartMarkupSection.Data, + ExpectedData + ); + } +} diff --git a/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/ChartCarpet/FamilyTests.cs b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/ChartCarpet/FamilyTests.cs new file mode 100644 index 00000000..2e056e64 --- /dev/null +++ b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/ChartCarpet/FamilyTests.cs @@ -0,0 +1,205 @@ +using Plotly.NET.CSharp; +using Xunit; + +namespace CSharp.Tests.HtmlCodegen.ChartCarpet; + +public class CarpetTests +{ + private const string ExpectedData = """var data = [{"type":"carpet","y":[2.0,3.0],"a":[0.0,1.0],"b":[1.0,2.0],"carpet":"carpet"}];"""; + + private static Plotly.NET.GenericChart CreateChart() => + Chart.Carpet( + carpetId: "carpet", + A: new[] { 0.0, 1.0 }, + B: new[] { 1.0, 2.0 }, + Y: new[] { 2.0, 3.0 }, + UseDefaults: false + ); + + [Fact] + public void CarpetChartDataMatchesExpectedMarkup() => + TestUtils.ChartGeneratedSectionEquals(CreateChart(), ChartMarkupSection.Data, ExpectedData); +} + +public class ScatterCarpetTests +{ + private const string ExpectedData = """var data = [{"type":"carpet","y":[2.0,3.0],"a":[0.0,1.0],"b":[1.0,2.0],"carpet":"carpet-scatter"},{"type":"scattercarpet","name":"scattercarpet","mode":"lines+markers","a":[0.0,1.0],"b":[1.0,2.0],"marker":{},"line":{},"carpet":"carpet-scatter"}];"""; + + private static Plotly.NET.GenericChart CreateChart() => + Chart.Combine( + new[] + { + Chart.Carpet( + carpetId: "carpet-scatter", + A: new[] { 0.0, 1.0 }, + B: new[] { 1.0, 2.0 }, + Y: new[] { 2.0, 3.0 }, + UseDefaults: false + ), + Chart.ScatterCarpet( + a: new[] { 0.0, 1.0 }, + b: new[] { 1.0, 2.0 }, + mode: Plotly.NET.StyleParam.Mode.Lines_Markers, + carpetAnchorId: "carpet-scatter", + Name: "scattercarpet", + UseDefaults: false + ) + } + ); + + [Fact] + public void ScatterCarpetChartDataMatchesExpectedMarkup() => + TestUtils.ChartGeneratedSectionEquals(CreateChart(), ChartMarkupSection.Data, ExpectedData); +} + +public class PointCarpetTests +{ + private const string ExpectedData = """var data = [{"type":"carpet","y":[2.0,3.0],"a":[0.0,1.0],"b":[1.0,2.0],"carpet":"carpet-point"},{"type":"scattercarpet","name":"pointcarpet","mode":"markers","a":[0.0,1.0],"b":[1.0,2.0],"marker":{},"line":{},"carpet":"carpet-point"}];"""; + + private static Plotly.NET.GenericChart CreateChart() => + Chart.Combine( + new[] + { + Chart.Carpet( + carpetId: "carpet-point", + A: new[] { 0.0, 1.0 }, + B: new[] { 1.0, 2.0 }, + Y: new[] { 2.0, 3.0 }, + UseDefaults: false + ), + Chart.PointCarpet( + a: new[] { 0.0, 1.0 }, + b: new[] { 1.0, 2.0 }, + carpetAnchorId: "carpet-point", + Name: "pointcarpet", + UseDefaults: false + ) + } + ); + + [Fact] + public void PointCarpetChartDataMatchesExpectedMarkup() => + TestUtils.ChartGeneratedSectionEquals(CreateChart(), ChartMarkupSection.Data, ExpectedData); +} + +public class LineCarpetTests +{ + private const string ExpectedData = """var data = [{"type":"carpet","y":[2.0,3.0],"a":[0.0,1.0],"b":[1.0,2.0],"carpet":"carpet-line"},{"type":"scattercarpet","name":"linecarpet","mode":"lines","a":[0.0,1.0],"b":[1.0,2.0],"marker":{},"line":{},"carpet":"carpet-line"}];"""; + + private static Plotly.NET.GenericChart CreateChart() => + Chart.Combine( + new[] + { + Chart.Carpet( + carpetId: "carpet-line", + A: new[] { 0.0, 1.0 }, + B: new[] { 1.0, 2.0 }, + Y: new[] { 2.0, 3.0 }, + UseDefaults: false + ), + Chart.LineCarpet( + a: new[] { 0.0, 1.0 }, + b: new[] { 1.0, 2.0 }, + carpetAnchorId: "carpet-line", + Name: "linecarpet", + UseDefaults: false + ) + } + ); + + [Fact] + public void LineCarpetChartDataMatchesExpectedMarkup() => + TestUtils.ChartGeneratedSectionEquals(CreateChart(), ChartMarkupSection.Data, ExpectedData); +} + +public class SplineCarpetTests +{ + private const string ExpectedData = """var data = [{"type":"carpet","y":[2.0,3.0],"a":[0.0,1.0],"b":[1.0,2.0],"carpet":"carpet-spline"},{"type":"scattercarpet","name":"splinecarpet","mode":"lines","a":[0.0,1.0],"b":[1.0,2.0],"marker":{},"line":{"shape":"spline"},"carpet":"carpet-spline"}];"""; + + private static Plotly.NET.GenericChart CreateChart() => + Chart.Combine( + new[] + { + Chart.Carpet( + carpetId: "carpet-spline", + A: new[] { 0.0, 1.0 }, + B: new[] { 1.0, 2.0 }, + Y: new[] { 2.0, 3.0 }, + UseDefaults: false + ), + Chart.SplineCarpet( + a: new[] { 0.0, 1.0 }, + b: new[] { 1.0, 2.0 }, + carpetAnchorId: "carpet-spline", + Name: "splinecarpet", + UseDefaults: false + ) + } + ); + + [Fact] + public void SplineCarpetChartDataMatchesExpectedMarkup() => + TestUtils.ChartGeneratedSectionEquals(CreateChart(), ChartMarkupSection.Data, ExpectedData); +} + +public class BubbleCarpetTests +{ + private const string ExpectedData = """var data = [{"type":"carpet","y":[2.0,3.0],"a":[0.0,1.0],"b":[1.0,2.0],"carpet":"carpet-bubble"},{"type":"scattercarpet","name":"bubblecarpet","mode":"markers","a":[0.0,1.0],"b":[1.0,2.0],"marker":{"size":[5,10]},"line":{},"carpet":"carpet-bubble"}];"""; + + private static Plotly.NET.GenericChart CreateChart() => + Chart.Combine( + new[] + { + Chart.Carpet( + carpetId: "carpet-bubble", + A: new[] { 0.0, 1.0 }, + B: new[] { 1.0, 2.0 }, + Y: new[] { 2.0, 3.0 }, + UseDefaults: false + ), + Chart.BubbleCarpet( + a: new[] { 0.0, 1.0 }, + b: new[] { 1.0, 2.0 }, + sizes: new[] { 5, 10 }, + carpetAnchorId: "carpet-bubble", + Name: "bubblecarpet", + UseDefaults: false + ) + } + ); + + [Fact] + public void BubbleCarpetChartDataMatchesExpectedMarkup() => + TestUtils.ChartGeneratedSectionEquals(CreateChart(), ChartMarkupSection.Data, ExpectedData); +} + +public class ContourCarpetTests +{ + private const string ExpectedData = """var data = [{"type":"carpet","y":[2.0,3.0],"a":[0.0,1.0],"b":[1.0,2.0],"carpet":"carpet-contour"},{"type":"contourcarpet","name":"contourcarpet","z":[1.0,2.0],"a":[0,1],"b":[1,2],"line":{},"carpet":"carpet-contour","contours":{}}];"""; + + private static Plotly.NET.GenericChart CreateChart() => + Chart.Combine( + new[] + { + Chart.Carpet( + carpetId: "carpet-contour", + A: new[] { 0.0, 1.0 }, + B: new[] { 1.0, 2.0 }, + Y: new[] { 2.0, 3.0 }, + UseDefaults: false + ), + Chart.ContourCarpet( + z: new[] { 1.0, 2.0 }, + carpetAnchorId: "carpet-contour", + A: new[] { 0, 1 }, + B: new[] { 1, 2 }, + Name: "contourcarpet", + UseDefaults: false + ) + } + ); + + [Fact] + public void ContourCarpetChartDataMatchesExpectedMarkup() => + TestUtils.ChartGeneratedSectionEquals(CreateChart(), ChartMarkupSection.Data, ExpectedData); +} diff --git a/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/ChartDomain/FamilyTests.cs b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/ChartDomain/FamilyTests.cs new file mode 100644 index 00000000..b7896ad7 --- /dev/null +++ b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/ChartDomain/FamilyTests.cs @@ -0,0 +1,313 @@ +using Plotly.NET.CSharp; +using Plotly.NET.LayoutObjects; +using Plotly.NET.TraceObjects; +using Xunit; + +namespace CSharp.Tests.HtmlCodegen.ChartDomain; + +public class PieTests +{ + private const string ExpectedData = """var data = [{"type":"pie","values":[19,26,55],"labels":["A","B","C"],"marker":{"line":{},"pattern":{}}}];"""; + + private static Plotly.NET.GenericChart CreateChart() => + Chart.Pie( + values: new[] { 19, 26, 55 }, + Labels: new[] { "A", "B", "C" }, + UseDefaults: false + ); + + [Fact] + public void PieChartDataMatchesExpectedMarkup() => + TestUtils.ChartGeneratedSectionEquals(CreateChart(), ChartMarkupSection.Data, ExpectedData); +} + +public class DoughnutTests +{ + private const string ExpectedData = """var data = [{"type":"pie","values":[19,26,55],"labels":["A","B","C"],"text":["A","B","C"],"marker":{"line":{},"pattern":{}},"hole":0.3}];"""; + + private static Plotly.NET.GenericChart CreateChart() => + Chart.Doughnut( + values: new[] { 19, 26, 55 }, + Labels: new[] { "A", "B", "C" }, + MultiText: new[] { "A", "B", "C" }, + Hole: 0.3, + UseDefaults: false + ); + + [Fact] + public void DoughnutChartDataMatchesExpectedMarkup() => + TestUtils.ChartGeneratedSectionEquals(CreateChart(), ChartMarkupSection.Data, ExpectedData); +} + +public class FunnelAreaTests +{ + private const string ExpectedData = """var data = [{"type":"funnelarea","values":[5,4,3],"text":["The 1st","The 2nd","The 3rd"],"marker":{"line":{"color":"purple","width":3.0},"pattern":{}}}];"""; + + private static Plotly.NET.GenericChart CreateChart() => + Chart.FunnelArea( + values: new[] { 5, 4, 3 }, + MultiText: new[] { "The 1st", "The 2nd", "The 3rd" }, + SectionOutlineColor: Plotly.NET.Color.fromString("purple"), + SectionOutlineWidth: 3.0, + UseDefaults: false + ); + + [Fact] + public void FunnelAreaChartDataMatchesExpectedMarkup() => + TestUtils.ChartGeneratedSectionEquals(CreateChart(), ChartMarkupSection.Data, ExpectedData); +} + +public class SunburstTests +{ + private const string ExpectedData = """var data = [{"type":"sunburst","parents":["","","B"],"values":[19,26,55],"labels":["A","B","C"],"text":["At","Bt","Ct"],"marker":{"line":{},"pattern":{}}}];"""; + + private static Plotly.NET.GenericChart CreateChart() => + Chart.Sunburst( + labels: new[] { "A", "B", "C" }, + parents: new[] { "", "", "B" }, + Values: new[] { 19, 26, 55 }, + MultiText: new[] { "At", "Bt", "Ct" }, + UseDefaults: false + ); + + [Fact] + public void SunburstChartDataMatchesExpectedMarkup() => + TestUtils.ChartGeneratedSectionEquals(CreateChart(), ChartMarkupSection.Data, ExpectedData); +} + +public class TreemapTests +{ + private const string ExpectedData = """var data = [{"type":"treemap","parents":["","","A"],"values":[20,5,15],"labels":["A","B","C"],"marker":{"line":{},"pattern":{}}}];"""; + + private static Plotly.NET.GenericChart CreateChart() => + Chart.Treemap( + labels: new[] { "A", "B", "C" }, + parents: new[] { "", "", "A" }, + Values: new[] { 20, 5, 15 }, + UseDefaults: false + ); + + [Fact] + public void TreemapChartDataMatchesExpectedMarkup() => + TestUtils.ChartGeneratedSectionEquals(CreateChart(), ChartMarkupSection.Data, ExpectedData); +} + +public class ParallelCoordTests +{ + private const string ExpectedData = """var data = [{"type":"parcoords","dimensions":[{"label":"A","values":[1.0,4.0,3.4,0.7],"axis":{}},{"label":"B","values":[3.0,1.5,1.7,2.3],"axis":{}}],"line":{"color":"blue"}}];"""; + + private static Plotly.NET.GenericChart CreateChart() => + Chart.ParallelCoord( + dimensions: new Dimension[] + { + Dimension.initParallel( + ConstraintRange: default, + Label: "A", + MultiSelect: default, + Name: default, + Range: default, + TemplateItemName: default, + TickFormat: default, + TickText: default, + Tickvals: default, + Values: new[] { 1.0, 4.0, 3.4, 0.7 }, + ValuesEncoded: default, + Visible: default + ), + Dimension.initParallel( + ConstraintRange: default, + Label: "B", + MultiSelect: default, + Name: default, + Range: default, + TemplateItemName: default, + TickFormat: default, + TickText: default, + Tickvals: default, + Values: new[] { 3.0, 1.5, 1.7, 2.3 }, + ValuesEncoded: default, + Visible: default + ) + }, + LineColor: Plotly.NET.Color.fromString("blue"), + UseDefaults: false + ); + + [Fact] + public void ParallelCoordChartDataMatchesExpectedMarkup() => + TestUtils.ChartGeneratedSectionEquals(CreateChart(), ChartMarkupSection.Data, ExpectedData); +} + +public class ParallelCategoriesTests +{ + private const string ExpectedData = """var data = [{"type":"parcats","dimensions":[{"label":"A","values":["Cat1","Cat1","Cat2"],"axis":{}},{"label":"B","values":["Yes","No","Yes"],"axis":{}}],"line":{"color":"blue"}}];"""; + + private static Plotly.NET.GenericChart CreateChart() => + Chart.ParallelCategories( + dimensions: new Dimension[] + { + Dimension.initParallel( + ConstraintRange: default, + Label: "A", + MultiSelect: default, + Name: default, + Range: default, + TemplateItemName: default, + TickFormat: default, + TickText: default, + Tickvals: default, + Values: new[] { "Cat1", "Cat1", "Cat2" }, + ValuesEncoded: default, + Visible: default + ), + Dimension.initParallel( + ConstraintRange: default, + Label: "B", + MultiSelect: default, + Name: default, + Range: default, + TemplateItemName: default, + TickFormat: default, + TickText: default, + Tickvals: default, + Values: new[] { "Yes", "No", "Yes" }, + ValuesEncoded: default, + Visible: default + ) + }, + LineColor: Plotly.NET.Color.fromString("blue"), + UseDefaults: false + ); + + [Fact] + public void ParallelCategoriesChartDataMatchesExpectedMarkup() => + TestUtils.ChartGeneratedSectionEquals(CreateChart(), ChartMarkupSection.Data, ExpectedData); +} + +public class SankeyTests +{ + private const string ExpectedData = """var data = [{"type":"sankey","node":{"label":["A","B","C","D"]},"link":{"source":[0,1,1],"target":[2,2,3],"value":[1,2,5]}}];"""; + + private static Plotly.NET.GenericChart CreateChart() => + Chart.Sankey( + nodes: SankeyNodes.init( + Color: default, + CustomData: default, + Groups: default, + HoverInfo: default, + HoverLabel: default, + HoverTemplate: default, + MultiHoverTemplate: default, + Label: new[] { "A", "B", "C", "D" }, + Line: default, + Pad: default, + Thickness: default, + X: default, + Y: default + ), + links: SankeyLinks.init( + ArrowLen: default, + Color: default, + ColorScales: default, + CustomData: default, + HoverInfo: default, + HoverLabel: default, + HoverTemplate: default, + MultiHoverTemplate: default, + Label: default, + Line: default, + Source: new[] { 0, 1, 1 }, + Target: new[] { 2, 2, 3 }, + Value: new[] { 1, 2, 5 } + ), + UseDefaults: false + ); + + [Fact] + public void SankeyChartDataMatchesExpectedMarkup() => + TestUtils.ChartGeneratedSectionEquals(CreateChart(), ChartMarkupSection.Data, ExpectedData); +} + +public class TableTests +{ + private const string ExpectedData = """var data = [{"type":"table","cells":{"values":[["0","1"],["A","B"]]},"header":{"values":["H1","H2"]}}];"""; + + private static Plotly.NET.GenericChart CreateChart() => + Chart.Table( + header: TableCells.init( + Align: default, + MultiAlign: default, + Fill: default, + Font: default, + Format: default, + Height: default, + Line: default, + Prefix: default, + MultiPrefix: default, + Suffix: default, + MultiSuffix: default, + Values: new[] { "H1", "H2" } + ), + cells: TableCells.init( + Align: default, + MultiAlign: default, + Fill: default, + Font: default, + Format: default, + Height: default, + Line: default, + Prefix: default, + MultiPrefix: default, + Suffix: default, + MultiSuffix: default, + Values: new[] + { + new[] { "0", "1" }, + new[] { "A", "B" } + } + ), + UseDefaults: false + ); + + [Fact] + public void TableChartDataMatchesExpectedMarkup() => + TestUtils.ChartGeneratedSectionEquals(CreateChart(), ChartMarkupSection.Data, ExpectedData); +} + +public class IndicatorTests +{ + private const string ExpectedData = """var data = [{"type":"indicator","mode":"number+delta+gauge","value":120,"domain":{"row":0,"column":1},"delta":{"reference":90},"gauge":{"axis":{"visible":false,"range":[-200.0,200.0]},"shape":"bullet"}}];"""; + + private static Plotly.NET.GenericChart CreateChart() => + Chart.Indicator( + value: 120, + mode: Plotly.NET.StyleParam.IndicatorMode.NumberDeltaGauge, + DeltaReference: 90, + Range: new Plotly.NET.StyleParam.Range.MinMax(-200.0, 200.0), + GaugeShape: Plotly.NET.StyleParam.IndicatorGaugeShape.Bullet, + ShowGaugeAxis: false, + Domain: Domain.init(X: default, Y: default, Row: 0, Column: 1), + UseDefaults: false + ); + + [Fact] + public void IndicatorChartDataMatchesExpectedMarkup() => + TestUtils.ChartGeneratedSectionEquals(CreateChart(), ChartMarkupSection.Data, ExpectedData); +} + +public class IcicleTests +{ + private const string ExpectedData = """var data = [{"type":"icicle","parents":["","A","A"],"values":[20,15,5],"labels":["A","AA","AB"],"marker":{"line":{},"pattern":{}},"tiling":{},"pathbar":{}}];"""; + + private static Plotly.NET.GenericChart CreateChart() => + Chart.Icicle( + labels: new[] { "A", "AA", "AB" }, + parents: new[] { "", "A", "A" }, + Values: new[] { 20, 15, 5 }, + UseDefaults: false + ); + + [Fact] + public void IcicleChartDataMatchesExpectedMarkup() => + TestUtils.ChartGeneratedSectionEquals(CreateChart(), ChartMarkupSection.Data, ExpectedData); +} diff --git a/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/ChartMap/BubbleGeoTests.cs b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/ChartMap/BubbleGeoTests.cs new file mode 100644 index 00000000..bc3c4660 --- /dev/null +++ b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/ChartMap/BubbleGeoTests.cs @@ -0,0 +1,24 @@ +using Plotly.NET.CSharp; +using Xunit; + +namespace CSharp.Tests.HtmlCodegen.ChartMap; + +public class BubbleGeoTests +{ + private const string ExpectedData = """var data = [{"type":"scattergeo","name":"bubblegeo","mode":"markers","lat":[2,3],"lon":[1,4],"marker":{"size":[10,20]}}];"""; + + private static Plotly.NET.GenericChart CreateBubbleGeoChart() => + Chart.BubbleGeo( + longitudes: new[] { 1, 4 }, + latitudes: new[] { 2, 3 }, + sizes: new[] { 10, 20 }, + Name: "bubblegeo", + UseDefaults: false + ); + + [Fact] + public void BubbleGeoChartDataMatchesExpectedMarkup() + { + TestUtils.ChartGeneratedSectionEquals(CreateBubbleGeoChart(), ChartMarkupSection.Data, ExpectedData); + } +} diff --git a/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/ChartMap/BubbleMapboxTests.cs b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/ChartMap/BubbleMapboxTests.cs new file mode 100644 index 00000000..7550f737 --- /dev/null +++ b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/ChartMap/BubbleMapboxTests.cs @@ -0,0 +1,24 @@ +using Plotly.NET.CSharp; +using Xunit; + +namespace CSharp.Tests.HtmlCodegen.ChartMap; + +public class BubbleMapboxTests +{ + private const string ExpectedData = """var data = [{"type":"scattermapbox","name":"bubblemapbox","mode":"markers","lat":[2,3],"lon":[1,4],"marker":{"size":[10,20]}}];"""; + + private static Plotly.NET.GenericChart CreateBubbleMapboxChart() => + Chart.BubbleMapbox( + longitudes: new[] { 1, 4 }, + latitudes: new[] { 2, 3 }, + sizes: new[] { 10, 20 }, + Name: "bubblemapbox", + UseDefaults: false + ); + + [Fact] + public void BubbleMapboxChartDataMatchesExpectedMarkup() + { + TestUtils.ChartGeneratedSectionEquals(CreateBubbleMapboxChart(), ChartMarkupSection.Data, ExpectedData); + } +} diff --git a/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/ChartMap/ChoroplethMapTests.cs b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/ChartMap/ChoroplethMapTests.cs new file mode 100644 index 00000000..27d65da7 --- /dev/null +++ b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/ChartMap/ChoroplethMapTests.cs @@ -0,0 +1,23 @@ +using Plotly.NET.CSharp; +using Xunit; + +namespace CSharp.Tests.HtmlCodegen.ChartMap; + +public class ChoroplethMapTests +{ + private const string ExpectedData = """var data = [{"type":"choropleth","name":"choroplethmap","z":[1,2],"locations":["A","B"]}];"""; + + private static Plotly.NET.GenericChart CreateChoroplethMapChart() => + Chart.ChoroplethMap( + locations: new[] { "A", "B" }, + z: new[] { 1, 2 }, + Name: "choroplethmap", + UseDefaults: false + ); + + [Fact] + public void ChoroplethMapChartDataMatchesExpectedMarkup() + { + TestUtils.ChartGeneratedSectionEquals(CreateChoroplethMapChart(), ChartMarkupSection.Data, ExpectedData); + } +} diff --git a/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/ChartMap/ChoroplethMapboxTests.cs b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/ChartMap/ChoroplethMapboxTests.cs new file mode 100644 index 00000000..4948c348 --- /dev/null +++ b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/ChartMap/ChoroplethMapboxTests.cs @@ -0,0 +1,24 @@ +using Plotly.NET.CSharp; +using Xunit; + +namespace CSharp.Tests.HtmlCodegen.ChartMap; + +public class ChoroplethMapboxTests +{ + private const string ExpectedData = """var data = [{"type":"choroplethmapbox","name":"choroplethmapbox","z":[1,2],"geojson":"https://example.com/test.geojson","locations":["A","B"]}];"""; + + private static Plotly.NET.GenericChart CreateChoroplethMapboxChart() => + Chart.ChoroplethMapbox( + locations: new[] { "A", "B" }, + z: new[] { 1, 2 }, + geoJson: "https://example.com/test.geojson", + Name: "choroplethmapbox", + UseDefaults: false + ); + + [Fact] + public void ChoroplethMapboxChartDataMatchesExpectedMarkup() + { + TestUtils.ChartGeneratedSectionEquals(CreateChoroplethMapboxChart(), ChartMarkupSection.Data, ExpectedData); + } +} diff --git a/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/ChartMap/DensityMapboxTests.cs b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/ChartMap/DensityMapboxTests.cs new file mode 100644 index 00000000..39ca1e4a --- /dev/null +++ b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/ChartMap/DensityMapboxTests.cs @@ -0,0 +1,26 @@ +using Plotly.NET.CSharp; +using Xunit; + +namespace CSharp.Tests.HtmlCodegen.ChartMap; + +public class DensityMapboxTests +{ + private const string ExpectedData = """var data = [{"type":"densitymapbox","name":"densitymapbox","z":[1,2],"radius":8,"lat":[2,3],"lon":[1,4],"colorscale":"Viridis"}];"""; + + private static Plotly.NET.GenericChart CreateDensityMapboxChart() => + Chart.DensityMapbox( + longitudes: new[] { 1, 4 }, + latitudes: new[] { 2, 3 }, + Name: "densitymapbox", + Z: new[] { 1, 2 }, + Radius: 8, + ColorScale: Plotly.NET.StyleParam.Colorscale.Viridis, + UseDefaults: false + ); + + [Fact] + public void DensityMapboxChartDataMatchesExpectedMarkup() + { + TestUtils.ChartGeneratedSectionEquals(CreateDensityMapboxChart(), ChartMarkupSection.Data, ExpectedData); + } +} diff --git a/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/ChartMap/LineGeoTests.cs b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/ChartMap/LineGeoTests.cs new file mode 100644 index 00000000..79f224f2 --- /dev/null +++ b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/ChartMap/LineGeoTests.cs @@ -0,0 +1,24 @@ +using Plotly.NET.CSharp; +using Xunit; + +namespace CSharp.Tests.HtmlCodegen.ChartMap; + +public class LineGeoTests +{ + private const string ExpectedData = """var data = [{"type":"scattergeo","name":"linegeo","mode":"lines+markers","lat":[2,3],"lon":[1,4],"marker":{},"line":{}}];"""; + + private static Plotly.NET.GenericChart CreateLineGeoChart() => + Chart.LineGeo( + longitudes: new[] { 1, 4 }, + latitudes: new[] { 2, 3 }, + ShowMarkers: true, + Name: "linegeo", + UseDefaults: false + ); + + [Fact] + public void LineGeoChartDataMatchesExpectedMarkup() + { + TestUtils.ChartGeneratedSectionEquals(CreateLineGeoChart(), ChartMarkupSection.Data, ExpectedData); + } +} diff --git a/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/ChartMap/LineMapboxTests.cs b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/ChartMap/LineMapboxTests.cs new file mode 100644 index 00000000..9bea9c3a --- /dev/null +++ b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/ChartMap/LineMapboxTests.cs @@ -0,0 +1,24 @@ +using Plotly.NET.CSharp; +using Xunit; + +namespace CSharp.Tests.HtmlCodegen.ChartMap; + +public class LineMapboxTests +{ + private const string ExpectedData = """var data = [{"type":"scattermapbox","name":"linemapbox","mode":"lines+markers","lat":[2,3],"lon":[1,4],"cluster":{},"marker":{},"line":{}}];"""; + + private static Plotly.NET.GenericChart CreateLineMapboxChart() => + Chart.LineMapbox( + longitudes: new[] { 1, 4 }, + latitudes: new[] { 2, 3 }, + ShowMarkers: true, + Name: "linemapbox", + UseDefaults: false + ); + + [Fact] + public void LineMapboxChartDataMatchesExpectedMarkup() + { + TestUtils.ChartGeneratedSectionEquals(CreateLineMapboxChart(), ChartMarkupSection.Data, ExpectedData); + } +} diff --git a/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/ChartMap/PointGeoTests.cs b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/ChartMap/PointGeoTests.cs new file mode 100644 index 00000000..0f15605e --- /dev/null +++ b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/ChartMap/PointGeoTests.cs @@ -0,0 +1,23 @@ +using Plotly.NET.CSharp; +using Xunit; + +namespace CSharp.Tests.HtmlCodegen.ChartMap; + +public class PointGeoTests +{ + private const string ExpectedData = """var data = [{"type":"scattergeo","name":"pointgeo","mode":"markers","lat":[2,3],"lon":[1,4],"marker":{},"line":{}}];"""; + + private static Plotly.NET.GenericChart CreatePointGeoChart() => + Chart.PointGeo( + longitudes: new[] { 1, 4 }, + latitudes: new[] { 2, 3 }, + Name: "pointgeo", + UseDefaults: false + ); + + [Fact] + public void PointGeoChartDataMatchesExpectedMarkup() + { + TestUtils.ChartGeneratedSectionEquals(CreatePointGeoChart(), ChartMarkupSection.Data, ExpectedData); + } +} diff --git a/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/ChartMap/PointMapboxTests.cs b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/ChartMap/PointMapboxTests.cs new file mode 100644 index 00000000..3fcd8dfc --- /dev/null +++ b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/ChartMap/PointMapboxTests.cs @@ -0,0 +1,23 @@ +using Plotly.NET.CSharp; +using Xunit; + +namespace CSharp.Tests.HtmlCodegen.ChartMap; + +public class PointMapboxTests +{ + private const string ExpectedData = """var data = [{"type":"scattermapbox","name":"pointmapbox","mode":"markers","lat":[2,3],"lon":[1,4],"cluster":{},"marker":{},"line":{}}];"""; + + private static Plotly.NET.GenericChart CreatePointMapboxChart() => + Chart.PointMapbox( + longitudes: new[] { 1, 4 }, + latitudes: new[] { 2, 3 }, + Name: "pointmapbox", + UseDefaults: false + ); + + [Fact] + public void PointMapboxChartDataMatchesExpectedMarkup() + { + TestUtils.ChartGeneratedSectionEquals(CreatePointMapboxChart(), ChartMarkupSection.Data, ExpectedData); + } +} diff --git a/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/ChartMap/ScatterGeoTests.cs b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/ChartMap/ScatterGeoTests.cs new file mode 100644 index 00000000..af2df3f9 --- /dev/null +++ b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/ChartMap/ScatterGeoTests.cs @@ -0,0 +1,24 @@ +using Plotly.NET.CSharp; +using Xunit; + +namespace CSharp.Tests.HtmlCodegen.ChartMap; + +public class ScatterGeoTests +{ + private const string ExpectedData = """var data = [{"type":"scattergeo","name":"scattergeo","mode":"lines+markers","lat":[2,3],"lon":[1,4],"marker":{},"line":{}}];"""; + + private static Plotly.NET.GenericChart CreateScatterGeoChart() => + Chart.ScatterGeo( + longitudes: new[] { 1, 4 }, + latitudes: new[] { 2, 3 }, + mode: Plotly.NET.StyleParam.Mode.Lines_Markers, + Name: "scattergeo", + UseDefaults: false + ); + + [Fact] + public void ScatterGeoChartDataMatchesExpectedMarkup() + { + TestUtils.ChartGeneratedSectionEquals(CreateScatterGeoChart(), ChartMarkupSection.Data, ExpectedData); + } +} diff --git a/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/ChartMap/ScatterMapboxTests.cs b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/ChartMap/ScatterMapboxTests.cs new file mode 100644 index 00000000..77c7d554 --- /dev/null +++ b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/ChartMap/ScatterMapboxTests.cs @@ -0,0 +1,24 @@ +using Plotly.NET.CSharp; +using Xunit; + +namespace CSharp.Tests.HtmlCodegen.ChartMap; + +public class ScatterMapboxTests +{ + private const string ExpectedData = """var data = [{"type":"scattermapbox","name":"scattermapbox","mode":"lines+markers","lat":[2,3],"lon":[1,4],"cluster":{},"marker":{},"line":{}}];"""; + + private static Plotly.NET.GenericChart CreateScatterMapboxChart() => + Chart.ScatterMapbox( + longitudes: new[] { 1, 4 }, + latitudes: new[] { 2, 3 }, + mode: Plotly.NET.StyleParam.Mode.Lines_Markers, + Name: "scattermapbox", + UseDefaults: false + ); + + [Fact] + public void ScatterMapboxChartDataMatchesExpectedMarkup() + { + TestUtils.ChartGeneratedSectionEquals(CreateScatterMapboxChart(), ChartMarkupSection.Data, ExpectedData); + } +} diff --git a/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/ChartPolar/BarPolarTests.cs b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/ChartPolar/BarPolarTests.cs new file mode 100644 index 00000000..83524b58 --- /dev/null +++ b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/ChartPolar/BarPolarTests.cs @@ -0,0 +1,27 @@ +using Plotly.NET.CSharp; +using Xunit; + +namespace CSharp.Tests.HtmlCodegen.ChartPolar; + +public class BarPolarTests +{ + private const string ExpectedData = """var data = [{"type":"barpolar","name":"barpolar","r":[1,2,3],"theta":["N","E","S"],"marker":{"pattern":{}}}];"""; + + private static Plotly.NET.GenericChart CreateBarPolarChart() => + Chart.BarPolar( + r: new[] { 1, 2, 3 }, + theta: new[] { "N", "E", "S" }, + Name: "barpolar", + UseDefaults: false + ); + + [Fact] + public void BarPolarChartDataMatchesExpectedMarkup() + { + TestUtils.ChartGeneratedSectionEquals( + CreateBarPolarChart(), + ChartMarkupSection.Data, + ExpectedData + ); + } +} diff --git a/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/ChartPolar/BubblePolarTests.cs b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/ChartPolar/BubblePolarTests.cs new file mode 100644 index 00000000..432cfd40 --- /dev/null +++ b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/ChartPolar/BubblePolarTests.cs @@ -0,0 +1,30 @@ +using Plotly.NET.CSharp; +using Xunit; + +namespace CSharp.Tests.HtmlCodegen.ChartPolar; + +public class BubblePolarTests +{ + private const string ExpectedData = """var data = [{"type":"scatterpolar","name":"bubblepolar","mode":"markers","r":[1,2,3],"theta":[0,45,90],"text":["A","B","C"],"textposition":"top left","marker":{"size":[10,20,30]}}];"""; + + private static Plotly.NET.GenericChart CreateBubblePolarChart() => + Chart.BubblePolar( + r: new[] { 1, 2, 3 }, + theta: new[] { 0, 45, 90 }, + sizes: new[] { 10, 20, 30 }, + Name: "bubblepolar", + MultiText: new[] { "A", "B", "C" }, + TextPosition: Plotly.NET.StyleParam.TextPosition.TopLeft, + UseDefaults: false + ); + + [Fact] + public void BubblePolarChartDataMatchesExpectedMarkup() + { + TestUtils.ChartGeneratedSectionEquals( + CreateBubblePolarChart(), + ChartMarkupSection.Data, + ExpectedData + ); + } +} diff --git a/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/ChartPolar/LinePolarTests.cs b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/ChartPolar/LinePolarTests.cs new file mode 100644 index 00000000..75651bd2 --- /dev/null +++ b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/ChartPolar/LinePolarTests.cs @@ -0,0 +1,28 @@ +using Plotly.NET.CSharp; +using Xunit; + +namespace CSharp.Tests.HtmlCodegen.ChartPolar; + +public class LinePolarTests +{ + private const string ExpectedData = """var data = [{"type":"scatterpolar","name":"linepolar","mode":"lines+markers","r":[1,2,3],"theta":[0,45,90],"marker":{},"line":{}}];"""; + + private static Plotly.NET.GenericChart CreateLinePolarChart() => + Chart.LinePolar( + r: new[] { 1, 2, 3 }, + theta: new[] { 0, 45, 90 }, + ShowMarkers: true, + Name: "linepolar", + UseDefaults: false + ); + + [Fact] + public void LinePolarChartDataMatchesExpectedMarkup() + { + TestUtils.ChartGeneratedSectionEquals( + CreateLinePolarChart(), + ChartMarkupSection.Data, + ExpectedData + ); + } +} diff --git a/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/ChartPolar/PointPolarTests.cs b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/ChartPolar/PointPolarTests.cs new file mode 100644 index 00000000..9132b130 --- /dev/null +++ b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/ChartPolar/PointPolarTests.cs @@ -0,0 +1,27 @@ +using Plotly.NET.CSharp; +using Xunit; + +namespace CSharp.Tests.HtmlCodegen.ChartPolar; + +public class PointPolarTests +{ + private const string ExpectedData = """var data = [{"type":"scatterpolar","name":"pointpolar","mode":"markers","r":[1,2,3],"theta":[0,45,90],"marker":{}}];"""; + + private static Plotly.NET.GenericChart CreatePointPolarChart() => + Chart.PointPolar( + r: new[] { 1, 2, 3 }, + theta: new[] { 0, 45, 90 }, + Name: "pointpolar", + UseDefaults: false + ); + + [Fact] + public void PointPolarChartDataMatchesExpectedMarkup() + { + TestUtils.ChartGeneratedSectionEquals( + CreatePointPolarChart(), + ChartMarkupSection.Data, + ExpectedData + ); + } +} diff --git a/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/ChartPolar/ScatterPolarTests.cs b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/ChartPolar/ScatterPolarTests.cs new file mode 100644 index 00000000..f7881416 --- /dev/null +++ b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/ChartPolar/ScatterPolarTests.cs @@ -0,0 +1,28 @@ +using Plotly.NET.CSharp; +using Xunit; + +namespace CSharp.Tests.HtmlCodegen.ChartPolar; + +public class ScatterPolarTests +{ + private const string ExpectedData = """var data = [{"type":"scatterpolar","name":"scatterpolar","mode":"lines+markers","r":[1,2,3],"theta":[0,45,90],"marker":{},"line":{}}];"""; + + private static Plotly.NET.GenericChart CreateScatterPolarChart() => + Chart.ScatterPolar( + r: new[] { 1, 2, 3 }, + theta: new[] { 0, 45, 90 }, + mode: Plotly.NET.StyleParam.Mode.Lines_Markers, + Name: "scatterpolar", + UseDefaults: false + ); + + [Fact] + public void ScatterPolarChartDataMatchesExpectedMarkup() + { + TestUtils.ChartGeneratedSectionEquals( + CreateScatterPolarChart(), + ChartMarkupSection.Data, + ExpectedData + ); + } +} diff --git a/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/ChartPolar/SplinePolarTests.cs b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/ChartPolar/SplinePolarTests.cs new file mode 100644 index 00000000..58f34274 --- /dev/null +++ b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/ChartPolar/SplinePolarTests.cs @@ -0,0 +1,28 @@ +using Plotly.NET.CSharp; +using Xunit; + +namespace CSharp.Tests.HtmlCodegen.ChartPolar; + +public class SplinePolarTests +{ + private const string ExpectedData = """var data = [{"type":"scatterpolar","name":"splinepolar","mode":"lines+markers","r":[1,2,3],"theta":[0,45,90],"marker":{},"line":{"shape":"spline"}}];"""; + + private static Plotly.NET.GenericChart CreateSplinePolarChart() => + Chart.SplinePolar( + r: new[] { 1, 2, 3 }, + theta: new[] { 0, 45, 90 }, + ShowMarkers: true, + Name: "splinepolar", + UseDefaults: false + ); + + [Fact] + public void SplinePolarChartDataMatchesExpectedMarkup() + { + TestUtils.ChartGeneratedSectionEquals( + CreateSplinePolarChart(), + ChartMarkupSection.Data, + ExpectedData + ); + } +} diff --git a/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/ChartSmith/FamilyTests.cs b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/ChartSmith/FamilyTests.cs new file mode 100644 index 00000000..040399b5 --- /dev/null +++ b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/ChartSmith/FamilyTests.cs @@ -0,0 +1,76 @@ +using Plotly.NET.CSharp; +using Xunit; + +namespace CSharp.Tests.HtmlCodegen.ChartSmith; + +public class ScatterSmithTests +{ + private const string ExpectedData = """var data = [{"type":"scattersmith","mode":"lines+markers+text","imag":[0.5,1.0,2.0,3.0],"real":[0.5,1.0,2.0,3.0],"text":["Pretty","Cool","Plot","Huh?"],"textposition":"top center","marker":{},"line":{}}];"""; + + private static Plotly.NET.GenericChart CreateChart() => + Chart.ScatterSmith( + real: new[] { 0.5, 1.0, 2.0, 3.0 }, + imag: new[] { 0.5, 1.0, 2.0, 3.0 }, + mode: Plotly.NET.StyleParam.Mode.Lines_Markers_Text, + MultiText: new[] { "Pretty", "Cool", "Plot", "Huh?" }, + TextPosition: Plotly.NET.StyleParam.TextPosition.TopCenter, + UseDefaults: false + ); + + [Fact] + public void ScatterSmithChartDataMatchesExpectedMarkup() => + TestUtils.ChartGeneratedSectionEquals(CreateChart(), ChartMarkupSection.Data, ExpectedData); +} + +public class PointSmithTests +{ + private const string ExpectedData = """var data = [{"type":"scattersmith","mode":"markers","imag":[0.5,1.0,2.0,3.0],"real":[0.5,1.0,2.0,3.0],"marker":{},"line":{}}];"""; + + private static Plotly.NET.GenericChart CreateChart() => + Chart.PointSmith( + real: new[] { 0.5, 1.0, 2.0, 3.0 }, + imag: new[] { 0.5, 1.0, 2.0, 3.0 }, + UseDefaults: false + ); + + [Fact] + public void PointSmithChartDataMatchesExpectedMarkup() => + TestUtils.ChartGeneratedSectionEquals(CreateChart(), ChartMarkupSection.Data, ExpectedData); +} + +public class LineSmithTests +{ + private const string ExpectedData = """var data = [{"type":"scattersmith","mode":"lines","imag":[0.5,1.0,2.0,3.0],"real":[0.5,1.0,2.0,3.0],"marker":{},"line":{"color":"rgba(128, 0, 128, 1.0)","dash":"dashdot"}}];"""; + + private static Plotly.NET.GenericChart CreateChart() => + Chart.LineSmith( + real: new[] { 0.5, 1.0, 2.0, 3.0 }, + imag: new[] { 0.5, 1.0, 2.0, 3.0 }, + LineDash: Plotly.NET.StyleParam.DrawingStyle.DashDot, + LineColor: Plotly.NET.Color.fromKeyword(Plotly.NET.ColorKeyword.Purple), + UseDefaults: false + ); + + [Fact] + public void LineSmithChartDataMatchesExpectedMarkup() => + TestUtils.ChartGeneratedSectionEquals(CreateChart(), ChartMarkupSection.Data, ExpectedData); +} + +public class BubbleSmithTests +{ + private const string ExpectedData = """var data = [{"type":"scattersmith","mode":"markers+text","imag":[0.5,1.0,2.0,3.0],"real":[0.5,1.0,2.0,3.0],"text":["one","two","three","four","five","six","seven"],"textposition":"top center","marker":{"size":[10,20,30,40]},"line":{}}];"""; + + private static Plotly.NET.GenericChart CreateChart() => + Chart.BubbleSmith( + real: new[] { 0.5, 1.0, 2.0, 3.0 }, + imag: new[] { 0.5, 1.0, 2.0, 3.0 }, + sizes: new[] { 10, 20, 30, 40 }, + MultiText: new[] { "one", "two", "three", "four", "five", "six", "seven" }, + TextPosition: Plotly.NET.StyleParam.TextPosition.TopCenter, + UseDefaults: false + ); + + [Fact] + public void BubbleSmithChartDataMatchesExpectedMarkup() => + TestUtils.ChartGeneratedSectionEquals(CreateChart(), ChartMarkupSection.Data, ExpectedData); +} diff --git a/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/ChartTernary/BubbleTernaryTests.cs b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/ChartTernary/BubbleTernaryTests.cs new file mode 100644 index 00000000..2a3a84e6 --- /dev/null +++ b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/ChartTernary/BubbleTernaryTests.cs @@ -0,0 +1,25 @@ +using Plotly.NET.CSharp; +using Xunit; + +namespace CSharp.Tests.HtmlCodegen.ChartTernary; + +public class BubbleTernaryTests +{ + private const string ExpectedData = """var data = [{"type":"scatterternary","name":"bubbleternary","mode":"markers","a":[1,2],"b":[2,3],"c":[3,4],"marker":{"size":[10,20]},"line":{}}];"""; + + private static Plotly.NET.GenericChart CreateBubbleTernaryChart() => + Chart.BubbleTernary( + sizes: new[] { 10, 20 }, + A: new[] { 1, 2 }, + B: new[] { 2, 3 }, + C: new[] { 3, 4 }, + Name: "bubbleternary", + UseDefaults: false + ); + + [Fact] + public void BubbleTernaryChartDataMatchesExpectedMarkup() + { + TestUtils.ChartGeneratedSectionEquals(CreateBubbleTernaryChart(), ChartMarkupSection.Data, ExpectedData); + } +} diff --git a/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/ChartTernary/LineTernaryTests.cs b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/ChartTernary/LineTernaryTests.cs new file mode 100644 index 00000000..a94d1db4 --- /dev/null +++ b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/ChartTernary/LineTernaryTests.cs @@ -0,0 +1,25 @@ +using Plotly.NET.CSharp; +using Xunit; + +namespace CSharp.Tests.HtmlCodegen.ChartTernary; + +public class LineTernaryTests +{ + private const string ExpectedData = """var data = [{"type":"scatterternary","name":"lineternary","mode":"lines+markers","a":[10,20],"b":[20,10],"marker":{},"line":{},"sum":100}];"""; + + private static Plotly.NET.GenericChart CreateLineTernaryChart() => + Chart.LineTernary( + A: new[] { 10, 20 }, + B: new[] { 20, 10 }, + Sum: 100, + ShowMarkers: true, + Name: "lineternary", + UseDefaults: false + ); + + [Fact] + public void LineTernaryChartDataMatchesExpectedMarkup() + { + TestUtils.ChartGeneratedSectionEquals(CreateLineTernaryChart(), ChartMarkupSection.Data, ExpectedData); + } +} diff --git a/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/ChartTernary/PointTernaryTests.cs b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/ChartTernary/PointTernaryTests.cs new file mode 100644 index 00000000..e9bcb839 --- /dev/null +++ b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/ChartTernary/PointTernaryTests.cs @@ -0,0 +1,24 @@ +using Plotly.NET.CSharp; +using Xunit; + +namespace CSharp.Tests.HtmlCodegen.ChartTernary; + +public class PointTernaryTests +{ + private const string ExpectedData = """var data = [{"type":"scatterternary","name":"pointternary","mode":"markers","a":[1],"b":[2],"c":[3],"marker":{},"line":{}}];"""; + + private static Plotly.NET.GenericChart CreatePointTernaryChart() => + Chart.PointTernary( + A: new[] { 1 }, + B: new[] { 2 }, + C: new[] { 3 }, + Name: "pointternary", + UseDefaults: false + ); + + [Fact] + public void PointTernaryChartDataMatchesExpectedMarkup() + { + TestUtils.ChartGeneratedSectionEquals(CreatePointTernaryChart(), ChartMarkupSection.Data, ExpectedData); + } +} diff --git a/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/ChartTernary/ScatterTernaryTests.cs b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/ChartTernary/ScatterTernaryTests.cs new file mode 100644 index 00000000..3531b20f --- /dev/null +++ b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/ChartTernary/ScatterTernaryTests.cs @@ -0,0 +1,25 @@ +using Plotly.NET.CSharp; +using Xunit; + +namespace CSharp.Tests.HtmlCodegen.ChartTernary; + +public class ScatterTernaryTests +{ + private const string ExpectedData = """var data = [{"type":"scatterternary","name":"scatterternary","mode":"lines+markers","a":[1,2],"b":[2,3],"c":[3,4],"marker":{},"line":{}}];"""; + + private static Plotly.NET.GenericChart CreateScatterTernaryChart() => + Chart.ScatterTernary( + A: new[] { 1, 2 }, + B: new[] { 2, 3 }, + C: new[] { 3, 4 }, + Mode: Plotly.NET.StyleParam.Mode.Lines_Markers, + Name: "scatterternary", + UseDefaults: false + ); + + [Fact] + public void ScatterTernaryChartDataMatchesExpectedMarkup() + { + TestUtils.ChartGeneratedSectionEquals(CreateScatterTernaryChart(), ChartMarkupSection.Data, ExpectedData); + } +} diff --git a/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Layout/LegendStyleTests.cs b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Layout/LegendStyleTests.cs new file mode 100644 index 00000000..3444e3c6 --- /dev/null +++ b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Layout/LegendStyleTests.cs @@ -0,0 +1,32 @@ +using Plotly.NET.CSharp; +using Xunit; + +namespace CSharp.Tests.HtmlCodegen.Layout; + +public class LegendStyleTests +{ + private const string ExpectedLegendLayout = """var layout = {"legend":{"entrywidth":0.0,"entrywidthmode":"pixels","orientation":"h","x":0.5,"xanchor":"center"}};"""; + + private static Plotly.NET.GenericChart CreateChart() => + Chart.Point( + x: new double[] { 1, 2 }, + y: new double[] { 5, 10 }, + UseDefaults: false + ); + + [Fact] + public void WithLegendStyleMatchesExpectedLayoutMarkup() + { + TestUtils.ChartGeneratedSectionEquals( + CreateChart().WithLegendStyle( + X: 0.5, + Orientation: Plotly.NET.StyleParam.Orientation.Horizontal, + XAnchor: Plotly.NET.StyleParam.XAnchorPosition.Center, + EntryWidth: 0, + EntryWidthMode: Plotly.NET.StyleParam.EntryWidthMode.Pixels + ), + ChartMarkupSection.Layout, + ExpectedLegendLayout + ); + } +} diff --git a/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Trace/TraceInfoTests.cs b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Trace/TraceInfoTests.cs new file mode 100644 index 00000000..f0824a44 --- /dev/null +++ b/tests/ExtensionLibsTests/CSharpTests/htmlcodegen/Trace/TraceInfoTests.cs @@ -0,0 +1,26 @@ +using Plotly.NET.CSharp; +using Xunit; + +namespace CSharp.Tests.HtmlCodegen.Trace; + +public class TraceInfoTests +{ + private const string ExpectedData = """var data = [{"type":"scatter","mode":"markers","x":[1.0,2.0],"y":[5.0,10.0],"marker":{},"line":{},"name":"Trace Name"}];"""; + + private static Plotly.NET.GenericChart CreateChart() => + Chart.Point( + x: new double[] { 1, 2 }, + y: new double[] { 5, 10 }, + UseDefaults: false + ); + + [Fact] + public void WithTraceInfoSetsTraceNameInGeneratedDataSection() + { + TestUtils.ChartGeneratedSectionEquals( + CreateChart().WithTraceInfo(Name: "Trace Name"), + ChartMarkupSection.Data, + ExpectedData + ); + } +} diff --git a/tools/chart-baseline-generation/README.md b/tools/chart-baseline-generation/README.md new file mode 100644 index 00000000..ee26ce8c --- /dev/null +++ b/tools/chart-baseline-generation/README.md @@ -0,0 +1,91 @@ +# Chart Baseline Generation + +Use this workflow when a Plotly.NET test needs an expected string derived from actual chart output. + +## Goal + +Generate the real chart output first, inspect it, then copy only the stable part into the test as the expected value. + +Do not hand-write large expected strings from memory. + +## Prerequisites + +The script loads Plotly.NET assemblies from `tests/ConsoleApps/CSharpConsole/bin/Debug/net10.0/`. +Before running the script, verify that directory contains `Plotly.NET.dll` and `Plotly.NET.CSharp.dll`. +If it is empty or the DLLs are missing, build them first via the FAKE pipeline: + +```powershell +./build.cmd Build +``` + +Any of the `Run*TestsFast` targets also produce these assemblies as a side effect, so if you are about to run tests anyway you can skip the explicit build step. + +If you edit sources in `src/Plotly.NET` or `src/Plotly.NET.CSharp` during the investigation, rebuild before re-running the script. `dotnet fsi` will happily use stale assemblies. + +## Default Workflow + +1. Ensure the dependency DLLs exist. +2. Identify the chart fixture or chart-construction expression you want to validate. +3. Prefer an existing fixture from `tests/Common/FSharpTestBase/TestCharts/`. +4. If there is no suitable fixture, put a temporary focused chart expression into `tools/chart-baseline-generation/generate-chart-markup.fsx`. +5. Use that script for both F# tests and C# tests. +6. For C# wrapper baselines, call `Plotly.NET.CSharp.Chart...` inside the F# script. +7. Keep `UseDefaults = false` on the chart to avoid noisy default template output. +8. Generate output with the same renderer the test uses: + - `GenericChart.toChartHTML` for shared chart html + - `GenericChart.toEmbeddedHTML` when the test is specifically about embedded output +9. Let the script print the stable sections you care about directly: `data`, `layout`, `config`, or `plotly-call`. +10. Inspect the generated section output and decide which part is stable enough to assert. +11. Copy the investigated value into the test. +12. Delete any temporary helper code before finishing. + +## Canonical Script + +Always use `tools/chart-baseline-generation/generate-chart-markup.fsx` as the investigation harness. Do not create or edit console app projects for this workflow. + +Edit `createChart()` in `tools/chart-baseline-generation/generate-chart-markup.fsx`, run the script for the section you need, inspect the generated output, then revert the temporary chart expression when finished. + +## How To Run + +```powershell +dotnet fsi tools/chart-baseline-generation/generate-chart-markup.fsx +dotnet fsi tools/chart-baseline-generation/generate-chart-markup.fsx -- data +dotnet fsi tools/chart-baseline-generation/generate-chart-markup.fsx -- layout +dotnet fsi tools/chart-baseline-generation/generate-chart-markup.fsx -- html +dotnet fsi tools/chart-baseline-generation/generate-chart-markup.fsx -- data --write-html temp/chart.html +``` + +By default, the script prints extracted stable sections to stdout and does not create temporary files. + +Use `--write-html ` only when you explicitly want the full generated html on disk. + +Pick the smallest local loop that matches the test you are editing: + +- C# wrapper tests: `./build.cmd RunCSharpTestsFast` +- Core F# tests: `./build.cmd RunTestsCoreFast` +- Extension library tests: `./build.cmd RunTestsExtensionLibsFast` + +Use the full `./build.cmd runTestsAll` before committing. + +## What To Assert + +Prefer the smallest stable assertion that proves the behavior: + +- full `var data = ...;` block when validating trace serialization +- full `var layout = ...;` block when validating layout generation +- a small but meaningful substring only when the full block is too brittle + +Avoid asserting volatile values such as generated DOM ids. + +The unified script can print sections by label: + +- `data` +- `layout` +- `config` +- `plotly-call` + +## Investigation Rules + +- Treat generated output as a candidate baseline, not automatically correct truth. +- Compare the output with the API intent and nearby F# tests before adopting it. +- If the output looks surprising, stop and investigate the chart construction rather than locking in a wrong baseline. diff --git a/tools/chart-baseline-generation/generate-chart-markup.fsx b/tools/chart-baseline-generation/generate-chart-markup.fsx new file mode 100644 index 00000000..144b5a36 --- /dev/null +++ b/tools/chart-baseline-generation/generate-chart-markup.fsx @@ -0,0 +1,131 @@ +#I "../../tests/ConsoleApps/CSharpConsole/bin/Debug/net10.0" +#r "DynamicObj.dll" +#r "Fable.Core.dll" +#r "Giraffe.ViewEngine.dll" +#r "Newtonsoft.Json.dll" +#r "Plotly.NET.dll" +#r "Plotly.NET.CSharp.dll" + +open System +open System.IO +open System.Text.RegularExpressions +open Plotly.NET + +type Section = + | Html + | All + | Data + | Layout + | Config + | PlotlyCall + +let rawArgs = + fsi.CommandLineArgs + |> Array.skip 1 + |> Array.filter (fun arg -> arg <> "--") + +let printUsage () = + eprintfn + "Usage: dotnet fsi tools/chart-baseline-generation/generate-chart-markup.fsx -- [html|all|data|layout|config|plotly-call] [--write-html ]" + +let parseSection = + function + | None -> All + | Some "html" -> Html + | Some "all" -> All + | Some "data" -> Data + | Some "layout" -> Layout + | Some "config" -> Config + | Some "plotly-call" -> PlotlyCall + | Some value -> failwith $"Unknown section: {value}" + +let formatSection name value = + $"=== {name} ===\n{value}" + +let findSection (html: string) name pattern = + let matchResult = Regex.Match(html, pattern, RegexOptions.Singleline) + + if matchResult.Success then + formatSection name (matchResult.Value.Trim()) + else + formatSection name "" + +let extractSections (html: string) = + [ + "data", @"var data = .*?;" + "layout", @"var layout = .*?;" + "config", @"var config = .*?;" + "plotly-call", @"Plotly\.newPlot\(.*?\);" + ] + |> List.map (fun (name, pattern) -> name, findSection html name pattern) + |> Map.ofList + +let parseArgs (args: string array) = + let rec loop remaining requestedSection outputPath = + match remaining with + | [||] -> parseSection requestedSection, outputPath + | [| "--write-html" |] -> failwith "Missing output path after --write-html" + | [| "--write-html"; path |] -> + parseSection requestedSection, Some path + | _ when remaining[0] = "--write-html" -> + loop remaining[2..] requestedSection (Some remaining[1]) + | _ when requestedSection.IsSome -> + failwith $"Unexpected argument: {remaining[0]}" + | _ -> + loop remaining[1..] (Some remaining[0]) outputPath + + loop args None None + +let createChart () : GenericChart = + // Replace this chart while investigating a specific baseline. + // + // For F# tests, prefer the core F# API: + // Chart.Point(x = [ 0.0; 1.0 ], y = [ 1.0; 4.0 ], UseDefaults = false) + // + // For C# tests, use the C# wrapper in this same script: + // Plotly.NET.CSharp.Chart.Point( + // x = [| 0.0; 1.0 |], + // y = [| 1.0; 4.0 |], + // Name = "points", + // UseDefaults = false + // ) + Chart.Point( + x = [ 0.0; 1.0; 2.0; 3.0 ], + y = [ 1.0; 4.0; 9.0; 16.0 ], + Name = "points", + UseDefaults = false + ) + +try + let requestedSection, outputPath = parseArgs rawArgs + let markup = createChart () |> GenericChart.toChartHTML + let sections = extractSections markup + + match outputPath with + | Some path -> + let fullOutputPath = Path.GetFullPath(path) + let outputDirectory = Path.GetDirectoryName(fullOutputPath) + + if not (String.IsNullOrWhiteSpace(outputDirectory)) then + Directory.CreateDirectory(outputDirectory) |> ignore + + File.WriteAllText(fullOutputPath, markup) + eprintfn "Wrote chart markup to %s" fullOutputPath + | None -> () + + let printSection key = + sections.[key] |> printfn "%s" + + match requestedSection with + | Html -> printfn "%s" markup + | All -> + [ "data"; "layout"; "config"; "plotly-call" ] + |> List.iter printSection + | Data -> printSection "data" + | Layout -> printSection "layout" + | Config -> printSection "config" + | PlotlyCall -> printSection "plotly-call" +with ex -> + printUsage () + eprintfn "%s" ex.Message + exit 1