(labelOpts, fontSize)
| 22 | */ |
| 23 | |
| 24 | const getBoxSize = (labelOpts, fontSize) => { |
| 25 | let {boxHeight = fontSize, boxWidth = fontSize} = labelOpts; |
| 26 | |
| 27 | if (labelOpts.usePointStyle) { |
| 28 | boxHeight = Math.min(boxHeight, fontSize); |
| 29 | boxWidth = labelOpts.pointStyleWidth || Math.min(boxWidth, fontSize); |
| 30 | } |
| 31 | |
| 32 | return { |
| 33 | boxWidth, |
| 34 | boxHeight, |
| 35 | itemHeight: Math.max(fontSize, boxHeight) |
| 36 | }; |
| 37 | }; |
| 38 | |
| 39 | const itemsEqual = (a, b) => a !== null && b !== null && a.datasetIndex === b.datasetIndex && a.index === b.index; |
| 40 |