mirror of
https://github.com/chanzuckerberg/cellxgene.git
synced 2026-09-30 08:48:13 +08:00
chore: extract schema types (#2375)
* chore: extract schema types * address comments
This commit is contained in:
@@ -3,7 +3,7 @@ Helper functions for user-editable annotations state management.
|
||||
See also reducers/annotations.js
|
||||
*/
|
||||
|
||||
import { Schema } from "../../common/types/entities";
|
||||
import { Schema } from "../../common/types/schema";
|
||||
|
||||
/*
|
||||
There are a number of state constraints assumed throughout the
|
||||
|
||||
@@ -11,9 +11,9 @@ import catLabelSort from "../catLabelSort";
|
||||
import {
|
||||
RawSchema,
|
||||
Schema,
|
||||
LayoutColumn,
|
||||
AnnotationColumn,
|
||||
} from "../../common/types/entities";
|
||||
EmbeddingSchema,
|
||||
AnnotationColumnSchema,
|
||||
} from "../../common/types/schema";
|
||||
|
||||
/*
|
||||
System wide schema assumptions:
|
||||
@@ -86,7 +86,7 @@ export function removeObsAnnoColumn(schema: Schema, name: string): Schema {
|
||||
export function addObsAnnoColumn(
|
||||
schema: Schema,
|
||||
_: string,
|
||||
defn: AnnotationColumn
|
||||
defn: AnnotationColumnSchema
|
||||
): Schema {
|
||||
const newSchema = _copyObsAnno(schema);
|
||||
|
||||
@@ -142,7 +142,7 @@ export function addObsAnnoCategory(schema: any, name: any, category: any) {
|
||||
return newSchema;
|
||||
}
|
||||
|
||||
export function addObsLayout(schema: Schema, layout: LayoutColumn): Schema {
|
||||
export function addObsLayout(schema: Schema, layout: EmbeddingSchema): Schema {
|
||||
/* add or replace a layout */
|
||||
const newSchema = _copyObsLayout(schema);
|
||||
newSchema.layout.obs.push(layout);
|
||||
|
||||
Reference in New Issue
Block a user