Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
alvin-hh committed Apr 7, 2015
2 parents 9e22c0b + 7160ba3 commit ac560a2
Show file tree
Hide file tree
Showing 26 changed files with 564 additions and 567 deletions.
4 changes: 2 additions & 2 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ module.exports = function(grunt) {
"js/util/scale.js",
"js/util/color.js",
"js/util/svgbase.js",
"js/util/svg.js",
"js/util/svg3d.js"
"js/util/svg3d.js",
"js/util/svg.js"
];

var ui_src = [
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jui",
"version": "1.3.4",
"version": "1.3.4.1",
"main": "jui.min.js",
"ignore": [
".jshintrc",
Expand Down
2 changes: 1 addition & 1 deletion js/chart/builder.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
jui.defineUI("chart.builder", [ "jquery", "util.base", "util.svg3d", "util.color", "chart.axis" ],
jui.defineUI("chart.builder", [ "jquery", "util.base", "util.svg", "util.color", "chart.axis" ],
function($, _, SVGUtil, ColorUtil, Axis) {

/**
Expand Down
2 changes: 1 addition & 1 deletion js/util/svg.js
Original file line number Diff line number Diff line change
Expand Up @@ -377,4 +377,4 @@ jui.define("util.svg",
}

return SVG;
}, "util.svg.base");
}, "util.svg.3d");
45 changes: 21 additions & 24 deletions js/util/svg3d.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
jui.define("util.svg3d", [ "util.base", "util.math", "util.color", "util.svg" ], function(_, math, color, SVGUtil) {
var SVG3D = function(rootElem, rootAttr) {
var svg = new SVGUtil(rootElem, rootAttr);

// SVG 유틸 상속
this.__proto__ = svg;
jui.define("util.svg.3d", [ "util.base", "util.math", "util.color" ], function(_, math, color) {
var SVG3d = function() {

// 3D 사각형 그리기
this.rect3d = function(fill, width, height, degree, depth) {
var self = this;

var radian = math.radian(degree),
x1 = 0,
y1 = 0,
Expand All @@ -18,24 +16,24 @@ jui.define("util.svg3d", [ "util.base", "util.math", "util.color", "util.svg" ],
w2 = width + x2,
h2 = height + y2;

var g = svg.group({}, function() {
svg.path({
var g = self.group({}, function() {
self.path({
fill: color.lighten(fill, 0.15),
stroke: color.lighten(fill, 0.15)
}).MoveTo(x2, x1)
.LineTo(w2, y1)
.LineTo(w1, y2)
.LineTo(x1, y2);

svg.path({
self.path({
fill: fill,
stroke: fill
}).MoveTo(x1, y2)
.LineTo(x1, h2)
.LineTo(w1, h2)
.LineTo(w1, y2);

svg.path({
self.path({
fill: color.darken(fill, 0.2),
stroke: color.darken(fill, 0.2)
}).MoveTo(w1, h2)
Expand All @@ -49,6 +47,8 @@ jui.define("util.svg3d", [ "util.base", "util.math", "util.color", "util.svg" ],

// 3D 타원 그리기
this.cylinder3d = function(fill, width, height, degree, depth, rate) {
var self = this;

var radian = math.radian(degree),
rate = (rate == undefined) ? 1 : (rate == 0) ? 0.01 : rate,
r = width / 2,
Expand All @@ -57,8 +57,8 @@ jui.define("util.svg3d", [ "util.base", "util.math", "util.color", "util.svg" ],
d = (Math.sin(radian) * depth) / 2,
key = _.createId("cylinder3d");

var g = svg.group({}, function() {
svg.ellipse({
var g = self.group({}, function() {
self.ellipse({
fill: color.darken(fill, 0.05),
"fill-opacity": 0.85,
stroke: color.darken(fill, 0.05),
Expand All @@ -68,7 +68,7 @@ jui.define("util.svg3d", [ "util.base", "util.math", "util.color", "util.svg" ],
cy: height
}).translate(l, d);

svg.path({
self.path({
fill: "url(#" + key + ")",
"fill-opacity": 0.85,
stroke: fill
Expand All @@ -79,7 +79,7 @@ jui.define("util.svg3d", [ "util.base", "util.math", "util.color", "util.svg" ],
.Arc(r + tr, d, 0, 0, 1, r - tr, d)
.translate(l, d);

svg.ellipse({
self.ellipse({
fill: color.lighten(fill, 0.2),
"fill-opacity": 0.95,
stroke: color.lighten(fill, 0.2),
Expand All @@ -89,26 +89,26 @@ jui.define("util.svg3d", [ "util.base", "util.math", "util.color", "util.svg" ],
cy: d
}).translate(l, d);

svg.linearGradient({
self.linearGradient({
id: key,
x1: "100%",
x2: "0%",
y1: "0%",
y2: "0%"
}, function() {
svg.stop({
self.stop({
offset: "0%",
"stop-color": color.lighten(fill, 0.15)
});
svg.stop({
self.stop({
offset: "33.333333333333336%",
"stop-color": color.darken(fill, 0.2)
});
svg.stop({
self.stop({
offset: "66.66666666666667%",
"stop-color": color.darken(fill, 0.2)
});
svg.stop({
self.stop({
offset: "100%",
"stop-color": color.lighten(fill, 0.15)
});
Expand All @@ -119,8 +119,5 @@ jui.define("util.svg3d", [ "util.base", "util.math", "util.color", "util.svg" ],
}
}

// Set Alias
SVG3D.createObject = SVGUtil.createObject;

return SVG3D;
});
return SVG3d;
}, "util.svg.base");
Loading

0 comments on commit ac560a2

Please sign in to comment.