Skip to content

Commit

Permalink
truncate node captions to 100 chars in viz to fix crash (#1429)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jon Harris authored Jun 11, 2021
1 parent 5055844 commit bf122d6
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,9 @@ const noEmptyLines = function(lines: any[]) {

const fitCaptionIntoCircle = function(node: any, style: any) {
const template = style.forNode(node).get('caption')
const captionText = style.interpolate(template, node)
const nodeText = style.interpolate(template, node)
const captionText =
nodeText.length > 100 ? nodeText.substring(0, 100) : nodeText
const fontFamily = 'sans-serif'
const fontSize = parseFloat(style.forNode(node).get('font-size'))
const lineHeight = fontSize
Expand Down

0 comments on commit bf122d6

Please sign in to comment.