Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
clowdflows
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Imène Lajili
clowdflows
Commits
82b95c03
Commit
82b95c03
authored
Feb 05, 2013
by
Anze Vavpetic
Browse files
Options
Browse Files
Download
Plain Diff
merge
parents
dabcd4aa
b2082f13
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
10 deletions
+33
-10
workflows/cforange/interaction_views.py
workflows/cforange/interaction_views.py
+10
-2
workflows/cforange/templates/interactions/cforange_hierarchical_clustering.html
...plates/interactions/cforange_hierarchical_clustering.html
+23
-8
No files found.
workflows/cforange/interaction_views.py
View file @
82b95c03
...
...
@@ -10,9 +10,17 @@ def cforange_hierarchical_clustering(request,input_dict,output_dict,widget):
matrix
=
input_dict
[
'dm'
]
linkage
=
int
(
input_dict
[
'linkage'
])
root
=
Clustering
.
hierarchical_clustering
(
linkage
,
matrix
)
attributes
=
[
x
.
name
for
x
in
matrix
.
items
.
domain
]
dm_examples
=
True
try
:
attributes
=
[
x
.
name
for
x
in
matrix
.
items
.
domain
]
except
:
attributes
=
[
'attribute'
]
dm_examples
=
False
def
build_hierarchy
(
node
,
root
=
False
):
values_dict
=
dict
([(
x
,
matrix
.
items
[
node
.
first
][
x
].
value
)
for
x
in
attributes
])
if
not
node
.
branches
else
{}
if
dm_examples
:
values_dict
=
dict
([(
x
,
matrix
.
items
[
node
.
first
][
x
].
value
)
for
x
in
attributes
])
if
not
node
.
branches
else
{}
else
:
values_dict
=
dict
([(
x
,
matrix
.
items
[
node
.
first
].
name
)
for
x
in
attributes
])
if
not
node
.
branches
else
{}
for
attribute
in
values_dict
.
keys
():
if
type
(
values_dict
[
attribute
])
==
float
:
values_dict
[
attribute
]
=
"%.3f"
%
values_dict
[
attribute
]
...
...
workflows/cforange/templates/interactions/cforange_hierarchical_clustering.html
View file @
82b95c03
...
...
@@ -164,14 +164,29 @@ if (vizualization=="circle") {
.
attr
(
"
r
"
,
3
);
}
for
(
a
in
attributes
)
{
node
.
append
(
"
svg:text
"
)
.
attr
(
"
dx
"
,
function
(
d
)
{
return
d
.
x
<
180
?
8
:
-
8
;
})
.
attr
(
"
dy
"
,
"
.31em
"
)
.
attr
(
"
text-anchor
"
,
function
(
d
)
{
return
d
.
x
<
180
?
"
start
"
:
"
end
"
;
})
.
attr
(
"
transform
"
,
function
(
d
)
{
return
d
.
x
<
180
?
null
:
"
rotate(180)
"
;
})
.
attr
(
"
class
"
,
"
attribute
"
+
a
+
"
attributes
"
)
.
text
(
function
(
d
)
{
return
d
.
values
[
attributes
[
a
]];
});
$
(
"
.node
"
).
mouseenter
(
function
()
{
alert
(
"
test
"
);
});
if
(
vizualization
==
"
circle
"
)
{
for
(
a
in
attributes
)
{
node
.
append
(
"
svg:text
"
)
.
attr
(
"
dx
"
,
function
(
d
)
{
return
d
.
x
<
180
?
8
:
-
8
;
})
.
attr
(
"
dy
"
,
"
.31em
"
)
.
attr
(
"
text-anchor
"
,
function
(
d
)
{
return
d
.
x
<
180
?
"
start
"
:
"
end
"
;
})
.
attr
(
"
transform
"
,
function
(
d
)
{
return
d
.
x
<
180
?
null
:
"
rotate(180)
"
;
})
.
attr
(
"
class
"
,
"
attribute
"
+
a
+
"
attributes
"
)
.
text
(
function
(
d
)
{
return
d
.
values
[
attributes
[
a
]];
});
}
}
else
{
for
(
a
in
attributes
)
{
node
.
append
(
"
svg:text
"
)
.
attr
(
"
dx
"
,
-
10
)
.
attr
(
"
dy
"
,
3
)
.
style
(
"
text-anchor
"
,
function
(
d
)
{
return
d
.
children
?
"
end
"
:
"
start
"
;
})
.
attr
(
"
class
"
,
"
attribute
"
+
a
+
"
attributes
"
)
.
text
(
function
(
d
)
{
return
d
.
values
[
attributes
[
a
]];
});
}
}
$
(
"
.attributes
"
).
hide
();
...
...
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