Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Avoid null references, if LINQPad.Runtime is not loaded
  • Loading branch information
Peter-B- committed Jul 25, 2023
commit b381634b8ab00a7ed351839a254c7f580098cd6a
11 changes: 7 additions & 4 deletions src/Plotly.NET/ChartAPI/GenericChart.fs
Original file line number Diff line number Diff line change
Expand Up @@ -140,13 +140,16 @@ module rec GenericChart =

/// Method to support dumping charts in LINQPad.
// See https://www.linqpad.net/CustomizingDump.aspx
member private this.ToDump () =
member private this.ToDump () : System.Object =
let html = toEmbeddedHTML this

let iFrameType = Type.GetType("LINQPad.Controls.IFrame, LINQPad.Runtime")
let iFrame = System.Activator.CreateInstance(iFrameType, html, true);

iFrame

if isNull iFrameType then
this
else
let iFrame = System.Activator.CreateInstance(iFrameType, html, true);
iFrame

let toFigure (gChart: GenericChart) =
match gChart with
Expand Down