Vous êtes sur la page 1sur 8

yEd Graph Editor Manual

Import of Excel Files


http://yed.yworks.com/support/manual/import_excel.html

T his f eat ure allows f or t he import of f iles f rom spreadsheet sof t ware like
Microsoft Excel, OpenOffice.org Calc, and Google Docs. At t he moment , yEd
can open t he f ollowing f ile f ormat s direct ly:
MS Excel 97/2000/XP (*.xls)
MS Excel 2007 (*.xlsx)
By using one of t he above ment ioned applicat ions as int ermediat e convert er,
a large number of ot her f ile f ormat s is also support ed, f or example t ext f iles
cont aining comma-separat ed values (*.csv).
In addit ion t o t he plain graph st ruct ure, i.e., t he nodes and edges, an arbit rary
number of cust om propert ies can be import ed. At t he moment , t he f ollowing
means of represent at ion are support ed: adjacency mat rix, edge list , and node
list .

Basics
T he import dialog consist s of t he set t ings panel on t he lef t -hand side and t he
spreadsheet panel on t he right -hand side.

The Spreadsheet Panel


T he spreadsheet panel shows t he f ile cont ent in one t able per sheet similar t o
ot her t ools. T he relevant dat a ranges can be select ed using t he mouse and
adopt ed int o t he mat ching set t ings it em.

The Settings Panel


T he set t ings panel consist s of t he sect ions Data and Presentation. Data
cont ains separat e groups of set t ings f or every means of represent at ion.
T hese set t ings are needed f or correct ly opening t he f ile. T he adjacency matrix
and edge list represent at ions are mut ually exclusive and a node list can be
used in combinat ion wit h bot h of t hem.
In Presentation, t here are opt ional set t ings t o cont rol t he det ails of t he
present at ion of t he graph. T he same result s can be achieved by using t he
corresponding layout algorit hms and t ools ret roact ively.

Means of Representation

T he most import ant propert ies of t he means of represent at ion available in


yEd are discussed in dedicat ed sect ions. Addit ionally, we exemplarily import a
small graph of 5 nodes, 8 edges, and some cust om propert ies t here:
Adjacency mat rix
Edge list
Node list

For more general inf ormat ion, t he Wikipedia art icle on adjacency mat rix is a
good st art ing point :
http://en.wikipedia.org/wiki/Adjacency_matrix.

Supplemental Information
Set t ings in Sect ion 'Dat a'
Set t ings in Sect ion 'Present at ion'
Frequent ly Asked Quest ions

Adjacency Matrix
T his represent at ion is based on a mat rix in which each node is relat ed t o one
row and one column. T hus, a graph of n nodes requires a mat rix of size n x n.
T he cells of t he mat rix def ine t he edges of t he graph and an edge connect ing
t he nodes i and j exist s if and only if t he cell at posit ion (i,j) is not empt y and
it s value is not equal t o 0.
T he values of cells which yield edges are provided in a cust om edge propert y.
Opt ionally, yEd can t reat t he values of t he f irst row and t he f irst column of t he
mat rix as node IDs and import t hem as cust om propert y. T ypically, t he
sequence of nodes implied by t he rows and columns is t he same. However, if
node IDs are present in bot h t he f irst row and t he f irst column, t he mapping t o
nodes respect s t hese IDs. T hereby, yEd handles dif f ering mappings f or rows
and columns correct ly, which is usef ul f or example f or bipart it e
represent at ions. T o allow addit ional cust om node propert ies besides t he
node ID, t his represent at ion can be combined wit h a node list. In t his case,
nodes f rom t he mat rix and f rom t he list are mapped according t o t he

specif ied node IDs.

Example
T he above illust rat ion shows t he represent at ion of t he example graph as an
adjacency mat rix. T he cells A4:A8 in column A and B3:F3 in row 3, which are
highlight ed in blue, cont ain node IDs, and t he ot her cells in t he range B4:F8
represent pot ent ial edges. T hus, t he result ing graph cont ains 8 edges,
def ined by t he cells of value 1. For example, t he cells C4, D4, and E4 est ablish
edges f rom Anna t o Ben, t o Chris, and t o Dan, respect ively, and t here is no
edge f rom Anna t o Elena since t he value of cell F4 is 0. T he f ollowing
screenshot shows t he set t ings f or t he import of t he example mat rix including
t he node IDs f rom t he f irst row and t he f irst column. Please not e t hat t he input
f ield Data Range cont ains t he cell range and a sheet name (here 'Mat rix 1').
Since t he node IDs in rows and columns are t he same, using only one of t hem
result s in t he same graph. For example, it is suf f icient t o specif y t he
range A4:F8 and enable t he set t ing Node IDs in First Column.

