- 博客(17)
- 资源 (2)
- 收藏
- 关注
原创 d3导出svg图片
svg必需放在一个div容器里var svgHeadInfo = '\n'; var svg = $('#vizContainer').find('svg')[0]; svg.setAttribute("xmlns:xlink", "http://www.w3.org/1999/xlink"); var svgS
2016-11-09 22:32:01 5848 1
原创 three.js环境下的一种飞线动画实现方法
var aCurve = createFlyLine(startPoint, endPoint, heightLimit, flyTime, lineStyle) scene.add(aCurve) function createFlyLine(startPoint, endPoint, heightLimit, flyTime, lineStyle) { var
2016-11-01 00:15:57 11952 5
原创 用THREE.Shape画二维圆角矩形
function roundedRect( shape, x, y, width, height, radius ) { shape.moveTo( x, y + radius ); shape.lineTo( x, y + height - radius ); shape.quadraticCurveTo( x, y + height, x + radius, y + heig
2016-10-23 22:34:51 5485
原创 计算THREE.Shape()生成的形状的uv,用shader material贴图
THREE.Shape()生成的形状会打破默认uv计算方式,需要重新计算才能正确应用shader的渐变色。
2016-10-23 22:10:49 2691
原创 《大数据可视化实战:d3.js深度应用》-02 开发环境配置
一、操作系统的偏好选择二、代码编辑器sublime text三、安装live-server
2015-10-11 21:33:45 4094 1
原创 selenium抓取元素排除某个特定的class标签
排除某个因素,第一优选想到正则表达式,无奈折腾半天没有成功,感觉是对元素的attrs按search在操作,$对字符串末尾检测都没什么用。语法如下:text_match((By.XPATH, "//tr[5]/td[11]/div"), r"[0,1]{1}.[0-9]{6}")BeautifulSoup可以用element[‘class’]输出元素的class进行检测,但是se
2015-08-13 13:41:27 9250
原创 百度地图API开发:大量坐标点进行分组聚合
leaflet具有markersCluster(标点聚合)的插件非常好用,偶然看到百度地图也有标点聚合开源库,尝试一下,先上效果图:交互版链接:http://guoweish.github.io/raw-map-baidu.html总结:1、优点:百度地图原生的火星坐标系和国内经过偏移的经纬度能完美歪在一起;网络访问速度比open street map快
2015-08-11 13:41:05 16629 2
原创 python网络爬虫抓取ajax动态网页数据:以抓取KFC门店地址为例
一,尝试用BeautifulSoup抓取先打开KFC网站门店列表页面:http://www.kfc.com.cn/kfccda/storelist/index.aspx可以看到门店列表如下图:打开Chrome Developer Tools观察页面结构,找到标签如下:发现要的数据位于id='listhtml'的表里,门店地址数据位于第二个tr开始的行里,尝试
2015-08-07 15:14:34 12866 4
原创 webdriver查找元素的几种方法
#通过id方式定位webdriver.find_element_by_id("kw")#通过name方式定位webdriver.find_element_by_name("wd")#通过tag name方式定位webdriver.find_element_by_tag_name("input")#通过class name 方式定位webdriver.find_element_by_clas
2015-08-04 16:10:41 1024
原创 大数据可视化系列一:可视化工具选择
在这个全民创业的火热年代,枯燥乏味的数据统计居然也靠“大数据”概念咸鱼翻身,突然变得炙手可热起来。既然大数据这么洋气,当然要好好钻研。梦想还是要有的,万一靠这发财了呢!一,数据可视化的魔力 大数据里面,我觉得最洋气的领域就是数据可视化了(其实是其它的不会...),俗话说的好,可视化就是大数据产业“长征的最后一公里”,是面向用户的最终数据体现形式,男人(用户)的唯一标准就是脸(图)好不好看
2015-08-04 12:11:36 4255 1
原创 在python中判断字符串是str还是unicode
if isinstance(iniStr , unicode ): print "unicode"elif isinstance(iniStr, str): print "str"else: print "no idea"
2015-08-03 12:22:02 12250 4
原创 gb2312网页转码输出utf-8格式文本
环境:python 2.7坑:urlopen链接读取后就要转,不能用bs解析后再转:url = "http://kfc.xixik.com/shop/shanghai/kfc"html = urllib.urlopen(url).read().decode('gbk')bsObj = BeautifulSoup(html, "html.parser")address = bsObj.
2015-07-31 21:50:29 939
原创 Atom编辑器在Ubuntu下安装(32位推荐,64位有官方deb包)
sudo add-apt-repository ppa:webupd8team/atom sudo apt-get update sudo apt-get install atom
2015-07-29 16:09:04 6762
原创 PYTHON将list或/dict对象写入txt/json文件
不能直接将list或dict对象进行写入,会出现typeError。一、写list到txt文件:ipTable = ['158.59.194.213', '18.9.14.13', '58.59.14.21']fileObject = open('sampleList.txt', 'w')for ip in ipTable: fileObject.write(ip) fileObj
2015-07-28 15:41:53 124621
原创 ubuntu下为python安装BeautifulSoup
在ubuntu上python2与3共存,为了支持2和3的开发环境,要分别安装bs。python2版本安装:sudo apt-get install python-bs4python3版本安装:sudo apt-get install python3-bs4测试:python(3)>from bs4 import beautifulSoup
2015-07-23 09:40:18 2284
原创 搭建scrapy抓取javascript动态数据的爬虫
由于简单的scrapy设置无法抓取如京东产品价格信息等javascript动态输出的数据,需要采用selenium、PhantomJS等工具辅助。运用这些工具的原理其实就是类似用浏览器打开需要爬取的网页,运行javascript产生目标数据后用scrapy进行采集。当前平台:ubuntu14.04, Python 2.7安装软件版本:selenium 2.46.1, 安装过
2015-07-22 10:52:25 4281
原创 在SVG中旋转图形,需要设置各个图形的旋转中心点
在SVG中旋转图形,需要设置各个图形的旋转中心点;基本语法源自CSS,如:div{transform:rotate(7deg);-ms-transform:rotate(7deg); /* IE 9 */-moz-transform:rotate(7deg); /* Firefox */-webkit-transform:rotate(7deg); /* Safari 和
2015-03-28 12:50:49 8742
Web Animation Using JavaScript - js网页动画-英文原版
2018-05-27
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人