raphael参数说明

大纲

https://github.com/DmitryBaranovskiy/raphael
http://dmitrybaranovskiy.github.io/raphael/

形状

名称参数说明
rectx, y, width, height, [r]矩形
circlecx, cy, r
ellipsecx, cy, rx, ry椭圆
imagesrc, x, y, width, height图片
pathpathString路径
textx, y, text文字

事件

名称说明
click/unclick点击
dblclick/undblclick双击
hover/hover移入、移出
mousedown/unmousedown鼠标按下
mousemove/unmousemove鼠标移动
mouseup/unmouseup鼠标抬起
touchstart/untouchstart手指按下
touchmove/untouchmove手指移动
touchend/untouchend手指抬起

transform

transform以字符串形式写,例如:"t200,50r45s2"

命令说明参数
ttranslatex,y
rrotateangle
sscalex,y

路径

命令说明参数
Mmoveto(x y)+
Z闭合 
Llineto(x y)+
H横线(horizontal)x+
V竖线(vertical)y+
C曲线(curve)(x1 y1 x2 y2 x y)+
S平滑曲线(smooth)(x2 y2 x y)+
Q二次贝赛尔曲线(quadratic)(x1 y1 x y)+
T平滑二次贝塞尔曲线(x y)+
A弧线(arc)(rx ry x-axis-rotation large-arc-flag sweep-flag x y)+
R卡特莫尔罗曲线(CatmullRom)——抗锯齿平滑曲线的一种算法x1 y1 (x y)+

属性

名称类型说明
基本样式  
xnumber 
ynumber 
widthnumber 
heightheight 
rxnumber圆角x
rynumber圆角y
cxnumber圆心x
cynumber圆心y
rnumber半径
opacitynumber透明度
pathstringpath字符串
srcstring图片地址,只有image元素可用
transformstring类似transform()方法
边线样式  
strokestring边线,只能是颜色
stroke-widthnumber边线宽度
stroke-linecapstring端点形状:[“butt”, “square”, “round”]
stroke-linejoinstring接头形状:[“bevel”, “round”, “miter”]
stroke-dasharraystring边线虚线,-和.组成:"-.-"/"-"/"--.._..--"
stroke-miterlimitnumber斜接长度限制,只有当接头是miter时有效
stroke-opacitynumber边线透明度
填充样式  
fillnumber填充,可以是颜色、渐变或图片
fill-opacitynumber填充透明度
字体  
fontstring类似于css的font
font-familystring字体
font-sizenumber字体大小
font-weightstring加粗
textstringtext元素的文字内容
text-anchorstring文本对齐:[“start”, “middle”, “end”]
titlestringtext的tooltip
hrefstring链接地址
targetstring链接target
其他  
cursorstring鼠标指针,类似于css的cursor样式
arrow-endstringarrowhead on the end of the path. The format for string is [-[-]]. Possible types: classic, block, open, oval, diamond, none, width: wide, narrow, midium, length: long, short, midium.
clip-rectstringcomma or space separated values: x, y, width and height

转载于:https://www.cnblogs.com/cxmSuperman/p/10582248.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值