MCPcopy Index your code
hub / github.com/SuperMap/iClient-JavaScript / makeCategoryTicks

Function makeCategoryTicks

libs/echarts/echarts-en.simple.js:38343–38383  ·  view source on GitHub ↗
(axis, tickModel)

Source from the content-addressed store, hash-verified

38341}
38342
38343function makeCategoryTicks(axis, tickModel) {
38344 var ticksCache = getListCache(axis, 'ticks');
38345 var optionTickInterval = getOptionCategoryInterval(tickModel);
38346 var result = listCacheGet(ticksCache, optionTickInterval);
38347
38348 if (result) {
38349 return result;
38350 }
38351
38352 var ticks;
38353 var tickCategoryInterval;
38354
38355 // Optimize for the case that large category data and no label displayed,
38356 // we should not return all ticks.
38357 if (!tickModel.get('show') || axis.scale.isBlank()) {
38358 ticks = [];
38359 }
38360
38361 if (isFunction$1(optionTickInterval)) {
38362 ticks = makeLabelsByCustomizedCategoryInterval(axis, optionTickInterval, true);
38363 }
38364 // Always use label interval by default despite label show. Consider this
38365 // scenario, Use multiple grid with the xAxis sync, and only one xAxis shows
38366 // labels. `splitLine` and `axisTick` should be consistent in this case.
38367 else if (optionTickInterval === 'auto') {
38368 var labelsResult = makeCategoryLabelsActually(axis, axis.getLabelModel());
38369 tickCategoryInterval = labelsResult.labelCategoryInterval;
38370 ticks = map(labelsResult.labels, function (labelItem) {
38371 return labelItem.tickValue;
38372 });
38373 }
38374 else {
38375 tickCategoryInterval = optionTickInterval;
38376 ticks = makeLabelsByNumericCategoryInterval(axis, tickCategoryInterval, true);
38377 }
38378
38379 // Cache to avoid calling interval function repeatly.
38380 return listCacheSet(ticksCache, optionTickInterval, {
38381 ticks: ticks, tickCategoryInterval: tickCategoryInterval
38382 });
38383}
38384
38385function makeRealNumberLabels(axis) {
38386 var ticks = axis.scale.getTicks();

Callers 1

createAxisTicksFunction · 0.70

Calls 10

getListCacheFunction · 0.70
listCacheGetFunction · 0.70
isFunction$1Function · 0.70
mapFunction · 0.70
listCacheSetFunction · 0.70
getMethod · 0.45

Tested by

no test coverage detected