Skip to content

Commit 58ca396

Browse files
authored
Themed histogram (#200)
1 parent 1423868 commit 58ca396

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

src/services/analyticsProvider.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@ export class AnalyticsProvider
404404
return response;
405405
}
406406

407-
public async getHtmlGraphForSpanPercentiles(spanName: string, instrumentationLib: string, codeObjectId: string, environment: string): Promise<string>
407+
public async getHtmlGraphForSpanPercentiles(spanName: string, instrumentationLib: string, codeObjectId: string, environment: string, theme?: string): Promise<string>
408408
{
409409
const response: string = await this.sendAndResponseBodyAsString(
410410
'POST',
@@ -415,7 +415,8 @@ export class AnalyticsProvider
415415
environment: environment,
416416
spanName: spanName,
417417
instrumentationLibrary: instrumentationLib,
418-
codeObjectId: codeObjectId
418+
codeObjectId: codeObjectId,
419+
theme: theme
419420
});
420421
return response;
421422
}

src/views/codeAnalytics/Histogram/histogramPanel.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import * as vscode from "vscode";
12
import {AnalyticsProvider} from "../../../services/analyticsProvider";
23
import {WorkspaceState} from "../../../state";
34

@@ -7,9 +8,15 @@ export class HistogramPanel {
78
}
89

910
public async getHtml(spanName: string, instrumentationLibrary: string, codeObjectId: string): Promise<string> {
10-
11+
let theme;
12+
if (vscode.window.activeColorTheme.kind === vscode.ColorThemeKind.Dark){
13+
theme = 'dark';
14+
}
15+
if (vscode.window.activeColorTheme.kind === vscode.ColorThemeKind.Light){
16+
theme = 'light';
17+
}
1118
const html = await this._analyticsProvider.getHtmlGraphForSpanPercentiles(
12-
spanName, instrumentationLibrary, codeObjectId, this._workspaceState.environment);
19+
spanName, instrumentationLibrary, codeObjectId, this._workspaceState.environment, theme);
1320

1421
return html;
1522
}

0 commit comments

Comments
 (0)