1.0.0 • Published 4 years ago

demand-map v1.0.0

Weekly downloads
1
License
MIT
Repository
-
Last release
4 years ago

demand-map

Quick Start

1. Import demand-map into your vue.js project.

npm install demand-map --S

in your component:

import DemandMap from 'demand-map';

components: { DemandMap }

2. Now you have it. The simplest usage:

<div class="demand-chart">
  <demand-map :center="center" :nodes="nodes" :nodeClick="nodeClick"></demand-map>
</div>
export default {
        name: 'App',
        data(){
            return {
                center: '人民网',  // 中心label
                nodes: [
                  {
                    name: 'xxx1',  // nodeName
                    value: 10,  // nodeValue
                    color: '#4798e9' // nodeColor 非必选
                  },
                  ... // max length 30
                ]
            }
        },
        methods: {
            nodeClick(n, v){
                console.log(n, v)
            }
        }
    }
.demand-chart{
    width: 1390px;
    height: 370px;
}

argument

ParamTypeDescribe
centerString中心label
nodesArray散点数据集合,max-length: 30
nodeClickFunctionnodes点击事件,参数name&value