Added @typescript-eslint/recommended config with suppressions (#2345)

* Disabled @blueprintjs/classes-constants. #2288.

* thuang-eslint-bp-off (#2344)

* Disabled @blueprintjs/classes-constants on webpack dev and shared. #2288.

* Added TS recommended, suppress lint errors codemod.

* Added per-error/warning ignore for tests.

* Added per-error/warning ignore for configuration.

* Added per-error/warning ignore for src. Removed suppress package.

* Minor linting.

Co-authored-by: Timmy Huang <tihuan@users.noreply.github.com>
This commit is contained in:
Mim Hastie
2021-07-28 16:06:34 -07:00
committed by GitHub
co-authored by Timmy Huang
parent 32f60a1547
commit 27575b8d86
163 changed files with 1827 additions and 64 deletions
+54
View File
@@ -18,6 +18,7 @@ import {
import { appUrlBase, TEST_EMAIL, TEST_PASSWORD } from "./config"; import { appUrlBase, TEST_EMAIL, TEST_PASSWORD } from "./config";
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
export async function drag(testId: any, start: any, end: any, lasso = false) { export async function drag(testId: any, start: any, end: any, lasso = false) {
const layout = await waitByID(testId); const layout = await waitByID(testId);
// @ts-expect-error ts-migrate(2531) FIXME: Object is possibly 'null'. // @ts-expect-error ts-migrate(2531) FIXME: Object is possibly 'null'.
@@ -43,6 +44,7 @@ export async function drag(testId: any, start: any, end: any, lasso = false) {
await page.mouse.up(); await page.mouse.up();
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
export async function clickOnCoordinate(testId: any, coord: any) { export async function clickOnCoordinate(testId: any, coord: any) {
const layout = await expect(page).toMatchElement(getTestId(testId)); const layout = await expect(page).toMatchElement(getTestId(testId));
const elBox = await layout.boxModel(); const elBox = await layout.boxModel();
@@ -56,7 +58,9 @@ export async function clickOnCoordinate(testId: any, coord: any) {
await page.mouse.click(x, y); await page.mouse.click(x, y);
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
export async function getAllHistograms(testclass: any, testIds: any) { export async function getAllHistograms(testclass: any, testIds: any) {
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
const histTestIds = testIds.map((tid: any) => `histogram-${tid}`); const histTestIds = testIds.map((tid: any) => `histogram-${tid}`);
// these load asynchronously, so we need to wait for each histogram individually, // these load asynchronously, so we need to wait for each histogram individually,
@@ -77,6 +81,7 @@ export async function getAllHistograms(testclass: any, testIds: any) {
return testIDs.map((id) => id.replace(/^histogram-/, "")); return testIDs.map((id) => id.replace(/^histogram-/, ""));
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
export async function getAllCategoriesAndCounts(category: any) { export async function getAllCategoriesAndCounts(category: any) {
// these load asynchronously, so we have to wait for the specific category. // these load asynchronously, so we have to wait for the specific category.
await waitByID(`category-${category}`); await waitByID(`category-${category}`);
@@ -93,6 +98,7 @@ export async function getAllCategoriesAndCounts(category: any) {
const count = (row.querySelector( const count = (row.querySelector(
"[data-testclass='categorical-value-count']" "[data-testclass='categorical-value-count']"
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
) as any).innerText; ) as any).innerText;
return [cat, count]; return [cat, count];
@@ -101,11 +107,13 @@ export async function getAllCategoriesAndCounts(category: any) {
); );
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
export async function getCellSetCount(num: any) { export async function getCellSetCount(num: any) {
await clickOn(`cellset-button-${num}`); await clickOn(`cellset-button-${num}`);
return getOneElementInnerText(`[data-testid='cellset-count-${num}']`); return getOneElementInnerText(`[data-testid='cellset-count-${num}']`);
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
export async function resetCategory(category: any) { export async function resetCategory(category: any) {
const checkboxId = `${category}:category-select`; const checkboxId = `${category}:category-select`;
await waitByID(checkboxId); await waitByID(checkboxId);
@@ -125,9 +133,13 @@ export async function resetCategory(category: any) {
if (isExpanded) await clickOn(`${category}:category-expand`); if (isExpanded) await clickOn(`${category}:category-expand`);
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
export async function calcCoordinate( export async function calcCoordinate(
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
testId: any, testId: any,
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
xAsPercent: any, xAsPercent: any,
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
yAsPercent: any yAsPercent: any
) { ) {
const el = await waitByID(testId); const el = await waitByID(testId);
@@ -141,8 +153,11 @@ export async function calcCoordinate(
}; };
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
export async function calcDragCoordinates( export async function calcDragCoordinates(
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
testId: any, testId: any,
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
coordinateAsPercent: any coordinateAsPercent: any
) { ) {
return { return {
@@ -159,6 +174,7 @@ export async function calcDragCoordinates(
}; };
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
export async function selectCategory(category: any, values: any, reset = true) { export async function selectCategory(category: any, values: any, reset = true) {
if (reset) await resetCategory(category); if (reset) await resetCategory(category);
@@ -170,6 +186,7 @@ export async function selectCategory(category: any, values: any, reset = true) {
} }
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
export async function expandCategory(category: any) { export async function expandCategory(category: any) {
const expand = await waitByID(`${category}:category-expand`); const expand = await waitByID(`${category}:category-expand`);
// @ts-expect-error ts-migrate(2531) FIXME: Object is possibly 'null'. // @ts-expect-error ts-migrate(2531) FIXME: Object is possibly 'null'.
@@ -179,6 +196,7 @@ export async function expandCategory(category: any) {
if (notExpanded) await clickOn(`${category}:category-expand`); if (notExpanded) await clickOn(`${category}:category-expand`);
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
export async function clip(min = 0, max = 100) { export async function clip(min = 0, max = 100) {
await clickOn("visualization-settings"); await clickOn("visualization-settings");
await clearInputAndTypeInto("clip-min-input", min); await clearInputAndTypeInto("clip-min-input", min);
@@ -186,6 +204,7 @@ export async function clip(min = 0, max = 100) {
await clickOn("clip-commit"); await clickOn("clip-commit");
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
export async function createCategory(categoryName: any) { export async function createCategory(categoryName: any) {
await clickOnUntil("open-annotation-dialog", async () => { await clickOnUntil("open-annotation-dialog", async () => {
await expect(page).toMatchElement(getTestId("new-category-name")); await expect(page).toMatchElement(getTestId("new-category-name"));
@@ -201,14 +220,17 @@ export async function createCategory(categoryName: any) {
*/ */
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
export async function colorByGeneset(genesetName: any) { export async function colorByGeneset(genesetName: any) {
await clickOn(`${genesetName}:colorby-entire-geneset`); await clickOn(`${genesetName}:colorby-entire-geneset`);
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
export async function colorByGene(gene: any) { export async function colorByGene(gene: any) {
await clickOn(`colorby-${gene}`); await clickOn(`colorby-${gene}`);
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
export async function assertColorLegendLabel(label: any) { export async function assertColorLegendLabel(label: any) {
const handle = await waitByID("continuous_legend_color_by_label"); const handle = await waitByID("continuous_legend_color_by_label");
@@ -220,6 +242,7 @@ export async function assertColorLegendLabel(label: any) {
return expect(result).toBe(label); return expect(result).toBe(label);
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
export async function expandGeneset(genesetName: any) { export async function expandGeneset(genesetName: any) {
const expand = await waitByID(`${genesetName}:geneset-expand`); const expand = await waitByID(`${genesetName}:geneset-expand`);
// @ts-expect-error ts-migrate(2531) FIXME: Object is possibly 'null'. // @ts-expect-error ts-migrate(2531) FIXME: Object is possibly 'null'.
@@ -229,6 +252,7 @@ export async function expandGeneset(genesetName: any) {
if (notExpanded) await clickOn(`${genesetName}:geneset-expand`); if (notExpanded) await clickOn(`${genesetName}:geneset-expand`);
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
export async function createGeneset(genesetName: any) { export async function createGeneset(genesetName: any) {
await clickOnUntil("open-create-geneset-dialog", async () => { await clickOnUntil("open-create-geneset-dialog", async () => {
await expect(page).toMatchElement(getTestId("create-geneset-input")); await expect(page).toMatchElement(getTestId("create-geneset-input"));
@@ -239,6 +263,7 @@ export async function createGeneset(genesetName: any) {
await waitByClass("autosave-complete"); await waitByClass("autosave-complete");
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
export async function editGenesetName(genesetName: any, editText: any) { export async function editGenesetName(genesetName: any, editText: any) {
const editButton = `${genesetName}:edit-genesetName-mode`; const editButton = `${genesetName}:edit-genesetName-mode`;
const submitButton = `${genesetName}:submit-geneset`; const submitButton = `${genesetName}:submit-geneset`;
@@ -250,6 +275,7 @@ export async function editGenesetName(genesetName: any, editText: any) {
await clickOn(submitButton); await clickOn(submitButton);
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
export async function deleteGeneset(genesetName: any) { export async function deleteGeneset(genesetName: any) {
const targetId = `${genesetName}:delete-geneset`; const targetId = `${genesetName}:delete-geneset`;
@@ -263,6 +289,7 @@ export async function deleteGeneset(genesetName: any) {
await waitByClass("autosave-complete"); await waitByClass("autosave-complete");
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
export async function assertGenesetDoesNotExist(genesetName: any) { export async function assertGenesetDoesNotExist(genesetName: any) {
// @ts-expect-error ts-migrate(2554) FIXME: Expected 2 arguments, but got 1. // @ts-expect-error ts-migrate(2554) FIXME: Expected 2 arguments, but got 1.
const result = await isElementPresent( const result = await isElementPresent(
@@ -271,6 +298,7 @@ export async function assertGenesetDoesNotExist(genesetName: any) {
await expect(result).toBe(false); await expect(result).toBe(false);
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
export async function assertGenesetExists(genesetName: any) { export async function assertGenesetExists(genesetName: any) {
const handle = await waitByID(`${genesetName}:geneset-name`); const handle = await waitByID(`${genesetName}:geneset-name`);
@@ -288,6 +316,7 @@ export async function assertGenesetExists(genesetName: any) {
*/ */
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
export async function addGeneToSet(genesetName: any, geneToAddToSet: any) { export async function addGeneToSet(genesetName: any, geneToAddToSet: any) {
const submitButton = `${genesetName}:submit-gene`; const submitButton = `${genesetName}:submit-gene`;
@@ -296,6 +325,7 @@ export async function addGeneToSet(genesetName: any, geneToAddToSet: any) {
await clickOn(submitButton); await clickOn(submitButton);
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
export async function removeGene(geneSymbol: any) { export async function removeGene(geneSymbol: any) {
const targetId = `delete-from-geneset:${geneSymbol}`; const targetId = `delete-from-geneset:${geneSymbol}`;
@@ -304,6 +334,7 @@ export async function removeGene(geneSymbol: any) {
await waitByClass("autosave-complete"); await waitByClass("autosave-complete");
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
export async function assertGeneExistsInGeneset(geneSymbol: any) { export async function assertGeneExistsInGeneset(geneSymbol: any) {
const handle = await waitByID(`${geneSymbol}:gene-label`); const handle = await waitByID(`${geneSymbol}:gene-label`);
@@ -315,6 +346,7 @@ export async function assertGeneExistsInGeneset(geneSymbol: any) {
return expect(result).toBe(geneSymbol); return expect(result).toBe(geneSymbol);
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
export async function assertGeneDoesNotExist(geneSymbol: any) { export async function assertGeneDoesNotExist(geneSymbol: any) {
// @ts-expect-error ts-migrate(2554) FIXME: Expected 2 arguments, but got 1. // @ts-expect-error ts-migrate(2554) FIXME: Expected 2 arguments, but got 1.
const result = await isElementPresent(getTestId(`${geneSymbol}:gene-label`)); const result = await isElementPresent(getTestId(`${geneSymbol}:gene-label`));
@@ -322,6 +354,7 @@ export async function assertGeneDoesNotExist(geneSymbol: any) {
await expect(result).toBe(false); await expect(result).toBe(false);
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
export async function expandGene(geneSymbol: any) { export async function expandGene(geneSymbol: any) {
await clickOn(`maximize-${geneSymbol}`); await clickOn(`maximize-${geneSymbol}`);
} }
@@ -332,6 +365,7 @@ export async function expandGene(geneSymbol: any) {
*/ */
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
export async function duplicateCategory(categoryName: any) { export async function duplicateCategory(categoryName: any) {
await clickOn("open-annotation-dialog"); await clickOn("open-annotation-dialog");
@@ -358,8 +392,11 @@ export async function duplicateCategory(categoryName: any) {
await waitByClass("autosave-complete"); await waitByClass("autosave-complete");
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
export async function renameCategory( export async function renameCategory(
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
oldCategoryName: any, oldCategoryName: any,
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
newCategoryName: any newCategoryName: any
) { ) {
await clickOn(`${oldCategoryName}:see-actions`); await clickOn(`${oldCategoryName}:see-actions`);
@@ -371,6 +408,7 @@ export async function renameCategory(
await clickOn(`${oldCategoryName}:submit-category-edit`); await clickOn(`${oldCategoryName}:submit-category-edit`);
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
export async function deleteCategory(categoryName: any) { export async function deleteCategory(categoryName: any) {
const targetId = `${categoryName}:delete-category`; const targetId = `${categoryName}:delete-category`;
@@ -384,6 +422,7 @@ export async function deleteCategory(categoryName: any) {
await assertCategoryDoesNotExist(); await assertCategoryDoesNotExist();
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
export async function createLabel(categoryName: any, labelName: any) { export async function createLabel(categoryName: any, labelName: any) {
/** /**
* (thuang): This explicit wait is needed, since currently showing * (thuang): This explicit wait is needed, since currently showing
@@ -409,15 +448,20 @@ export async function createLabel(categoryName: any, labelName: any) {
await clickOn(`${categoryName}:submit-label`); await clickOn(`${categoryName}:submit-label`);
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
export async function deleteLabel(categoryName: any, labelName: any) { export async function deleteLabel(categoryName: any, labelName: any) {
await expandCategory(categoryName); await expandCategory(categoryName);
await clickOn(`${categoryName}:${labelName}:see-actions`); await clickOn(`${categoryName}:${labelName}:see-actions`);
await clickOn(`${categoryName}:${labelName}:delete-label`); await clickOn(`${categoryName}:${labelName}:delete-label`);
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
export async function renameLabel( export async function renameLabel(
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
categoryName: any, categoryName: any,
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
oldLabelName: any, oldLabelName: any,
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
newLabelName: any newLabelName: any
) { ) {
await expandCategory(categoryName); await expandCategory(categoryName);
@@ -430,12 +474,14 @@ export async function renameLabel(
await clickOn(`${categoryName}:${oldLabelName}:submit-label-edit`); await clickOn(`${categoryName}:${oldLabelName}:submit-label-edit`);
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
export async function addGeneToSearch(geneName: any) { export async function addGeneToSearch(geneName: any) {
await typeInto("gene-search", geneName); await typeInto("gene-search", geneName);
await page.keyboard.press("Enter"); await page.keyboard.press("Enter");
await page.waitForSelector(`[data-testid='histogram-${geneName}']`); await page.waitForSelector(`[data-testid='histogram-${geneName}']`);
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
export async function subset(coordinatesAsPercent: any) { export async function subset(coordinatesAsPercent: any) {
// In order to deselect the selection after the subset, make sure we have some clear part // In order to deselect the selection after the subset, make sure we have some clear part
// of the scatterplot we can click on // of the scatterplot we can click on
@@ -450,7 +496,9 @@ export async function subset(coordinatesAsPercent: any) {
await clickOnCoordinate("layout-graph", clearCoordinate); await clickOnCoordinate("layout-graph", clearCoordinate);
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
export async function setSellSet(cellSet: any, cellSetNum: any) { export async function setSellSet(cellSet: any, cellSetNum: any) {
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
const selections = cellSet.filter((sel: any) => sel.kind === "categorical"); const selections = cellSet.filter((sel: any) => sel.kind === "categorical");
for (const selection of selections) { for (const selection of selections) {
@@ -460,18 +508,21 @@ export async function setSellSet(cellSet: any, cellSetNum: any) {
await getCellSetCount(cellSetNum); await getCellSetCount(cellSetNum);
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
export async function runDiffExp(cellSet1: any, cellSet2: any) { export async function runDiffExp(cellSet1: any, cellSet2: any) {
await setSellSet(cellSet1, 1); await setSellSet(cellSet1, 1);
await setSellSet(cellSet2, 2); await setSellSet(cellSet2, 2);
await clickOn("diffexp-button"); await clickOn("diffexp-button");
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
export async function bulkAddGenes(geneNames: any) { export async function bulkAddGenes(geneNames: any) {
await clickOn("section-bulk-add"); await clickOn("section-bulk-add");
await typeInto("input-bulk-add", geneNames.join(",")); await typeInto("input-bulk-add", geneNames.join(","));
await page.keyboard.press("Enter"); await page.keyboard.press("Enter");
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
export async function assertCategoryDoesNotExist(categoryName: any) { export async function assertCategoryDoesNotExist(categoryName: any) {
// @ts-expect-error ts-migrate(2554) FIXME: Expected 2 arguments, but got 1. // @ts-expect-error ts-migrate(2554) FIXME: Expected 2 arguments, but got 1.
const result = await isElementPresent( const result = await isElementPresent(
@@ -481,6 +532,7 @@ export async function assertCategoryDoesNotExist(categoryName: any) {
await expect(result).toBe(false); await expect(result).toBe(false);
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
export async function login() { export async function login() {
await goToPage(appUrlBase); await goToPage(appUrlBase);
@@ -502,6 +554,7 @@ export async function login() {
expect(page.url()).toContain(appUrlBase); expect(page.url()).toContain(appUrlBase);
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
export async function logout() { export async function logout() {
await clickOnUntil("user-info", async () => { await clickOnUntil("user-info", async () => {
await waitByID("log-out"); await waitByID("log-out");
@@ -514,6 +567,7 @@ export async function logout() {
await waitByID("log-in"); await waitByID("log-in");
} }
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
async function waitUntilFormFieldStable(selector: any) { async function waitUntilFormFieldStable(selector: any) {
const MAX_RETRY = 10; const MAX_RETRY = 10;
const WAIT_FOR_MS = 200; const WAIT_FOR_MS = 200;
@@ -76,6 +76,7 @@ const brushThisGeneGeneset = "brush_this_gene";
const geneBrushedCellCount = "109"; const geneBrushedCellCount = "109";
const subsetGeneBrushedCellCount = "96"; const subsetGeneBrushedCellCount = "96";
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
async function setup(config: any) { async function setup(config: any) {
await goToPage(appUrlBase); await goToPage(appUrlBase);
@@ -150,6 +151,7 @@ describe.each([
await expect(page).toClick(getTestClass("pop-1-geneset-expand")); await expect(page).toClick(getTestClass("pop-1-geneset-expand"));
await page.waitForFunction( await page.waitForFunction(
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
(selector: any) => !document.querySelector(selector), (selector: any) => !document.querySelector(selector),
{}, {},
getTestClass("gene-loading-spinner") getTestClass("gene-loading-spinner")
@@ -165,6 +167,7 @@ describe.each([
await expect(page).toClick(getTestClass("pop-2-geneset-expand")); await expect(page).toClick(getTestClass("pop-2-geneset-expand"));
await page.waitForFunction( await page.waitForFunction(
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
(selector: any) => !document.querySelector(selector), (selector: any) => !document.querySelector(selector),
{}, {},
getTestClass("gene-loading-spinner") getTestClass("gene-loading-spinner")
@@ -362,9 +365,11 @@ describe.each([
expect(actualLabelName).toBe(expectedLabelName); expect(actualLabelName).toBe(expectedLabelName);
expect(actualLabelCount).toBe(expectedLabelCount); expect(actualLabelCount).toBe(expectedLabelCount);
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
async function getInnerText(element: any, className: any) { async function getInnerText(element: any, className: any) {
return element.$eval( return element.$eval(
getTestClass(className), getTestClass(className),
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
(node: any) => node?.innerText (node: any) => node?.innerText
); );
} }
@@ -531,6 +536,7 @@ describe.each([
expect(result).toMatchSnapshot(); expect(result).toMatchSnapshot();
}); });
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
async function assertCategoryExists(categoryName: any) { async function assertCategoryExists(categoryName: any) {
const handle = await waitByID(`${categoryName}:category-label`); const handle = await waitByID(`${categoryName}:category-label`);
@@ -542,6 +548,7 @@ describe.each([
return expect(result).toBe(categoryName); return expect(result).toBe(categoryName);
} }
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
async function assertLabelExists(categoryName: any, labelName: any) { async function assertLabelExists(categoryName: any, labelName: any) {
await expect(page).toMatchElement( await expect(page).toMatchElement(
getTestId(`${categoryName}:category-expand`) getTestId(`${categoryName}:category-expand`)
@@ -559,6 +566,7 @@ describe.each([
).toBe(labelName); ).toBe(labelName);
} }
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
async function assertLabelDoesNotExist(categoryName: any, labelName: any) { async function assertLabelDoesNotExist(categoryName: any, labelName: any) {
await expandCategory(categoryName); await expandCategory(categoryName);
const result = await page.$( const result = await page.$(
+1
View File
@@ -50,6 +50,7 @@ beforeEach(async () => {
} }
const errorMsgText = await Promise.all( const errorMsgText = await Promise.all(
// TODO can we do this without internal properties? // TODO can we do this without internal properties?
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
msg.args().map((arg: any) => arg._remoteObject.description) msg.args().map((arg: any) => arg._remoteObject.description)
); );
throw new Error(`Console error: ${errorMsgText}`); throw new Error(`Console error: ${errorMsgText}`);
+17
View File
@@ -1,30 +1,38 @@
/* eslint-disable no-await-in-loop -- await in loop is needed to emulate sequential user actions */ /* eslint-disable no-await-in-loop -- await in loop is needed to emulate sequential user actions */
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
export function getTestId(id: any) { export function getTestId(id: any) {
return `[data-testid='${id}']`; return `[data-testid='${id}']`;
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
export function getTestClass(className: any) { export function getTestClass(className: any) {
return `[data-testclass='${className}']`; return `[data-testclass='${className}']`;
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
export async function waitByID(testId: any, props = {}) { export async function waitByID(testId: any, props = {}) {
return page.waitForSelector(getTestId(testId), props); return page.waitForSelector(getTestId(testId), props);
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
export async function waitByClass(testClass: any, props = {}) { export async function waitByClass(testClass: any, props = {}) {
return page.waitForSelector(`[data-testclass='${testClass}']`, props); return page.waitForSelector(`[data-testclass='${testClass}']`, props);
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
export async function waitForAllByIds(testIds: any) { export async function waitForAllByIds(testIds: any) {
await Promise.all( await Promise.all(
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
testIds.map((testId: any) => page.waitForSelector(getTestId(testId))) testIds.map((testId: any) => page.waitForSelector(getTestId(testId)))
); );
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
export async function getAllByClass(testClass: any) { export async function getAllByClass(testClass: any) {
return page.$$(`[data-testclass=${testClass}]`); return page.$$(`[data-testclass=${testClass}]`);
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
export async function typeInto(testId: any, text: any) { export async function typeInto(testId: any, text: any) {
// blueprint's typeahead is treating typing weird, clicking & waiting first solves this // blueprint's typeahead is treating typing weird, clicking & waiting first solves this
// only works for text without special characters // only works for text without special characters
@@ -36,6 +44,7 @@ export async function typeInto(testId: any, text: any) {
await page.type(selector, text); await page.type(selector, text);
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
export async function clearInputAndTypeInto(testId: any, text: any) { export async function clearInputAndTypeInto(testId: any, text: any) {
await waitByID(testId); await waitByID(testId);
const selector = getTestId(testId); const selector = getTestId(testId);
@@ -49,6 +58,7 @@ export async function clearInputAndTypeInto(testId: any, text: any) {
await page.type(selector, text); await page.type(selector, text);
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
export async function clickOn(testId: any, options = {}) { export async function clickOn(testId: any, options = {}) {
await expect(page).toClick(getTestId(testId), options); await expect(page).toClick(getTestId(testId), options);
} }
@@ -57,6 +67,7 @@ export async function clickOn(testId: any, options = {}) {
* (thuang): There are times when Puppeteer clicks on a button and the page doesn't respond. * (thuang): There are times when Puppeteer clicks on a button and the page doesn't respond.
* So I added clickOnUntil() to retry clicking until a given condition is met. * So I added clickOnUntil() to retry clicking until a given condition is met.
*/ */
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
export async function clickOnUntil(testId: any, assert: any) { export async function clickOnUntil(testId: any, assert: any) {
const MAX_RETRY = 10; const MAX_RETRY = 10;
const WAIT_FOR_MS = 200; const WAIT_FOR_MS = 200;
@@ -81,18 +92,22 @@ export async function clickOnUntil(testId: any, assert: any) {
} }
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
export async function getOneElementInnerHTML(selector: any, options = {}) { export async function getOneElementInnerHTML(selector: any, options = {}) {
await page.waitForSelector(selector, options); await page.waitForSelector(selector, options);
return page.$eval(selector, (el) => el.innerHTML); return page.$eval(selector, (el) => el.innerHTML);
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
export async function getOneElementInnerText(selector: any) { export async function getOneElementInnerText(selector: any) {
expect(page).toMatchElement(selector); expect(page).toMatchElement(selector);
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
return page.$eval(selector, (el) => (el as any).innerText); return page.$eval(selector, (el) => (el as any).innerText);
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
export async function getElementCoordinates(testId: any) { export async function getElementCoordinates(testId: any) {
return page.$eval(getTestId(testId), (elem) => { return page.$eval(getTestId(testId), (elem) => {
const { left, top } = elem.getBoundingClientRect(); const { left, top } = elem.getBoundingClientRect();
@@ -118,6 +133,7 @@ async function nameNewAnnotation() {
} }
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
export async function goToPage(url: any) { export async function goToPage(url: any) {
await page.goto(url, { await page.goto(url, {
waitUntil: "networkidle0", waitUntil: "networkidle0",
@@ -127,6 +143,7 @@ export async function goToPage(url: any) {
await clickTermsOfService(); await clickTermsOfService();
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
export async function isElementPresent(selector: any, options: any) { export async function isElementPresent(selector: any, options: any) {
// @ts-expect-error ts-migrate(2554) FIXME: Expected 1 arguments, but got 2. // @ts-expect-error ts-migrate(2554) FIXME: Expected 1 arguments, but got 2.
return Boolean(await page.$(selector, options)); return Boolean(await page.$(selector, options));
+3
View File
@@ -1,8 +1,11 @@
// eslint-disable-next-line @typescript-eslint/no-var-requires --- FIXME: disabled temporarily on migrate to TS.
const PuppeteerEnvironment = require("jest-environment-puppeteer"); const PuppeteerEnvironment = require("jest-environment-puppeteer");
require("jest-circus"); require("jest-circus");
// eslint-disable-next-line @typescript-eslint/no-var-requires --- FIXME: disabled temporarily on migrate to TS.
const ENV_DEFAULT = require("../../../environment.default.json"); const ENV_DEFAULT = require("../../../environment.default.json");
// @ts-expect-error ts-migrate(2451) FIXME: Cannot redeclare block-scoped variable 'takeScreen... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2451) FIXME: Cannot redeclare block-scoped variable 'takeScreen... Remove this comment to see the full error message
// eslint-disable-next-line @typescript-eslint/no-var-requires --- FIXME: disabled temporarily on migrate to TS.
const takeScreenshot = require("./takeScreenshot"); const takeScreenshot = require("./takeScreenshot");
class ScreenshotEnvironment extends PuppeteerEnvironment { class ScreenshotEnvironment extends PuppeteerEnvironment {
+4 -1
View File
@@ -1,9 +1,12 @@
// @ts-ignore FIXME revisit from ts-migrate // eslint-disable-next-line @typescript-eslint/ban-ts-comment --- FIXME: disabled temporarily on migrate to TS.
// @ts-ignore FIXME: 'globalSetup.ts' cannot be compiled under '--isola... Remove this comment to see the full error message
const { const {
SecretsManagerClient, SecretsManagerClient,
GetSecretValueCommand, GetSecretValueCommand,
// eslint-disable-next-line @typescript-eslint/no-var-requires --- FIXME: disabled temporarily on migrate to TS.
} = require("@aws-sdk/client-secrets-manager"); } = require("@aws-sdk/client-secrets-manager");
// eslint-disable-next-line @typescript-eslint/no-var-requires --- FIXME: disabled temporarily on migrate to TS.
const { setup } = require("jest-environment-puppeteer"); const { setup } = require("jest-environment-puppeteer");
const client = new SecretsManagerClient({ region: "us-west-2" }); const client = new SecretsManagerClient({ region: "us-west-2" });
@@ -21,9 +21,13 @@ describe("cascade", () => {
[ [
"foo", "foo",
( (
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
currentState: any, currentState: any,
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
action: any, action: any,
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
nextSharedState: any, nextSharedState: any,
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
prevSharedState: any prevSharedState: any
) => { ) => {
expect(currentState).toBeUndefined(); expect(currentState).toBeUndefined();
@@ -36,9 +40,13 @@ describe("cascade", () => {
[ [
"bar", "bar",
( (
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
currentState: any, currentState: any,
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
action: any, action: any,
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
nextSharedState: any, nextSharedState: any,
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
prevSharedState: any prevSharedState: any
) => { ) => {
expect(currentState).toBeUndefined(); expect(currentState).toBeUndefined();
@@ -24,6 +24,7 @@ describe("create", () => {
describe("undo", () => { describe("undo", () => {
test("expected state modifications", () => { test("expected state modifications", () => {
const initialState = { a: 0, b: 1000 }; const initialState = { a: 0, b: 1000 };
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
const reducer = (state: any) => { const reducer = (state: any) => {
return { a: state.a + 1, b: state.b + 1 }; return { a: state.a + 1, b: state.b + 1 };
}; };
@@ -44,9 +45,11 @@ describe("undo", () => {
describe("redo", () => { describe("redo", () => {
const initialState = { a: 0, b: 1000 }; const initialState = { a: 0, b: 1000 };
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
const reducer = (state: any) => { const reducer = (state: any) => {
return { a: state.a + 1, b: state.b + 1 }; return { a: state.a + 1, b: state.b + 1 };
}; };
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
let UR: any; let UR: any;
beforeEach(() => { beforeEach(() => {
@@ -14,9 +14,11 @@ import { Dataframe } from "../../../src/util/dataframe";
enableFetchMocks(); enableFetchMocks();
describe("AnnoMatrix", () => { describe("AnnoMatrix", () => {
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
let annoMatrix: any; let annoMatrix: any;
beforeEach(async () => { beforeEach(async () => {
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
(fetch as any).resetMocks(); // reset all fetch mocking state (fetch as any).resetMocks(); // reset all fetch mocking state
// reset all fetch mocking state // reset all fetch mocking state
annoMatrix = new AnnoMatrixLoader( annoMatrix = new AnnoMatrixLoader(
@@ -37,6 +39,7 @@ describe("AnnoMatrix", () => {
}); });
test("simple single column fetch", async () => { test("simple single column fetch", async () => {
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
(fetch as any).once(serverMocks.annotationsObs(["name_0"])); (fetch as any).once(serverMocks.annotationsObs(["name_0"]));
const df = await annoMatrix.fetch("obs", "name_0"); const df = await annoMatrix.fetch("obs", "name_0");
@@ -46,6 +49,7 @@ describe("AnnoMatrix", () => {
}); });
test("simple multi column fetch", async () => { test("simple multi column fetch", async () => {
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
(fetch as any) (fetch as any)
.once(serverMocks.annotationsObs(["name_0"])) .once(serverMocks.annotationsObs(["name_0"]))
.once(serverMocks.annotationsObs(["n_genes"])); .once(serverMocks.annotationsObs(["n_genes"]));
@@ -56,8 +60,10 @@ describe("AnnoMatrix", () => {
}); });
describe("fetch from field", () => { describe("fetch from field", () => {
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
const getLastTwo = async (field: any) => { const getLastTwo = async (field: any) => {
const columnNames = annoMatrix.getMatrixColumns(field).slice(-2); const columnNames = annoMatrix.getMatrixColumns(field).slice(-2);
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
(fetch as any).mockResponses( (fetch as any).mockResponses(
...columnNames.map(() => serverMocks.responder) ...columnNames.map(() => serverMocks.responder)
); );
@@ -73,18 +79,21 @@ describe("AnnoMatrix", () => {
test("fetch - test all query forms", async () => { test("fetch - test all query forms", async () => {
// single string is a column name // single string is a column name
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
(fetch as any).once(serverMocks.annotationsObs(["n_genes"])); (fetch as any).once(serverMocks.annotationsObs(["n_genes"]));
await expect(annoMatrix.fetch("obs", "n_genes")).resolves.toBeInstanceOf( await expect(annoMatrix.fetch("obs", "n_genes")).resolves.toBeInstanceOf(
Dataframe Dataframe
); );
// array of column names, expecting n_genes to be cached. // array of column names, expecting n_genes to be cached.
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
(fetch as any).once(serverMocks.annotationsObs(["percent_mito"])); (fetch as any).once(serverMocks.annotationsObs(["percent_mito"]));
await expect( await expect(
annoMatrix.fetch("obs", ["n_genes", "percent_mito"]) annoMatrix.fetch("obs", ["n_genes", "percent_mito"])
).resolves.toBeInstanceOf(Dataframe); ).resolves.toBeInstanceOf(Dataframe);
// more complex value filter query, enumerated // more complex value filter query, enumerated
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
(fetch as any).once(serverMocks.responder); (fetch as any).once(serverMocks.responder);
await expect( await expect(
annoMatrix.fetch("X", { annoMatrix.fetch("X", {
@@ -98,6 +107,7 @@ describe("AnnoMatrix", () => {
// more complex value filter query, range // more complex value filter query, range
const varIndex = annoMatrix.schema.annotations.var.index; const varIndex = annoMatrix.schema.annotations.var.index;
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
(fetch as any) (fetch as any)
.once( .once(
serverMocks.withExpected("/data/var", [[`var:${varIndex}`, "SUMO3"]]) serverMocks.withExpected("/data/var", [[`var:${varIndex}`, "SUMO3"]])
@@ -174,6 +184,7 @@ describe("AnnoMatrix", () => {
expect(am1.nObs).toEqual(am2.nObs); expect(am1.nObs).toEqual(am2.nObs);
expect(am1.nVar).toEqual(am2.nVar); expect(am1.nVar).toEqual(am2.nVar);
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
(fetch as any) (fetch as any)
.once(serverMocks.annotationsObs(["n_genes"])) .once(serverMocks.annotationsObs(["n_genes"]))
.once(serverMocks.annotationsObs(["n_genes"])); .once(serverMocks.annotationsObs(["n_genes"]));
@@ -191,6 +202,7 @@ describe("AnnoMatrix", () => {
// @ts-expect-error ts-migrate(7006) FIXME: Parameter 'base' implicitly has an 'any' type. // @ts-expect-error ts-migrate(7006) FIXME: Parameter 'base' implicitly has an 'any' type.
async function addDrop(base) { async function addDrop(base) {
expect(base.getMatrixColumns("obs")).not.toContain("foo"); expect(base.getMatrixColumns("obs")).not.toContain("foo");
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
(fetch as any).mockRejectOnce(new Error("unknown column name")); (fetch as any).mockRejectOnce(new Error("unknown column name"));
await expect(base.fetch("obs", "foo")).rejects.toThrow( await expect(base.fetch("obs", "foo")).rejects.toThrow(
"unknown column name" "unknown column name"
@@ -216,6 +228,7 @@ describe("AnnoMatrix", () => {
const am2 = am1.dropObsColumn("foo"); const am2 = am1.dropObsColumn("foo");
expect(base.getMatrixColumns("obs")).not.toContain("foo"); expect(base.getMatrixColumns("obs")).not.toContain("foo");
expect(am2.getMatrixColumns("obs")).not.toContain("foo"); expect(am2.getMatrixColumns("obs")).not.toContain("foo");
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
(fetch as any).mockRejectOnce(new Error("unknown column name")); (fetch as any).mockRejectOnce(new Error("unknown column name"));
await expect(am2.fetch("obs", "foo")).rejects.toThrow( await expect(am2.fetch("obs", "foo")).rejects.toThrow(
"unknown column name" "unknown column name"
@@ -239,6 +252,7 @@ describe("AnnoMatrix", () => {
const am4 = clip(am3, 0, 1); const am4 = clip(am3, 0, 1);
await addDrop(am4); await addDrop(am4);
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
(fetch as any).mockResponse(serverMocks.responder); (fetch as any).mockResponse(serverMocks.responder);
await am1.fetch("obs", am1.getMatrixColumns("obs")); await am1.fetch("obs", am1.getMatrixColumns("obs"));
@@ -246,6 +260,7 @@ describe("AnnoMatrix", () => {
await am3.fetch("obs", am3.getMatrixColumns("obs")); await am3.fetch("obs", am3.getMatrixColumns("obs"));
await am4.fetch("obs", am4.getMatrixColumns("obs")); await am4.fetch("obs", am4.getMatrixColumns("obs"));
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
(fetch as any).resetMocks(); (fetch as any).resetMocks();
await addDrop(am1); await addDrop(am1);
@@ -292,6 +307,7 @@ describe("AnnoMatrix", () => {
); );
/* drop column */ /* drop column */
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
(fetch as any).mockRejectOnce(new Error("unknown column name")); (fetch as any).mockRejectOnce(new Error("unknown column name"));
am = am1.dropObsColumn("test"); am = am1.dropObsColumn("test");
await expect(am.fetch("obs", "test")).rejects.toThrow( await expect(am.fetch("obs", "test")).rejects.toThrow(
@@ -313,6 +329,7 @@ describe("AnnoMatrix", () => {
const am3 = isubset(annoMatrix, [10, 1, 0, 30, 2]); const am3 = isubset(annoMatrix, [10, 1, 0, 30, 2]);
await addSetDrop(am3); await addSetDrop(am3);
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
(fetch as any).mockResponse(serverMocks.responder); (fetch as any).mockResponse(serverMocks.responder);
await am1.fetch("obs", am1.getMatrixColumns("obs")); await am1.fetch("obs", am1.getMatrixColumns("obs"));
@@ -17,10 +17,13 @@ import { rangeFill } from "../../../src/util/range";
enableFetchMocks(); enableFetchMocks();
describe("AnnoMatrixCrossfilter", () => { describe("AnnoMatrixCrossfilter", () => {
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
let annoMatrix: any; let annoMatrix: any;
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
let crossfilter: any; let crossfilter: any;
beforeEach(async () => { beforeEach(async () => {
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
(fetch as any).resetMocks(); // reset all fetch mocking state (fetch as any).resetMocks(); // reset all fetch mocking state
// reset all fetch mocking state // reset all fetch mocking state
annoMatrix = new AnnoMatrixLoader( annoMatrix = new AnnoMatrixLoader(
@@ -68,6 +71,7 @@ describe("AnnoMatrixCrossfilter", () => {
crossfilter.obsCrossfilter.hasDimension("obs/louvain") crossfilter.obsCrossfilter.hasDimension("obs/louvain")
).toBeFalsy(); ).toBeFalsy();
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
(fetch as any).once( (fetch as any).once(
serverMocks.dataframeResponse(["louvain"], [obsLouvain]) serverMocks.dataframeResponse(["louvain"], [obsLouvain])
); );
@@ -79,6 +83,7 @@ describe("AnnoMatrixCrossfilter", () => {
expect( expect(
newCrossfilter.obsCrossfilter.hasDimension("obs/louvain") newCrossfilter.obsCrossfilter.hasDimension("obs/louvain")
).toBeTruthy(); ).toBeTruthy();
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
expect((fetch as any).mock.calls).toHaveLength(1); expect((fetch as any).mock.calls).toHaveLength(1);
newCrossfilter = await crossfilter.select("obs", "louvain", { newCrossfilter = await crossfilter.select("obs", "louvain", {
@@ -90,6 +95,7 @@ describe("AnnoMatrixCrossfilter", () => {
test("simple column select", async () => { test("simple column select", async () => {
let xfltr; let xfltr;
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
(fetch as any).once( (fetch as any).once(
serverMocks.dataframeResponse(["louvain"], [obsLouvain]) serverMocks.dataframeResponse(["louvain"], [obsLouvain])
); );
@@ -130,10 +136,12 @@ describe("AnnoMatrixCrossfilter", () => {
const values = df.col("louvain").asArray(); const values = df.col("louvain").asArray();
const selected = xfltr.allSelectedMask(); const selected = xfltr.allSelectedMask();
values.every( values.every(
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
(val: any, idx: any) => (val: any, idx: any) =>
!["NK cells", "B cells"].includes(val) !== !selected[idx] !["NK cells", "B cells"].includes(val) !== !selected[idx]
); );
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
(fetch as any).once( (fetch as any).once(
serverMocks.dataframeResponse(["n_genes"], [new Int32Array(obsNGenes)]) serverMocks.dataframeResponse(["n_genes"], [new Int32Array(obsNGenes)])
); );
@@ -168,6 +176,7 @@ describe("AnnoMatrixCrossfilter", () => {
const varIndex = annoMatrix.schema.annotations.var.index; const varIndex = annoMatrix.schema.annotations.var.index;
const { nObs } = annoMatrix.schema.dataframe; const { nObs } = annoMatrix.schema.dataframe;
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
(fetch as any).once( (fetch as any).once(
serverMocks.dataframeResponse( serverMocks.dataframeResponse(
["TEST"], ["TEST"],
@@ -205,14 +214,17 @@ describe("AnnoMatrixCrossfilter", () => {
const values = df.icol(0).asArray(); const values = df.icol(0).asArray();
const selected = xfltr.allSelectedMask(); const selected = xfltr.allSelectedMask();
values.every( values.every(
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
(val: any, idx: any) => !(val >= 0 && val <= 50) !== !selected[idx] (val: any, idx: any) => !(val >= 0 && val <= 50) !== !selected[idx]
); );
expect( expect(
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
selected.reduce((acc: any, val: any) => (val ? acc + 1 : acc), 0) selected.reduce((acc: any, val: any) => (val ? acc + 1 : acc), 0)
).toEqual(xfltr.countSelected()); ).toEqual(xfltr.countSelected());
}); });
test("spatial column select", async () => { test("spatial column select", async () => {
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
(fetch as any).once( (fetch as any).once(
serverMocks.dataframeResponse( serverMocks.dataframeResponse(
["umap_0", "umap_1"], ["umap_0", "umap_1"],
@@ -241,6 +253,7 @@ describe("AnnoMatrixCrossfilter", () => {
let xfltr = new AnnoMatrixObsCrossfilter(annoMatrixSubset); let xfltr = new AnnoMatrixObsCrossfilter(annoMatrixSubset);
expect(xfltr.countSelected()).toEqual(annoMatrixSubset.nObs); expect(xfltr.countSelected()).toEqual(annoMatrixSubset.nObs);
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
(fetch as any).once( (fetch as any).once(
serverMocks.dataframeResponse(["louvain"], [obsLouvain]) serverMocks.dataframeResponse(["louvain"], [obsLouvain])
); );
@@ -256,6 +269,7 @@ describe("AnnoMatrixCrossfilter", () => {
const values = df.col("louvain").asArray(); const values = df.col("louvain").asArray();
const selected = xfltr.allSelectedMask(); const selected = xfltr.allSelectedMask();
values.every( values.every(
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
(val: any, idx: any) => (val: any, idx: any) =>
!["NK cells", "B cells"].includes(val) !== !selected[idx] !["NK cells", "B cells"].includes(val) !== !selected[idx]
); );
@@ -270,6 +284,7 @@ describe("AnnoMatrixCrossfilter", () => {
"unable to obsSelect upon the var dimension" "unable to obsSelect upon the var dimension"
); );
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
(fetch as any).mockRejectOnce(new Error("unknown column name")); (fetch as any).mockRejectOnce(new Error("unknown column name"));
await expect(crossfilter.select("obs", "foo")).rejects.toThrow( await expect(crossfilter.select("obs", "foo")).rejects.toThrow(
"unknown column name" "unknown column name"
@@ -281,6 +296,7 @@ describe("AnnoMatrixCrossfilter", () => {
/* /*
test the matrix mutators via crossfilter proxy test the matrix mutators via crossfilter proxy
*/ */
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
async function helperAddTestCol(cf: any, colName: any, colSchema = null) { async function helperAddTestCol(cf: any, colName: any, colSchema = null) {
expect( expect(
cf.annoMatrix.getMatrixColumns("obs").includes(colName) cf.annoMatrix.getMatrixColumns("obs").includes(colName)
@@ -301,6 +317,7 @@ describe("AnnoMatrixCrossfilter", () => {
const xfltr = cf.addObsColumn(colSchema, Array, initValue); const xfltr = cf.addObsColumn(colSchema, Array, initValue);
expect( expect(
xfltr.annoMatrix.schema.annotations.obs.columns.filter( xfltr.annoMatrix.schema.annotations.obs.columns.filter(
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
(v: any) => v.name === colName (v: any) => v.name === colName
) )
).toHaveLength(1); ).toHaveLength(1);
@@ -331,6 +348,7 @@ describe("AnnoMatrixCrossfilter", () => {
}); });
expect( expect(
xfltr.annoMatrix.schema.annotations.obs.columns.filter( xfltr.annoMatrix.schema.annotations.obs.columns.filter(
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
(v: any) => v.name === "foo" (v: any) => v.name === "foo"
) )
).toHaveLength(1); ).toHaveLength(1);
@@ -340,7 +358,7 @@ describe("AnnoMatrixCrossfilter", () => {
expect( expect(
df df
.col("foo") .col("foo")
.asArray() .asArray() // eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
.every((v: any) => v === "A") .every((v: any) => v === "A")
).toBeTruthy(); ).toBeTruthy();
@@ -378,10 +396,12 @@ describe("AnnoMatrixCrossfilter", () => {
xfltr = xfltr.dropObsColumn("foo"); xfltr = xfltr.dropObsColumn("foo");
expect( expect(
xfltr.annoMatrix.schema.annotations.obs.columns.filter( xfltr.annoMatrix.schema.annotations.obs.columns.filter(
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
(v: any) => v.name === "foo" (v: any) => v.name === "foo"
) )
).toHaveLength(0); ).toHaveLength(0);
expect(xfltr.annoMatrix.schema.annotations.obsByName.foo).toBeUndefined(); expect(xfltr.annoMatrix.schema.annotations.obsByName.foo).toBeUndefined();
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
(fetch as any).mockRejectOnce(new Error("unknown column name")); (fetch as any).mockRejectOnce(new Error("unknown column name"));
await expect(xfltr.annoMatrix.fetch("obs", "foo")).rejects.toThrow( await expect(xfltr.annoMatrix.fetch("obs", "foo")).rejects.toThrow(
"unknown column name" "unknown column name"
@@ -395,6 +415,7 @@ describe("AnnoMatrixCrossfilter", () => {
}); });
xfltr = xfltr.dropObsColumn("bar"); xfltr = xfltr.dropObsColumn("bar");
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
(fetch as any).mockRejectOnce(new Error("unknown column name")); (fetch as any).mockRejectOnce(new Error("unknown column name"));
await expect(xfltr.select("obs", "bar", { mode: "all" })).rejects.toThrow( await expect(xfltr.select("obs", "bar", { mode: "all" })).rejects.toThrow(
"unknown column name" "unknown column name"
@@ -421,6 +442,7 @@ describe("AnnoMatrixCrossfilter", () => {
type: "categorical", type: "categorical",
}); });
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
(fetch as any).mockRejectOnce(new Error("unknown column name")); (fetch as any).mockRejectOnce(new Error("unknown column name"));
await expect(xfltr.annoMatrix.fetch("obs", "foo")).rejects.toThrow( await expect(xfltr.annoMatrix.fetch("obs", "foo")).rejects.toThrow(
"unknown column name" "unknown column name"
@@ -436,6 +458,7 @@ describe("AnnoMatrixCrossfilter", () => {
}); });
xfltr = xfltr.renameObsColumn("bar", "xyz"); xfltr = xfltr.renameObsColumn("bar", "xyz");
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
(fetch as any).mockRejectOnce(new Error("unknown column name")); (fetch as any).mockRejectOnce(new Error("unknown column name"));
await expect(xfltr.select("obs", "bar", { mode: "all" })).rejects.toThrow( await expect(xfltr.select("obs", "bar", { mode: "all" })).rejects.toThrow(
"unknown column name" "unknown column name"
@@ -446,6 +469,7 @@ describe("AnnoMatrixCrossfilter", () => {
}); });
test("addObsAnnoCategory", async () => { test("addObsAnnoCategory", async () => {
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
let xfltr: any; let xfltr: any;
// catch unknown or readonly columns // catch unknown or readonly columns
@@ -515,7 +539,7 @@ describe("AnnoMatrixCrossfilter", () => {
expect( expect(
(await xfltr.annoMatrix.fetch("obs", "foo")) (await xfltr.annoMatrix.fetch("obs", "foo"))
.col("foo") .col("foo")
.asArray() .asArray() // eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
.every((v: any) => v === "unassigned") .every((v: any) => v === "unassigned")
).toBeTruthy(); ).toBeTruthy();
expect(xfltr.annoMatrix.getColumnSchema("obs", "foo")).toMatchObject({ expect(xfltr.annoMatrix.getColumnSchema("obs", "foo")).toMatchObject({
@@ -534,7 +558,7 @@ describe("AnnoMatrixCrossfilter", () => {
expect( expect(
(await xfltr1.annoMatrix.fetch("obs", "foo")) (await xfltr1.annoMatrix.fetch("obs", "foo"))
.col("foo") .col("foo")
.asArray() .asArray() // eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
.every((v: any) => v === "unassigned") .every((v: any) => v === "unassigned")
).toBeTruthy(); ).toBeTruthy();
expect(xfltr1.annoMatrix.getColumnSchema("obs", "foo")).toMatchObject({ expect(xfltr1.annoMatrix.getColumnSchema("obs", "foo")).toMatchObject({
@@ -557,7 +581,7 @@ describe("AnnoMatrixCrossfilter", () => {
expect( expect(
(await xfltr2.annoMatrix.fetch("obs", "foo")) (await xfltr2.annoMatrix.fetch("obs", "foo"))
.col("foo") .col("foo")
.asArray() .asArray() // eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
.every((v: any) => v === "red") .every((v: any) => v === "red")
).toBeTruthy(); ).toBeTruthy();
expect(xfltr2.annoMatrix.getColumnSchema("obs", "foo")).toMatchObject({ expect(xfltr2.annoMatrix.getColumnSchema("obs", "foo")).toMatchObject({
@@ -593,7 +617,7 @@ describe("AnnoMatrixCrossfilter", () => {
expect( expect(
(await xfltr.annoMatrix.fetch("obs", "foo")) (await xfltr.annoMatrix.fetch("obs", "foo"))
.col("foo") .col("foo")
.asArray() .asArray() // eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
.every((v: any) => v === "unassigned") .every((v: any) => v === "unassigned")
).toBeTruthy(); ).toBeTruthy();
const xfltr1 = await xfltr.setObsColumnValues("foo", [0, 10], "purple"); const xfltr1 = await xfltr.setObsColumnValues("foo", [0, 10], "purple");
@@ -602,6 +626,7 @@ describe("AnnoMatrixCrossfilter", () => {
.col("foo") .col("foo")
.asArray() .asArray()
.every( .every(
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
(v: any, i: any) => (v: any, i: any) =>
v === "unassigned" || (v === "purple" && (i === 0 || i === 10)) v === "unassigned" || (v === "purple" && (i === 0 || i === 10))
) )
@@ -660,7 +685,7 @@ describe("AnnoMatrixCrossfilter", () => {
expect( expect(
(await xfltr1.annoMatrix.fetch("obs", "foo")) (await xfltr1.annoMatrix.fetch("obs", "foo"))
.col("foo") .col("foo")
.asArray() .asArray() // eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
.filter((v: any) => v === "purple") .filter((v: any) => v === "purple")
).toHaveLength(2); ).toHaveLength(2);
@@ -668,13 +693,13 @@ describe("AnnoMatrixCrossfilter", () => {
expect( expect(
(await xfltr1.annoMatrix.fetch("obs", "foo")) (await xfltr1.annoMatrix.fetch("obs", "foo"))
.col("foo") .col("foo")
.asArray() .asArray() // eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
.filter((v: any) => v === "magenta") .filter((v: any) => v === "magenta")
).toHaveLength(2); ).toHaveLength(2);
expect( expect(
(await xfltr1.annoMatrix.fetch("obs", "foo")) (await xfltr1.annoMatrix.fetch("obs", "foo"))
.col("foo") .col("foo")
.asArray() .asArray() // eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
.filter((v: any) => v === "purple") .filter((v: any) => v === "purple")
).toHaveLength(0); ).toHaveLength(0);
expect(xfltr1.annoMatrix.getColumnSchema("obs", "foo")).toMatchObject({ expect(xfltr1.annoMatrix.getColumnSchema("obs", "foo")).toMatchObject({
@@ -695,6 +720,7 @@ describe("AnnoMatrixCrossfilter", () => {
describe("edge cases", () => { describe("edge cases", () => {
test("transition from empty annoMatrix", async () => { test("transition from empty annoMatrix", async () => {
// select before fetch needs to work // select before fetch needs to work
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
(fetch as any).once( (fetch as any).once(
serverMocks.dataframeResponse(["louvain"], [obsLouvain]) serverMocks.dataframeResponse(["louvain"], [obsLouvain])
); );
@@ -702,6 +728,7 @@ describe("AnnoMatrixCrossfilter", () => {
mode: "exact", mode: "exact",
values: "B cells", values: "B cells",
}); });
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
expect((fetch as any).mock.calls).toHaveLength(1); expect((fetch as any).mock.calls).toHaveLength(1);
expect(xfltr.obsCrossfilter.hasDimension("obs/louvain")).toBeTruthy(); expect(xfltr.obsCrossfilter.hasDimension("obs/louvain")).toBeTruthy();
expect(xfltr.obsCrossfilter.all()).toBe(xfltr.annoMatrix._cache.obs); expect(xfltr.obsCrossfilter.all()).toBe(xfltr.annoMatrix._cache.obs);
@@ -1,5 +1,6 @@
export const baseDataURL = "https://a.fake.url/api/v0.2"; export const baseDataURL = "https://a.fake.url/api/v0.2";
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
(window as any).CELLXGENE = { (window as any).CELLXGENE = {
API: { API: {
prefix: baseDataURL, prefix: baseDataURL,
@@ -14,6 +14,7 @@ const indexedSchema = {
), ),
}; };
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
function makeMockColumn(s: any, length: any) { function makeMockColumn(s: any, length: any) {
const { type } = s; const { type } = s;
switch (type) { switch (type) {
@@ -37,8 +38,10 @@ function makeMockColumn(s: any, length: any) {
} }
} }
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
function getEncodedDataframe(colNames: any, length: any, colSchemas: any) { function getEncodedDataframe(colNames: any, length: any, colSchemas: any) {
const colIndex = new KeyIndex(colNames); const colIndex = new KeyIndex(colNames);
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
const columns = colSchemas.map((s: any) => makeMockColumn(s, length)); const columns = colSchemas.map((s: any) => makeMockColumn(s, length));
// @ts-expect-error ts-migrate(2345) FIXME: Argument of type 'KeyIndex' is not assignable to p... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2345) FIXME: Argument of type 'KeyIndex' is not assignable to p... Remove this comment to see the full error message
const df = new Dataframe([length, colNames.length], columns, null, colIndex); const df = new Dataframe([length, colNames.length], columns, null, colIndex);
@@ -46,6 +49,7 @@ function getEncodedDataframe(colNames: any, length: any, colSchemas: any) {
return body; return body;
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
export function dataframeResponse(colNames: any, columns: any) { export function dataframeResponse(colNames: any, columns: any) {
const colIndex = new KeyIndex(colNames); const colIndex = new KeyIndex(colNames);
const df = new Dataframe( const df = new Dataframe(
@@ -62,8 +66,10 @@ export function dataframeResponse(colNames: any, columns: any) {
return () => Promise.resolve({ body, init: { status: 200, headers } }); return () => Promise.resolve({ body, init: { status: 200, headers } });
} }
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
function annotationObsResponse(request: any) { function annotationObsResponse(request: any) {
const url = new URL(request.url); const url = new URL(request.url);
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
const params = Array.from((url.searchParams as any).entries()); const params = Array.from((url.searchParams as any).entries());
const names = params const names = params
// @ts-expect-error ts-migrate(2769) FIXME: No overload matches this call. // @ts-expect-error ts-migrate(2769) FIXME: No overload matches this call.
@@ -91,8 +97,10 @@ function annotationObsResponse(request: any) {
}); });
} }
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
function annotationVarResponse(request: any) { function annotationVarResponse(request: any) {
const url = new URL(request.url); const url = new URL(request.url);
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
const params = Array.from((url.searchParams as any).entries()); const params = Array.from((url.searchParams as any).entries());
const names = params const names = params
// @ts-expect-error ts-migrate(2769) FIXME: No overload matches this call. // @ts-expect-error ts-migrate(2769) FIXME: No overload matches this call.
@@ -120,8 +128,10 @@ function annotationVarResponse(request: any) {
}); });
} }
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
function layoutObsResponse(request: any) { function layoutObsResponse(request: any) {
const url = new URL(request.url); const url = new URL(request.url);
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
const params = Array.from((url.searchParams as any).entries()); const params = Array.from((url.searchParams as any).entries());
// @ts-expect-error ts-migrate(2769) FIXME: No overload matches this call. // @ts-expect-error ts-migrate(2769) FIXME: No overload matches this call.
const names = params.filter(([k]) => k === "layout-name").map(([, v]) => v); const names = params.filter(([k]) => k === "layout-name").map(([, v]) => v);
@@ -150,10 +160,13 @@ function layoutObsResponse(request: any) {
}); });
} }
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
function dataVarResponse(request: any) { function dataVarResponse(request: any) {
const url = new URL(request.url); const url = new URL(request.url);
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
const params = Array.from((url.searchParams as any).entries()); const params = Array.from((url.searchParams as any).entries());
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
const colNames = params.map((v) => `${(v as any)[0]}/${(v as any)[1]}`); const colNames = params.map((v) => `${(v as any)[0]}/${(v as any)[1]}`);
const colSchemas = colNames.map(() => schema.schema.dataframe); const colSchemas = colNames.map(() => schema.schema.dataframe);
const body = getEncodedDataframe( const body = getEncodedDataframe(
@@ -171,6 +184,7 @@ function dataVarResponse(request: any) {
}); });
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
export function responder(request: any) { export function responder(request: any) {
const url = new URL(request.url); const url = new URL(request.url);
const { pathname } = url; const { pathname } = url;
@@ -189,29 +203,34 @@ export function responder(request: any) {
return Promise.reject(new Error("bad URL")); return Promise.reject(new Error("bad URL"));
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
export function withExpected(expectedURL: any, expectedParams: any) { export function withExpected(expectedURL: any, expectedParams: any) {
/* /*
Do some additional error checking Do some additional error checking
*/ */
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
return (request: any) => { return (request: any) => {
// if URL is bogus, reject the promise // if URL is bogus, reject the promise
const url = new URL(request.url); const url = new URL(request.url);
if (!url.pathname.endsWith(expectedURL)) { if (!url.pathname.endsWith(expectedURL)) {
return Promise.reject(new Error("Unexpected URL!")); return Promise.reject(new Error("Unexpected URL!"));
} }
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
const params = Array.from((url.searchParams as any).entries()).sort( const params = Array.from((url.searchParams as any).entries()).sort(
// @ts-expect-error ts-migrate(2345) FIXME: Argument of type '(a: unknown, b: unknown) => bool... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2345) FIXME: Argument of type '(a: unknown, b: unknown) => bool... Remove this comment to see the full error message
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
(a, b) => (a as any)[0] < (b as any)[0] (a, b) => (a as any)[0] < (b as any)[0]
); );
expectedParams = expectedParams expectedParams = expectedParams
.slice() .slice() // eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
.sort((a: any, b: any) => a[0] < b[0]); .sort((a: any, b: any) => a[0] < b[0]);
if ( if (
params.length !== expectedParams.length || params.length !== expectedParams.length ||
!params.every( !params.every(
(p, i) => (p, i) =>
(p as any)[0] === expectedParams[i][0] && // eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
(p as any)[0] === expectedParams[i][0] && // eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
(p as any)[1] === expectedParams[i][1] (p as any)[1] === expectedParams[i][1]
) )
) { ) {
@@ -222,9 +241,11 @@ export function withExpected(expectedURL: any, expectedParams: any) {
}; };
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
export function annotationsObs(names: any) { export function annotationsObs(names: any) {
return withExpected( return withExpected(
"/annotations/obs", "/annotations/obs",
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
names.map((name: any) => ["annotation-name", name]) names.map((name: any) => ["annotation-name", name])
); );
} }
@@ -219,13 +219,16 @@ describe("whereCache", () => {
}) })
); );
// @ts-expect-error ts-migrate(2531) FIXME: Object is possibly 'null'. // @ts-expect-error ts-migrate(2531) FIXME: Object is possibly 'null'.
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
expect((wc.where as any).field.queryField.has("queryColumn")).toEqual(true); expect((wc.where as any).field.queryField.has("queryColumn")).toEqual(true);
expect( expect(
// @ts-expect-error ts-migrate(2531) FIXME: Object is possibly 'null'. // @ts-expect-error ts-migrate(2531) FIXME: Object is possibly 'null'.
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
(wc.where as any).field.queryField.get("queryColumn") (wc.where as any).field.queryField.get("queryColumn")
).toBeInstanceOf(Map); ).toBeInstanceOf(Map);
expect( expect(
// @ts-expect-error ts-migrate(2531) FIXME: Object is possibly 'null'. // @ts-expect-error ts-migrate(2531) FIXME: Object is possibly 'null'.
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
(wc.where as any).field.queryField.get("queryColumn").has("queryValue") (wc.where as any).field.queryField.get("queryColumn").has("queryValue")
).toEqual(true); ).toEqual(true);
expect(_whereCacheGet(wc, schema, "field", query)).toEqual([0, 1, 2]); expect(_whereCacheGet(wc, schema, "field", query)).toEqual([0, 1, 2]);
+5
View File
@@ -8,8 +8,11 @@ import { indexEntireSchema } from "../../src/util/stateManager/schemaHelpers";
import { _normalizeCategoricalSchema } from "../../src/annoMatrix/schema"; import { _normalizeCategoricalSchema } from "../../src/annoMatrix/schema";
describe("centroid", () => { describe("centroid", () => {
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
let schema: any; let schema: any;
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
let obsAnnotations: any; let obsAnnotations: any;
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
let obsLayout: any; let obsLayout: any;
beforeAll(() => { beforeAll(() => {
@@ -44,6 +47,7 @@ describe("centroid", () => {
quantile([0.5], obsLayout.col("umap_1").asArray())[0], quantile([0.5], obsLayout.col("umap_1").asArray())[0],
]; ];
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
centroidResult.forEach((coordinate: any) => { centroidResult.forEach((coordinate: any) => {
expect(coordinate).toEqual(expectedResult); expect(coordinate).toEqual(expectedResult);
}); });
@@ -68,6 +72,7 @@ describe("centroid", () => {
quantile([0.5], obsLayout.col("umap_1").asArray())[0], quantile([0.5], obsLayout.col("umap_1").asArray())[0],
]; ];
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
centroidResult.forEach((coordinate: any) => { centroidResult.forEach((coordinate: any) => {
expect(coordinate).toEqual(expectedResult); expect(coordinate).toEqual(expectedResult);
}); });
@@ -811,6 +811,7 @@ describe("dataframe factories", () => {
new Float64Array(3).fill(1.1), new Float64Array(3).fill(1.1),
] ]
); );
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
const dfB = dfA.mapColumns((col: any, idx: any) => { const dfB = dfA.mapColumns((col: any, idx: any) => {
expect(dfA.icol(idx).asArray()).toBe(col); expect(dfA.icol(idx).asArray()).toBe(col);
return col; return col;
@@ -869,6 +870,7 @@ describe("dataframe factories", () => {
}); });
describe("dataframe col", () => { describe("dataframe col", () => {
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
let df: any = null; let df: any = null;
beforeEach(() => { beforeEach(() => {
df = new Dataframe.Dataframe( df = new Dataframe.Dataframe(
@@ -1,5 +1,6 @@
import * as Dataframe from "../../../src/util/dataframe"; import * as Dataframe from "../../../src/util/dataframe";
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
function float32Conversion(f: any) { function float32Conversion(f: any) {
return new Float32Array([f])[0]; return new Float32Array([f])[0];
} }
@@ -1,6 +1,7 @@
import PromiseLimit from "../../src/util/promiseLimit"; import PromiseLimit from "../../src/util/promiseLimit";
import { range } from "../../src/util/range"; import { range } from "../../src/util/range";
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
const delay = (t: any) => new Promise((resolve) => setTimeout(resolve, t)); const delay = (t: any) => new Promise((resolve) => setTimeout(resolve, t));
describe("PromiseLimit", () => { describe("PromiseLimit", () => {
@@ -52,6 +53,7 @@ describe("PromiseLimit", () => {
}; };
// @ts-expect-error ts-migrate(2554) FIXME: Expected 3 arguments, but got 1. // @ts-expect-error ts-migrate(2554) FIXME: Expected 3 arguments, but got 1.
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
await Promise.all(range(10).map((i: any) => plimit.add(() => callback(i)))); await Promise.all(range(10).map((i: any) => plimit.add(() => callback(i))));
expect(maxRunning).toEqual(2); expect(maxRunning).toEqual(2);
@@ -125,6 +125,7 @@ describe("categorical color helpers", () => {
Array.from(schema.annotations.obsByName.categoricalColumn.categories) Array.from(schema.annotations.obsByName.categoricalColumn.categories)
); );
const userDefinedColorTable = { const userDefinedColorTable = {
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
categoricalColumn: shuffleCats.reduce((acc: any, label: any) => { categoricalColumn: shuffleCats.reduce((acc: any, label: any) => {
acc[label] = randRGBColor(); acc[label] = randRGBColor();
return acc; return acc;
@@ -159,23 +160,29 @@ TODO:
2. user defined colors 2. user defined colors
*/ */
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
function indexSchema(schema: any) { function indexSchema(schema: any) {
schema.annotations.obsByName = Object.fromEntries( schema.annotations.obsByName = Object.fromEntries(
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
schema.annotations?.obs?.columns?.map((v: any) => [v.name, v]) ?? [] schema.annotations?.obs?.columns?.map((v: any) => [v.name, v]) ?? []
); );
schema.annotations.varByName = Object.fromEntries( schema.annotations.varByName = Object.fromEntries(
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
schema.annotations?.var?.columns?.map((v: any) => [v.name, v]) ?? [] schema.annotations?.var?.columns?.map((v: any) => [v.name, v]) ?? []
); );
schema.layout.obsByName = Object.fromEntries( schema.layout.obsByName = Object.fromEntries(
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
schema.layout?.obs?.map((v: any) => [v.name, v]) ?? [] schema.layout?.obs?.map((v: any) => [v.name, v]) ?? []
); );
schema.layout.varByName = Object.fromEntries( schema.layout.varByName = Object.fromEntries(
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
schema.layout?.var?.map((v: any) => [v.name, v]) ?? [] schema.layout?.var?.map((v: any) => [v.name, v]) ?? []
); );
return schema; return schema;
} }
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
function makeScale(rgb: any) { function makeScale(rgb: any) {
// make a scale string from a rgb float triple // make a scale string from a rgb float triple
return `rgb(${(rgb[0] * 255) >>> 0}, ${(rgb[1] * 255) >>> 0}, ${ return `rgb(${(rgb[0] * 255) >>> 0}, ${(rgb[1] * 255) >>> 0}, ${
@@ -183,6 +190,7 @@ function makeScale(rgb: any) {
})`; })`;
} }
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
function shuffle(array: any) { function shuffle(array: any) {
for (let i = array.length - 1; i > 0; i -= 1) { for (let i = array.length - 1; i > 0; i -= 1) {
const j = (Math.random() * (i + 1)) >>> 0; const j = (Math.random() * (i + 1)) >>> 0;
@@ -107,8 +107,11 @@ const anAnnotationsVarJSONResponse = {
.value(), .value(),
}; };
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
function encodeTypedArray(builder: any, uType: any, uData: any) { function encodeTypedArray(builder: any, uType: any, uData: any) {
// @ts-expect-error --- FIXME: Element implicitly has an 'any' type.
const uTypeName = NetEncoding.TypedArray[uType]; const uTypeName = NetEncoding.TypedArray[uType];
// @ts-expect-error --- FIXME: Element implicitly has an 'any' type.
const ArrayType = NetEncoding[uTypeName]; const ArrayType = NetEncoding[uTypeName];
const dv = ArrayType.createDataVector(builder, uData); const dv = ArrayType.createDataVector(builder, uData);
builder.startObject(1); builder.startObject(1);
@@ -116,6 +119,7 @@ function encodeTypedArray(builder: any, uType: any, uData: any) {
return builder.endObject(); return builder.endObject();
} }
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
function encodeMatrix(columns: any, colIndex = undefined) { function encodeMatrix(columns: any, colIndex = undefined) {
/* /*
IMPORTANT: this is not a general purpose encoder. in particular, IMPORTANT: this is not a general purpose encoder. in particular,
@@ -126,6 +126,7 @@ const someData = [
}, },
]; ];
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
let payments: any = null; let payments: any = null;
beforeEach(() => { beforeEach(() => {
payments = new Crossfilter(someData); payments = new Crossfilter(someData);
@@ -141,6 +142,7 @@ describe("ImmutableTypedCrossfilter", () => {
.addDimension( .addDimension(
"quantity", "quantity",
"scalar", "scalar",
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
(i: any, d: any) => d[i].quantity, (i: any, d: any) => d[i].quantity,
Int32Array Int32Array
) )
@@ -163,6 +165,7 @@ describe("ImmutableTypedCrossfilter", () => {
const p2 = payments.addDimension( const p2 = payments.addDimension(
"quantity", "quantity",
"scalar", "scalar",
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
(i: any, data: any) => data[i].quantity, (i: any, data: any) => data[i].quantity,
Int32Array Int32Array
); );
@@ -183,16 +186,18 @@ describe("ImmutableTypedCrossfilter", () => {
.addDimension( .addDimension(
"quantity", "quantity",
"scalar", "scalar",
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
(i: any, d: any) => d[i].quantity, (i: any, d: any) => d[i].quantity,
Int32Array Int32Array
) ) // eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
.addDimension("tip", "scalar", (i: any, d: any) => d[i].tip, Float32Array) .addDimension("tip", "scalar", (i: any, d: any) => d[i].tip, Float32Array)
.addDimension( .addDimension(
"total", "total",
"scalar", "scalar",
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
(i: any, d: any) => d[i].total, (i: any, d: any) => d[i].total,
Float32Array Float32Array
) ) // eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
.addDimension("type", "enum", (i: any, d: any) => d[i].type); .addDimension("type", "enum", (i: any, d: any) => d[i].type);
expect(p).toBeDefined(); expect(p).toBeDefined();
@@ -245,18 +250,21 @@ describe("ImmutableTypedCrossfilter", () => {
}); });
describe("scalar dimension", () => { describe("scalar dimension", () => {
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
let p: any; let p: any;
beforeEach(() => { beforeEach(() => {
p = payments p = payments
.addDimension( .addDimension(
"quantity", "quantity",
"scalar", "scalar",
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
(i: any, d: any) => d[i].quantity, (i: any, d: any) => d[i].quantity,
Int32Array Int32Array
) )
.addDimension( .addDimension(
"tip", "tip",
"scalar", "scalar",
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
(i: any, d: any) => d[i].tip, (i: any, d: any) => d[i].tip,
Float32Array Float32Array
) )
@@ -302,8 +310,10 @@ describe("ImmutableTypedCrossfilter", () => {
}); });
describe("enum dimension", () => { describe("enum dimension", () => {
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
let p: any; let p: any;
beforeEach(() => { beforeEach(() => {
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
p = payments.addDimension("type", "enum", (i: any, d: any) => d[i].type); p = payments.addDimension("type", "enum", (i: any, d: any) => d[i].type);
}); });
@@ -342,6 +352,7 @@ describe("ImmutableTypedCrossfilter", () => {
}); });
describe("spatial dimension", () => { describe("spatial dimension", () => {
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
let p: any; let p: any;
beforeEach(() => { beforeEach(() => {
const X = someData.map((r) => r.coords[0]); const X = someData.map((r) => r.coords[0]);
@@ -431,18 +442,21 @@ describe("ImmutableTypedCrossfilter", () => {
}); });
describe("non-finite scalars", () => { describe("non-finite scalars", () => {
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
let p: any; let p: any;
beforeEach(() => { beforeEach(() => {
p = payments p = payments
.addDimension( .addDimension(
"quantity", "quantity",
"scalar", "scalar",
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
(i: any, d: any) => d[i].quantity, (i: any, d: any) => d[i].quantity,
Int32Array Int32Array
) )
.addDimension( .addDimension(
"nonFinite", "nonFinite",
"scalar", "scalar",
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
(i: any, d: any) => d[i].nonFinite, (i: any, d: any) => d[i].nonFinite,
Float32Array Float32Array
) )
@@ -15,6 +15,7 @@ paths for:
const pInf = Number.POSITIVE_INFINITY; const pInf = Number.POSITIVE_INFINITY;
const nInf = Number.NEGATIVE_INFINITY; const nInf = Number.NEGATIVE_INFINITY;
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
function fillRange(arr: any, start = 0) { function fillRange(arr: any, start = 0) {
const larr = arr; const larr = arr;
for (let i = 0, len = larr.length; i < len; i += 1) { for (let i = 0, len = larr.length; i < len; i += 1) {
@@ -23,6 +24,7 @@ function fillRange(arr: any, start = 0) {
return larr; return larr;
} }
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
function fillRand(arr: any) { function fillRand(arr: any) {
for (let i = 0, len = arr.length; i < len; i += 1) { for (let i = 0, len = arr.length; i < len; i += 1) {
arr[i] = Math.random(); arr[i] = Math.random();
@@ -140,6 +142,7 @@ describe("sortIndex", () => {
const source1 = Type.from([6, 5, 4, 3, 2, 1, 0]); const source1 = Type.from([6, 5, 4, 3, 2, 1, 0]);
const index1 = fillRange(new Uint32Array(source1.length)); const index1 = fillRange(new Uint32Array(source1.length));
expect(sortIndex(index1, source1)).toMatchObject( expect(sortIndex(index1, source1)).toMatchObject(
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
index1.sort((a: any, b: any) => source1[a] - source1[b]) index1.sort((a: any, b: any) => source1[a] - source1[b])
); );
@@ -147,12 +150,14 @@ describe("sortIndex", () => {
const source2 = Type.from([6, 5, 4, 3, 2, 1]); const source2 = Type.from([6, 5, 4, 3, 2, 1]);
const index2 = fillRange(new Uint32Array(source2.length)); const index2 = fillRange(new Uint32Array(source2.length));
expect(sortIndex(index2, source2)).toMatchObject( expect(sortIndex(index2, source2)).toMatchObject(
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
index2.sort((a: any, b: any) => source1[a] - source1[b]) index2.sort((a: any, b: any) => source1[a] - source1[b])
); );
const source3 = fillRand(new Type(1000)); const source3 = fillRand(new Type(1000));
const index3 = fillRange(new Uint32Array(source3.length)); const index3 = fillRange(new Uint32Array(source3.length));
expect(sortIndex(index3, source3)).toMatchObject( expect(sortIndex(index3, source3)).toMatchObject(
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
index3.sort((a: any, b: any) => source1[a] - source1[b]) index3.sort((a: any, b: any) => source1[a] - source1[b])
); );
}) })
+1
View File
@@ -10,6 +10,7 @@ module.exports = {
}, },
], ],
"@babel/preset-react", "@babel/preset-react",
// eslint-disable-next-line prettier/prettier --- FIXME: disabled temporarily on migrate to TS.
"@babel/preset-typescript" "@babel/preset-typescript"
], ],
plugins: [ plugins: [
+3
View File
@@ -1,8 +1,10 @@
/* eslint-disable @blueprintjs/classes-constants -- we don't import blueprint here */
module.exports = { module.exports = {
root: true, root: true,
parser: "@typescript-eslint/parser", parser: "@typescript-eslint/parser",
extends: [ extends: [
"airbnb-typescript", "airbnb-typescript",
"plugin:@typescript-eslint/recommended",
"plugin:eslint-comments/recommended", "plugin:eslint-comments/recommended",
"plugin:@blueprintjs/recommended", "plugin:@blueprintjs/recommended",
"plugin:compat/recommended", "plugin:compat/recommended",
@@ -115,3 +117,4 @@ module.exports = {
}, },
], ],
}; };
/* eslint-enable @blueprintjs/classes-constants -- we don't import blueprint here */
@@ -1,6 +1,10 @@
/* eslint-disable import/no-extraneous-dependencies -- this file is a devDependency*/ /* eslint-disable import/no-extraneous-dependencies -- this file is a devDependency*/
/* eslint-disable @blueprintjs/classes-constants -- we don't import blueprint here */
// eslint-disable-next-line @typescript-eslint/no-var-requires --- FIXME: disabled temporarily on migrate to TS.
const cheerio = require("cheerio"); const cheerio = require("cheerio");
// eslint-disable-next-line @typescript-eslint/no-var-requires --- FIXME: disabled temporarily on migrate to TS.
const crypto = require("crypto"); const crypto = require("crypto");
// eslint-disable-next-line @typescript-eslint/no-var-requires --- FIXME: disabled temporarily on migrate to TS.
const HtmlWebpackPlugin = require("html-webpack-plugin"); const HtmlWebpackPlugin = require("html-webpack-plugin");
const digest = (str) => { const digest = (str) => {
@@ -50,4 +54,5 @@ class CspHashPlugin {
} }
module.exports = CspHashPlugin; module.exports = CspHashPlugin;
/* eslint-enable @blueprintjs/classes-constants -- we don't import blueprint here */
/* eslint-enable import/no-extraneous-dependencies -- enable*/ /* eslint-enable import/no-extraneous-dependencies -- enable*/
@@ -1,13 +1,23 @@
/* eslint-disable @blueprintjs/classes-constants -- we don't import blueprint here */
// eslint-disable-next-line @typescript-eslint/no-var-requires --- FIXME: disabled temporarily on migrate to TS.
const path = require("path"); const path = require("path");
// eslint-disable-next-line @typescript-eslint/no-var-requires --- FIXME: disabled temporarily on migrate to TS.
const webpack = require("webpack"); const webpack = require("webpack");
// eslint-disable-next-line @typescript-eslint/no-var-requires --- FIXME: disabled temporarily on migrate to TS.
const HtmlWebpackPlugin = require("html-webpack-plugin"); const HtmlWebpackPlugin = require("html-webpack-plugin");
// eslint-disable-next-line @typescript-eslint/no-var-requires --- FIXME: disabled temporarily on migrate to TS.
const FaviconsWebpackPlugin = require("favicons-webpack-plugin"); const FaviconsWebpackPlugin = require("favicons-webpack-plugin");
// eslint-disable-next-line @typescript-eslint/no-var-requires --- FIXME: disabled temporarily on migrate to TS.
const ScriptExtHtmlWebpackPlugin = require("script-ext-html-webpack-plugin"); const ScriptExtHtmlWebpackPlugin = require("script-ext-html-webpack-plugin");
// eslint-disable-next-line @typescript-eslint/no-var-requires --- FIXME: disabled temporarily on migrate to TS.
const MiniCssExtractPlugin = require("mini-css-extract-plugin"); const MiniCssExtractPlugin = require("mini-css-extract-plugin");
// eslint-disable-next-line @typescript-eslint/no-var-requires --- FIXME: disabled temporarily on migrate to TS.
const { merge } = require("webpack-merge"); const { merge } = require("webpack-merge");
// eslint-disable-next-line @typescript-eslint/no-var-requires --- FIXME: disabled temporarily on migrate to TS.
const sharedConfig = require("./webpack.config.shared"); const sharedConfig = require("./webpack.config.shared");
// eslint-disable-next-line @typescript-eslint/no-var-requires --- FIXME: disabled temporarily on migrate to TS.
const babelOptions = require("../babel/babel.dev"); const babelOptions = require("../babel/babel.dev");
const fonts = path.resolve("src/fonts"); const fonts = path.resolve("src/fonts");
@@ -83,3 +93,4 @@ const devConfig = {
}; };
module.exports = merge(sharedConfig, devConfig); module.exports = merge(sharedConfig, devConfig);
/* eslint-enable @blueprintjs/classes-constants -- we don't import blueprint here */
@@ -1,18 +1,31 @@
// eslint-disable-next-line @typescript-eslint/no-var-requires --- FIXME: disabled temporarily on migrate to TS.
const path = require("path"); const path = require("path");
// eslint-disable-next-line @typescript-eslint/no-var-requires --- FIXME: disabled temporarily on migrate to TS.
const webpack = require("webpack"); const webpack = require("webpack");
// eslint-disable-next-line @typescript-eslint/no-var-requires --- FIXME: disabled temporarily on migrate to TS.
const HtmlWebpackPlugin = require("html-webpack-plugin"); const HtmlWebpackPlugin = require("html-webpack-plugin");
// eslint-disable-next-line @typescript-eslint/no-var-requires --- FIXME: disabled temporarily on migrate to TS.
const { CleanWebpackPlugin } = require("clean-webpack-plugin"); const { CleanWebpackPlugin } = require("clean-webpack-plugin");
// eslint-disable-next-line @typescript-eslint/no-var-requires --- FIXME: disabled temporarily on migrate to TS.
const TerserJSPlugin = require("terser-webpack-plugin"); const TerserJSPlugin = require("terser-webpack-plugin");
// eslint-disable-next-line @typescript-eslint/no-var-requires --- FIXME: disabled temporarily on migrate to TS.
const CleanCss = require("clean-css"); const CleanCss = require("clean-css");
// eslint-disable-next-line @typescript-eslint/no-var-requires --- FIXME: disabled temporarily on migrate to TS.
const OptimizeCSSAssetsPlugin = require("optimize-css-assets-webpack-plugin"); const OptimizeCSSAssetsPlugin = require("optimize-css-assets-webpack-plugin");
// eslint-disable-next-line @typescript-eslint/no-var-requires --- FIXME: disabled temporarily on migrate to TS.
const FaviconsWebpackPlugin = require("favicons-webpack-plugin"); const FaviconsWebpackPlugin = require("favicons-webpack-plugin");
// eslint-disable-next-line @typescript-eslint/no-var-requires --- FIXME: disabled temporarily on migrate to TS.
const MiniCssExtractPlugin = require("mini-css-extract-plugin"); const MiniCssExtractPlugin = require("mini-css-extract-plugin");
// eslint-disable-next-line @typescript-eslint/no-var-requires --- FIXME: disabled temporarily on migrate to TS.
const { merge } = require("webpack-merge"); const { merge } = require("webpack-merge");
// eslint-disable-next-line @typescript-eslint/no-var-requires --- FIXME: disabled temporarily on migrate to TS.
const babelOptions = require("../babel/babel.prod"); const babelOptions = require("../babel/babel.prod");
// eslint-disable-next-line @typescript-eslint/no-var-requires --- FIXME: disabled temporarily on migrate to TS.
const CspHashPlugin = require("./cspHashPlugin"); const CspHashPlugin = require("./cspHashPlugin");
// eslint-disable-next-line @typescript-eslint/no-var-requires --- FIXME: disabled temporarily on migrate to TS.
const sharedConfig = require("./webpack.config.shared"); const sharedConfig = require("./webpack.config.shared");
const fonts = path.resolve("src/fonts"); const fonts = path.resolve("src/fonts");
@@ -1,8 +1,13 @@
/* eslint-disable @blueprintjs/classes-constants -- we don't import blueprint here */
// eslint-disable-next-line @typescript-eslint/no-var-requires --- FIXME: disabled temporarily on migrate to TS.
const path = require("path"); const path = require("path");
// eslint-disable-next-line @typescript-eslint/no-var-requires --- FIXME: disabled temporarily on migrate to TS.
const fs = require("fs"); const fs = require("fs");
// eslint-disable-next-line @typescript-eslint/no-var-requires --- FIXME: disabled temporarily on migrate to TS.
const MiniCssExtractPlugin = require("mini-css-extract-plugin"); const MiniCssExtractPlugin = require("mini-css-extract-plugin");
// eslint-disable-next-line @typescript-eslint/no-var-requires --- FIXME: disabled temporarily on migrate to TS.
const ObsoleteWebpackPlugin = require("obsolete-webpack-plugin"); const ObsoleteWebpackPlugin = require("obsolete-webpack-plugin");
// eslint-disable-next-line @blueprintjs/classes-constants -- incorrect match // eslint-disable-next-line @typescript-eslint/no-var-requires --- FIXME: disabled temporarily on migrate to TS.
const ScriptExtHtmlWebpackPlugin = require("script-ext-html-webpack-plugin"); const ScriptExtHtmlWebpackPlugin = require("script-ext-html-webpack-plugin");
const src = path.resolve("src"); const src = path.resolve("src");
@@ -75,3 +80,4 @@ module.exports = {
}), }),
], ],
}; };
/* eslint-enable @blueprintjs/classes-constants -- we don't import blueprint here */
+41 -5
View File
@@ -9,8 +9,11 @@ import { MatrixFBS, AnnotationsHelpers } from "../util/stateManager";
const { isUserAnnotation } = AnnotationsHelpers; const { isUserAnnotation } = AnnotationsHelpers;
export const annotationCreateCategoryAction = ( export const annotationCreateCategoryAction = (
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
newCategoryName: any, newCategoryName: any,
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
categoryToDuplicate: any categoryToDuplicate: any
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
) => async (dispatch: any, getState: any) => { ) => async (dispatch: any, getState: any) => {
/* /*
Add a new user-created category to the obs annotations. Add a new user-created category to the obs annotations.
@@ -89,8 +92,11 @@ export const annotationCreateCategoryAction = (
}; };
export const annotationRenameCategoryAction = ( export const annotationRenameCategoryAction = (
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
oldCategoryName: any, oldCategoryName: any,
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
newCategoryName: any newCategoryName: any
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
) => (dispatch: any, getState: any) => { ) => (dispatch: any, getState: any) => {
/* /*
Rename a user-created annotation category Rename a user-created annotation category
@@ -124,8 +130,11 @@ export const annotationRenameCategoryAction = (
}); });
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
export const annotationDeleteCategoryAction = (categoryName: any) => ( export const annotationDeleteCategoryAction = (categoryName: any) => (
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
dispatch: any, dispatch: any,
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
getState: any getState: any
) => { ) => {
/* /*
@@ -149,9 +158,12 @@ export const annotationDeleteCategoryAction = (categoryName: any) => (
}; };
export const annotationCreateLabelInCategory = ( export const annotationCreateLabelInCategory = (
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
categoryName: any, categoryName: any,
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
labelName: any, labelName: any,
assignSelected: any // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
assignSelected: any // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
) => async (dispatch: any, getState: any) => { ) => async (dispatch: any, getState: any) => {
/* /*
Add a new label to a user-defined category. If assignSelected is true, assign Add a new label to a user-defined category. If assignSelected is true, assign
@@ -188,8 +200,10 @@ export const annotationCreateLabelInCategory = (
}; };
export const annotationDeleteLabelFromCategory = ( export const annotationDeleteLabelFromCategory = (
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
categoryName: any, categoryName: any,
labelName: any // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
labelName: any // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
) => async (dispatch: any, getState: any) => { ) => async (dispatch: any, getState: any) => {
/* /*
delete a label from a user-defined category delete a label from a user-defined category
@@ -218,9 +232,13 @@ export const annotationDeleteLabelFromCategory = (
}; };
export const annotationRenameLabelInCategory = ( export const annotationRenameLabelInCategory = (
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
categoryName: any, categoryName: any,
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
oldLabelName: any, oldLabelName: any,
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
newLabelName: any newLabelName: any
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
) => async (dispatch: any, getState: any) => { ) => async (dispatch: any, getState: any) => {
/* /*
label name change label name change
@@ -255,8 +273,11 @@ export const annotationRenameLabelInCategory = (
}; };
export const annotationLabelCurrentSelection = ( export const annotationLabelCurrentSelection = (
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
categoryName: any, categoryName: any,
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
labelName: any labelName: any
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
) => async (dispatch: any, getState: any) => { ) => async (dispatch: any, getState: any) => {
/* /*
set the label on all currently selected set the label on all currently selected
@@ -284,14 +305,22 @@ export const annotationLabelCurrentSelection = (
}); });
}; };
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
function writableAnnotations(annoMatrix: any) { function writableAnnotations(annoMatrix: any) {
return annoMatrix.schema.annotations.obs.columns return (
.filter((s: any) => s.writable) annoMatrix.schema.annotations.obs.columns
.map((s: any) => s.name); // eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
.filter((s: any) => s.writable)
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
.map((s: any) => s.name)
);
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
export const needToSaveObsAnnotations = ( export const needToSaveObsAnnotations = (
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
annoMatrix: any, annoMatrix: any,
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
lastSavedAnnoMatrix: any lastSavedAnnoMatrix: any
) => { ) => {
/* /*
@@ -317,12 +346,16 @@ export const needToSaveObsAnnotations = (
// no schema changes; check for change in contents // no schema changes; check for change in contents
return currentWritable.some( return currentWritable.some(
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
(col: any) => annoMatrix.col(col) !== lastSavedAnnoMatrix.col(col) (col: any) => annoMatrix.col(col) !== lastSavedAnnoMatrix.col(col)
); );
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
export const saveObsAnnotationsAction = () => async ( export const saveObsAnnotationsAction = () => async (
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
dispatch: any, dispatch: any,
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
getState: any getState: any
) => { ) => {
/* /*
@@ -394,8 +427,11 @@ export const saveObsAnnotationsAction = () => async (
} }
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
export const saveGenesetsAction = () => async ( export const saveGenesetsAction = () => async (
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
dispatch: any, dispatch: any,
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
getState: any getState: any
) => { ) => {
const state = getState(); const state = getState();
+7
View File
@@ -5,9 +5,13 @@ action creators related to embeddings choice
import { AnnoMatrixObsCrossfilter } from "../annoMatrix"; import { AnnoMatrixObsCrossfilter } from "../annoMatrix";
import { _setEmbeddingSubset } from "../util/stateManager/viewStackHelpers"; import { _setEmbeddingSubset } from "../util/stateManager/viewStackHelpers";
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
export async function _switchEmbedding( export async function _switchEmbedding(
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
prevAnnoMatrix: any, prevAnnoMatrix: any,
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
prevCrossfilter: any, prevCrossfilter: any,
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
newEmbeddingName: any newEmbeddingName: any
) { ) {
/* /*
@@ -25,8 +29,11 @@ export async function _switchEmbedding(
return [annoMatrix, obsCrossfilter]; return [annoMatrix, obsCrossfilter];
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
export const layoutChoiceAction = (newLayoutChoice: any) => async ( export const layoutChoiceAction = (newLayoutChoice: any) => async (
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
dispatch: any, dispatch: any,
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
getState: any getState: any
) => { ) => {
/* /*
+20
View File
@@ -21,8 +21,11 @@ The behavior manifest in these action creators:
Note that crossfilter indices are lazy created, as needed. Note that crossfilter indices are lazy created, as needed.
*/ */
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
export const genesetDelete = (genesetName: any) => ( export const genesetDelete = (genesetName: any) => (
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
dispatch: any, dispatch: any,
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
getState: any getState: any
) => { ) => {
const state = getState(); const state = getState();
@@ -43,8 +46,11 @@ export const genesetDelete = (genesetName: any) => (
}); });
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
export const genesetAddGenes = (genesetName: any, genes: any) => async ( export const genesetAddGenes = (genesetName: any, genes: any) => async (
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
dispatch: any, dispatch: any,
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
getState: any getState: any
) => { ) => {
const state = getState(); const state = getState();
@@ -53,6 +59,7 @@ export const genesetAddGenes = (genesetName: any, genes: any) => async (
const varIndex = schema.annotations.var.index; const varIndex = schema.annotations.var.index;
const df = await annoMatrix.fetch("var", varIndex); const df = await annoMatrix.fetch("var", varIndex);
const geneNames = df.col(varIndex).asArray(); const geneNames = df.col(varIndex).asArray();
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
genes = genes.reduce((acc: any, gene: any) => { genes = genes.reduce((acc: any, gene: any) => {
if (geneNames.indexOf(gene.geneSymbol) === -1) { if (geneNames.indexOf(gene.geneSymbol) === -1) {
postUserErrorToast( postUserErrorToast(
@@ -81,8 +88,11 @@ export const genesetAddGenes = (genesetName: any, genes: any) => async (
}); });
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
export const genesetDeleteGenes = (genesetName: any, geneSymbols: any) => ( export const genesetDeleteGenes = (genesetName: any, geneSymbols: any) => (
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
dispatch: any, dispatch: any,
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
getState: any getState: any
) => { ) => {
const state = getState(); const state = getState();
@@ -101,8 +111,11 @@ Private
*/ */
function dropGenesetSummaryDimension( function dropGenesetSummaryDimension(
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
obsCrossfilter: any, obsCrossfilter: any,
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
state: any, state: any,
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
genesetName: any genesetName: any
) { ) {
const { annoMatrix, genesets } = state; const { annoMatrix, genesets } = state;
@@ -120,6 +133,7 @@ function dropGenesetSummaryDimension(
return obsCrossfilter.dropDimension("X", query); return obsCrossfilter.dropDimension("X", query);
} }
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
function dropGeneDimension(obsCrossfilter: any, state: any, gene: any) { function dropGeneDimension(obsCrossfilter: any, state: any, gene: any) {
const { annoMatrix } = state; const { annoMatrix } = state;
const varIndex = annoMatrix.schema.annotations?.var?.index; const varIndex = annoMatrix.schema.annotations?.var?.index;
@@ -134,13 +148,18 @@ function dropGeneDimension(obsCrossfilter: any, state: any, gene: any) {
} }
function dropGeneset( function dropGeneset(
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
dispatch: any, dispatch: any,
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
state: any, state: any,
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
genesetName: any, genesetName: any,
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
geneSymbols: any geneSymbols: any
) { ) {
const { obsCrossfilter: prevObsCrossfilter } = state; const { obsCrossfilter: prevObsCrossfilter } = state;
const obsCrossfilter = geneSymbols.reduce( const obsCrossfilter = geneSymbols.reduce(
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
(crossfilter: any, gene: any) => (crossfilter: any, gene: any) =>
dropGeneDimension(crossfilter, state, gene), dropGeneDimension(crossfilter, state, gene),
dropGenesetSummaryDimension(prevObsCrossfilter, state, genesetName) dropGenesetSummaryDimension(prevObsCrossfilter, state, genesetName)
@@ -150,6 +169,7 @@ function dropGeneset(
continuousNamespace: { isGeneSetSummary: true }, continuousNamespace: { isGeneSetSummary: true },
selection: genesetName, selection: genesetName,
}); });
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
geneSymbols.forEach((g: any) => geneSymbols.forEach((g: any) =>
dispatch({ dispatch({
type: "continuous metadata histogram cancel", type: "continuous metadata histogram cancel",
+18
View File
@@ -15,6 +15,7 @@ import * as genesetActions from "./geneset";
/* /*
return promise fetching user-configured colors return promise fetching user-configured colors
*/ */
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
async function userColorsFetchAndLoad(dispatch: any) { async function userColorsFetchAndLoad(dispatch: any) {
return fetchJson("colors").then((response) => return fetchJson("colors").then((response) =>
dispatch({ dispatch({
@@ -28,6 +29,7 @@ async function schemaFetch() {
return fetchJson("schema"); return fetchJson("schema");
} }
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
async function configFetch(dispatch: any) { async function configFetch(dispatch: any) {
return fetchJson("config").then((response) => { return fetchJson("config").then((response) => {
const config = { ...globals.configDefaults, ...response.config }; const config = { ...globals.configDefaults, ...response.config };
@@ -39,6 +41,7 @@ async function configFetch(dispatch: any) {
}); });
} }
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
async function userInfoFetch(dispatch: any) { async function userInfoFetch(dispatch: any) {
return fetchJson("userinfo").then((response) => { return fetchJson("userinfo").then((response) => {
const { userinfo: userInfo } = response || {}; const { userinfo: userInfo } = response || {};
@@ -50,6 +53,7 @@ async function userInfoFetch(dispatch: any) {
}); });
} }
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
async function genesetsFetch(dispatch: any, config: any) { async function genesetsFetch(dispatch: any, config: any) {
/* request genesets ONLY if the backend supports the feature */ /* request genesets ONLY if the backend supports the feature */
const defaultResponse = { const defaultResponse = {
@@ -71,19 +75,24 @@ async function genesetsFetch(dispatch: any, config: any) {
} }
} }
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
function prefetchEmbeddings(annoMatrix: any) { function prefetchEmbeddings(annoMatrix: any) {
/* /*
prefetch requests for all embeddings prefetch requests for all embeddings
*/ */
const { schema } = annoMatrix; const { schema } = annoMatrix;
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
const available = schema.layout.obs.map((v: any) => v.name); const available = schema.layout.obs.map((v: any) => v.name);
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
available.forEach((embName: any) => annoMatrix.prefetch("emb", embName)); available.forEach((embName: any) => annoMatrix.prefetch("emb", embName));
} }
/* /*
Application bootstrap Application bootstrap
*/ */
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
const doInitialDataLoad = () => const doInitialDataLoad = () =>
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
catchErrorsWrap(async (dispatch: any) => { catchErrorsWrap(async (dispatch: any) => {
dispatch({ type: "initial data load start" }); dispatch({ type: "initial data load start" });
@@ -114,6 +123,7 @@ const doInitialDataLoad = () =>
const layoutSchema = schema?.schema?.layout?.obs ?? []; const layoutSchema = schema?.schema?.layout?.obs ?? [];
if ( if (
defaultEmbedding && defaultEmbedding &&
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
layoutSchema.some((s: any) => s.name === defaultEmbedding) layoutSchema.some((s: any) => s.name === defaultEmbedding)
) { ) {
dispatch(embActions.layoutChoiceAction(defaultEmbedding)); dispatch(embActions.layoutChoiceAction(defaultEmbedding));
@@ -123,6 +133,7 @@ const doInitialDataLoad = () =>
} }
}, true); }, true);
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
function requestSingleGeneExpressionCountsForColoringPOST(gene: any) { function requestSingleGeneExpressionCountsForColoringPOST(gene: any) {
return { return {
type: "color by expression", type: "color by expression",
@@ -130,6 +141,7 @@ function requestSingleGeneExpressionCountsForColoringPOST(gene: any) {
}; };
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
const requestUserDefinedGene = (gene: any) => ({ const requestUserDefinedGene = (gene: any) => ({
type: "request user defined gene success", type: "request user defined gene success",
@@ -138,6 +150,7 @@ const requestUserDefinedGene = (gene: any) => ({
}, },
}); });
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
const dispatchDiffExpErrors = (dispatch: any, response: any) => { const dispatchDiffExpErrors = (dispatch: any, response: any) => {
switch (response.status) { switch (response.status) {
case 403: case 403:
@@ -162,9 +175,12 @@ const dispatchDiffExpErrors = (dispatch: any, response: any) => {
}; };
const requestDifferentialExpression = ( const requestDifferentialExpression = (
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
set1: any, set1: any,
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
set2: any, set2: any,
num_genes = 50 num_genes = 50
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
) => async (dispatch: any, getState: any) => { ) => async (dispatch: any, getState: any) => {
dispatch({ type: "request differential expression started" }); dispatch({ type: "request differential expression started" });
try { try {
@@ -214,6 +230,7 @@ const requestDifferentialExpression = (
const diffexpLists = { negative: [], positive: [] }; const diffexpLists = { negative: [], positive: [] };
for (const polarity of Object.keys(diffexpLists)) { for (const polarity of Object.keys(diffexpLists)) {
// @ts-expect-error ts-migrate(7053) FIXME: Element implicitly has an 'any' type because expre... Remove this comment to see the full error message // @ts-expect-error ts-migrate(7053) FIXME: Element implicitly has an 'any' type because expre... Remove this comment to see the full error message
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
diffexpLists[polarity] = response[polarity].map((v: any) => [ diffexpLists[polarity] = response[polarity].map((v: any) => [
varIndex.at(v[0], varIndexName), varIndex.at(v[0], varIndexName),
...v.slice(1), ...v.slice(1),
@@ -233,6 +250,7 @@ const requestDifferentialExpression = (
} }
}; };
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
function fetchJson(pathAndQuery: any) { function fetchJson(pathAndQuery: any) {
return doJsonRequest( return doJsonRequest(
`${globals.API.prefix}${globals.API.version}${pathAndQuery}` `${globals.API.prefix}${globals.API.version}${pathAndQuery}`
+48 -6
View File
@@ -2,10 +2,13 @@
Action creators for selection Action creators for selection
*/ */
export const selectContinuousMetadataAction = ( export const selectContinuousMetadataAction = (
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
type: any, type: any,
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
query: any, query: any,
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
range: any, range: any,
oldProps = {} oldProps = {} // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
) => async (dispatch: any, getState: any) => { ) => async (dispatch: any, getState: any) => {
const { obsCrossfilter: prevObsCrossfilter } = getState(); const { obsCrossfilter: prevObsCrossfilter } = getState();
@@ -29,12 +32,21 @@ export const selectContinuousMetadataAction = (
}; };
export const selectCategoricalMetadataAction = ( export const selectCategoricalMetadataAction = (
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
type: any, // action type type: any, // action type
metadataField: any, // annotation category name // annotation category name
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
metadataField: any,
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
labels: any, labels: any,
label: any, // the label being selected/deselected // the label being selected/deselected
isSelected: any, // bool // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
label: any,
// bool
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
isSelected: any,
oldProps = {} oldProps = {}
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
) => async (dispatch: any, getState: any) => { ) => async (dispatch: any, getState: any) => {
const { const {
obsCrossfilter: prevObsCrossfilter, obsCrossfilter: prevObsCrossfilter,
@@ -43,6 +55,7 @@ export const selectCategoricalMetadataAction = (
const labelSelectionState = new Map(categoricalSelection[metadataField]); const labelSelectionState = new Map(categoricalSelection[metadataField]);
labels.forEach( labels.forEach(
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
(l: any) => labelSelectionState.has(l) || labelSelectionState.set(l, true) (l: any) => labelSelectionState.has(l) || labelSelectionState.set(l, true)
); );
labelSelectionState.set(label, isSelected); labelSelectionState.set(label, isSelected);
@@ -70,11 +83,18 @@ export const selectCategoricalMetadataAction = (
}; };
export const selectCategoricalAllMetadataAction = ( export const selectCategoricalAllMetadataAction = (
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
type: any, // action type type: any, // action type
metadataField: any, // annotation category name // annotation category name
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
metadataField: any,
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
labels: any, labels: any,
isSelected: any, // bool, select all or none // bool, select all or none
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
isSelected: any,
oldProps = {} oldProps = {}
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
) => async (dispatch: any, getState: any) => { ) => async (dispatch: any, getState: any) => {
const { const {
obsCrossfilter: prevObsCrossfilter, obsCrossfilter: prevObsCrossfilter,
@@ -82,6 +102,7 @@ export const selectCategoricalAllMetadataAction = (
} = getState(); } = getState();
const labelSelectionState = new Map(categoricalSelection[metadataField]); const labelSelectionState = new Map(categoricalSelection[metadataField]);
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
labels.forEach((label: any) => labelSelectionState.set(label, isSelected)); labels.forEach((label: any) => labelSelectionState.set(label, isSelected));
const selection = { mode: isSelected ? "all" : "none" }; const selection = { mode: isSelected ? "all" : "none" };
@@ -104,14 +125,19 @@ export const selectCategoricalAllMetadataAction = (
** Graph selection-related actions ** Graph selection-related actions
**/ **/
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
export const graphBrushStartAction = () => export const graphBrushStartAction = () =>
/* no change to crossfilter until a change fires */ /* no change to crossfilter until a change fires */
({ type: "graph brush start" }); ({ type: "graph brush start" });
const _graphBrushWithinRectAction = ( const _graphBrushWithinRectAction = (
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
type: any, type: any,
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
embName: any, embName: any,
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
brushCoords: any brushCoords: any
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
) => async (dispatch: any, getState: any) => { ) => async (dispatch: any, getState: any) => {
const { obsCrossfilter: prevObsCrossfilter } = getState(); const { obsCrossfilter: prevObsCrossfilter } = getState();
@@ -129,8 +155,11 @@ const _graphBrushWithinRectAction = (
}); });
}; };
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
const _graphAllAction = (type: any, embName: any) => async ( const _graphAllAction = (type: any, embName: any) => async (
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
dispatch: any, dispatch: any,
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
getState: any getState: any
) => { ) => {
const { obsCrossfilter: prevObsCrossfilter } = getState(); const { obsCrossfilter: prevObsCrossfilter } = getState();
@@ -145,29 +174,39 @@ const _graphAllAction = (type: any, embName: any) => async (
}); });
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
export const graphBrushChangeAction = (embName: any, brushCoords: any) => export const graphBrushChangeAction = (embName: any, brushCoords: any) =>
_graphBrushWithinRectAction("graph brush change", embName, brushCoords); _graphBrushWithinRectAction("graph brush change", embName, brushCoords);
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
export const graphBrushEndAction = (embName: any, brushCoords: any) => export const graphBrushEndAction = (embName: any, brushCoords: any) =>
_graphBrushWithinRectAction("graph brush end", embName, brushCoords); _graphBrushWithinRectAction("graph brush end", embName, brushCoords);
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
export const graphBrushCancelAction = (embName: any) => export const graphBrushCancelAction = (embName: any) =>
_graphAllAction("graph brush cancel", embName); _graphAllAction("graph brush cancel", embName);
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
export const graphBrushDeselectAction = (embName: any) => export const graphBrushDeselectAction = (embName: any) =>
_graphAllAction("graph brush deselect", embName); _graphAllAction("graph brush deselect", embName);
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
export const graphLassoStartAction = () => export const graphLassoStartAction = () =>
/* no change to crossfilter until a change fires */ /* no change to crossfilter until a change fires */
({ type: "graph lasso start" }); ({ type: "graph lasso start" });
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
export const graphLassoCancelAction = (embName: any) => export const graphLassoCancelAction = (embName: any) =>
_graphAllAction("graph lasso cancel", embName); _graphAllAction("graph lasso cancel", embName);
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
export const graphLassoDeselectAction = (embName: any) => export const graphLassoDeselectAction = (embName: any) =>
_graphAllAction("graph lasso cancel", embName); _graphAllAction("graph lasso cancel", embName);
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
export const graphLassoEndAction = (embName: any, polygon: any) => async ( export const graphLassoEndAction = (embName: any, polygon: any) => async (
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
dispatch: any, dispatch: any,
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
getState: any getState: any
) => { ) => {
const { obsCrossfilter: prevObsCrossfilter } = getState(); const { obsCrossfilter: prevObsCrossfilter } = getState();
@@ -192,8 +231,11 @@ export const graphLassoEndAction = (embName: any, polygon: any) => async (
/* /*
Differential expression set selection Differential expression set selection
*/ */
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
export const setCellSetFromSelection = (cellSetId: any) => ( export const setCellSetFromSelection = (cellSetId: any) => (
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
dispatch: any, dispatch: any,
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
getState: any getState: any
) => { ) => {
const { obsCrossfilter } = getState(); const { obsCrossfilter } = getState();
+5
View File
@@ -18,8 +18,11 @@ import {
_userResetSubsetAnnoMatrix, _userResetSubsetAnnoMatrix,
} from "../util/stateManager/viewStackHelpers"; } from "../util/stateManager/viewStackHelpers";
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
export const clipAction = (min: any, max: any) => ( export const clipAction = (min: any, max: any) => (
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
dispatch: any, dispatch: any,
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
getState: any getState: any
) => { ) => {
/* /*
@@ -37,6 +40,7 @@ export const clipAction = (min: any, max: any) => (
}); });
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
export const subsetAction = () => (dispatch: any, getState: any) => { export const subsetAction = () => (dispatch: any, getState: any) => {
/* /*
Subset the annoMatrix to the current crossfilter selection by pushing a Subset the annoMatrix to the current crossfilter selection by pushing a
@@ -61,6 +65,7 @@ export const subsetAction = () => (dispatch: any, getState: any) => {
}); });
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
export const resetSubsetAction = () => (dispatch: any, getState: any) => { export const resetSubsetAction = () => (dispatch: any, getState: any) => {
/* /*
Reset the annoMatrix to all data. Because we may have multiple views Reset the annoMatrix to all data. Because we may have multiple views
+40 -10
View File
@@ -17,26 +17,37 @@ import { _queryValidate, _queryCacheKey } from "./query";
const _dataframeCache = dataframeMemo(128); const _dataframeCache = dataframeMemo(128);
export default class AnnoMatrix { export default class AnnoMatrix {
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
public isView: any; public isView: any;
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
public nObs: any; public nObs: any;
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
public nVar: any; public nVar: any;
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
public rowIndex: any; public rowIndex: any;
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
public schema: any; public schema: any;
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
public userFlags: any; public userFlags: any;
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
public viewOf: any; public viewOf: any;
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
protected _cache: any; protected _cache: any;
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
private _pendingLoad: any; private _pendingLoad: any;
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
private _whereCache: any; private _whereCache: any;
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
private _gcInfo: any; private _gcInfo: any;
/* /*
@@ -69,6 +80,7 @@ export default class AnnoMatrix {
subset(annoMatrix, rowLabels) -> annoMatrix subset(annoMatrix, rowLabels) -> annoMatrix
etc. etc.
*/ */
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
static fields() { static fields() {
/* /*
return the fields present in the AnnoMatrix instance. return the fields present in the AnnoMatrix instance.
@@ -76,6 +88,7 @@ export default class AnnoMatrix {
return ["obs", "var", "emb", "X"]; return ["obs", "var", "emb", "X"];
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
constructor(schema: any, nObs: any, nVar: any, rowIndex = null) { constructor(schema: any, nObs: any, nVar: any, rowIndex = null) {
/* /*
Private constructor - this is an abstract base class. Do not use. Private constructor - this is an abstract base class. Do not use.
@@ -132,6 +145,7 @@ export default class AnnoMatrix {
** Schema helper/accessors ** Schema helper/accessors
**/ **/
// @ts-expect-error ts-migrate(7006) FIXME: Parameter 'field' implicitly has an 'any' type. // @ts-expect-error ts-migrate(7006) FIXME: Parameter 'field' implicitly has an 'any' type.
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
getMatrixColumns(field) { getMatrixColumns(field) {
/* /*
Return array of column names in the field. ONLY supported on the Return array of column names in the field. ONLY supported on the
@@ -144,7 +158,7 @@ export default class AnnoMatrix {
return _schemaColumns(this.schema, field); return _schemaColumns(this.schema, field);
} }
// eslint-disable-next-line class-methods-use-this -- need to be able to call this on instances // eslint-disable-next-line class-methods-use-this, @typescript-eslint/explicit-module-boundary-types -- need to be able to call this on instances
getMatrixFields() { getMatrixFields() {
/* /*
Return array of fields in this annoMatrix. Currently hard-wired to Return array of fields in this annoMatrix. Currently hard-wired to
@@ -156,6 +170,7 @@ export default class AnnoMatrix {
} }
// @ts-expect-error ts-migrate(7006) FIXME: Parameter 'field' implicitly has an 'any' type. // @ts-expect-error ts-migrate(7006) FIXME: Parameter 'field' implicitly has an 'any' type.
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
getColumnSchema(field, col) { getColumnSchema(field, col) {
/* /*
Return the schema for the field & column ,eg, Return the schema for the field & column ,eg,
@@ -169,6 +184,7 @@ export default class AnnoMatrix {
} }
// @ts-expect-error ts-migrate(7006) FIXME: Parameter 'field' implicitly has an 'any' type. // @ts-expect-error ts-migrate(7006) FIXME: Parameter 'field' implicitly has an 'any' type.
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
getColumnDimensions(field, col) { getColumnDimensions(field, col) {
/* /*
Return the dimensions on this field / column. For most fields, which are 1D, Return the dimensions on this field / column. For most fields, which are 1D,
@@ -187,10 +203,12 @@ export default class AnnoMatrix {
/** /**
** General utility methods ** General utility methods
**/ **/
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
base() { base() {
/* /*
return the base of view, or `this` if not a view. return the base of view, or `this` if not a view.
*/ */
// eslint-disable-next-line @typescript-eslint/no-this-alias --- FIXME: disabled temporarily on migrate to TS.
let annoMatrix = this; let annoMatrix = this;
while (annoMatrix.isView) annoMatrix = annoMatrix.viewOf; while (annoMatrix.isView) annoMatrix = annoMatrix.viewOf;
return annoMatrix; return annoMatrix;
@@ -200,6 +218,7 @@ export default class AnnoMatrix {
** Load / read interfaces ** Load / read interfaces
**/ **/
// @ts-expect-error ts-migrate(7006) FIXME: Parameter 'field' implicitly has an 'any' type. // @ts-expect-error ts-migrate(7006) FIXME: Parameter 'field' implicitly has an 'any' type.
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
fetch(field, q) { fetch(field, q) {
/* /*
Return the given query on a single matrix field as a single dataframe. Return the given query on a single matrix field as a single dataframe.
@@ -258,6 +277,7 @@ export default class AnnoMatrix {
} }
// @ts-expect-error ts-migrate(7006) FIXME: Parameter 'field' implicitly has an 'any' type. // @ts-expect-error ts-migrate(7006) FIXME: Parameter 'field' implicitly has an 'any' type.
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
prefetch(field, q) { prefetch(field, q) {
/* /*
Start a data fetch & cache fill. Identical to fetch() except it does Start a data fetch & cache fill. Identical to fetch() except it does
@@ -289,7 +309,7 @@ export default class AnnoMatrix {
**/ **/
// @ts-expect-error ts-migrate(6133) FIXME: 'col' is declared but its value is never read. // @ts-expect-error ts-migrate(6133) FIXME: 'col' is declared but its value is never read.
// eslint-disable-next-line class-methods-use-this, @typescript-eslint/no-unused-vars -- make sure subclass implements // eslint-disable-next-line class-methods-use-this, @typescript-eslint/no-unused-vars, @typescript-eslint/explicit-module-boundary-types -- make sure subclass implements
addObsAnnoCategory(col, category) { addObsAnnoCategory(col, category) {
/* /*
Add a new category value (aka "label") to a writable obs column, and return the new AnnoMatrix. Add a new category value (aka "label") to a writable obs column, and return the new AnnoMatrix.
@@ -307,7 +327,7 @@ export default class AnnoMatrix {
} }
// @ts-expect-error ts-migrate(6133) FIXME: 'col' is declared but its value is never read. // @ts-expect-error ts-migrate(6133) FIXME: 'col' is declared but its value is never read.
// eslint-disable-next-line class-methods-use-this, @typescript-eslint/no-unused-vars -- make sure subclass implements // eslint-disable-next-line class-methods-use-this, @typescript-eslint/no-unused-vars, @typescript-eslint/explicit-module-boundary-types -- make sure subclass implements
async removeObsAnnoCategory(col, category, unassignedCategory) { async removeObsAnnoCategory(col, category, unassignedCategory) {
/* /*
Remove a category value from an obs column, reassign any obs having that value Remove a category value from an obs column, reassign any obs having that value
@@ -329,7 +349,7 @@ export default class AnnoMatrix {
} }
// @ts-expect-error ts-migrate(6133) FIXME: 'col' is declared but its value is never read. // @ts-expect-error ts-migrate(6133) FIXME: 'col' is declared but its value is never read.
// eslint-disable-next-line class-methods-use-this, @typescript-eslint/no-unused-vars -- make sure subclass implements // eslint-disable-next-line class-methods-use-this, @typescript-eslint/no-unused-vars, @typescript-eslint/explicit-module-boundary-types -- make sure subclass implements
dropObsColumn(col) { dropObsColumn(col) {
/* /*
Drop an entire writable column, eg a user-created obs annotation. Typical use Drop an entire writable column, eg a user-created obs annotation. Typical use
@@ -346,7 +366,7 @@ export default class AnnoMatrix {
} }
// @ts-expect-error ts-migrate(6133) FIXME: 'colSchema' is declared but its value is never rea... Remove this comment to see the full error message // @ts-expect-error ts-migrate(6133) FIXME: 'colSchema' is declared but its value is never rea... Remove this comment to see the full error message
// eslint-disable-next-line class-methods-use-this, @typescript-eslint/no-unused-vars -- make sure subclass implements // eslint-disable-next-line class-methods-use-this, @typescript-eslint/no-unused-vars, @typescript-eslint/explicit-module-boundary-types -- make sure subclass implements
addObsColumn(colSchema, Ctor, value) { addObsColumn(colSchema, Ctor, value) {
/* /*
Add a new writable OBS annotation column, with the caller-specified schema, initial value Add a new writable OBS annotation column, with the caller-specified schema, initial value
@@ -376,7 +396,7 @@ export default class AnnoMatrix {
} }
// @ts-expect-error ts-migrate(6133) FIXME: 'oldCol' is declared but its value is never read. // @ts-expect-error ts-migrate(6133) FIXME: 'oldCol' is declared but its value is never read.
// eslint-disable-next-line class-methods-use-this, @typescript-eslint/no-unused-vars -- make sure subclass implements // eslint-disable-next-line class-methods-use-this, @typescript-eslint/no-unused-vars, @typescript-eslint/explicit-module-boundary-types -- make sure subclass implements
renameObsColumn(oldCol, newCol) { renameObsColumn(oldCol, newCol) {
/* /*
Rename the obs column 'oldCol' to have name 'newCol' and returns new AnnoMatrix. Rename the obs column 'oldCol' to have name 'newCol' and returns new AnnoMatrix.
@@ -392,7 +412,7 @@ export default class AnnoMatrix {
} }
// @ts-expect-error ts-migrate(6133) FIXME: 'col' is declared but its value is never read. // @ts-expect-error ts-migrate(6133) FIXME: 'col' is declared but its value is never read.
// eslint-disable-next-line class-methods-use-this, @typescript-eslint/no-unused-vars -- make sure subclass implements // eslint-disable-next-line class-methods-use-this, @typescript-eslint/no-unused-vars, @typescript-eslint/explicit-module-boundary-types -- make sure subclass implements
async setObsColumnValues(col, obsLabels, value) { async setObsColumnValues(col, obsLabels, value) {
/* /*
Set all obs with label in array 'obsLabels' to have 'value'. Typical use would be Set all obs with label in array 'obsLabels' to have 'value'. Typical use would be
@@ -411,7 +431,7 @@ export default class AnnoMatrix {
} }
// @ts-expect-error ts-migrate(6133) FIXME: 'col' is declared but its value is never read. // @ts-expect-error ts-migrate(6133) FIXME: 'col' is declared but its value is never read.
// eslint-disable-next-line class-methods-use-this, @typescript-eslint/no-unused-vars -- make sure subclass implements // eslint-disable-next-line class-methods-use-this, @typescript-eslint/no-unused-vars, @typescript-eslint/explicit-module-boundary-types -- make sure subclass implements
async resetObsColumnValues(col, oldValue, newValue) { async resetObsColumnValues(col, oldValue, newValue) {
/* /*
Set by value - all elements in the column with value 'oldValue' are set to 'newValue'. Set by value - all elements in the column with value 'oldValue' are set to 'newValue'.
@@ -429,7 +449,7 @@ export default class AnnoMatrix {
} }
// @ts-expect-error ts-migrate(6133) FIXME: 'colSchema' is declared but its value is never rea... Remove this comment to see the full error message // @ts-expect-error ts-migrate(6133) FIXME: 'colSchema' is declared but its value is never rea... Remove this comment to see the full error message
// eslint-disable-next-line class-methods-use-this, @typescript-eslint/no-unused-vars -- make sure subclass implements // eslint-disable-next-line class-methods-use-this, @typescript-eslint/no-unused-vars, @typescript-eslint/explicit-module-boundary-types -- make sure subclass implements
addEmbedding(colSchema) { addEmbedding(colSchema) {
/* /*
Add a new obs embedding to the AnnoMatrix, with provided schema. Add a new obs embedding to the AnnoMatrix, with provided schema.
@@ -443,6 +463,7 @@ export default class AnnoMatrix {
} }
// @ts-expect-error ts-migrate(7006) FIXME: Parameter 'field' implicitly has an 'any' type. // @ts-expect-error ts-migrate(7006) FIXME: Parameter 'field' implicitly has an 'any' type.
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
getCacheKeys(field, query) { getCacheKeys(field, query) {
/* /*
Return cache keys for columns associated with this query. May return Return cache keys for columns associated with this query. May return
@@ -455,6 +476,7 @@ Return cache keys for columns associated with this query. May return
** Private interfaces below. ** Private interfaces below.
**/ **/
// @ts-expect-error ts-migrate(7006) FIXME: Parameter 'field' implicitly has an 'any' type. // @ts-expect-error ts-migrate(7006) FIXME: Parameter 'field' implicitly has an 'any' type.
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
_resolveCachedQueries(field, queries) { _resolveCachedQueries(field, queries) {
return ( return (
queries queries
@@ -471,6 +493,7 @@ Return cache keys for columns associated with this query. May return
} }
// @ts-expect-error ts-migrate(7006) FIXME: Parameter 'field' implicitly has an 'any' type. // @ts-expect-error ts-migrate(7006) FIXME: Parameter 'field' implicitly has an 'any' type.
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
async _fetch(field, q) { async _fetch(field, q) {
if (!AnnoMatrix.fields().includes(field)) return undefined; if (!AnnoMatrix.fields().includes(field)) return undefined;
const queries = Array.isArray(q) ? q : [q]; const queries = Array.isArray(q) ? q : [q];
@@ -518,6 +541,7 @@ Return cache keys for columns associated with this query. May return
} }
// @ts-expect-error ts-migrate(7006) FIXME: Parameter 'field' implicitly has an 'any' type. // @ts-expect-error ts-migrate(7006) FIXME: Parameter 'field' implicitly has an 'any' type.
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
async _getPendingLoad(field, query, fetchFn) { async _getPendingLoad(field, query, fetchFn) {
/* /*
Given a query on a field, ensure that we only have a single outstanding Given a query on a field, ensure that we only have a single outstanding
@@ -539,7 +563,7 @@ Return cache keys for columns associated with this query. May return
return this._pendingLoad[field][key]; return this._pendingLoad[field][key];
} }
// eslint-disable-next-line class-methods-use-this -- make sure subclass implements // eslint-disable-next-line class-methods-use-this, @typescript-eslint/explicit-module-boundary-types -- make sure subclass implements
async _doLoad() { async _doLoad() {
_subclassResponsibility(); _subclassResponsibility();
} }
@@ -574,6 +598,7 @@ Return cache keys for columns associated with this query. May return
as much of the cache is pinned by that data structure. as much of the cache is pinned by that data structure.
*/ */
// @ts-expect-error ts-migrate(7006) FIXME: Parameter 'field' implicitly has an 'any' type. // @ts-expect-error ts-migrate(7006) FIXME: Parameter 'field' implicitly has an 'any' type.
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
_gcField(field, isHot, pinnedColumns) { _gcField(field, isHot, pinnedColumns) {
const maxColumns = isHot ? 256 : 10; const maxColumns = isHot ? 256 : 10;
const cache = this._cache[field]; const cache = this._cache[field];
@@ -616,6 +641,7 @@ Return cache keys for columns associated with this query. May return
} }
// @ts-expect-error ts-migrate(7006) FIXME: Parameter 'field' implicitly has an 'any' type. // @ts-expect-error ts-migrate(7006) FIXME: Parameter 'field' implicitly has an 'any' type.
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
_gcFetchCleanup(field, pinnedColumns) { _gcFetchCleanup(field, pinnedColumns) {
/* /*
Called during data load/fetch. By definition, this is 'hot', so we Called during data load/fetch. By definition, this is 'hot', so we
@@ -631,6 +657,7 @@ Return cache keys for columns associated with this query. May return
} }
// @ts-expect-error ts-migrate(7006) FIXME: Parameter 'hints' implicitly has an 'any' type. // @ts-expect-error ts-migrate(7006) FIXME: Parameter 'hints' implicitly has an 'any' type.
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
_gc(hints) { _gc(hints) {
/* /*
Called from middleware, or elsewhere. isHot is true if we are in the active store, Called from middleware, or elsewhere. isHot is true if we are in the active store,
@@ -644,6 +671,7 @@ Return cache keys for columns associated with this query. May return
} }
// @ts-expect-error ts-migrate(7006) FIXME: Parameter 'field' implicitly has an 'any' type. // @ts-expect-error ts-migrate(7006) FIXME: Parameter 'field' implicitly has an 'any' type.
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
_gcUpdateStats(field, dataframe) { _gcUpdateStats(field, dataframe) {
/* /*
called each time a query is performed, allowing the gc to update any bookkeeping called each time a query is performed, allowing the gc to update any bookkeeping
@@ -672,6 +700,7 @@ Return cache keys for columns associated with this query. May return
Do not override _clone(); Do not override _clone();
**/ **/
// @ts-expect-error ts-migrate(7006) FIXME: Parameter 'clone' implicitly has an 'any' type. // @ts-expect-error ts-migrate(7006) FIXME: Parameter 'clone' implicitly has an 'any' type.
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
_cloneDeeper(clone) { _cloneDeeper(clone) {
clone._cache = _shallowClone(this._cache); clone._cache = _shallowClone(this._cache);
clone._gcInfo = new Map(); clone._gcInfo = new Map();
@@ -684,6 +713,7 @@ Return cache keys for columns associated with this query. May return
return clone; return clone;
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
_clone() { _clone() {
const clone = _shallowClone(this); const clone = _shallowClone(this);
this._cloneDeeper(clone); this._cloneDeeper(clone);
+1
View File
@@ -1,6 +1,7 @@
/* /*
Shallow clone an object, correctly handling prototype Shallow clone an object, correctly handling prototype
*/ */
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
export default function _shallowClone(orig: any) { export default function _shallowClone(orig: any) {
return Object.assign(Object.create(Object.getPrototypeOf(orig)), orig); return Object.assign(Object.create(Object.getPrototypeOf(orig)), orig);
} }
+52 -1
View File
@@ -24,16 +24,22 @@ function _dimensionName(field, colNames) {
export default class AnnoMatrixObsCrossfilter { export default class AnnoMatrixObsCrossfilter {
// @ts-expect-error ts-migrate(7006) FIXME: Parameter 'annoMatrix' implicitly has an 'any' typ... Remove this comment to see the full error message // @ts-expect-error ts-migrate(7006) FIXME: Parameter 'annoMatrix' implicitly has an 'any' typ... Remove this comment to see the full error message
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
constructor(annoMatrix, _obsCrossfilter = null) { constructor(annoMatrix, _obsCrossfilter = null) {
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
(this as any).annoMatrix = annoMatrix; (this as any).annoMatrix = annoMatrix;
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
(this as any).obsCrossfilter = (this as any).obsCrossfilter =
_obsCrossfilter || new Crossfilter(annoMatrix._cache.obs); _obsCrossfilter || new Crossfilter(annoMatrix._cache.obs);
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
(this as any).obsCrossfilter = (this as any).obsCrossfilter.setData( (this as any).obsCrossfilter = (this as any).obsCrossfilter.setData(
annoMatrix._cache.obs annoMatrix._cache.obs
); );
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
size() { size() {
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
return (this as any).obsCrossfilter.size(); return (this as any).obsCrossfilter.size();
} }
@@ -45,12 +51,15 @@ export default class AnnoMatrixObsCrossfilter {
See API documentation in annoMatrix.js. See API documentation in annoMatrix.js.
**/ **/
// @ts-expect-error ts-migrate(7006) FIXME: Parameter 'colSchema' implicitly has an 'any' type... Remove this comment to see the full error message // @ts-expect-error ts-migrate(7006) FIXME: Parameter 'colSchema' implicitly has an 'any' type... Remove this comment to see the full error message
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
addObsColumn(colSchema, Ctor, value) { addObsColumn(colSchema, Ctor, value) {
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
const annoMatrix = (this as any).annoMatrix.addObsColumn( const annoMatrix = (this as any).annoMatrix.addObsColumn(
colSchema, colSchema,
Ctor, Ctor,
value value
); );
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
const obsCrossfilter = (this as any).obsCrossfilter.setData( const obsCrossfilter = (this as any).obsCrossfilter.setData(
annoMatrix._cache.obs annoMatrix._cache.obs
); );
@@ -58,7 +67,9 @@ export default class AnnoMatrixObsCrossfilter {
} }
// @ts-expect-error ts-migrate(7006) FIXME: Parameter 'col' implicitly has an 'any' type. // @ts-expect-error ts-migrate(7006) FIXME: Parameter 'col' implicitly has an 'any' type.
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
dropObsColumn(col) { dropObsColumn(col) {
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
const annoMatrix = (this as any).annoMatrix.dropObsColumn(col); const annoMatrix = (this as any).annoMatrix.dropObsColumn(col);
// @ts-expect-error ts-migrate(2339) FIXME: Property 'obsCrossfilter' does not exist on type '... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'obsCrossfilter' does not exist on type '... Remove this comment to see the full error message
let { obsCrossfilter } = this; let { obsCrossfilter } = this;
@@ -70,7 +81,9 @@ export default class AnnoMatrixObsCrossfilter {
} }
// @ts-expect-error ts-migrate(7006) FIXME: Parameter 'oldCol' implicitly has an 'any' type. // @ts-expect-error ts-migrate(7006) FIXME: Parameter 'oldCol' implicitly has an 'any' type.
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
renameObsColumn(oldCol, newCol) { renameObsColumn(oldCol, newCol) {
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
const annoMatrix = (this as any).annoMatrix.renameObsColumn(oldCol, newCol); const annoMatrix = (this as any).annoMatrix.renameObsColumn(oldCol, newCol);
const oldDimName = _dimensionName("obs", oldCol); const oldDimName = _dimensionName("obs", oldCol);
const newDimName = _dimensionName("obs", newCol); const newDimName = _dimensionName("obs", newCol);
@@ -83,7 +96,9 @@ export default class AnnoMatrixObsCrossfilter {
} }
// @ts-expect-error ts-migrate(7006) FIXME: Parameter 'col' implicitly has an 'any' type. // @ts-expect-error ts-migrate(7006) FIXME: Parameter 'col' implicitly has an 'any' type.
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
addObsAnnoCategory(col, category) { addObsAnnoCategory(col, category) {
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
const annoMatrix = (this as any).annoMatrix.addObsAnnoCategory( const annoMatrix = (this as any).annoMatrix.addObsAnnoCategory(
col, col,
category category
@@ -98,7 +113,9 @@ export default class AnnoMatrixObsCrossfilter {
} }
// @ts-expect-error ts-migrate(7006) FIXME: Parameter 'col' implicitly has an 'any' type. // @ts-expect-error ts-migrate(7006) FIXME: Parameter 'col' implicitly has an 'any' type.
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
async removeObsAnnoCategory(col, category, unassignedCategory) { async removeObsAnnoCategory(col, category, unassignedCategory) {
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
const annoMatrix = await (this as any).annoMatrix.removeObsAnnoCategory( const annoMatrix = await (this as any).annoMatrix.removeObsAnnoCategory(
col, col,
category, category,
@@ -114,7 +131,9 @@ export default class AnnoMatrixObsCrossfilter {
} }
// @ts-expect-error ts-migrate(7006) FIXME: Parameter 'col' implicitly has an 'any' type. // @ts-expect-error ts-migrate(7006) FIXME: Parameter 'col' implicitly has an 'any' type.
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
async setObsColumnValues(col, rowLabels, value) { async setObsColumnValues(col, rowLabels, value) {
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
const annoMatrix = await (this as any).annoMatrix.setObsColumnValues( const annoMatrix = await (this as any).annoMatrix.setObsColumnValues(
col, col,
rowLabels, rowLabels,
@@ -130,7 +149,9 @@ export default class AnnoMatrixObsCrossfilter {
} }
// @ts-expect-error ts-migrate(7006) FIXME: Parameter 'col' implicitly has an 'any' type. // @ts-expect-error ts-migrate(7006) FIXME: Parameter 'col' implicitly has an 'any' type.
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
async resetObsColumnValues(col, oldValue, newValue) { async resetObsColumnValues(col, oldValue, newValue) {
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
const annoMatrix = await (this as any).annoMatrix.resetObsColumnValues( const annoMatrix = await (this as any).annoMatrix.resetObsColumnValues(
col, col,
oldValue, oldValue,
@@ -146,10 +167,13 @@ export default class AnnoMatrixObsCrossfilter {
} }
// @ts-expect-error ts-migrate(7006) FIXME: Parameter 'colSchema' implicitly has an 'any' type... Remove this comment to see the full error message // @ts-expect-error ts-migrate(7006) FIXME: Parameter 'colSchema' implicitly has an 'any' type... Remove this comment to see the full error message
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
addEmbedding(colSchema) { addEmbedding(colSchema) {
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
const annoMatrix = (this as any).annoMatrix.addEmbedding(colSchema); const annoMatrix = (this as any).annoMatrix.addEmbedding(colSchema);
return new AnnoMatrixObsCrossfilter( return new AnnoMatrixObsCrossfilter(
annoMatrix, annoMatrix,
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
(this as any).obsCrossfilter (this as any).obsCrossfilter
); );
} }
@@ -160,6 +184,7 @@ export default class AnnoMatrixObsCrossfilter {
* annomatrix cache. * annomatrix cache.
*/ */
// @ts-expect-error ts-migrate(7006) FIXME: Parameter 'field' implicitly has an 'any' type. // @ts-expect-error ts-migrate(7006) FIXME: Parameter 'field' implicitly has an 'any' type.
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
dropDimension(field, query) { dropDimension(field, query) {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'annoMatrix' does not exist on type 'Anno... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'annoMatrix' does not exist on type 'Anno... Remove this comment to see the full error message
const { annoMatrix } = this; const { annoMatrix } = this;
@@ -182,6 +207,7 @@ export default class AnnoMatrixObsCrossfilter {
**/ **/
// @ts-expect-error ts-migrate(7006) FIXME: Parameter 'field' implicitly has an 'any' type. // @ts-expect-error ts-migrate(7006) FIXME: Parameter 'field' implicitly has an 'any' type.
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
async select(field, query, spec) { async select(field, query, spec) {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'annoMatrix' does not exist on type 'Anno... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'annoMatrix' does not exist on type 'Anno... Remove this comment to see the full error message
const { annoMatrix } = this; const { annoMatrix } = this;
@@ -214,62 +240,83 @@ export default class AnnoMatrixObsCrossfilter {
return new AnnoMatrixObsCrossfilter(annoMatrix, obsCrossfilter); return new AnnoMatrixObsCrossfilter(annoMatrix, obsCrossfilter);
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
selectAll() { selectAll() {
/* /*
Select all on any dimension in this field. Select all on any dimension in this field.
*/ */
// @ts-expect-error ts-migrate(2339) FIXME: Property 'annoMatrix' does not exist on type 'Anno... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'annoMatrix' does not exist on type 'Anno... Remove this comment to see the full error message
const { annoMatrix } = this; const { annoMatrix } = this;
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
const currentDims = (this as any).obsCrossfilter.dimensionNames(); const currentDims = (this as any).obsCrossfilter.dimensionNames();
// @ts-expect-error ts-migrate(7006) FIXME: Parameter 'xfltr' implicitly has an 'any' type. // @ts-expect-error ts-migrate(7006) FIXME: Parameter 'xfltr' implicitly has an 'any' type.
const obsCrossfilter = currentDims.reduce((xfltr, dim) => { const obsCrossfilter = currentDims.reduce((xfltr, dim) => {
return xfltr.select(dim, { mode: "all" }); return xfltr.select(dim, { mode: "all" });
}, (this as any).obsCrossfilter); }, (this as any).obsCrossfilter); // eslint-disable-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
return new AnnoMatrixObsCrossfilter(annoMatrix, obsCrossfilter); return new AnnoMatrixObsCrossfilter(annoMatrix, obsCrossfilter);
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
countSelected() { countSelected() {
/* if no data yet indexed in the crossfilter, just say everything is selected */ /* if no data yet indexed in the crossfilter, just say everything is selected */
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
if ((this as any).obsCrossfilter.size() === 0) if ((this as any).obsCrossfilter.size() === 0)
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
return (this as any).annoMatrix.nObs; return (this as any).annoMatrix.nObs;
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
return (this as any).obsCrossfilter.countSelected(); return (this as any).obsCrossfilter.countSelected();
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
allSelectedMask() { allSelectedMask() {
/* if no data yet indexed in the crossfilter, just say everything is selected */ /* if no data yet indexed in the crossfilter, just say everything is selected */
if ( if (
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
(this as any).obsCrossfilter.size() === 0 || (this as any).obsCrossfilter.size() === 0 ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
(this as any).obsCrossfilter.dimensionNames().length === 0 (this as any).obsCrossfilter.dimensionNames().length === 0
) { ) {
/* fake the mask */ /* fake the mask */
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
return new Uint8Array((this as any).annoMatrix.nObs).fill(1); return new Uint8Array((this as any).annoMatrix.nObs).fill(1);
} }
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
return (this as any).obsCrossfilter.allSelectedMask(); return (this as any).obsCrossfilter.allSelectedMask();
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
allSelectedLabels() { allSelectedLabels() {
/* if no data yet indexed in the crossfilter, just say everything is selected */ /* if no data yet indexed in the crossfilter, just say everything is selected */
if ( if (
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
(this as any).obsCrossfilter.size() === 0 || (this as any).obsCrossfilter.size() === 0 ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
(this as any).obsCrossfilter.dimensionNames().length === 0 (this as any).obsCrossfilter.dimensionNames().length === 0
) { ) {
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
return (this as any).annoMatrix.rowIndex.labels(); return (this as any).annoMatrix.rowIndex.labels();
} }
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
const mask = (this as any).obsCrossfilter.allSelectedMask(); const mask = (this as any).obsCrossfilter.allSelectedMask();
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
const index = (this as any).annoMatrix.rowIndex.isubsetMask(mask); const index = (this as any).annoMatrix.rowIndex.isubsetMask(mask);
return index.labels(); return index.labels();
} }
// @ts-expect-error ts-migrate(7006) FIXME: Parameter 'array' implicitly has an 'any' type. // @ts-expect-error ts-migrate(7006) FIXME: Parameter 'array' implicitly has an 'any' type.
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
fillByIsSelected(array, selectedValue, deselectedValue) { fillByIsSelected(array, selectedValue, deselectedValue) {
/* if no data yet indexed in the crossfilter, just say everything is selected */ /* if no data yet indexed in the crossfilter, just say everything is selected */
if ( if (
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
(this as any).obsCrossfilter.size() === 0 || (this as any).obsCrossfilter.size() === 0 ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
(this as any).obsCrossfilter.dimensionNames().length === 0 (this as any).obsCrossfilter.dimensionNames().length === 0
) { ) {
return array.fill(selectedValue); return array.fill(selectedValue);
} }
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
return (this as any).obsCrossfilter.fillByIsSelected( return (this as any).obsCrossfilter.fillByIsSelected(
array, array,
selectedValue, selectedValue,
@@ -282,6 +329,7 @@ export default class AnnoMatrixObsCrossfilter {
**/ **/
// @ts-expect-error ts-migrate(7006) FIXME: Parameter 'annoMatrix' implicitly has an 'any' typ... Remove this comment to see the full error message // @ts-expect-error ts-migrate(7006) FIXME: Parameter 'annoMatrix' implicitly has an 'any' typ... Remove this comment to see the full error message
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
_addObsCrossfilterDimension(annoMatrix, obsCrossfilter, field, df) { _addObsCrossfilterDimension(annoMatrix, obsCrossfilter, field, df) {
if (field === "var") return obsCrossfilter; if (field === "var") return obsCrossfilter;
const dimName = _dimensionNameFromDf(field, df); const dimName = _dimensionNameFromDf(field, df);
@@ -293,9 +341,11 @@ export default class AnnoMatrixObsCrossfilter {
} }
// @ts-expect-error ts-migrate(7006) FIXME: Parameter 'field' implicitly has an 'any' type. // @ts-expect-error ts-migrate(7006) FIXME: Parameter 'field' implicitly has an 'any' type.
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
_getColumnBaseType(field, col) { _getColumnBaseType(field, col) {
/* Look up the primitive type for this field/col */ /* Look up the primitive type for this field/col */
const colSchema = _getColumnSchema( const colSchema = _getColumnSchema(
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
(this as any).annoMatrix.schema, (this as any).annoMatrix.schema,
field, field,
col col
@@ -304,6 +354,7 @@ export default class AnnoMatrixObsCrossfilter {
} }
// @ts-expect-error ts-migrate(7006) FIXME: Parameter 'field' implicitly has an 'any' type. // @ts-expect-error ts-migrate(7006) FIXME: Parameter 'field' implicitly has an 'any' type.
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
_getObsDimensionParams(field, df) { _getObsDimensionParams(field, df) {
/* return the crossfilter dimensiontype type and params for this field/dataframe */ /* return the crossfilter dimensiontype type and params for this field/dataframe */
+4
View File
@@ -1,18 +1,22 @@
export { doBinaryRequest, doFetch } from "../util/actionHelpers"; export { doBinaryRequest, doFetch } from "../util/actionHelpers";
/* double URI encode - needed for query-param filters */ /* double URI encode - needed for query-param filters */
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
export function _dubEncURIComp(s: any) { export function _dubEncURIComp(s: any) {
return encodeURIComponent(encodeURIComponent(s)); return encodeURIComponent(encodeURIComponent(s));
} }
/* currently unused, consider deleting */ /* currently unused, consider deleting */
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
export function _fetchResult(promise: any) { export function _fetchResult(promise: any) {
let _status = "pending"; let _status = "pending";
const res = promise.then( const res = promise.then(
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
(r: any) => { (r: any) => {
_status = "success"; _status = "success";
return r; return r;
}, },
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
(e: any) => { (e: any) => {
_status = "error"; _status = "error";
throw e; throw e;
+26 -1
View File
@@ -23,6 +23,7 @@ import {
const promiseThrottle = new PromiseLimit(5); const promiseThrottle = new PromiseLimit(5);
export default class AnnoMatrixLoader extends AnnoMatrix { export default class AnnoMatrixLoader extends AnnoMatrix {
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
baseURL: any; baseURL: any;
/* /*
@@ -35,6 +36,7 @@ export default class AnnoMatrixLoader extends AnnoMatrix {
new AnnoMatrixLoader(serverBaseURL, schema) -> instance new AnnoMatrixLoader(serverBaseURL, schema) -> instance
*/ */
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
constructor(baseURL: any, schema: any) { constructor(baseURL: any, schema: any) {
const { nObs, nVar } = schema.dataframe; const { nObs, nVar } = schema.dataframe;
super(schema, nObs, nVar); super(schema, nObs, nVar);
@@ -50,6 +52,7 @@ export default class AnnoMatrixLoader extends AnnoMatrix {
/** /**
** Public. API described in base class. ** Public. API described in base class.
**/ **/
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
addObsAnnoCategory(col: any, category: any) { addObsAnnoCategory(col: any, category: any) {
/* /*
Add a new category (aka label) to the schema for an obs column. Add a new category (aka label) to the schema for an obs column.
@@ -62,9 +65,13 @@ export default class AnnoMatrixLoader extends AnnoMatrix {
return newAnnoMatrix; return newAnnoMatrix;
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
async removeObsAnnoCategory( async removeObsAnnoCategory(
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
col: any, col: any,
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
category: any, category: any,
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
unassignedCategory: any unassignedCategory: any
) { ) {
/* /*
@@ -86,6 +93,7 @@ export default class AnnoMatrixLoader extends AnnoMatrix {
return newAnnoMatrix; return newAnnoMatrix;
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
dropObsColumn(col: any) { dropObsColumn(col: any) {
/* /*
drop column from field drop column from field
@@ -94,12 +102,14 @@ export default class AnnoMatrixLoader extends AnnoMatrix {
_writableCheck(colSchema); // throws on error _writableCheck(colSchema); // throws on error
const newAnnoMatrix = this._clone(); const newAnnoMatrix = this._clone();
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
newAnnoMatrix._cache.obs = (this as any)._cache.obs.dropCol(col); newAnnoMatrix._cache.obs = (this as any)._cache.obs.dropCol(col);
newAnnoMatrix.schema = removeObsAnnoColumn(this.schema, col); newAnnoMatrix.schema = removeObsAnnoColumn(this.schema, col);
return newAnnoMatrix; return newAnnoMatrix;
} }
// @ts-expect-error ts-migrate(7006) FIXME: Parameter 'colSchema' implicitly has an 'any' type... Remove this comment to see the full error message // @ts-expect-error ts-migrate(7006) FIXME: Parameter 'colSchema' implicitly has an 'any' type... Remove this comment to see the full error message
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
addObsColumn(colSchema, Ctor, value) { addObsColumn(colSchema, Ctor, value) {
/* /*
add a column to field, initializing with value. Value may add a column to field, initializing with value. Value may
@@ -112,6 +122,7 @@ export default class AnnoMatrixLoader extends AnnoMatrix {
const colName = colSchema.name; const colName = colSchema.name;
if ( if (
_getColumnSchema(this.schema, "obs", colName) || _getColumnSchema(this.schema, "obs", colName) ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
(this as any)._cache.obs.hasCol(colName) (this as any)._cache.obs.hasCol(colName)
) { ) {
throw new Error("column already exists"); throw new Error("column already exists");
@@ -128,6 +139,7 @@ export default class AnnoMatrixLoader extends AnnoMatrix {
} else { } else {
data = new Ctor(this.nObs).fill(value); data = new Ctor(this.nObs).fill(value);
} }
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
newAnnoMatrix._cache.obs = (this as any)._cache.obs.withCol(colName, data); newAnnoMatrix._cache.obs = (this as any)._cache.obs.withCol(colName, data);
_normalizeCategoricalSchema( _normalizeCategoricalSchema(
colSchema, colSchema,
@@ -138,14 +150,17 @@ export default class AnnoMatrixLoader extends AnnoMatrix {
} }
// @ts-expect-error ts-migrate(7006) FIXME: Parameter 'oldCol' implicitly has an 'any' type. // @ts-expect-error ts-migrate(7006) FIXME: Parameter 'oldCol' implicitly has an 'any' type.
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
renameObsColumn(oldCol, newCol) { renameObsColumn(oldCol, newCol) {
/* /*
Rename the obs oldColName to newColName. oldCol must be writable. Rename the obs oldColName to newColName. oldCol must be writable.
*/ */
const oldColSchema = _getColumnSchema(this.schema, "obs", oldCol); const oldColSchema = _getColumnSchema(this.schema, "obs", oldCol);
_writableCheck(oldColSchema); _writableCheck(oldColSchema);
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
const value = (this as any)._cache.obs.hasCol(oldCol) const value = (this as any)._cache.obs.hasCol(oldCol)
? (this as any)._cache.obs.col(oldCol).asArray() ? // eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
(this as any)._cache.obs.col(oldCol).asArray()
: undefined; : undefined;
return this.dropObsColumn(oldCol).addObsColumn( return this.dropObsColumn(oldCol).addObsColumn(
{ {
@@ -158,6 +173,7 @@ export default class AnnoMatrixLoader extends AnnoMatrix {
} }
// @ts-expect-error ts-migrate(7006) FIXME: Parameter 'col' implicitly has an 'any' type. // @ts-expect-error ts-migrate(7006) FIXME: Parameter 'col' implicitly has an 'any' type.
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
async setObsColumnValues(col, rowLabels, value) { async setObsColumnValues(col, rowLabels, value) {
/* /*
Set all rows identified by rowLabels to value. Set all rows identified by rowLabels to value.
@@ -167,10 +183,12 @@ export default class AnnoMatrixLoader extends AnnoMatrix {
// ensure that we have the data in cache before we manipulate it // ensure that we have the data in cache before we manipulate it
await this.fetch("obs", col); await this.fetch("obs", col);
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
if (!(this as any)._cache.obs.hasCol(col)) if (!(this as any)._cache.obs.hasCol(col))
throw new Error("Internal error - user annotation data missing"); throw new Error("Internal error - user annotation data missing");
const rowIndices = this.rowIndex.getOffsets(rowLabels); const rowIndices = this.rowIndex.getOffsets(rowLabels);
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
const data = (this as any)._cache.obs.col(col).asArray().slice(); const data = (this as any)._cache.obs.col(col).asArray().slice();
for (let i = 0, len = rowIndices.length; i < len; i += 1) { for (let i = 0, len = rowIndices.length; i < len; i += 1) {
const idx = rowIndices[i]; const idx = rowIndices[i];
@@ -179,6 +197,7 @@ export default class AnnoMatrixLoader extends AnnoMatrix {
} }
const newAnnoMatrix = this._clone(); const newAnnoMatrix = this._clone();
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
newAnnoMatrix._cache.obs = (this as any)._cache.obs.replaceColData( newAnnoMatrix._cache.obs = (this as any)._cache.obs.replaceColData(
col, col,
data data
@@ -191,6 +210,7 @@ export default class AnnoMatrixLoader extends AnnoMatrix {
} }
// @ts-expect-error ts-migrate(7006) FIXME: Parameter 'col' implicitly has an 'any' type. // @ts-expect-error ts-migrate(7006) FIXME: Parameter 'col' implicitly has an 'any' type.
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
async resetObsColumnValues(col, oldValue, newValue) { async resetObsColumnValues(col, oldValue, newValue) {
/* /*
Set all rows with value 'oldValue' to 'newValue'. Set all rows with value 'oldValue' to 'newValue'.
@@ -204,15 +224,18 @@ export default class AnnoMatrixLoader extends AnnoMatrix {
// ensure that we have the data in cache before we manipulate it // ensure that we have the data in cache before we manipulate it
await this.fetch("obs", col); await this.fetch("obs", col);
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
if (!(this as any)._cache.obs.hasCol(col)) if (!(this as any)._cache.obs.hasCol(col))
throw new Error("Internal error - user annotation data missing"); throw new Error("Internal error - user annotation data missing");
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
const data = (this as any)._cache.obs.col(col).asArray().slice(); const data = (this as any)._cache.obs.col(col).asArray().slice();
for (let i = 0, l = data.length; i < l; i += 1) { for (let i = 0, l = data.length; i < l; i += 1) {
if (data[i] === oldValue) data[i] = newValue; if (data[i] === oldValue) data[i] = newValue;
} }
const newAnnoMatrix = this._clone(); const newAnnoMatrix = this._clone();
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
newAnnoMatrix._cache.obs = (this as any)._cache.obs.replaceColData( newAnnoMatrix._cache.obs = (this as any)._cache.obs.replaceColData(
col, col,
data data
@@ -225,6 +248,7 @@ export default class AnnoMatrixLoader extends AnnoMatrix {
} }
// @ts-expect-error ts-migrate(7006) FIXME: Parameter 'colSchema' implicitly has an 'any' type... Remove this comment to see the full error message // @ts-expect-error ts-migrate(7006) FIXME: Parameter 'colSchema' implicitly has an 'any' type... Remove this comment to see the full error message
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
addEmbedding(colSchema) { addEmbedding(colSchema) {
/* /*
add new layout to the obs embeddings add new layout to the obs embeddings
@@ -243,6 +267,7 @@ export default class AnnoMatrixLoader extends AnnoMatrix {
** Private below ** Private below
**/ **/
// @ts-expect-error ts-migrate(2416) FIXME: Property '_doLoad' in type 'AnnoMatrixLoader' is n... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2416) FIXME: Property '_doLoad' in type 'AnnoMatrixLoader' is n... Remove this comment to see the full error message
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
async _doLoad(field, query) { async _doLoad(field, query) {
/* /*
_doLoad - evaluates the query against the field. Returns: _doLoad - evaluates the query against the field. Returns:
+6
View File
@@ -11,6 +11,7 @@ Undoable metareducer and the AnnoMatrix private API. It would be helpful
to make the Undoable interface better factored. to make the Undoable interface better factored.
*/ */
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
const annoMatrixGC = (store: any) => (next: any) => (action: any) => { const annoMatrixGC = (store: any) => (next: any) => (action: any) => {
if (_itIsTimeForGC()) { if (_itIsTimeForGC()) {
_doGC(store); _doGC(store);
@@ -34,6 +35,7 @@ function _itIsTimeForGC() {
return false; return false;
} }
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
function _doGC(store: any) { function _doGC(store: any) {
const state = store.getState(); const state = store.getState();
@@ -43,7 +45,9 @@ function _doGC(store: any) {
const undoableFuture = state["@@undoable/future"]; const undoableFuture = state["@@undoable/future"];
const undoableStack = undoablePast const undoableStack = undoablePast
.concat(undoableFuture) .concat(undoableFuture)
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
.flatMap((snapshot: any) => .flatMap((snapshot: any) =>
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
snapshot.filter((v: any) => v[0] === "annoMatrix").map((v: any) => v[1]) snapshot.filter((v: any) => v[0] === "annoMatrix").map((v: any) => v[1])
); );
const currentAnnoMatrix = state.annoMatrix; const currentAnnoMatrix = state.annoMatrix;
@@ -53,6 +57,7 @@ function _doGC(store: any) {
as our current gc algo is more aggressive with those not hot. as our current gc algo is more aggressive with those not hot.
*/ */
const allAnnoMatrices = new Map( const allAnnoMatrices = new Map(
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
undoableStack.map((m: any) => [m, { isHot: false }]) undoableStack.map((m: any) => [m, { isHot: false }])
); );
let am = currentAnnoMatrix; let am = currentAnnoMatrix;
@@ -61,6 +66,7 @@ function _doGC(store: any) {
am = am.viewOf; am = am.viewOf;
} }
allAnnoMatrices.forEach((hints, annoMatrix) => allAnnoMatrices.forEach((hints, annoMatrix) =>
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
(annoMatrix as any)._gc(hints) (annoMatrix as any)._gc(hints)
); );
} }
+10 -1
View File
@@ -10,6 +10,7 @@ import { _dubEncURIComp } from "./fetchHelpers";
* @param {object | string} query - the query * @param {object | string} query - the query
* @returns {object | string} - the normalized query * @returns {object | string} - the normalized query
*/ */
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
export function _queryValidate(query: any) { export function _queryValidate(query: any) {
if (typeof query !== "object") return query; if (typeof query !== "object") return query;
@@ -40,10 +41,12 @@ export function _queryValidate(query: any) {
throw new Error("query must specify one of where or summarize"); throw new Error("query must specify one of where or summarize");
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
export function _expectSimpleQuery(query: any) { export function _expectSimpleQuery(query: any) {
if (typeof query === "object") throw new Error("expected simple query"); if (typeof query === "object") throw new Error("expected simple query");
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
export function _expectComplexQuery(query: any) { export function _expectComplexQuery(query: any) {
if (typeof query !== "object") throw new Error("expected complex query"); if (typeof query !== "object") throw new Error("expected complex query");
} }
@@ -55,6 +58,7 @@ export function _expectComplexQuery(query: any) {
* @param {string|object} query * @param {string|object} query
* @returns the key * @returns the key
*/ */
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
export function _queryCacheKey(field: any, query: any) { export function _queryCacheKey(field: any, query: any) {
if (typeof query === "object") { if (typeof query === "object") {
// complex query // complex query
@@ -84,6 +88,7 @@ export function _queryCacheKey(field: any, query: any) {
return `${field}/${query}`; return `${field}/${query}`;
} }
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
function _urlEncodeWhereQuery(q: any) { function _urlEncodeWhereQuery(q: any) {
const { field: queryField, column: queryColumn, value: queryValue } = q; const { field: queryField, column: queryColumn, value: queryValue } = q;
return `${_dubEncURIComp(queryField)}:${_dubEncURIComp( return `${_dubEncURIComp(queryField)}:${_dubEncURIComp(
@@ -91,14 +96,16 @@ function _urlEncodeWhereQuery(q: any) {
)}=${_dubEncURIComp(queryValue)}`; )}=${_dubEncURIComp(queryValue)}`;
} }
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
function _urlEncodeSummarizeQuery(q: any) { function _urlEncodeSummarizeQuery(q: any) {
const { method, field, column, values } = q; const { method, field, column, values } = q;
const filter = values const filter = values // eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
.map((value: any) => _urlEncodeWhereQuery({ field, column, value })) .map((value: any) => _urlEncodeWhereQuery({ field, column, value }))
.join("&"); .join("&");
return `method=${method}&${filter}`; return `method=${method}&${filter}`;
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
export function _urlEncodeComplexQuery(q: any) { export function _urlEncodeComplexQuery(q: any) {
if (typeof q === "object") { if (typeof q === "object") {
if (q.where) { if (q.where) {
@@ -111,6 +118,7 @@ export function _urlEncodeComplexQuery(q: any) {
throw new Error("Unrecognized complex query type"); throw new Error("Unrecognized complex query type");
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
export function _urlEncodeLabelQuery(colKey: any, q: any) { export function _urlEncodeLabelQuery(colKey: any, q: any) {
if (!colKey) throw new Error("Unsupported query by name"); if (!colKey) throw new Error("Unsupported query by name");
if (typeof q !== "string") throw new Error("Query must be a simple label."); if (typeof q !== "string") throw new Error("Query must be a simple label.");
@@ -120,6 +128,7 @@ export function _urlEncodeLabelQuery(colKey: any, q: any) {
/** /**
* Generate the column key the server will send us for this query. * Generate the column key the server will send us for this query.
*/ */
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
export function _hashStringValues(arrayOfString: any) { export function _hashStringValues(arrayOfString: any) {
const hash = sha1(arrayOfString.join("")); const hash = sha1(arrayOfString.join(""));
return hash; return hash;
+6
View File
@@ -4,6 +4,7 @@ Private helper functions related to schema
import catLabelSort from "../util/catLabelSort"; import catLabelSort from "../util/catLabelSort";
import { unassignedCategoryLabel } from "../globals"; import { unassignedCategoryLabel } from "../globals";
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
export function _getColumnSchema(schema: any, field: any, col: any) { export function _getColumnSchema(schema: any, field: any, col: any) {
/* look up the column definition */ /* look up the column definition */
switch (field) { switch (field) {
@@ -26,6 +27,7 @@ export function _getColumnSchema(schema: any, field: any, col: any) {
} }
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
export function _getColumnDimensionNames(schema: any, field: any, col: any) { export function _getColumnDimensionNames(schema: any, field: any, col: any) {
/* /*
field/col may be an alias for multiple columns. Currently used to map ND field/col may be an alias for multiple columns. Currently used to map ND
@@ -40,6 +42,7 @@ export function _getColumnDimensionNames(schema: any, field: any, col: any) {
} }
// @ts-expect-error ts-migrate(7006) FIXME: Parameter 'schema' implicitly has an 'any' type. // @ts-expect-error ts-migrate(7006) FIXME: Parameter 'schema' implicitly has an 'any' type.
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
export function _schemaColumns(schema, field) { export function _schemaColumns(schema, field) {
switch (field) { switch (field) {
case "obs": case "obs":
@@ -54,6 +57,7 @@ export function _schemaColumns(schema, field) {
} }
// @ts-expect-error ts-migrate(7006) FIXME: Parameter 'schema' implicitly has an 'any' type. // @ts-expect-error ts-migrate(7006) FIXME: Parameter 'schema' implicitly has an 'any' type.
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
export function _getWritableColumns(schema, field) { export function _getWritableColumns(schema, field) {
if (field !== "obs") return []; if (field !== "obs") return [];
return ( return (
@@ -66,12 +70,14 @@ export function _getWritableColumns(schema, field) {
} }
// @ts-expect-error ts-migrate(7006) FIXME: Parameter 'schema' implicitly has an 'any' type. // @ts-expect-error ts-migrate(7006) FIXME: Parameter 'schema' implicitly has an 'any' type.
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
export function _isContinuousType(schema) { export function _isContinuousType(schema) {
const { type } = schema; const { type } = schema;
return !(type === "string" || type === "boolean" || type === "categorical"); return !(type === "string" || type === "boolean" || type === "categorical");
} }
// @ts-expect-error ts-migrate(7006) FIXME: Parameter 'colSchema' implicitly has an 'any' type... Remove this comment to see the full error message // @ts-expect-error ts-migrate(7006) FIXME: Parameter 'colSchema' implicitly has an 'any' type... Remove this comment to see the full error message
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
export function _normalizeCategoricalSchema(colSchema, col) { export function _normalizeCategoricalSchema(colSchema, col) {
/* /*
Ensure all enum schema types have a categories array, that Ensure all enum schema types have a categories array, that
+5
View File
@@ -5,6 +5,7 @@ instances of AnnoMatrix, implementing common UI functions.
import { AnnoMatrixRowSubsetView, AnnoMatrixClipView } from "./views"; import { AnnoMatrixRowSubsetView, AnnoMatrixClipView } from "./views";
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
export function isubsetMask(annoMatrix: any, obsMask: any) { export function isubsetMask(annoMatrix: any, obsMask: any) {
/* /*
Subset annomatrix to contain the rows which have truish value in the mask. Subset annomatrix to contain the rows which have truish value in the mask.
@@ -14,6 +15,7 @@ export function isubsetMask(annoMatrix: any, obsMask: any) {
} }
// @ts-expect-error ts-migrate(7006) FIXME: Parameter 'annoMatrix' implicitly has an 'any' typ... Remove this comment to see the full error message // @ts-expect-error ts-migrate(7006) FIXME: Parameter 'annoMatrix' implicitly has an 'any' typ... Remove this comment to see the full error message
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
export function isubset(annoMatrix, obsOffsets) { export function isubset(annoMatrix, obsOffsets) {
/* /*
Subset annomatrix to contain the positions contained in the obsOffsets array Subset annomatrix to contain the positions contained in the obsOffsets array
@@ -27,6 +29,7 @@ export function isubset(annoMatrix, obsOffsets) {
} }
// @ts-expect-error ts-migrate(7006) FIXME: Parameter 'annoMatrix' implicitly has an 'any' typ... Remove this comment to see the full error message // @ts-expect-error ts-migrate(7006) FIXME: Parameter 'annoMatrix' implicitly has an 'any' typ... Remove this comment to see the full error message
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
export function subset(annoMatrix, obsLabels) { export function subset(annoMatrix, obsLabels) {
/* /*
subset based on labels subset based on labels
@@ -36,6 +39,7 @@ export function subset(annoMatrix, obsLabels) {
} }
// @ts-expect-error ts-migrate(7006) FIXME: Parameter 'annoMatrix' implicitly has an 'any' typ... Remove this comment to see the full error message // @ts-expect-error ts-migrate(7006) FIXME: Parameter 'annoMatrix' implicitly has an 'any' typ... Remove this comment to see the full error message
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
export function subsetByIndex(annoMatrix, obsIndex) { export function subsetByIndex(annoMatrix, obsIndex) {
/* /*
subset based upon the new obs index. subset based upon the new obs index.
@@ -44,6 +48,7 @@ export function subsetByIndex(annoMatrix, obsIndex) {
} }
// @ts-expect-error ts-migrate(7006) FIXME: Parameter 'annoMatrix' implicitly has an 'any' typ... Remove this comment to see the full error message // @ts-expect-error ts-migrate(7006) FIXME: Parameter 'annoMatrix' implicitly has an 'any' typ... Remove this comment to see the full error message
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
export function clip(annoMatrix, qmin, qmax) { export function clip(annoMatrix, qmin, qmax) {
/* /*
Create a view that clips all continuous data to the [min, max] range. Create a view that clips all continuous data to the [min, max] range.
+18
View File
@@ -9,6 +9,7 @@ import { _whereCacheCreate } from "./whereCache";
import { _isContinuousType, _getColumnSchema } from "./schema"; import { _isContinuousType, _getColumnSchema } from "./schema";
class AnnoMatrixView extends AnnoMatrix { class AnnoMatrixView extends AnnoMatrix {
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
constructor(viewOf: any, rowIndex = null) { constructor(viewOf: any, rowIndex = null) {
// @ts-expect-error ts-migrate(2531) FIXME: Object is possibly 'null'. // @ts-expect-error ts-migrate(2531) FIXME: Object is possibly 'null'.
const nObs = rowIndex ? rowIndex.size() : viewOf.nObs; const nObs = rowIndex ? rowIndex.size() : viewOf.nObs;
@@ -17,6 +18,7 @@ class AnnoMatrixView extends AnnoMatrix {
this.isView = true; this.isView = true;
} }
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
addObsAnnoCategory(col: any, category: any) { addObsAnnoCategory(col: any, category: any) {
const newAnnoMatrix = this._clone(); const newAnnoMatrix = this._clone();
newAnnoMatrix.viewOf = this.viewOf.addObsAnnoCategory(col, category); newAnnoMatrix.viewOf = this.viewOf.addObsAnnoCategory(col, category);
@@ -25,8 +27,11 @@ class AnnoMatrixView extends AnnoMatrix {
} }
async removeObsAnnoCategory( async removeObsAnnoCategory(
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
col: any, col: any,
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
category: any, category: any,
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
unassignedCategory: any unassignedCategory: any
) { ) {
const newAnnoMatrix = this._clone(); const newAnnoMatrix = this._clone();
@@ -39,6 +44,7 @@ class AnnoMatrixView extends AnnoMatrix {
return newAnnoMatrix; return newAnnoMatrix;
} }
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
dropObsColumn(col: any) { dropObsColumn(col: any) {
const newAnnoMatrix = this._clone(); const newAnnoMatrix = this._clone();
newAnnoMatrix.viewOf = this.viewOf.dropObsColumn(col); newAnnoMatrix.viewOf = this.viewOf.dropObsColumn(col);
@@ -47,6 +53,7 @@ class AnnoMatrixView extends AnnoMatrix {
return newAnnoMatrix; return newAnnoMatrix;
} }
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
addObsColumn(colSchema: any, Ctor: any, value: any) { addObsColumn(colSchema: any, Ctor: any, value: any) {
const newAnnoMatrix = this._clone(); const newAnnoMatrix = this._clone();
newAnnoMatrix.viewOf = this.viewOf.addObsColumn(colSchema, Ctor, value); newAnnoMatrix.viewOf = this.viewOf.addObsColumn(colSchema, Ctor, value);
@@ -54,6 +61,7 @@ class AnnoMatrixView extends AnnoMatrix {
return newAnnoMatrix; return newAnnoMatrix;
} }
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
renameObsColumn(oldCol: any, newCol: any) { renameObsColumn(oldCol: any, newCol: any) {
const newAnnoMatrix = this._clone(); const newAnnoMatrix = this._clone();
newAnnoMatrix.viewOf = this.viewOf.renameObsColumn(oldCol, newCol); newAnnoMatrix.viewOf = this.viewOf.renameObsColumn(oldCol, newCol);
@@ -61,6 +69,7 @@ class AnnoMatrixView extends AnnoMatrix {
return newAnnoMatrix; return newAnnoMatrix;
} }
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
async setObsColumnValues(col: any, rowLabels: any, value: any) { async setObsColumnValues(col: any, rowLabels: any, value: any) {
const newAnnoMatrix = this._clone(); const newAnnoMatrix = this._clone();
newAnnoMatrix.viewOf = await this.viewOf.setObsColumnValues( newAnnoMatrix.viewOf = await this.viewOf.setObsColumnValues(
@@ -73,6 +82,7 @@ class AnnoMatrixView extends AnnoMatrix {
return newAnnoMatrix; return newAnnoMatrix;
} }
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
async resetObsColumnValues(col: any, oldValue: any, newValue: any) { async resetObsColumnValues(col: any, oldValue: any, newValue: any) {
const newAnnoMatrix = this._clone(); const newAnnoMatrix = this._clone();
newAnnoMatrix.viewOf = await this.viewOf.resetObsColumnValues( newAnnoMatrix.viewOf = await this.viewOf.resetObsColumnValues(
@@ -85,6 +95,7 @@ class AnnoMatrixView extends AnnoMatrix {
return newAnnoMatrix; return newAnnoMatrix;
} }
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
addEmbedding(colSchema: any) { addEmbedding(colSchema: any) {
const newAnnoMatrix = this._clone(); const newAnnoMatrix = this._clone();
newAnnoMatrix.viewOf = this.viewOf.addEmbedding(colSchema); newAnnoMatrix.viewOf = this.viewOf.addEmbedding(colSchema);
@@ -100,6 +111,7 @@ class AnnoMatrixMapView extends AnnoMatrixView {
// @ts-expect-error ts-migrate(7006) FIXME: Parameter 'viewOf' implicitly has an 'any' type. // @ts-expect-error ts-migrate(7006) FIXME: Parameter 'viewOf' implicitly has an 'any' type.
constructor(viewOf, mapFn) { constructor(viewOf, mapFn) {
super(viewOf); super(viewOf);
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
(this as any).mapFn = mapFn; (this as any).mapFn = mapFn;
} }
@@ -110,6 +122,7 @@ class AnnoMatrixMapView extends AnnoMatrixView {
const dfMapped = df.mapColumns((colData, colIdx) => { const dfMapped = df.mapColumns((colData, colIdx) => {
const colLabel = df.colIndex.getLabel(colIdx); const colLabel = df.colIndex.getLabel(colIdx);
const colSchema = _getColumnSchema(this.schema, field, colLabel); const colSchema = _getColumnSchema(this.schema, field, colLabel);
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
return (this as any).mapFn(field, colLabel, colSchema, colData, df); return (this as any).mapFn(field, colLabel, colSchema, colData, df);
}); });
const whereCacheUpdate = _whereCacheCreate( const whereCacheUpdate = _whereCacheCreate(
@@ -126,12 +139,15 @@ export class AnnoMatrixClipView extends AnnoMatrixMapView {
A view which is a clipped transformation of its parent A view which is a clipped transformation of its parent
*/ */
// @ts-expect-error ts-migrate(7006) FIXME: Parameter 'viewOf' implicitly has an 'any' type. // @ts-expect-error ts-migrate(7006) FIXME: Parameter 'viewOf' implicitly has an 'any' type.
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
constructor(viewOf, qmin, qmax) { constructor(viewOf, qmin, qmax) {
// @ts-expect-error ts-migrate(7006) FIXME: Parameter 'field' implicitly has an 'any' type. // @ts-expect-error ts-migrate(7006) FIXME: Parameter 'field' implicitly has an 'any' type.
super(viewOf, (field, colLabel, colSchema, colData, df) => super(viewOf, (field, colLabel, colSchema, colData, df) =>
_clipAnnoMatrix(field, colLabel, colSchema, colData, df, qmin, qmax) _clipAnnoMatrix(field, colLabel, colSchema, colData, df, qmin, qmax)
); );
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
(this as any).isClipped = true; (this as any).isClipped = true;
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
(this as any).clipRange = [qmin, qmax]; (this as any).clipRange = [qmin, qmax];
Object.seal(this); Object.seal(this);
} }
@@ -142,12 +158,14 @@ export class AnnoMatrixRowSubsetView extends AnnoMatrixView {
A view which is a subset of total rows. A view which is a subset of total rows.
*/ */
// @ts-expect-error ts-migrate(7006) FIXME: Parameter 'viewOf' implicitly has an 'any' type. // @ts-expect-error ts-migrate(7006) FIXME: Parameter 'viewOf' implicitly has an 'any' type.
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
constructor(viewOf, rowIndex) { constructor(viewOf, rowIndex) {
super(viewOf, rowIndex); super(viewOf, rowIndex);
Object.seal(this); Object.seal(this);
} }
// @ts-expect-error ts-migrate(2416) FIXME: Property '_doLoad' in type 'AnnoMatrixRowSubsetVie... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2416) FIXME: Property '_doLoad' in type 'AnnoMatrixRowSubsetVie... Remove this comment to see the full error message
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
async _doLoad(field, query) { async _doLoad(field, query) {
const df = await this.viewOf._fetch(field, query); const df = await this.viewOf._fetch(field, query);
+8
View File
@@ -51,10 +51,15 @@ creates a cache entry of:
import { _getColumnDimensionNames } from "./schema"; import { _getColumnDimensionNames } from "./schema";
import { _hashStringValues } from "./query"; import { _hashStringValues } from "./query";
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
export function _whereCacheGet( export function _whereCacheGet(
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
whereCache: any, whereCache: any,
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
schema: any, schema: any,
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
field: any, field: any,
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
query: any query: any
) { ) {
/* /*
@@ -91,6 +96,7 @@ export function _whereCacheGet(
} }
// @ts-expect-error ts-migrate(7006) FIXME: Parameter 'field' implicitly has an 'any' type. // @ts-expect-error ts-migrate(7006) FIXME: Parameter 'field' implicitly has an 'any' type.
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
export function _whereCacheCreate(field, query, columnLabels) { export function _whereCacheCreate(field, query, columnLabels) {
/* /*
Create a new whereCache Create a new whereCache
@@ -141,6 +147,7 @@ export function _whereCacheCreate(field, query, columnLabels) {
function __mergeQueries(dst, src) { function __mergeQueries(dst, src) {
for (const [queryField, columnMap] of Object.entries(src)) { for (const [queryField, columnMap] of Object.entries(src)) {
dst[queryField] = dst[queryField] || new Map(); dst[queryField] = dst[queryField] || new Map();
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
for (const [queryColumn, valueMap] of columnMap as any) { for (const [queryColumn, valueMap] of columnMap as any) {
if (!dst[queryField].has(queryColumn)) if (!dst[queryField].has(queryColumn))
dst[queryField].set(queryColumn, new Map()); dst[queryField].set(queryColumn, new Map());
@@ -181,6 +188,7 @@ function __whereCacheMerge(dst, src) {
} }
// @ts-expect-error ts-migrate(7019) FIXME: Rest parameter 'caches' implicitly has an 'any[]' ... Remove this comment to see the full error message // @ts-expect-error ts-migrate(7019) FIXME: Rest parameter 'caches' implicitly has an 'any[]' ... Remove this comment to see the full error message
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
export function _whereCacheMerge(...caches) { export function _whereCacheMerge(...caches) {
return caches.reduce(__whereCacheMerge, {}); return caches.reduce(__whereCacheMerge, {});
} }
+4
View File
@@ -1,14 +1,18 @@
import React from "react"; import React from "react";
import { Button, Tooltip, Dialog, Classes, Colors } from "@blueprintjs/core"; import { Button, Tooltip, Dialog, Classes, Colors } from "@blueprintjs/core";
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
type State = any; type State = any;
// eslint-disable-next-line @typescript-eslint/ban-types --- FIXME: disabled temporarily on migrate to TS.
class AnnoDialog extends React.PureComponent<{}, State> { class AnnoDialog extends React.PureComponent<{}, State> {
// eslint-disable-next-line @typescript-eslint/ban-types --- FIXME: disabled temporarily on migrate to TS.
constructor(props: {}) { constructor(props: {}) {
super(props); super(props);
this.state = {}; this.state = {};
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
render() { render() {
const { const {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'isActive' does not exist on type 'Readon... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'isActive' does not exist on type 'Readon... Remove this comment to see the full error message
+7
View File
@@ -17,11 +17,15 @@ import actions from "../actions";
// @ts-expect-error ts-migrate(1238) FIXME: Unable to resolve signature of class decorator whe... Remove this comment to see the full error message // @ts-expect-error ts-migrate(1238) FIXME: Unable to resolve signature of class decorator whe... Remove this comment to see the full error message
@connect((state) => ({ @connect((state) => ({
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
loading: (state as any).controls.loading, loading: (state as any).controls.loading,
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
error: (state as any).controls.error, error: (state as any).controls.error,
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
graphRenderCounter: (state as any).controls.graphRenderCounter, graphRenderCounter: (state as any).controls.graphRenderCounter,
})) }))
class App extends React.Component { class App extends React.Component {
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
componentDidMount() { componentDidMount() {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'dispatch' does not exist on type 'Readon... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'dispatch' does not exist on type 'Readon... Remove this comment to see the full error message
const { dispatch } = this.props; const { dispatch } = this.props;
@@ -33,12 +37,14 @@ class App extends React.Component {
this.forceUpdate(); this.forceUpdate();
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
_onURLChanged() { _onURLChanged() {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'dispatch' does not exist on type 'Readon... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'dispatch' does not exist on type 'Readon... Remove this comment to see the full error message
const { dispatch } = this.props; const { dispatch } = this.props;
dispatch({ type: "url changed", url: document.location.href }); dispatch({ type: "url changed", url: document.location.href });
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
render() { render() {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'loading' does not exist on type 'Readonl... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'loading' does not exist on type 'Readonl... Remove this comment to see the full error message
const { loading, error, graphRenderCounter } = this.props; const { loading, error, graphRenderCounter } = this.props;
@@ -72,6 +78,7 @@ class App extends React.Component {
{loading || error ? null : ( {loading || error ? null : (
<Layout> <Layout>
<LeftSideBar /> <LeftSideBar />
{/* eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS. */}
{(viewportRef: any) => ( {(viewportRef: any) => (
<> <>
<MenuBar /> <MenuBar />
@@ -11,22 +11,31 @@ import {
Tooltip, Tooltip,
} from "@blueprintjs/core"; } from "@blueprintjs/core";
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
type State = any; type State = any;
// @ts-expect-error ts-migrate(1238) FIXME: Unable to resolve signature of class decorator whe... Remove this comment to see the full error message // @ts-expect-error ts-migrate(1238) FIXME: Unable to resolve signature of class decorator whe... Remove this comment to see the full error message
@connect((state) => ({ @connect((state) => ({
idhash: idhash:
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
(state as any).config?.parameters?.["annotations-user-data-idhash"] ?? null, (state as any).config?.parameters?.["annotations-user-data-idhash"] ?? null,
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
annotations: (state as any).annotations, annotations: (state as any).annotations,
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
auth: (state as any).config?.authentication, auth: (state as any).config?.authentication,
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
userInfo: (state as any).userInfo, userInfo: (state as any).userInfo,
writableCategoriesEnabled: writableCategoriesEnabled:
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
(state as any).config?.parameters?.annotations ?? false, (state as any).config?.parameters?.annotations ?? false,
writableGenesetsEnabled: !( writableGenesetsEnabled: !(
(state as any).config?.parameters?.annotations_genesets_readonly ?? true // eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
((state as any).config?.parameters?.annotations_genesets_readonly ?? true)
), ),
})) }))
// eslint-disable-next-line @typescript-eslint/ban-types --- FIXME: disabled temporarily on migrate to TS.
class FilenameDialog extends React.Component<{}, State> { class FilenameDialog extends React.Component<{}, State> {
// eslint-disable-next-line @typescript-eslint/ban-types --- FIXME: disabled temporarily on migrate to TS.
constructor(props: {}) { constructor(props: {}) {
super(props); super(props);
this.state = { this.state = {
@@ -34,8 +43,10 @@ class FilenameDialog extends React.Component<{}, State> {
}; };
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
dismissFilenameDialog = () => {}; dismissFilenameDialog = () => {};
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
handleCreateFilename = () => { handleCreateFilename = () => {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'dispatch' does not exist on type 'Readon... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'dispatch' does not exist on type 'Readon... Remove this comment to see the full error message
const { dispatch } = this.props; const { dispatch } = this.props;
@@ -46,6 +57,7 @@ class FilenameDialog extends React.Component<{}, State> {
}); });
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
filenameError = () => { filenameError = () => {
const legalNames = /^\w+$/; const legalNames = /^\w+$/;
const { filenameText } = this.state; const { filenameText } = this.state;
@@ -66,6 +78,7 @@ class FilenameDialog extends React.Component<{}, State> {
return err; return err;
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
filenameErrorMessage = () => { filenameErrorMessage = () => {
const err = this.filenameError(); const err = this.filenameError();
let markup = null; let markup = null;
@@ -101,6 +114,7 @@ class FilenameDialog extends React.Component<{}, State> {
return markup; return markup;
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
render() { render() {
const { const {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'writableCategoriesEnabled' does not exis... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'writableCategoriesEnabled' does not exis... Remove this comment to see the full error message
+24 -4
View File
@@ -3,29 +3,40 @@ import { connect } from "react-redux";
import actions from "../../actions"; import actions from "../../actions";
import FilenameDialog from "./filenameDialog"; import FilenameDialog from "./filenameDialog";
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
type State = any; type State = any;
// @ts-expect-error ts-migrate(1238) FIXME: Unable to resolve signature of class decorator whe... Remove this comment to see the full error message // @ts-expect-error ts-migrate(1238) FIXME: Unable to resolve signature of class decorator whe... Remove this comment to see the full error message
@connect((state) => ({ @connect((state) => ({
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
annotations: (state as any).annotations, annotations: (state as any).annotations,
obsAnnotationSaveInProgress: obsAnnotationSaveInProgress:
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
(state as any).autosave?.obsAnnotationSaveInProgress ?? false, (state as any).autosave?.obsAnnotationSaveInProgress ?? false,
genesetSaveInProgress: genesetSaveInProgress:
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
(state as any).autosave?.genesetSaveInProgress ?? false, (state as any).autosave?.genesetSaveInProgress ?? false,
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
error: (state as any).autosave?.error, error: (state as any).autosave?.error,
writableCategoriesEnabled: writableCategoriesEnabled:
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
(state as any).config?.parameters?.annotations ?? false, (state as any).config?.parameters?.annotations ?? false,
writableGenesetsEnabled: !( writableGenesetsEnabled: !(
(state as any).config?.parameters?.annotations_genesets_readonly ?? true // eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
((state as any).config?.parameters?.annotations_genesets_readonly ?? true)
), ),
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
annoMatrix: (state as any).annoMatrix, annoMatrix: (state as any).annoMatrix,
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
genesets: (state as any).genesets, genesets: (state as any).genesets,
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
lastSavedAnnoMatrix: (state as any).autosave?.lastSavedAnnoMatrix, lastSavedAnnoMatrix: (state as any).autosave?.lastSavedAnnoMatrix,
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
lastSavedGenesets: (state as any).autosave?.lastSavedGenesets, lastSavedGenesets: (state as any).autosave?.lastSavedGenesets,
})) }))
// eslint-disable-next-line @typescript-eslint/ban-types --- FIXME: disabled temporarily on migrate to TS.
class Autosave extends React.Component<{}, State> { class Autosave extends React.Component<{}, State> {
clearInterval: any; // eslint-disable-next-line @typescript-eslint/ban-types --- FIXME: disabled temporarily on migrate to TS.
constructor(props: {}) { constructor(props: {}) {
super(props); super(props);
this.state = { this.state = {
@@ -33,6 +44,7 @@ class Autosave extends React.Component<{}, State> {
}; };
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
componentDidMount() { componentDidMount() {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'writableCategoriesEnabled' does not exis... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'writableCategoriesEnabled' does not exis... Remove this comment to see the full error message
const { writableCategoriesEnabled, writableGenesetsEnabled } = this.props; const { writableCategoriesEnabled, writableGenesetsEnabled } = this.props;
@@ -46,11 +58,13 @@ class Autosave extends React.Component<{}, State> {
this.setState({ timer }); this.setState({ timer });
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
componentWillUnmount() { componentWillUnmount() {
const { timer } = this.state; const { timer } = this.state;
if (timer) this.clearInterval(timer); if (timer) clearInterval(timer);
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
tick = () => { tick = () => {
const { const {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'dispatch' does not exist on type 'Readon... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'dispatch' does not exist on type 'Readon... Remove this comment to see the full error message
@@ -68,6 +82,7 @@ class Autosave extends React.Component<{}, State> {
} }
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
needToSaveObsAnnotations = () => { needToSaveObsAnnotations = () => {
/* return true if we need to save obs cell labels, false if we don't */ /* return true if we need to save obs cell labels, false if we don't */
// @ts-expect-error ts-migrate(2339) FIXME: Property 'annoMatrix' does not exist on type 'Read... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'annoMatrix' does not exist on type 'Read... Remove this comment to see the full error message
@@ -75,6 +90,7 @@ class Autosave extends React.Component<{}, State> {
return actions.needToSaveObsAnnotations(annoMatrix, lastSavedAnnoMatrix); return actions.needToSaveObsAnnotations(annoMatrix, lastSavedAnnoMatrix);
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
needToSaveGenesets = () => { needToSaveGenesets = () => {
/* return true if we need to save gene ses, false if we do not */ /* return true if we need to save gene ses, false if we do not */
// @ts-expect-error ts-migrate(2339) FIXME: Property 'genesets' does not exist on type 'Readon... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'genesets' does not exist on type 'Readon... Remove this comment to see the full error message
@@ -82,16 +98,19 @@ class Autosave extends React.Component<{}, State> {
return genesets.initialized && genesets.genesets !== lastSavedGenesets; return genesets.initialized && genesets.genesets !== lastSavedGenesets;
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
needToSave() { needToSave() {
return this.needToSaveGenesets() || this.needToSaveObsAnnotations(); return this.needToSaveGenesets() || this.needToSaveObsAnnotations();
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
saveInProgress() { saveInProgress() {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'obsAnnotationSaveInProgress' does not ex... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'obsAnnotationSaveInProgress' does not ex... Remove this comment to see the full error message
const { obsAnnotationSaveInProgress, genesetSaveInProgress } = this.props; const { obsAnnotationSaveInProgress, genesetSaveInProgress } = this.props;
return obsAnnotationSaveInProgress || genesetSaveInProgress; return obsAnnotationSaveInProgress || genesetSaveInProgress;
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
statusMessage() { statusMessage() {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'error' does not exist on type 'Readonly<... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'error' does not exist on type 'Readonly<... Remove this comment to see the full error message
const { error } = this.props; const { error } = this.props;
@@ -101,6 +120,7 @@ class Autosave extends React.Component<{}, State> {
return this.needToSave() ? "Unsaved" : "All saved"; return this.needToSave() ? "Unsaved" : "All saved";
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
render() { render() {
const { const {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'writableCategoriesEnabled' does not exis... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'writableCategoriesEnabled' does not exis... Remove this comment to see the full error message
@@ -1,6 +1,7 @@
import React from "react"; import React from "react";
import * as globals from "../../globals"; import * as globals from "../../globals";
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
const ErrorLoading = ({ displayName, zebra }: any) => { const ErrorLoading = ({ displayName, zebra }: any) => {
return ( return (
<div <div
@@ -5,6 +5,7 @@ import * as d3 from "d3";
import maybeScientific from "../../util/maybeScientific"; import maybeScientific from "../../util/maybeScientific";
import clamp from "../../util/clamp"; import clamp from "../../util/clamp";
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
const Histogram = ({ const Histogram = ({
field, field,
fieldForId, fieldForId,
@@ -17,7 +18,7 @@ const Histogram = ({
margin, margin,
isColorBy, isColorBy,
selectionRange, selectionRange,
mini, mini, // eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
}: any) => { }: any) => {
const svgRef = useRef(null); const svgRef = useRef(null);
const [brush, setBrush] = useState(null); const [brush, setBrush] = useState(null);
@@ -80,6 +81,7 @@ const Histogram = ({
// @ts-expect-error ts-migrate(2769) FIXME: No overload matches this call. // @ts-expect-error ts-migrate(2769) FIXME: No overload matches this call.
isColorBy isColorBy
? // @ts-expect-error ts-migrate(6133) FIXME: 'd' is declared but its value is never read. ? // @ts-expect-error ts-migrate(6133) FIXME: 'd' is declared but its value is never read.
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
(d: any, i: any) => colorScale(histogramScale(binStart(i))) (d: any, i: any) => colorScale(histogramScale(binStart(i)))
: defaultBarColor : defaultBarColor
); );
@@ -134,6 +136,7 @@ const Histogram = ({
.tickFormat( .tickFormat(
// @ts-expect-error ts-migrate(2769) FIXME: No overload matches this call. // @ts-expect-error ts-migrate(2769) FIXME: No overload matches this call.
d3.format( d3.format(
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
y.domain().some((n: any) => Math.abs(n) >= 10000) ? ".0e" : "," y.domain().some((n: any) => Math.abs(n) >= 10000) ? ".0e" : ","
) )
) )
@@ -38,21 +38,28 @@ const HEIGHT_MINI = 15 - MARGIN_MINI.TOP - MARGIN_MINI.BOTTOM;
field field
); );
return { return {
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
annoMatrix: (state as any).annoMatrix, annoMatrix: (state as any).annoMatrix,
isScatterplotXXaccessor: isScatterplotXXaccessor:
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
(state as any).controls.scatterplotXXaccessor === field, (state as any).controls.scatterplotXXaccessor === field,
isScatterplotYYaccessor: isScatterplotYYaccessor:
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
(state as any).controls.scatterplotYYaccessor === field, (state as any).controls.scatterplotYYaccessor === field,
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
continuousSelectionRange: (state as any).continuousSelection[myName], continuousSelectionRange: (state as any).continuousSelection[myName],
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
isColorAccessor: (state as any).colors.colorAccessor === field, isColorAccessor: (state as any).colors.colorAccessor === field,
}; };
}) })
class HistogramBrush extends React.PureComponent { class HistogramBrush extends React.PureComponent {
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
static watchAsync(props: any, prevProps: any) { static watchAsync(props: any, prevProps: any) {
return !shallowEqual(props.watchProps, prevProps.watchProps); return !shallowEqual(props.watchProps, prevProps.watchProps);
} }
/* memoized closure to prevent HistogramHeader unecessary repaint */ /* memoized closure to prevent HistogramHeader unecessary repaint */
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
handleColorAction = memoize((dispatch) => (field: any, isObs: any) => { handleColorAction = memoize((dispatch) => (field: any, isObs: any) => {
if (isObs) { if (isObs) {
dispatch({ dispatch({
@@ -65,6 +72,7 @@ class HistogramBrush extends React.PureComponent {
}); });
// @ts-expect-error ts-migrate(6133) FIXME: 'selection' is declared but its value is never rea... Remove this comment to see the full error message // @ts-expect-error ts-migrate(6133) FIXME: 'selection' is declared but its value is never rea... Remove this comment to see the full error message
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
onBrush = (selection: any, x: any, eventType: any) => { onBrush = (selection: any, x: any, eventType: any) => {
const type = `continuous metadata histogram ${eventType}`; const type = `continuous metadata histogram ${eventType}`;
return () => { return () => {
@@ -82,13 +90,17 @@ class HistogramBrush extends React.PureComponent {
} = this.props; } = this.props;
// ignore programmatically generated events // ignore programmatically generated events
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
if (!(d3 as any).event.sourceEvent) return; if (!(d3 as any).event.sourceEvent) return;
// ignore cascading events, which are programmatically generated // ignore cascading events, which are programmatically generated
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
if ((d3 as any).event.sourceEvent.sourceEvent) return; if ((d3 as any).event.sourceEvent.sourceEvent) return;
const query = this.createQuery(); const query = this.createQuery();
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
const range = (d3 as any).event.selection const range = (d3 as any).event.selection
? [x((d3 as any).event.selection[0]), x((d3 as any).event.selection[1])] ? // eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
[x((d3 as any).event.selection[0]), x((d3 as any).event.selection[1])]
: null; : null;
const otherProps = { const otherProps = {
selection: field, selection: field,
@@ -105,7 +117,9 @@ class HistogramBrush extends React.PureComponent {
}; };
// @ts-expect-error ts-migrate(6133) FIXME: 'selection' is declared but its value is never rea... Remove this comment to see the full error message // @ts-expect-error ts-migrate(6133) FIXME: 'selection' is declared but its value is never rea... Remove this comment to see the full error message
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
onBrushEnd = (selection: any, x: any) => { onBrushEnd = (selection: any, x: any) => {
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
return () => { return () => {
const { const {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'dispatch' does not exist on type 'Readon... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'dispatch' does not exist on type 'Readon... Remove this comment to see the full error message
@@ -123,30 +137,38 @@ class HistogramBrush extends React.PureComponent {
const smallAmountToAvoidInfiniteLoop = 0.1; const smallAmountToAvoidInfiniteLoop = 0.1;
// ignore programmatically generated events // ignore programmatically generated events
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
if (!(d3 as any).event.sourceEvent) return; if (!(d3 as any).event.sourceEvent) return;
// ignore cascading events, which are programmatically generated // ignore cascading events, which are programmatically generated
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
if ((d3 as any).event.sourceEvent.sourceEvent) return; if ((d3 as any).event.sourceEvent.sourceEvent) return;
let type; let type;
let range = null; let range = null;
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
if ((d3 as any).event.selection) { if ((d3 as any).event.selection) {
type = "continuous metadata histogram end"; type = "continuous metadata histogram end";
if ( if (
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
(d3 as any).event.selection[1] - (d3 as any).event.selection[0] > (d3 as any).event.selection[1] - (d3 as any).event.selection[0] >
minAllowedBrushSize minAllowedBrushSize
) { ) {
range = [ range = [
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
x((d3 as any).event.selection[0]), x((d3 as any).event.selection[0]),
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
x((d3 as any).event.selection[1]), x((d3 as any).event.selection[1]),
]; ];
} else { } else {
/* the user selected range is too small and will be hidden #587, so take control of it procedurally */ /* the user selected range is too small and will be hidden #587, so take control of it procedurally */
/* https://stackoverflow.com/questions/12354729/d3-js-limit-size-of-brush */ /* https://stackoverflow.com/questions/12354729/d3-js-limit-size-of-brush */
const procedurallyResizedBrushWidth = const procedurallyResizedBrushWidth =
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
(d3 as any).event.selection[0] + (d3 as any).event.selection[0] +
minAllowedBrushSize + minAllowedBrushSize +
smallAmountToAvoidInfiniteLoop; // smallAmountToAvoidInfiniteLoop; //
range = [ range = [
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
x((d3 as any).event.selection[0]), x((d3 as any).event.selection[0]),
x(procedurallyResizedBrushWidth), x(procedurallyResizedBrushWidth),
]; ];
@@ -170,6 +192,7 @@ class HistogramBrush extends React.PureComponent {
}; };
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
handleSetGeneAsScatterplotX = () => { handleSetGeneAsScatterplotX = () => {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'dispatch' does not exist on type 'Readon... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'dispatch' does not exist on type 'Readon... Remove this comment to see the full error message
const { dispatch, field } = this.props; const { dispatch, field } = this.props;
@@ -179,6 +202,7 @@ class HistogramBrush extends React.PureComponent {
}); });
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
handleSetGeneAsScatterplotY = () => { handleSetGeneAsScatterplotY = () => {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'dispatch' does not exist on type 'Readon... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'dispatch' does not exist on type 'Readon... Remove this comment to see the full error message
const { dispatch, field } = this.props; const { dispatch, field } = this.props;
@@ -188,6 +212,7 @@ class HistogramBrush extends React.PureComponent {
}); });
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
removeHistogram = () => { removeHistogram = () => {
const { const {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'dispatch' does not exist on type 'Readon... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'dispatch' does not exist on type 'Readon... Remove this comment to see the full error message
@@ -224,6 +249,7 @@ class HistogramBrush extends React.PureComponent {
} }
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
fetchAsyncProps = async () => { fetchAsyncProps = async () => {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'annoMatrix' does not exist on type 'Read... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'annoMatrix' does not exist on type 'Read... Remove this comment to see the full error message
const { annoMatrix, width } = this.props; const { annoMatrix, width } = this.props;
@@ -289,7 +315,7 @@ class HistogramBrush extends React.PureComponent {
}; };
}; };
// eslint-disable-next-line class-methods-use-this -- instance method allows for memoization per annotation // eslint-disable-next-line class-methods-use-this, @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- instance method allows for memoization per annotation
calcHistogramCache(col: any, newMargin: any, newWidth: any, newHeight: any) { calcHistogramCache(col: any, newMargin: any, newWidth: any, newHeight: any) {
/* /*
recalculate expensive stuff, notably bins, summaries, etc. recalculate expensive stuff, notably bins, summaries, etc.
@@ -299,28 +325,38 @@ class HistogramBrush extends React.PureComponent {
const { min: domainMin, max: domainMax } = summary; const { min: domainMin, max: domainMax } = summary;
const numBins = 40; const numBins = 40;
const { TOP: topMargin, LEFT: leftMargin } = newMargin; const { TOP: topMargin, LEFT: leftMargin } = newMargin;
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
(histogramCache as any).domain = [domainMin, domainMax]; (histogramCache as any).domain = [domainMin, domainMax];
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
/* doesn't change with mini */ (histogramCache as any).x = d3 /* doesn't change with mini */ (histogramCache as any).x = d3
.scaleLinear() .scaleLinear()
.domain([domainMin, domainMax]) .domain([domainMin, domainMax])
.range([leftMargin, leftMargin + newWidth]); .range([leftMargin, leftMargin + newWidth]);
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
(histogramCache as any).bins = col.histogram(numBins, [ (histogramCache as any).bins = col.histogram(numBins, [
domainMin, domainMin,
domainMax, domainMax,
]); ]);
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
/* memoized */ (histogramCache as any).binWidth = /* memoized */ (histogramCache as any).binWidth =
(domainMax - domainMin) / numBins; (domainMax - domainMin) / numBins;
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
(histogramCache as any).binStart = (i: any) => (histogramCache as any).binStart = (i: any) =>
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
domainMin + i * (histogramCache as any).binWidth; domainMin + i * (histogramCache as any).binWidth;
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
(histogramCache as any).binEnd = (i: any) => (histogramCache as any).binEnd = (i: any) =>
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
domainMin + (i + 1) * (histogramCache as any).binWidth; domainMin + (i + 1) * (histogramCache as any).binWidth;
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
const yMax = (histogramCache as any).bins.reduce((l: any, r: any) => const yMax = (histogramCache as any).bins.reduce((l: any, r: any) =>
l > r ? l : r l > r ? l : r
); );
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
(histogramCache as any).y = d3 (histogramCache as any).y = d3
.scaleLinear() .scaleLinear()
.domain([0, yMax]) .domain([0, yMax])
@@ -329,6 +365,7 @@ class HistogramBrush extends React.PureComponent {
return histogramCache; return histogramCache;
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
createQuery() { createQuery() {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'isObs' does not exist on type 'Readonly<... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'isObs' does not exist on type 'Readonly<... Remove this comment to see the full error message
const { isObs, isGeneSetSummary, field, setGenes, annoMatrix } = this.props; const { isObs, isGeneSetSummary, field, setGenes, annoMatrix } = this.props;
@@ -366,6 +403,7 @@ class HistogramBrush extends React.PureComponent {
]; ];
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
render() { render() {
const { const {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'dispatch' does not exist on type 'Readon... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'dispatch' does not exist on type 'Readon... Remove this comment to see the full error message
@@ -425,6 +463,7 @@ class HistogramBrush extends React.PureComponent {
</Async.Rejected> </Async.Rejected>
<Async.Fulfilled> <Async.Fulfilled>
{(asyncProps) => {(asyncProps) =>
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
(asyncProps as any).OK2Render ? ( (asyncProps as any).OK2Render ? (
<div <div
id={`histogram_${fieldForId}`} id={`histogram_${fieldForId}`}
@@ -456,11 +495,14 @@ class HistogramBrush extends React.PureComponent {
<Histogram <Histogram
field={field} field={field}
fieldForId={fieldForId} fieldForId={fieldForId}
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
display={(asyncProps as any).isSingleValue ? "none" : "block"} display={(asyncProps as any).isSingleValue ? "none" : "block"}
histogram={ histogram={
mini mini
? (asyncProps as any).miniHistogram ? // eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
: (asyncProps as any).histogram (asyncProps as any).miniHistogram
: // eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
(asyncProps as any).histogram
} }
width={width} width={width}
height={mini ? HEIGHT_MINI : HEIGHT} height={mini ? HEIGHT_MINI : HEIGHT}
@@ -477,10 +519,15 @@ class HistogramBrush extends React.PureComponent {
isGeneSetSummary={isGeneSetSummary} isGeneSetSummary={isGeneSetSummary}
isObs={isObs} isObs={isObs}
displayName={field} displayName={field}
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
hideRanges={(asyncProps as any).isSingleValue} hideRanges={(asyncProps as any).isSingleValue}
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
rangeMin={(asyncProps as any).unclippedRange[0]} rangeMin={(asyncProps as any).unclippedRange[0]}
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
rangeMax={(asyncProps as any).unclippedRange[1]} rangeMax={(asyncProps as any).unclippedRange[1]}
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
rangeColorMin={(asyncProps as any).unclippedRangeColor[0]} rangeColorMin={(asyncProps as any).unclippedRangeColor[0]}
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
rangeColorMax={(asyncProps as any).unclippedRangeColor[1]} rangeColorMax={(asyncProps as any).unclippedRangeColor[1]}
/> />
)} )}
@@ -3,6 +3,7 @@ import { Button } from "@blueprintjs/core";
import * as globals from "../../globals"; import * as globals from "../../globals";
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
const StillLoading = ({ zebra, displayName }: any) => { const StillLoading = ({ zebra, displayName }: any) => {
/* /*
Render a loading indicator for the field. Render a loading indicator for the field.
@@ -2,14 +2,18 @@ import React from "react";
import { Button, MenuItem } from "@blueprintjs/core"; import { Button, MenuItem } from "@blueprintjs/core";
import { Select } from "@blueprintjs/select"; import { Select } from "@blueprintjs/select";
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
type State = any; type State = any;
// eslint-disable-next-line @typescript-eslint/ban-types --- FIXME: disabled temporarily on migrate to TS.
class DuplicateCategorySelect extends React.PureComponent<{}, State> { class DuplicateCategorySelect extends React.PureComponent<{}, State> {
// eslint-disable-next-line @typescript-eslint/ban-types --- FIXME: disabled temporarily on migrate to TS.
constructor(props: {}) { constructor(props: {}) {
super(props); super(props);
this.state = {}; this.state = {};
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
render() { render() {
const { const {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'allCategoryNames' does not exist on type... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'allCategoryNames' does not exist on type... Remove this comment to see the full error message
@@ -5,15 +5,21 @@ import LabelInput from "../../labelInput";
import { labelPrompt, isLabelErroneous } from "../labelUtil"; import { labelPrompt, isLabelErroneous } from "../labelUtil";
import actions from "../../../actions"; import actions from "../../../actions";
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
type State = any; type State = any;
// @ts-expect-error ts-migrate(1238) FIXME: Unable to resolve signature of class decorator whe... Remove this comment to see the full error message // @ts-expect-error ts-migrate(1238) FIXME: Unable to resolve signature of class decorator whe... Remove this comment to see the full error message
@connect((state) => ({ @connect((state) => ({
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
annotations: (state as any).annotations, annotations: (state as any).annotations,
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
schema: (state as any).annoMatrix?.schema, schema: (state as any).annoMatrix?.schema,
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
obsCrossfilter: (state as any).obsCrossfilter, obsCrossfilter: (state as any).obsCrossfilter,
})) }))
// eslint-disable-next-line @typescript-eslint/ban-types --- FIXME: disabled temporarily on migrate to TS.
class Category extends React.PureComponent<{}, State> { class Category extends React.PureComponent<{}, State> {
// eslint-disable-next-line @typescript-eslint/ban-types --- FIXME: disabled temporarily on migrate to TS.
constructor(props: {}) { constructor(props: {}) {
super(props); super(props);
this.state = { this.state = {
@@ -21,6 +27,7 @@ class Category extends React.PureComponent<{}, State> {
}; };
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
disableAddNewLabelMode = (e: any) => { disableAddNewLabelMode = (e: any) => {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'dispatch' does not exist on type 'Readon... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'dispatch' does not exist on type 'Readon... Remove this comment to see the full error message
const { dispatch } = this.props; const { dispatch } = this.props;
@@ -33,6 +40,7 @@ class Category extends React.PureComponent<{}, State> {
if (e) e.preventDefault(); if (e) e.preventDefault();
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
handleAddNewLabelToCategory = (e: any) => { handleAddNewLabelToCategory = (e: any) => {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'dispatch' does not exist on type 'Readon... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'dispatch' does not exist on type 'Readon... Remove this comment to see the full error message
const { dispatch, metadataField } = this.props; const { dispatch, metadataField } = this.props;
@@ -49,6 +57,7 @@ class Category extends React.PureComponent<{}, State> {
e.preventDefault(); e.preventDefault();
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
addLabelAndAssignCells = (e: any) => { addLabelAndAssignCells = (e: any) => {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'dispatch' does not exist on type 'Readon... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'dispatch' does not exist on type 'Readon... Remove this comment to see the full error message
const { dispatch, metadataField } = this.props; const { dispatch, metadataField } = this.props;
@@ -61,20 +70,24 @@ class Category extends React.PureComponent<{}, State> {
e.preventDefault(); e.preventDefault();
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
labelNameError = (name: any) => { labelNameError = (name: any) => {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'metadataField' does not exist on type 'R... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'metadataField' does not exist on type 'R... Remove this comment to see the full error message
const { metadataField, schema } = this.props; const { metadataField, schema } = this.props;
return isLabelErroneous(name, metadataField, schema); return isLabelErroneous(name, metadataField, schema);
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
instruction = (label: any) => { instruction = (label: any) => {
return labelPrompt(this.labelNameError(label), "New, unique label", ":"); return labelPrompt(this.labelNameError(label), "New, unique label", ":");
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
handleChangeOrSelect = (label: any) => { handleChangeOrSelect = (label: any) => {
this.setState({ newLabelText: label }); this.setState({ newLabelText: label });
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
render() { render() {
const { newLabelText } = this.state; const { newLabelText } = this.state;
// @ts-expect-error ts-migrate(2339) FIXME: Property 'metadataField' does not exist on type 'R... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'metadataField' does not exist on type 'R... Remove this comment to see the full error message
@@ -7,14 +7,19 @@ import { labelPrompt } from "../labelUtil";
import { AnnotationsHelpers } from "../../../util/stateManager"; import { AnnotationsHelpers } from "../../../util/stateManager";
import actions from "../../../actions"; import actions from "../../../actions";
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
type State = any; type State = any;
// @ts-expect-error ts-migrate(1238) FIXME: Unable to resolve signature of class decorator whe... Remove this comment to see the full error message // @ts-expect-error ts-migrate(1238) FIXME: Unable to resolve signature of class decorator whe... Remove this comment to see the full error message
@connect((state) => ({ @connect((state) => ({
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
annotations: (state as any).annotations, annotations: (state as any).annotations,
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
schema: (state as any).annoMatrix?.schema, schema: (state as any).annoMatrix?.schema,
})) }))
// eslint-disable-next-line @typescript-eslint/ban-types --- FIXME: disabled temporarily on migrate to TS.
class AnnoDialogEditCategoryName extends React.PureComponent<{}, State> { class AnnoDialogEditCategoryName extends React.PureComponent<{}, State> {
// eslint-disable-next-line @typescript-eslint/ban-types --- FIXME: disabled temporarily on migrate to TS.
constructor(props: {}) { constructor(props: {}) {
super(props); super(props);
this.state = { this.state = {
@@ -23,12 +28,14 @@ class AnnoDialogEditCategoryName extends React.PureComponent<{}, State> {
}; };
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
handleChangeOrSelect = (name: any) => { handleChangeOrSelect = (name: any) => {
this.setState({ this.setState({
newCategoryText: name, newCategoryText: name,
}); });
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
disableEditCategoryMode = () => { disableEditCategoryMode = () => {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'dispatch' does not exist on type 'Readon... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'dispatch' does not exist on type 'Readon... Remove this comment to see the full error message
const { dispatch, metadataField } = this.props; const { dispatch, metadataField } = this.props;
@@ -38,6 +45,7 @@ class AnnoDialogEditCategoryName extends React.PureComponent<{}, State> {
this.setState({ newCategoryText: metadataField }); this.setState({ newCategoryText: metadataField });
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
handleEditCategory = (e: any) => { handleEditCategory = (e: any) => {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'dispatch' does not exist on type 'Readon... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'dispatch' does not exist on type 'Readon... Remove this comment to see the full error message
const { dispatch, metadataField } = this.props; const { dispatch, metadataField } = this.props;
@@ -49,6 +57,7 @@ class AnnoDialogEditCategoryName extends React.PureComponent<{}, State> {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'schema' does not exist on type 'Readonly... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'schema' does not exist on type 'Readonly... Remove this comment to see the full error message
const { schema } = this.props; const { schema } = this.props;
const allCategoryNames = schema.annotations.obs.columns.map( const allCategoryNames = schema.annotations.obs.columns.map(
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
(c: any) => c.name (c: any) => c.name
); );
if ( if (
@@ -66,6 +75,7 @@ class AnnoDialogEditCategoryName extends React.PureComponent<{}, State> {
e.preventDefault(); e.preventDefault();
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
editedCategoryNameError = (name: any) => { editedCategoryNameError = (name: any) => {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'metadataField' does not exist on type 'R... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'metadataField' does not exist on type 'R... Remove this comment to see the full error message
const { metadataField } = this.props; const { metadataField } = this.props;
@@ -82,6 +92,7 @@ class AnnoDialogEditCategoryName extends React.PureComponent<{}, State> {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'schema' does not exist on type 'Readonly... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'schema' does not exist on type 'Readonly... Remove this comment to see the full error message
const { schema } = this.props; const { schema } = this.props;
const allCategoryNames = schema.annotations.obs.columns.map( const allCategoryNames = schema.annotations.obs.columns.map(
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
(c: any) => c.name (c: any) => c.name
); );
const categoryNameAlreadyExists = allCategoryNames.indexOf(name) > -1; const categoryNameAlreadyExists = allCategoryNames.indexOf(name) > -1;
@@ -93,6 +104,7 @@ class AnnoDialogEditCategoryName extends React.PureComponent<{}, State> {
return false; return false;
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
instruction = (name: any) => { instruction = (name: any) => {
return labelPrompt( return labelPrompt(
this.editedCategoryNameError(name), this.editedCategoryNameError(name),
@@ -101,12 +113,15 @@ class AnnoDialogEditCategoryName extends React.PureComponent<{}, State> {
); );
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
allCategoryNames() { allCategoryNames() {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'schema' does not exist on type 'Readonly... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'schema' does not exist on type 'Readonly... Remove this comment to see the full error message
const { schema } = this.props; const { schema } = this.props;
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
return schema.annotations.obs.columns.map((c: any) => c.name); return schema.annotations.obs.columns.map((c: any) => c.name);
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
render() { render() {
const { newCategoryText } = this.state; const { newCategoryText } = this.state;
// @ts-expect-error ts-migrate(2339) FIXME: Property 'metadataField' does not exist on type 'R... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'metadataField' does not exist on type 'R... Remove this comment to see the full error message
@@ -16,18 +16,23 @@ import { IconNames } from "@blueprintjs/icons";
import * as globals from "../../../globals"; import * as globals from "../../../globals";
import actions from "../../../actions"; import actions from "../../../actions";
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
type State = any; type State = any;
// @ts-expect-error ts-migrate(1238) FIXME: Unable to resolve signature of class decorator whe... Remove this comment to see the full error message // @ts-expect-error ts-migrate(1238) FIXME: Unable to resolve signature of class decorator whe... Remove this comment to see the full error message
@connect((state) => ({ @connect((state) => ({
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
annotations: (state as any).annotations, annotations: (state as any).annotations,
})) }))
// eslint-disable-next-line @typescript-eslint/ban-types --- FIXME: disabled temporarily on migrate to TS.
class AnnoMenuCategory extends React.PureComponent<{}, State> { class AnnoMenuCategory extends React.PureComponent<{}, State> {
// eslint-disable-next-line @typescript-eslint/ban-types --- FIXME: disabled temporarily on migrate to TS.
constructor(props: {}) { constructor(props: {}) {
super(props); super(props);
this.state = {}; this.state = {};
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
activateAddNewLabelMode = () => { activateAddNewLabelMode = () => {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'dispatch' does not exist on type 'Readon... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'dispatch' does not exist on type 'Readon... Remove this comment to see the full error message
const { dispatch, metadataField } = this.props; const { dispatch, metadataField } = this.props;
@@ -37,6 +42,7 @@ class AnnoMenuCategory extends React.PureComponent<{}, State> {
}); });
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
activateEditCategoryMode = () => { activateEditCategoryMode = () => {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'dispatch' does not exist on type 'Readon... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'dispatch' does not exist on type 'Readon... Remove this comment to see the full error message
const { dispatch, metadataField } = this.props; const { dispatch, metadataField } = this.props;
@@ -46,12 +52,14 @@ class AnnoMenuCategory extends React.PureComponent<{}, State> {
}); });
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
handleDeleteCategory = () => { handleDeleteCategory = () => {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'dispatch' does not exist on type 'Readon... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'dispatch' does not exist on type 'Readon... Remove this comment to see the full error message
const { dispatch, metadataField } = this.props; const { dispatch, metadataField } = this.props;
dispatch(actions.annotationDeleteCategoryAction(metadataField)); dispatch(actions.annotationDeleteCategoryAction(metadataField));
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
render() { render() {
const { const {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'metadataField' does not exist on type 'R... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'metadataField' does not exist on type 'R... Remove this comment to see the full error message
@@ -33,35 +33,47 @@ const LABEL_WIDTH_ANNO = LABEL_WIDTH - ANNO_BUTTON_WIDTH;
// @ts-expect-error ts-migrate(1238) FIXME: Unable to resolve signature of class decorator whe... Remove this comment to see the full error message // @ts-expect-error ts-migrate(1238) FIXME: Unable to resolve signature of class decorator whe... Remove this comment to see the full error message
@connect((state, ownProps) => { @connect((state, ownProps) => {
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
const schema = (state as any).annoMatrix?.schema; const schema = (state as any).annoMatrix?.schema;
// @ts-expect-error ts-migrate(2339) FIXME: Property 'metadataField' does not exist on type '{... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'metadataField' does not exist on type '{... Remove this comment to see the full error message
const { metadataField } = ownProps; const { metadataField } = ownProps;
const isUserAnno = schema?.annotations?.obsByName[metadataField]?.writable; const isUserAnno = schema?.annotations?.obsByName[metadataField]?.writable;
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
const categoricalSelection = (state as any).categoricalSelection?.[ const categoricalSelection = (state as any).categoricalSelection?.[
metadataField metadataField
]; ];
return { return {
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
colors: (state as any).colors, colors: (state as any).colors,
categoricalSelection, categoricalSelection,
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
annotations: (state as any).annotations, annotations: (state as any).annotations,
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
annoMatrix: (state as any).annoMatrix, annoMatrix: (state as any).annoMatrix,
schema, schema,
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
crossfilter: (state as any).obsCrossfilter, crossfilter: (state as any).obsCrossfilter,
isUserAnno, isUserAnno,
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
genesets: (state as any).genesets.genesets, genesets: (state as any).genesets.genesets,
}; };
}) })
class Category extends React.PureComponent { class Category extends React.PureComponent {
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
static getSelectionState( static getSelectionState(
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
categoricalSelection: any, categoricalSelection: any,
// @ts-expect-error ts-migrate(6133) FIXME: 'metadataField' is declared but its value is never... Remove this comment to see the full error message // @ts-expect-error ts-migrate(6133) FIXME: 'metadataField' is declared but its value is never... Remove this comment to see the full error message
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
metadataField: any, metadataField: any,
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
categorySummary: any categorySummary: any
) { ) {
// total number of categories in this dimension // total number of categories in this dimension
const totalCatCount = categorySummary.numCategoryValues; const totalCatCount = categorySummary.numCategoryValues;
// number of selected options in this category // number of selected options in this category
const selectedCatCount = categorySummary.categoryValues.reduce( const selectedCatCount = categorySummary.categoryValues.reduce(
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
(res: any, label: any) => (res: any, label: any) =>
categoricalSelection.get(label) ?? true ? res + 1 : res, categoricalSelection.get(label) ?? true ? res + 1 : res,
0 0
@@ -73,12 +85,14 @@ class Category extends React.PureComponent {
: "some"; : "some";
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
static watchAsync(props: any, prevProps: any) { static watchAsync(props: any, prevProps: any) {
return !shallowEqual(props.watchProps, prevProps.watchProps); return !shallowEqual(props.watchProps, prevProps.watchProps);
} }
createCategorySummaryFromDfCol = memoize(createCategorySummaryFromDfCol); createCategorySummaryFromDfCol = memoize(createCategorySummaryFromDfCol);
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
getSelectionState(categorySummary: any) { getSelectionState(categorySummary: any) {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'categoricalSelection' does not exist on ... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'categoricalSelection' does not exist on ... Remove this comment to see the full error message
const { categoricalSelection, metadataField } = this.props; const { categoricalSelection, metadataField } = this.props;
@@ -89,6 +103,7 @@ class Category extends React.PureComponent {
); );
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
handleColorChange = () => { handleColorChange = () => {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'dispatch' does not exist on type 'Readon... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'dispatch' does not exist on type 'Readon... Remove this comment to see the full error message
const { dispatch, metadataField } = this.props; const { dispatch, metadataField } = this.props;
@@ -98,6 +113,7 @@ class Category extends React.PureComponent {
}); });
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
handleCategoryClick = () => { handleCategoryClick = () => {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'annotations' does not exist on type 'Rea... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'annotations' does not exist on type 'Rea... Remove this comment to see the full error message
const { annotations, metadataField, onExpansionChange } = this.props; const { annotations, metadataField, onExpansionChange } = this.props;
@@ -109,12 +125,14 @@ class Category extends React.PureComponent {
} }
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
handleCategoryKeyPress = (e: any) => { handleCategoryKeyPress = (e: any) => {
if (e.key === "Enter") { if (e.key === "Enter") {
this.handleCategoryClick(); this.handleCategoryClick();
} }
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
handleToggleAllClick = (categorySummary: any) => { handleToggleAllClick = (categorySummary: any) => {
const isChecked = this.getSelectionState(categorySummary); const isChecked = this.getSelectionState(categorySummary);
if (isChecked === "all") { if (isChecked === "all") {
@@ -124,6 +142,7 @@ class Category extends React.PureComponent {
} }
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
fetchAsyncProps = async (props: any) => { fetchAsyncProps = async (props: any) => {
const { annoMatrix, metadataField, colors } = props.watchProps; const { annoMatrix, metadataField, colors } = props.watchProps;
// @ts-expect-error ts-migrate(2339) FIXME: Property 'crossfilter' does not exist on type 'Rea... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'crossfilter' does not exist on type 'Rea... Remove this comment to see the full error message
@@ -146,6 +165,7 @@ class Category extends React.PureComponent {
}; };
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
async fetchData(annoMatrix: any, metadataField: any, colors: any) { async fetchData(annoMatrix: any, metadataField: any, colors: any) {
/* /*
fetch our data and the color-by data if appropriate, and then build a summary fetch our data and the color-by data if appropriate, and then build a summary
@@ -180,6 +200,7 @@ class Category extends React.PureComponent {
return [categoryData, categorySummary, colorData]; return [categoryData, categorySummary, colorData];
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
updateColorTable(colorData: any) { updateColorTable(colorData: any) {
// color table, which may be null // color table, which may be null
// @ts-expect-error ts-migrate(2339) FIXME: Property 'schema' does not exist on type 'Readonly... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'schema' does not exist on type 'Readonly... Remove this comment to see the full error message
@@ -199,6 +220,7 @@ class Category extends React.PureComponent {
}; };
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
toggleNone(categorySummary: any) { toggleNone(categorySummary: any) {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'dispatch' does not exist on type 'Readon... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'dispatch' does not exist on type 'Readon... Remove this comment to see the full error message
const { dispatch, metadataField } = this.props; const { dispatch, metadataField } = this.props;
@@ -212,6 +234,7 @@ class Category extends React.PureComponent {
); );
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
toggleAll(categorySummary: any) { toggleAll(categorySummary: any) {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'dispatch' does not exist on type 'Readon... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'dispatch' does not exist on type 'Readon... Remove this comment to see the full error message
const { dispatch, metadataField } = this.props; const { dispatch, metadataField } = this.props;
@@ -225,6 +248,7 @@ class Category extends React.PureComponent {
); );
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
render() { render() {
const { const {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'metadataField' does not exist on type 'R... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'metadataField' does not exist on type 'R... Remove this comment to see the full error message
@@ -319,6 +343,7 @@ class Category extends React.PureComponent {
export default Category; export default Category;
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
const StillLoading = ({ metadataField, checkboxID }: any) => { const StillLoading = ({ metadataField, checkboxID }: any) => {
/* /*
We are still loading this category, so render a "busy" signal. We are still loading this category, so render a "busy" signal.
@@ -370,6 +395,7 @@ const StillLoading = ({ metadataField, checkboxID }: any) => {
); );
}; };
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
const ErrorLoading = ({ metadataField, error }: any) => { const ErrorLoading = ({ metadataField, error }: any) => {
console.error(error); // log error to console as it is unexpected. console.error(error); // log error to console as it is unexpected.
return ( return (
+19 -2
View File
@@ -10,16 +10,22 @@ import LabelInput from "../labelInput";
import { labelPrompt } from "./labelUtil"; import { labelPrompt } from "./labelUtil";
import actions from "../../actions"; import actions from "../../actions";
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
type State = any; type State = any;
// @ts-expect-error ts-migrate(1238) FIXME: Unable to resolve signature of class decorator whe... Remove this comment to see the full error message // @ts-expect-error ts-migrate(1238) FIXME: Unable to resolve signature of class decorator whe... Remove this comment to see the full error message
@connect((state) => ({ @connect((state) => ({
writableCategoriesEnabled: writableCategoriesEnabled:
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
(state as any).config?.parameters?.annotations ?? false, (state as any).config?.parameters?.annotations ?? false,
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
schema: (state as any).annoMatrix?.schema, schema: (state as any).annoMatrix?.schema,
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
userInfo: (state as any).userInfo, userInfo: (state as any).userInfo,
})) }))
// eslint-disable-next-line @typescript-eslint/ban-types --- FIXME: disabled temporarily on migrate to TS.
class Categories extends React.Component<{}, State> { class Categories extends React.Component<{}, State> {
// eslint-disable-next-line @typescript-eslint/ban-types --- FIXME: disabled temporarily on migrate to TS.
constructor(props: {}) { constructor(props: {}) {
super(props); super(props);
this.state = { this.state = {
@@ -30,6 +36,7 @@ class Categories extends React.Component<{}, State> {
}; };
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
handleCreateUserAnno = (e: any) => { handleCreateUserAnno = (e: any) => {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'dispatch' does not exist on type 'Readon... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'dispatch' does not exist on type 'Readon... Remove this comment to see the full error message
const { dispatch } = this.props; const { dispatch } = this.props;
@@ -48,10 +55,12 @@ class Categories extends React.Component<{}, State> {
e.preventDefault(); e.preventDefault();
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
handleEnableAnnoMode = () => { handleEnableAnnoMode = () => {
this.setState({ createAnnoModeActive: true }); this.setState({ createAnnoModeActive: true });
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
handleDisableAnnoMode = () => { handleDisableAnnoMode = () => {
this.setState({ this.setState({
createAnnoModeActive: false, createAnnoModeActive: false,
@@ -60,10 +69,12 @@ class Categories extends React.Component<{}, State> {
}); });
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
handleModalDuplicateCategorySelection = (d: any) => { handleModalDuplicateCategorySelection = (d: any) => {
this.setState({ categoryToDuplicate: d }); this.setState({ categoryToDuplicate: d });
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
categoryNameError = (name: any) => { categoryNameError = (name: any) => {
/* /*
return false if this is a LEGAL/acceptable category name or NULL/empty string, return false if this is a LEGAL/acceptable category name or NULL/empty string,
@@ -78,6 +89,7 @@ class Categories extends React.Component<{}, State> {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'schema' does not exist on type 'Readonly... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'schema' does not exist on type 'Readonly... Remove this comment to see the full error message
const { schema } = this.props; const { schema } = this.props;
const allCategoryNames = schema.annotations.obs.columns.map( const allCategoryNames = schema.annotations.obs.columns.map(
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
(c: any) => c.name (c: any) => c.name
); );
/* check category name syntax */ /* check category name syntax */
@@ -93,14 +105,17 @@ class Categories extends React.Component<{}, State> {
return false; return false;
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
handleChange = (name: any) => { handleChange = (name: any) => {
this.setState({ newCategoryText: name }); this.setState({ newCategoryText: name });
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
handleSelect = (name: any) => { handleSelect = (name: any) => {
this.setState({ newCategoryText: name }); this.setState({ newCategoryText: name });
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
instruction = (name: any) => { instruction = (name: any) => {
return labelPrompt( return labelPrompt(
this.categoryNameError(name), this.categoryNameError(name),
@@ -109,6 +124,7 @@ class Categories extends React.Component<{}, State> {
); );
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
onExpansionChange = (catName: any) => { onExpansionChange = (catName: any) => {
const { expandedCats } = this.state; const { expandedCats } = this.state;
if (expandedCats.has(catName)) { if (expandedCats.has(catName)) {
@@ -122,6 +138,7 @@ class Categories extends React.Component<{}, State> {
} }
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
render() { render() {
const { const {
createAnnoModeActive, createAnnoModeActive,
@@ -180,7 +197,6 @@ class Categories extends React.Component<{}, State> {
/> />
} }
/> />
{writableCategoriesEnabled ? ( {writableCategoriesEnabled ? (
<div style={{ marginBottom: 10 }}> <div style={{ marginBottom: 10 }}>
<Tooltip <Tooltip
@@ -209,9 +225,9 @@ class Categories extends React.Component<{}, State> {
</Tooltip> </Tooltip>
</div> </div>
) : null} ) : null}
{/* READ ONLY CATEGORICAL FIELDS */} {/* READ ONLY CATEGORICAL FIELDS */}
{/* this is duplicative but flat, could be abstracted */} {/* this is duplicative but flat, could be abstracted */}
{/* eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS */}
{allCategoryNames.map((catName: any) => {allCategoryNames.map((catName: any) =>
!schema.annotations.obsByName[catName].writable && !schema.annotations.obsByName[catName].writable &&
(schema.annotations.obsByName[catName].categories?.length > 1 || (schema.annotations.obsByName[catName].categories?.length > 1 ||
@@ -227,6 +243,7 @@ class Categories extends React.Component<{}, State> {
) : null ) : null
)} )}
{/* WRITEABLE FIELDS */} {/* WRITEABLE FIELDS */}
{/* eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS */}
{allCategoryNames.map((catName: any) => {allCategoryNames.map((catName: any) =>
schema.annotations.obsByName[catName].writable ? ( schema.annotations.obsByName[catName].writable ? (
<Category <Category
@@ -3,6 +3,7 @@ import { Colors } from "@blueprintjs/core";
import { AnnotationsHelpers } from "../../util/stateManager"; import { AnnotationsHelpers } from "../../util/stateManager";
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
export function isLabelErroneous(label: any, metadataField: any, schema: any) { export function isLabelErroneous(label: any, metadataField: any, schema: any) {
/* /*
return false if this is a LEGAL/acceptable category name or NULL/empty string, return false if this is a LEGAL/acceptable category name or NULL/empty string,
@@ -35,6 +36,7 @@ const errorMessageMap = {
"multi-space-run": "Multiple consecutive spaces not allowed", "multi-space-run": "Multiple consecutive spaces not allowed",
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
export function labelPrompt(err: any, prolog: any, epilog: any) { export function labelPrompt(err: any, prolog: any, epilog: any) {
let errPrompt = null; let errPrompt = null;
if (err) { if (err) {
@@ -30,6 +30,7 @@ const STACKED_BAR_HEIGHT = 11;
const STACKED_BAR_WIDTH = 100; const STACKED_BAR_WIDTH = 100;
/* this is defined outside of the class so we can use it in connect() */ /* this is defined outside of the class so we can use it in connect() */
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
function _currentLabelAsString(ownProps: any) { function _currentLabelAsString(ownProps: any) {
const { label } = ownProps; const { label } = ownProps;
// when called as a function, the String() constructor performs type conversion, // when called as a function, the String() constructor performs type conversion,
@@ -37,6 +38,7 @@ function _currentLabelAsString(ownProps: any) {
return String(label); return String(label);
} }
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
type State = any; type State = any;
// @ts-expect-error ts-migrate(1238) FIXME: Unable to resolve signature of class decorator whe... Remove this comment to see the full error message // @ts-expect-error ts-migrate(1238) FIXME: Unable to resolve signature of class decorator whe... Remove this comment to see the full error message
@@ -54,14 +56,18 @@ type State = any;
const isSelected = category.get(label) ?? true; const isSelected = category.get(label) ?? true;
return { return {
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
annotations: (state as any).annotations, annotations: (state as any).annotations,
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
schema: (state as any).annoMatrix?.schema, schema: (state as any).annoMatrix?.schema,
isDilated, isDilated,
isSelected, isSelected,
label, label,
}; };
}) })
// eslint-disable-next-line @typescript-eslint/ban-types --- FIXME: disabled temporarily on migrate to TS.
class CategoryValue extends React.Component<{}, State> { class CategoryValue extends React.Component<{}, State> {
// eslint-disable-next-line @typescript-eslint/ban-types --- FIXME: disabled temporarily on migrate to TS.
constructor(props: {}) { constructor(props: {}) {
super(props); super(props);
this.state = { this.state = {
@@ -69,12 +75,15 @@ class CategoryValue extends React.Component<{}, State> {
}; };
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/ban-types --- FIXME: disabled temporarily on migrate to TS.
componentDidUpdate(prevProps: {}) { componentDidUpdate(prevProps: {}) {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'metadataField' does not exist on type 'R... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'metadataField' does not exist on type 'R... Remove this comment to see the full error message
const { metadataField, categoryIndex, categorySummary } = this.props; const { metadataField, categoryIndex, categorySummary } = this.props;
if ( if (
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
(prevProps as any).metadataField !== metadataField || (prevProps as any).metadataField !== metadataField ||
(prevProps as any).categoryIndex !== categoryIndex || // eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
(prevProps as any).categoryIndex !== categoryIndex || // eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
(prevProps as any).categorySummary !== categorySummary (prevProps as any).categorySummary !== categorySummary
) { ) {
// eslint-disable-next-line react/no-did-update-set-state --- adequately checked to prevent looping // eslint-disable-next-line react/no-did-update-set-state --- adequately checked to prevent looping
@@ -85,6 +94,7 @@ class CategoryValue extends React.Component<{}, State> {
} }
// If coloring by and this isn't the colorAccessor and it isn't being edited // If coloring by and this isn't the colorAccessor and it isn't being edited
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
get shouldRenderStackedBarOrHistogram() { get shouldRenderStackedBarOrHistogram() {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'colorAccessor' does not exist on type 'R... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'colorAccessor' does not exist on type 'R... Remove this comment to see the full error message
const { colorAccessor, isColorBy, annotations } = this.props; const { colorAccessor, isColorBy, annotations } = this.props;
@@ -92,18 +102,21 @@ class CategoryValue extends React.Component<{}, State> {
return !!colorAccessor && !isColorBy && !annotations.isEditingLabelName; return !!colorAccessor && !isColorBy && !annotations.isEditingLabelName;
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
handleDeleteValue = () => { handleDeleteValue = () => {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'dispatch' does not exist on type 'Readon... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'dispatch' does not exist on type 'Readon... Remove this comment to see the full error message
const { dispatch, metadataField, label } = this.props; const { dispatch, metadataField, label } = this.props;
dispatch(actions.annotationDeleteLabelFromCategory(metadataField, label)); dispatch(actions.annotationDeleteLabelFromCategory(metadataField, label));
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
handleAddCurrentSelectionToThisLabel = () => { handleAddCurrentSelectionToThisLabel = () => {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'dispatch' does not exist on type 'Readon... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'dispatch' does not exist on type 'Readon... Remove this comment to see the full error message
const { dispatch, metadataField, label } = this.props; const { dispatch, metadataField, label } = this.props;
dispatch(actions.annotationLabelCurrentSelection(metadataField, label)); dispatch(actions.annotationLabelCurrentSelection(metadataField, label));
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
handleEditValue = (e: any) => { handleEditValue = (e: any) => {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'dispatch' does not exist on type 'Readon... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'dispatch' does not exist on type 'Readon... Remove this comment to see the full error message
const { dispatch, metadataField, label } = this.props; const { dispatch, metadataField, label } = this.props;
@@ -119,6 +132,7 @@ class CategoryValue extends React.Component<{}, State> {
e.preventDefault(); e.preventDefault();
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
handleCreateArbitraryLabel = (txt: any) => { handleCreateArbitraryLabel = (txt: any) => {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'dispatch' does not exist on type 'Readon... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'dispatch' does not exist on type 'Readon... Remove this comment to see the full error message
const { dispatch, metadataField, label } = this.props; const { dispatch, metadataField, label } = this.props;
@@ -128,6 +142,7 @@ class CategoryValue extends React.Component<{}, State> {
); );
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
labelNameError = (name: any) => { labelNameError = (name: any) => {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'metadataField' does not exist on type 'R... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'metadataField' does not exist on type 'R... Remove this comment to see the full error message
const { metadataField, schema } = this.props; const { metadataField, schema } = this.props;
@@ -135,10 +150,12 @@ class CategoryValue extends React.Component<{}, State> {
return isLabelErroneous(name, metadataField, schema); return isLabelErroneous(name, metadataField, schema);
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
instruction = (label: any) => { instruction = (label: any) => {
return labelPrompt(this.labelNameError(label), "New, unique label", ":"); return labelPrompt(this.labelNameError(label), "New, unique label", ":");
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
activateEditLabelMode = () => { activateEditLabelMode = () => {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'dispatch' does not exist on type 'Readon... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'dispatch' does not exist on type 'Readon... Remove this comment to see the full error message
const { dispatch, metadataField, categoryIndex, label } = this.props; const { dispatch, metadataField, categoryIndex, label } = this.props;
@@ -150,6 +167,7 @@ class CategoryValue extends React.Component<{}, State> {
}); });
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
cancelEditMode = () => { cancelEditMode = () => {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'dispatch' does not exist on type 'Readon... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'dispatch' does not exist on type 'Readon... Remove this comment to see the full error message
const { dispatch, metadataField, categoryIndex, label } = this.props; const { dispatch, metadataField, categoryIndex, label } = this.props;
@@ -164,6 +182,7 @@ class CategoryValue extends React.Component<{}, State> {
}); });
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
toggleOff = () => { toggleOff = () => {
const { const {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'dispatch' does not exist on type 'Readon... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'dispatch' does not exist on type 'Readon... Remove this comment to see the full error message
@@ -187,6 +206,7 @@ class CategoryValue extends React.Component<{}, State> {
); );
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
shouldComponentUpdate = (nextProps: any, nextState: any) => { shouldComponentUpdate = (nextProps: any, nextState: any) => {
/* /*
Checks to see if at least one of the following changed: Checks to see if at least one of the following changed:
@@ -212,10 +232,13 @@ class CategoryValue extends React.Component<{}, State> {
const valueSelectionChange = isSelected !== newIsSelected; const valueSelectionChange = isSelected !== newIsSelected;
const colorAccessorChange = const colorAccessorChange =
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
(props as any).colorAccessor !== nextProps.colorAccessor; (props as any).colorAccessor !== nextProps.colorAccessor;
const annotationsChange = const annotationsChange =
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
(props as any).annotations !== nextProps.annotations; (props as any).annotations !== nextProps.annotations;
const editingLabel = state.editedLabelText !== nextState.editedLabelText; const editingLabel = state.editedLabelText !== nextState.editedLabelText;
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
const dilationChange = (props as any).isDilated !== nextProps.isDilated; const dilationChange = (props as any).isDilated !== nextProps.isDilated;
const count = categorySummary.categoryValueCounts[categoryIndex]; const count = categorySummary.categoryValueCounts[categoryIndex];
@@ -227,6 +250,7 @@ class CategoryValue extends React.Component<{}, State> {
// if any one changes, but only for the currently colored-by category. // if any one changes, but only for the currently colored-by category.
const colorMightHaveChanged = const colorMightHaveChanged =
nextProps.colorAccessor === nextProps.metadataField && nextProps.colorAccessor === nextProps.metadataField &&
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
(props as any).categorySummary !== nextProps.categorySummary; (props as any).categorySummary !== nextProps.categorySummary;
return ( return (
@@ -241,6 +265,7 @@ class CategoryValue extends React.Component<{}, State> {
); );
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
toggleOn = () => { toggleOn = () => {
const { const {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'dispatch' does not exist on type 'Readon... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'dispatch' does not exist on type 'Readon... Remove this comment to see the full error message
@@ -264,6 +289,7 @@ class CategoryValue extends React.Component<{}, State> {
); );
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
handleMouseEnter = () => { handleMouseEnter = () => {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'dispatch' does not exist on type 'Readon... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'dispatch' does not exist on type 'Readon... Remove this comment to see the full error message
const { dispatch, metadataField, categoryIndex, label } = this.props; const { dispatch, metadataField, categoryIndex, label } = this.props;
@@ -275,6 +301,7 @@ class CategoryValue extends React.Component<{}, State> {
}); });
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
handleMouseExit = () => { handleMouseExit = () => {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'dispatch' does not exist on type 'Readon... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'dispatch' does not exist on type 'Readon... Remove this comment to see the full error message
const { dispatch, metadataField, categoryIndex, label } = this.props; const { dispatch, metadataField, categoryIndex, label } = this.props;
@@ -286,23 +313,33 @@ class CategoryValue extends React.Component<{}, State> {
}); });
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
handleTextChange = (text: any) => { handleTextChange = (text: any) => {
this.setState({ editedLabelText: text }); this.setState({ editedLabelText: text });
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
handleChoice = (e: any) => { handleChoice = (e: any) => {
/* Blueprint Suggest format */ /* Blueprint Suggest format */
this.setState({ editedLabelText: e.target }); this.setState({ editedLabelText: e.target });
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
createHistogramBins = ( createHistogramBins = (
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
metadataField: any, metadataField: any,
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
categoryData: any, categoryData: any,
// @ts-expect-error ts-migrate(6133) FIXME: 'colorAccessor' is declared but its value is never... Remove this comment to see the full error message // @ts-expect-error ts-migrate(6133) FIXME: 'colorAccessor' is declared but its value is never... Remove this comment to see the full error message
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
colorAccessor: any, colorAccessor: any,
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
colorData: any, colorData: any,
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
categoryValue: any, categoryValue: any,
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
width: any, width: any,
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
height: any height: any
) => { ) => {
/* /*
@@ -337,15 +374,24 @@ class CategoryValue extends React.Component<{}, State> {
}; };
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
createStackedGraphBins = ( createStackedGraphBins = (
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
metadataField: any, metadataField: any,
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
categoryData: any, categoryData: any,
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
colorAccessor: any, colorAccessor: any,
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
colorData: any, colorData: any,
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
categoryValue: any, categoryValue: any,
// @ts-expect-error ts-migrate(6133) FIXME: 'colorTable' is declared but its value is never re... Remove this comment to see the full error message // @ts-expect-error ts-migrate(6133) FIXME: 'colorTable' is declared but its value is never re... Remove this comment to see the full error message
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
colorTable: any, colorTable: any,
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
schema: any, schema: any,
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
width: any width: any
) => { ) => {
/* /*
@@ -383,10 +429,12 @@ class CategoryValue extends React.Component<{}, State> {
return null; return null;
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
currentLabelAsString() { currentLabelAsString() {
return _currentLabelAsString(this.props); return _currentLabelAsString(this.props);
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
isAddCurrentSelectionDisabled(crossfilter: any, category: any, value: any) { isAddCurrentSelectionDisabled(crossfilter: any, category: any, value: any) {
/* /*
disable "add current selection to label", if one of the following is true: disable "add current selection to label", if one of the following is true:
@@ -411,6 +459,7 @@ class CategoryValue extends React.Component<{}, State> {
return false; return false;
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
renderMiniStackedBar = () => { renderMiniStackedBar = () => {
const { const {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'colorAccessor' does not exist on type 'R... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'colorAccessor' does not exist on type 'R... Remove this comment to see the full error message
@@ -470,6 +519,7 @@ class CategoryValue extends React.Component<{}, State> {
); );
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
renderMiniHistogram = () => { renderMiniHistogram = () => {
const { const {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'colorAccessor' does not exist on type 'R... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'colorAccessor' does not exist on type 'R... Remove this comment to see the full error message
@@ -528,6 +578,7 @@ class CategoryValue extends React.Component<{}, State> {
); );
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
render() { render() {
const { const {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'metadataField' does not exist on type 'R... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'metadataField' does not exist on type 'R... Remove this comment to see the full error message
@@ -10,15 +10,18 @@ import {
// @ts-expect-error ts-migrate(1238) FIXME: Unable to resolve signature of class decorator whe... Remove this comment to see the full error message // @ts-expect-error ts-migrate(1238) FIXME: Unable to resolve signature of class decorator whe... Remove this comment to see the full error message
@connect((state) => ({ @connect((state) => ({
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
schema: (state as any).annoMatrix?.schema, schema: (state as any).annoMatrix?.schema,
})) }))
class Occupancy extends React.PureComponent { class Occupancy extends React.PureComponent {
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
canvas: any; canvas: any;
_WIDTH = 100; _WIDTH = 100;
_HEIGHT = 11; _HEIGHT = 11;
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
createHistogram = () => { createHistogram = () => {
/* /*
Knowing that colorScale is based off continous data, Knowing that colorScale is based off continous data,
@@ -68,6 +71,7 @@ class Occupancy extends React.PureComponent {
} }
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
createOccupancyStack = () => { createOccupancyStack = () => {
/* /*
Knowing that the color scale is based off of catagorical data, Knowing that the color scale is based off of catagorical data,
@@ -126,6 +130,7 @@ class Occupancy extends React.PureComponent {
} }
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
render() { render() {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'colorAccessor' does not exist on type 'R... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'colorAccessor' does not exist on type 'R... Remove this comment to see the full error message
const { colorAccessor, categoryValue, colorByIsCategorical } = this.props; const { colorAccessor, categoryValue, colorByIsCategorical } = this.props;
@@ -6,9 +6,11 @@ import HistogramBrush from "../brushableHistogram";
// @ts-expect-error ts-migrate(1238) FIXME: Unable to resolve signature of class decorator whe... Remove this comment to see the full error message // @ts-expect-error ts-migrate(1238) FIXME: Unable to resolve signature of class decorator whe... Remove this comment to see the full error message
@connect((state) => ({ @connect((state) => ({
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
schema: (state as any).annoMatrix?.schema, schema: (state as any).annoMatrix?.schema,
})) }))
class Continuous extends React.PureComponent { class Continuous extends React.PureComponent {
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
render() { render() {
/* initial value for iterator to simulate index, ranges is an object */ /* initial value for iterator to simulate index, ranges is an object */
// @ts-expect-error ts-migrate(2339) FIXME: Property 'schema' does not exist on type 'Readonly... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'schema' does not exist on type 'Readonly... Remove this comment to see the full error message
@@ -16,12 +18,17 @@ class Continuous extends React.PureComponent {
if (!schema) return null; if (!schema) return null;
const obsIndex = schema.annotations.obs.index; const obsIndex = schema.annotations.obs.index;
const allContinuousNames = schema.annotations.obs.columns const allContinuousNames = schema.annotations.obs.columns
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
.filter((col: any) => col.type === "int32" || col.type === "float32") .filter((col: any) => col.type === "int32" || col.type === "float32")
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
.filter((col: any) => col.name !== obsIndex) .filter((col: any) => col.name !== obsIndex)
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
.filter((col: any) => !col.writable) // skip user annotations - they will be treated as categorical .filter((col: any) => !col.writable) // skip user annotations - they will be treated as categorical
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
.map((col: any) => col.name); .map((col: any) => col.name);
return ( return (
<div> <div>
{/* eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS. */}
{allContinuousNames.map((key: any, zebra: any) => ( {allContinuousNames.map((key: any, zebra: any) => (
// @ts-expect-error ts-migrate(2769) FIXME: No overload matches this call. // @ts-expect-error ts-migrate(2769) FIXME: No overload matches this call.
<HistogramBrush key={key} field={key} isObs zebra={zebra % 2 === 0} /> <HistogramBrush key={key} field={key} isObs zebra={zebra % 2 === 0} />
@@ -5,6 +5,7 @@
******************************************/ ******************************************/
import * as d3 from "d3"; import * as d3 from "d3";
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
const setupParallelCoordinates = (width: any, height: any, margin: any) => { const setupParallelCoordinates = (width: any, height: any, margin: any) => {
const container = d3.select("#parcoords"); const container = d3.select("#parcoords");
+7
View File
@@ -12,13 +12,16 @@ export const innerHeight = height - 2;
export const devicePixelRatio = window.devicePixelRatio || 1; export const devicePixelRatio = window.devicePixelRatio || 1;
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
export const createDimensions = (data: any) => { export const createDimensions = (data: any) => {
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
const newArr: any = []; const newArr: any = [];
each(data, (value, key) => { each(data, (value, key) => {
if (value.range) { if (value.range) {
newArr.push({ newArr.push({
key /* room for confusion: lodash calls this key, it's also the name of the property parallel coords code is looking for */, key /* room for confusion: lodash calls this key, it's also the name of the property parallel coords code is looking for */,
type: { type: {
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
within: (d: any, extent: any, dim: any) => within: (d: any, extent: any, dim: any) =>
extent[0] <= dim.scale(d) && dim.scale(d) <= extent[1], extent[0] <= dim.scale(d) && dim.scale(d) <= extent[1],
}, },
@@ -35,13 +38,17 @@ export const createDimensions = (data: any) => {
// @ts-expect-error ts-migrate(2554) FIXME: Expected 1 arguments, but got 0. // @ts-expect-error ts-migrate(2554) FIXME: Expected 1 arguments, but got 0.
export const yAxis = d3.axisLeft(); export const yAxis = d3.axisLeft();
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
export const brushstart = () => { export const brushstart = () => {
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
(d3 as any).event.sourceEvent.stopPropagation(); (d3 as any).event.sourceEvent.stopPropagation();
}; };
// Unused. // Unused.
// export const d3_functor = v => (typeof v === "function" ? v : () => v); // export const d3_functor = v => (typeof v === "function" ? v : () => v);
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
export const project = (d: any, dimensions: any, xscale: any) => export const project = (d: any, dimensions: any, xscale: any) =>
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
dimensions.map((p: any, i: any) => { dimensions.map((p: any, i: any) => {
// check if data element has property and contains a value // check if data element has property and contains a value
if (!(p.key in d) || d[p.key] === null) return null; if (!(p.key in d) || d[p.key] === null) return null;
@@ -9,6 +9,7 @@ import {
} from "../../util/stateManager/colorHelpers"; } from "../../util/stateManager/colorHelpers";
// create continuous color legend // create continuous color legend
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
const continuous = (selectorId: any, colorScale: any, colorAccessor: any) => { const continuous = (selectorId: any, colorScale: any, colorAccessor: any) => {
const legendHeight = 200; const legendHeight = 200;
const legendWidth = 80; const legendWidth = 80;
@@ -110,11 +111,15 @@ const continuous = (selectorId: any, colorScale: any, colorAccessor: any) => {
// @ts-expect-error ts-migrate(1238) FIXME: Unable to resolve signature of class decorator whe... Remove this comment to see the full error message // @ts-expect-error ts-migrate(1238) FIXME: Unable to resolve signature of class decorator whe... Remove this comment to see the full error message
@connect((state) => ({ @connect((state) => ({
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
annoMatrix: (state as any).annoMatrix, annoMatrix: (state as any).annoMatrix,
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
colors: (state as any).colors, colors: (state as any).colors,
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
genesets: (state as any).genesets.genesets, genesets: (state as any).genesets.genesets,
})) }))
class ContinuousLegend extends React.Component { class ContinuousLegend extends React.Component {
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
async componentDidUpdate(prevProps: any) { async componentDidUpdate(prevProps: any) {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'annoMatrix' does not exist on type 'Read... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'annoMatrix' does not exist on type 'Read... Remove this comment to see the full error message
const { annoMatrix, colors, genesets } = this.props; const { annoMatrix, colors, genesets } = this.props;
@@ -157,6 +162,7 @@ class ContinuousLegend extends React.Component {
} }
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
render() { render() {
return ( return (
<div <div
+13
View File
@@ -15,28 +15,36 @@ import * as globals from "../../globals";
import actions from "../../actions"; import actions from "../../actions";
import { getDiscreteCellEmbeddingRowIndex } from "../../util/stateManager/viewStackHelpers"; import { getDiscreteCellEmbeddingRowIndex } from "../../util/stateManager/viewStackHelpers";
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
type EmbeddingState = any; type EmbeddingState = any;
// @ts-expect-error ts-migrate(1238) FIXME: Unable to resolve signature of class decorator whe... Remove this comment to see the full error message // @ts-expect-error ts-migrate(1238) FIXME: Unable to resolve signature of class decorator whe... Remove this comment to see the full error message
@connect((state) => { @connect((state) => {
return { return {
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
layoutChoice: (state as any).layoutChoice, layoutChoice: (state as any).layoutChoice,
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
schema: (state as any).annoMatrix?.schema, schema: (state as any).annoMatrix?.schema,
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
crossfilter: (state as any).obsCrossfilter, crossfilter: (state as any).obsCrossfilter,
}; };
}) })
// eslint-disable-next-line @typescript-eslint/ban-types --- FIXME: disabled temporarily on migrate to TS.
class Embedding extends React.PureComponent<{}, EmbeddingState> { class Embedding extends React.PureComponent<{}, EmbeddingState> {
// eslint-disable-next-line @typescript-eslint/ban-types --- FIXME: disabled temporarily on migrate to TS.
constructor(props: {}) { constructor(props: {}) {
super(props); super(props);
this.state = {}; this.state = {};
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
handleLayoutChoiceChange = (e: any) => { handleLayoutChoiceChange = (e: any) => {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'dispatch' does not exist on type 'Readon... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'dispatch' does not exist on type 'Readon... Remove this comment to see the full error message
const { dispatch } = this.props; const { dispatch } = this.props;
dispatch(actions.layoutChoiceAction(e.currentTarget.value)); dispatch(actions.layoutChoiceAction(e.currentTarget.value));
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
render() { render() {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'layoutChoice' does not exist on type 'Re... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'layoutChoice' does not exist on type 'Re... Remove this comment to see the full error message
const { layoutChoice, schema, crossfilter } = this.props; const { layoutChoice, schema, crossfilter } = this.props;
@@ -105,8 +113,10 @@ class Embedding extends React.PureComponent<{}, EmbeddingState> {
export default Embedding; export default Embedding;
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
const loadAllEmbeddingCounts = async ({ annoMatrix, available }: any) => { const loadAllEmbeddingCounts = async ({ annoMatrix, available }: any) => {
const embeddings = await Promise.all( const embeddings = await Promise.all(
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
available.map((name: any) => annoMatrix.base().fetch("emb", name)) available.map((name: any) => annoMatrix.base().fetch("emb", name))
); );
// @ts-expect-error ts-migrate(7006) FIXME: Parameter 'name' implicitly has an 'any' type. // @ts-expect-error ts-migrate(7006) FIXME: Parameter 'name' implicitly has an 'any' type.
@@ -117,6 +127,7 @@ const loadAllEmbeddingCounts = async ({ annoMatrix, available }: any) => {
})); }));
}; };
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
const EmbeddingChoices = ({ onChange, annoMatrix, layoutChoice }: any) => { const EmbeddingChoices = ({ onChange, annoMatrix, layoutChoice }: any) => {
const { available } = layoutChoice; const { available } = layoutChoice;
const { data, error, isPending } = useAsync({ const { data, error, isPending } = useAsync({
@@ -133,6 +144,7 @@ const EmbeddingChoices = ({ onChange, annoMatrix, layoutChoice }: any) => {
/* still loading, or errored out - just omit counts (TODO: spinner?) */ /* still loading, or errored out - just omit counts (TODO: spinner?) */
return ( return (
<RadioGroup onChange={onChange} selectedValue={layoutChoice.current}> <RadioGroup onChange={onChange} selectedValue={layoutChoice.current}>
{/* eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS. */}
{layoutChoice.available.map((name: any) => ( {layoutChoice.available.map((name: any) => (
<Radio label={`${name}`} value={name} key={name} /> <Radio label={`${name}`} value={name} key={name} />
))} ))}
@@ -142,6 +154,7 @@ const EmbeddingChoices = ({ onChange, annoMatrix, layoutChoice }: any) => {
if (data) { if (data) {
return ( return (
<RadioGroup onChange={onChange} selectedValue={layoutChoice.current}> <RadioGroup onChange={onChange} selectedValue={layoutChoice.current}>
{/* eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS. */}
{data.map((summary: any) => { {data.map((summary: any) => {
const { discreteCellIndex, embeddingName } = summary; const { discreteCellIndex, embeddingName } = summary;
const sizeHint = `${discreteCellIndex.size()} cells`; const sizeHint = `${discreteCellIndex.size()} cells`;
@@ -1,5 +1,6 @@
import React from "react"; import React from "react";
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
function Container(props: any) { function Container(props: any) {
const { children } = props; const { children } = props;
return ( return (
@@ -2,6 +2,7 @@ import React from "react";
import * as globals from "../../globals"; import * as globals from "../../globals";
class Layout extends React.Component { class Layout extends React.Component {
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
viewportRef: any; viewportRef: any;
/* /*
Layout - this react component contains all the layout style and logic for the application once it has loaded. Layout - this react component contains all the layout style and logic for the application once it has loaded.
@@ -14,6 +15,7 @@ class Layout extends React.Component {
should be. should be.
*/ */
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
componentDidMount() { componentDidMount() {
/* /*
This is a bit of a hack. In order for the graph to size correctly, it needs to know the size of the parent This is a bit of a hack. In order for the graph to size correctly, it needs to know the size of the parent
@@ -22,6 +24,7 @@ class Layout extends React.Component {
this.forceUpdate(); this.forceUpdate();
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
render() { render() {
const { children } = this.props; const { children } = this.props;
// @ts-expect-error ts-migrate(2488) FIXME: Type 'ReactNode' must have a '[Symbol.iterator]()'... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2488) FIXME: Type 'ReactNode' must have a '[Symbol.iterator]()'... Remove this comment to see the full error message
+1
View File
@@ -1,6 +1,7 @@
import React from "react"; import React from "react";
import * as globals from "../../globals"; import * as globals from "../../globals";
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
const Logo = (props: any) => { const Logo = (props: any) => {
const { size } = props; const { size } = props;
return ( return (
@@ -11,6 +11,7 @@ const ToastTopCenter = Toaster.create({
/* /*
A "user" error - eg, bad input A "user" error - eg, bad input
*/ */
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
export const postUserErrorToast = (message: any) => export const postUserErrorToast = (message: any) =>
ToastTopCenter.show({ message, intent: Intent.WARNING }); ToastTopCenter.show({ message, intent: Intent.WARNING });
@@ -18,12 +19,14 @@ export const postUserErrorToast = (message: any) =>
A toast the user must dismiss manually, because they need to act on its information, A toast the user must dismiss manually, because they need to act on its information,
ie., 8 bulk add genes out of 40 were bad. Manually see which ones and fix. ie., 8 bulk add genes out of 40 were bad. Manually see which ones and fix.
*/ */
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
export const keepAroundErrorToast = (message: any) => export const keepAroundErrorToast = (message: any) =>
ToastTopCenter.show({ message, timeout: 0, intent: Intent.WARNING }); ToastTopCenter.show({ message, timeout: 0, intent: Intent.WARNING });
/* /*
a hard network error a hard network error
*/ */
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
export const postNetworkErrorToast = (message: any, key = undefined) => export const postNetworkErrorToast = (message: any, key = undefined) =>
ToastTopCenter.show( ToastTopCenter.show(
{ {
@@ -37,6 +40,7 @@ export const postNetworkErrorToast = (message: any, key = undefined) =>
/* /*
Async message to user Async message to user
*/ */
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
export const postAsyncSuccessToast = (message: any) => export const postAsyncSuccessToast = (message: any) =>
ToastTopCenter.show({ ToastTopCenter.show({
message, message,
@@ -44,6 +48,7 @@ export const postAsyncSuccessToast = (message: any) =>
intent: Intent.SUCCESS, intent: Intent.SUCCESS,
}); });
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
export const postAsyncFailureToast = (message: any) => export const postAsyncFailureToast = (message: any) =>
ToastTopCenter.show({ ToastTopCenter.show({
message, message,
@@ -9,6 +9,7 @@ import actions from "../../actions";
const MINI_HISTOGRAM_WIDTH = 110; const MINI_HISTOGRAM_WIDTH = 110;
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
type State = any; type State = any;
// @ts-expect-error ts-migrate(1238) FIXME: Unable to resolve signature of class decorator whe... Remove this comment to see the full error message // @ts-expect-error ts-migrate(1238) FIXME: Unable to resolve signature of class decorator whe... Remove this comment to see the full error message
@@ -17,14 +18,19 @@ type State = any;
const { gene } = ownProps; const { gene } = ownProps;
return { return {
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
isColorAccessor: (state as any).colors.colorAccessor === gene, isColorAccessor: (state as any).colors.colorAccessor === gene,
isScatterplotXXaccessor: isScatterplotXXaccessor:
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
(state as any).controls.scatterplotXXaccessor === gene, (state as any).controls.scatterplotXXaccessor === gene,
isScatterplotYYaccessor: isScatterplotYYaccessor:
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
(state as any).controls.scatterplotYYaccessor === gene, (state as any).controls.scatterplotYYaccessor === gene,
}; };
}) })
// eslint-disable-next-line @typescript-eslint/ban-types --- FIXME: disabled temporarily on migrate to TS.
class Gene extends React.Component<{}, State> { class Gene extends React.Component<{}, State> {
// eslint-disable-next-line @typescript-eslint/ban-types --- FIXME: disabled temporarily on migrate to TS.
constructor(props: {}) { constructor(props: {}) {
super(props); super(props);
this.state = { this.state = {
@@ -32,17 +38,20 @@ class Gene extends React.Component<{}, State> {
}; };
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
onColorChangeClick = () => { onColorChangeClick = () => {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'dispatch' does not exist on type 'Readon... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'dispatch' does not exist on type 'Readon... Remove this comment to see the full error message
const { dispatch, gene } = this.props; const { dispatch, gene } = this.props;
dispatch(actions.requestSingleGeneExpressionCountsForColoringPOST(gene)); dispatch(actions.requestSingleGeneExpressionCountsForColoringPOST(gene));
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
handleGeneExpandClick = () => { handleGeneExpandClick = () => {
const { geneIsExpanded } = this.state; const { geneIsExpanded } = this.state;
this.setState({ geneIsExpanded: !geneIsExpanded }); this.setState({ geneIsExpanded: !geneIsExpanded });
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
handleSetGeneAsScatterplotX = () => { handleSetGeneAsScatterplotX = () => {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'dispatch' does not exist on type 'Readon... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'dispatch' does not exist on type 'Readon... Remove this comment to see the full error message
const { dispatch, gene } = this.props; const { dispatch, gene } = this.props;
@@ -52,6 +61,7 @@ class Gene extends React.Component<{}, State> {
}); });
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
handleSetGeneAsScatterplotY = () => { handleSetGeneAsScatterplotY = () => {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'dispatch' does not exist on type 'Readon... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'dispatch' does not exist on type 'Readon... Remove this comment to see the full error message
const { dispatch, gene } = this.props; const { dispatch, gene } = this.props;
@@ -61,12 +71,14 @@ class Gene extends React.Component<{}, State> {
}); });
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
handleDeleteGeneFromSet = () => { handleDeleteGeneFromSet = () => {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'dispatch' does not exist on type 'Readon... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'dispatch' does not exist on type 'Readon... Remove this comment to see the full error message
const { dispatch, gene, geneset } = this.props; const { dispatch, gene, geneset } = this.props;
dispatch(actions.genesetDeleteGenes(geneset, [gene])); dispatch(actions.genesetDeleteGenes(geneset, [gene]));
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
render() { render() {
const { const {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'gene' does not exist on type 'Readonly<{... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'gene' does not exist on type 'Readonly<{... Remove this comment to see the full error message
@@ -9,9 +9,12 @@ import HistogramBrush from "../brushableHistogram";
import { diffexpPopNamePrefix1, diffexpPopNamePrefix2 } from "../../globals"; import { diffexpPopNamePrefix1, diffexpPopNamePrefix2 } from "../../globals";
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
type State = any; type State = any;
// eslint-disable-next-line @typescript-eslint/ban-types --- FIXME: disabled temporarily on migrate to TS.
class GeneSet extends React.Component<{}, State> { class GeneSet extends React.Component<{}, State> {
// eslint-disable-next-line @typescript-eslint/ban-types --- FIXME: disabled temporarily on migrate to TS.
constructor(props: {}) { constructor(props: {}) {
super(props); super(props);
this.state = { this.state = {
@@ -19,11 +22,13 @@ class GeneSet extends React.Component<{}, State> {
}; };
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
onGenesetMenuClick = () => { onGenesetMenuClick = () => {
const { isOpen } = this.state; const { isOpen } = this.state;
this.setState({ isOpen: !isOpen }); this.setState({ isOpen: !isOpen });
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
renderGenes() { renderGenes() {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'setName' does not exist on type 'Readonl... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'setName' does not exist on type 'Readonl... Remove this comment to see the full error message
const { setName, setGenes } = this.props; const { setName, setGenes } = this.props;
@@ -46,6 +51,7 @@ class GeneSet extends React.Component<{}, State> {
); );
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
render() { render() {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'setName' does not exist on type 'Readonl... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'setName' does not exist on type 'Readonl... Remove this comment to see the full error message
const { setName, genesetDescription, setGenes } = this.props; const { setName, genesetDescription, setGenes } = this.props;
@@ -7,20 +7,25 @@ import GeneSet from "./geneSet";
import QuickGene from "./quickGene"; import QuickGene from "./quickGene";
import CreateGenesetDialogue from "./menus/createGenesetDialogue"; import CreateGenesetDialogue from "./menus/createGenesetDialogue";
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
type State = any; type State = any;
// @ts-expect-error ts-migrate(1238) FIXME: Unable to resolve signature of class decorator whe... Remove this comment to see the full error message // @ts-expect-error ts-migrate(1238) FIXME: Unable to resolve signature of class decorator whe... Remove this comment to see the full error message
@connect((state) => { @connect((state) => {
return { return {
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
genesets: (state as any).genesets.genesets, genesets: (state as any).genesets.genesets,
}; };
}) })
// eslint-disable-next-line @typescript-eslint/ban-types --- FIXME: disabled temporarily on migrate to TS.
class GeneExpression extends React.Component<{}, State> { class GeneExpression extends React.Component<{}, State> {
// eslint-disable-next-line @typescript-eslint/ban-types --- FIXME: disabled temporarily on migrate to TS.
constructor(props: {}) { constructor(props: {}) {
super(props); super(props);
this.state = { geneSetsExpanded: true }; this.state = { geneSetsExpanded: true };
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
renderGeneSets = () => { renderGeneSets = () => {
const sets = []; const sets = [];
// @ts-expect-error ts-migrate(2339) FIXME: Property 'genesets' does not exist on type 'Readon... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'genesets' does not exist on type 'Readon... Remove this comment to see the full error message
@@ -40,24 +45,29 @@ class GeneExpression extends React.Component<{}, State> {
return sets; return sets;
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
handleActivateCreateGenesetMode = () => { handleActivateCreateGenesetMode = () => {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'dispatch' does not exist on type 'Readon... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'dispatch' does not exist on type 'Readon... Remove this comment to see the full error message
const { dispatch } = this.props; const { dispatch } = this.props;
const { geneSetsExpanded } = this.state; const { geneSetsExpanded } = this.state;
dispatch({ type: "geneset: activate add new geneset mode" }); dispatch({ type: "geneset: activate add new geneset mode" });
if (!geneSetsExpanded) { if (!geneSetsExpanded) {
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
this.setState((state: any) => { this.setState((state: any) => {
return { ...state, geneSetsExpanded: true }; return { ...state, geneSetsExpanded: true };
}); });
} }
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
handleExpandGeneSets = () => { handleExpandGeneSets = () => {
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
this.setState((state: any) => { this.setState((state: any) => {
return { ...state, geneSetsExpanded: !state.geneSetsExpanded }; return { ...state, geneSetsExpanded: !state.geneSetsExpanded };
}); });
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
render() { render() {
const { geneSetsExpanded } = this.state; const { geneSetsExpanded } = this.state;
return ( return (
@@ -5,13 +5,17 @@ import LabelInput from "../../labelInput";
import parseBulkGeneString from "../../../util/parseBulkGeneString"; import parseBulkGeneString from "../../../util/parseBulkGeneString";
import actions from "../../../actions"; import actions from "../../../actions";
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
type State = any; type State = any;
// @ts-expect-error ts-migrate(1238) FIXME: Unable to resolve signature of class decorator whe... Remove this comment to see the full error message // @ts-expect-error ts-migrate(1238) FIXME: Unable to resolve signature of class decorator whe... Remove this comment to see the full error message
@connect((state) => ({ @connect((state) => ({
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
genesetsUI: (state as any).genesetsUI, genesetsUI: (state as any).genesetsUI,
})) }))
// eslint-disable-next-line @typescript-eslint/ban-types --- FIXME: disabled temporarily on migrate to TS.
class AddGeneToGenesetDialogue extends React.PureComponent<{}, State> { class AddGeneToGenesetDialogue extends React.PureComponent<{}, State> {
// eslint-disable-next-line @typescript-eslint/ban-types --- FIXME: disabled temporarily on migrate to TS.
constructor(props: {}) { constructor(props: {}) {
super(props); super(props);
this.state = { this.state = {
@@ -19,6 +23,7 @@ class AddGeneToGenesetDialogue extends React.PureComponent<{}, State> {
}; };
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
disableAddGeneMode = () => { disableAddGeneMode = () => {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'dispatch' does not exist on type 'Readon... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'dispatch' does not exist on type 'Readon... Remove this comment to see the full error message
const { dispatch } = this.props; const { dispatch } = this.props;
@@ -27,10 +32,12 @@ class AddGeneToGenesetDialogue extends React.PureComponent<{}, State> {
}); });
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
handleAddGeneToGeneSet = (e: any) => { handleAddGeneToGeneSet = (e: any) => {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'geneset' does not exist on type 'Readonl... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'geneset' does not exist on type 'Readonl... Remove this comment to see the full error message
const { geneset, dispatch } = this.props; const { geneset, dispatch } = this.props;
const { genesToAdd } = this.state; const { genesToAdd } = this.state;
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
const genesTmpHardcodedFormat: any = []; const genesTmpHardcodedFormat: any = [];
const genesArrayFromString = parseBulkGeneString(genesToAdd); const genesArrayFromString = parseBulkGeneString(genesToAdd);
genesArrayFromString.forEach((_gene) => { genesArrayFromString.forEach((_gene) => {
@@ -45,10 +52,12 @@ class AddGeneToGenesetDialogue extends React.PureComponent<{}, State> {
if (e) e.preventDefault(); if (e) e.preventDefault();
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
handleChange = (e: any) => { handleChange = (e: any) => {
this.setState({ genesToAdd: e }); this.setState({ genesToAdd: e });
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
render() { render() {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'geneset' does not exist on type 'Readonl... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'geneset' does not exist on type 'Readonl... Remove this comment to see the full error message
const { geneset, genesetsUI } = this.props; const { geneset, genesetsUI } = this.props;
@@ -20,6 +20,7 @@ import {
import { memoize } from "../../../util/dataframe/util"; import { memoize } from "../../../util/dataframe/util";
import parseBulkGeneString from "../../../util/parseBulkGeneString"; import parseBulkGeneString from "../../../util/parseBulkGeneString";
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
const renderGene = (fuzzySortResult: any, { handleClick, modifiers }: any) => { const renderGene = (fuzzySortResult: any, { handleClick, modifiers }: any) => {
if (!modifiers.matchesPredicate) { if (!modifiers.matchesPredicate) {
return null; return null;
@@ -33,6 +34,7 @@ const renderGene = (fuzzySortResult: any, { handleClick, modifiers }: any) => {
disabled={modifiers.disabled} disabled={modifiers.disabled}
data-testid={`suggest-menu-item-${geneName}`} data-testid={`suggest-menu-item-${geneName}`}
key={geneName} key={geneName}
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
onClick={(g: any /* this fires when user clicks a menu item */) => onClick={(g: any /* this fires when user clicks a menu item */) =>
handleClick(g) handleClick(g)
} }
@@ -41,6 +43,7 @@ const renderGene = (fuzzySortResult: any, { handleClick, modifiers }: any) => {
); );
}; };
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
const filterGenes = (query: any, genes: any) => const filterGenes = (query: any, genes: any) =>
/* fires on load, once, and then for each character typed into the input */ /* fires on load, once, and then for each character typed into the input */
fuzzysort.go(query, genes, { fuzzysort.go(query, genes, {
@@ -48,17 +51,23 @@ const filterGenes = (query: any, genes: any) =>
threshold: -10000, // don't return bad results threshold: -10000, // don't return bad results
}); });
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
type AddGenesState = any; type AddGenesState = any;
// @ts-expect-error ts-migrate(1238) FIXME: Unable to resolve signature of class decorator whe... Remove this comment to see the full error message // @ts-expect-error ts-migrate(1238) FIXME: Unable to resolve signature of class decorator whe... Remove this comment to see the full error message
@connect((state) => { @connect((state) => {
return { return {
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
annoMatrix: (state as any).annoMatrix, annoMatrix: (state as any).annoMatrix,
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
userDefinedGenes: (state as any).controls.userDefinedGenes, userDefinedGenes: (state as any).controls.userDefinedGenes,
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
userDefinedGenesLoading: (state as any).controls.userDefinedGenesLoading, userDefinedGenesLoading: (state as any).controls.userDefinedGenesLoading,
}; };
}) })
// eslint-disable-next-line @typescript-eslint/ban-types --- FIXME: disabled temporarily on migrate to TS.
class AddGenes extends React.Component<{}, AddGenesState> { class AddGenes extends React.Component<{}, AddGenesState> {
// eslint-disable-next-line @typescript-eslint/ban-types --- FIXME: disabled temporarily on migrate to TS.
constructor(props: {}) { constructor(props: {}) {
super(props); super(props);
this.state = { this.state = {
@@ -70,15 +79,18 @@ class AddGenes extends React.Component<{}, AddGenesState> {
}; };
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
componentDidMount() { componentDidMount() {
// @ts-expect-error ts-migrate(2554) FIXME: Expected 1 arguments, but got 0. // @ts-expect-error ts-migrate(2554) FIXME: Expected 1 arguments, but got 0.
this.updateState(); this.updateState();
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/ban-types --- FIXME: disabled temporarily on migrate to TS.
componentDidUpdate(prevProps: {}) { componentDidUpdate(prevProps: {}) {
this.updateState(prevProps); this.updateState(prevProps);
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
handleClick(g: any) { handleClick(g: any) {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'dispatch' does not exist on type 'Readon... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'dispatch' does not exist on type 'Readon... Remove this comment to see the full error message
const { dispatch, userDefinedGenes } = this.props; const { dispatch, userDefinedGenes } = this.props;
@@ -100,6 +112,7 @@ class AddGenes extends React.Component<{}, AddGenesState> {
} }
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
_genesToUpper = (listGenes: any) => { _genesToUpper = (listGenes: any) => {
// Has to be a Map to preserve index // Has to be a Map to preserve index
const upperGenes = new Map(); const upperGenes = new Map();
@@ -110,9 +123,10 @@ class AddGenes extends React.Component<{}, AddGenesState> {
return upperGenes; return upperGenes;
}; };
// eslint-disable-next-line react/sort-comp -- memo requires a defined _genesToUpper // eslint-disable-next-line react/sort-comp, @typescript-eslint/no-explicit-any -- memo requires a defined _genesToUpper
_memoGenesToUpper = memoize(this._genesToUpper, (arr: any) => arr); _memoGenesToUpper = memoize(this._genesToUpper, (arr: any) => arr);
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
handleBulkAddClick = () => { handleBulkAddClick = () => {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'dispatch' does not exist on type 'Readon... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'dispatch' does not exist on type 'Readon... Remove this comment to see the full error message
const { dispatch, userDefinedGenes } = this.props; const { dispatch, userDefinedGenes } = this.props;
@@ -164,6 +178,7 @@ class AddGenes extends React.Component<{}, AddGenesState> {
return undefined; return undefined;
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
async updateState(prevProps: any) { async updateState(prevProps: any) {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'annoMatrix' does not exist on type 'Read... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'annoMatrix' does not exist on type 'Read... Remove this comment to see the full error message
const { annoMatrix } = this.props; const { annoMatrix } = this.props;
@@ -186,6 +201,7 @@ class AddGenes extends React.Component<{}, AddGenesState> {
} }
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
placeholderGeneNames() { placeholderGeneNames() {
/* /*
return a string containing gene name suggestions for use as a user hint. return a string containing gene name suggestions for use as a user hint.
@@ -215,6 +231,7 @@ class AddGenes extends React.Component<{}, AddGenesState> {
return "Apod, Cd74, ..."; return "Apod, Cd74, ...";
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
render() { render() {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'userDefinedGenesLoading' does not exist ... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'userDefinedGenesLoading' does not exist ... Remove this comment to see the full error message
const { userDefinedGenesLoading } = this.props; const { userDefinedGenesLoading } = this.props;
@@ -7,17 +7,25 @@ import { Tooltip2 } from "@blueprintjs/popover2";
import LabelInput from "../../labelInput"; import LabelInput from "../../labelInput";
import actions from "../../../actions"; import actions from "../../../actions";
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
type State = any; type State = any;
// @ts-expect-error ts-migrate(1238) FIXME: Unable to resolve signature of class decorator whe... Remove this comment to see the full error message // @ts-expect-error ts-migrate(1238) FIXME: Unable to resolve signature of class decorator whe... Remove this comment to see the full error message
@connect((state) => ({ @connect((state) => ({
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
annotations: (state as any).annotations, annotations: (state as any).annotations,
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
schema: (state as any).annoMatrix?.schema, schema: (state as any).annoMatrix?.schema,
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
obsCrossfilter: (state as any).obsCrossfilter, obsCrossfilter: (state as any).obsCrossfilter,
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
genesets: (state as any).genesets.genesets, genesets: (state as any).genesets.genesets,
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
genesetsUI: (state as any).genesetsUI, genesetsUI: (state as any).genesetsUI,
})) }))
// eslint-disable-next-line @typescript-eslint/ban-types --- FIXME: disabled temporarily on migrate to TS.
class CreateGenesetDialogue extends React.PureComponent<{}, State> { class CreateGenesetDialogue extends React.PureComponent<{}, State> {
// eslint-disable-next-line @typescript-eslint/ban-types --- FIXME: disabled temporarily on migrate to TS.
constructor(props: {}) { constructor(props: {}) {
super(props); super(props);
this.state = { this.state = {
@@ -27,6 +35,7 @@ class CreateGenesetDialogue extends React.PureComponent<{}, State> {
}; };
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
disableCreateGenesetMode = (e: any) => { disableCreateGenesetMode = (e: any) => {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'dispatch' does not exist on type 'Readon... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'dispatch' does not exist on type 'Readon... Remove this comment to see the full error message
const { dispatch } = this.props; const { dispatch } = this.props;
@@ -42,6 +51,7 @@ class CreateGenesetDialogue extends React.PureComponent<{}, State> {
if (e) e.preventDefault(); if (e) e.preventDefault();
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
createGeneset = (e: any) => { createGeneset = (e: any) => {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'dispatch' does not exist on type 'Readon... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'dispatch' does not exist on type 'Readon... Remove this comment to see the full error message
const { dispatch } = this.props; const { dispatch } = this.props;
@@ -56,6 +66,7 @@ class CreateGenesetDialogue extends React.PureComponent<{}, State> {
genesetDescription, genesetDescription,
}); });
if (genesToPopulateGeneset) { if (genesToPopulateGeneset) {
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
const genesTmpHardcodedFormat: any = []; const genesTmpHardcodedFormat: any = [];
const genesArrayFromString = pull( const genesArrayFromString = pull(
uniq(genesToPopulateGeneset.split(/[ ,]+/)), uniq(genesToPopulateGeneset.split(/[ ,]+/)),
@@ -78,10 +89,12 @@ class CreateGenesetDialogue extends React.PureComponent<{}, State> {
e.preventDefault(); e.preventDefault();
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
genesetNameError = () => { genesetNameError = () => {
return false; return false;
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
handleChange = (e: any) => { handleChange = (e: any) => {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'genesets' does not exist on type 'Readon... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'genesets' does not exist on type 'Readon... Remove this comment to see the full error message
const { genesets } = this.props; const { genesets } = this.props;
@@ -89,20 +102,24 @@ class CreateGenesetDialogue extends React.PureComponent<{}, State> {
this.validate(e, genesets); this.validate(e, genesets);
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
handleGenesetInputChange = (e: any) => { handleGenesetInputChange = (e: any) => {
this.setState({ genesToPopulateGeneset: e }); this.setState({ genesToPopulateGeneset: e });
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
handleDescriptionInputChange = (e: any) => { handleDescriptionInputChange = (e: any) => {
this.setState({ genesetDescription: e }); this.setState({ genesetDescription: e });
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
instruction = (genesetName: any, genesets: any) => { instruction = (genesetName: any, genesets: any) => {
return genesets.has(genesetName) return genesets.has(genesetName)
? "Gene set name must be unique." ? "Gene set name must be unique."
: "New, unique gene set name"; : "New, unique gene set name";
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
validate = (genesetName: any, genesets: any) => { validate = (genesetName: any, genesets: any) => {
if (genesets.has(genesetName)) { if (genesets.has(genesetName)) {
this.setState({ this.setState({
@@ -127,6 +144,7 @@ class CreateGenesetDialogue extends React.PureComponent<{}, State> {
return true; return true;
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
render() { render() {
const { genesetName, nameErrorMessage } = this.state; const { genesetName, nameErrorMessage } = this.state;
// @ts-expect-error ts-migrate(2339) FIXME: Property 'genesetsUI' does not exist on type 'Read... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'genesetsUI' does not exist on type 'Read... Remove this comment to see the full error message
@@ -3,17 +3,25 @@ import { connect } from "react-redux";
import AnnoDialog from "../../annoDialog"; import AnnoDialog from "../../annoDialog";
import LabelInput from "../../labelInput"; import LabelInput from "../../labelInput";
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
type State = any; type State = any;
// @ts-expect-error ts-migrate(1238) FIXME: Unable to resolve signature of class decorator whe... Remove this comment to see the full error message // @ts-expect-error ts-migrate(1238) FIXME: Unable to resolve signature of class decorator whe... Remove this comment to see the full error message
@connect((state) => ({ @connect((state) => ({
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
annotations: (state as any).annotations, annotations: (state as any).annotations,
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
schema: (state as any).annoMatrix?.schema, schema: (state as any).annoMatrix?.schema,
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
obsCrossfilter: (state as any).obsCrossfilter, obsCrossfilter: (state as any).obsCrossfilter,
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
genesetsUI: (state as any).genesetsUI, genesetsUI: (state as any).genesetsUI,
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
genesets: (state as any).genesets.genesets, genesets: (state as any).genesets.genesets,
})) }))
// eslint-disable-next-line @typescript-eslint/ban-types --- FIXME: disabled temporarily on migrate to TS.
class RenameGeneset extends React.PureComponent<{}, State> { class RenameGeneset extends React.PureComponent<{}, State> {
// eslint-disable-next-line @typescript-eslint/ban-types --- FIXME: disabled temporarily on migrate to TS.
constructor(props: {}) { constructor(props: {}) {
super(props); super(props);
this.state = { this.state = {
@@ -24,6 +32,7 @@ class RenameGeneset extends React.PureComponent<{}, State> {
}; };
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
disableEditGenesetNameMode = (e: any) => { disableEditGenesetNameMode = (e: any) => {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'dispatch' does not exist on type 'Readon... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'dispatch' does not exist on type 'Readon... Remove this comment to see the full error message
const { dispatch } = this.props; const { dispatch } = this.props;
@@ -37,6 +46,7 @@ class RenameGeneset extends React.PureComponent<{}, State> {
if (e) e.preventDefault(); if (e) e.preventDefault();
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
renameGeneset = (e: any) => { renameGeneset = (e: any) => {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'dispatch' does not exist on type 'Readon... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'dispatch' does not exist on type 'Readon... Remove this comment to see the full error message
const { dispatch, genesetsUI } = this.props; const { dispatch, genesetsUI } = this.props;
@@ -55,18 +65,22 @@ class RenameGeneset extends React.PureComponent<{}, State> {
e.preventDefault(); e.preventDefault();
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
genesetNameError = () => { genesetNameError = () => {
return false; return false;
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
handleChange = (e: any) => { handleChange = (e: any) => {
this.setState({ newGenesetName: e }); this.setState({ newGenesetName: e });
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
handleChangeDescription = (e: any) => { handleChangeDescription = (e: any) => {
this.setState({ newGenesetDescription: e }); this.setState({ newGenesetDescription: e });
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
validate = (genesetName: any, genesets: any) => { validate = (genesetName: any, genesets: any) => {
return ( return (
!genesets.has(genesetName) && !genesets.has(genesetName) &&
@@ -76,6 +90,7 @@ class RenameGeneset extends React.PureComponent<{}, State> {
); );
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
render() { render() {
const { newGenesetName, newGenesetDescription } = this.state; const { newGenesetName, newGenesetDescription } = this.state;
const { const {
@@ -17,21 +17,27 @@ import * as globals from "../../../globals";
import actions from "../../../actions"; import actions from "../../../actions";
import AddGeneToGenesetDialogue from "./addGeneToGenesetDialogue"; import AddGeneToGenesetDialogue from "./addGeneToGenesetDialogue";
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
type State = any; type State = any;
// @ts-expect-error ts-migrate(1238) FIXME: Unable to resolve signature of class decorator whe... Remove this comment to see the full error message // @ts-expect-error ts-migrate(1238) FIXME: Unable to resolve signature of class decorator whe... Remove this comment to see the full error message
@connect((state) => { @connect((state) => {
return { return {
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
genesetsUI: (state as any).genesetsUI, genesetsUI: (state as any).genesetsUI,
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
colorAccessor: (state as any).colors.colorAccessor, colorAccessor: (state as any).colors.colorAccessor,
}; };
}) })
// eslint-disable-next-line @typescript-eslint/ban-types --- FIXME: disabled temporarily on migrate to TS.
class GenesetMenus extends React.PureComponent<{}, State> { class GenesetMenus extends React.PureComponent<{}, State> {
// eslint-disable-next-line @typescript-eslint/ban-types --- FIXME: disabled temporarily on migrate to TS.
constructor(props: {}) { constructor(props: {}) {
super(props); super(props);
this.state = {}; this.state = {};
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
activateAddGeneToGenesetMode = () => { activateAddGeneToGenesetMode = () => {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'dispatch' does not exist on type 'Readon... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'dispatch' does not exist on type 'Readon... Remove this comment to see the full error message
const { dispatch, geneset } = this.props; const { dispatch, geneset } = this.props;
@@ -41,6 +47,7 @@ class GenesetMenus extends React.PureComponent<{}, State> {
}); });
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
activateEditGenesetNameMode = () => { activateEditGenesetNameMode = () => {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'dispatch' does not exist on type 'Readon... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'dispatch' does not exist on type 'Readon... Remove this comment to see the full error message
const { dispatch, geneset } = this.props; const { dispatch, geneset } = this.props;
@@ -51,6 +58,7 @@ class GenesetMenus extends React.PureComponent<{}, State> {
}); });
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
handleColorByEntireGeneset = () => { handleColorByEntireGeneset = () => {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'dispatch' does not exist on type 'Readon... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'dispatch' does not exist on type 'Readon... Remove this comment to see the full error message
const { dispatch, geneset } = this.props; const { dispatch, geneset } = this.props;
@@ -61,12 +69,14 @@ class GenesetMenus extends React.PureComponent<{}, State> {
}); });
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
handleDeleteGeneset = () => { handleDeleteGeneset = () => {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'dispatch' does not exist on type 'Readon... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'dispatch' does not exist on type 'Readon... Remove this comment to see the full error message
const { dispatch, geneset } = this.props; const { dispatch, geneset } = this.props;
dispatch(actions.genesetDelete(geneset)); dispatch(actions.genesetDelete(geneset));
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
render() { render() {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'geneset' does not exist on type 'Readonl... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'geneset' does not exist on type 'Readonl... Remove this comment to see the full error message
const { geneset, genesetsEditable, createText, colorAccessor } = this.props; const { geneset, genesetsEditable, createText, colorAccessor } = this.props;
@@ -10,6 +10,7 @@ import Gene from "./gene";
import { postUserErrorToast } from "../framework/toasters"; import { postUserErrorToast } from "../framework/toasters";
import actions from "../../actions"; import actions from "../../actions";
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
const usePrevious = (value: any) => { const usePrevious = (value: any) => {
const ref = useRef(); const ref = useRef();
useEffect(() => { useEffect(() => {
@@ -18,6 +19,7 @@ const usePrevious = (value: any) => {
return ref.current; return ref.current;
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
function QuickGene() { function QuickGene() {
const dispatch = useDispatch(); const dispatch = useDispatch();
@@ -28,8 +30,11 @@ function QuickGene() {
const { annoMatrix, userDefinedGenes, userDefinedGenesLoading } = useSelector( const { annoMatrix, userDefinedGenes, userDefinedGenesLoading } = useSelector(
(state) => { (state) => {
return { return {
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
annoMatrix: (state as any).annoMatrix, annoMatrix: (state as any).annoMatrix,
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
userDefinedGenes: (state as any).controls.userDefinedGenes, userDefinedGenes: (state as any).controls.userDefinedGenes,
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
userDefinedGenesLoading: (state as any).controls userDefinedGenesLoading: (state as any).controls
.userDefinedGenesLoading, .userDefinedGenesLoading,
}; };
@@ -41,6 +46,7 @@ function QuickGene() {
// @ts-expect-error ts-migrate(2345) FIXME: Argument of type '() => Promise<void>' is not assi... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2345) FIXME: Argument of type '() => Promise<void>' is not assi... Remove this comment to see the full error message
useEffect(async () => { useEffect(async () => {
if (!annoMatrix) return; if (!annoMatrix) return;
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
if (annoMatrix !== (prevProps as any)?.annoMatrix) { if (annoMatrix !== (prevProps as any)?.annoMatrix) {
const { schema } = annoMatrix; const { schema } = annoMatrix;
const varIndex = schema.annotations.var.index; const varIndex = schema.annotations.var.index;
@@ -60,7 +66,9 @@ function QuickGene() {
const handleExpand = () => setIsExpanded(!isExpanded); const handleExpand = () => setIsExpanded(!isExpanded);
const renderGene = ( const renderGene = (
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
fuzzySortResult: any, fuzzySortResult: any,
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
{ handleClick, modifiers }: any { handleClick, modifiers }: any
) => { ) => {
if (!modifiers.matchesPredicate) { if (!modifiers.matchesPredicate) {
@@ -75,6 +83,7 @@ function QuickGene() {
disabled={modifiers.disabled} disabled={modifiers.disabled}
data-testid={`suggest-menu-item-${geneName}`} data-testid={`suggest-menu-item-${geneName}`}
key={geneName} key={geneName}
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
onClick={(g: any /* this fires when user clicks a menu item */) => onClick={(g: any /* this fires when user clicks a menu item */) =>
handleClick(g) handleClick(g)
} }
@@ -83,6 +92,7 @@ function QuickGene() {
); );
}; };
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
const handleClick = (g: any) => { const handleClick = (g: any) => {
if (!g) return; if (!g) return;
const gene = g.target; const gene = g.target;
@@ -98,6 +108,7 @@ function QuickGene() {
} }
}; };
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
const filterGenes = (query: any, genes: any) => const filterGenes = (query: any, genes: any) =>
/* fires on load, once, and then for each character typed into the input */ /* fires on load, once, and then for each character typed into the input */
fuzzysort.go(query, genes, { fuzzysort.go(query, genes, {
@@ -105,11 +116,13 @@ function QuickGene() {
threshold: -10000, // don't return bad results threshold: -10000, // don't return bad results
}); });
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
const removeGene = (gene: any) => () => { const removeGene = (gene: any) => () => {
dispatch({ type: "clear user defined gene", data: gene }); dispatch({ type: "clear user defined gene", data: gene });
}; };
const QuickGenes = useMemo(() => { const QuickGenes = useMemo(() => {
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
return userDefinedGenes.map((gene: any) => { return userDefinedGenes.map((gene: any) => {
return ( return (
<Gene <Gene
@@ -1,5 +1,6 @@
import { glPointFlags, glPointSize } from "../../util/glHelpers"; import { glPointFlags, glPointSize } from "../../util/glHelpers";
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
export default function drawPointsRegl(regl: any) { export default function drawPointsRegl(regl: any) {
return regl({ return regl({
vert: ` vert: `
+63
View File
@@ -34,6 +34,7 @@ Simple 2D transforms control all point painting. There are three:
* camera - apply a 2D camera transformation (pan, zoom) * camera - apply a 2D camera transformation (pan, zoom)
* projection - apply any transformation required for screen size and layout * projection - apply any transformation required for screen size and layout
*/ */
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
function createProjectionTF(viewportWidth: any, viewportHeight: any) { function createProjectionTF(viewportWidth: any, viewportHeight: any) {
/* /*
the projection transform accounts for the screen size & other layout the projection transform accounts for the screen size & other layout
@@ -68,21 +69,33 @@ function createModelTF() {
return m; return m;
} }
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
type GraphState = any; type GraphState = any;
// @ts-expect-error ts-migrate(1238) FIXME: Unable to resolve signature of class decorator whe... Remove this comment to see the full error message // @ts-expect-error ts-migrate(1238) FIXME: Unable to resolve signature of class decorator whe... Remove this comment to see the full error message
@connect((state) => ({ @connect((state) => ({
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
annoMatrix: (state as any).annoMatrix, annoMatrix: (state as any).annoMatrix,
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
crossfilter: (state as any).obsCrossfilter, crossfilter: (state as any).obsCrossfilter,
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
selectionTool: (state as any).graphSelection.tool, selectionTool: (state as any).graphSelection.tool,
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
currentSelection: (state as any).graphSelection.selection, currentSelection: (state as any).graphSelection.selection,
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
layoutChoice: (state as any).layoutChoice, layoutChoice: (state as any).layoutChoice,
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
graphInteractionMode: (state as any).controls.graphInteractionMode, graphInteractionMode: (state as any).controls.graphInteractionMode,
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
colors: (state as any).colors, colors: (state as any).colors,
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
pointDilation: (state as any).pointDilation, pointDilation: (state as any).pointDilation,
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
genesets: (state as any).genesets.genesets, genesets: (state as any).genesets.genesets,
})) }))
// eslint-disable-next-line @typescript-eslint/ban-types --- FIXME: disabled temporarily on migrate to TS.
class Graph extends React.Component<{}, GraphState> { class Graph extends React.Component<{}, GraphState> {
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
static createReglState(canvas: any) { static createReglState(canvas: any) {
/* /*
Must be created for each canvas Must be created for each canvas
@@ -108,12 +121,15 @@ class Graph extends React.Component<{}, GraphState> {
}; };
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
static watchAsync(props: any, prevProps: any) { static watchAsync(props: any, prevProps: any) {
return !shallowEqual(props.watchProps, prevProps.watchProps); return !shallowEqual(props.watchProps, prevProps.watchProps);
} }
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
cachedAsyncProps: any; cachedAsyncProps: any;
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
reglCanvas: any; reglCanvas: any;
computePointPositions = memoize((X, Y, modelTF) => { computePointPositions = memoize((X, Y, modelTF) => {
@@ -214,6 +230,7 @@ class Graph extends React.Component<{}, GraphState> {
} }
); );
// eslint-disable-next-line @typescript-eslint/ban-types --- FIXME: disabled temporarily on migrate to TS.
constructor(props: {}) { constructor(props: {}) {
super(props); super(props);
const viewport = this.getViewportDimensions(); const viewport = this.getViewportDimensions();
@@ -255,10 +272,12 @@ class Graph extends React.Component<{}, GraphState> {
}; };
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
componentDidMount() { componentDidMount() {
window.addEventListener("resize", this.handleResize); window.addEventListener("resize", this.handleResize);
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/ban-types --- FIXME: disabled temporarily on migrate to TS.
componentDidUpdate(prevProps: {}, prevState: GraphState) { componentDidUpdate(prevProps: {}, prevState: GraphState) {
const { const {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'selectionTool' does not exist on type 'R... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'selectionTool' does not exist on type 'R... Remove this comment to see the full error message
@@ -312,10 +331,12 @@ class Graph extends React.Component<{}, GraphState> {
} }
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
componentWillUnmount() { componentWillUnmount() {
window.removeEventListener("resize", this.handleResize); window.removeEventListener("resize", this.handleResize);
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
handleResize = () => { handleResize = () => {
const { state } = this.state; const { state } = this.state;
const viewport = this.getViewportDimensions(); const viewport = this.getViewportDimensions();
@@ -327,17 +348,20 @@ class Graph extends React.Component<{}, GraphState> {
}); });
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
handleCanvasEvent = (e: any) => { handleCanvasEvent = (e: any) => {
const { camera, projectionTF } = this.state; const { camera, projectionTF } = this.state;
if (e.type !== "wheel") e.preventDefault(); if (e.type !== "wheel") e.preventDefault();
if (camera.handleEvent(e, projectionTF)) { if (camera.handleEvent(e, projectionTF)) {
this.renderCanvas(); this.renderCanvas();
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
this.setState((state: any) => { this.setState((state: any) => {
return { ...state, updateOverlay: !state.updateOverlay }; return { ...state, updateOverlay: !state.updateOverlay };
}); });
} }
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
handleBrushDragAction() { handleBrushDragAction() {
/* /*
event describing brush position: event describing brush position:
@@ -369,6 +393,7 @@ class Graph extends React.Component<{}, GraphState> {
); );
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
handleBrushStartAction() { handleBrushStartAction() {
// Ignore programatically generated events. // Ignore programatically generated events.
// @ts-expect-error ts-migrate(2339) FIXME: Property 'event' does not exist on type 'typeof im... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'event' does not exist on type 'typeof im... Remove this comment to see the full error message
@@ -378,6 +403,7 @@ class Graph extends React.Component<{}, GraphState> {
dispatch(actions.graphBrushStartAction()); dispatch(actions.graphBrushStartAction());
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
handleBrushEndAction() { handleBrushEndAction() {
// Ignore programatically generated events. // Ignore programatically generated events.
// @ts-expect-error ts-migrate(2339) FIXME: Property 'event' does not exist on type 'typeof im... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'event' does not exist on type 'typeof im... Remove this comment to see the full error message
@@ -410,12 +436,14 @@ class Graph extends React.Component<{}, GraphState> {
} }
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
handleBrushDeselectAction() { handleBrushDeselectAction() {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'dispatch' does not exist on type 'Readon... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'dispatch' does not exist on type 'Readon... Remove this comment to see the full error message
const { dispatch, layoutChoice } = this.props; const { dispatch, layoutChoice } = this.props;
dispatch(actions.graphBrushDeselectAction(layoutChoice.current)); dispatch(actions.graphBrushDeselectAction(layoutChoice.current));
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
handleLassoStart() { handleLassoStart() {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'dispatch' does not exist on type 'Readon... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'dispatch' does not exist on type 'Readon... Remove this comment to see the full error message
const { dispatch, layoutChoice } = this.props; const { dispatch, layoutChoice } = this.props;
@@ -424,6 +452,7 @@ class Graph extends React.Component<{}, GraphState> {
} }
// when a lasso is completed, filter to the points within the lasso polygon // when a lasso is completed, filter to the points within the lasso polygon
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
handleLassoEnd(polygon: any) { handleLassoEnd(polygon: any) {
const minimumPolygonArea = 10; const minimumPolygonArea = 10;
// @ts-expect-error ts-migrate(2339) FIXME: Property 'dispatch' does not exist on type 'Readon... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'dispatch' does not exist on type 'Readon... Remove this comment to see the full error message
@@ -438,24 +467,28 @@ class Graph extends React.Component<{}, GraphState> {
dispatch( dispatch(
actions.graphLassoEndAction( actions.graphLassoEndAction(
layoutChoice.current, layoutChoice.current,
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
polygon.map((xy: any) => this.mapScreenToPoint(xy)) polygon.map((xy: any) => this.mapScreenToPoint(xy))
) )
); );
} }
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
handleLassoCancel() { handleLassoCancel() {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'dispatch' does not exist on type 'Readon... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'dispatch' does not exist on type 'Readon... Remove this comment to see the full error message
const { dispatch, layoutChoice } = this.props; const { dispatch, layoutChoice } = this.props;
dispatch(actions.graphLassoCancelAction(layoutChoice.current)); dispatch(actions.graphLassoCancelAction(layoutChoice.current));
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
handleLassoDeselectAction() { handleLassoDeselectAction() {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'dispatch' does not exist on type 'Readon... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'dispatch' does not exist on type 'Readon... Remove this comment to see the full error message
const { dispatch, layoutChoice } = this.props; const { dispatch, layoutChoice } = this.props;
dispatch(actions.graphLassoDeselectAction(layoutChoice.current)); dispatch(actions.graphLassoDeselectAction(layoutChoice.current));
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
handleDeselectAction() { handleDeselectAction() {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'selectionTool' does not exist on type 'R... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'selectionTool' does not exist on type 'R... Remove this comment to see the full error message
const { selectionTool } = this.props; const { selectionTool } = this.props;
@@ -463,6 +496,7 @@ class Graph extends React.Component<{}, GraphState> {
if (selectionTool === "lasso") this.handleLassoDeselectAction(); if (selectionTool === "lasso") this.handleLassoDeselectAction();
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
handleOpacityRangeChange(e: any) { handleOpacityRangeChange(e: any) {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'dispatch' does not exist on type 'Readon... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'dispatch' does not exist on type 'Readon... Remove this comment to see the full error message
const { dispatch } = this.props; const { dispatch } = this.props;
@@ -472,6 +506,7 @@ class Graph extends React.Component<{}, GraphState> {
}); });
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
setReglCanvas = (canvas: any) => { setReglCanvas = (canvas: any) => {
this.reglCanvas = canvas; this.reglCanvas = canvas;
this.setState({ this.setState({
@@ -479,6 +514,7 @@ class Graph extends React.Component<{}, GraphState> {
}); });
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
getViewportDimensions = () => { getViewportDimensions = () => {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'viewportRef' does not exist on type 'Rea... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'viewportRef' does not exist on type 'Rea... Remove this comment to see the full error message
const { viewportRef } = this.props; const { viewportRef } = this.props;
@@ -488,6 +524,7 @@ class Graph extends React.Component<{}, GraphState> {
}; };
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
createToolSVG = () => { createToolSVG = () => {
/* /*
Called from componentDidUpdate. Create the tool SVG, and return any Called from componentDidUpdate. Create the tool SVG, and return any
@@ -531,6 +568,7 @@ class Graph extends React.Component<{}, GraphState> {
return { toolSVG: newToolSVG, tool, container }; return { toolSVG: newToolSVG, tool, container };
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
fetchAsyncProps = async (props: any) => { fetchAsyncProps = async (props: any) => {
const { const {
annoMatrix, annoMatrix,
@@ -578,10 +616,15 @@ class Graph extends React.Component<{}, GraphState> {
}; };
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
async fetchData( async fetchData(
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
annoMatrix: any, annoMatrix: any,
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
layoutChoice: any, layoutChoice: any,
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
colors: any, colors: any,
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
pointDilation: any pointDilation: any
) { ) {
/* /*
@@ -610,6 +653,7 @@ class Graph extends React.Component<{}, GraphState> {
return Promise.all(promises); return Promise.all(promises);
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
brushToolUpdate(tool: any, container: any) { brushToolUpdate(tool: any, container: any) {
/* /*
this is called from componentDidUpdate(), so be very careful using this is called from componentDidUpdate(), so be very careful using
@@ -653,6 +697,7 @@ class Graph extends React.Component<{}, GraphState> {
} }
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
lassoToolUpdate(tool: any) { lassoToolUpdate(tool: any) {
/* /*
this is called from componentDidUpdate(), so be very careful using this is called from componentDidUpdate(), so be very careful using
@@ -664,6 +709,7 @@ class Graph extends React.Component<{}, GraphState> {
/* /*
if there is a current selection, make sure the lasso tool matches if there is a current selection, make sure the lasso tool matches
*/ */
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
const polygon = currentSelection.polygon.map((p: any) => const polygon = currentSelection.polygon.map((p: any) =>
this.mapPointToScreen(p) this.mapPointToScreen(p)
); );
@@ -673,6 +719,7 @@ class Graph extends React.Component<{}, GraphState> {
} }
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
selectionToolUpdate(tool: any, container: any) { selectionToolUpdate(tool: any, container: any) {
/* /*
this is called from componentDidUpdate(), so be very careful using this is called from componentDidUpdate(), so be very careful using
@@ -694,6 +741,7 @@ class Graph extends React.Component<{}, GraphState> {
} }
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
mapScreenToPoint(pin: any) { mapScreenToPoint(pin: any) {
/* /*
Map an XY coordinates from screen domain to cell/point range, Map an XY coordinates from screen domain to cell/point range,
@@ -712,6 +760,7 @@ class Graph extends React.Component<{}, GraphState> {
return xy; return xy;
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
mapPointToScreen(xyCell: any) { mapPointToScreen(xyCell: any) {
/* /*
Map an XY coordinate from cell/point domain to screen range. Inverse Map an XY coordinate from cell/point domain to screen range. Inverse
@@ -749,6 +798,7 @@ class Graph extends React.Component<{}, GraphState> {
); );
}); });
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
updateReglAndRender(asyncProps: any, prevAsyncProps: any) { updateReglAndRender(asyncProps: any, prevAsyncProps: any) {
const { positions, colors, flags, height, width } = asyncProps; const { positions, colors, flags, height, width } = asyncProps;
this.cachedAsyncProps = asyncProps; this.cachedAsyncProps = asyncProps;
@@ -772,6 +822,7 @@ class Graph extends React.Component<{}, GraphState> {
if (needToRenderCanvas) this.renderCanvas(); if (needToRenderCanvas) this.renderCanvas();
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
updateColorTable(colors: any, colorDf: any) { updateColorTable(colors: any, colorDf: any) {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'annoMatrix' does not exist on type 'Read... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'annoMatrix' does not exist on type 'Read... Remove this comment to see the full error message
const { annoMatrix } = this.props; const { annoMatrix } = this.props;
@@ -796,6 +847,7 @@ class Graph extends React.Component<{}, GraphState> {
); );
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
createColorByQuery(colors: any) { createColorByQuery(colors: any) {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'annoMatrix' does not exist on type 'Read... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'annoMatrix' does not exist on type 'Read... Remove this comment to see the full error message
const { annoMatrix, genesets } = this.props; const { annoMatrix, genesets } = this.props;
@@ -804,13 +856,21 @@ class Graph extends React.Component<{}, GraphState> {
return createColorQuery(colorMode, colorAccessor, schema, genesets); return createColorQuery(colorMode, colorAccessor, schema, genesets);
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
renderPoints( renderPoints(
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
regl: any, regl: any,
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
drawPoints: any, drawPoints: any,
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
colorBuffer: any, colorBuffer: any,
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
pointBuffer: any, pointBuffer: any,
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
flagBuffer: any, flagBuffer: any,
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
camera: any, camera: any,
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
projectionTF: any projectionTF: any
) { ) {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'annoMatrix' does not exist on type 'Read... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'annoMatrix' does not exist on type 'Read... Remove this comment to see the full error message
@@ -838,6 +898,7 @@ class Graph extends React.Component<{}, GraphState> {
regl._gl.flush(); regl._gl.flush();
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
render() { render() {
const { const {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'graphInteractionMode' does not exist on ... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'graphInteractionMode' does not exist on ... Remove this comment to see the full error message
@@ -957,6 +1018,7 @@ class Graph extends React.Component<{}, GraphState> {
} }
} }
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
const ErrorLoading = ({ displayName, error, width, height }: any) => { const ErrorLoading = ({ displayName, error, width, height }: any) => {
console.log(error); // log to console as this is an unepected error console.log(error); // log to console as this is an unepected error
return ( return (
@@ -973,6 +1035,7 @@ const ErrorLoading = ({ displayName, error, width, height }: any) => {
); );
}; };
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
const StillLoading = ({ displayName, width, height }: any) => { const StillLoading = ({ displayName, width, height }: any) => {
/* /*
Render a busy/loading indicator Render a busy/loading indicator
@@ -8,19 +8,28 @@ import { createColorQuery } from "../../../util/stateManager/colorHelpers";
// @ts-expect-error ts-migrate(1238) FIXME: Unable to resolve signature of class decorator whe... Remove this comment to see the full error message // @ts-expect-error ts-migrate(1238) FIXME: Unable to resolve signature of class decorator whe... Remove this comment to see the full error message
@connect((state) => ({ @connect((state) => ({
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
annoMatrix: (state as any).annoMatrix, annoMatrix: (state as any).annoMatrix,
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
colors: (state as any).colors, colors: (state as any).colors,
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
layoutChoice: (state as any).layoutChoice, layoutChoice: (state as any).layoutChoice,
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
dilatedValue: (state as any).pointDilation.categoryField, dilatedValue: (state as any).pointDilation.categoryField,
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
categoricalSelection: (state as any).categoricalSelection, categoricalSelection: (state as any).categoricalSelection,
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
showLabels: (state as any).centroidLabels?.showLabels, showLabels: (state as any).centroidLabels?.showLabels,
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
genesets: (state as any).genesets.genesets, genesets: (state as any).genesets.genesets,
})) }))
export default class CentroidLabels extends PureComponent { export default class CentroidLabels extends PureComponent {
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
static watchAsync(props: any, prevProps: any) { static watchAsync(props: any, prevProps: any) {
return !shallowEqual(props.watchProps, prevProps.watchProps); return !shallowEqual(props.watchProps, prevProps.watchProps);
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
fetchAsyncProps = async (props: any) => { fetchAsyncProps = async (props: any) => {
const { const {
annoMatrix, annoMatrix,
@@ -55,6 +64,7 @@ export default class CentroidLabels extends PureComponent {
}; };
// @ts-expect-error ts-migrate(6133) FIXME: 'e' is declared but its value is never read. // @ts-expect-error ts-migrate(6133) FIXME: 'e' is declared but its value is never read.
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
handleMouseEnter = (e: any, colorAccessor: any, label: any) => { handleMouseEnter = (e: any, colorAccessor: any, label: any) => {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'dispatch' does not exist on type 'Readon... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'dispatch' does not exist on type 'Readon... Remove this comment to see the full error message
const { dispatch } = this.props; const { dispatch } = this.props;
@@ -66,6 +76,7 @@ export default class CentroidLabels extends PureComponent {
}; };
// @ts-expect-error ts-migrate(6133) FIXME: 'e' is declared but its value is never read. // @ts-expect-error ts-migrate(6133) FIXME: 'e' is declared but its value is never read.
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
handleMouseOut = (e: any, colorAccessor: any, label: any) => { handleMouseOut = (e: any, colorAccessor: any, label: any) => {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'dispatch' does not exist on type 'Readon... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'dispatch' does not exist on type 'Readon... Remove this comment to see the full error message
const { dispatch } = this.props; const { dispatch } = this.props;
@@ -76,6 +87,7 @@ export default class CentroidLabels extends PureComponent {
}); });
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
colorByQuery() { colorByQuery() {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'annoMatrix' does not exist on type 'Read... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'annoMatrix' does not exist on type 'Read... Remove this comment to see the full error message
const { annoMatrix, colors, genesets } = this.props; const { annoMatrix, colors, genesets } = this.props;
@@ -84,6 +96,7 @@ export default class CentroidLabels extends PureComponent {
return createColorQuery(colorMode, colorAccessor, schema, genesets); return createColorQuery(colorMode, colorAccessor, schema, genesets);
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
async fetchData() { async fetchData() {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'annoMatrix' does not exist on type 'Read... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'annoMatrix' does not exist on type 'Read... Remove this comment to see the full error message
const { annoMatrix, layoutChoice } = this.props; const { annoMatrix, layoutChoice } = this.props;
@@ -101,6 +114,7 @@ export default class CentroidLabels extends PureComponent {
return Promise.all(promises); return Promise.all(promises);
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
render() { render() {
const { const {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'inverseTransform' does not exist on type... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'inverseTransform' does not exist on type... Remove this comment to see the full error message
@@ -134,10 +148,12 @@ export default class CentroidLabels extends PureComponent {
<Async.Fulfilled> <Async.Fulfilled>
{(asyncProps) => { {(asyncProps) => {
if (!showLabels) return null; if (!showLabels) return null;
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
const labelSVGS: any = []; const labelSVGS: any = [];
const deselectOpacity = 0.375; const deselectOpacity = 0.375;
// @ts-expect-error ts-migrate(2339) FIXME: Property 'category' does not exist on type 'unknow... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'category' does not exist on type 'unknow... Remove this comment to see the full error message
const { category, colorAccessor, labels } = asyncProps; const { category, colorAccessor, labels } = asyncProps;
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
labels.forEach((coords: any, label: any) => { labels.forEach((coords: any, label: any) => {
const selected = category.get(label) ?? true; const selected = category.get(label) ?? true;
// Mirror LSB middle truncation // Mirror LSB middle truncation
@@ -181,7 +197,7 @@ const Label = ({
colorAccessor, colorAccessor,
displayLabel, displayLabel,
onMouseEnter, onMouseEnter,
onMouseOut, onMouseOut, // eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
}: any) => { }: any) => {
/* /*
Render a label at a given coordinate. Render a label at a given coordinate.
@@ -3,8 +3,10 @@ import React, { PureComponent, cloneElement } from "react";
// @ts-expect-error ts-migrate(2307) FIXME: Cannot find module '../graph.css' or its correspon... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2307) FIXME: Cannot find module '../graph.css' or its correspon... Remove this comment to see the full error message
import styles from "../graph.css"; import styles from "../graph.css";
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
type State = any; type State = any;
// eslint-disable-next-line @typescript-eslint/ban-types --- FIXME: disabled temporarily on migrate to TS.
export default class GraphOverlayLayer extends PureComponent<{}, State> { export default class GraphOverlayLayer extends PureComponent<{}, State> {
/* /*
This component takes its children (assumed in the data coordinate space ([0, 1] range, origin in bottom left corner)) This component takes its children (assumed in the data coordinate space ([0, 1] range, origin in bottom left corner))
@@ -12,6 +14,7 @@ export default class GraphOverlayLayer extends PureComponent<{}, State> {
Children are assigned in the graph component and must implement onDisplayChange() Children are assigned in the graph component and must implement onDisplayChange()
*/ */
// eslint-disable-next-line @typescript-eslint/ban-types --- FIXME: disabled temporarily on migrate to TS.
constructor(props: {}) { constructor(props: {}) {
super(props); super(props);
this.state = { this.state = {
@@ -19,6 +22,7 @@ export default class GraphOverlayLayer extends PureComponent<{}, State> {
}; };
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
matrixToTransformString = (m: any) => { matrixToTransformString = (m: any) => {
/* /*
Translates the gl-matrix mat3 to SVG matrix transform style Translates the gl-matrix mat3 to SVG matrix transform style
@@ -31,17 +35,21 @@ export default class GraphOverlayLayer extends PureComponent<{}, State> {
return `matrix(${m[0]} ${m[1]} ${m[3]} ${m[4]} ${m[6]} ${m[7]})`; return `matrix(${m[0]} ${m[1]} ${m[3]} ${m[4]} ${m[6]} ${m[7]})`;
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
reverseMatrixScaleTransformString = (m: any) => { reverseMatrixScaleTransformString = (m: any) => {
return `matrix(${1 / m[0]} 0 0 ${1 / m[4]} 0 0)`; return `matrix(${1 / m[0]} 0 0 ${1 / m[4]} 0 0)`;
}; };
// This is passed to all children, should be called when an overlay's display state is toggled along with the overlay name and its new display state in boolean form // This is passed to all children, should be called when an overlay's display state is toggled along with the overlay name and its new display state in boolean form
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
overlaySetShowing = (overlay: any, displaying: any) => { overlaySetShowing = (overlay: any, displaying: any) => {
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
this.setState((state: any) => { this.setState((state: any) => {
return { ...state, display: { ...state.display, [overlay]: displaying } }; return { ...state, display: { ...state.display, [overlay]: displaying } };
}); });
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
render() { render() {
const { const {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'cameraTF' does not exist on type 'Readon... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'cameraTF' does not exist on type 'Readon... Remove this comment to see the full error message
+14
View File
@@ -1,18 +1,27 @@
import * as d3 from "d3"; import * as d3 from "d3";
import { Colors } from "@blueprintjs/core"; import { Colors } from "@blueprintjs/core";
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
const Lasso = () => { const Lasso = () => {
const dispatch = d3.dispatch("start", "end", "cancel"); const dispatch = d3.dispatch("start", "end", "cancel");
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
const lasso = (svg: any) => { const lasso = (svg: any) => {
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
let lassoPolygon: any; let lassoPolygon: any;
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
let lassoPath: any; let lassoPath: any;
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
let closePath: any; let closePath: any;
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
let lassoInProgress: any; let lassoInProgress: any;
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
const polygonToPath = (polygon: any) => const polygonToPath = (polygon: any) =>
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
`M${polygon.map((d: any) => d.join(",")).join("L")}`; `M${polygon.map((d: any) => d.join(",")).join("L")}`;
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
const distance = (pt1: any, pt2: any) => const distance = (pt1: any, pt2: any) =>
Math.sqrt((pt2[0] - pt1[0]) ** 2 + (pt2[1] - pt1[1]) ** 2); Math.sqrt((pt2[0] - pt1[0]) ** 2 + (pt2[1] - pt1[1]) ** 2);
@@ -21,6 +30,7 @@ const Lasso = () => {
const lassoPathColor = Colors.BLUE5; const lassoPathColor = Colors.BLUE5;
const handleDragStart = () => { const handleDragStart = () => {
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
lassoPolygon = [(d3 as any).mouse(svg.node())]; // current x y of mouse within element lassoPolygon = [(d3 as any).mouse(svg.node())]; // current x y of mouse within element
if (lassoPath) { if (lassoPath) {
@@ -56,6 +66,7 @@ const Lasso = () => {
}; };
const handleDrag = () => { const handleDrag = () => {
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
const point = (d3 as any).mouse(svg.node()); const point = (d3 as any).mouse(svg.node());
lassoPolygon.push(point); lassoPolygon.push(point);
lassoPath.attr("d", polygonToPath(lassoPolygon)); lassoPath.attr("d", polygonToPath(lassoPolygon));
@@ -126,6 +137,7 @@ const Lasso = () => {
area.call(drag); area.call(drag);
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
(lasso as any).reset = () => { (lasso as any).reset = () => {
if (lassoPath) { if (lassoPath) {
lassoPath.remove(); lassoPath.remove();
@@ -138,6 +150,7 @@ const Lasso = () => {
} }
}; };
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
(lasso as any).move = (polygon: any) => { (lasso as any).move = (polygon: any) => {
if (polygon !== lassoPolygon || polygon.length !== lassoPolygon.length) { if (polygon !== lassoPolygon || polygon.length !== lassoPolygon.length) {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'reset' does not exist on type '(svg: any... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'reset' does not exist on type '(svg: any... Remove this comment to see the full error message
@@ -155,6 +168,7 @@ const Lasso = () => {
}; };
}; };
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
lasso.on = (type: any, callback: any) => { lasso.on = (type: any, callback: any) => {
dispatch.on(type, callback); dispatch.on(type, callback);
return lasso; return lasso;
@@ -7,12 +7,19 @@ import Lasso from "./setupLasso";
******************************************* *******************************************
******************************************/ ******************************************/
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
export default ( export default (
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
selectionToolType: any, selectionToolType: any,
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
handleStartAction: any, handleStartAction: any,
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
handleDragAction: any, handleDragAction: any,
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
handleEndAction: any, handleEndAction: any,
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
handleCancelAction: any, handleCancelAction: any,
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
viewport: any viewport: any
) => { ) => {
const svg = d3.select("#graph-wrapper").select("#lasso-layer"); const svg = d3.select("#graph-wrapper").select("#lasso-layer");
@@ -39,6 +46,7 @@ export default (
} }
if (selectionToolType === "lasso") { if (selectionToolType === "lasso") {
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
const lasso = (Lasso() as any) const lasso = (Lasso() as any)
.on("end", handleEndAction) .on("end", handleEndAction)
// FYI, Lasso doesn't generate drag // FYI, Lasso doesn't generate drag
@@ -8,14 +8,20 @@ import { selectableCategoryNames } from "../../util/stateManager/controlsHelpers
// @ts-expect-error ts-migrate(1238) FIXME: Unable to resolve signature of class decorator whe... Remove this comment to see the full error message // @ts-expect-error ts-migrate(1238) FIXME: Unable to resolve signature of class decorator whe... Remove this comment to see the full error message
@connect((state) => { @connect((state) => {
return { return {
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
schema: (state as any).annoMatrix.schema, schema: (state as any).annoMatrix.schema,
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
datasetTitle: (state as any).config?.displayNames?.dataset ?? "", datasetTitle: (state as any).config?.displayNames?.dataset ?? "",
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
aboutURL: (state as any).config?.links?.["about-dataset"], aboutURL: (state as any).config?.links?.["about-dataset"],
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
isOpen: (state as any).controls.datasetDrawer, isOpen: (state as any).controls.datasetDrawer,
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
dataPortalProps: (state as any).config?.corpora_props, dataPortalProps: (state as any).config?.corpora_props,
}; };
}) })
class InfoDrawer extends PureComponent { class InfoDrawer extends PureComponent {
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
handleClose = () => { handleClose = () => {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'dispatch' does not exist on type 'Readon... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'dispatch' does not exist on type 'Readon... Remove this comment to see the full error message
const { dispatch } = this.props; const { dispatch } = this.props;
@@ -23,6 +29,7 @@ class InfoDrawer extends PureComponent {
dispatch({ type: "toggle dataset drawer" }); dispatch({ type: "toggle dataset drawer" });
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
render() { render() {
const { const {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'position' does not exist on type 'Readon... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'position' does not exist on type 'Readon... Remove this comment to see the full error message
@@ -43,6 +50,7 @@ class InfoDrawer extends PureComponent {
const allCategoryNames = selectableCategoryNames(schema).sort(); const allCategoryNames = selectableCategoryNames(schema).sort();
const singleValueCategories = new Map(); const singleValueCategories = new Map();
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
allCategoryNames.forEach((catName: any) => { allCategoryNames.forEach((catName: any) => {
const isUserAnno = schema?.annotations?.obsByName[catName]?.writable; const isUserAnno = schema?.annotations?.obsByName[catName]?.writable;
const colSchema = schema.annotations.obsByName[catName]; const colSchema = schema.annotations.obsByName[catName];
@@ -1,6 +1,7 @@
import { H3, H1, UL, HTMLTable, Classes } from "@blueprintjs/core"; import { H3, H1, UL, HTMLTable, Classes } from "@blueprintjs/core";
import React from "react"; import React from "react";
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
const renderContributors = (contributors: any, affiliations: any) => { const renderContributors = (contributors: any, affiliations: any) => {
// eslint-disable-next-line no-constant-condition -- Temp removed contributor section to avoid publishing PII // eslint-disable-next-line no-constant-condition -- Temp removed contributor section to avoid publishing PII
if (!contributors || contributors.length === 0 || true) return null; if (!contributors || contributors.length === 0 || true) return null;
@@ -8,6 +9,7 @@ const renderContributors = (contributors: any, affiliations: any) => {
<> <>
<H3>Contributors</H3> <H3>Contributors</H3>
<p> <p>
{/* eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS. */}
{contributors.map((contributor: any) => { {contributors.map((contributor: any) => {
const { email, name, institution } = contributor; const { email, name, institution } = contributor;
@@ -27,6 +29,7 @@ const renderContributors = (contributors: any, affiliations: any) => {
// generates a list of unique institutions by order of appearance in contributors // generates a list of unique institutions by order of appearance in contributors
const buildAffiliations = (contributors = []) => { const buildAffiliations = (contributors = []) => {
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
const affiliations: any = []; const affiliations: any = [];
contributors.forEach((contributor) => { contributors.forEach((contributor) => {
const { institution } = contributor; const { institution } = contributor;
@@ -37,12 +40,14 @@ const buildAffiliations = (contributors = []) => {
return affiliations; return affiliations;
}; };
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
const renderAffiliations = (affiliations: any) => { const renderAffiliations = (affiliations: any) => {
if (affiliations.length === 0) return null; if (affiliations.length === 0) return null;
return ( return (
<> <>
<H3>Affiliations</H3> <H3>Affiliations</H3>
<UL> <UL>
{/* eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS. */}
{affiliations.map((item: any, index: any) => ( {affiliations.map((item: any, index: any) => (
<div key={item}> <div key={item}>
<sup>{index + 1}</sup> <sup>{index + 1}</sup>
@@ -55,6 +60,7 @@ const renderAffiliations = (affiliations: any) => {
); );
}; };
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
const renderDOILink = (type: any, doi: any) => { const renderDOILink = (type: any, doi: any) => {
if (!doi) return null; if (!doi) return null;
return ( return (
@@ -72,7 +78,9 @@ const renderDOILink = (type: any, doi: any) => {
const ONTOLOGY_KEY = "ontology_term_id"; const ONTOLOGY_KEY = "ontology_term_id";
// Render list of metadata attributes found in categorical field // Render list of metadata attributes found in categorical field
const renderDatasetMetadata = ( const renderDatasetMetadata = (
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
singleValueCategories: any, singleValueCategories: any,
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
corporaMetadata: any corporaMetadata: any
) => { ) => {
if (singleValueCategories.size === 0) return null; if (singleValueCategories.size === 0) return null;
@@ -110,15 +118,18 @@ const renderDatasetMetadata = (
// If this category is a ontology term, let's add its value to the previous node // If this category is a ontology term, let's add its value to the previous node
if (String(category).includes(ONTOLOGY_KEY)) { if (String(category).includes(ONTOLOGY_KEY)) {
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
const prevElem = (elems as any).pop(); const prevElem = (elems as any).pop();
const newChildren = [...prevElem.props.children]; const newChildren = [...prevElem.props.children];
newChildren.splice(2, 1, [<td key="ontology">{value}</td>]); newChildren.splice(2, 1, [<td key="ontology">{value}</td>]);
// Props aren't extensible so we must clone and alter the component to append the new child // Props aren't extensible so we must clone and alter the component to append the new child
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
(elems as any).push( (elems as any).push(
React.cloneElement(prevElem, prevElem.props, newChildren) React.cloneElement(prevElem, prevElem.props, newChildren)
); );
} else { } else {
// Create the list item // Create the list item
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
(elems as any).push( (elems as any).push(
<tr key={category}> <tr key={category}>
<td>{`${category}:`}</td> <td>{`${category}:`}</td>
@@ -137,6 +148,7 @@ const renderDatasetMetadata = (
// Renders any links found in the config where link_type is not "SUMMARY" // Renders any links found in the config where link_type is not "SUMMARY"
// If there are no links in the config, render the aboutURL // If there are no links in the config, render the aboutURL
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
const renderLinks = (projectLinks: any, aboutURL: any) => { const renderLinks = (projectLinks: any, aboutURL: any) => {
if (!projectLinks && !aboutURL) return null; if (!projectLinks && !aboutURL) return null;
if (projectLinks) if (projectLinks)
@@ -144,6 +156,7 @@ const renderLinks = (projectLinks: any, aboutURL: any) => {
<> <>
<H3>Project Links</H3> <H3>Project Links</H3>
<UL> <UL>
{/* eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS. */}
{projectLinks.map((link: any) => { {projectLinks.map((link: any) => {
if (link.link_type === "SUMMARY") return null; if (link.link_type === "SUMMARY") return null;
return ( return (
+24 -6
View File
@@ -3,8 +3,10 @@ import { InputGroup, MenuItem, Keys } from "@blueprintjs/core";
import { Suggest } from "@blueprintjs/select"; import { Suggest } from "@blueprintjs/select";
import fuzzysort from "fuzzysort"; import fuzzysort from "fuzzysort";
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
type State = any; type State = any;
// eslint-disable-next-line @typescript-eslint/ban-types --- FIXME: disabled temporarily on migrate to TS.
export default class LabelInput extends React.PureComponent<{}, State> { export default class LabelInput extends React.PureComponent<{}, State> {
/* /*
Input widget for text labels, which acts like an InputGroup, but will also Input widget for text labels, which acts like an InputGroup, but will also
@@ -28,6 +30,7 @@ export default class LabelInput extends React.PureComponent<{}, State> {
/* maxinum number of suggestions */ /* maxinum number of suggestions */
static QueryResultLimit = 100; static QueryResultLimit = 100;
// eslint-disable-next-line @typescript-eslint/ban-types --- FIXME: disabled temporarily on migrate to TS.
constructor(props: {}) { constructor(props: {}) {
super(props); super(props);
@@ -41,6 +44,7 @@ export default class LabelInput extends React.PureComponent<{}, State> {
}; };
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
handleQueryChange = (query: any, event: any) => { handleQueryChange = (query: any, event: any) => {
// https://github.com/palantir/blueprint/issues/2983 // https://github.com/palantir/blueprint/issues/2983
if (!event) return; if (!event) return;
@@ -56,6 +60,7 @@ export default class LabelInput extends React.PureComponent<{}, State> {
if (onChange) onChange(query, event); if (onChange) onChange(query, event);
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
handleItemSelect = (item: any, event: any) => { handleItemSelect = (item: any, event: any) => {
/* only report the select if not already reported via onChange() */ /* only report the select if not already reported via onChange() */
const { target } = item; const { target } = item;
@@ -65,6 +70,7 @@ export default class LabelInput extends React.PureComponent<{}, State> {
if (target !== query && onSelect) onSelect(target, event); if (target !== query && onSelect) onSelect(target, event);
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
handleKeyDown = (e: any) => { handleKeyDown = (e: any) => {
/* /*
prevent these events from propagating to containing form/dialog prevent these events from propagating to containing form/dialog
@@ -80,14 +86,18 @@ export default class LabelInput extends React.PureComponent<{}, State> {
} }
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
handleChange = (e: any) => { handleChange = (e: any) => {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'onChange' does not exist on type 'Readon... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'onChange' does not exist on type 'Readon... Remove this comment to see the full error message
const { onChange } = this.props; const { onChange } = this.props;
if (onChange) onChange(e.target.value); if (onChange) onChange(e.target.value);
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
renderLabelSuggestion = ( renderLabelSuggestion = (
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
queryResult: any, queryResult: any,
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
{ handleClick, modifiers }: any { handleClick, modifiers }: any
) => { ) => {
if (queryResult.newLabel) { if (queryResult.newLabel) {
@@ -116,6 +126,7 @@ export default class LabelInput extends React.PureComponent<{}, State> {
); );
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
filterLabels(query: any) { filterLabels(query: any) {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'labelSuggestions' does not exist on type... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'labelSuggestions' does not exist on type... Remove this comment to see the full error message
const { labelSuggestions } = this.props; const { labelSuggestions } = this.props;
@@ -123,12 +134,15 @@ export default class LabelInput extends React.PureComponent<{}, State> {
/* empty query is wildcard */ /* empty query is wildcard */
if (query === "") { if (query === "") {
return labelSuggestions return (
.slice(0, LabelInput.QueryResultLimit) labelSuggestions
.map((l: any) => ({ .slice(0, LabelInput.QueryResultLimit)
target: l, // eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
score: -10000, .map((l: any) => ({
})); target: l,
score: -10000,
}))
);
} }
/* else, do a fuzzy query */ /* else, do a fuzzy query */
@@ -145,6 +159,7 @@ export default class LabelInput extends React.PureComponent<{}, State> {
return queryResults; return queryResults;
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
render() { render() {
const { props } = this; const { props } = this;
// @ts-expect-error ts-migrate(2339) FIXME: Property 'labelSuggestions' does not exist on type... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'labelSuggestions' does not exist on type... Remove this comment to see the full error message
@@ -155,6 +170,7 @@ export default class LabelInput extends React.PureComponent<{}, State> {
return ( return (
<InputGroup <InputGroup
autoFocus={autoFocus} autoFocus={autoFocus}
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
{...(props as any).inputProps} // eslint-disable-line react/jsx-props-no-spreading --- Allows for modularity {...(props as any).inputProps} // eslint-disable-line react/jsx-props-no-spreading --- Allows for modularity
value={label} value={label}
onChange={this.handleChange} onChange={this.handleChange}
@@ -164,9 +180,11 @@ export default class LabelInput extends React.PureComponent<{}, State> {
const popoverProps = { const popoverProps = {
minimal: true, minimal: true,
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
...(props as any).popoverProps, ...(props as any).popoverProps,
}; };
const inputProps = { const inputProps = {
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
...(props as any).inputProps, ...(props as any).inputProps,
autoFocus: false, autoFocus: false,
}; };
@@ -8,10 +8,13 @@ import Continuous from "../continuous/continuous";
// @ts-expect-error ts-migrate(1238) FIXME: Unable to resolve signature of class decorator whe... Remove this comment to see the full error message // @ts-expect-error ts-migrate(1238) FIXME: Unable to resolve signature of class decorator whe... Remove this comment to see the full error message
@connect((state) => ({ @connect((state) => ({
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
scatterplotXXaccessor: (state as any).controls.scatterplotXXaccessor, scatterplotXXaccessor: (state as any).controls.scatterplotXXaccessor,
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
scatterplotYYaccessor: (state as any).controls.scatterplotYYaccessor, scatterplotYYaccessor: (state as any).controls.scatterplotYYaccessor,
})) }))
class LeftSideBar extends React.Component { class LeftSideBar extends React.Component {
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
render() { render() {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'scatterplotXXaccessor' does not exist on... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'scatterplotXXaccessor' does not exist on... Remove this comment to see the full error message
const { scatterplotXXaccessor, scatterplotYYaccessor } = this.props; const { scatterplotXXaccessor, scatterplotYYaccessor } = this.props;
@@ -12,26 +12,34 @@ const DATASET_TITLE_FONT_SIZE = 14;
// @ts-expect-error ts-migrate(1238) FIXME: Unable to resolve signature of class decorator whe... Remove this comment to see the full error message // @ts-expect-error ts-migrate(1238) FIXME: Unable to resolve signature of class decorator whe... Remove this comment to see the full error message
@connect((state) => { @connect((state) => {
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
const { corpora_props: corporaProps } = (state as any).config; const { corpora_props: corporaProps } = (state as any).config;
const correctVersion = const correctVersion =
["1.0.0", "1.1.0"].indexOf(corporaProps?.version?.corpora_schema_version) > ["1.0.0", "1.1.0"].indexOf(corporaProps?.version?.corpora_schema_version) >
-1; -1;
return { return {
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
datasetTitle: (state as any).config?.displayNames?.dataset ?? "", datasetTitle: (state as any).config?.displayNames?.dataset ?? "",
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
libraryVersions: (state as any).config?.library_versions, libraryVersions: (state as any).config?.library_versions,
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
aboutLink: (state as any).config?.links?.["about-dataset"], aboutLink: (state as any).config?.links?.["about-dataset"],
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
tosURL: (state as any).config?.parameters?.about_legal_tos, tosURL: (state as any).config?.parameters?.about_legal_tos,
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
privacyURL: (state as any).config?.parameters?.about_legal_privacy, privacyURL: (state as any).config?.parameters?.about_legal_privacy,
title: correctVersion ? corporaProps?.title : undefined, title: correctVersion ? corporaProps?.title : undefined,
}; };
}) })
class LeftSideBar extends React.Component { class LeftSideBar extends React.Component {
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
handleClick = () => { handleClick = () => {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'dispatch' does not exist on type 'Readon... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'dispatch' does not exist on type 'Readon... Remove this comment to see the full error message
const { dispatch } = this.props; const { dispatch } = this.props;
dispatch({ type: "toggle dataset drawer" }); dispatch({ type: "toggle dataset drawer" });
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
render() { render() {
const { const {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'datasetTitle' does not exist on type 'Re... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'datasetTitle' does not exist on type 'Re... Remove this comment to see the full error message
@@ -37,6 +37,7 @@ const Auth = React.memo((props) => {
const isAuthenticated = userInfo && userInfo.is_authenticated; const isAuthenticated = userInfo && userInfo.is_authenticated;
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
(window as any).userInfo = userInfo; (window as any).userInfo = userInfo;
const randomInt = Math.random() * 15; const randomInt = Math.random() * 15;
@@ -131,6 +132,7 @@ const Auth = React.memo((props) => {
} }
}); });
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
function PromptContent({ setIsPromptOpen }: any) { function PromptContent({ setIsPromptOpen }: any) {
const [isChecked, setIsChecked] = useState(false); const [isChecked, setIsChecked] = useState(false);
@@ -6,15 +6,18 @@ import actions from "../../actions";
// @ts-expect-error ts-migrate(1238) FIXME: Unable to resolve signature of class decorator whe... Remove this comment to see the full error message // @ts-expect-error ts-migrate(1238) FIXME: Unable to resolve signature of class decorator whe... Remove this comment to see the full error message
@connect((state) => ({ @connect((state) => ({
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
differential: (state as any).differential, differential: (state as any).differential,
})) }))
class CellSetButton extends React.PureComponent { class CellSetButton extends React.PureComponent {
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
set() { set() {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'dispatch' does not exist on type 'Readon... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'dispatch' does not exist on type 'Readon... Remove this comment to see the full error message
const { dispatch, eitherCellSetOneOrTwo } = this.props; const { dispatch, eitherCellSetOneOrTwo } = this.props;
dispatch(actions.setCellSetFromSelection(eitherCellSetOneOrTwo)); dispatch(actions.setCellSetFromSelection(eitherCellSetOneOrTwo));
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
render() { render() {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'differential' does not exist on type 'Re... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'differential' does not exist on type 'Re... Remove this comment to see the full error message
const { differential, eitherCellSetOneOrTwo } = this.props; const { differential, eitherCellSetOneOrTwo } = this.props;
+2 -1
View File
@@ -45,7 +45,8 @@ const Clip = React.memo((props) => {
pendingClipPercentiles?.clipPercentileMax ?? clipPercentileMax; pendingClipPercentiles?.clipPercentileMax ?? clipPercentileMax;
const intent = const intent =
clipPercentileMin > 0 || clipPercentileMax < 100 clipPercentileMin > 0 || clipPercentileMax < 100
? (Intent as any).INTENT_WARNING ? // eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
(Intent as any).INTENT_WARNING
: Intent.NONE; : Intent.NONE;
return ( return (
@@ -9,12 +9,16 @@ import CellSetButton from "./cellSetButtons";
// @ts-expect-error ts-migrate(1238) FIXME: Unable to resolve signature of class decorator whe... Remove this comment to see the full error message // @ts-expect-error ts-migrate(1238) FIXME: Unable to resolve signature of class decorator whe... Remove this comment to see the full error message
@connect((state) => ({ @connect((state) => ({
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
differential: (state as any).differential, differential: (state as any).differential,
diffexpMayBeSlow: diffexpMayBeSlow:
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
(state as any).config?.parameters?.["diffexp-may-be-slow"] ?? false, (state as any).config?.parameters?.["diffexp-may-be-slow"] ?? false,
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
diffexpCellcountMax: (state as any).config?.limits?.diffexp_cellcount_max, diffexpCellcountMax: (state as any).config?.limits?.diffexp_cellcount_max,
})) }))
class DiffexpButtons extends React.PureComponent { class DiffexpButtons extends React.PureComponent {
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
computeDiffExp = () => { computeDiffExp = () => {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'dispatch' does not exist on type 'Readon... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'dispatch' does not exist on type 'Readon... Remove this comment to see the full error message
const { dispatch, differential } = this.props; const { dispatch, differential } = this.props;
@@ -28,6 +32,7 @@ class DiffexpButtons extends React.PureComponent {
} }
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
render() { render() {
/* diffexp-related buttons may be disabled */ /* diffexp-related buttons may be disabled */
// @ts-expect-error ts-migrate(2339) FIXME: Property 'differential' does not exist on type 'Re... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'differential' does not exist on type 'Re... Remove this comment to see the full error message
+31
View File
@@ -14,12 +14,14 @@ import UndoRedoReset from "./undoRedo";
import DiffexpButtons from "./diffexpButtons"; import DiffexpButtons from "./diffexpButtons";
import { getEmbSubsetView } from "../../util/stateManager/viewStackHelpers"; import { getEmbSubsetView } from "../../util/stateManager/viewStackHelpers";
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
type State = any; type State = any;
// @ts-expect-error ts-migrate(1238) FIXME: Unable to resolve signature of class decorator whe... Remove this comment to see the full error message // @ts-expect-error ts-migrate(1238) FIXME: Unable to resolve signature of class decorator whe... Remove this comment to see the full error message
@connect((state) => { @connect((state) => {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'annoMatrix' does not exist on type 'Defa... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'annoMatrix' does not exist on type 'Defa... Remove this comment to see the full error message
const { annoMatrix } = state; const { annoMatrix } = state;
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
const crossfilter = (state as any).obsCrossfilter; const crossfilter = (state as any).obsCrossfilter;
const selectedCount = crossfilter.countSelected(); const selectedCount = crossfilter.countSelected();
@@ -33,32 +35,49 @@ type State = any;
return { return {
subsetPossible, subsetPossible,
subsetResetPossible, subsetResetPossible,
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
graphInteractionMode: (state as any).controls.graphInteractionMode, graphInteractionMode: (state as any).controls.graphInteractionMode,
clipPercentileMin: Math.round(100 * (annoMatrix?.clipRange?.[0] ?? 0)), clipPercentileMin: Math.round(100 * (annoMatrix?.clipRange?.[0] ?? 0)),
clipPercentileMax: Math.round(100 * (annoMatrix?.clipRange?.[1] ?? 1)), clipPercentileMax: Math.round(100 * (annoMatrix?.clipRange?.[1] ?? 1)),
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
userDefinedGenes: (state as any).controls.userDefinedGenes, userDefinedGenes: (state as any).controls.userDefinedGenes,
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
colorAccessor: (state as any).colors.colorAccessor, colorAccessor: (state as any).colors.colorAccessor,
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
scatterplotXXaccessor: (state as any).controls.scatterplotXXaccessor, scatterplotXXaccessor: (state as any).controls.scatterplotXXaccessor,
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
scatterplotYYaccessor: (state as any).controls.scatterplotYYaccessor, scatterplotYYaccessor: (state as any).controls.scatterplotYYaccessor,
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
libraryVersions: (state as any).config?.library_versions, libraryVersions: (state as any).config?.library_versions,
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
auth: (state as any).config?.authentication, auth: (state as any).config?.authentication,
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
userInfo: (state as any).userInfo, userInfo: (state as any).userInfo,
// @ts-expect-error ts-migrate(7053) FIXME: Element implicitly has an 'any' type because expre... Remove this comment to see the full error message // @ts-expect-error ts-migrate(7053) FIXME: Element implicitly has an 'any' type because expre... Remove this comment to see the full error message
undoDisabled: state["@@undoable/past"].length === 0, undoDisabled: state["@@undoable/past"].length === 0,
// @ts-expect-error ts-migrate(7053) FIXME: Element implicitly has an 'any' type because expre... Remove this comment to see the full error message // @ts-expect-error ts-migrate(7053) FIXME: Element implicitly has an 'any' type because expre... Remove this comment to see the full error message
redoDisabled: state["@@undoable/future"].length === 0, redoDisabled: state["@@undoable/future"].length === 0,
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
aboutLink: (state as any).config?.links?.["about-dataset"], aboutLink: (state as any).config?.links?.["about-dataset"],
disableDiffexp: disableDiffexp:
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
(state as any).config?.parameters?.["disable-diffexp"] ?? false, (state as any).config?.parameters?.["disable-diffexp"] ?? false,
diffexpMayBeSlow: diffexpMayBeSlow:
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
(state as any).config?.parameters?.["diffexp-may-be-slow"] ?? false, (state as any).config?.parameters?.["diffexp-may-be-slow"] ?? false,
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
showCentroidLabels: (state as any).centroidLabels.showLabels, showCentroidLabels: (state as any).centroidLabels.showLabels,
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
tosURL: (state as any).config?.parameters?.about_legal_tos, tosURL: (state as any).config?.parameters?.about_legal_tos,
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
privacyURL: (state as any).config?.parameters?.about_legal_privacy, privacyURL: (state as any).config?.parameters?.about_legal_privacy,
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
categoricalSelection: (state as any).categoricalSelection, categoricalSelection: (state as any).categoricalSelection,
}; };
}) })
// eslint-disable-next-line @typescript-eslint/ban-types --- FIXME: disabled temporarily on migrate to TS.
class MenuBar extends React.PureComponent<{}, State> { class MenuBar extends React.PureComponent<{}, State> {
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
static isValidDigitKeyEvent(e: any) { static isValidDigitKeyEvent(e: any) {
/* /*
Return true if this event is necessary to enter a percent number input. Return true if this event is necessary to enter a percent number input.
@@ -83,6 +102,7 @@ class MenuBar extends React.PureComponent<{}, State> {
return key >= 0 && key <= 9; return key >= 0 && key <= 9;
} }
// eslint-disable-next-line @typescript-eslint/ban-types --- FIXME: disabled temporarily on migrate to TS.
constructor(props: {}) { constructor(props: {}) {
super(props); super(props);
this.state = { this.state = {
@@ -90,6 +110,7 @@ class MenuBar extends React.PureComponent<{}, State> {
}; };
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
isClipDisabled = () => { isClipDisabled = () => {
/* /*
return true if clip button should be disabled. return true if clip button should be disabled.
@@ -114,6 +135,7 @@ class MenuBar extends React.PureComponent<{}, State> {
return isDisabled; return isDisabled;
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
handleClipOnKeyPress = (e: any) => { handleClipOnKeyPress = (e: any) => {
/* /*
allow only numbers, plus other critical keys which allow only numbers, plus other critical keys which
@@ -124,6 +146,7 @@ class MenuBar extends React.PureComponent<{}, State> {
} }
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
handleClipPercentileMinValueChange = (v: any) => { handleClipPercentileMinValueChange = (v: any) => {
/* /*
Ignore anything that isn't a legit number Ignore anything that isn't a legit number
@@ -144,6 +167,7 @@ class MenuBar extends React.PureComponent<{}, State> {
}); });
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
handleClipPercentileMaxValueChange = (v: any) => { handleClipPercentileMaxValueChange = (v: any) => {
/* /*
Ignore anything that isn't a legit number Ignore anything that isn't a legit number
@@ -165,6 +189,7 @@ class MenuBar extends React.PureComponent<{}, State> {
}); });
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
handleClipCommit = () => { handleClipCommit = () => {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'dispatch' does not exist on type 'Readon... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'dispatch' does not exist on type 'Readon... Remove this comment to see the full error message
const { dispatch } = this.props; const { dispatch } = this.props;
@@ -175,6 +200,7 @@ class MenuBar extends React.PureComponent<{}, State> {
dispatch(actions.clipAction(min, max)); dispatch(actions.clipAction(min, max));
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
handleClipOpening = () => { handleClipOpening = () => {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'clipPercentileMin' does not exist on typ... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'clipPercentileMin' does not exist on typ... Remove this comment to see the full error message
const { clipPercentileMin, clipPercentileMax } = this.props; const { clipPercentileMin, clipPercentileMax } = this.props;
@@ -183,10 +209,12 @@ class MenuBar extends React.PureComponent<{}, State> {
}); });
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
handleClipClosing = () => { handleClipClosing = () => {
this.setState({ pendingClipPercentiles: null }); this.setState({ pendingClipPercentiles: null });
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
handleCentroidChange = () => { handleCentroidChange = () => {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'dispatch' does not exist on type 'Readon... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'dispatch' does not exist on type 'Readon... Remove this comment to see the full error message
const { dispatch, showCentroidLabels } = this.props; const { dispatch, showCentroidLabels } = this.props;
@@ -197,18 +225,21 @@ class MenuBar extends React.PureComponent<{}, State> {
}); });
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
handleSubset = () => { handleSubset = () => {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'dispatch' does not exist on type 'Readon... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'dispatch' does not exist on type 'Readon... Remove this comment to see the full error message
const { dispatch } = this.props; const { dispatch } = this.props;
dispatch(actions.subsetAction()); dispatch(actions.subsetAction());
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
handleSubsetReset = () => { handleSubsetReset = () => {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'dispatch' does not exist on type 'Readon... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'dispatch' does not exist on type 'Readon... Remove this comment to see the full error message
const { dispatch } = this.props; const { dispatch } = this.props;
dispatch(actions.resetSubsetAction()); dispatch(actions.resetSubsetAction());
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
render() { render() {
const { const {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'dispatch' does not exist on type 'Readon... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'dispatch' does not exist on type 'Readon... Remove this comment to see the full error message
@@ -7,13 +7,16 @@ import {
} from "@blueprintjs/core"; } from "@blueprintjs/core";
export default class MiniHistogram extends React.PureComponent { export default class MiniHistogram extends React.PureComponent {
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
canvasRef: any; canvasRef: any;
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
constructor(props: any) { constructor(props: any) {
super(props); super(props);
this.canvasRef = React.createRef(); this.canvasRef = React.createRef();
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
drawHistogram = () => { drawHistogram = () => {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'xScale' does not exist on type 'Readonly... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'xScale' does not exist on type 'Readonly... Remove this comment to see the full error message
const { xScale, yScale, bins, width, height } = this.props; const { xScale, yScale, bins, width, height } = this.props;
@@ -38,10 +41,12 @@ export default class MiniHistogram extends React.PureComponent {
} }
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
componentDidMount = () => { componentDidMount = () => {
this.drawHistogram(); this.drawHistogram();
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
componentDidUpdate = (prevProps: any) => { componentDidUpdate = (prevProps: any) => {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'obsOrVarContinuousFieldDisplayName' does... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'obsOrVarContinuousFieldDisplayName' does... Remove this comment to see the full error message
const { obsOrVarContinuousFieldDisplayName, bins } = this.props; const { obsOrVarContinuousFieldDisplayName, bins } = this.props;
@@ -53,6 +58,7 @@ export default class MiniHistogram extends React.PureComponent {
this.drawHistogram(); this.drawHistogram();
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
render() { render() {
const { const {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'domainLabel' does not exist on type 'Rea... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'domainLabel' does not exist on type 'Rea... Remove this comment to see the full error message
@@ -1,13 +1,16 @@
import React from "react"; import React from "react";
export default class MiniStackedBar extends React.PureComponent { export default class MiniStackedBar extends React.PureComponent {
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
canvasRef: any; canvasRef: any;
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
constructor(props: any) { constructor(props: any) {
super(props); super(props);
this.canvasRef = React.createRef(); this.canvasRef = React.createRef();
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
drawStacks = () => { drawStacks = () => {
const { const {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'domainValues' does not exist on type 'Re... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'domainValues' does not exist on type 'Re... Remove this comment to see the full error message
@@ -51,16 +54,19 @@ export default class MiniStackedBar extends React.PureComponent {
} }
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
componentDidUpdate = (prevProps: any) => { componentDidUpdate = (prevProps: any) => {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'occupancy' does not exist on type 'Reado... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'occupancy' does not exist on type 'Reado... Remove this comment to see the full error message
const { occupancy } = this.props; const { occupancy } = this.props;
if (occupancy !== prevProps.occupancy) this.drawStacks(); if (occupancy !== prevProps.occupancy) this.drawStacks();
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
componentDidMount = () => { componentDidMount = () => {
this.drawStacks(); this.drawStacks();
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
render() { render() {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'width' does not exist on type 'Readonly<... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'width' does not exist on type 'Readonly<... Remove this comment to see the full error message
const { width, height } = this.props; const { width, height } = this.props;
@@ -5,10 +5,13 @@ import * as globals from "../../globals";
// @ts-expect-error ts-migrate(1238) FIXME: Unable to resolve signature of class decorator whe... Remove this comment to see the full error message // @ts-expect-error ts-migrate(1238) FIXME: Unable to resolve signature of class decorator whe... Remove this comment to see the full error message
@connect((state) => ({ @connect((state) => ({
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
scatterplotXXaccessor: (state as any).controls.scatterplotXXaccessor, scatterplotXXaccessor: (state as any).controls.scatterplotXXaccessor,
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
scatterplotYYaccessor: (state as any).controls.scatterplotYYaccessor, scatterplotYYaccessor: (state as any).controls.scatterplotYYaccessor,
})) }))
class RightSidebar extends React.Component { class RightSidebar extends React.Component {
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
render() { render() {
return ( return (
<div <div
@@ -1,5 +1,6 @@
import { glPointFlags, glPointSize } from "../../util/glHelpers"; import { glPointFlags, glPointSize } from "../../util/glHelpers";
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
export default function drawPointsRegl(regl: any) { export default function drawPointsRegl(regl: any) {
return regl({ return regl({
vert: ` vert: `
@@ -23,6 +23,7 @@ import {
flagHighlight, flagHighlight,
} from "../../util/glHelpers"; } from "../../util/glHelpers";
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
function createProjectionTF(viewportWidth: any, viewportHeight: any) { function createProjectionTF(viewportWidth: any, viewportHeight: any) {
/* /*
the projection transform accounts for the screen size & other layout the projection transform accounts for the screen size & other layout
@@ -31,6 +32,7 @@ function createProjectionTF(viewportWidth: any, viewportHeight: any) {
return mat3.projection(m, viewportWidth, viewportHeight); return mat3.projection(m, viewportWidth, viewportHeight);
} }
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
function getScale(col: any, rangeMin: any, rangeMax: any) { function getScale(col: any, rangeMin: any, rangeMax: any) {
if (!col) return null; if (!col) return null;
const { min, max } = col.summarize(); const { min, max } = col.summarize();
@@ -39,6 +41,7 @@ function getScale(col: any, rangeMin: any, rangeMax: any) {
const getXScale = memoize(getScale); const getXScale = memoize(getScale);
const getYScale = memoize(getScale); const getYScale = memoize(getScale);
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
type State = any; type State = any;
// @ts-expect-error ts-migrate(1238) FIXME: Unable to resolve signature of class decorator whe... Remove this comment to see the full error message // @ts-expect-error ts-migrate(1238) FIXME: Unable to resolve signature of class decorator whe... Remove this comment to see the full error message
@@ -48,20 +51,27 @@ type State = any;
const { const {
scatterplotXXaccessor, scatterplotXXaccessor,
scatterplotYYaccessor, scatterplotYYaccessor,
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
} = (state as any).controls; } = (state as any).controls;
return { return {
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
annoMatrix: (state as any).annoMatrix, annoMatrix: (state as any).annoMatrix,
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
colors: (state as any).colors, colors: (state as any).colors,
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
pointDilation: (state as any).pointDilation, pointDilation: (state as any).pointDilation,
// Accessors are var/gene names (strings) // Accessors are var/gene names (strings)
scatterplotXXaccessor, scatterplotXXaccessor,
scatterplotYYaccessor, scatterplotYYaccessor,
crossfilter, crossfilter,
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
genesets: (state as any).genesets.genesets, genesets: (state as any).genesets.genesets,
}; };
}) })
// eslint-disable-next-line @typescript-eslint/ban-types --- FIXME: disabled temporarily on migrate to TS.
class Scatterplot extends React.PureComponent<{}, State> { class Scatterplot extends React.PureComponent<{}, State> {
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
static createReglState(canvas: any) { static createReglState(canvas: any) {
/* /*
Must be created for each canvas Must be created for each canvas
@@ -92,14 +102,18 @@ class Scatterplot extends React.PureComponent<{}, State> {
}; };
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
static watchAsync(props: any, prevProps: any) { static watchAsync(props: any, prevProps: any) {
return !shallowEqual(props.watchProps, prevProps.watchProps); return !shallowEqual(props.watchProps, prevProps.watchProps);
} }
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
axes: any; axes: any;
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
reglCanvas: any; reglCanvas: any;
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
renderCache: any; renderCache: any;
computePointPositions = memoize((X, Y, xScale, yScale) => { computePointPositions = memoize((X, Y, xScale, yScale) => {
@@ -198,6 +212,7 @@ class Scatterplot extends React.PureComponent<{}, State> {
} }
); );
// eslint-disable-next-line @typescript-eslint/ban-types --- FIXME: disabled temporarily on migrate to TS.
constructor(props: {}) { constructor(props: {}) {
super(props); super(props);
const viewport = this.getViewportDimensions(); const viewport = this.getViewportDimensions();
@@ -213,15 +228,18 @@ class Scatterplot extends React.PureComponent<{}, State> {
}; };
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
componentDidMount() { componentDidMount() {
// this affect point render size for the scatterplot // this affect point render size for the scatterplot
window.addEventListener("resize", this.handleResize); window.addEventListener("resize", this.handleResize);
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
componentWillUnmount() { componentWillUnmount() {
window.removeEventListener("resize", this.handleResize); window.removeEventListener("resize", this.handleResize);
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
setReglCanvas = (canvas: any) => { setReglCanvas = (canvas: any) => {
this.reglCanvas = canvas; this.reglCanvas = canvas;
if (canvas) { if (canvas) {
@@ -232,6 +250,7 @@ class Scatterplot extends React.PureComponent<{}, State> {
} }
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
getViewportDimensions = () => { getViewportDimensions = () => {
return { return {
height: window.innerHeight, height: window.innerHeight,
@@ -239,6 +258,7 @@ class Scatterplot extends React.PureComponent<{}, State> {
}; };
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
handleResize = () => { handleResize = () => {
const { state } = this.state; const { state } = this.state;
const viewport = this.getViewportDimensions(); const viewport = this.getViewportDimensions();
@@ -248,6 +268,7 @@ class Scatterplot extends React.PureComponent<{}, State> {
}); });
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
fetchAsyncProps = async (props: any) => { fetchAsyncProps = async (props: any) => {
const { const {
scatterplotXXaccessor, scatterplotXXaccessor,
@@ -310,6 +331,7 @@ class Scatterplot extends React.PureComponent<{}, State> {
}; };
}; };
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
createXQuery(geneName: any) { createXQuery(geneName: any) {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'annoMatrix' does not exist on type 'Read... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'annoMatrix' does not exist on type 'Read... Remove this comment to see the full error message
const { annoMatrix } = this.props; const { annoMatrix } = this.props;
@@ -328,6 +350,7 @@ class Scatterplot extends React.PureComponent<{}, State> {
]; ];
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
createColorByQuery(colors: any) { createColorByQuery(colors: any) {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'annoMatrix' does not exist on type 'Read... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'annoMatrix' does not exist on type 'Read... Remove this comment to see the full error message
const { annoMatrix, genesets } = this.props; const { annoMatrix, genesets } = this.props;
@@ -336,6 +359,7 @@ class Scatterplot extends React.PureComponent<{}, State> {
return createColorQuery(colorMode, colorAccessor, schema, genesets); return createColorQuery(colorMode, colorAccessor, schema, genesets);
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
updateColorTable(colors: any, colorDf: any) { updateColorTable(colors: any, colorDf: any) {
/* update color table state */ /* update color table state */
// @ts-expect-error ts-migrate(2339) FIXME: Property 'annoMatrix' does not exist on type 'Read... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'annoMatrix' does not exist on type 'Read... Remove this comment to see the full error message
@@ -351,10 +375,15 @@ class Scatterplot extends React.PureComponent<{}, State> {
); );
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
async fetchData( async fetchData(
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
scatterplotXXaccessor: any, scatterplotXXaccessor: any,
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
scatterplotYYaccessor: any, scatterplotYYaccessor: any,
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
colors: any, colors: any,
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
pointDilation: any pointDilation: any
) { ) {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'annoMatrix' does not exist on type 'Read... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'annoMatrix' does not exist on type 'Read... Remove this comment to see the full error message
@@ -408,6 +437,7 @@ class Scatterplot extends React.PureComponent<{}, State> {
); );
}); });
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
updateReglAndRender(newRenderCache: any) { updateReglAndRender(newRenderCache: any) {
const { positions, colors, flags } = newRenderCache; const { positions, colors, flags } = newRenderCache;
this.renderCache = newRenderCache; this.renderCache = newRenderCache;
@@ -418,12 +448,19 @@ class Scatterplot extends React.PureComponent<{}, State> {
this.renderCanvas(); this.renderCanvas();
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
renderPoints( renderPoints(
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
regl: any, regl: any,
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
drawPoints: any, drawPoints: any,
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
flagBuffer: any, flagBuffer: any,
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
colorBuffer: any, colorBuffer: any,
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
pointBuffer: any, pointBuffer: any,
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
projectionTF: any projectionTF: any
) { ) {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'annoMatrix' does not exist on type 'Read... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'annoMatrix' does not exist on type 'Read... Remove this comment to see the full error message
@@ -452,6 +489,7 @@ class Scatterplot extends React.PureComponent<{}, State> {
regl._gl.flush(); regl._gl.flush();
} }
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
render() { render() {
const { const {
// @ts-expect-error ts-migrate(2339) FIXME: Property 'dispatch' does not exist on type 'Readon... Remove this comment to see the full error message // @ts-expect-error ts-migrate(2339) FIXME: Property 'dispatch' does not exist on type 'Readon... Remove this comment to see the full error message
@@ -564,7 +602,9 @@ class Scatterplot extends React.PureComponent<{}, State> {
minimized={minimized} minimized={minimized}
scatterplotYYaccessor={scatterplotYYaccessor} scatterplotYYaccessor={scatterplotYYaccessor}
scatterplotXXaccessor={scatterplotXXaccessor} scatterplotXXaccessor={scatterplotXXaccessor}
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
xScale={(asyncProps as any).xScale} xScale={(asyncProps as any).xScale}
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
yScale={(asyncProps as any).yScale} yScale={(asyncProps as any).yScale}
/> />
); );

Some files were not shown because too many files have changed in this diff Show More