Skip to content

Commit

Permalink
Fix use of TimeGraphArrow sourceId and destinationId
Browse files Browse the repository at this point in the history
The sourceId and destinationId should be the row id of source row and
destination row. But it is used as the index of the source and
destination rows in the full list of rows.

Change to use the sourceId and destinationId properly. This requires
that the TimeGraphChartArrows layer receive the full list of row ids.

Enable unit tests in build pipeline.

Signed-off-by: Patrick Tasse <patrick.tasse@gmail.com>
  • Loading branch information
PatrickTasse committed May 10, 2022
1 parent 0b6178c commit 100418b
Show file tree
Hide file tree
Showing 6 changed files with 1,086 additions and 14 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ jobs:
NODE_OPTIONS: "--max_old_space_size=4096"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # https://github.com/microsoft/vscode-ripgrep/issues/9

- name: Test
shell: bash
run: |
yarn test
publish:
needs: build
if: github.ref == 'refs/heads/master' && github.event_name == 'push' && github.repository == 'eclipse-cdt-cloud/timeline-chart'
Expand Down
2 changes: 1 addition & 1 deletion example/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ timeGraphChart.registerMouseInteractions({
}
});

timeGraphChartArrows.addArrows(timeGraph.arrows);
timeGraphChartArrows.addArrows(timeGraph.arrows, testDataProvider.getRowIds());
timeGraphChartRangeEvents.addRangeEvents(timeGraph.rangeEvents);

const cursorReset = document.getElementById('cursor-reset');
Expand Down
8 changes: 8 additions & 0 deletions example/src/test-data-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,14 @@ export class TestDataProvider {
})
}

getRowIds(): number[] {
const rowIds: number[] = [];
timeGraphEntries.model.entries.forEach(entry => {
rowIds.push(entry.id);
});
return rowIds;
}

getData(opts: { range?: TimelineChart.TimeGraphRange, resolution?: number }): TimelineChart.TimeGraphModel {
const rows: TimelineChart.TimeGraphRowModel[] = [];
const range = opts.range || { start: BigInt(0), end: this.totalLength };
Expand Down
Loading

0 comments on commit 100418b

Please sign in to comment.