MCPcopy
hub / github.com/nhn/tui.chart / renderPlotLineModels

Method renderPlotLineModels

apps/chart/src/component/plot.ts:93–116  ·  view source on GitHub ↗
(
    relativePositions: number[],
    vertical: boolean,
    options: { size?: number; startPosition?: number; axes?: Axes } = {}
  )

Source from the content-addressed store, hash-verified

91 }
92
93 renderPlotLineModels(
94 relativePositions: number[],
95 vertical: boolean,
96 options: { size?: number; startPosition?: number; axes?: Axes } = {}
97 ): LineModel[] {
98 const { size, startPosition, axes } = options;
99
100 const { lineColor: color, lineWidth, dashSegments } = this.theme[
101 vertical ? 'vertical' : 'horizontal'
102 ] as Required<LineTheme>;
103 const tickInterval = (vertical ? axes?.xAxis : axes?.yAxis)?.tickInterval || 1;
104
105 return relativePositions
106 .filter((_, idx) => !(idx % tickInterval))
107 .map((position) =>
108 this.makeLineModel(
109 vertical,
110 position,
111 { color, lineWidth, dashSegments },
112 size ?? this.rect.width,
113 startPosition ?? 0
114 )
115 );
116 }
117
118 renderPlotsForCenterYAxis(axes: Axes): LineModel[] {
119 const { xAxisHalfSize, secondStartX, yAxisHeight } = axes.centerYAxis!;

Callers 2

renderPlotsMethod · 0.95

Calls 1

makeLineModelMethod · 0.95

Tested by

no test coverage detected