Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
clinicaltrials
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
david Chavalarias
clinicaltrials
Commits
634d8755
Commit
634d8755
authored
Mar 20, 2017
by
Romain Loth
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
piecharts layout: two per row (with label tweaking to keep it readable)
parent
030b3588
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
90 additions
and
21 deletions
+90
-21
normalize.php
php_library/normalize.php
+22
-0
stat-prep_from_array.php
php_library/stat-prep_from_array.php
+9
-6
print_directory.php
print_directory.php
+25
-8
print_scholar_directory.php
print_scholar_directory.php
+25
-7
comex.css
static/css/comex.css
+9
-0
No files found.
php_library/normalize.php
View file @
634d8755
...
...
@@ -86,4 +86,26 @@ function split_join_keywords_for_html($str_value) {
return
join
(
', '
,
$mod_arr
);
}
function
shorter_html_label
(
$label
)
{
$calibre
=
17
;
// shorter label via acro extraction
// if POSSible: use orgs.toarray to avoid matching
$matches
=
array
();
preg_match_all
(
'/^([^(]+\()([^)]+)(\).*)$/U'
,
$label
,
$matches
);
if
(
count
(
$matches
))
{
$label
=
$matches
[
2
][
0
];
$lhs
=
substr
(
$matches
[
1
][
0
],
0
,
-
1
)
;
// rm opening paren
$rhs
=
substr
(
$matches
[
3
][
0
],
1
);
// rm closing paren
$remainder
=
$lhs
.
' '
.
$rhs
;
if
(
strlen
(
$remainder
)
>
$calibre
)
{
$remainder
=
substr
(
$lhs
.
' '
.
$rhs
,
0
,
$calibre
-
3
)
.
'...'
;
}
$label
.=
' <span style="font-size:8px">'
.
$remainder
.
'</span>'
;
}
else
{
$label
=
'<span style="font-size:8px">'
.
substr
(
$label
,
0
,
$calibre
.
'...'
)
.
'</span>'
;
}
return
$label
;
}
?>
php_library/stat-prep_from_array.php
View file @
634d8755
...
...
@@ -226,14 +226,17 @@ $n_shown_labs = 0 ;
$tot_shown_labs
=
0
;
$labs_total_responses
=
0
;
foreach
(
$lab_counts
as
$key
=>
$value
)
{
// $key is the orgid, but we need the name
$label
=
$org_id_to_label
[
$key
];
$thresh
=
min
(
9
,
$n_labs
/
15
);
if
(
!
$label
||
$label
==
"_NULL"
)
{
$missing_labs
+=
$value
;
}
elseif
(
$value
>
$thresh
)
{
$label
=
shorter_html_label
(
$label
);
$labs_data
.=
'["'
.
addslashes
(
$label
)
.
'",'
.
$value
.
'],'
;
$n_shown_labs
+=
1
;
$tot_shown_labs
+=
$value
;
...
...
@@ -328,7 +331,7 @@ $(document).ready(function() {
pie: {
allowPointSelect: true,
cursor: "pointer",
size: "
7
5%",
size: "
4
5%",
dataLabels: {
enabled: true,
color: "#000000",
...
...
@@ -367,7 +370,7 @@ $(document).ready(function() {
pie: {
allowPointSelect: true,
cursor: "pointer",
size: "
7
5%",
size: "
4
5%",
dataLabels: {
enabled: true,
color: "#000000",
...
...
@@ -405,7 +408,7 @@ $(document).ready(function() {
pie: {
allowPointSelect: true,
cursor: "pointer",
size: "
7
5%",
size: "
4
5%",
dataLabels: {
enabled: true,
color: "#000000",
...
...
@@ -440,7 +443,7 @@ $(document).ready(function() {
colors: '
.
$COLOR_SCHEME
.
'
},
title: {
text: "Lab
oratories affiliation
s"
text: "Labs"
},
tooltip: {
formatter: function() {
...
...
@@ -451,7 +454,7 @@ $(document).ready(function() {
pie: {
allowPointSelect: true,
cursor: "pointer",
size: "
7
5%",
size: "
4
5%",
dataLabels: {
enabled: true,
color: "#000000",
...
...
@@ -499,7 +502,7 @@ $(document).ready(function() {
pie: {
allowPointSelect: true,
cursor: "pointer",
size: "
7
5%",
size: "
4
5%",
dataLabels: {
enabled: true,
color: "#000000",
...
...
print_directory.php
View file @
634d8755
...
...
@@ -445,15 +445,32 @@ Contributions and ideas are welcome to improve this directory.
</div>
<br/>
<h2 class="oldstyle">Global statistics</h2>
<div id="country" style="width: 800px; height: 300px; margin: 0 auto"></div>
<div id="title" style="width: 800px; height: 300px; margin: 0 auto"></div>
<div id="position" style="width: 800px; height: 300px; margin: 0 auto"></div>
<!-- these two are displayed only if the distribution has
at least 3 big groups (cf. n_shown in stats-prep) -->
<div id="labs_div" style="width: 800px; height: 300px; margin: 0 auto"></div>
<div id="insts_div" style="width: 800px; height: 300px; margin: 0 auto"></div>
<div class="container-fluid">
<div class="row chart-row">
<div class="col-lg-5 col-md-5 col-sm-12">
<div id="country" class="directory-piechart"></div>
</div>
<div class="col-lg-6 col-md-6 col-sm-12">
<div id="title" class="directory-piechart"></div>
</div>
</div>
<div class="row chart-row">
<div class="col-lg-5 col-md-5 col-sm-12">
<div id="position" class="directory-piechart"></div>
</div>
<div class="col-lg-6 col-md-6 col-sm-12">
<!-- conditional display (cf. n_shown in stats-prep) -->
<div id="labs_div" class="directory-piechart"></div>
</div>
</div>
<div class="row chart-row">
<div class="col-lg-12 col-md-12 col-sm-12">
<!-- conditional display (idem) -->
<div id="insts_div" class="directory-piechart"></div>
</div>
</div>
</div>
<br/>
<br/> <A NAME="scholars"> </A>
...
...
print_scholar_directory.php
View file @
634d8755
...
...
@@ -272,15 +272,33 @@ Contributions and ideas are welcome to improve this directory.
</div>
<br/>
<h2 class="oldstyle">Global statistics</h2>
<div id="country" style="width: 800px; height: 300px; margin: 0 auto"></div>
<div id="title" style="width: 800px; height: 300px; margin: 0 auto"></div>
<div id="position" style="width: 800px; height: 300px; margin: 0 auto"></div>
<!-- these two are displayed only if the distribution has
at least 3 big groups (cf. n_shown in stats-prep) -->
<div id="labs_div" style="width: 800px; height: 300px; margin: 0 auto"></div>
<div id="insts_div" style="width: 800px; height: 300px; margin: 0 auto"></div>
<div class="container-fluid">
<div class="row chart-row">
<div class="col-lg-5 col-md-5 col-sm-12">
<div id="country" class="directory-piechart"></div>
</div>
<div class="col-lg-6 col-md-6 col-sm-12">
<div id="title" class="directory-piechart"></div>
</div>
</div>
<div class="row chart-row">
<div class="col-lg-5 col-md-5 col-sm-12">
<div id="position" class="directory-piechart"></div>
</div>
<div class="col-lg-6 col-md-6 col-sm-12">
<!-- conditional display (cf. n_shown in stats-prep) -->
<div id="labs_div" class="directory-piechart"></div>
</div>
</div>
<div class="row chart-row">
<div class="col-lg-12 col-md-12 col-sm-12">
<!-- conditional display (idem) -->
<div id="insts_div" class="directory-piechart"></div>
</div>
</div>
</div>
<br/>
<br/> <A NAME="scholars"> </A>
...
...
static/css/comex.css
View file @
634d8755
...
...
@@ -424,6 +424,15 @@ div.ccsection-footer {
}
.chart-row
{
margin
:
0
0
35px
0
;
}
.directory-piechart
{
/*width: 70%;*/
height
:
300px
;
margin
:
0
auto
;
}
/**/
.bigger
{
font-size
:
150%
;
...
...
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