这是indexloc提供的服务,不要输入任何密码
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ module FSharpPocketViewTags =
let strong = f "strong"
let sub = f "sub"
let sup = f "sup"
let svg = f "svg"
let table = f "table"
let tbody = f "tbody"
let td = f "td"
Expand Down
1 change: 1 addition & 0 deletions Microsoft.DotNet.Interactive.Rendering/PocketViewTags.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ public static class PocketViewTags
public static dynamic strong => _.strong;
public static dynamic sub => _.sub;
public static dynamic sup => _.sup;
public static dynamic svg => _.svg;
public static dynamic table => _.table;
public static dynamic tbody => _.tbody;
public static dynamic td => _.td;
Expand Down
771 changes: 750 additions & 21 deletions NotebookExamples/csharp/Docs/Plotting with Xplot.ipynb

Large diffs are not rendered by default.

876 changes: 876 additions & 0 deletions NotebookExamples/fsharp/Docs/Plotting with Xplot.ipynb

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@ public class XPlotKernelExtension : IKernelExtension
{
public Task OnLoadAsync(IKernel kernel)
{
Formatter<PlotlyChart>.Register((chart, writer) =>
{
writer.Write(GetChartHtml(chart));
}, "text/html");
Formatter<PlotlyChart>.Register(
(chart, writer) =>
{
writer.Write(GetChartHtml(chart));
},
HtmlFormatter.MimeType);

return Task.CompletedTask;
}
Expand All @@ -31,13 +33,13 @@ public string GetChartHtml(PlotlyChart chart)
var scriptNode = document.DocumentNode.SelectSingleNode("//script");

var newHtmlDocument = new HtmlDocument();

newHtmlDocument.DocumentNode.ChildNodes.Add(divNode);
newHtmlDocument.DocumentNode.ChildNodes.Add(GetScriptNodeWithRequire(scriptNode));

return newHtmlDocument.DocumentNode.WriteContentTo();
}


private static HtmlNode GetScriptNodeWithRequire(HtmlNode scriptNode)
{
Expand Down