UNPKG

highcharts

Version:
67 lines (66 loc) 1.32 kB
/* * * * Marker clusters module. * * (c) 2010-2026 Highsoft AS * * Author: Wojciech Chmiel * * A commercial license may be required depending on use. * See www.highcharts.com/license * * * */ 'use strict'; /* * * * Variables * * */ let symbols; /* * * * Functions * * */ /** * Cluster symbol. * @internal */ function cluster(x, y, width, height) { const w = width / 2, h = height / 2, outerWidth = 1, space = 1, inner = symbols.arc(x + w, y + h, w - space * 4, h - space * 4, { start: Math.PI * 0.5, end: Math.PI * 2.5, open: false }), outer1 = symbols.arc(x + w, y + h, w - space * 3, h - space * 3, { start: Math.PI * 0.5, end: Math.PI * 2.5, innerR: w - outerWidth * 2, open: false }), outer2 = symbols.arc(x + w, y + h, w - space, h - space, { start: Math.PI * 0.5, end: Math.PI * 2.5, innerR: w, open: false }); return outer2.concat(outer1, inner); } /** * Register marker cluster symbols. * @internal */ function compose(SVGRendererClass) { symbols = SVGRendererClass.prototype.symbols; symbols.cluster = cluster; } /* * * * Default Export * * */ /** @internal */ const MarkerClusterSymbols = { compose }; /** @internal */ export default MarkerClusterSymbols;