MCPcopy
hub / github.com/apache/echarts / createAxisTicks

Function createAxisTicks

src/coord/axisTickLabelBuilder.ts:145–161  ·  view source on GitHub ↗
(
    axis: Axis,
    tickModel: Model<CategoryTickLabelSplitBuildingOption>,
    opt?: Pick<ScaleGetTicksOpt, 'breakTicks' | 'pruneByBreak'>
)

Source from the content-addressed store, hash-verified

143 * @param tickModel For example, can be axisTick, splitLine, splitArea.
144 */
145export function createAxisTicks(
146 axis: Axis,
147 tickModel: Model<CategoryTickLabelSplitBuildingOption>,
148 opt?: Pick<ScaleGetTicksOpt, 'breakTicks' | 'pruneByBreak'>
149): AxisTicksCreated {
150 const scale = axis.scale;
151 const custom = axis.getTickModel().get('customValues');
152 if (custom) {
153 return {
154 ticks: parseTickLabelCustomValues(custom, scale)
155 };
156 }
157 // Only ordinal scale support tick interval
158 return axis.type === 'category'
159 ? makeCategoryTicks(axis, tickModel)
160 : {ticks: scale.getTicks(opt)};
161}
162
163function parseTickLabelCustomValues(
164 customValues: AxisTickLabelCustomValuesOption,

Callers 1

getTicksCoordsMethod · 0.90

Calls 5

makeCategoryTicksFunction · 0.85
getTickModelMethod · 0.80
getMethod · 0.45
getTicksMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…