perf: Simple map
This commit is contained in:
parent
4d35186ffe
commit
426db8d149
File diff suppressed because one or more lines are too long
@ -72,7 +72,7 @@ const Tooltip = {
|
||||
>
|
||||
<VisTopoJSONMap
|
||||
:topojson="worldMapTopoJSON"
|
||||
map-feature-name="states"
|
||||
map-feature-name="countries"
|
||||
/>
|
||||
<ChartSingleTooltip
|
||||
index="id"
|
||||
|
||||
@ -1,19 +1,5 @@
|
||||
import { writeFileSync } from 'fs'
|
||||
import { join } from 'path'
|
||||
import { WorldMapSimplestTopoJSON } from '@unovis/ts/maps.js'
|
||||
import WorldMapTopoJSON from '../assets/location/world.json' with { type: "json" } // https://github.com/apache/echarts/blob/master/test/data/map/json/world.json
|
||||
|
||||
WorldMapTopoJSON.objects.states.geometries.map((state) => {
|
||||
const name = state.properties.name
|
||||
const country = WorldMapSimplestTopoJSON.objects.countries.geometries.find(country => country.properties.name === name)
|
||||
state.id = state.name || ''
|
||||
if (country) {
|
||||
state.id = country.id || ''
|
||||
state.properties = {
|
||||
name: country.properties?.name || '',
|
||||
}
|
||||
}
|
||||
return state
|
||||
})
|
||||
|
||||
writeFileSync(join(import.meta.dirname, '../public/world.json'), JSON.stringify(WorldMapTopoJSON), 'utf8')
|
||||
writeFileSync(join(import.meta.dirname, '../public/world.json'), JSON.stringify(WorldMapSimplestTopoJSON), 'utf8')
|
||||
|
||||
Loading…
Reference in New Issue
Block a user