Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
kityminder-core
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
吴志俊
kityminder-core
Commits
16a00384
Commit
16a00384
authored
Oct 27, 2014
by
techird
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加鱼骨图布局 - Kick Off
parent
d8823e40
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
106 additions
and
0 deletions
+106
-0
import.js
import.js
+2
-0
fish-bone-master.js
src/connect/fish-bone-master.js
+12
-0
fish-bone-master.js
src/layout/fish-bone-master.js
+57
-0
fish-bone.js
src/template/fish-bone.js
+35
-0
No files found.
import.js
View file @
16a00384
...
...
@@ -60,6 +60,7 @@
{
path
:
'src/layout/mind.js'
,
pack
:
'edit|share|m-share'
},
{
path
:
'src/layout/filetree.js'
,
pack
:
'edit|share|m-share'
},
{
path
:
'src/layout/btree.js'
,
pack
:
'edit|share|m-share'
},
{
path
:
'src/layout/fish-bone-master.js'
,
pack
:
'edit|share|m-share'
},
/* 连线 */
{
path
:
'src/connect/bezier.js'
,
pack
:
'edit|share|m-share'
},
...
...
@@ -78,6 +79,7 @@
{
path
:
'src/template/structure.js'
,
pack
:
'edit|share|m-share'
},
{
path
:
'src/template/filetree.js'
,
pack
:
'edit|share|m-share'
},
{
path
:
'src/template/right.js'
,
pack
:
'edit|share|m-share'
},
{
path
:
'src/template/fish-bone.js'
,
pack
:
'edit|share|m-share'
},
/* 模块 */
{
path
:
'src/module/node.js'
,
pack
:
'edit|share|m-share'
},
...
...
src/connect/fish-bone-master.js
0 → 100644
View file @
16a00384
/**
* @fileOverview
*
* 鱼骨头主干连线
*
* @author: techird
* @copyright: Baidu FEX, 2014
*/
KityMinder
.
registerConnectProvider
(
'fish-bone-master'
,
function
(
node
,
parent
,
connection
)
{
});
\ No newline at end of file
src/layout/fish-bone-master.js
0 → 100644
View file @
16a00384
/**
* @fileOverview
*
* 鱼骨图主骨架布局
*
* @author: techird
* @copyright: Baidu FEX, 2014
*/
/* global Layout:true */
KityMinder
.
registerLayout
(
'fish-bone-master'
,
kity
.
createClass
(
'FishBoneMasterLayout'
,
{
base
:
Layout
,
doLayout
:
function
(
parent
,
children
)
{
var
upPart
=
[],
downPart
=
[];
var
child
=
children
[
0
];
var
pBox
=
parent
.
getContentBox
();
parent
.
setVertexOut
(
new
kity
.
Point
(
pBox
.
right
,
pBox
.
cy
));
parent
.
setLayoutVectorOut
(
new
kity
.
Vector
(
1
,
0
));
if
(
!
child
)
return
;
var
pMarginRight
=
parent
.
getStyle
(
'margin-right'
);
var
cMarginLeft
=
child
.
getStyle
(
'margin-left'
);
var
cMarginTop
=
child
.
getStyle
(
'margin-top'
);
var
cMarginBottom
=
child
.
getStyle
(
'margin-bottom'
);
children
.
forEach
(
function
(
child
,
index
)
{
child
.
setLayoutTransform
(
new
kity
.
Matrix
());
var
cBox
=
child
.
getContentBox
();
if
(
index
%
2
)
{
downPart
.
push
(
child
);
child
.
setVertexIn
(
new
kity
.
Point
(
cBox
.
left
,
cBox
.
top
));
child
.
setLayoutVectorIn
(
new
kity
.
Vector
(
cMarginLeft
,
cMarginTop
));
}
else
{
upPart
.
push
(
child
);
child
.
setVertexIn
(
new
kity
.
Point
(
cBox
.
left
,
cBox
.
bottom
));
child
.
setLayoutVectorIn
(
new
kity
.
Vector
(
1
,
-
1
));
}
});
this
.
stack
(
upPart
,
'x'
);
this
.
stack
(
downPart
,
'x'
);
this
.
align
(
upPart
,
'bottom'
);
this
.
align
(
downPart
,
'top'
);
this
.
move
(
upPart
,
pMarginRight
+
cMarginLeft
,
-
cMarginBottom
);
this
.
move
(
downPart
,
pMarginRight
+
cMarginLeft
+
cMarginLeft
,
+
cMarginTop
);
}
}));
\ No newline at end of file
src/template/fish-bone.js
0 → 100644
View file @
16a00384
/**
* @fileOverview
*
* 默认模板 - 鱼骨头模板
*
* @author: techird
* @copyright: Baidu FEX, 2014
*/
KityMinder
.
registerTemplate
(
'fish-bone'
,
{
getLayout
:
function
(
node
)
{
if
(
node
.
getData
(
'layout'
))
return
node
.
getData
(
'layout'
);
var
level
=
node
.
getLevel
();
// 根节点
if
(
level
===
0
)
{
return
'fish-bone-master'
;
}
// 一级节点
if
(
level
===
1
)
{
return
'right'
;
}
return
node
.
parent
.
getLayout
();
},
// getConnect: function(node) {
// if (node.getLevel() == 1) return 'arc';
// return 'under';
// }
});
\ No newline at end of file
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