Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add truncation of timeline label #4990

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions packages/cbioportal-clinical-timeline/src/TrackHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,9 @@ import { TICK_AXIS_HEIGHT } from './TickAxis';
import { CustomTrackSpecification } from './CustomTrack';
import { TimelineStore } from './TimelineStore';
import { useObserver } from 'mobx-react-lite';
import { TruncatedText } from 'cbioportal-frontend-commons';
import { EllipsisTextTooltip } from 'cbioportal-frontend-commons';
import { isTrackVisible } from './lib/helpers';
import LineChartAxis, {
LINE_CHART_AXIS_SVG_WIDTH,
LINE_CHART_AXIS_TICK_WIDTH,
} from './LineChartAxis';
import LineChartAxis, { LINE_CHART_AXIS_SVG_WIDTH } from './LineChartAxis';
import ReactDOM from 'react-dom';

interface ITrackHeaderProps {
Expand Down Expand Up @@ -50,7 +47,7 @@ const TrackHeader: React.FunctionComponent<ITrackHeaderProps> = function({
onMouseLeave={handleTrackHover}
>
<span>
<TruncatedText text={getTrackLabel(track)} maxLength={20} />
<EllipsisTextTooltip text={getTrackLabel(track)} />
</span>
{isLineChartTrack && (
<div
Expand Down
8 changes: 6 additions & 2 deletions packages/cbioportal-clinical-timeline/src/timeline.scss
Original file line number Diff line number Diff line change
Expand Up @@ -79,16 +79,20 @@ $tl-fontsize: 12px;
}

.tl-timeline-leftbar {
max-width: 150px;
.tl-timeline-tracklabels {
overflow: hidden;
display: flex;
flex-direction: column;
font-size: $tl-fontsize;
font-size: 12.5px; // The first tooltip does not show up if the font-size is too small (<12px)
> div {
white-space: nowrap;
border-bottom: 1px dashed #eee;
padding-right: 10px;
padding-right: 15px;
padding-top: 2px;
overflow: hidden;
text-overflow: ellipsis;
//max-width: 100%;
}
}
}
Expand Down