-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from x-image-privacy/wordcloud-basile
Wordcloud working
- Loading branch information
Showing
13 changed files
with
1,870 additions
and
402 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
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
nodeLinker: node-modules | ||
|
||
plugins: | ||
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs | ||
spec: "@yarnpkg/plugin-interactive-tools" | ||
|
||
yarnPath: .yarn/releases/yarn-3.4.1.cjs |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
export const CONTAINER_WIDTH = 500; | ||
export const CONTAINER_HEIGHT = 300; | ||
export const CENTER_Y = CONTAINER_HEIGHT / 2; | ||
export const CENTER_X = CONTAINER_WIDTH / 2; | ||
|
||
export const DEFAULT_RECT = { x: CENTER_X, y: CENTER_Y, width: 10, height: 10 }; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { describe, expect, it } from "vitest"; | ||
import { areCentersTooClose, Coordinate, Rectangle } from "./utils"; | ||
|
||
const origin: Coordinate = { | ||
x: 0, | ||
y: 0, | ||
}; | ||
|
||
describe("areCentersTooClose", () => { | ||
it("No collisions", () => { | ||
expect(areCentersTooClose(origin, { x: 6, y: 0 }, 2, 2)).toBe(false); | ||
expect(areCentersTooClose(origin, { x: 0, y: 6 }, 2, 2)).toBe(false); | ||
expect(areCentersTooClose({ x: 0, y: 6 }, origin, 2, 2)).toBe(false); | ||
}); | ||
it("Collisions in X", () => { | ||
expect(areCentersTooClose(origin, { x: 2, y: 0 }, 3, 2)).toBe(true); | ||
expect(areCentersTooClose(origin, { x: 2, y: 0 }, 2.1, 2)).toBe(true); | ||
expect(areCentersTooClose({ x: 2, y: 0 }, origin, 2.1, 2)).toBe(true); | ||
}); | ||
it("Collisions in Y", () => { | ||
expect(areCentersTooClose(origin, { x: 0, y: 2 }, 2, 3)).toBe(true); | ||
expect(areCentersTooClose(origin, { x: 0, y: 2 }, 2, 2.1)).toBe(true); | ||
expect(areCentersTooClose({ x: 0, y: 2 }, origin, 2, 2.1)).toBe(true); | ||
}); | ||
it("Collisions in X and Y", () => { | ||
expect(areCentersTooClose(origin, { x: 2, y: 2 }, 2.5, 2.5)).toBe(true); | ||
expect(areCentersTooClose(origin, { x: -2, y: -2 }, 2.5, 2.5)).toBe(true); | ||
expect(areCentersTooClose({ x: -2, y: -2 }, origin, 2.5, 2.5)).toBe(true); | ||
}); | ||
}); |
Oops, something went wrong.