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
a5ac8ad2
Commit
a5ac8ad2
authored
Jan 30, 2013
by
bogdan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tree Visualization widget
parent
f0462cb1
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
3385 additions
and
3365 deletions
+3385
-3365
workflows/cforange/db/package_data.json
workflows/cforange/db/package_data.json
+3349
-3362
workflows/library.py
workflows/library.py
+5
-2
workflows/models.py
workflows/models.py
+1
-1
workflows/templates/visualizations/tree_visualization.html
workflows/templates/visualizations/tree_visualization.html
+3
-0
workflows/visualization_views.py
workflows/visualization_views.py
+27
-0
No files found.
workflows/cforange/db/package_data.json
View file @
a5ac8ad2
This diff is collapsed.
Click to expand it.
workflows/library.py
View file @
a5ac8ad2
...
...
@@ -494,9 +494,9 @@ def svmeasy(input_dict):
return
output_dict
def
class_tree
(
input_dict
):
import
o
range
import
O
range
output_dict
=
{}
output_dict
[
'treeout'
]
=
orang
e
.
TreeLearner
(
name
=
"Classification Tree (Orange)"
)
output_dict
[
'treeout'
]
=
Orange
.
classification
.
tre
e
.
TreeLearner
(
name
=
"Classification Tree (Orange)"
)
return
output_dict
def
c45_tree
(
input_dict
):
...
...
@@ -840,3 +840,6 @@ def alter_table_finished(postdata, input_dict, output_dict):
except
:
# Catch orange exception and give a proper error message.
raise
Exception
(
"Illegal value '%s' for discrete attribute '%s', legal values are: %s."
%
(
new_value
,
att
,
new_table
.
domain
[
att
].
values
))
return
{
'altered_data'
:
new_table
}
def
tree_visualization
(
input_dict
):
return
{}
\ No newline at end of file
workflows/models.py
View file @
a5ac8ad2
...
...
@@ -267,7 +267,7 @@ class AbstractWidget(models.Model):
i
.
uid
=
uuid
.
uuid4
()
if
commit
:
i
.
save
()
for
option
in
i
:
for
option
in
i
.
options
.
all
()
:
option
.
uid
=
uuid
.
uuid4
()
if
commit
:
option
.
save
()
...
...
workflows/templates/visualizations/tree_visualization.html
0 → 100644
View file @
a5ac8ad2
<div
id=
"widgetvisualization-{{widget.pk}}"
rel=
"{{widget.pk}}"
width=
"900"
height=
"600"
class=
"widgetvisualizationdialog"
title=
"{{widget.name}}"
>
{{ svg|safe }}
</div>
\ No newline at end of file
workflows/visualization_views.py
View file @
a5ac8ad2
...
...
@@ -191,3 +191,30 @@ def sdmsegs_viewer(request,input_dict,output_dict,widget):
}
output_dict
=
{
'json_output'
:
output
}
return
render
(
request
,
'visualizations/sdmsegs_viewer.html'
,{
'widget'
:
widget
,
'input_dict'
:
input_dict
,
'output_dict'
:
output_dict
})
def
tree_visualization
(
request
,
input_dict
,
output_dict
,
widget
):
import
Orange
import
pydot
import
tempfile
f
=
tempfile
.
NamedTemporaryFile
(
delete
=
False
,
suffix
=
'.dot'
)
tree
=
input_dict
[
'clt'
]
tree
.
dot
(
f
,
leaf_shape
=
"oval"
,
node_shape
=
"box"
)
f
.
close
()
dot_file
=
open
(
f
.
name
,
"r"
)
dot_data
=
dot_file
.
read
()
tree_visualization_graph
=
pydot
.
graph_from_dot_data
(
dot_data
)
tree_visualization_graph
.
set_name
(
"TreeVisualization"
)
tree_visualization_graph
.
set_size
(
"9"
)
tree_visualization_graph
.
set_ratio
(
"fill"
)
tree_visualization
=
tree_visualization_graph
.
create_svg
()
return
render
(
request
,
'visualizations/tree_visualization.html'
,
{
'widget'
:
widget
,
'input_dict'
:
input_dict
,
'svg'
:
tree_visualization
})
\ 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