import type { ColorName, HPOLabel, OrganId, StrictColorPalette } from "./types"; /** * All supported organ IDs */ export const ORGAN_IDS: readonly OrganId[] = [ "digestive", "lung", "thoracicCavity", "breast", "heart", "head", "eye", "ear", "voice", "kidney", "integument", "constitutional", "limbs", "nervous", "metabolism", "cell", "endocrine", "neoplasm", "immune", "muscle", "growth", "prenatal", "blood", ] as const; /** * Display names for organs (English) */ export const ORGAN_NAMES_EN: Record = { head: "Head", eye: "Eye", ear: "Ear", heart: "Heart", lung: "Lung", digestive: "Digestive", kidney: "Kidney", integument: "Integument", constitutional: "Constitutional", limbs: "Limbs", nervous: "Nervous", breast: "Breast", thoracicCavity: "Thoracic Cavity", voice: "Voice", metabolism: "Metabolism", cell: "Cell", endocrine: "Endocrine", neoplasm: "Neoplasm", immune: "Immune", muscle: "Muscle", growth: "Growth", prenatal: "Prenatal", blood: "Blood", }; /** * Display names for organs (Korean) */ export const ORGAN_NAMES_KO: Record = { head: "머리", eye: "눈", ear: "귀", heart: "심장", lung: "폐", digestive: "소화기", kidney: "신장", integument: "외피", constitutional: "전신", limbs: "팔다리", nervous: "신경계", breast: "유방", thoracicCavity: "흉강", voice: "음성", metabolism: "대사", cell: "세포", endocrine: "내분비", neoplasm: "신생물", immune: "면역", muscle: "근육", growth: "성장", prenatal: "태아", blood: "혈액", }; /** * All HPO category labels */ export const HPO_LABELS: readonly HPOLabel[] = [ "others", "Growth abnormality", "Abnormality of the genitourinary system", "Abnormality of the immune system", "Abnormality of the digestive system", "Abnormality of metabolism/homeostasis", "Abnormality of head or neck", "Abnormality of the musculoskeletal system", "Abnormality of the nervous system", "Abnormality of the respiratory system", "Abnormality of the eye", "Abnormality of the cardiovascular system", "Abnormality of the ear", "Abnormality of prenatal development or birth", "Abnormality of the integument", "Abnormality of the breast", "Abnormality of the endocrine system", "Abnormality of blood and blood-forming tissues", "Abnormality of limbs", "Abnormality of the voice", "Constitutional symptom", "Neoplasm", "Abnormal cellular phenotype", "Abnormality of the thoracic cavity", ] as const; /** * Mapping from HPO label to OrganId * Note: "others" has no corresponding OrganId */ export const HPO_LABEL_TO_ORGAN: Record, OrganId> = { "Growth abnormality": "growth", "Abnormality of the genitourinary system": "kidney", "Abnormality of the immune system": "immune", "Abnormality of the digestive system": "digestive", "Abnormality of metabolism/homeostasis": "metabolism", "Abnormality of head or neck": "head", "Abnormality of the musculoskeletal system": "muscle", "Abnormality of the nervous system": "nervous", "Abnormality of the respiratory system": "lung", "Abnormality of the eye": "eye", "Abnormality of the cardiovascular system": "heart", "Abnormality of the ear": "ear", "Abnormality of prenatal development or birth": "prenatal", "Abnormality of the integument": "integument", "Abnormality of the breast": "breast", "Abnormality of the endocrine system": "endocrine", "Abnormality of blood and blood-forming tissues": "blood", "Abnormality of limbs": "limbs", "Abnormality of the voice": "voice", "Constitutional symptom": "constitutional", Neoplasm: "neoplasm", "Abnormal cellular phenotype": "cell", "Abnormality of the thoracic cavity": "thoracicCavity", }; /** * Mapping from OrganId to HPO label */ export const ORGAN_TO_HPO_LABEL: Record> = { growth: "Growth abnormality", kidney: "Abnormality of the genitourinary system", immune: "Abnormality of the immune system", digestive: "Abnormality of the digestive system", metabolism: "Abnormality of metabolism/homeostasis", head: "Abnormality of head or neck", muscle: "Abnormality of the musculoskeletal system", nervous: "Abnormality of the nervous system", lung: "Abnormality of the respiratory system", eye: "Abnormality of the eye", heart: "Abnormality of the cardiovascular system", ear: "Abnormality of the ear", prenatal: "Abnormality of prenatal development or birth", integument: "Abnormality of the integument", breast: "Abnormality of the breast", endocrine: "Abnormality of the endocrine system", blood: "Abnormality of blood and blood-forming tissues", limbs: "Abnormality of limbs", voice: "Abnormality of the voice", constitutional: "Constitutional symptom", neoplasm: "Neoplasm", cell: "Abnormal cellular phenotype", thoracicCavity: "Abnormality of the thoracic cavity", }; /** * Color palettes for each color scheme. * Based on Tailwind CSS color palette. */ export const DEFAULT_COLOR_PALETTE: StrictColorPalette = { blue: { 100: "#DBEAFE", 200: "#BFDBFE", 300: "#93C5FD", alpha: { 100: "#1A7EFF26", 200: "#0975FB42", 300: "#0478fa6e", }, }, yellow: { 100: "#FFF3D4", 200: "#FFECBA", 300: "#FFCF54", alpha: { 100: "#FFE50D30", 200: "#FCDB025C", 300: "#F2C90575", }, }, gray: { 100: "#F0F2F5", 200: "#E4E6EB", 300: "#BEC2CC", alpha: { 100: "#0000000D", 200: "#101A231A", 300: "#020F1C26", }, }, }; /** * Default color scheme used when no colorScheme is specified */ export const DEFAULT_COLOR_NAME: ColorName = "blue"; /** * Default stroke color */ export const DEFAULT_STROKE_COLOR = "#ff142d"; /** * Default stroke width; */ export const DEFAULT_STROKE_WIDTH = 0.5; /** * Animation duration in milliseconds */ export const ANIMATION_DURATION_MS = 150; /** * CSS transition string for smooth style changes */ const TRANSITION_PROPERTIES = [ "fill", "stroke", "stroke-width", "opacity", "filter", "stop-color", "stop-opacity", "visibility", ]; export const TRANSITION_STYLE = TRANSITION_PROPERTIES.map( (property) => `${property} ${ANIMATION_DURATION_MS}ms ease-out`, ).join(", "); /** * Body SVG viewBox dimensions */ export const BODY_VIEWBOX = { width: 122, height: 358, };