Socket
Socket
Sign inDemoInstall

@blackywkl/vuewordcloud

Package Overview
Dependencies
0
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.2 to 1.0.3

CHANGELOG.md

2

dist/wordCloud.js

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

!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("wordCloud",[],e):"object"==typeof exports?exports.wordCloud=e():t.wordCloud=e()}("undefined"!=typeof self?self:this,function(){return function(t){function e(n){if(i[n])return i[n].exports;var o=i[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,e),o.l=!0,o.exports}var i={};return e.m=t,e.c=i,e.d=function(t,i,n){e.o(t,i)||Object.defineProperty(t,i,{configurable:!1,enumerable:!0,get:n})},e.n=function(t){var i=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(i,"a",i),i},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=1)}([function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var o=i(4),s=n(o),r=i(5),u=n(r);e.default={name:"Wordcloud",data:function(){return{id4canvas:(0,s.default)(),canvasEl:{},drawArea:{},words:[],mouse:{},canvasSize:{}}},props:{width:{type:Number,default:400},height:{type:Number,default:400},texts:{type:Array,default:[]},mouseStop:{type:Boolean,default:!1}},mounted:function(){this.$el.width=this.width,this.$el.height=this.height,this.$nextTick(function(){this.drawArea=this.$el.getContext("2d"),this.mouseStop&&this.stopByMouse(),this.setUp()})},methods:{loop:function(){window.requestAnimationFrame(this.loop),this.drawArea.clearRect(0,0,this.$el.width,this.$el.height);for(var t=0;t<this.words.length;t++)this.words[t].update(),this.words[t].draw()},setUp:function(){this.words=[];for(var t=this.texts.length-1;t>=0;t--)this.words.push(new u.default(this.texts[t].text,this.texts[t].size,this.texts[t].color,this.$el.width,this.$el.height,this.mouse,this.drawArea));window.requestAnimationFrame(this.loop)},stopByMouse:function(){var t=this;this.$el.addEventListener("mousemove",function(e){e.stopPropagation();var i=this.getBoundingClientRect();t.mouse.x=e.clientX-i.left,t.mouse.y=e.clientY-i.top})}}}},function(t,e,i){"use strict";var n=i(2),o=function(t){return t&&t.__esModule?t:{default:t}}(n),s=function t(e){arguments.length>1&&void 0!==arguments[1]&&arguments[1];t.installed||e.component(o.default.name,o.default)};"undefined"!=typeof window&&window.Vue&&s(window.Vue),t.exports={install:s,WordCloud:o.default}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=i(0),o=i.n(n);for(var s in n)"default"!==s&&function(t){i.d(e,t,function(){return n[t]})}(s);var r=i(6),u=i(3),d=u(o.a,r.a,!1,null,null,null);d.options.__file="src/wordCloud.vue",e.default=d.exports},function(t,e){t.exports=function(t,e,i,n,o,s){var r,u=t=t||{},d=typeof t.default;"object"!==d&&"function"!==d||(r=t,u=t.default);var a="function"==typeof u?u.options:u;e&&(a.render=e.render,a.staticRenderFns=e.staticRenderFns,a._compiled=!0),i&&(a.functional=!0),o&&(a._scopeId=o);var h;if(s?(h=function(t){t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,t||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),n&&n.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(s)},a._ssrRegister=h):n&&(h=n),h){var l=a.functional,f=l?a.render:a.beforeCreate;l?(a._injectStyles=h,a.render=function(t,e){return h.call(e),f(t,e)}):a.beforeCreate=f?[].concat(f,h):[h]}return{esModule:r,exports:u,options:a}}},function(t,e,i){"use strict";function n(){var t=function(){return(65536*(1+Math.random())|0).toString(16).substring(1)};return"_"+t()+t()+t()+t()+t()+t()+t()+t()}t.exports=n},function(t,e,i){"use strict";function n(){var t=Math.floor(360*Math.random());if(!(t>75&&t<105||t>170&&t<190||t>255&&t<285||t>350||t<10))return t;n()}var o={textColor:"rgb(200,200,200)",defaultFontFamily:"Microsoft YaHei",defaultSpeed:.3,variantSpeed:.1};t.exports=function(t,e,i,s,r,u,d){this.x=(.8*Math.random()+.2)*s-100,this.y=(.8*Math.random()+.2)*r,this.text=t||"test",this.size=e||parseInt(100*Math.random())+1,this.sizeText=this.size+"px "+(this.fontFamily||o.defaultFontFamily),this.speed=o.defaultSpeed+Math.random()*o.variantSpeed,this.directionAngle=n(),this.color=i||o.textColor,this.vector={x:Math.cos(this.directionAngle)*this.speed,y:Math.sin(this.directionAngle)*this.speed},this.update=function(){this.border(),u.x>=this.x&&u.x<=this.x+this.width&&u.y>=this.y-this.size&&u.y<=this.y||(this.x+=this.vector.x,this.y+=this.vector.y)},this.border=function(){(this.x+this.width>s||this.x<0)&&(this.vector.x*=-1),(this.y>=r||this.y<=this.size)&&(this.vector.y*=-1),this.y>r&&(this.y=r),this.x<0&&(this.x=0),this.y<0&&(this.y=0)},this.draw=function(){d.font=this.sizeText,d.fillText(this.text,this.x,this.y),this.width=this.width||d.measureText(this.text).width,d.fillStyle=this.color}}},function(t,e,i){"use strict";var n=function(){var t=this,e=t.$createElement;return(t._self._c||e)("canvas",{attrs:{id:t.id4canvas}})},o=[];n._withStripped=!0;var s={render:n,staticRenderFns:o};e.a=s}])});
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("wordCloud",[],e):"object"==typeof exports?exports.wordCloud=e():t.wordCloud=e()}("undefined"!=typeof self?self:this,function(){return function(t){function e(n){if(i[n])return i[n].exports;var o=i[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,e),o.l=!0,o.exports}var i={};return e.m=t,e.c=i,e.d=function(t,i,n){e.o(t,i)||Object.defineProperty(t,i,{configurable:!1,enumerable:!0,get:n})},e.n=function(t){var i=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(i,"a",i),i},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=1)}([function(t,e,i){"use strict";var n=i(5),o=i.n(n),s=i(6),r=i.n(s);e.a={name:"Wordcloud",data:function(){return{id4canvas:o()(),canvasEl:{},drawArea:{},words:[],mouse:{},canvasSize:{}}},props:{width:{type:Number,default:400},height:{type:Number,default:400},texts:{type:Array,default:[]},mouseStop:{type:Boolean,default:!1}},mounted:function(){this.$el.width=this.width,this.$el.height=this.height,this.$nextTick(function(){this.drawArea=this.$el.getContext("2d"),this.mouseStop&&this.stopByMouse(),this.setUp()})},methods:{loop:function(){window.requestAnimationFrame(this.loop),this.drawArea.clearRect(0,0,this.$el.width,this.$el.height);for(var t=0;t<this.words.length;t++)this.words[t].update(),this.words[t].draw()},setUp:function(){this.words=[];for(var t=this.texts.length-1;t>=0;t--)this.words.push(new r.a(this.texts[t].text,this.texts[t].size,this.texts[t].color,this.$el.width,this.$el.height,this.mouse,this.drawArea));window.requestAnimationFrame(this.loop)},stopByMouse:function(){var t=this;this.$el.addEventListener("mousemove",function(e){e.stopPropagation();var i=this.getBoundingClientRect();t.mouse.x=e.clientX-i.left,t.mouse.y=e.clientY-i.top})}}}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){var e=i(3),n=function t(i){arguments.length>1&&void 0!==arguments[1]&&arguments[1];t.installed||i.component(e.a.name,e.a)};"undefined"!=typeof window&&window.Vue&&n(window.Vue),t.exports={install:n,WordCloud:e.a}}.call(e,i(2)(t))},function(t,e){t.exports=function(t){if(!t.webpackPolyfill){var e=Object.create(t);e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),Object.defineProperty(e,"exports",{enumerable:!0}),e.webpackPolyfill=1}return e}},function(t,e,i){"use strict";var n=i(0),o=i(7),s=i(4),r=s(n.a,o.a,!1,null,null,null);r.options.__file="src/wordCloud.vue",e.a=r.exports},function(t,e){t.exports=function(t,e,i,n,o,s){var r,a=t=t||{},d=typeof t.default;"object"!==d&&"function"!==d||(r=t,a=t.default);var h="function"==typeof a?a.options:a;e&&(h.render=e.render,h.staticRenderFns=e.staticRenderFns,h._compiled=!0),i&&(h.functional=!0),o&&(h._scopeId=o);var u;if(s?(u=function(t){t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,t||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),n&&n.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(s)},h._ssrRegister=u):n&&(u=n),u){var c=h.functional,l=c?h.render:h.beforeCreate;c?(h._injectStyles=u,h.render=function(t,e){return u.call(e),l(t,e)}):h.beforeCreate=l?[].concat(l,u):[u]}return{esModule:r,exports:a,options:h}}},function(t,e){function i(){var t=function(){return(65536*(1+Math.random())|0).toString(16).substring(1)};return"_"+t()+t()+t()+t()+t()+t()+t()+t()}t.exports=i},function(t,e){function i(){var t=Math.floor(360*Math.random());if(!(t>75&&t<105||t>170&&t<190||t>255&&t<285||t>350||t<10))return t;i()}var n={textColor:"rgb(200,200,200)",defaultFontFamily:"Microsoft YaHei",defaultSpeed:.3,variantSpeed:.1};t.exports=function(t,e,o,s,r,a,d){this.x=(.8*Math.random()+.2)*s-100,this.y=(.8*Math.random()+.2)*r,this.text=t||"test",this.size=e||parseInt(100*Math.random())+1,this.sizeText=this.size+"px "+(this.fontFamily||n.defaultFontFamily),this.speed=n.defaultSpeed+Math.random()*n.variantSpeed,this.directionAngle=i(),this.color=o||n.textColor,this.vector={x:Math.cos(this.directionAngle)*this.speed,y:Math.sin(this.directionAngle)*this.speed},this.update=function(){this.border(),a.x>=this.x&&a.x<=this.x+this.width&&a.y>=this.y-this.size&&a.y<=this.y||(this.x+=this.vector.x,this.y+=this.vector.y)},this.border=function(){(this.x+this.width>s||this.x<0)&&(this.vector.x*=-1),(this.y>=r||this.y<=this.size)&&(this.vector.y*=-1),this.y>r&&(this.y=r),this.x<0&&(this.x=0),this.y<0&&(this.y=0)},this.draw=function(){d.font=this.sizeText,d.fillText(this.text,this.x,this.y),this.width=this.width||d.measureText(this.text).width,d.fillStyle=this.color}}},function(t,e,i){"use strict";var n=function(){var t=this,e=t.$createElement;return(t._self._c||e)("canvas",{attrs:{id:t.id4canvas}})},o=[];n._withStripped=!0;var s={render:n,staticRenderFns:o};e.a=s}])});
{
"name": "@blackywkl/vuewordcloud",
"version": "1.0.2",
"version": "1.0.3",
"description": "word cloud make by vue",

@@ -25,22 +25,21 @@ "main": "dist/wordCloud.js",

"homepage": "https://github.com/freedomlang/VueWordCloud#readme",
"dependencies": {
"vue": "^2.4.4",
"webpack": "^3.6.0"
},
"dependencies": {},
"devDependencies": {
"babel-core": "^6.26.0",
"babel-loader": "^7.1.2",
"babel-polyfill": "^6.26.0",
"babel-preset-es2015": "^6.24.1",
"cross-env": "^5.0.5",
"css-loader": "^0.28.7",
"@babel/core": "^7.0.0",
"@babel/polyfill": "^7.0.0",
"@babel/preset-env": "^7.0.0",
"babel-loader": "^8.0.0",
"cross-env": "^5.2.0",
"css-loader": "^0.28.11",
"html-webpack-plugin": "^2.30.1",
"node-sass": "^4.5.3",
"resolve-url-loader": "^2.1.0",
"node-sass": "^4.11.0",
"resolve-url-loader": "^2.3.1",
"rimraf": "^2.6.2",
"sass-loader": "^6.0.6",
"sass-loader": "^6.0.7",
"style-loader": "^0.19.0",
"vue-loader": "^13.0.5",
"vue-style-loader": "^3.0.3",
"vue-template-compiler": "^2.4.4",
"vue": "^2.5.21",
"vue-loader": "^13.7.3",
"vue-style-loader": "^3.1.2",
"vue-template-compiler": "^2.5.21",
"webpack": "^3.12.0",
"webpack-dashboard": "^2.0.0",

@@ -47,0 +46,0 @@ "webpack-dev-server": "^2.9.1"

# wordcloud for Vue
A wordcloud component for Vue,
A wordcloud component for Vue.

@@ -16,2 +16,3 @@

### Example
[![Edit @blackywkl/vuewordcloud](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/3xz78r9r66)

@@ -90,4 +91,4 @@ ```

- [ ] Add github page
- [ ] Add online demo(codesandbox)
- [ ] Add github page
- [x] Add online demo(codesandbox)
- [ ] Add test

@@ -94,0 +95,0 @@ - [ ] Add callback for click

Sorry, the diff of this file is not supported yet

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