npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

vue-data-map

v0.1.2

Published

A configurable Vue 3 data dashboard component (KPI cards + multi-type charts + China map) powered by ECharts.

Readme

vue-data-map

npm license

A configurable Vue 3 data dashboard component — KPI cards + multi-type charts + China heat map — powered by ECharts. One schema in, full dashboard out.

一份 schema 即可渲染一整页带指标卡、多种图表与中国地图的运营看板,支持深浅色主题、响应式 12 栅格布局。

✨ Features

  • 📊 7 chart types built-in shorthand: bar · line · pie · gauge · radar · scatter · map (+ custom 任意 ECharts option)
  • 🎯 KPI metrics strip with delta arrows, sparklines, accent bars
  • 🌗 Light / Dark theme + customizable palette
  • 📐 12-column responsive grid, mobile-friendly
  • 🔌 ECharts is a peerDependency — no double bundling
  • 📦 ~13 KB ESM (gzip ~3.8 KB), TypeScript-first

📦 Install

npm i vue-data-map echarts
# or
pnpm add vue-data-map echarts

vueecharts 是 peerDependencies,请确保你的项目已安装。

🚀 Quick Start

<script setup lang="ts">
import { DataMap, type DataMapSchema } from 'vue-data-map';
import 'vue-data-map/style.css';

// If you use the China map widget, register it once at app boot:
import * as echarts from 'echarts';
import chinaJson from '@/assets/china.json'; // download from https://geo.datav.aliyun.com/areas_v3/bound/100000_full.json
echarts.registerMap('china', chinaJson);

const schema: DataMapSchema = {
  title: '销售运营数据看板',
  subtitle: '统计周期:2026-Q2',
  metrics: [
    { label: '总销售额', value: '¥ 3,128,450', delta: 0.124, spark: [120,132,101,134,90,230,210,256] },
    { label: '订单总数', value: 18452, delta: 0.082 },
    { label: '客单价',   value: '¥ 169.5', delta: -0.021 }
  ],
  widgets: [
    {
      type: 'line', title: '月度营收', span: 8,
      data: {
        categories: ['1月','2月','3月','4月','5月'],
        series: [{ name: '营收', data: [210, 230, 270, 245, 320], area: true }]
      }
    },
    {
      type: 'pie', title: '渠道占比', span: 4,
      data: { series: [{ name: '官网', value: 40 }, { name: '抖音', value: 35 }, { name: '京东', value: 25 }] }
    }
  ]
};
</script>

<template>
  <DataMap :schema="schema" :theme="{ mode: 'light' }" />
</template>

📚 API

<DataMap> Props

| Prop | Type | Default | Description | |----------|------------------|------------------|-------------| | schema | DataMapSchema | required | Dashboard definition | | theme | DataMapTheme | { mode: 'light' } | Theme override |

DataMapSchema

interface DataMapSchema {
  title?: string;
  subtitle?: string;
  metrics?: MetricItem[];
  widgets?: ChartWidget[];
}

interface MetricItem {
  label: string;
  value: string | number;
  unit?: string;
  delta?: number;          // e.g. 0.123 → +12.3%
  trend?: 'up' | 'down' | 'flat';
  description?: string;
  color?: string;          // accent override
  spark?: number[];        // tiny inline trend
}

interface ChartWidget {
  type: 'bar' | 'line' | 'pie' | 'gauge' | 'map' | 'radar' | 'scatter' | 'custom';
  title?: string;
  subtitle?: string;
  span?: number;           // 1..12 grid columns, default 6
  minHeight?: number;      // px, default 280
  data?: any;              // shorthand payload (see below)
  option?: EChartsOption;  // OR pass a full ECharts option (overrides data)
}

Shorthand data payloads

| type | Shape | |-----------|-------| | bar / line | { categories: string[]; series: { name: string; data: number[]; area?: boolean }[] } | | pie | { series: { name: string; value: number }[] } | | gauge | { value: number; max?: number; name?: string } | | radar | { indicator: { name: string; max: number }[]; series: { name: string; value: number[] }[] } | | scatter | { series: { name: string; data: [number, number][]; symbolSize?: number }[] } | | map | { mapName: string; data: { name: string; value: number }[]; min?: number; max?: number } | | custom | use option instead |

Theme

interface DataMapTheme {
  mode?: 'light' | 'dark';
  primary?: string;
  danger?: string;
  background?: string;
  cardBackground?: string;
  textColor?: string;
  mutedColor?: string;
}

🗺️ Using the China map

vue-data-map ships without any GeoJSON to keep bundle size minimal. Register the map you need once at app startup:

import * as echarts from 'echarts';
import chinaJson from './assets/china.json';
echarts.registerMap('china', chinaJson);

Then use mapName: 'china' in your widget. Recommended GeoJSON source: https://datav.aliyun.com/portal/school/atlas/area_selector.

⚠️ Province names in the DataV GeoJSON include suffixes like 北京市 / 广东省 / 内蒙古自治区 — your data items must use the same names.

🧩 Plugin install

import { createApp } from 'vue';
import DataMap from 'vue-data-map';
import 'vue-data-map/style.css';

createApp(App).use(DataMap).mount('#app');
// now <DataMap />, <MetricCard />, <ChartPanel /> are globally registered

📄 License

MIT © jasperliu2026ai