Skip to content

Commit

Permalink
Merge pull request #927 from nextstrain/fix-numeric-legends
Browse files Browse the repository at this point in the history
Only truncate legend labels if they are strings
  • Loading branch information
huddlej authored Mar 6, 2020
2 parents 82eaa0b + 5f4a6d7 commit 2bd5550
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/tree/legend/item.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const LegendItem = ({
style={{fontSize: 12, fill: darkGrey, fontFamily: dataFont}}
>
<title>{label}</title>
{label.substring(0, legendMaxLength)}
{typeof label === 'string' ? label.substring(0, legendMaxLength) : label}
</text>
</g>
);
Expand Down

0 comments on commit 2bd5550

Please sign in to comment.