Socket
Socket
Sign inDemoInstall

echarts-wordcloud

Package Overview
Dependencies
2
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.3 to 1.1.0

5

package.json
{
"name": "echarts-wordcloud",
"version": "1.0.3",
"version": "1.1.0",
"description": "ECharts wordcloud extension based on wordcloud2.js",

@@ -9,4 +9,3 @@ "main": "index.js",

"dependencies": {
"echarts": "^3.2.2",
"zrender": "^3.1.2"
"echarts": "^3.6.2"
},

@@ -13,0 +12,0 @@ "repository": {

4

README.md

@@ -81,2 +81,6 @@ # [ECharts](https://github.com/ecomfe/echarts) wordcloud extension based on [wordcloud2.js](https://github.com/timdream/wordcloud2.js)

// set to true to allow word being draw partly outside of the canvas.
// Allow word bigger than the size of the canvas to be drawn
drawOutOfBounds: false,
// Global text style

@@ -83,0 +87,0 @@ textStyle: {

@@ -1,2 +0,2 @@

var echarts = require('echarts');
var echarts = require('echarts/lib/echarts');
var layoutUtil = require('echarts/lib/util/layout');

@@ -20,9 +20,23 @@

var toneSum = 0;
var toneCnt = 0;
for (var i = 0; i < imageData.data.length; i += 4) {
var tone = imageData.data[i] +
imageData.data[i + 1] +
imageData.data[i + 2];
var alpha = imageData.data[i + 3];
if (alpha > 128) {
var tone = imageData.data[i]
+ imageData.data[i + 1]
+ imageData.data[i + 2];
toneSum += tone;
++toneCnt;
}
}
var threshold = toneSum / toneCnt;
if (alpha < 128 || tone > 128 * 3) {
for (var i = 0; i < imageData.data.length; i += 4) {
var tone = imageData.data[i]
+ imageData.data[i + 1]
+ imageData.data[i + 2];
var alpha = imageData.data[i + 3];
if (alpha < 128 || tone > threshold) {
// Area not to draw

@@ -45,2 +59,3 @@ newImageData.data[i] = 0;

ctx.putImageData(newImageData, 0, 0);
console.log(maskCanvas.toDataURL());
}

@@ -113,3 +128,3 @@

drawOutOfBound: false,
drawOutOfBound: seriesModel.get('drawOutOfBound'),

@@ -144,2 +159,7 @@ shuffle: false,

canvas.removeEventListener('wordclouddrawn', onWordCloudDrawn);
// Abort
canvas.addEventListener('wordclouddrawn', function (e) {
// Prevent default to cancle the event and stop the loop
e.preventDefault();
});
}

@@ -146,0 +166,0 @@ };

var completeDimensions = require('echarts/lib/data/helper/completeDimensions');
var echarts = require('echarts');
var echarts = require('echarts/lib/echarts');

@@ -46,2 +46,4 @@ echarts.extendSeriesModel({

drawOutOfBound: false,
textStyle: {

@@ -53,2 +55,2 @@ normal: {

}
});
});

@@ -1,2 +0,2 @@

var echarts = require('echarts');
var echarts = require('echarts/lib/echarts');

@@ -91,2 +91,2 @@ function getShallow(model, path) {

}
});
});

@@ -14,4 +14,4 @@ var PROD = process.argv.indexOf('-p') >= 0;

externals: {
'echarts': 'echarts'
'echarts/lib/echarts': 'echarts'
}
};

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc