Merge branch 'dev'
This commit is contained in:
commit
74a2309b44
1
.gitignore
vendored
1
.gitignore
vendored
@ -25,3 +25,4 @@ logs
|
||||
.wrangler
|
||||
site
|
||||
cache
|
||||
assets/location/world-topo.json
|
||||
|
||||
@ -1 +1 @@
|
||||
v20
|
||||
v20.11
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<main class="grid gap-8 lg:grid-cols-12">
|
||||
<DashboardMetricsLocations class="col-span-1 lg:col-span-8" />
|
||||
<LazyDashboardMetricsLocations class="col-span-1 lg:col-span-8" />
|
||||
<DashboardMetricsGroup
|
||||
class="lg:col-span-4"
|
||||
:tabs="['country', 'region', 'city']"
|
||||
|
||||
@ -1,20 +1,8 @@
|
||||
<script setup>
|
||||
import { VisSingleContainer, VisTopoJSONMap, VisTopoJSONMapSelectors } from '@unovis/vue'
|
||||
import { WorldMapSimplestTopoJSON } from '@unovis/ts/maps'
|
||||
import WorldMapTopoJSON from '@/assets/location/world-topo.json' // https://github.com/apache/echarts/blob/master/test/data/map/json/world.json
|
||||
import { ChartTooltip } from '@/components/ui/chart'
|
||||
|
||||
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 = country.properties
|
||||
}
|
||||
return state
|
||||
})
|
||||
|
||||
const id = inject('id')
|
||||
const startAt = inject('startAt')
|
||||
const endAt = inject('endAt')
|
||||
|
||||
@ -5,7 +5,7 @@ import withNuxt from './.nuxt/eslint.config.mjs'
|
||||
export default withNuxt(
|
||||
// antfu(),
|
||||
{
|
||||
ignores: ['components/ui'],
|
||||
ignores: ['components/ui', 'scripts/build-map.js'],
|
||||
},
|
||||
{
|
||||
rules: {
|
||||
|
||||
@ -7,15 +7,19 @@
|
||||
"scripts": {
|
||||
"dev": "nuxt dev",
|
||||
"build": "nuxt build",
|
||||
"build:map": "node scripts/build-map.js",
|
||||
"preview": "wrangler pages dev dist",
|
||||
"deploy": "wrangler pages deploy dist",
|
||||
"postinstall": "nuxt prepare",
|
||||
"postinstall": "npm run build:map && nuxt prepare",
|
||||
"lint": "eslint .",
|
||||
"lint:fix": "eslint . --fix",
|
||||
"typecheck": "nuxt typecheck",
|
||||
"wrangler": "wrangler",
|
||||
"lint-staged": "lint-staged"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=20.11.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@unovis/ts": "^1.4.1",
|
||||
"@unovis/vue": "^1.4.1",
|
||||
|
||||
@ -5,6 +5,6 @@ provide('id', ref())
|
||||
<template>
|
||||
<main class="space-y-6">
|
||||
<DashboardBreadcrumb title="Analysis" />
|
||||
<Dashboard />
|
||||
<LazyDashboard />
|
||||
</main>
|
||||
</template>
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<main class="flex items-center justify-center h-full">
|
||||
<Login />
|
||||
<LazyLogin />
|
||||
</main>
|
||||
</template>
|
||||
|
||||
17
scripts/build-map.js
Normal file
17
scripts/build-map.js
Normal file
@ -0,0 +1,17 @@
|
||||
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 = country.properties
|
||||
}
|
||||
return state
|
||||
})
|
||||
|
||||
writeFileSync(join(import.meta.dirname, '../assets/location/world-topo.json'), JSON.stringify(WorldMapTopoJSON), 'utf8')
|
||||
Loading…
Reference in New Issue
Block a user