Merge pull request #11508 from dataease/pr@dev-v2@chart-tooltip-carousel-fix

fix(图表): 修复地图、气泡地图地区为省份时,无法启用提示轮播的问题
This commit is contained in:
jianneng-fit2cloud 2024-08-12 18:38:50 +08:00 committed by GitHub
commit ff95ec3885
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -7,6 +7,16 @@ import { Scene } from '@antv/l7-scene'
import { deepCopy } from '@/utils/utils'
export const configCarouselTooltip = (chart, view, data, scene) => {
if (['bubble-map', 'map'].includes(chart.type)) {
data = view.source.data.dataArray
?.filter(i => i.value)
.reduce((acc, current) => {
if (!acc.some(obj => obj.adcode === current.adcode)) {
acc.push(current)
}
return acc
}, [])
}
if (carouselManagerInstances[chart.container]) {
const instances = carouselManagerInstances[chart.container]
instances.update(scene, chart, view, data)