import * as React from 'react'; import { faGear } from '@fortawesome/free-solid-svg-icons/faGear'; import { Loader, Select, SimpleGrid, Stack, Text } from '@mantine/core'; import { VisynApp, VisynHeader } from '../app'; import type { DatavisynTaggle } from '../ranking'; import { VisynRanking } from '../ranking/VisynRanking'; import { BaseVisConfig, ELabelingOptions, ENumericalColorScaleType, ERegressionLineType, EScatterSelectSettings, ESupportedPlotlyVis, IScatterConfig, Vis, } from '../vis'; import { MyCategoricalScore, MyLinkScore, MyNumberScore, MySMILESScore, MyStringScore } from './scoresUtils'; import { useVisynUser } from '../hooks'; import { VisynActionIcon } from '../icons/visyn-action-icon'; const { breastCancerData } = await import('../vis/stories/breastCancerData'); const { fetchBreastCancerData } = await import('../vis/stories/fetchBreastCancerData'); export function MainApp() { const user = useVisynUser(); const [visConfig, setVisConfig] = React.useState({ type: ESupportedPlotlyVis.SCATTER, numColumnsSelected: [ { description: 'Gene expression', id: 'stat2GeneExpression', name: 'STAT2', }, { description: 'Gene expression', id: 'brca1GeneExpression', name: 'BRCA1', }, ], color: { description: '', id: 'cellularity', name: 'Cellularity', }, numColorScaleType: ENumericalColorScaleType.SEQUENTIAL, facets: null, shape: null, dragMode: EScatterSelectSettings.RECTANGLE, alphaSliderVal: 1, showLabels: ELabelingOptions.SELECTED, showLabelLimit: 20, regressionLineOptions: { type: ERegressionLineType.LINEAR, showStats: true, }, } as IScatterConfig); const columns = React.useMemo(() => (user ? fetchBreastCancerData() : []), [user]); const [selection, setSelection] = React.useState([]); const visSelection = React.useMemo(() => selection.map((s) => `${breastCancerData.indexOf(s)}`), [selection]); const [loading, setLoading] = React.useState(false); const lineupRef = React.useRef(); return ( This is the demo app for visyn core., }, center: ( {breastCancerData.length} data points / {selection.length} points selected ), }} /> } > {user ? (