@@ -179,6 +179,133 @@ export class TspDataProvider {
179179 * Get data for sync analysis mode - fetches full range but normalizes time coordinates
180180 * to map selection range to 0 to delta_t
181181 */
182+ // async getDataForSyncAnalysis(
183+ // ids: number[],
184+ // entries: TimeGraphEntry[],
185+ // fetchArrows: boolean,
186+ // totalTimeRange: TimeRange,
187+ // worldRange?: TimelineChart.TimeGraphRange,
188+ // nbTimes?: number,
189+ // annotationMarkers?: string[],
190+ // markerSetId?: string,
191+ // additionalProperties?: { [key: string]: any }
192+ // ): Promise<TimelineChart.TimeGraphModel> {
193+ // this.timeGraphEntries = [...entries];
194+ // if (!this.timeGraphEntries.length || !worldRange || !nbTimes) {
195+ // return {
196+ // id: 'model',
197+ // totalLength: this.totalRange,
198+ // rows: [],
199+ // rangeEvents: [],
200+ // arrows: [],
201+ // data: {}
202+ // };
203+ // }
204+
205+ // // Fire all TSP requests
206+ // this.totalRange = totalTimeRange.getEnd() - totalTimeRange.getStart();
207+ // const start = totalTimeRange.getStart() + worldRange.start;
208+ // const end = totalTimeRange.getStart() + worldRange.end;
209+ // const timeGraphStateParams = QueryHelper.selectionTimeRangeQuery(
210+ // start,
211+ // end,
212+ // nbTimes,
213+ // ids,
214+ // additionalProperties ? additionalProperties : {}
215+ // );
216+ // const statesPromise = this.client.fetchTimeGraphStates(this.traceUUID, this.outputId, timeGraphStateParams);
217+
218+ // const additionalProps: { [key: string]: any } = {};
219+ // if (annotationMarkers) {
220+ // additionalProps['requested_marker_categories'] = annotationMarkers;
221+ // }
222+ // if (markerSetId) {
223+ // additionalProps['requested_marker_set'] = markerSetId;
224+ // }
225+ // const annotationParams = QueryHelper.selectionTimeRangeQuery(start, end, nbTimes, ids, additionalProps);
226+ // const annotations: Map<number, TimelineChart.TimeGraphAnnotation[]> = new Map();
227+ // const annotationsPromise = this.client.fetchAnnotations(this.traceUUID, this.outputId, annotationParams);
228+
229+ // const arrowStart = worldRange.start + this.timeGraphEntries[0].start;
230+ // const arrowEnd = worldRange.end + this.timeGraphEntries[0].start;
231+ // const fetchParameters = QueryHelper.timeRangeQuery(arrowStart, arrowEnd, nbTimes);
232+
233+ // // Wait for responses
234+ // const [tspClientAnnotationsResponse, tspClientStatesResponse] = await Promise.all([
235+ // annotationsPromise,
236+ // statesPromise
237+ // ]);
238+
239+ // // the start time which is normalized to logical 0 in timeline chart.
240+ // const chartStart = totalTimeRange.getStart();
241+
242+ // const annotationsResponse = tspClientAnnotationsResponse.getModel();
243+ // const rangeEvents: TimelineChart.TimeGraphAnnotation[] = [];
244+ // if (tspClientAnnotationsResponse.isOk() && annotationsResponse) {
245+ // Object.entries(annotationsResponse.model.annotations).forEach(([category, categoryArray]) => {
246+ // categoryArray.forEach(annotation => {
247+ // if (annotation.type === Type.CHART) {
248+ // if (annotation.entryId === -1) {
249+ // rangeEvents.push(this.getAnnotation(category, annotation, rangeEvents.length, chartStart));
250+ // } else {
251+ // let entryArray = annotations.get(annotation.entryId);
252+ // if (entryArray === undefined) {
253+ // entryArray = [];
254+ // annotations.set(annotation.entryId, entryArray);
255+ // }
256+ // entryArray.push(this.getAnnotation(category, annotation, entryArray.length, chartStart));
257+ // }
258+ // }
259+ // });
260+ // });
261+ // }
262+
263+ // const stateResponse = tspClientStatesResponse.getModel();
264+
265+ // if (tspClientStatesResponse.isOk() && stateResponse) {
266+ // this.timeGraphRows = stateResponse.model.rows;
267+ // this.timeGraphRowsOrdering(ids);
268+ // } else {
269+ // this.timeGraphRows = [];
270+ // }
271+
272+ // const rows: TimelineChart.TimeGraphRowModel[] = [];
273+ // this.timeGraphRows.forEach((row: TimeGraphRow) => {
274+ // const rowId: number = row.entryId;
275+ // const entry = this.timeGraphEntries.find(tgEntry => tgEntry.id === rowId);
276+ // if (entry) {
277+ // rows.push(this.getRowModel(row, chartStart, rowId, entry));
278+ // }
279+ // });
280+
281+ // for (const [entryId, entryArray] of annotations.entries()) {
282+ // const row = rows.find(tgEntry => tgEntry.id === entryId);
283+ // if (row) {
284+ // row.annotations = entryArray;
285+ // }
286+ // }
287+
288+ // let arrows: TimelineChart.TimeGraphArrow[] = [];
289+ // if (fetchArrows) {
290+ // const tspClientArrowsResponse = await this.client.fetchTimeGraphArrows(
291+ // this.traceUUID,
292+ // this.outputId,
293+ // fetchParameters
294+ // );
295+ // arrows = this.getArrows(tspClientArrowsResponse, worldRange, nbTimes);
296+ // }
297+
298+ // return {
299+ // id: 'model',
300+ // totalLength: this.totalRange,
301+ // rows,
302+ // arrows,
303+ // rangeEvents,
304+ // data: {
305+ // originalStart: chartStart
306+ // }
307+ // };
308+ // }
182309 async getDataForSyncAnalysis (
183310 ids : number [ ] ,
184311 entries : TimeGraphEntry [ ] ,
0 commit comments