Initial commit

This commit is contained in:
2026-07-23 14:37:19 +02:00
commit 6775634701
4 changed files with 65 additions and 0 deletions
+1
View File
@@ -0,0 +1 @@
use nix
+17
View File
@@ -0,0 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net10.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<Compile Include="Program.fs" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Plotly.NET" Version="5.1.0" />
<PackageReference Include="Plotly.NET.ImageExport" Version="6.1.0" />
</ItemGroup>
</Project>
+34
View File
@@ -0,0 +1,34 @@
open Plotly.NET
open Plotly.NET.ImageExport
[<EntryPoint>]
let main argv =
let chromePathEnvOpt =
System.Environment.GetEnvironmentVariable("GOOGLE_CHROME")
|> Option.ofObj
let chromePathOpt: string option =
if argv.Length >= 1 then
Some (argv[0])
else
chromePathEnvOpt
match chromePathOpt with
| Some chromePath ->
PuppeteerSharpRendererOptions.localBrowserExecutablePath <- Some chromePath
let chart =
Chart.Point (
x = [ 0 .. 10 ],
y = [ 0 .. 10 ]
)
|> Chart.withTitle "Hello world!"
try
do chart |> Chart.savePNG("test")
with e ->
eprintfn "Error saving PNG: %s" e.Message
| None ->
eprintfn "Usage: <chrome-path> or define GOOLE_CHROME with path to binary"
0
+13
View File
@@ -0,0 +1,13 @@
with import <nixpkgs> {};
let
sdk = dotnetCorePackages.sdk_10_0;
in
mkShell {
packages = [
sdk
];
DOTNET_ROOT = "${sdk}/share/dotnet";
GOOGLE_CHROME = lib.getExe google-chrome;
}