(cfg, local, shared, axisModel, group, transformGroup, api)
| 670 | const builders: Record<AxisBuilderAxisPartName, AxisElementsBuilder> = { |
| 671 | |
| 672 | axisLine(cfg, local, shared, axisModel, group, transformGroup, api) { |
| 673 | if (__DEV__) { |
| 674 | const ready = shared.ensureRecord(axisModel).ready; |
| 675 | assert(!ready.axisLine); |
| 676 | ready.axisLine = true; |
| 677 | } |
| 678 | |
| 679 | let shown = axisModel.get(['axisLine', 'show']); |
| 680 | if (shown === 'auto') { |
| 681 | shown = true; |
| 682 | if (cfg.raw.axisLineAutoShow != null) { |
| 683 | shown = !!cfg.raw.axisLineAutoShow; |
| 684 | } |
| 685 | } |
| 686 | if (!shown) { |
| 687 | return; |
| 688 | } |
| 689 | |
| 690 | const extent = axisModel.axis.getExtent(); |
| 691 | |
| 692 | const matrix = transformGroup.transform; |
| 693 | const pt1 = [extent[0], 0]; |
| 694 | const pt2 = [extent[1], 0]; |
| 695 | const inverse = pt1[0] > pt2[0]; |
| 696 | if (matrix) { |
| 697 | v2ApplyTransform(pt1, pt1, matrix); |
| 698 | v2ApplyTransform(pt2, pt2, matrix); |
| 699 | } |
| 700 | |
| 701 | const lineStyle = extend( |
| 702 | { |
| 703 | lineCap: 'round' |
| 704 | }, |
| 705 | axisModel.getModel(['axisLine', 'lineStyle']).getLineStyle() |
| 706 | ); |
| 707 | const pathBaseProp: PathProps = { |
| 708 | strokeContainThreshold: cfg.raw.strokeContainThreshold || 5, |
| 709 | silent: true, |
| 710 | z2: 1, |
| 711 | style: lineStyle, |
| 712 | }; |
| 713 | |
| 714 | if (axisModel.get(['axisLine', 'breakLine']) && hasBreaks(axisModel.axis.scale)) { |
| 715 | getAxisBreakHelper()!.buildAxisBreakLine(axisModel, group, transformGroup, pathBaseProp); |
| 716 | } |
| 717 | else { |
| 718 | const line = new graphic.Line(extend({ |
| 719 | shape: { |
| 720 | x1: pt1[0], |
| 721 | y1: pt1[1], |
| 722 | x2: pt2[0], |
| 723 | y2: pt2[1] |
| 724 | }, |
| 725 | }, pathBaseProp)); |
| 726 | graphic.subPixelOptimizeLine(line.shape, line.style.lineWidth); |
| 727 | line.anid = 'line'; |
| 728 | group.add(line); |
| 729 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…