(
labelLine: Polyline,
ignore: boolean,
stateName: string,
stateModel: Model
)
| 529 | type LabelLineModel = Model<LabelLineOption>; |
| 530 | |
| 531 | function setLabelLineState( |
| 532 | labelLine: Polyline, |
| 533 | ignore: boolean, |
| 534 | stateName: string, |
| 535 | stateModel: Model |
| 536 | ) { |
| 537 | const isNormal = stateName === 'normal'; |
| 538 | const stateObj = isNormal ? labelLine : labelLine.ensureState(stateName); |
| 539 | // Make sure display. |
| 540 | stateObj.ignore = ignore; |
| 541 | // Set smooth |
| 542 | let smooth = stateModel.get('smooth'); |
| 543 | smooth = smooth === true ? 0.3 : Math.max(+smooth, 0) || 0; |
| 544 | |
| 545 | stateObj.shape = stateObj.shape || {}; |
| 546 | |
| 547 | // always set the `smooth` property |
| 548 | (stateObj.shape as Polyline['shape']).smooth = smooth; |
| 549 | |
| 550 | const styleObj = stateModel.getModel('lineStyle').getLineStyle(); |
| 551 | isNormal ? labelLine.useStyle(styleObj) : stateObj.style = styleObj; |
| 552 | } |
| 553 | |
| 554 | function buildLabelLinePath(path: CanvasRenderingContext2D, shape: Polyline['shape']) { |
| 555 | const smooth = shape.smooth as number; |
no test coverage detected
searching dependent graphs…