Merge branch 'dev'
This commit is contained in:
commit
74a2309b44
10 changed files with 28 additions and 18 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -25,3 +25,4 @@ logs
|
||||||
.wrangler
|
.wrangler
|
||||||
site
|
site
|
||||||
cache
|
cache
|
||||||
|
assets/location/world-topo.json
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
v20
|
v20.11
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<main class="grid gap-8 lg:grid-cols-12">
|
<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
|
<DashboardMetricsGroup
|
||||||
class="lg:col-span-4"
|
class="lg:col-span-4"
|
||||||
:tabs="['country', 'region', 'city']"
|
:tabs="['country', 'region', 'city']"
|
||||||
|
|
|
||||||
|
|
@ -1,20 +1,8 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { VisSingleContainer, VisTopoJSONMap, VisTopoJSONMapSelectors } from '@unovis/vue'
|
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 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'
|
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 id = inject('id')
|
||||||
const startAt = inject('startAt')
|
const startAt = inject('startAt')
|
||||||
const endAt = inject('endAt')
|
const endAt = inject('endAt')
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ import withNuxt from './.nuxt/eslint.config.mjs'
|
||||||
export default withNuxt(
|
export default withNuxt(
|
||||||
// antfu(),
|
// antfu(),
|
||||||
{
|
{
|
||||||
ignores: ['components/ui'],
|
ignores: ['components/ui', 'scripts/build-map.js'],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
rules: {
|
rules: {
|
||||||
|
|
|
||||||
|
|
@ -7,15 +7,19 @@
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "nuxt dev",
|
"dev": "nuxt dev",
|
||||||
"build": "nuxt build",
|
"build": "nuxt build",
|
||||||
|
"build:map": "node scripts/build-map.js",
|
||||||
"preview": "wrangler pages dev dist",
|
"preview": "wrangler pages dev dist",
|
||||||
"deploy": "wrangler pages deploy dist",
|
"deploy": "wrangler pages deploy dist",
|
||||||
"postinstall": "nuxt prepare",
|
"postinstall": "npm run build:map && nuxt prepare",
|
||||||
"lint": "eslint .",
|
"lint": "eslint .",
|
||||||
"lint:fix": "eslint . --fix",
|
"lint:fix": "eslint . --fix",
|
||||||
"typecheck": "nuxt typecheck",
|
"typecheck": "nuxt typecheck",
|
||||||
"wrangler": "wrangler",
|
"wrangler": "wrangler",
|
||||||
"lint-staged": "lint-staged"
|
"lint-staged": "lint-staged"
|
||||||
},
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=20.11.0"
|
||||||
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@unovis/ts": "^1.4.1",
|
"@unovis/ts": "^1.4.1",
|
||||||
"@unovis/vue": "^1.4.1",
|
"@unovis/vue": "^1.4.1",
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,6 @@ provide('id', ref())
|
||||||
<template>
|
<template>
|
||||||
<main class="space-y-6">
|
<main class="space-y-6">
|
||||||
<DashboardBreadcrumb title="Analysis" />
|
<DashboardBreadcrumb title="Analysis" />
|
||||||
<Dashboard />
|
<LazyDashboard />
|
||||||
</main>
|
</main>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<main class="flex items-center justify-center h-full">
|
<main class="flex items-center justify-center h-full">
|
||||||
<Login />
|
<LazyLogin />
|
||||||
</main>
|
</main>
|
||||||
</template>
|
</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 a new issue