-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
43 changed files
with
468 additions
and
326 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: E2E Tests - Playwright | ||
on: | ||
pull_request: | ||
branches: [main, master] | ||
jobs: | ||
tests: | ||
timeout-minutes: 600 | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
working-directory: ./packages/view | ||
steps: | ||
- uses: actions/checkout@v2 # v3 is not available as of my last update in January 2022 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18.16.0 | ||
|
||
# Add Playwright GitHub Action | ||
- name: Setup Playwright | ||
uses: microsoft/playwright-github-action@v1 | ||
|
||
- name: Install dependencies | ||
run: npm i | ||
|
||
- name: npx playwright install | ||
run: npx playwright install | ||
|
||
- name: Run Playwright tests | ||
run: npm run test:e2e |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 3 additions & 1 deletion
4
packages/view/src/components/VerticalClusterList/ClusterGraph/ClusterGraph.const.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
packages/view/src/components/VerticalClusterList/ClusterGraph/Draws/destroyClusterGraph.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import type { RefObject } from "react"; | ||
import * as d3 from "d3"; | ||
|
||
export const destroyClusterGraph = (target: RefObject<SVGElement>) => d3.select(target.current).selectAll("*").remove(); |
13 changes: 13 additions & 0 deletions
13
packages/view/src/components/VerticalClusterList/ClusterGraph/Draws/drawClusterBox.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import type { SVGElementSelection } from "../ClusterGraph.type"; | ||
|
||
export const drawClusterBox = ( | ||
container: SVGElementSelection<SVGGElement>, | ||
graphWidth: number, | ||
clusterHeight: number | ||
) => { | ||
container | ||
.append("rect") | ||
.attr("class", "cluster-graph-container__box") | ||
.attr("width", graphWidth) | ||
.attr("height", clusterHeight); | ||
}; |
17 changes: 17 additions & 0 deletions
17
...ges/view/src/components/VerticalClusterList/ClusterGraph/Draws/drawCommitAmountCluster.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import * as d3 from "d3"; | ||
|
||
import type { SVGElementSelection } from "../ClusterGraph.type"; | ||
|
||
export const drawCommitAmountCluster = ( | ||
container: SVGElementSelection<SVGGElement>, | ||
graphHeight: number, | ||
clusterHeight: number | ||
) => { | ||
const widthScale = d3.scaleLinear().range([0, graphHeight]).domain([0, 10]); | ||
container | ||
.append("rect") | ||
.attr("class", "cluster-graph-container__commit-amount-cluster") | ||
.attr("width", (d) => widthScale(Math.min(d.clusterSize, 10))) | ||
.attr("height", clusterHeight) | ||
.attr("x", (d) => (graphHeight - widthScale(Math.min(d.clusterSize, 10))) / 2); | ||
}; |
37 changes: 37 additions & 0 deletions
37
packages/view/src/components/VerticalClusterList/ClusterGraph/Draws/drawTotalLine.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import type { RefObject } from "react"; | ||
import * as d3 from "d3"; | ||
|
||
import type { ClusterGraphElement, SVGMargin } from "../ClusterGraph.type"; | ||
|
||
export const drawTotalLine = ( | ||
svgRef: RefObject<SVGSVGElement>, | ||
data: ClusterGraphElement[], | ||
detailElementHeight: number, | ||
svgMargin: SVGMargin, | ||
clusterHeight: number, | ||
nodeGap: number, | ||
graphWidth: number | ||
) => { | ||
const lineData = [ | ||
{ | ||
start: svgMargin.top, | ||
end: (clusterHeight + nodeGap) * data.length, | ||
selected: { | ||
prev: data[0].selected.prev, | ||
current: data[0].selected.current, | ||
}, | ||
}, | ||
]; | ||
|
||
d3.select(svgRef.current) | ||
.selectAll(".cluster-graph__total-line") | ||
.data(lineData) | ||
.join("line") | ||
.attr("class", "cluster-graph__total-line") | ||
.attr("x1", svgMargin.left + graphWidth / 2) | ||
.attr("y1", (d) => d.start) | ||
.attr("x2", svgMargin.left + graphWidth / 2) | ||
.attr("y2", (d) => d.end + d.selected.prev.length * detailElementHeight) | ||
.transition() | ||
.attr("y2", (d) => d.end + d.selected.current.length * detailElementHeight); | ||
}; |
4 changes: 4 additions & 0 deletions
4
packages/view/src/components/VerticalClusterList/ClusterGraph/Draws/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export * from "./drawClusterBox"; | ||
export * from "./drawCommitAmountCluster"; | ||
export * from "./drawTotalLine"; | ||
export * from "./destroyClusterGraph"; |
Oops, something went wrong.