Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
genotoul-bioinfo
D-GENIES
Commits
6a8bf528
Commit
6a8bf528
authored
Jan 29, 2018
by
Floreal Cabanettes
Browse files
Add 2 color palettes, Implements
#98
parent
8e05190f
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/dgenies/static/js/d3.boxplot.events.js
View file @
6a8bf528
...
...
@@ -19,6 +19,8 @@ d3.boxplot.events.init = function () {
$
(
"
input#chroms-limits
"
).
change
(
function
()
{
d3
.
boxplot
.
events
.
set_break_lines_visibility
(
this
.
value
);
});
$
(
"
div#legend div.draw
"
).
on
(
"
click
"
,
d3
.
boxplot
.
switch_color_theme
);
};
d3
.
boxplot
.
events
.
init_context_menu
=
function
()
{
...
...
src/dgenies/static/js/d3.boxplot.js
View file @
6a8bf528
...
...
@@ -30,12 +30,30 @@ d3.boxplot.old_translate = null;
d3
.
boxplot
.
scale
=
1000
;
d3
.
boxplot
.
content_lines_width
=
d3
.
boxplot
.
scale
/
400
;
d3
.
boxplot
.
break_lines_width
=
d3
.
boxplot
.
scale
/
1500
;
d3
.
boxplot
.
color_idy_theme
=
"
default
"
;
d3
.
boxplot
.
color_idy_themes
=
[
"
default
"
,
"
colorblind
"
,
"
black&white
"
]
d3
.
boxplot
.
color_idy
=
{
"
3
"
:
"
#094b09
"
,
"
2
"
:
"
#2ebd40
"
,
"
1
"
:
"
#d5670b
"
,
"
0
"
:
"
#ffd84b
"
,
"
-1
"
:
"
#fff
"
"
default
"
:
{
"
3
"
:
"
#094b09
"
,
"
2
"
:
"
#2ebd40
"
,
"
1
"
:
"
#d5670b
"
,
"
0
"
:
"
#ffd84b
"
,
"
-1
"
:
"
#fff
"
},
"
colorblind
"
:
{
"
3
"
:
"
#000
"
,
"
2
"
:
"
#006DDB
"
,
"
1
"
:
"
#DB6E00
"
,
"
0
"
:
"
#FFB677
"
,
"
-1
"
:
"
#fff
"
},
"
black&white
"
:
{
"
3
"
:
"
#000
"
,
"
2
"
:
"
#626262
"
,
"
1
"
:
"
#9c9c9c
"
,
"
0
"
:
"
#DDDCDC
"
,
"
-1
"
:
"
#fff
"
}
};
d3
.
boxplot
.
limit_idy
=
null
;
d3
.
boxplot
.
min_idy_draw
=
0
;
...
...
@@ -599,7 +617,7 @@ d3.boxplot._sort_color_idy = function(a, b) {
d3
.
boxplot
.
draw_legend
=
function
()
{
d3
.
select
(
"
#legend .draw
"
).
html
(
""
);
//Empty legend
let
color_idy
=
d3
.
boxplot
.
color_idy
;
let
color_idy
=
d3
.
boxplot
.
color_idy
[
d3
.
boxplot
.
color_idy_theme
]
;
let
color_idy_len
=
Object
.
keys
(
color_idy
).
length
;
let
color_idy_order
=
[
"
3
"
,
"
2
"
,
"
1
"
,
"
0
"
];
let
color_idy_labels
=
[
d3
.
boxplot
.
limit_idy
[
2
].
toString
(),
d3
.
boxplot
.
limit_idy
[
1
].
toString
(),
...
...
@@ -689,13 +707,37 @@ d3.boxplot.__draw_idy_lines = function (idy, lines, x_len, y_len) {
if
(
lines
[
idy
].
length
>
0
)
{
d3
.
boxplot
.
container
.
append
(
"
path
"
)
.
attr
(
"
d
"
,
d3
.
boxplot
.
__lineFunction
(
lines
[
idy
],
min_size
,
max_size
,
x_len
,
y_len
))
.
attr
(
"
class
"
,
"
content-lines s_
"
+
min_size
.
toString
().
replace
(
"
.
"
,
"
_
"
))
.
attr
(
"
class
"
,
"
content-lines s_
"
+
min_size
.
toString
().
replace
(
"
.
"
,
"
_
"
)
+
"
idy_
"
+
idy
)
.
attr
(
"
stroke-width
"
,
d3
.
boxplot
.
content_lines_width
+
"
px
"
)
.
attr
(
"
stroke
"
,
d3
.
boxplot
.
color_idy
[
idy
])
.
attr
(
"
stroke
"
,
d3
.
boxplot
.
color_idy
[
d3
.
boxplot
.
color_idy_theme
][
idy
])
.
attr
(
"
stroke-linecap
"
,
d3
.
boxplot
.
linecap
);
}
}
}
};
d3
.
boxplot
.
switch_color_theme
=
function
()
{
let
current_theme
=
d3
.
boxplot
.
color_idy_theme
;
let
idx
=
d3
.
boxplot
.
color_idy_themes
.
indexOf
(
current_theme
)
if
(
idx
<
d3
.
boxplot
.
color_idy_themes
.
length
-
1
)
{
idx
++
;
}
else
{
idx
=
0
;
}
d3
.
boxplot
.
change_color_theme
(
d3
.
boxplot
.
color_idy_themes
[
idx
]);
};
d3
.
boxplot
.
change_color_theme
=
function
(
theme
)
{
if
(
d3
.
boxplot
.
color_idy_themes
.
indexOf
(
theme
)
===
-
1
)
{
throw
"
Theme not valid!
"
}
for
(
let
idy
=
0
;
idy
<
4
;
idy
++
)
{
d3
.
boxplot
.
color_idy_theme
=
theme
;
d3
.
boxplot
.
container
.
selectAll
(
"
path.idy_
"
+
idy
.
toString
())
.
attr
(
"
stroke
"
,
d3
.
boxplot
.
color_idy
[
d3
.
boxplot
.
color_idy_theme
][
idy
])
}
d3
.
boxplot
.
draw_legend
();
};
d3
.
boxplot
.
draw_lines
=
function
(
lines
=
d3
.
boxplot
.
lines
,
x_len
=
d3
.
boxplot
.
x_len
,
y_len
=
d3
.
boxplot
.
y_len
)
{
...
...
src/dgenies/views.py
View file @
6a8bf528
...
...
@@ -506,4 +506,4 @@ def send_mail(id_res):
job_mng
.
send_mail
()
return
"OK"
else
:
abort
(
403
)
\ No newline at end of file
abort
(
403
)
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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