|
2 | 2 | import {nextTick, Ref, ref} from "vue"; |
3 | 3 | import {withLoading} from "../../utils/loading"; |
4 | 4 | import {GraphData, GraphKind, GraphsSelector} from "../../graph/data"; |
5 | | -import {GRAPH_DATA_URL} from "../../urls"; |
6 | 5 | import DataSelector, {SelectionParams} from "./data-selector.vue"; |
7 | 6 | import { |
8 | 7 | createUrlWithAppendedParams, |
9 | 8 | getUrlParams, |
10 | 9 | navigateToUrlParams, |
11 | 10 | } from "../../utils/navigation"; |
12 | 11 | import {renderPlots} from "./plots"; |
13 | | -import {getJson} from "../../utils/requests"; |
14 | 12 | import {BenchmarkInfo, loadBenchmarkInfo} from "../../api"; |
15 | 13 | import AsOf from "../../components/as-of.vue"; |
| 14 | +import {loadGraphs} from "../../graph/api"; |
16 | 15 |
|
17 | 16 | function loadSelectorFromUrl(urlParams: Dict<string>): GraphsSelector { |
18 | 17 | const start = urlParams["start"] ?? ""; |
@@ -60,18 +59,10 @@ function hasSpecificSelection(selector: GraphsSelector): boolean { |
60 | 59 | } |
61 | 60 |
|
62 | 61 | async function loadGraphData(selector: GraphsSelector, loading: Ref<boolean>) { |
63 | | - const graphData: GraphData = await withLoading(loading, async () => { |
64 | | - const params = { |
65 | | - start: selector.start, |
66 | | - end: selector.end, |
67 | | - kind: selector.kind as string, |
68 | | - stat: selector.stat, |
69 | | - benchmark: selector.benchmark, |
70 | | - scenario: selector.scenario, |
71 | | - profile: selector.profile, |
72 | | - }; |
73 | | - return await getJson<GraphData>(GRAPH_DATA_URL, params); |
74 | | - }); |
| 62 | + const graphData: GraphData = await withLoading( |
| 63 | + loading, |
| 64 | + async () => await loadGraphs(selector) |
| 65 | + ); |
75 | 66 |
|
76 | 67 | // Wait for the UI to be updated, which also resets the plot HTML elements. |
77 | 68 | // Then draw the plots. |
|
0 commit comments