dosubot[bot] commented on issue #38314:
URL: https://github.com/apache/superset/issues/38314#issuecomment-3981341648

   <!-- Answer -->
   This looks like a known issue with how the MapBox clustering calculates 
point sizes. The root cause is that **single-element clusters and multi-element 
clusters use different scaling mechanisms**:
   
   - **Single points** use a fixed size of `radius / 6`
   - **Clusters** use square root scaling: `(clusterLabel / maxLabel)^0.5 * 
radius`
   
   This means when you have a cluster with value=1 alongside clusters with 
larger values, the single-element cluster may be treated as a cluster (using 
the square root formula) but still appear disproportionately large relative to 
your visual expectations.
   
   The relevant code is in 
[ScatterPlotGlowOverlay.jsx](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/plugins/legacy-plugin-chart-map-box/src/ScatterPlotGlowOverlay.jsx#L164-L169).
   
   Several related point radius issues were fixed in recent releases 
([#36962](https://github.com/apache/superset/pull/36962), 
[#36890](https://github.com/apache/superset/pull/36890), 
[#37625](https://github.com/apache/superset/pull/37625)), but this specific 
edge case where clusters with value=1 appear larger than expected may need a 
dedicated fix to add special handling for single-element clusters in the 
scaling logic.
   
   
   <!-- Dosu Comment Footer -->
   *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).*
   
   ---
   <sup>How did I do? 
[Good](https://app.dosu.dev/response-feedback/3fbe4d16-34be-4161-b073-97233cd945a3?feedback_type=great_response)
 | 
[Irrelevant](https://app.dosu.dev/response-feedback/3fbe4d16-34be-4161-b073-97233cd945a3?feedback_type=irrelevant_answer)
 | 
[Incorrect](https://app.dosu.dev/response-feedback/3fbe4d16-34be-4161-b073-97233cd945a3?feedback_type=incorrect_sources)
 | 
[Verbose](https://app.dosu.dev/response-feedback/3fbe4d16-34be-4161-b073-97233cd945a3?feedback_type=too_verbose)
 | 
[Hallucination](https://app.dosu.dev/response-feedback/3fbe4d16-34be-4161-b073-97233cd945a3?feedback_type=hallucination)
 | [Report 
🐛](https://app.dosu.dev/response-feedback/3fbe4d16-34be-4161-b073-97233cd945a3?feedback_type=bug_report)
 | 
[Other](https://app.dosu.dev/response-feedback/3fbe4d16-34be-4161-b073-97233cd945a3?feedback_type=other)</sup>
   
   [![Chat with 
Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/a28d3c7e-a9d3-459e-9fb6-3a6f9ff4f357/ask?utm_source=github)&nbsp;[![Open
 in 
Cursor](https://dosu.dev/dosu-in-cursor.svg)](https://cursor.com/link/prompt?text=This%20looks%20like%20a%20known%20issue%20with%20how%20the%20MapBox%20clustering%20calculates%20point%20sizes.%20The%20root%20cause%20is%20that%20%2A%2Asingle-element%20clusters%20and%20multi-element%20clusters%20use%20different%20scaling%20mechanisms%2A%2A%3A%0A%0A-%20%2A%2ASingle%20points%2A%2A%20use%20a%20fixed%20size%20of%20%60radius%20/%206%60%0A-%20%2A%2AClusters%2A%2A%20use%20square%20root%20scaling%3A%20%60%28clusterLabel%20/%20maxLabel%29%5E0.5%20%2A%20radius%60%0A%0AThis%20means%20when%20you%20have%20a%20cluster%20with%20value%3D1%20alongside%20clusters%20with%20larger%20values%2C%20the%20single-element%20cluster%20may%20be%20treated%20as%20a%20cluster%20%28using%20the%20square%20root%20formula%29%20but%20still%20appear%20disproportionate
 
ly%20large%20relative%20to%20your%20visual%20expectations.%0A%0AThe%20relevant%20code%20is%20in%20%5BScatterPlotGlowOverlay.jsx%5D%28https%3A//github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/plugins/legacy-plugin-chart-map-box/src/ScatterPlotGlowOverlay.jsx%23L164-L169%29.%0A%0ASeveral%20related%20point%20radius%20issues%20were%20fixed%20in%20recent%20releases%20%28%5B%2336962%5D%28https%3A//github.com/apache/superset/pull/36962%29%2C%20%5B%2336890%5D%28https%3A//github.com/apache/superset/pull/36890%29%2C%20%5B%2337625%5D%28https%3A//github.com/apache/superset/pull/37625%29%29%2C%20but%20this%20specific%20edge%20case%20where%20clusters%20with%20value%3D1%20appear%20larger%20than%20expected%20may%20need%20a%20dedicated%20fix%20to%20add%20special%20handling%20for%20single-element%20clusters%20in%20the%20scaling%20logic.)&nbsp;[![Join
 
Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/d
 iscord-bot)&nbsp;[![Share on 
X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache/superset/issues/38314)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to