Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
A antv-g2 components for vue.js
npm install @antv/g2 v-g2
import Vue from 'vue';
import VG2 from 'v-g2'; // refers to components/ECharts.vue in webpack
// register component to use
Vue.component('v-g2', VG2);
require.config({
paths: {
vue: 'path/to/vue',
g2: 'path/to/g2',
'v-g2': 'path/to/v-g2',
},
});
require(['vue', 'v-g2'], function(Vue, VG2) {
// register component to use...
Vue.component('v-g2', VG2);
});
// register component to use
Vue.component('v-g2', VG2);
<template>
<v-g2 style="height:500px" :options="options"></v-g2>
</template>
<script>
import VG2 from 'v-g2';
const data = [
{ type: '未知', value: 654, percent: 0.02 },
{ type: '17 岁以下', value: 654, percent: 0.02 },
{ type: '18-24 岁', value: 4400, percent: 0.2 },
{ type: '25-29 岁', value: 5300, percent: 0.24 },
{ type: '30-39 岁', value: 6200, percent: 0.28 },
{ type: '40-49 岁', value: 3300, percent: 0.14 },
{ type: '50 岁以上', value: 1500, percent: 0.06 },
];
export default {
components: {
VG2,
},
data() {
return {
options: {
title: '不同年龄段销售额统计',
padding: [50, 20, 50, 50],
options: {
data,
scales: {
value: {
alias: '销售额(万)',
},
},
axes: {
// value: false,
type: {
label: {
style: {
fill: '#aaaaaa',
},
},
tickLine: {
alignTick: false,
length: 0,
},
},
},
annotations: [
{
type: 'dataMarker',
text: {
content: '因政策调整导致销量下滑',
style: {
fontSize: 13,
},
},
position: ['40-49 岁', 3500],
// lineLength: 30,
},
],
geometries: [
{
type: 'interval',
position: 'type*value',
style: {
opacity: 1,
},
color: 'type',
label: {
fields: ['value'],
},
},
],
},
},
};
},
};
</script>
<style>
.g2-label-item {
font-size: 12px;
text-align: center;
line-height: 0.4;
}
.g2-label-item-value {
color: #595959;
}
.g2-label-item-percent {
color: #8c8c8c;
}
</style>
chartOpt
Used to update option and data for G2 instance
viewOpt
Used to update option and data for G2 view instance
drawChart
Redraw v-g2 chart
FAQs
A vue wrapper for antv-g2
The npm package v-g2 receives a total of 0 weekly downloads. As such, v-g2 popularity was classified as not popular.
We found that v-g2 demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.