private static HtmlString RenderDataExplorer(this NteractDataExplorer explorer, Uri uri, string context, string cacheBuster) { var divId = explorer.Id; var data = explorer.TabularDataResource.ToJson(); var code = new StringBuilder(); code.AppendLine("<div style=\"background-color:white;\">"); code.AppendLine($"<div id=\"{divId}\" style=\"height: 100ch ;margin: 2px;\">"); code.AppendLine("</div>"); code.AppendLine(@"<script type=""text/javascript"">"); GenerateCode(data, code, divId, "https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js", uri, context, cacheBuster); code.AppendLine(" </script>"); code.AppendLine("</div>"); return(new HtmlString(code.ToString())); }
public static T UseNteractDataExplorer <T>(this T kernel, string uri = null, string context = null, string cacheBuster = null) where T : Kernel { NteractDataExplorer.RegisterFormatters(); NteractDataExplorer.SetDefaultConfiguration(string.IsNullOrWhiteSpace(uri) ? null : new Uri(uri), context, cacheBuster); return(kernel); }