Additional Options
T ypically, t he sequence of nodes represent ed by rows and by columns is t he
same, i.e., row i and column i represent t he same node. If node IDs are present
simult aneously f or rows and f or columns, t he mapping respect s t he IDs and
t he sequences can be dif f erent . T hus, it is possible t o import bipart it e mat rix
represent at ions, f or example. Addit ionally, empt y cells are support ed and are
handled like cells of value 0. T he f ollowing example represent s a graph which
is equal t o t he example above except f or t he values of t he edge propert y.

Edge List
T his means of represent at ion describes t he graph in a list of edges. Every
edge is relat ed t o a separat e row which cont ains t he IDs of t he t wo end
nodes of t he edge and an arbit rary number of addit ional values which are
provided as cust om edge propert ies. T he sequence of t he t ypes of t he
ent ries of all rows must be ident ical, t hat is, f or example, if t he ID of t he
source node is t he second ent ry of t he f irst row, it must be t he second ent ry
of all ot her rows, t oo. T he node IDs are provided as cust om (node) propert y.
T o allow addit ional cust om node propert ies besides t he node ID, t his
represent at ion can be combined wit h a node list. In t his case, nodes f rom t he
mat rix and f rom t he list are mapped according t o t he specif ied node IDs.

Example
T he t able above shows t he represent at ion of t he example graph as edge list .
T he cells of row 3 which are highlight ed in blue cont ain t he names of cust om
edge propert ies and each f ollowing row corresponds t o one edge. In each row,
t he columns A and B indicat e t he IDs of source and t arget nodes f ollowed by
t he values of t he edge propert ies Weight and Label. For example, t he rows 4,
5, and 6 describe edges f rom Anna t o Ben, t o Chris, and t o Dan, respect ively.
If t he import ed graph does not cont ain t he edges you expect ed, please check

if you select ed t he correct columns f or t he IDs.

Node List
A node list represent s only nodes and no edges. It s main use case is t he
combinat ion wit h one of t he ot her means t o specif y addit ional node
propert ies, however, it can also be used on it s own. T he f ormat is similar t o
edge list s, but every row is relat ed t o a node. Besides t he ID of t he respect ive
node, it can cont ain an arbit rary number of addit ional values which are
provided as cust om node propert ies. Just like f or edge list s, t he sequence of
t he t ypes of t he ent ries of all rows must be ident ical, t hat is, f or example, if
t he ID of t he node is t he second ent ry of t he f irst row, it must be t he second
ent ry of all ot her rows, t oo.

Example
T he above illust rat ion shows a node list t hat is compat ible wit h t he example
graph. T he cells of row 3 which are highlight ed in blue cont ain t he names of
cust om node propert ies and each f ollowing row corresponds t o one node. T he
values in column A (t he propert y Name) can be used as node IDs t o mat ch
each row and it s corresponding node t o a node f rom anot her t ype of
represent at ion. If t here are IDs in t he node list which do not mat ch t o nodes of
anot her represent at ion, addit ional nodes are creat ed f or t hem. Accordingly, if
a node list is used wit hout an addit ional represent at ion, t he result ing graph will
cont ain unconnect ed nodes only.

Settings in Section 'Data'


Edge Representation
Det ermines t he means of represent at ion of t he edges. Available opt ions are
adjacency mat rix and edge list . Not e t hat a node list can be combined wit h
any of t hese.

Data Range of Adjacency Matrix


Det ermines t he range of cells which cont ains an adjacency mat rix. If t he
aspect rat io of t he specif ied range is invalid, empt y cells are used t o pad t he
short er direct ion.

Node IDs in First Row / Column


Specif ies whet her t he f irst row (column) of t he dat a range cont ains node IDs.
Such header rows (columns) are ignored when creat ing edges.

Data Range of Edge List


Det ermines t he range of cells which cont ains an edge list . In order t o creat e a
graph, t he columns of source and t arget IDs are also required. Besides t hese
IDs, each row may cont ain an arbit rary number of cust om propert ies.

Column of Source / Target ID


Det ermines which column cont ains t he ID of t he source node (t arget node).
For convenience, 'Adopt ' ut ilizes t he column of t he lef t cell of t he current
select ion. T heref ore, it is not necessary t o select exact ly t he respect ive cells.

