diff --git a/src/XPlot.Plotly.Interactive/KernelExtension.fs b/src/XPlot.Plotly.Interactive/KernelExtension.fs index ce963ef..f32868f 100644 --- a/src/XPlot.Plotly.Interactive/KernelExtension.fs +++ b/src/XPlot.Plotly.Interactive/KernelExtension.fs @@ -19,18 +19,20 @@ open Giraffe.ViewEngine open XPlot.Plotly.Interactive.PowerShell.Commands type KernelExtension() = + static let mutable PlotlyUrl = "https://cdn.plot.ly/plotly-1.49.2.min" + static let mutable RequireJsUrl = "https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" let getScriptElementWithRequire (script: string) = let newScript = StringBuilder() newScript.AppendLine("""") |> ignore newScript.ToString() @@ -70,6 +72,12 @@ var renderPlotly = function() { registerPowerShellAccelerators() registerPowerShellModule() + /// Override the Plotly cdn url value used in all KernelExtensions. + static member SetPlotlyUrl(url: string) = PlotlyUrl <- url + + /// Override the RequireJS cdn url value used in all KernelExtensions. + static member SetRequireJsUrl(url: string) = RequireJsUrl <- url + interface IKernelExtension with member _.OnLoadAsync kernel = registerPlotlyFormatters()