MCPcopy Create free account
hub / github.com/SuperMap/iClient-JavaScript / createLineClipPath

Function createLineClipPath

libs/echarts/echarts-en.simple.js:35032–35055  ·  view source on GitHub ↗
(coordSys, hasAnimation, seriesModel)

Source from the content-addressed store, hash-verified

35030}
35031
35032function createLineClipPath(coordSys, hasAnimation, seriesModel) {
35033 if (coordSys.type === 'cartesian2d') {
35034 var isHorizontal = coordSys.getBaseAxis().isHorizontal();
35035 var clipPath = createGridClipPath(coordSys, hasAnimation, seriesModel);
35036 // Expand clip shape to avoid clipping when line value exceeds axis
35037 if (!seriesModel.get('clip', true)) {
35038 var rectShape = clipPath.shape;
35039 var expandSize = Math.max(rectShape.width, rectShape.height);
35040 if (isHorizontal) {
35041 rectShape.y -= expandSize;
35042 rectShape.height += expandSize * 2;
35043 }
35044 else {
35045 rectShape.x -= expandSize;
35046 rectShape.width += expandSize * 2;
35047 }
35048 }
35049 return clipPath;
35050 }
35051 else {
35052 return createPolarClipPath(coordSys, hasAnimation, seriesModel);
35053 }
35054
35055}
35056
35057Chart.extend({
35058

Callers 1

Calls 4

maxMethod · 0.80
createGridClipPathFunction · 0.70
createPolarClipPathFunction · 0.70
getMethod · 0.45

Tested by

no test coverage detected