diff --git a/.editorconfig b/.editorconfig index a46e3e379f..b567338281 100644 --- a/.editorconfig +++ b/.editorconfig @@ -26,3 +26,8 @@ dotnet_diagnostic.MSML_ExtendBaseTestClass.severity = none # The MSML_RelaxTestNaming suppressor for VSTHRD200 is not active for CodeAnalyzer.Tests, so we disable it altogether. # VSTHRD200: Use "Async" suffix for async methods dotnet_diagnostic.VSTHRD200.severity = none + +# Xml project files +[*.{csproj}] +indent_size = 2 +charset = utf-8 diff --git a/NuGet.config b/NuGet.config index 231d0f8008..976d8d3441 100644 --- a/NuGet.config +++ b/NuGet.config @@ -7,6 +7,7 @@ + diff --git a/eng/Versions.props b/eng/Versions.props index c80580b44d..96685cc388 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -33,8 +33,8 @@ 2 0.20.1 3.3.1 - 1.0.0-beta.20410.1 - 1.0.0-beta.20410.1 + 1.0.0-beta.21155.3 + 1.0.0-beta.21155.3 2.0.0 4.3.0 4.5.0 diff --git a/src/Microsoft.Data.Analysis.Interactive/DataFrameKernelExtension.cs b/src/Microsoft.Data.Analysis.Interactive/DataFrameKernelExtension.cs index 595c71e5a6..4ff4f8d0dd 100644 --- a/src/Microsoft.Data.Analysis.Interactive/DataFrameKernelExtension.cs +++ b/src/Microsoft.Data.Analysis.Interactive/DataFrameKernelExtension.cs @@ -24,10 +24,10 @@ public Task OnLoadAsync(Kernel kernel) public static void RegisterDataFrame() { - Formatter.Register((df, writer) => + Formatter.Register((df, writer) => { - const int MAX = 10000; - const int SIZE = 10; + const int maxRowCount = 10000; + const int rowsPerPage = 25; var uniqueId = DateTime.Now.Ticks; @@ -37,15 +37,15 @@ public static void RegisterDataFrame() }; header.AddRange(df.Columns.Select(c => (IHtmlContent)th(c.Name))); - if (df.Rows.Count > SIZE) + if (df.Rows.Count > rowsPerPage) { - var maxMessage = df.Rows.Count > MAX ? $" (showing a max of {MAX} rows)" : string.Empty; + var maxMessage = df.Rows.Count > maxRowCount ? $" (showing a max of {maxRowCount} rows)" : string.Empty; var title = h3[style: "text-align: center;"]($"DataFrame - {df.Rows.Count} rows {maxMessage}"); // table body - var maxRows = Math.Min(MAX, df.Rows.Count); + var rowCount = Math.Min(maxRowCount, df.Rows.Count); var rows = new List>(); - for (var index = 0; index < maxRows; index++) + for (var index = 0; index < rowCount; index++) { var cells = new List { @@ -58,29 +58,29 @@ public static void RegisterDataFrame() rows.Add(cells); } - //navigator + //navigator var footer = new List(); BuildHideRowsScript(uniqueId); - var paginateScriptFirst = BuildHideRowsScript(uniqueId) + GotoPageIndex(uniqueId, 0) + BuildPageScript(uniqueId, SIZE); + var paginateScriptFirst = BuildHideRowsScript(uniqueId) + GotoPageIndex(uniqueId, 0) + BuildPageScript(uniqueId, rowsPerPage); footer.Add(button[style: "margin: 2px;", onclick: paginateScriptFirst]("⏮")); - var paginateScriptPrevTen = BuildHideRowsScript(uniqueId) + UpdatePageIndex(uniqueId, -10, (maxRows - 1) / SIZE) + BuildPageScript(uniqueId, SIZE); + var paginateScriptPrevTen = BuildHideRowsScript(uniqueId) + UpdatePageIndex(uniqueId, -10, (rowCount - 1) / rowsPerPage) + BuildPageScript(uniqueId, rowsPerPage); footer.Add(button[style: "margin: 2px;", onclick: paginateScriptPrevTen]("⏪")); - var paginateScriptPrev = BuildHideRowsScript(uniqueId) + UpdatePageIndex(uniqueId, -1, (maxRows - 1) / SIZE) + BuildPageScript(uniqueId, SIZE); + var paginateScriptPrev = BuildHideRowsScript(uniqueId) + UpdatePageIndex(uniqueId, -1, (rowCount - 1) / rowsPerPage) + BuildPageScript(uniqueId, rowsPerPage); footer.Add(button[style: "margin: 2px;", onclick: paginateScriptPrev]("◀️")); footer.Add(b[style: "margin: 2px;"]("Page")); footer.Add(b[id: $"page_{uniqueId}", style: "margin: 2px;"]("1")); - var paginateScriptNext = BuildHideRowsScript(uniqueId) + UpdatePageIndex(uniqueId, 1, (maxRows - 1) / SIZE) + BuildPageScript(uniqueId, SIZE); + var paginateScriptNext = BuildHideRowsScript(uniqueId) + UpdatePageIndex(uniqueId, 1, (rowCount - 1) / rowsPerPage) + BuildPageScript(uniqueId, rowsPerPage); footer.Add(button[style: "margin: 2px;", onclick: paginateScriptNext]("▶️")); - var paginateScriptNextTen = BuildHideRowsScript(uniqueId) + UpdatePageIndex(uniqueId, 10, (maxRows - 1) / SIZE) + BuildPageScript(uniqueId, SIZE); + var paginateScriptNextTen = BuildHideRowsScript(uniqueId) + UpdatePageIndex(uniqueId, 10, (rowCount - 1) / rowsPerPage) + BuildPageScript(uniqueId, rowsPerPage); footer.Add(button[style: "margin: 2px;", onclick: paginateScriptNextTen]("⏩")); - var paginateScriptLast = BuildHideRowsScript(uniqueId) + GotoPageIndex(uniqueId, (maxRows - 1) / SIZE) + BuildPageScript(uniqueId, SIZE); + var paginateScriptLast = BuildHideRowsScript(uniqueId) + GotoPageIndex(uniqueId, (rowCount - 1) / rowsPerPage) + BuildPageScript(uniqueId, rowsPerPage); footer.Add(button[style: "margin: 2px;", onclick: paginateScriptLast]("⏭️")); //table @@ -93,7 +93,7 @@ public static void RegisterDataFrame() writer.Write(t); //show first page - writer.Write($""); + writer.Write($""); } else { diff --git a/src/Microsoft.Data.Analysis.Interactive/Microsoft.Data.Analysis.Interactive.csproj b/src/Microsoft.Data.Analysis.Interactive/Microsoft.Data.Analysis.Interactive.csproj index 3167c983dc..241a44cbca 100644 --- a/src/Microsoft.Data.Analysis.Interactive/Microsoft.Data.Analysis.Interactive.csproj +++ b/src/Microsoft.Data.Analysis.Interactive/Microsoft.Data.Analysis.Interactive.csproj @@ -1,18 +1,17 @@  - - netcoreapp3.1 - false - $(NoWarn);MSML_ParameterLocalVarName;SA1028 - + + netcoreapp3.1 + false + - - - - + + + + - - - + + + diff --git a/src/Microsoft.Data.Analysis/Microsoft.Data.Analysis.csproj b/src/Microsoft.Data.Analysis/Microsoft.Data.Analysis.csproj index 5511c493a4..e542ba000c 100644 --- a/src/Microsoft.Data.Analysis/Microsoft.Data.Analysis.csproj +++ b/src/Microsoft.Data.Analysis/Microsoft.Data.Analysis.csproj @@ -1,250 +1,250 @@  - - - netstandard2.0 - true - false - This package contains easy-to-use and high-performance libraries for data analysis and transformation. - Initial preview of robust and extensible types and algorithms for manipulating structured data that supports aggregations, statistical funtions, sorting, grouping, joins, merges, handling missing values and more. - ML.NET ML Machine Learning Data Science DataFrame Preparation DataView Analytics Exploration - true - - $(NoWarn);1591;NU5100;MSML_GeneralName;MSML_ParameterLocalVarName;MSML_PrivateFieldName;MSML_TypeParamName;SA1028;SA1507;SX1101;MSML_NoInstanceInitializers - $(TargetsForTfmSpecificContentInPackage);AddMDAIToInteractiveExtensionsFolder - - - - - - - - + $(NoWarn);1591;NU5100;MSML_GeneralName;MSML_ParameterLocalVarName;MSML_PrivateFieldName;MSML_TypeParamName;SA1028;SA1507;SX1101;MSML_NoInstanceInitializers + $(TargetsForTfmSpecificContentInPackage);AddMDAIToInteractiveExtensionsFolder + - - <_ItemsToIncludeForInteractive Update="@(_ItemsToIncludeForInteractive)" PackagePath="interactive-extensions/dotnet" /> - - - + + + + + + - - True - True - Converters.tt - - - True - True - PrimitiveDataFrameColumn.BinaryOperators.tt - + <_ItemsToIncludeForInteractive Update="@(_ItemsToIncludeForInteractive)" PackagePath="interactive-extensions/dotnet" /> + + - - - - - - - + + + True + True + Converters.tt + + + True + True + PrimitiveDataFrameColumn.BinaryOperators.tt + + - - - + + + + + + + - - - TextTemplatingFileGenerator - Converters.cs - - - TextTemplatingFileGenerator - PrimitiveDataFrameColumn.BinaryOperationAPIs.ExplodedColumns.cs - - - TextTemplatingFileGenerator - PrimitiveDataFrameColumn.BinaryOperationImplementations.Exploded.cs - - - TextTemplatingFileGenerator - DataFrameColumn.BinaryOperations.cs - - - TextTemplatingFileGenerator - DataFrameColumn.BinaryOperators.cs - - - TextTemplatingFileGenerator - DataFrameColumn.Computations.cs - - - TextTemplatingFileGenerator - DataFrame.BinaryOperations.cs - - - TextTemplatingFileGenerator - DataFrame.BinaryOperators.cs - - - TextTemplatingFileGenerator - DataFrameBinaryOperators.cs - - - TextTemplatingFileGenerator - PrimitiveDataFrameColumn.BinaryOperations.Combinations.ttinclude - - - True - True - PrimitiveDataFrameColumn.BinaryOperations.Combinations.tt - - - TextTemplatingFileGenerator - PrimitiveDataFrameColumn.BinaryOperations.cs - - - TextTemplatingFileGenerator - PrimitiveDataFrameColumn.BinaryOperators.cs - - - TextTemplatingFileGenerator - PrimitiveDataFrameColumn.Computations.cs - - - TextTemplatingFileGenerator - PrimitiveDataFrameColumn.ReversedBinaryOperations.cs - - - TextTemplatingFileGenerator - PrimitiveColumnArithmetic.cs - - - TextTemplatingFileGenerator - PrimitiveDataFrameColumnComputations.cs - - - TextTemplatingFileGenerator - PrimitiveColumnContainer.BinaryOperations.cs - - - TextTemplatingFileGenerator - PrimitiveDataFrameColumnArithmetic.cs - - - TextTemplatingFileGenerator - PrimitiveColumnContainer.BinaryOperations.cs - - + + + - - - + + + TextTemplatingFileGenerator + Converters.cs + + + TextTemplatingFileGenerator + PrimitiveDataFrameColumn.BinaryOperationAPIs.ExplodedColumns.cs + + + TextTemplatingFileGenerator + PrimitiveDataFrameColumn.BinaryOperationImplementations.Exploded.cs + + + TextTemplatingFileGenerator + DataFrameColumn.BinaryOperations.cs + + + TextTemplatingFileGenerator + DataFrameColumn.BinaryOperators.cs + + + TextTemplatingFileGenerator + DataFrameColumn.Computations.cs + + + TextTemplatingFileGenerator + DataFrame.BinaryOperations.cs + + + TextTemplatingFileGenerator + DataFrame.BinaryOperators.cs + + + TextTemplatingFileGenerator + DataFrameBinaryOperators.cs + + + TextTemplatingFileGenerator + PrimitiveDataFrameColumn.BinaryOperations.Combinations.ttinclude + + + True + True + PrimitiveDataFrameColumn.BinaryOperations.Combinations.tt + + + TextTemplatingFileGenerator + PrimitiveDataFrameColumn.BinaryOperations.cs + + + TextTemplatingFileGenerator + PrimitiveDataFrameColumn.BinaryOperators.cs + + + TextTemplatingFileGenerator + PrimitiveDataFrameColumn.Computations.cs + + + TextTemplatingFileGenerator + PrimitiveDataFrameColumn.ReversedBinaryOperations.cs + + + TextTemplatingFileGenerator + PrimitiveColumnArithmetic.cs + + + TextTemplatingFileGenerator + PrimitiveDataFrameColumnComputations.cs + + + TextTemplatingFileGenerator + PrimitiveColumnContainer.BinaryOperations.cs + + + TextTemplatingFileGenerator + PrimitiveDataFrameColumnArithmetic.cs + + + TextTemplatingFileGenerator + PrimitiveColumnContainer.BinaryOperations.cs + + - - - True - True - Converters.tt - - - True - True - PrimitiveDataFrameColumn.BinaryOperationImplementations.Exploded.tt - - - True - True - DataFrameColumn.BinaryOperations.tt - - - True - True - PrimitiveDataFrameColumn.BinaryOperationAPIs.ExplodedColumns.tt - - - True - True - DataFrameColumn.BinaryOperators.tt - - - True - True - DataFrameColumn.Computations.tt - - - True - True - DataFrame.BinaryOperations.tt - - - True - True - DataFrame.BinaryOperators.tt - - - True - True - DataFrameBinaryOperators.tt - - - True - True - PrimitiveDataFrameColumn.BinaryOperations.tt - - - True - True - PrimitiveDataFrameColumn.BinaryOperators.tt - - - True - True - PrimitiveDataFrameColumn.Computations.tt - - - True - True - PrimitiveDataFrameColumn.ReversedBinaryOperations.tt - - - True - True - PrimitiveColumnArithmetic.tt - - - True - True - PrimitiveDataFrameColumnComputations.tt - - - True - True - PrimitiveColumnContainer.BinaryOperations.tt - - - True - True - PrimitiveDataFrameColumnArithmetic.tt - - - True - True - PrimitiveColumnContainer.BinaryOperations.tt - - - True - True - Strings.resx - - + + + - - - ResXFileCodeGenerator - Strings.Designer.cs - Microsoft.Data - - + + + True + True + Converters.tt + + + True + True + PrimitiveDataFrameColumn.BinaryOperationImplementations.Exploded.tt + + + True + True + DataFrameColumn.BinaryOperations.tt + + + True + True + PrimitiveDataFrameColumn.BinaryOperationAPIs.ExplodedColumns.tt + + + True + True + DataFrameColumn.BinaryOperators.tt + + + True + True + DataFrameColumn.Computations.tt + + + True + True + DataFrame.BinaryOperations.tt + + + True + True + DataFrame.BinaryOperators.tt + + + True + True + DataFrameBinaryOperators.tt + + + True + True + PrimitiveDataFrameColumn.BinaryOperations.tt + + + True + True + PrimitiveDataFrameColumn.BinaryOperators.tt + + + True + True + PrimitiveDataFrameColumn.Computations.tt + + + True + True + PrimitiveDataFrameColumn.ReversedBinaryOperations.tt + + + True + True + PrimitiveColumnArithmetic.tt + + + True + True + PrimitiveDataFrameColumnComputations.tt + + + True + True + PrimitiveColumnContainer.BinaryOperations.tt + + + True + True + PrimitiveDataFrameColumnArithmetic.tt + + + True + True + PrimitiveColumnContainer.BinaryOperations.tt + + + True + True + Strings.resx + + + + + + ResXFileCodeGenerator + Strings.Designer.cs + Microsoft.Data + + diff --git a/test/Microsoft.Data.Analysis.Interactive.Tests/DataFrameInteractiveTests.cs b/test/Microsoft.Data.Analysis.Interactive.Tests/DataFrameInteractiveTests.cs index 7a6c2f61c3..033893819b 100644 --- a/test/Microsoft.Data.Analysis.Interactive.Tests/DataFrameInteractiveTests.cs +++ b/test/Microsoft.Data.Analysis.Interactive.Tests/DataFrameInteractiveTests.cs @@ -8,10 +8,10 @@ namespace Microsoft.Data.Analysis.Interactive.Tests { - public partial class DataFrameInteractiveTests + public class DataFrameInteractiveTests { - private const string BUTTON_HTML_PART = "button onclick"; - private const string TABLE_HTML_PART = ""; + private const string ButtonHtmlPart = "button onclick"; + private const string TableHtmlPart = " - - netcoreapp3.1 - $(NoWarn);MSML_PrivateFieldName;MSML_ExtendBaseTestClass - + + netcoreapp3.1 + $(NoWarn);MSML_ExtendBaseTestClass + - - - + + - - - - + + + + + + + +