forked from fex-team/kityminder
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0d2dd94
commit 62ba94a
Showing
16 changed files
with
250 additions
and
310 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,6 +26,6 @@ | |
maxImageHeight: 200, | ||
|
||
// 修改后自动保存时间间隔(单位:秒);设置为 false 不自动保存 | ||
autoSave: 1000 | ||
autoSave: 2 | ||
}; | ||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,12 @@ | ||
/** | ||
* @fileOverview | ||
* | ||
* 圆弧连线 | ||
* | ||
* @author: techird | ||
* @copyright: Baidu FEX, 2014 | ||
* @author: along | ||
* @copyright: [email protected] , 2015 | ||
*/ | ||
|
||
var connectMarker = new kity.Marker().pipe(function() { | ||
var connectMarker = new kity.Marker().pipe(function () { | ||
var r = 7; | ||
var dot = new kity.Circle(r - 1); | ||
this.addShape(dot); | ||
|
@@ -16,14 +15,14 @@ var connectMarker = new kity.Marker().pipe(function() { | |
this.node.setAttribute('markerUnits', 'userSpaceOnUse'); | ||
}); | ||
|
||
KityMinder.registerConnectProvider('arc_tp', function(node, parent, connection, width, color) { | ||
KityMinder.registerConnectProvider('arc_tp', function (node, parent, connection, width, color) { | ||
var end_box = node.getLayoutBox(), | ||
start_box = parent.getLayoutBox(); | ||
|
||
|
||
if(node.getIndex()>0){ | ||
var index = node.getIndex(); | ||
start_box = parent.getChildren()[index-1].getLayoutBox(); | ||
if (node.getIndex() > 0) { | ||
var index = node.getIndex(); | ||
start_box = parent.getChildren()[index - 1].getLayoutBox(); | ||
} | ||
|
||
|
||
|
@@ -38,13 +37,13 @@ KityMinder.registerConnectProvider('arc_tp', function(node, parent, connection, | |
start = new kity.Point(start_box.cx, start_box.cy); | ||
end = new kity.Point(end_box.cx, end_box.cy); | ||
|
||
var jl = Math.sqrt(Math.abs(start.x -end.x) * Math.abs(start.x - end.x) + Math.abs(start.y -end.y) * Math.abs(start.y -end.y)); //两圆中心点距离 | ||
var jl = Math.sqrt(Math.abs(start.x - end.x) * Math.abs(start.x - end.x) + Math.abs(start.y - end.y) * Math.abs(start.y - end.y)); //两圆中心点距离 | ||
|
||
jl = node.getIndex()==0 ? jl *0.4 : jl; | ||
jl = node.getIndex() == 0 ? jl * 0.4 : jl; | ||
|
||
vector = kity.Vector.fromPoints(start, end); | ||
pathData.push('M', start); | ||
pathData.push('A', jl, jl, 0, 0 , 1, end); | ||
pathData.push('A', jl, jl, 0, 0, 1, end); | ||
|
||
connection.setMarker(connectMarker); | ||
connectMarker.dot.fill(color); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,98 +1,43 @@ | ||
/** | ||
* Created with JetBrains WebStorm. | ||
* User: chenbaolong | ||
* Date: 15-3-20 | ||
* Time: 上午11:04 | ||
* To change this template use File | Settings | File Templates. | ||
* @fileOverview | ||
* | ||
* 天盘模板 | ||
* | ||
* @author: along | ||
* @copyright: [email protected], 2015 | ||
*/ | ||
/* global Layout:true */ | ||
|
||
KityMinder.registerLayout('tianpan', kity.createClass({ | ||
base: Layout, | ||
|
||
doLayout: function(parent, children) { | ||
if(children.length==0) return; | ||
doLayout: function (parent, children) { | ||
if (children.length == 0) return; | ||
|
||
var layout = this; | ||
var pbox = parent.getContentBox(); | ||
|
||
var x, y; | ||
var _theta = 5; | ||
var _r = Math.max(pbox.width,50); | ||
children.forEach(function(child, index) { | ||
var x, y,box; | ||
var _theta = 5; | ||
var _r = Math.max(pbox.width, 50); | ||
children.forEach(function (child, index) { | ||
child.setLayoutTransform(new kity.Matrix()); | ||
var box = layout.getTreeBox(child); | ||
var w = Math.max(box.width,box.height); | ||
_r = Math.max(w,_r); | ||
box = layout.getTreeBox(child); | ||
_r = Math.max(Math.max(box.width, box.height), _r); | ||
}) | ||
_r = _r / 1.5 / Math.PI; | ||
_r = _r / 1.5 / Math.PI; | ||
|
||
children.forEach(function(child, index) { | ||
// x = _r * (Math.cos(alpha) + Math.sin(alpha)* alpha * Math.PI/180); | ||
// y = _r * (Math.sin(alpha) - Math.cos(alpha)* alpha * Math.PI/180); | ||
children.forEach(function (child, index) { | ||
x = _r * (Math.cos(_theta) + Math.sin(_theta) * _theta); | ||
y = _r * (Math.sin(_theta) - Math.cos(_theta) * _theta); | ||
|
||
_theta += (0.9 - index * 0.02); | ||
child.setLayoutVectorIn(new kity.Vector(1, 0)); | ||
child.setVertexIn(new kity.Point(pbox.left+15, pbox.cy+25)); | ||
child.setVertexIn(new kity.Point(pbox.cx, pbox.cy)); | ||
child.setLayoutTransform(new kity.Matrix()); | ||
layout.move([child],x,y); | ||
|
||
// | ||
// child.getContentBox().translate(x, y); | ||
// console.log(child.getContentBox()); | ||
// debugger | ||
|
||
|
||
// _tmp_rects.forEach(function (tmpRect) { | ||
// debugger | ||
// if (g.getIntersectBox(tmpRect,_cut_rect)) { | ||
// _cover = true; | ||
// } | ||
// }) | ||
// | ||
// if (_cover) { | ||
// _r += 2; | ||
// console.log('true') | ||
// } else { | ||
// _do = false; | ||
// _tempchilds.push({child: child, r: _r, theta: _theta, area: _cut_rect}) | ||
// _theta += 0.9; | ||
// _tmp_rects.push(_cut_rect); | ||
// } | ||
// } | ||
}); | ||
|
||
|
||
|
||
return; | ||
|
||
//debugger | ||
var layout = this; | ||
var half = Math.ceil(node.children.length / 2); | ||
var right = []; | ||
var left = []; | ||
|
||
children.forEach(function(child) { | ||
if (child.getIndex() < half) right.push(child); | ||
else left.push(child); | ||
layout.move([child], x, y); | ||
}); | ||
|
||
var leftLayout = KityMinder.getLayoutInstance('left'); | ||
var rightLayout = KityMinder.getLayoutInstance('right'); | ||
|
||
leftLayout.doLayout(node, left); | ||
rightLayout.doLayout(node, right); | ||
|
||
var box = node.getContentBox(); | ||
node.setVertexOut(new kity.Point(box.cx, box.cy)); | ||
node.setLayoutVectorOut(new kity.Vector(0, 0)); | ||
}, | ||
|
||
getOrderHint: function(node) { | ||
|
||
|
||
getOrderHint: function (node) { | ||
var hint = []; | ||
var box = node.getLayoutBox(); | ||
var offset = 5; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters