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
22 changes: 18 additions & 4 deletions src/KustoLanguageServer/Charting/ChartOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,25 @@ public static ChartOptions FromChartVisualizationOptions(ChartVisualizationOptio
Legend = options.Legend.ToString(),
XAxis = options.XAxis.ToString(),
YAxis = options.YAxis.ToString(),
Xmin = options.Xmin,
Xmax = options.Xmax,
Ymin = options.Ymin,
Ymax = options.Ymax,
Xmin = ConvertNanToNull(options.Xmin),
Xmax = ConvertNanToNull(options.Xmax),
Ymin = ConvertNanToNull(options.Ymin),
Ymax = ConvertNanToNull(options.Ymax),
Accumulate = options.Accumulate
};
}

private static object? ConvertNanToNull(object? value)
{
return value switch
{
double d when double.IsNaN(d) => null,
double d when double.IsPositiveInfinity(d) => double.MaxValue,
double d when double.IsNegativeInfinity(d) => double.MinValue,
float f when float.IsNaN(f) => null,
float f when float.IsPositiveInfinity(f) => float.MaxValue,
float f when float.IsNegativeInfinity(f) => float.MinValue,
_ => value
};
}
}
2 changes: 1 addition & 1 deletion src/VsCodeExtension/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import * as conn from './features/connectionsPanel'
import * as connections from './features/connections'
import * as documentPanels from './features/documentPanels'
import * as chartPanel from './features/chartPanel'
import * as charts from './features/results'
import * as charts from './features/resultsEditor'
import * as copilot from './features/copilot'
import * as connectionStatusBar from './features/connectionStatusBar'
import * as clientStorage from './features/clientStorage'
Expand Down
2 changes: 1 addition & 1 deletion src/VsCodeExtension/features/chartPanel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import * as vscode from 'vscode';
import { LanguageClient } from 'vscode-languageclient/node';
import * as server from './server';
import { isDarkMode, injectChartMessageHandler, handleChartWebviewMessage, registerChartWebview, saveResults } from './results';
import { isDarkMode, injectChartMessageHandler, handleChartWebviewMessage, registerChartWebview, saveResults } from './resultsEditor';

let chartPanel: vscode.WebviewPanel | undefined;
let currentResultData: server.ResultData | undefined;
Expand Down
Loading
Loading