Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,4 @@ jobs:
steps:
- uses: actions/checkout@v5
- uses: biomejs/setup-biome@v2
with:
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By deleting the fixed version specifier, the setup script will look at what version is declared as dependency in the project

version: "2.0.0"
- run: biome ci .
10 changes: 8 additions & 2 deletions biome.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
{
"$schema": "https://biomejs.dev/schemas/2.1.2/schema.json",
"$schema": "https://biomejs.dev/schemas/2.3.14/schema.json",
"assist": { "actions": { "source": { "organizeImports": "on" } } },
"files": {
"includes": ["**", "!**/app/**/*", "!**/data/**/*"]
"includes": [
"**",
"!**/app/**/*",
"!**/data/**/*",
"!**/docs/**/*",
"!**/scripts/**/*"
]
},
"linter": {
"enabled": true,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
}
},
"devDependencies": {
"@biomejs/biome": "2.3.1",
"@biomejs/biome": "2.3.14",
"@changesets/cli": "^2.29.7",
"@types/chroma-js": "^3.1.1",
"@types/node": "^24.9.1",
Expand Down
74 changes: 37 additions & 37 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 21 additions & 7 deletions src/__tests__/chromatin.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,9 @@ describe("resolveColor", () => {
expect(Array.isArray(result)).toBe(true);
assert(Array.isArray(result));
expect(result.length).toBe(4);
result.forEach((color) => expect(chroma.valid(color)).toBe(true));
result.forEach((color) => {
expect(chroma.valid(color)).toBe(true);
});
});

test("should resolve colors from numeric values array with string colorScale", () => {
Expand All @@ -345,7 +347,9 @@ describe("resolveColor", () => {
expect(Array.isArray(result)).toBe(true);
assert(Array.isArray(result));
expect(result).toHaveLength(4);
result.forEach((color) => expect(chroma.valid(color)).toBe(true));
result.forEach((color) => {
expect(chroma.valid(color)).toBe(true);
});
});

test("should resolve colors from categorical field", () => {
Expand All @@ -359,7 +363,9 @@ describe("resolveColor", () => {
expect(Array.isArray(result)).toBe(true);
assert(Array.isArray(result));
expect(result).toHaveLength(4);
result.forEach((color) => expect(chroma.valid(color)).toBe(true));
result.forEach((color) => {
expect(chroma.valid(color)).toBe(true);
});
});

test("should resolve colors from categorical values array", () => {
Expand All @@ -373,7 +379,9 @@ describe("resolveColor", () => {
expect(Array.isArray(result)).toBe(true);
assert(Array.isArray(result));
expect(result).toHaveLength(4);
result.forEach((color) => expect(chroma.valid(color)).toBe(true));
result.forEach((color) => {
expect(chroma.valid(color)).toBe(true);
});
});

test("should use default color range when min/max not provided for numeric scale", () => {
Expand All @@ -387,7 +395,9 @@ describe("resolveColor", () => {
expect(Array.isArray(result)).toBe(true);
assert(Array.isArray(result));
expect(result).toHaveLength(4);
result.forEach((color) => expect(chroma.valid(color)).toBe(true));
result.forEach((color) => {
expect(chroma.valid(color)).toBe(true);
});
});

test("should handle non-existent field gracefully", () => {
Expand Down Expand Up @@ -424,7 +434,9 @@ describe("resolveColor", () => {
expect(Array.isArray(result)).toBe(true);
assert(Array.isArray(result));
expect(result).toHaveLength(4);
result.forEach((color) => expect(chroma.valid(color)).toBe(true));
result.forEach((color) => {
expect(chroma.valid(color)).toBe(true);
});
});

test("should handle categorical colors when enough colors provided", () => {
Expand All @@ -438,7 +450,9 @@ describe("resolveColor", () => {
expect(Array.isArray(result)).toBe(true);
assert(Array.isArray(result));
expect(result).toHaveLength(4);
result.forEach((color) => expect(chroma.valid(color)).toBe(true));
result.forEach((color) => {
expect(chroma.valid(color)).toBe(true);
});
});

test("should throw when insufficient colors for categorical values", () => {
Expand Down
4 changes: 2 additions & 2 deletions src/chromatin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ export function resolveScale(table: Table, vc: ViewConfig): number | number[] {
}
assert(
values.length >= table.numRows,
"array length of \`scale.values\` in view config must be equal or larger than the number of bins",
"array length of `scale.values` in view config must be equal or larger than the number of bins",
);
scale = mapValuesToScale(values, vc.scale);
}
Expand Down Expand Up @@ -333,7 +333,7 @@ export function resolveColor(
}
assert(
vc.color.values.length >= table.numRows,
"array length of \`color.values\` in view config must be equal or larger than the number of bins",
"array length of `color.values` in view config must be equal or larger than the number of bins",
);
color = mapValuesToColors(vc.color.values, vc.color);
}
Expand Down
3 changes: 0 additions & 3 deletions src/data-loaders/loader-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ export const recenter = (originalPositions: vec3[]): vec3[] => {
vec3.add(vec3.create(), bbMax, bbMin),
0.5,
);
const bbSides = vec3.sub(vec3.create(), bbMax, bbMin);
bbSides.forEach((v: number) => Math.abs(v));

const positionsCentered = positions.map((a) =>
vec3.sub(vec3.create(), a, bbCenter),
);
Expand Down
Loading