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

Function createGridClipPath

libs/echarts/echarts-en.simple.js:34676–34716  ·  view source on GitHub ↗
(cartesian, hasAnimation, seriesModel)

Source from the content-addressed store, hash-verified

34674* under the License.
34675*/
34676function createGridClipPath(cartesian, hasAnimation, seriesModel) {
34677 var rect = cartesian.getArea();
34678 var isHorizontal = cartesian.getBaseAxis().isHorizontal();
34679
34680 var x = rect.x;
34681 var y = rect.y;
34682 var width = rect.width;
34683 var height = rect.height;
34684
34685 var lineWidth = seriesModel.get('lineStyle.width') || 2;
34686 // Expand the clip path a bit to avoid the border is clipped and looks thinner
34687 x -= lineWidth / 2;
34688 y -= lineWidth / 2;
34689 width += lineWidth;
34690 height += lineWidth;
34691
34692 // fix: https://github.com/apache/incubator-echarts/issues/11369
34693 x = Math.floor(x);
34694 width = Math.round(width);
34695
34696 var clipPath = new Rect({
34697 shape: {
34698 x: x,
34699 y: y,
34700 width: width,
34701 height: height
34702 }
34703 });
34704
34705 if (hasAnimation) {
34706 clipPath.shape[isHorizontal ? 'width' : 'height'] = 0;
34707 initProps(clipPath, {
34708 shape: {
34709 width: width,
34710 height: height
34711 }
34712 }, seriesModel);
34713 }
34714
34715 return clipPath;
34716}
34717
34718function createPolarClipPath(polar, hasAnimation, seriesModel) {
34719 var sectorArea = polar.getArea();

Callers 2

createClipPathFunction · 0.70
createLineClipPathFunction · 0.70

Calls 4

roundMethod · 0.80
initPropsFunction · 0.70
getAreaMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected