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
90bf132b
Commit
90bf132b
authored
Sep 04, 2009
by
Dmitry Baranovskiy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change version to 1.0 RC1
parent
459d0981
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
67 additions
and
67 deletions
+67
-67
raphael.path.methods.js
plugins/raphael.path.methods.js
+25
-63
raphael.primitives.js
plugins/raphael.primitives.js
+38
-0
raphael-min.js
raphael-min.js
+2
-2
raphael.js
raphael.js
+2
-2
No files found.
plugins/raphael.path.methods.js
View file @
90bf132b
Raphael
.
el
.
isAbsolute
=
true
;
Raphael
.
el
.
isAbsolute
=
true
;
Raphael
.
el
.
absolutely
=
function
()
{
Raphael
.
el
.
absolutely
=
function
()
{
if
(
this
.
type
!=
"path"
)
{
this
.
isAbsolute
=
1
;
return
this
;
}
this
.
isAbsolute
=
true
;
return
this
;
return
this
;
};
};
Raphael
.
el
.
relatively
=
function
()
{
Raphael
.
el
.
relatively
=
function
()
{
if
(
this
.
type
!=
"path"
)
{
this
.
isAbsolute
=
0
;
return
this
;
}
this
.
isAbsolute
=
false
;
return
this
;
return
this
;
};
};
Raphael
.
el
.
moveTo
=
function
(
x
,
y
)
{
Raphael
.
el
.
moveTo
=
function
(
x
,
y
)
{
if
(
this
.
type
!=
"path"
)
{
this
.
_last
=
{
x
:
x
,
y
:
y
};
return
this
;
return
this
.
attr
({
path
:
this
.
attrs
.
path
+
[
"m"
,
"M"
][
+
this
.
isAbsolute
]
+
parseFloat
(
x
)
+
" "
+
parseFloat
(
y
)});
}
var
d
=
this
.
isAbsolute
?
"M"
:
"m"
;
d
+=
+
parseFloat
(
x
).
toFixed
(
3
)
+
" "
+
(
+
parseFloat
(
y
).
toFixed
(
3
))
+
" "
;
this
.
attr
({
path
:
this
.
attrs
.
path
+
d
});
return
this
;
};
};
Raphael
.
el
.
lineTo
=
function
(
x
,
y
)
{
Raphael
.
el
.
lineTo
=
function
(
x
,
y
)
{
if
(
this
.
type
!=
"path"
)
{
this
.
_last
=
{
x
:
x
,
y
:
y
};
return
this
;
return
this
.
attr
({
path
:
this
.
attrs
.
path
+
[
"l"
,
"L"
][
+
this
.
isAbsolute
]
+
parseFloat
(
x
)
+
" "
+
parseFloat
(
y
)});
}
var
d
=
this
.
isAbsolute
?
"L"
:
"l"
;
d
+=
+
parseFloat
(
x
).
toFixed
(
3
)
+
" "
+
(
+
parseFloat
(
y
).
toFixed
(
3
))
+
" "
;
this
.
attr
({
path
:
this
.
attrs
.
path
+
d
});
return
this
;
};
};
Raphael
.
el
.
arcTo
=
function
(
rx
,
ry
,
large_arc_flag
,
sweep_flag
,
x
,
y
)
{
Raphael
.
el
.
arcTo
=
function
(
rx
,
ry
,
large_arc_flag
,
sweep_flag
,
x
,
y
,
angle
)
{
if
(
this
.
type
!=
"path"
)
{
this
.
_last
=
{
x
:
x
,
y
:
y
};
return
this
;
return
this
.
attr
({
path
:
this
.
attrs
.
path
+
[
"a"
,
"A"
][
+
this
.
isAbsolute
]
+
[
parseFloat
(
rx
),
parseFloat
(
ry
),
+
angle
,
large_arc_flag
,
sweep_flag
,
parseFloat
(
x
),
parseFloat
(
y
)].
join
(
" "
)});
}
var
d
=
this
.
isAbsolute
?
"A"
:
"a"
;
d
+=
[
+
parseFloat
(
rx
).
toFixed
(
3
),
+
parseFloat
(
ry
).
toFixed
(
3
),
0
,
large_arc_flag
,
sweep_flag
,
+
parseFloat
(
x
).
toFixed
(
3
),
+
parseFloat
(
y
).
toFixed
(
3
)].
join
(
" "
);
this
.
attr
({
path
:
this
.
attrs
.
path
+
d
});
return
this
;
};
};
Raphael
.
el
.
curveTo
=
function
()
{
Raphael
.
el
.
curveTo
=
function
()
{
if
(
this
.
type
!=
"path"
)
{
return
this
;
}
var
args
=
Array
.
prototype
.
splice
.
call
(
arguments
,
0
,
arguments
.
length
),
var
args
=
Array
.
prototype
.
splice
.
call
(
arguments
,
0
,
arguments
.
length
),
d
=
[
0
,
0
,
0
,
0
,
"s"
,
0
,
"c"
][
args
.
length
]
||
""
;
d
=
[
0
,
0
,
0
,
0
,
"s"
,
0
,
"c"
][
args
.
length
]
||
""
;
if
(
this
.
isAbsolute
)
{
this
.
isAbsolute
&&
(
d
=
d
.
toUpperCase
());
d
=
d
.
toUpperCase
();
this
.
_last
=
{
x
:
args
[
args
.
length
-
2
],
y
:
args
[
args
.
length
-
1
]};
}
return
this
.
attr
({
path
:
this
.
attrs
.
path
+
d
+
args
});
this
.
attr
({
path
:
this
.
attrs
.
path
+
d
+
args
});
};
Raphael
.
el
.
cplineTo
=
function
(
x
,
y
,
w
)
{
this
.
attr
({
path
:
this
.
attrs
.
path
+
[
"C"
,
this
.
_last
.
x
+
w
,
this
.
_last
.
y
,
x
-
w
,
y
,
x
,
y
]});
this
.
_last
=
{
x
:
x
,
y
:
y
};
return
this
;
return
this
;
};
};
Raphael
.
el
.
qcurveTo
=
function
()
{
Raphael
.
el
.
qcurveTo
=
function
()
{
if
(
this
.
type
!=
"path"
)
{
return
this
;
}
var
d
=
[
0
,
1
,
"t"
,
3
,
"q"
][
arguments
.
length
],
var
d
=
[
0
,
1
,
"t"
,
3
,
"q"
][
arguments
.
length
],
args
=
Array
.
prototype
.
splice
.
call
(
arguments
,
0
,
arguments
.
length
);
args
=
Array
.
prototype
.
splice
.
call
(
arguments
,
0
,
arguments
.
length
);
if
(
this
.
isAbsolute
)
{
if
(
this
.
isAbsolute
)
{
d
=
d
.
toUpperCase
();
d
=
d
.
toUpperCase
();
}
}
this
.
attr
({
path
:
this
.
attrs
.
path
+
d
+
args
})
;
this
.
_last
=
{
x
:
args
[
args
.
length
-
2
],
y
:
args
[
args
.
length
-
1
]}
;
return
this
;
return
this
.
attr
({
path
:
this
.
attrs
.
path
+
d
+
args
})
;
};
};
Raphael
.
el
.
addRoundedCorner
=
function
(
r
,
dir
)
{
Raphael
.
el
.
addRoundedCorner
=
function
(
r
,
dir
)
{
if
(
this
.
type
!=
"path"
)
{
var
rollback
=
this
.
isAbsolute
;
return
this
;
rollback
&&
this
.
relatively
();
}
this
.
_last
=
{
x
:
r
*
(
!!
(
dir
.
indexOf
(
"r"
)
+
1
)
*
2
-
1
),
y
:
r
*
(
!!
(
dir
.
indexOf
(
"d"
)
+
1
)
*
2
-
1
)};
var
rollback
=
this
.
isAbsolute
,
this
.
arcTo
(
r
,
r
,
0
,
{
"lu"
:
1
,
"rd"
:
1
,
"ur"
:
1
,
"dl"
:
1
}[
dir
]
||
0
,
this
.
_last
.
x
,
this
.
_last
.
y
);
o
=
this
;
rollback
&&
this
.
absolutely
();
if
(
rollback
)
{
this
.
relatively
();
rollback
=
function
()
{
o
.
absolutely
();
};
}
else
{
rollback
=
function
()
{};
}
this
.
arcTo
(
r
,
r
,
0
,
{
"lu"
:
1
,
"rd"
:
1
,
"ur"
:
1
,
"dl"
:
1
}[
dir
]
||
0
,
r
*
(
!!
(
dir
.
indexOf
(
"r"
)
+
1
)
*
2
-
1
),
r
*
(
!!
(
dir
.
indexOf
(
"d"
)
+
1
)
*
2
-
1
));
rollback
();
return
this
;
return
this
;
};
};
Raphael
.
el
.
andClose
=
function
()
{
Raphael
.
el
.
andClose
=
function
()
{
if
(
this
.
type
!=
"path"
)
{
return
this
.
attr
({
path
:
this
.
attrs
.
path
+
"z"
});
return
this
;
};
}
this
.
attr
({
path
:
this
.
attrs
.
path
+
"z"
});
return
this
;
};
\ No newline at end of file
plugins/raphael.primitives.js
View file @
90bf132b
...
@@ -46,4 +46,42 @@ Raphael.fn.polygon = function (cx, cy, r, n) {
...
@@ -46,4 +46,42 @@ Raphael.fn.polygon = function (cx, cy, r, n) {
};
};
Raphael
.
fn
.
line
=
function
(
x1
,
y1
,
x2
,
y2
)
{
Raphael
.
fn
.
line
=
function
(
x1
,
y1
,
x2
,
y2
)
{
return
this
.
path
([
"M"
,
x1
,
y1
,
"L"
,
x2
,
y2
]);
return
this
.
path
([
"M"
,
x1
,
y1
,
"L"
,
x2
,
y2
]);
};
Raphael
.
fn
.
drawGrid
=
function
(
x
,
y
,
w
,
h
,
wv
,
hv
,
color
)
{
color
=
color
||
"#000"
;
var
path
=
[
"M"
,
x
,
y
,
"L"
,
x
+
w
,
y
,
x
+
w
,
y
+
h
,
x
,
y
+
h
,
x
,
y
],
rowHeight
=
h
/
hv
,
columnWidth
=
w
/
wv
;
for
(
var
i
=
1
;
i
<
hv
;
i
++
)
{
path
=
path
.
concat
([
"M"
,
x
,
y
+
i
*
rowHeight
,
"L"
,
x
+
w
,
y
+
i
*
rowHeight
]);
}
for
(
var
i
=
1
;
i
<
wv
;
i
++
)
{
path
=
path
.
concat
([
"M"
,
x
+
i
*
columnWidth
,
y
,
"L"
,
x
+
i
*
columnWidth
,
y
+
h
]);
}
return
this
.
path
(
path
.
join
(
","
)).
attr
({
stroke
:
color
});
};
Raphael
.
fn
.
square
=
function
(
cx
,
cy
,
r
)
{
r
=
r
*
.
7
;
return
this
.
rect
(
cx
-
r
,
cy
-
r
,
2
*
r
,
2
*
r
);
};
Raphael
.
fn
.
triangle
=
function
(
cx
,
cy
,
r
)
{
r
*=
1.75
;
return
this
.
path
(
"M"
.
concat
(
cx
,
","
,
cy
,
"m0-"
,
r
*
.
58
,
"l"
,
r
*
.
5
,
","
,
r
*
.
87
,
"-"
,
r
,
",0z"
));
};
Raphael
.
fn
.
diamond
=
function
(
cx
,
cy
,
r
)
{
return
this
.
path
([
"M"
,
cx
,
cy
-
r
,
"l"
,
r
,
r
,
-
r
,
r
,
-
r
,
-
r
,
r
,
-
r
,
"z"
]);
};
Raphael
.
fn
.
cross
=
function
(
cx
,
cy
,
r
)
{
r
=
r
/
2.5
;
return
this
.
path
(
"M"
.
concat
(
cx
-
r
,
","
,
cy
,
"l"
,
[
-
r
,
-
r
,
r
,
-
r
,
r
,
r
,
r
,
-
r
,
r
,
r
,
-
r
,
r
,
r
,
r
,
-
r
,
r
,
-
r
,
-
r
,
-
r
,
r
,
-
r
,
-
r
,
"z"
]));
};
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
.
arrow
=
function
(
cx
,
cy
,
r
,
angle
)
{
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"
)).
rotate
(
angle
||
0
);
};
Raphael
.
fn
.
i
=
function
(
cx
,
cy
,
r
)
{
return
this
.
path
(
"M13.052,15.376c0,0.198-0.466,0.66-1.397,1.388c-0.932,0.728-1.773,1.092-2.526,1.092c-0.518,0-0.895-0.133-1.129-0.398s-0.352-0.564-0.352-0.897c0-0.209,0.031-0.404,0.092-0.583c0.062-0.179,0.13-0.361,0.204-0.546l1.758-3.646c0.099-0.209,0.169-0.379,0.213-0.509c0.043-0.129,0.064-0.244,0.064-0.342s-0.019-0.169-0.055-0.213c-0.037-0.043-0.087-0.064-0.148-0.064c-0.16,0-0.472,0.244-0.935,0.731c-0.462,0.487-0.737,0.731-0.823,0.731c-0.099,0-0.198-0.068-0.296-0.204s-0.148-0.222-0.148-0.259c0-0.123,0.117-0.324,0.352-0.602c0.234-0.277,0.531-0.57,0.888-0.879C9.135,9.892,9.521,9.627,9.971,9.38c0.45-0.247,0.848-0.37,1.194-0.37c0.555,0,0.972,0.158,1.249,0.472c0.278,0.314,0.417,0.694,0.417,1.138c0,0.185-0.019,0.382-0.056,0.592c-0.037,0.209-0.117,0.425-0.24,0.647l-1.407,3.09c-0.111,0.259-0.191,0.469-0.241,0.629c-0.049,0.161-0.074,0.271-0.074,0.333c0,0.074,0.019,0.121,0.055,0.139c0.037,0.018,0.074,0.027,0.111,0.027c0.271,0,0.589-0.194,0.953-0.583c0.364-0.389,0.595-0.583,0.694-0.583c0.086,0,0.179,0.064,0.278,0.194C13.002,15.237,13.052,15.327,13.052,15.376z M14.477,5.827c0,0.457-0.164,0.852-0.49,1.185c-0.327,0.333-0.725,0.5-1.194,0.5c-0.457,0-0.851-0.167-1.185-0.5c-0.333-0.333-0.5-0.728-0.5-1.185c0-0.456,0.167-0.851,0.5-1.184c0.333-0.333,0.728-0.5,1.185-0.5c0.469,0,0.867,0.167,1.194,0.5C14.313,4.976,14.477,5.371,14.477,5.827z"
).
translate
(
cx
-
11
,
cy
-
11
).
scale
((
r
||
20
)
/
20
);
};
};
\ No newline at end of file
raphael-min.js
View file @
90bf132b
This source diff could not be displayed because it is too large. You can
view the blob
instead.
raphael.js
View file @
90bf132b
/*
/*
* Raphael 1.0 - JavaScript Vector Library
* Raphael 1.0
RC1
- JavaScript Vector Library
*
*
* Copyright (c) 2008 - 2009 Dmitry Baranovskiy (http://raphaeljs.com)
* Copyright (c) 2008 - 2009 Dmitry Baranovskiy (http://raphaeljs.com)
* Licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) license.
* Licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) license.
...
@@ -21,7 +21,7 @@ window.Raphael = (function () {
...
@@ -21,7 +21,7 @@ window.Raphael = (function () {
availableAttrs
=
{
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
},
availableAttrs
=
{
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
=
{
cx
:
"number"
,
cy
:
"number"
,
fill
:
"colour"
,
"fill-opacity"
:
"number"
,
"font-size"
:
"number"
,
height
:
"number"
,
opacity
:
"number"
,
path
:
"path"
,
r
:
"number"
,
rotation
:
"csv"
,
rx
:
"number"
,
ry
:
"number"
,
scale
:
"csv"
,
stroke
:
"colour"
,
"stroke-opacity"
:
"number"
,
"stroke-width"
:
"number"
,
translation
:
"csv"
,
width
:
"number"
,
x
:
"number"
,
y
:
"number"
},
availableAnimAttrs
=
{
cx
:
"number"
,
cy
:
"number"
,
fill
:
"colour"
,
"fill-opacity"
:
"number"
,
"font-size"
:
"number"
,
height
:
"number"
,
opacity
:
"number"
,
path
:
"path"
,
r
:
"number"
,
rotation
:
"csv"
,
rx
:
"number"
,
ry
:
"number"
,
scale
:
"csv"
,
stroke
:
"colour"
,
"stroke-opacity"
:
"number"
,
"stroke-width"
:
"number"
,
translation
:
"csv"
,
width
:
"number"
,
x
:
"number"
,
y
:
"number"
},
events
=
[
"click"
,
"dblclick"
,
"mousedown"
,
"mousemove"
,
"mouseout"
,
"mouseover"
,
"mouseup"
];
events
=
[
"click"
,
"dblclick"
,
"mousedown"
,
"mousemove"
,
"mouseout"
,
"mouseover"
,
"mouseup"
];
R
.
version
=
"1.0"
;
R
.
version
=
"1.0
RC1
"
;
R
.
type
=
(
window
.
SVGAngle
||
document
.
implementation
.
hasFeature
(
"http://www.w3.org/TR/SVG11/feature#BasicStructure"
,
"1.1"
)
?
"SVG"
:
"VML"
);
R
.
type
=
(
window
.
SVGAngle
||
document
.
implementation
.
hasFeature
(
"http://www.w3.org/TR/SVG11/feature#BasicStructure"
,
"1.1"
)
?
"SVG"
:
"VML"
);
R
.
svg
=
!
(
R
.
vml
=
R
.
type
==
"VML"
);
R
.
svg
=
!
(
R
.
vml
=
R
.
type
==
"VML"
);
R
.
idGenerator
=
0
;
R
.
idGenerator
=
0
;
...
...
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