mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-02-16 10:58:30 -05:00
add visualization option support (#1160)
* add visualization option support * add comments
This commit is contained in:
@@ -2,6 +2,9 @@
|
|||||||
// Copyright (c) Microsoft. All rights reserved.
|
// Copyright (c) Microsoft. All rights reserved.
|
||||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||||
//
|
//
|
||||||
|
using System.Runtime.Serialization;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using Newtonsoft.Json.Converters;
|
||||||
|
|
||||||
namespace Microsoft.Kusto.ServiceLayer.QueryExecution.Contracts
|
namespace Microsoft.Kusto.ServiceLayer.QueryExecution.Contracts
|
||||||
{
|
{
|
||||||
@@ -40,7 +43,53 @@ namespace Microsoft.Kusto.ServiceLayer.QueryExecution.Contracts
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public SpecialAction SpecialAction { get; set; }
|
public SpecialAction SpecialAction { get; set; }
|
||||||
|
|
||||||
public override string ToString() => $"Result Summary Id:{Id}, Batch Id:'{BatchId}', RowCount:'{RowCount}', Complete:'{Complete}', SpecialAction:'{SpecialAction}'";
|
/// <summary>
|
||||||
|
/// The visualization options for the client to render charts.
|
||||||
|
/// </summary>
|
||||||
|
public VisualizationOptions Visualization { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns a string represents the current object.
|
||||||
|
/// </summary>
|
||||||
|
public override string ToString() => $"Result Summary Id:{Id}, Batch Id:'{BatchId}', RowCount:'{RowCount}', Complete:'{Complete}', SpecialAction:'{SpecialAction}', Visualization:'{Visualization}'";
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Represents the configuration options for data visualization
|
||||||
|
/// </summary>
|
||||||
|
public class VisualizationOptions
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the type of the visualization
|
||||||
|
/// </summary>
|
||||||
|
public VisualizationType Type { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The supported visualization types
|
||||||
|
/// </summary>
|
||||||
|
[JsonConverter(typeof(StringEnumConverter))]
|
||||||
|
public enum VisualizationType
|
||||||
|
{
|
||||||
|
[EnumMember(Value = "bar")]
|
||||||
|
Bar,
|
||||||
|
[EnumMember(Value = "count")]
|
||||||
|
Count,
|
||||||
|
[EnumMember(Value = "doughnut")]
|
||||||
|
Doughnut,
|
||||||
|
[EnumMember(Value = "horizontalBar")]
|
||||||
|
HorizontalBar,
|
||||||
|
[EnumMember(Value = "image")]
|
||||||
|
Image,
|
||||||
|
[EnumMember(Value = "line")]
|
||||||
|
Line,
|
||||||
|
[EnumMember(Value = "pie")]
|
||||||
|
Pie,
|
||||||
|
[EnumMember(Value = "scatter")]
|
||||||
|
Scatter,
|
||||||
|
[EnumMember(Value = "table")]
|
||||||
|
Table,
|
||||||
|
[EnumMember(Value = "timeSeries")]
|
||||||
|
TimeSeries
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,10 @@
|
|||||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||||
//
|
//
|
||||||
|
|
||||||
|
using System.Runtime.Serialization;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using Newtonsoft.Json.Converters;
|
||||||
|
|
||||||
namespace Microsoft.SqlTools.ServiceLayer.QueryExecution.Contracts
|
namespace Microsoft.SqlTools.ServiceLayer.QueryExecution.Contracts
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -40,7 +44,53 @@ namespace Microsoft.SqlTools.ServiceLayer.QueryExecution.Contracts
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public SpecialAction SpecialAction { get; set; }
|
public SpecialAction SpecialAction { get; set; }
|
||||||
|
|
||||||
public override string ToString() => $"Result Summary Id:{Id}, Batch Id:'{BatchId}', RowCount:'{RowCount}', Complete:'{Complete}', SpecialAction:'{SpecialAction}'";
|
/// <summary>
|
||||||
|
/// The visualization options for the client to render charts.
|
||||||
|
/// </summary>
|
||||||
|
public VisualizationOptions Visualization { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns a string represents the current object.
|
||||||
|
/// </summary>
|
||||||
|
public override string ToString() => $"Result Summary Id:{Id}, Batch Id:'{BatchId}', RowCount:'{RowCount}', Complete:'{Complete}', SpecialAction:'{SpecialAction}', Visualization:'{Visualization}'";
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Represents the configuration options for data visualization
|
||||||
|
/// </summary>
|
||||||
|
public class VisualizationOptions
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the type of the visualization
|
||||||
|
/// </summary>
|
||||||
|
public VisualizationType Type { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The supported visualization types
|
||||||
|
/// </summary>
|
||||||
|
[JsonConverter(typeof(StringEnumConverter))]
|
||||||
|
public enum VisualizationType
|
||||||
|
{
|
||||||
|
[EnumMember(Value = "bar")]
|
||||||
|
Bar,
|
||||||
|
[EnumMember(Value = "count")]
|
||||||
|
Count,
|
||||||
|
[EnumMember(Value = "doughnut")]
|
||||||
|
Doughnut,
|
||||||
|
[EnumMember(Value = "horizontalBar")]
|
||||||
|
HorizontalBar,
|
||||||
|
[EnumMember(Value = "image")]
|
||||||
|
Image,
|
||||||
|
[EnumMember(Value = "line")]
|
||||||
|
Line,
|
||||||
|
[EnumMember(Value = "pie")]
|
||||||
|
Pie,
|
||||||
|
[EnumMember(Value = "scatter")]
|
||||||
|
Scatter,
|
||||||
|
[EnumMember(Value = "table")]
|
||||||
|
Table,
|
||||||
|
[EnumMember(Value = "timeSeries")]
|
||||||
|
TimeSeries
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user