Skip to content

Commit

Permalink
fix #394 :
Browse files Browse the repository at this point in the history
- Add a mutable navigationOptions member to PuppeteerSharpRendererOptions
- Enables setting `Timeout` on that object, note that large charts may take extremely long to render
  • Loading branch information
kMutagene committed Feb 2, 2024
1 parent f152f49 commit a1b438a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Plotly.NET.ImageExport/PuppeteerSharpRenderer.fs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ module PuppeteerSharpRendererOptions =
let mutable localBrowserExecutablePath =
None

let mutable navigationOptions = NavigationOptions()

type PuppeteerSharpRenderer() =

Expand Down Expand Up @@ -68,7 +69,12 @@ type PuppeteerSharpRenderer() =
let! page = browser.NewPageAsync() |> Async.AwaitTask

try
let! _ = page.SetContentAsync(patchHtml width height scale format html) |> Async.AwaitTask
let! _ =
page.SetContentAsync(
html = patchHtml width height scale format html,
options = PuppeteerSharpRendererOptions.navigationOptions
)
|> Async.AwaitTask
let! imgHandle = page.WaitForExpressionAsync("window.plotlyImage") |> Async.AwaitTask
let! imgStr = imgHandle.JsonValueAsync<string>() |> Async.AwaitTask
return imgStr
Expand Down

0 comments on commit a1b438a

Please sign in to comment.