Skip to content

ImageExport never stops #319

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
vanaur opened this issue Jul 8, 2022 · 3 comments
Closed

ImageExport never stops #319

vanaur opened this issue Jul 8, 2022 · 3 comments

Comments

@vanaur
Copy link

vanaur commented Jul 8, 2022

Description

I want to use Plotly.NET.ImageExport to statically export a graph as an image. When I run the application, my program runs for a very long time without any results.

Repro steps

Create a new F# project in console mode and add the dependencies to Plotly.NET and Ploty.NET.ImgeExport:

$  dotnet new console -lang F#
$  dotnet add package Plotly.NET
$  dotnet add package Plotly.NET.ImageExport

Then write any code that exports an image:

open Plotly.NET.ImageExport
open Plotly.NET

let test path =
    let xs = [ 0.0 .. 9.0 ]
    let ys = Seq.map (fun x -> x ** 2.0) xs

    Chart.Scatter(xs, ys, StyleParam.Mode.Lines_Markers)
    |> Chart.saveJPG path

printfn "Exporting the graph..."
do test "test.jpg"
printfn "Done!"  // never appears

Expected behavior

I expect it to generate an image, and especially for my application to stop, it seems to loop.

Actual behavior

After 10 minutes of waiting, I stopped my program because nothing happens.

Known workarounds

I came across this issue. My application did indeed generate a local chromium, so I referred Plotly to it:

open Plotly.NET.ImageExport
open Plotly.NET

do
    PuppeteerSharpRendererOptions.localBrowserExecutablePath <-
        Some ".local-chromium/Linux-884014/chrome-linux/chrome"

let test path =
    let xs = [ 0.0 .. 9.0 ]
    let ys = Seq.map (fun x -> x ** 2.0) xs

    Chart.Scatter(xs, ys, StyleParam.Mode.Lines_Markers)
    |> Chart.saveJPG path

printfn "Exporting the graph..."
do test "test.jpg"
printfn "Done!"  // never appears

I have tried absolute and relative path, but the problem remains the same.

Related information

  • Operating system: Linux, Pop!_OS
  • .NET Runtime: version 6.0.301
@WhiteBlackGoose
Copy link
Contributor

WhiteBlackGoose commented Jul 8, 2022

Hello. We fixed that bug very recently, actually. It didn't make it to the release yet, so get a prerelease version:

dotnet new nugetconfig
dotnet nuget add source https://www.myget.org/F/plotly-net-nightly/api/v3/index.json
dotnet add package Plotly.NET --prerelease

@vanaur
Copy link
Author

vanaur commented Jul 9, 2022

Oh, I see, thanks for the information! And the pre-release is working well.

@WhiteBlackGoose
Copy link
Contributor

@kMutagene I guess we can close it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants