forked from datajoint/datajoint-matlab
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy patherd.m
More file actions
32 lines (30 loc) · 688 Bytes
/
erd.m
File metadata and controls
32 lines (30 loc) · 688 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
function erd(varargin)
% ERD -- plot the entity relationship diagram of a DataJoint package.
%
% See also dj.Schema/erd, dj.Table.erd
if ~nargin
disp 'nothing to plot'
return
end
ret = dj.ERD();
for entity = varargin
if exist(entity{1}, 'class')
obj = dj.ERD(feval(entity{1}));
r = dj.config('displayDiagram_hierarchy_radius');
while min(r)>0
if r(1)>0
obj.up
r(1) = r(1)-1;
end
if r(2)>0
obj.down
r(2) = r(2)-1;
end
end
else
obj = dj.ERD(feval([entity{1} '.getSchema']));
end
ret = ret + obj;
end
ret.draw
end