Property Names in First Row


Specif ies whet her t he f irst row of t he dat a range cont ains propert y names.
Such a header row is ignored when creat ing edges.

Data Range of Node List

Det ermines t he range of cells which cont ains a node list . If a node list is used
in combinat ion wit h anot her represent at ion, t he column of node IDs is required
t o mat ch corresponding nodes of t he t wo represent at ions. Besides t he ID,
each row may cont ain an arbit rary number of cust om propert ies.

Column of Node ID
Det ermines which column cont ains t he ID of t he node. For convenience,
'Adopt ' ut ilizes t he column of t he lef t cell of t he current select ion. T heref ore, it
is not necessary t o select exact ly t he respect ive cells.

Property Names in First Row


Specif ies whet her t he f irst row of t he dat a range cont ains propert y names.
Such a header row is ignored when creat ing nodes.

Settings in Section 'Presentation'


T he set t ings on t his t ab enable you t o det ermine t he visual represent at ion of
newly creat ed nodes and edges. Addit ionally, you can also choose t he t ype of
aut omat ic layout t hat is applied t o t he graph t hat result s f rom import ing t he
spreadsheet dat a.

Nodes
T he f ollowing set t ings allow you t o specif y aspect s of t he node
represent at ion. You can use t he values of a cust om propert y as adopt ed f rom
t he spreadsheet dat a as t he label t ext of newly creat ed nodes.
Alt ernat ively, and more powerf ully, you can use a node conf igurat ion as
def ined in t he Propert ies Mapper dialog t o t urn cust om propert ies as adopt ed
f rom t he spreadsheet dat a int o visual propert ies of t he newly creat ed nodes.
Use Conf igurat ion
If enabled, one of t he node conf igurat ions as def ined in t he Propert ies
Mapper dialog will be applied t o t he nodes af t er import ing t he
spreadsheet dat a. You can choose t he conf igurat ion f rom t he dropdown combo box.
Label T ext
Allows you t o select a cust om propert y whose values are displayed as
node labels. It is also possible t o do wit hout any labels.
Fit Size t o Label
Specif ies whet her t he size of t he nodes is adjust ed t o f it t he lengt h of
it s label. Int ernally, t he t ool Fit Node to Label is used. T hus, it is
possible t o f ine-t une t he node size adjust ment by changing t he set t ings
of t he t ool.
T emplat e
Det ermines t he t emplat e f or t he visual represent at ion of t he nodes.

Alt ernat ives are t he current ly select ed sample represent at ion f rom t he
palet t e and a rect angular shape.
T he lat t er opt ions are only available when 'Use Conf igurat ion' is disabled.

Edges
T he f ollowing set t ings allow you t o specif y aspect s of t he edge
represent at ion. You can use t he values of a cust om propert y as adopt ed f rom
t he spreadsheet dat a as t he label t ext of newly creat ed edges.
Alt ernat ively, and more powerf ully, you can use a edge conf igurat ion as
def ined in t he Propert ies Mapper dialog t o t urn cust om propert ies as adopt ed
f rom t he spreadsheet dat a int o visual propert ies of t he newly creat ed edges.
Use Conf igurat ion
If enabled, one of t he edge conf igurat ions as def ined in t he Propert ies
Mapper dialog will be applied t o t he edges af t er import ing t he
spreadsheet dat a. You can choose t he conf igurat ion f rom t he dropdown combo box.
Label T ext
Allows you t o select a cust om propert y whose values are displayed as
edge labels. It is also possible t o do wit hout any labels.
T emplat e
Det ermines t he t emplat e f or t he visual represent at ion of t he edges.
Alt ernat ives are t he current ly select ed sample represent at ion f rom t he
palet t e and polyline edges wit h or wit hout t arget arrows.
T he lat t er opt ions are only available when 'Use Conf igurat ion' is disabled.

Layout
Det ermines t he init ial layout . Alt ernat ives are circular, organic, and
hierarchical layout . T he comput at ion t akes t he set t ings of t he respect ive
layout int o account . T hus, t heir cont rols can be used t o f ine-t une t he result .

Frequently Asked Questions


T here is an additional node (edge) in my imported graph. Or: One node
(edge) is missing in my imported graph.
Please check if your dat a ranges cont ain header rows and t he set t ings
'Propert y Names in First Row' f or node list and edge list are set accordingly.

Vous aimerez peut-être aussi