diff --git a/lib/render.js b/lib/render.js index 5fb662d..bf7dcc9 100644 --- a/lib/render.js +++ b/lib/render.js @@ -155,7 +155,7 @@ const labelArr = (desc, opt) => { }, { field: e.name, style: 'fill-opacity:0.1' + typeStyle(e.type) - }), + }), e.rect !== undefined ? e.rect : {} )]); } @@ -325,7 +325,7 @@ const cage = (desc, opt) => { } } return res; -} /* eslint complexity: [1, 23] */; +} /* eslint complexity: [1, 30] */; const lane = (desc, opt) => { const {index, vspace, hspace, margin, hflip, lanes, compact, label} = opt; @@ -349,11 +349,9 @@ const lane = (desc, opt) => { let txt = index; if (typeof lab === 'string') { txt = lab; - } else - if (typeof lab === 'number') { + } else if (typeof lab === 'number') { txt += lab; - } else - if (typeof lab === 'object') { + } else if (typeof lab === 'object') { txt = lab[index] || txt; } res.push(['g', {'text-anchor': 'end'}, @@ -366,11 +364,9 @@ const lane = (desc, opt) => { let txt = index; if (typeof lab === 'string') { txt = lab; - } else - if (typeof lab === 'number') { + } else if (typeof lab === 'number') { txt += lab; - } else - if (typeof lab === 'object') { + } else if (typeof lab === 'object') { txt = lab[index] || txt; } res.push(['g', {'text-anchor': 'start'},