<commit_before><style lang="scss" scoped>
@import '~scss/web/map'
</style>

<template>
    <div class="map-demo">
        <h1>高德地图集成测试</h1>
		<div id="map-container" tabindex="0"></div>
    </div>
</template>

<script>
export default {
    name: 'svg',
    data () {
        return {
			map: null,
        }
    },
    mounted(){
		var map = new AMap.Map('map-container', {
    	    zoom: 4
    	});
		AMapUI.load(['ui/misc/PointSimplifier', 'lib/$'], function(PointSimplifier, $) {

    	    if (!PointSimplifier.supportCanvas) {
    	        alert('当前环境不支持 Canvas！');
    	        return;
    	    }

    	    var pointSimplifierIns = new PointSimplifier({

    	        zIndex: 300,
    	        map: map,
    	        //maxChildrenOfQuadNode:3,

    	        getPosition: function(item) {

    	            if (!item) {
    	                return null;
    	            }

    	            var parts = item.split(',');

    	            return [parseFloat(parts[0]), parseFloat(parts[1])];
    	        },
    	        compareDataItem: function(a, b, aIndex, bIndex) {

    	            if (aIndex === bIndex) {
    	                return 0;
    	            }

    	            return aIndex > bIndex ? -1 : 1;
    	        },
    	        getHoverTitle: function(dataItem, idx) {
    	            return '序号: ' + idx;
    	        },
    	        renderOptions: {
    	            //点的样式
    	            pointStyle: {
    	                //绘制点占据的矩形区域
    	                content: function(ctx, x, y, width, height) {

    	                //    //注意，这里的width和height可能不同于pointStyle里面的width/height， 高清屏幕下会存在比例缩放

    	                //    //这里绘制一个圆顶锥形
    	                //    var yPos = 1 / 3;
						//	

    	                //    var top = [x + width / 2, y],
    	                //        right = [x + width, y + height * yPos],
    	                //        bottom = [x + width / 2, y + height],
    	                //        left = [x, y + height * yPos];

    	                //    ctx.moveTo(left[0], left[1]);
    	                //    ctx.arcTo(top[0], top[1], right[0], right[1], width / 3);
    	                //    ctx.lineTo(right[0], right[1]);
    	                //    ctx.lineTo(bottom[0], bottom[1]);
    	                //    ctx.lineTo(left[0], left[1]);
							var yPos = 1 / 3,
    	                		left = [x, y + height * yPos];

							ctx.strokeStyle="grey";
							ctx.moveTo(x,y+height/3);
							ctx.stroke();
							//ctx.quadraticCurveTo(x+width/4,y+height*yPos*2,x+width/2,y+height);
    	                    ctx.lineTo(x+width/2, y+height);
							//ctx.quadraticCurveTo(x+3*width/4,y+height*yPos*2,x+width,y+height*yPos*2);
    	                    ctx.lineTo(x+width, y+height*yPos);
							ctx.stroke();
							ctx.beginPath();
							ctx.arc(x+width/2,y+height*yPos,width/2,Math.PI,2*Math.PI);
							ctx.stroke();
							ctx.strokeRect(x+10,y+20,20,10);
							ctx.fillStyle="#FF0000";
							ctx.fillRect(x+10,y+20,15,10);

    	                },
						//content: 'circle',
    	                //宽度
    	                width: 40,
    	                //高度
    	                height: 60,
						fillStyle: '#ffffff',
    	                //offset: ['-50%', '-100%'],
    	                offset: [-20, -60],
    	                //fillStyle: '#316395',
    	                lineWidth: 1,
    	                strokeStyle: '#000'
    	            },
    	            topNAreaStyle: {
    	                content: function(ctx, x, y, width, height) {

    	                    //绘制一个连接矩形四边中点的菱形

    	                    var yPos = 1 / 3;
<commit_msg>绘制剩余电量<commit_after><style lang="scss" scoped>
@import '~scss/web/map'
</style>

<template>
    <div class="map-demo">
        <h1>高德地图集成测试</h1>
		<div id="map-container" tabindex="0"></div>
    </div>
</template>

<script>
export default {
    name: 'svg',
    data () {
        return {
			map: null,
        }
    },
    mounted(){
		var map = new AMap.Map('map-container', {
    	    zoom: 4
    	});
		AMapUI.load(['ui/misc/PointSimplifier', 'lib/$'], function(PointSimplifier, $) {

    	    if (!PointSimplifier.supportCanvas) {
    	        alert('当前环境不支持 Canvas！');
    	        return;
    	    }

    	    var pointSimplifierIns = new PointSimplifier({

    	        zIndex: 300,
    	        map: map,
    	        //maxChildrenOfQuadNode:3,

    	        getPosition: function(item) {

    	            if (!item) {
    	                return null;
    	            }

    	            var parts = item.split(',');

    	            return [parseFloat(parts[0]), parseFloat(parts[1])];
    	        },
    	        compareDataItem: function(a, b, aIndex, bIndex) {

    	            if (aIndex === bIndex) {
    	                return 0;
    	            }

    	            return aIndex > bIndex ? -1 : 1;
    	        },
    	        getHoverTitle: function(dataItem, idx) {
    	            return '序号: ' + idx;
    	        },
    	        renderOptions: {
    	            //点的样式
    	            pointStyle: {
    	                //绘制点占据的矩形区域
    	                content: function(ctx, x, y, width, height) {

    	                //    //注意，这里的width和height可能不同于pointStyle里面的width/height， 高清屏幕下会存在比例缩放

    	                //    //这里绘制一个圆顶锥形
    	                //    var yPos = 1 / 3;
						//	

    	                //    var top = [x + width / 2, y],
    	                //        right = [x + width, y + height * yPos],
    	                //        bottom = [x + width / 2, y + height],
    	                //        left = [x, y + height * yPos];

    	                //    ctx.moveTo(left[0], left[1]);
    	                //    ctx.arcTo(top[0], top[1], right[0], right[1], width / 3);
    	                //    ctx.lineTo(right[0], right[1]);
    	                //    ctx.lineTo(bottom[0], bottom[1]);
    	                //    ctx.lineTo(left[0], left[1]);
							var yPos = 1 / 3,
    	                		left = [x, y + height * yPos];

							ctx.strokeStyle="green";
							ctx.moveTo(x,y+height/3);
							ctx.stroke();
							//ctx.quadraticCurveTo(x+width/4,y+height*yPos*2,x+width/2,y+height);
    	                    ctx.lineTo(x+width/2, y+height);
							//ctx.quadraticCurveTo(x+3*width/4,y+height*yPos*2,x+width,y+height*yPos*2);
    	                    ctx.lineTo(x+width, y+height*yPos);
							ctx.stroke();
							ctx.beginPath();
							ctx.arc(x+width/2,y+height*yPos,width/2,Math.PI,2*Math.PI);
							ctx.stroke();
							ctx.strokeRect(x+10,y+18,20,10);
							ctx.fillStyle="#FF0000";
							ctx.fillRect(x+10,y+18,15,10);

    	                },
						//content: 'circle',
    	                //宽度
    	                width: 40,
    	                //高度
    	                height: 50,
						fillStyle: '#ffffff',
    	                //offset: ['-50%', '-100%'],
						drawPositionPoint: true,
						pointPositionStyle: 'red',
    	                offset: [-20, -55],
						getAreaScore: 3,
    	                //fillStyle: '#316395',
    	                lineWidth: 1,
    	                strokeStyle: '#000'
    	            },
					pointHardcoreStyle:{
						fillStyle: 'red',
					},
    	            topNAreaStyle: {
    	                content: function(ctx, x, y, width, height) {

    	                    //绘制一个连接矩形四边中点的菱形

    	                    var yPos = 1 / 3;

{'fraction_non_alphanumeric': 0.1449314696702402, 'fraction_numerical': 0.024290948568326774, 'mean_word_length': 1.1356128658359896, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 27, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7622705', 'n_tokens_mistral': 2915, 'n_tokens_neox': 2564, 'n_words': 397}