[问题探讨]VUE项目基于Echarts Map实现下探到区级(含json数据获取方式)

本文主要是介绍[问题探讨]VUE项目基于Echarts Map实现下探到区级(含json数据获取方式),希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

需求:Echarts Map实现下探到区级(含json数据获取方式)

一,json资源下载

方式1,github clone项目获取
https://github.com/tom-wong666/echarts-map-json

方式2,访问在线示例获取
http://120.77.182.31:8091/

二,Echarts Map实现下探到区级

1,npm安装Echarts

npm install echarts

2,npm安装axios

npm install axios

3,main.js配置axios

import axios from 'axios'Vue.prototype.$http = axios.create({timeout: 25000
})

4,代码实现

<template><div><div class="map-index"><span>[</span><span class="area-item" @click="changeMapIndexCode(-1)">中国</span><template v-for="(item,key) in mapIndex"><span :key="item.code+'right'">></span><span :key="item.code" class="area-item" @click="changeMapIndexCode(key)">{{ item.name }}</span></template><span>]</span></div><div id="chinaMap" :style="{width:'100vw', height:'100vh'}"/></div>
</template><script>
import echarts from 'echarts/lib/echarts'
require('../../static/china.js')
export default {name: 'MapDemo',data () {return {mapIndex: [],mapIndexCode: '',myChart: {},areaMapping: {安徽: {code: 'anhui',children: {安庆市: {code: 'anqing'},蚌埠市: {code: 'bengbu'},亳州市: {code: 'bozhou'},池州市: {code: 'chizhou'},滁州市: {code: 'chuzhou'},阜阳市: {code: 'fuyang'},淮北市: {code: 'huaibei'},淮南市: {code: 'huainan'},合肥市: {code: 'hefei'},黄山市: {code: 'huanshan'},六安市: {code: 'liuan'},马鞍山市: {code: 'maanshan'},铜陵市: {code: 'tongling'},芜湖市: {code: 'wuhu'},宿州市: {code: 'suzhou'},宣城市: {code: 'xuancheng'}}},澳门: {code: 'aomen'},北京: {code: 'beijing'},重庆: {code: 'chongqing'},福建: {code: 'fujian',children: {宁德市: {code: 'ningde'},福州市: {code: 'fuzhou'},龙岩市: {code: 'longyan'},南平市: {code: 'nanping'},莆田市: {code: 'putian'},泉州市: {code: 'quanzhou'},三明市: {code: 'sanming'},厦门市: {code: 'shamen'},漳州市: {code: 'zhangzhou'}}},甘肃: {code: 'gansu',children: {白银市: {code: 'baiyin'},定西市: {code: 'dingxi'},甘南藏族自治州: {code: 'gannan'},嘉峪关市: {code: 'jiayuguan'},金昌市: {code: 'jinchang'},酒泉市: {code: 'jiuquan'},兰州市: {code: 'lanzhou'},临夏回族自治州: {code: 'linxia'},陇南市: {code: 'longnan'},平凉市: {code: 'pingliang'},庆阳市: {code: 'qingyang'},天水市: {code: 'tianshui'},武威市: {code: 'wuwei'},张掖市: {code: 'zhangye'}}},广东: {code: 'guangdong',children: {深圳市: {code: 'shenzhen'},东莞市: {code: 'dongguan'},潮州市: {code: 'chaozhou'},东沙群岛: {code: 'dongsha'},佛山市: {code: 'foshan'},广州市: {code: 'guangzhou'},河源市: {code: 'heyuan'},惠州市: {code: 'huizhou'},江门市: {code: 'jiangmen'},揭阳市: {code: 'jieyang'},茂名市: {code: 'maoming'},梅州市: {code: 'meizhou'},清远市: {code: 'qingyuan'},汕头市: {code: 'shantou'},汕尾市: {code: 'shanwei'},韶关市: {code: 'shaoguan'},阳江市: {code: 'yangjiang'},云浮市: {code: 'yunfu'},湛江市: {code: 'zhanjiang'},肇庆市: {code: 'zhaoqing'},中山市: {code: 'zhongshan'},珠海市: {code: 'zhuhai'}}},广西: {code: 'guangxi',children: {百色市: {code: 'baise'},北海市: {code: 'beihai'},崇左市: {code: 'chongzuo'},防城港市: {code: 'fangchenggang'},贵港市: {code: 'guigang'},桂林市: {code: 'guilin'},河池市: {code: 'hechi'},贺州市: {code: 'hezhou'},来宾市: {code: 'laibin'},柳州市: {code: 'liuzhou'},南宁市: {code: 'nanning'},钦州市: {code: 'qinzhou'},梧州市: {code: 'wuzhou'},玉林市: {code: 'yulin'}}},贵州: {code: 'guizhou',children: {安顺市: {code: 'anshun'},毕节市: {code: 'bijie'},贵阳市: {code: 'guiyang'},六盘水市: {code: 'liupanshui'},黔东南苗族侗族自治州: {code: 'qiandongnan'},黔南布依族苗族自治州: {code: 'qiannan'},黔西南布依族苗族自治州: {code: 'qianxinan'},铜仁市: {code: 'tongren'},遵义市: {code: 'zunyi'}}},海南: {code: 'hainan',children: {白沙黎族自治县: {code: 'baisha'},保亭黎族苗族自治县: {code: 'baoting'},昌江黎族自治县: {code: 'changjiang'},澄迈县: {code: 'chengmai'},儋州市: {code: 'zhanzou'},定安县: {code: 'dingan'},东方市: {code: 'dongfang'},海口市: {code: 'haikou'},乐东黎族自治县: {code: 'ledong'},临高县: {code: 'lingao'},陵水黎族自治县: {code: 'lingshui'},琼海市: {code: 'qionghai'},琼中黎族苗族自治县: {code: 'qiongzhong'},三沙市: {code: 'sansha'},三亚市: {code: 'sanya'},屯昌县: {code: 'tunchang'},万宁市: {code: 'wanning'},文昌市: {code: 'wenchang'},五指山市: {code: 'wuzhishan'}}},南海诸岛: {code: 'hainan'},河北: {code: 'hebei',children: {保定市: {code: 'baoding'},沧州市: {code: 'cangzhou'},承德市: {code: 'chengde'},邯郸市: {code: 'handan'},衡水市: {code: 'hengshui'},廊坊市: {code: 'langfang'},秦皇岛市: {code: 'qinhuangdao'},石家庄市: {code: 'shijiazhuang'},唐山市: {code: 'tangshan'},邢台市: {code: 'xingtai'},张家口市: {code: 'zhangjiakou'}}},黑龙江: {code: 'heilongjiang',children: {大庆市: {code: 'daqing'},大兴安岭地区: {code: 'daxinganling'},哈尔滨市: {code: 'haerbin'},鹤岗市: {code: 'hegang'},黑河市: {code: 'heihe'},鸡西市: {code: 'jixi'},佳木斯市: {code: 'jiamusi'},牡丹江市: {code: 'mudanjiang'},七台河市: {code: 'qitaihe'},齐齐哈尔市: {code: 'qiqihaer'},双鸭山市: {code: 'shuangyashan'},绥化市: {code: 'suihua'},伊春市: {code: 'yichun'}}},河南: {code: 'henan',children: {安阳市: {code: 'anyang'},鹤壁市: {code: 'hebi'},济源市: {code: 'jiyuan'},焦作市: {code: 'jiaozuo'},开封市: {code: 'kaifeng'},洛阳市: {code: 'luoyang'},漯河市: {code: 'luohe'},南阳市: {code: 'nanyang'},平顶山市: {code: 'pingdingshan'},濮阳市: {code: 'puyang'},三门峡市: {code: 'sanmenxia'},商丘市: {code: 'shangqiu'},新乡市: {code: 'xinxiang'},信阳市: {code: 'xinyang'},许昌市: {code: 'xuchang'},郑州市: {code: 'zhengzhou'},周口市: {code: 'zhoukou'},驻马店市: {code: 'zhumadian'}}},湖北: {code: 'hubei',children: {鄂州市: {code: 'ezhou'},恩施土家族苗族自治州: {code: 'enshitujiazu'},黄冈市: {code: 'huanggang'},黄石市: {code: 'huangshi'},荆门市: {code: 'jingmen'},荆州市: {code: 'jingzhou'},潜江市: {code: 'qianjiang'},神农架林区: {code: 'shennongjia'},十堰市: {code: 'shiyan'},随州市: {code: 'suizhou'},天门市: {code: 'tianmen'},武汉市: {code: 'wuhan'},仙桃市: {code: 'xiantao'},咸宁市: {code: 'xianning'},襄阳市: {code: 'xiangyang'},孝感市: {code: 'xiaogan'},宜昌市: {code: 'yichang'}}},湖南: {code: 'hunan',children: {常德市: {code: 'changde'},郴州市: {code: 'chenzhou'},衡阳市: {code: 'hengyang'},怀化市: {code: 'huaihua'},娄底市: {code: 'loudi'},邵阳市: {code: 'shaoyang'},湘潭市: {code: 'xiangtan'},湘西土家族苗族自治州: {code: 'xiangxitujiazumiaozu'},益阳市: {code: 'yiyang'},永州市: {code: 'yongzhou'},岳阳市: {code: 'yueyang'},张家界市: {code: 'zhangjiajie'},长沙市: {code: 'changsha'},株洲市: {code: 'zhuzhou'}}},江苏: {code: 'jiangsu',children: {常州市: {code: 'changzhou'},淮安市: {code: 'huaian'},连云港市: {code: 'lianyungang'},南京市: {code: 'nanjing'},南通市: {code: 'nantong'},苏州市: {code: 'suzhou'},泰州市: {code: 'taizhou'},无锡市: {code: 'wuxi'},宿迁市: {code: 'suqian'},徐州市: {code: 'xuzhou'},盐城市: {code: 'yancheng'},扬州市: {code: 'yangzhou'},镇江市: {code: 'zhenjiang'}}},江西: {code: 'jiangxi',children: {抚州市: {code: 'fuzhou'},赣州市: {code: 'ganzhou'},吉安市: {code: 'jian'},景德镇市: {code: 'jingdezhen'},九江市: {code: 'jiujiang'},南昌市: {code: 'nanchang'},萍乡市: {code: 'pingxiang'},上饶市: {code: 'shangrao'},新余市: {code: 'xinyu'},宜春市: {code: 'yichun'},鹰潭市: {code: 'yingtan'}}},吉林: {code: 'jilin',children: {白城市: {code: 'baicheng'},白山市: {code: 'baishan'},吉林市: {code: 'jilin'},辽源市: {code: 'liaoyuan'},四平市: {code: 'siping'},松原市: {code: 'songyuan'},通化市: {code: 'tonghua'},延边朝鲜族自治州: {code: 'yanbian'},长春市: {code: 'changchun'}}},辽宁: {code: 'liaoning',children: {鞍山市: {code: 'anshan'},本溪市: {code: 'benxi'},朝阳市: {code: 'zhaoyang'},大连市: {code: 'dalian'},丹东市: {code: 'dandong'},抚顺市: {code: 'fushun'},阜新市: {code: 'fuxin'},葫芦岛市: {code: 'huludao'},锦州市: {code: 'jinzhou'},辽阳市: {code: 'liaoyang'},盘锦市: {code: 'panjin'},沈阳市: {code: 'shenyang'},铁岭市: {code: 'tieling'},营口市: {code: 'yingkou'}}},内蒙古: {code: 'neimenggu',children: {阿拉善盟: {code: 'alashan'},巴彦淖尔市: {code: 'bayanzhuoer'},包头市: {code: 'baotou'},赤峰市: {code: 'chifeng'},鄂尔多斯市: {code: 'eerduosi'},呼和浩特市: {code: 'huhehaote'},呼伦贝尔市: {code: 'hulunbeier'},通辽市: {code: 'tongliao'},乌海市: {code: 'wuhai'},乌兰察布市: {code: 'wulanchabu'},锡林郭勒盟: {code: 'xilinguole'},兴安盟: {code: 'xingan'}}},宁夏: {code: 'ningxia',children: {中卫市: {code: 'zhongwei'},固原市: {code: 'guyuan'},石嘴山市: {code: 'shizuishan'},吴忠市: {code: 'wuzhong'},银川市: {code: 'yinchuan'}}},青海: {code: 'qinghai',children: {海东市: {code: 'haidong'},果洛藏族自治州: {code: 'guoluo'},海北藏族自治州: {code: 'haibei'},海南藏族自治州: {code: 'hainan'},海西蒙古族藏族自治州: {code: 'haixi'},黄南藏族自治州: {code: 'huangnan'},西宁市: {code: 'xining'},玉树藏族自治州: {code: 'yushu'}}},山东: {code: 'shandong',children: {滨州市: {code: 'binzhou'},德州市: {code: 'dezhou'},东营市: {code: 'dongying'},菏泽市: {code: 'hejie'},济南市: {code: 'jinan'},济宁市: {code: 'jining'},聊城市: {code: 'liaocheng'},临沂市: {code: 'linyi'},青岛市: {code: 'qingdao'},日照市: {code: 'rizhao'},泰安市: {code: 'taian'},威海市: {code: 'weihai'},潍坊市: {code: 'weifang'},烟台市: {code: 'yantai'},枣庄市: {code: 'zaozhuang'},淄博市: {code: 'zibo'}}},上海: {code: 'shanghai'},山西: {code: 'shanxi',children: {大同市: {code: 'datong'},晋城市: {code: 'jincheng'},晋中市: {code: 'jinzhong'},临汾市: {code: 'linfen'},吕梁市: {code: 'lvliang'},朔州市: {code: 'shuozhou'},太原市: {code: 'taiyuan'},忻州市: {code: 'xinzhou'},阳泉市: {code: 'yangquan'},运城市: {code: 'yuncheng'},长治市: {code: 'changzhi'}}},陕西: {code: 'shanxi1',children: {安康市: {code: 'ankang'},宝鸡市: {code: 'baoji'},汉中市: {code: 'hanzhong'},商洛市: {code: 'shangluo'},铜川市: {code: 'tongchuan'},渭南市: {code: 'weinan'},西安市: {code: 'xian'},咸阳市: {code: 'xianyang'},延安市: {code: 'yanan'},榆林市: {code: 'yulin'}}},四川: {code: 'sichuan',children: {阿坝藏族羌族自治州: {code: 'aba'},巴中市: {code: 'bazhong'},成都市: {code: 'chengdu'},达州市: {code: 'dazhou'},德阳市: {code: 'deyang'},甘孜藏族自治州: {code: 'ganzi'},广安市: {code: 'guangan'},广元市: {code: 'guangyuan'},乐山市: {code: 'leshan'},凉山彝族自治州: {code: 'liangshan'},泸州市: {code: 'luzhou'},眉山市: {code: 'meishan'},绵阳市: {code: 'mianyang'},南充市: {code: 'nanchong'},内江市: {code: 'neijiang'},攀枝花市: {code: 'panzhihua'},遂宁市: {code: 'suining'},雅安市: {code: 'yaan'},宜宾市: {code: 'yibin'},资阳市: {code: 'ziyang'},自贡市: {code: 'zigong'}}},台湾: {code: 'taiwan'},天津: {code: 'tianjin'},香港: {code: 'xianggang'},新疆: {code: 'xinjiang',children: {阿克苏地区: {code: 'akesu'},阿勒泰地区: {code: 'alatai'},巴音郭楞蒙古自治州: {code: 'bayinguoleng'},北屯市: {code: 'beitun'},博尔塔拉蒙古自治州: {code: 'boerta'},昌吉回族自治州: {code: 'changji'},和田地区: {code: 'hetian'},喀什地区: {code: 'kashen'},可克达拉市: {code: 'kekada'},克拉玛依市: {code: 'kelamayi'},克孜勒苏柯尔克孜自治州: {code: 'kezilesu'},昆玉市: {code: 'kunyu'},石河子市: {code: 'shihezi'},双河市: {code: 'shuanghe'},塔城地区: {code: 'tacheng'},铁门关市: {code: 'tiemenguan'},图木舒克市: {code: 'tumushuke'},五家渠市: {code: 'wujiaqu'},伊犁哈萨克自治州: {code: 'yili'}}},西藏: {code: 'xizang',children: {阿里地区: {code: 'ali'},昌都市: {code: 'changdu'},拉萨市: {code: 'lasa'},林芝市: {code: 'linzhi'},那曲市: {code: 'naqu'},日喀则市: {code: 'rikeze'},山南市: {code: 'shannan'}}},云南: {code: 'yunnan',children: {保山市: {code: 'baoding'},楚雄彝族自治州: {code: 'chuxiong'},大理白族自治州: {code: 'dali'},德宏傣族景颇族自治州: {code: 'dehong'},迪庆藏族自治州: {code: 'diqing'},红河哈尼族彝族自治州: {code: 'honghe'},昆明市: {code: 'kunming'},丽江市: {code: 'lijiang'},临沧市: {code: 'lincang'},怒江傈僳族自治州: {code: 'nujiang'},普洱市: {code: 'puer'},曲靖市: {code: 'qujing'},文山壮族苗族自治州: {code: 'wenshan'},西双版纳傣族自治州: {code: 'xishuangbanna'},玉溪市: {code: 'yuxi'},昭通市: {code: 'zhaotong'}}},浙江: {code: 'zhejiang',children: {杭州市: {code: 'hangzhou'},湖州市: {code: 'huzhou'},嘉兴市: {code: 'jiaxing'},金华市: {code: 'jinhua'},丽水市: {code: 'lishui'},宁波市: {code: 'ningbo'},衢州市: {code: 'quzhou'},绍兴市: {code: 'shaoxing'},台州市: {code: 'taizhou'},温州市: {code: 'wenzhou'},舟山市: {code: 'zhoushan'}}}},mapSeriesOption: {},publicMapSeriesOption: {type: 'map',z: 2,// 自定义扩展图表类型mapType: 'China',// 区域块上的labellabel: {show: true,color: '#fff',formatter: param => {return param.name}},itemStyle: {areaColor: '#669999'},layoutCenter: ['50%', '50%']}}},computed: {mapOption () {return {xAxis: {show: false,type: 'value'},yAxis: {show: false,type: 'value'},// 漫步-开启缩放和拖动roam: true,// zoom: 20,// 滚轮缩放控制scaleLimit: {min: 0.5,max: 5},tooltip: {trigger: 'item',formatter: function (e) {return e.name}},series: [this.mapSeriesOption]}}},mounted () {this.drawChinaMap([])},methods: {// 画中国地图的方法drawChinaMap (provData) {this.mapIndex = []this.mapIndexCode = -1// 如果存在则先销毁// 清空原地图,避免点击事件累加if (this.myChart.id !== undefined) {this.myChart.dispose()}this.myChart = echarts.init(document.getElementById('chinaMap'))// 这里依据屏幕大小配置const clientWidth = document.body.clientWidthlet layoutSize = '100%'if (clientWidth >= 1920) {layoutSize = '120%'} else if (clientWidth < 1920 && clientWidth >= 1600) {layoutSize = '100%'} else {layoutSize = '100%'}const specialMapSeriesOption = {// 这里决定了地图使用china.jsmap: 'china',// 需要设置layoutCenter,layoutSize才会有效layoutSize: layoutSize,data: provData}this.mapSeriesOption = Object.assign(specialMapSeriesOption,this.publicMapSeriesOption)this.myChart.setOption(this.mapOption)// 注册点击事件this.myChart.on('click', params => {this.drawProvinceMap(params.name, [])})},// 画省级地图的方法drawProvinceMap (provinceName, cityData) {const provinceCode = this.areaMapping[provinceName].codethis.mapIndex = []this.mapIndex.push({name: provinceName,code: provinceCode})this.mapIndexCode = 0// 如果存在则先销毁// 清空原地图,避免点击事件累加if (this.myChart.id !== undefined) {this.myChart.dispose()}const url = `/map/province/${provinceCode}.json`// 获取jsonthis.$http.get(url).then(res => {this.myChart = echarts.init(document.getElementById('chinaMap'))// 这里更换省级地图jsonecharts.registerMap('China', res.data)const specialMapSeriesOption = {// 需要设置layoutCenter,layoutSize才会有效layoutSize: '95%',data: cityData}this.mapSeriesOption = Object.assign(specialMapSeriesOption,this.publicMapSeriesOption)this.myChart.setOption(this.mapOption)// 调整mapIndexthis.$emit('changeMapIndex', 0, provinceName, provinceCode)// 注册点击事件this.myChart.on('click', params => {// 先确认是否有地图,有地图继续请求if (this.areaMapping[provinceName].children &&this.areaMapping[provinceName].children[params.name] &&this.areaMapping[provinceName].children[params.name].code !== undefined) {this.drawCityMap(provinceCode, this.areaMapping[provinceName].children[params.name].code, [], params.name)}})}).catch(error => {console.log(error)})},// 画城市地图的方法drawCityMap (provinceCode, cityCode, areaData, cityName) {this.mapIndex.push({name: cityName,code: cityCode})this.mapIndexCode = 1// 如果存在则先销毁// 清空原地图,避免点击事件累加if (this.myChart.id !== undefined) {this.myChart.dispose()}this.myChart = echarts.init(document.getElementById('chinaMap'))// 这里更换市级地图jsonconst url = `/map/province/${provinceCode}/${cityCode}.json`// 获取jsonthis.$http.get(url).then(res => {echarts.registerMap('China', res.data)const specialMapSeriesOption = {// 需要设置layoutCenter,layoutSize才会有效layoutSize: '95%',data: areaData}this.mapSeriesOption = Object.assign(specialMapSeriesOption,this.publicMapSeriesOption)this.myChart.setOption(this.mapOption)}).catch(error => {console.log(error)})},changeMapIndexCode (index) {if (index === this.mapIndexCode) returnswitch (index) {case -1:this.drawChinaMap()breakcase 0:this.drawProvinceMap(this.mapIndex[0].name)breakcase 1:this.drawCityMap(this.mapIndex[0].code, this.mapIndex[1].code, [], this.mapIndex[1].name)breakdefault:this.getProvinceInfo()}}}
}
</script><style scoped>.map-index {position: absolute;top: 30px;left: 30px;color: #ffcf00;z-index: 10000;font-size: 18px;display: flex;justify-content: flex-start;align-items: center;}.map-index > .area-item {cursor: pointer;border-bottom: 1px solid rgba(0,0,0,0,);padding: 0 3px;}.map-index > .area-item:hover {border-bottom: 1px solid #ffcf00;}.map-index > .svg-icon {width: 15px;height: 15px;}.download-source {color: #ff4c4c;position: absolute;top: 30px;left: 50%;margin-left: -70px;z-index: 20000;font-size: 18px;}
</style>

这篇关于[问题探讨]VUE项目基于Echarts Map实现下探到区级(含json数据获取方式)的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/909774

相关文章

Vue3 的 shallowRef 和 shallowReactive:优化性能

大家对 Vue3 的 ref 和 reactive 都很熟悉,那么对 shallowRef 和 shallowReactive 是否了解呢? 在编程和数据结构中,“shallow”(浅层)通常指对数据结构的最外层进行操作,而不递归地处理其内部或嵌套的数据。这种处理方式关注的是数据结构的第一层属性或元素,而忽略更深层次的嵌套内容。 1. 浅层与深层的对比 1.1 浅层(Shallow) 定义

大模型研发全揭秘:客服工单数据标注的完整攻略

在人工智能(AI)领域,数据标注是模型训练过程中至关重要的一步。无论你是新手还是有经验的从业者,掌握数据标注的技术细节和常见问题的解决方案都能为你的AI项目增添不少价值。在电信运营商的客服系统中,工单数据是客户问题和解决方案的重要记录。通过对这些工单数据进行有效标注,不仅能够帮助提升客服自动化系统的智能化水平,还能优化客户服务流程,提高客户满意度。本文将详细介绍如何在电信运营商客服工单的背景下进行

基于MySQL Binlog的Elasticsearch数据同步实践

一、为什么要做 随着马蜂窝的逐渐发展,我们的业务数据越来越多,单纯使用 MySQL 已经不能满足我们的数据查询需求,例如对于商品、订单等数据的多维度检索。 使用 Elasticsearch 存储业务数据可以很好的解决我们业务中的搜索需求。而数据进行异构存储后,随之而来的就是数据同步的问题。 二、现有方法及问题 对于数据同步,我们目前的解决方案是建立数据中间表。把需要检索的业务数据,统一放到一张M

这15个Vue指令,让你的项目开发爽到爆

1. V-Hotkey 仓库地址: github.com/Dafrok/v-ho… Demo: 戳这里 https://dafrok.github.io/v-hotkey 安装: npm install --save v-hotkey 这个指令可以给组件绑定一个或多个快捷键。你想要通过按下 Escape 键后隐藏某个组件,按住 Control 和回车键再显示它吗?小菜一碟: <template

关于数据埋点,你需要了解这些基本知识

产品汪每天都在和数据打交道,你知道数据来自哪里吗? 移动app端内的用户行为数据大多来自埋点,了解一些埋点知识,能和数据分析师、技术侃大山,参与到前期的数据采集,更重要是让最终的埋点数据能为我所用,否则可怜巴巴等上几个月是常有的事。   埋点类型 根据埋点方式,可以区分为: 手动埋点半自动埋点全自动埋点 秉承“任何事物都有两面性”的道理:自动程度高的,能解决通用统计,便于统一化管理,但个性化定

【 html+css 绚丽Loading 】000046 三才归元阵

前言:哈喽,大家好,今天给大家分享html+css 绚丽Loading!并提供具体代码帮助大家深入理解,彻底掌握!创作不易,如果能帮助到大家或者给大家一些灵感和启发,欢迎收藏+关注哦 💕 目录 📚一、效果📚二、信息💡1.简介:💡2.外观描述:💡3.使用方式:💡4.战斗方式:💡5.提升:💡6.传说: 📚三、源代码,上代码,可以直接复制使用🎥效果🗂️目录✍️

使用SecondaryNameNode恢复NameNode的数据

1)需求: NameNode进程挂了并且存储的数据也丢失了,如何恢复NameNode 此种方式恢复的数据可能存在小部分数据的丢失。 2)故障模拟 (1)kill -9 NameNode进程 [lytfly@hadoop102 current]$ kill -9 19886 (2)删除NameNode存储的数据(/opt/module/hadoop-3.1.4/data/tmp/dfs/na

异构存储(冷热数据分离)

异构存储主要解决不同的数据,存储在不同类型的硬盘中,达到最佳性能的问题。 异构存储Shell操作 (1)查看当前有哪些存储策略可以用 [lytfly@hadoop102 hadoop-3.1.4]$ hdfs storagepolicies -listPolicies (2)为指定路径(数据存储目录)设置指定的存储策略 hdfs storagepolicies -setStoragePo

Hadoop集群数据均衡之磁盘间数据均衡

生产环境,由于硬盘空间不足,往往需要增加一块硬盘。刚加载的硬盘没有数据时,可以执行磁盘数据均衡命令。(Hadoop3.x新特性) plan后面带的节点的名字必须是已经存在的,并且是需要均衡的节点。 如果节点不存在,会报如下错误: 如果节点只有一个硬盘的话,不会创建均衡计划: (1)生成均衡计划 hdfs diskbalancer -plan hadoop102 (2)执行均衡计划 hd

【前端学习】AntV G6-08 深入图形与图形分组、自定义节点、节点动画(下)

【课程链接】 AntV G6:深入图形与图形分组、自定义节点、节点动画(下)_哔哩哔哩_bilibili 本章十吾老师讲解了一个复杂的自定义节点中,应该怎样去计算和绘制图形,如何给一个图形制作不间断的动画,以及在鼠标事件之后产生动画。(有点难,需要好好理解) <!DOCTYPE html><html><head><meta charset="UTF-8"><title>06