Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
R
raphael
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nhn
raphael
Commits
f1d24342
Commit
f1d24342
authored
Jan 18, 2010
by
Dmitry Baranovskiy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.3.1 Fixed couple bugs with title, arc & subpath.
parent
a8d0f3fa
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
74 additions
and
52 deletions
+74
-52
raphael.blur.js
plugins/raphael.blur.js
+45
-33
raphael.primitives.js
plugins/raphael.primitives.js
+10
-2
raphael-min.js
raphael-min.js
+2
-2
raphael.js
raphael.js
+17
-15
No files found.
plugins/raphael.blur.js
View file @
f1d24342
...
...
@@ -5,37 +5,49 @@
* Licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) license.
*/
if
(
Raphael
.
vml
)
{
Raphael
.
el
.
blur
=
function
(
size
)
{
var
s
=
this
.
node
.
style
,
f
=
s
.
filter
;
f
=
f
.
replace
(
/ progid:
\S
+Blur
\([^\)]
+
\)
/g
,
""
);
if
(
size
!=
"none"
)
{
s
.
filter
=
f
+
" progid:DXImageTransform.Microsoft.Blur(pixelradius="
+
(
+
size
||
1.5
)
+
")"
;
s
.
margin
=
Raphael
.
format
(
"-{0}px 0 0 -{0}px"
,
Math
.
round
(
+
size
||
1.5
));
}
else
{
s
.
filter
=
f
;
s
.
margin
=
0
;
}
};
}
else
{
Raphael
.
el
.
blur
=
function
(
size
)
{
// Experimental. No WebKit support.
if
(
size
!=
"none"
)
{
var
fltr
=
$
(
"filter"
),
blur
=
$
(
"feGaussianBlur"
);
fltr
.
id
=
"r"
+
(
Raphael
.
idGenerator
++
).
toString
(
36
);
$
(
blur
,
{
stdDeviation
:
+
size
||
1.5
});
fltr
.
appendChild
(
blur
);
this
.
paper
.
defs
.
appendChild
(
fltr
);
this
.
_blur
=
fltr
;
$
(
this
.
node
,
{
filter
:
"url(#"
+
fltr
.
id
+
")"
});
}
else
{
if
(
this
.
_blur
)
{
this
.
_blur
.
parentNode
.
removeChild
(
this
.
_blur
);
delete
this
.
_blur
;
(
function
()
{
if
(
Raphael
.
vml
)
{
var
reg
=
/ progid:
\S
+Blur
\([^\)]
+
\)
/g
;
Raphael
.
el
.
blur
=
function
(
size
)
{
var
s
=
this
.
node
.
style
,
f
=
s
.
filter
;
f
=
f
.
replace
(
reg
,
""
);
if
(
size
!=
"none"
)
{
s
.
filter
=
f
+
" progid:DXImageTransform.Microsoft.Blur(pixelradius="
+
(
+
size
||
1.5
)
+
")"
;
s
.
margin
=
Raphael
.
format
(
"-{0}px 0 0 -{0}px"
,
Math
.
round
(
+
size
||
1.5
));
}
else
{
s
.
filter
=
f
;
s
.
margin
=
0
;
}
this
.
node
.
removeAttribute
(
"filter"
);
}
};
}
\ No newline at end of file
};
}
else
{
var
$
=
function
(
el
,
attr
)
{
if
(
attr
)
{
for
(
var
key
in
attr
)
if
(
attr
.
hasOwnProperty
(
key
))
{
el
.
setAttribute
(
key
,
attr
[
key
]);
}
}
else
{
return
doc
.
createElementNS
(
"http://www.w3.org/2000/svg"
,
el
);
}
};
Raphael
.
el
.
blur
=
function
(
size
)
{
// Experimental. No WebKit support.
if
(
size
!=
"none"
)
{
var
fltr
=
$
(
"filter"
),
blur
=
$
(
"feGaussianBlur"
);
fltr
.
id
=
"r"
+
(
Raphael
.
idGenerator
++
).
toString
(
36
);
$
(
blur
,
{
stdDeviation
:
+
size
||
1.5
});
fltr
.
appendChild
(
blur
);
this
.
paper
.
defs
.
appendChild
(
fltr
);
this
.
_blur
=
fltr
;
$
(
this
.
node
,
{
filter
:
"url(#"
+
fltr
.
id
+
")"
});
}
else
{
if
(
this
.
_blur
)
{
this
.
_blur
.
parentNode
.
removeChild
(
this
.
_blur
);
delete
this
.
_blur
;
}
this
.
node
.
removeAttribute
(
"filter"
);
}
};
}
})();
\ No newline at end of file
plugins/raphael.primitives.js
View file @
f1d24342
...
...
@@ -5,7 +5,7 @@
* Licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) license.
*/
Raphael
.
fn
.
g
.
star
=
function
(
cx
,
cy
,
r
,
r2
,
rays
)
{
Raphael
.
fn
.
star
=
function
(
cx
,
cy
,
r
,
r2
,
rays
)
{
r2
=
r2
||
r
*
.
382
;
rays
=
rays
||
5
;
var
points
=
[
"M"
,
cx
,
cy
+
r2
,
"L"
],
...
...
@@ -41,6 +41,14 @@ Raphael.fn.spike = function (cx, cy, rout, rin, n) {
points
.
push
(
"z"
);
return
this
.
path
(
points
);
};
Raphael
.
fn
.
polyline
=
function
()
{
var
points
=
"M"
.
concat
(
arguments
[
0
]
||
0
,
","
,
arguments
[
1
]
||
0
,
"L"
);
for
(
var
i
=
2
,
ii
=
arguments
.
length
-
1
;
i
<
ii
;
i
++
)
{
points
+=
arguments
[
i
]
+
","
+
arguments
[
++
i
];
}
arguments
[
ii
].
toLowerCase
()
==
"z"
&&
(
points
+=
"z"
);
return
this
.
path
(
points
);
};
Raphael
.
fn
.
polygon
=
function
(
cx
,
cy
,
r
,
n
)
{
n
=
+
n
<
3
||
!
n
?
5
:
n
;
var
points
=
[
"M"
,
cx
,
cy
-
r
,
"L"
],
...
...
@@ -86,6 +94,6 @@ Raphael.fn.plus = function (cx, cy, r) {
r
=
r
/
2
;
return
this
.
path
(
"M"
.
concat
(
cx
-
r
/
2
,
","
,
cy
-
r
/
2
,
"l"
,
[
0
,
-
r
,
r
,
0
,
0
,
r
,
r
,
0
,
0
,
r
,
-
r
,
0
,
0
,
r
,
-
r
,
0
,
0
,
-
r
,
-
r
,
0
,
0
,
-
r
,
"z"
]));
};
Raphael
.
fn
.
g
.
arrow
=
function
(
cx
,
cy
,
r
)
{
Raphael
.
fn
.
arrow
=
function
(
cx
,
cy
,
r
)
{
return
this
.
path
(
"M"
.
concat
(
cx
-
r
*
.
7
,
","
,
cy
-
r
*
.
4
,
"l"
,
[
r
*
.
6
,
0
,
0
,
-
r
*
.
4
,
r
,
r
*
.
8
,
-
r
,
r
*
.
8
,
0
,
-
r
*
.
4
,
-
r
*
.
6
,
0
],
"z"
));
};
raphael-min.js
View file @
f1d24342
This source diff could not be displayed because it is too large. You can
view the blob
instead.
raphael.js
View file @
f1d24342
/*!
* Raphael 1.3.
0
- JavaScript Vector Library
* Raphael 1.3.
1
- JavaScript Vector Library
*
* Copyright (c) 2008 - 2009 Dmitry Baranovskiy (http://raphaeljs.com)
* Licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) license.
*/
window
.
Raphael
=
(
function
()
{
Raphael
=
(
function
()
{
var
separator
=
/
[
,
]
+/
,
elements
=
/^
(
circle|rect|path|ellipse|text|image
)
$/
,
doc
=
document
,
...
...
@@ -61,7 +61,7 @@ window.Raphael = (function () {
availableAttrs
=
{
"clip-rect"
:
"0 0 1e9 1e9"
,
cursor
:
"default"
,
cx
:
0
,
cy
:
0
,
fill
:
"#fff"
,
"fill-opacity"
:
1
,
font
:
'10px "Arial"'
,
"font-family"
:
'"Arial"'
,
"font-size"
:
"10"
,
"font-style"
:
"normal"
,
"font-weight"
:
400
,
gradient
:
0
,
height
:
0
,
href
:
"http://raphaeljs.com/"
,
opacity
:
1
,
path
:
"M0,0"
,
r
:
0
,
rotation
:
0
,
rx
:
0
,
ry
:
0
,
scale
:
"1 1"
,
src
:
""
,
stroke
:
"#000"
,
"stroke-dasharray"
:
""
,
"stroke-linecap"
:
"butt"
,
"stroke-linejoin"
:
"butt"
,
"stroke-miterlimit"
:
0
,
"stroke-opacity"
:
1
,
"stroke-width"
:
1
,
target
:
"_blank"
,
"text-anchor"
:
"middle"
,
title
:
"Raphael"
,
translation
:
"0 0"
,
width
:
0
,
x
:
0
,
y
:
0
},
availableAnimAttrs
=
{
along
:
"along"
,
"clip-rect"
:
"csv"
,
cx
:
nu
,
cy
:
nu
,
fill
:
"colour"
,
"fill-opacity"
:
nu
,
"font-size"
:
nu
,
height
:
nu
,
opacity
:
nu
,
path
:
"path"
,
r
:
nu
,
rotation
:
"csv"
,
rx
:
nu
,
ry
:
nu
,
scale
:
"csv"
,
stroke
:
"colour"
,
"stroke-opacity"
:
nu
,
"stroke-width"
:
nu
,
translation
:
"csv"
,
width
:
nu
,
x
:
nu
,
y
:
nu
},
rp
=
"replace"
;
R
.
version
=
"1.3.
0
"
;
R
.
version
=
"1.3.
1
"
;
R
.
type
=
(
win
.
SVGAngle
||
doc
.
implementation
.
hasFeature
(
"http://www.w3.org/TR/SVG11/feature#BasicStructure"
,
"1.1"
)
?
"SVG"
:
"VML"
);
if
(
R
.
type
==
"VML"
)
{
var
d
=
document
.
createElement
(
"div"
);
...
...
@@ -575,6 +575,11 @@ window.Raphael = (function () {
y
=
(
y1
-
y2
)
/
2
;
rx
=
mmax
(
rx
,
math
.
abs
(
x
));
ry
=
mmax
(
ry
,
math
.
abs
(
y
));
var
h
=
(
x
*
x
)
/
(
rx
*
rx
)
+
(
y
*
y
)
/
(
ry
*
ry
);
if
(
h
>
1
){
rx
=
math
.
sqrt
(
h
)
*
rx
;
ry
=
math
.
sqrt
(
h
)
*
ry
;
}
var
rx2
=
rx
*
rx
,
ry2
=
ry
*
ry
,
k
=
(
large_arc_flag
==
sweep_flag
?
-
1
:
1
)
*
...
...
@@ -1077,7 +1082,7 @@ window.Raphael = (function () {
hl
[
appendChild
](
node
);
pn
=
hl
;
}
pn
.
setAttributeNS
(
o
.
Paper
[
proto
]
.
xlink
,
att
,
value
);
pn
.
setAttributeNS
(
o
.
paper
.
xlink
,
att
,
value
);
break
;
case
"cursor"
:
node
.
style
.
cursor
=
value
;
...
...
@@ -2628,11 +2633,9 @@ window.Raphael = (function () {
if
(
subpath
&&
!
subpaths
.
start
)
{
point
=
R
.
findDotsAtSegment
(
x
,
y
,
p
[
1
],
p
[
2
],
p
[
3
],
p
[
4
],
p
[
5
],
p
[
6
],
(
length
-
len
)
/
l
);
sp
+=
[
"C"
,
point
.
start
.
x
,
point
.
start
.
y
,
point
.
m
.
x
,
point
.
m
.
y
,
point
.
x
,
point
.
y
];
if
(
onlystart
)
{
return
sp
;
}
if
(
onlystart
)
return
sp
;
subpaths
.
start
=
sp
;
sp
=
[
"M"
,
point
.
x
,
point
.
y
,
"C"
,
point
.
n
.
x
,
point
.
n
.
y
,
point
.
end
.
x
,
point
.
end
.
y
,
p
[
5
],
p
[
6
]][
join
]();
sp
=
[
"M"
,
point
.
x
,
point
.
y
+
"C"
,
point
.
n
.
x
,
point
.
n
.
y
,
point
.
end
.
x
,
point
.
end
.
y
,
p
[
5
],
p
[
6
]][
join
]();
len
+=
l
;
x
=
+
p
[
5
];
y
=
+
p
[
6
];
...
...
@@ -2678,6 +2681,9 @@ window.Raphael = (function () {
};
Element
[
proto
].
getSubpath
=
function
(
from
,
to
)
{
if
(
this
.
type
!=
"path"
)
return
;
if
(
math
.
abs
(
this
.
getTotalLength
()
-
to
)
<
1
e
-
6
)
{
return
getSubpathsAtLength
(
this
.
attrs
.
path
,
from
).
end
;
}
var
a
=
getSubpathsAtLength
(
this
.
attrs
.
path
,
to
,
1
);
return
from
?
getSubpathsAtLength
(
a
,
from
).
end
:
a
;
};
...
...
@@ -3198,15 +3204,11 @@ window.Raphael = (function () {
return
token
||
E
;
};
R
.
ninja
=
function
()
{
var
r
=
win
.
Raphael
,
u
;
var
r
=
Raphael
;
if
(
oldRaphael
.
was
)
{
win
.
Raphael
=
oldRaphael
.
is
;
Raphael
=
oldRaphael
.
is
;
}
else
{
try
{
delete
win
.
Raphael
;
}
catch
(
e
)
{
win
.
Raphael
=
u
;
}
delete
Raphael
;
}
return
r
;
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment