Word break on visualization if text too wide

Add mobile scrollable toolbar

Add onClick to make visualization context appear
This commit is contained in:
James Ketr 2025-04-17 18:31:11 -07:00
parent 1dd5ae115d
commit c9a6f34d5a
2 changed files with 20 additions and 2 deletions

View File

@ -1071,7 +1071,9 @@ const App = () => {
<Box sx={{ borderBottom: 1, borderColor: 'divider' }}> <Box sx={{ borderBottom: 1, borderColor: 'divider' }}>
<Tabs value={tab} indicatorColor="secondary" <Tabs value={tab} indicatorColor="secondary"
textColor="inherit" textColor="inherit"
variant="fullWidth" variant="scrollable"
allowScrollButtonsMobile
scrollButtons="auto"
onChange={handleTabChange} aria-label="Backstory navigation"> onChange={handleTabChange} aria-label="Backstory navigation">
<Tab label="Backstory" icon={<Avatar sx={{ width: 24, height: 24 }} variant="rounded" alt="Backstory logo" src="/logo192.png" />} iconPosition="start" /> <Tab label="Backstory" icon={<Avatar sx={{ width: 24, height: 24 }} variant="rounded" alt="Backstory logo" src="/logo192.png" />} iconPosition="start" />
<Tab label="Resume Builder"/> <Tab label="Resume Builder"/>

View File

@ -271,8 +271,22 @@ const VectorVisualizer: React.FC<VectorVisualizerProps> = ({ setSnack, connectio
}); });
}} }}
onClick={(event: any) => {
const point = event.points[0];
console.log('Point:', point);
const type = point.customdata.type;
const text = point.customdata.doc;
const emoji = emojiMap[type] || '❓';
setTooltip({
visible: true,
background: point['marker.color'],
color: getTextColorForBackground(point['marker.color']),
content: `${emoji} ${type.toUpperCase()}\n${text}`,
});
}}
data={[plotData.data]} data={[plotData.data]}
useResizeHandler={true} useResizeHandler={true}
config={{ config={{
responsive: true, responsive: true,
displayModeBar: false, displayModeBar: false,
@ -297,6 +311,8 @@ const VectorVisualizer: React.FC<VectorVisualizerProps> = ({ setSnack, connectio
overflow: 'auto', overflow: 'auto',
maxHeight: '20vh', maxHeight: '20vh',
minHeight: '20vh', minHeight: '20vh',
overflowWrap: 'break-all',
wordBreak: 'break-all',
}} }}
> >
<Typography variant="body2" sx={{ p: 1, pt: 0 }}> <Typography variant="body2" sx={{ p: 1, pt: 0 }}>