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

Function getSymbolMeta

src/chart/bar/PictorialBarView.ts:252–302  ·  view source on GitHub ↗
(
    data: SeriesData,
    dataIndex: number,
    itemModel: ItemModel,
    opt: CreateOpts
)

Source from the content-addressed store, hash-verified

250
251// Set or calculate default value about symbol, and calculate layout info.
252function getSymbolMeta(
253 data: SeriesData,
254 dataIndex: number,
255 itemModel: ItemModel,
256 opt: CreateOpts
257): SymbolMeta {
258 const layout = data.getItemLayout(dataIndex) as RectLayout;
259 const symbolRepeat = itemModel.get('symbolRepeat');
260 const symbolClip = itemModel.get('symbolClip');
261 const symbolPosition = itemModel.get('symbolPosition') || 'start';
262 const symbolRotate = itemModel.get('symbolRotate');
263 const rotation = (symbolRotate || 0) * Math.PI / 180 || 0;
264 const symbolPatternSize = itemModel.get('symbolPatternSize') || 2;
265 const isAnimationEnabled = itemModel.isAnimationEnabled();
266
267 const symbolMeta: SymbolMeta = {
268 dataIndex: dataIndex,
269 layout: layout,
270 itemModel: itemModel,
271 symbolType: data.getItemVisual(dataIndex, 'symbol') || 'circle',
272 style: data.getItemVisual(dataIndex, 'style'),
273 symbolClip: symbolClip,
274 symbolRepeat: symbolRepeat,
275 symbolRepeatDirection: itemModel.get('symbolRepeatDirection'),
276 symbolPatternSize: symbolPatternSize,
277 rotation: rotation,
278 animationModel: isAnimationEnabled ? itemModel : null,
279 hoverScale: isAnimationEnabled && itemModel.get(['emphasis', 'scale']),
280 z2: itemModel.getShallow('z', true) || 0
281 } as SymbolMeta;
282
283 prepareBarLength(itemModel, symbolRepeat, layout, opt, symbolMeta);
284
285 prepareSymbolSize(
286 data, dataIndex, layout, symbolRepeat, symbolClip, symbolMeta.boundingLength,
287 symbolMeta.pxSign, symbolPatternSize, opt, symbolMeta
288 );
289
290 prepareLineWidth(itemModel, symbolMeta.symbolScale, rotation, opt, symbolMeta);
291
292 const symbolSize = symbolMeta.symbolSize;
293 const symbolOffset = normalizeSymbolOffset(itemModel.get('symbolOffset'), symbolSize);
294
295 prepareLayoutInfo(
296 itemModel, symbolSize, layout, symbolRepeat, symbolClip, symbolOffset as number[],
297 symbolPosition, symbolMeta.valueLineWidth, symbolMeta.boundingLength, symbolMeta.repeatCutLength,
298 opt, symbolMeta
299 );
300
301 return symbolMeta;
302}
303
304// bar length can be negative.
305function prepareBarLength(

Callers 1

renderMethod · 0.85

Calls 10

normalizeSymbolOffsetFunction · 0.90
prepareBarLengthFunction · 0.85
prepareSymbolSizeFunction · 0.85
prepareLineWidthFunction · 0.85
prepareLayoutInfoFunction · 0.85
getItemLayoutMethod · 0.80
getShallowMethod · 0.80
getMethod · 0.45
isAnimationEnabledMethod · 0.45
getItemVisualMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…