Siddparmar has submitted this change and it was merged.

Change subject: min bar size
......................................................................


min bar size

Change-Id: I44932ec733dffc4183dff9e44a2dc6cb094e494e
---
M build/javascripts/privacy.js
M build/javascripts/rag.js
M build/stylesheets/graph.css
M source/javascripts/privacy.js
M source/javascripts/rag.js
M source/stylesheets/graph.css.scss
6 files changed, 44 insertions(+), 26 deletions(-)

Approvals:
  Siddparmar: Verified; Looks good to me, approved



diff --git a/build/javascripts/privacy.js b/build/javascripts/privacy.js
index bc48bdb..2917f9c 100644
--- a/build/javascripts/privacy.js
+++ b/build/javascripts/privacy.js
@@ -223,7 +223,7 @@
                                        } );
                                        return total;
                                } ) ] )
-                               .range( [ 0, width ] );
+                               .range( [ 20, width ] );
                        }
 
                        var y_range = [];
@@ -316,8 +316,8 @@
                                                        + "<span>" +  ( 
Number(filteredData[ 0 ] ) + Number( filteredData[ 1 ] ) + Number( 
filteredData[ 2 ] ) ) + "</span>"
                                                        + "<b>" + $( 
'#t_information_produced_all' ).val() + "</b>"
                                                        + "<span>" + 
filteredData[ 0 ] + "</span>"
-                                                       + "<b>" + $( 
'#t_information_produced_partial' ).val() + "</b>"
-                                                       + "<span>" + 
filteredData[ 2 ] + "</span>";
+                                                       + "<b 
class='partial-data'>" + $( '#t_information_produced_partial' ).val() + "</b>"
+                                                       + "<span 
class='partial-data'>" + filteredData[ 2 ] + "</span>";
                                        }
 
                                        if ( content === "" ) {
@@ -325,8 +325,8 @@
                                                        + '<span>' + ( 
disclosedAll + disclosedPartial + disclosedNone ) + '</span>'
                                                        + '<b>' + $( 
'#t_information_produced_all' ).val() + '</b>'
                                                        + '<span>' + 
disclosedAll + '</span>'
-                                                       + '<b>' + $( 
'#t_information_produced_partial' ).val() + '</b>'
-                                                       + '<span>' + 
disclosedPartial + '</span>'
+                                                       + '<b 
class="partial-data">' + $( '#t_information_produced_partial' ).val() + '</b>'
+                                                       + '<span 
class="partial-data">' + disclosedPartial + '</span>'
                                        }
 
                                        return tooltip
@@ -356,7 +356,7 @@
                                } )
                                .transition()
                                .attr( 'x', function ( d ) {
-                                       return xScale( d.x );
+                                       return xScale( d.x ) - 20;
                                } )
                                .attr( 'width', function ( d ) {
                                        return xScale( d.value );
@@ -401,8 +401,8 @@
                                                        + "<span>" +  ( 
Number(filteredData[ 0 ] ) + Number( filteredData[ 1 ] ) + Number( 
filteredData[ 2 ] ) ) + "</span>"
                                                        + "<b>" + $( 
'#t_information_produced_all' ).val() + "</b>"
                                                        + "<span>" + 
filteredData[ 0 ] + "</span>"
-                                                       + "<b>" + $( 
'#t_information_produced_partial' ).val() + "</b>"
-                                                       + "<span>" + 
filteredData[ 2 ] + "</span>";
+                                                       + "<b 
class='partial-data'>" + $( '#t_information_produced_partial' ).val() + "</b>"
+                                                       + "<span 
class='partial-data'>" + filteredData[ 2 ] + "</span>";
                                        }
 
                                        if ( content === "" ) {
@@ -410,8 +410,8 @@
                                                        + '<span>' + ( 
disclosedAll + disclosedPartial + disclosedNone ) + '</span>'
                                                        + '<b>' + $( 
'#t_information_produced_all' ).val() + '</b>'
                                                        + '<span>' + 
disclosedAll + '</span>'
-                                                       + '<b>' + $( 
'#t_information_produced_partial' ).val() + '</b>'
-                                                       + '<span>' + 
disclosedPartial + '</span>'
+                                                       + '<b 
class="partial-data">' + $( '#t_information_produced_partial' ).val() + '</b>'
+                                                       + '<span 
class="partial-data">' + disclosedPartial + '</span>'
                                        }
 
                                        return tooltip
@@ -1029,7 +1029,8 @@
 
                        var allDataTab = $('#user_data_all'),
                                janJun16DataTab = $('#user_data_janjun16'),
-                               legendPartial = $('.legend_partial')
+                               legendPartial = $('.legend_partial'),
+                               graphTooltip = $('.graph_tooltip')
 
                        function updateFlagBorder() {
                        
@@ -1069,10 +1070,14 @@
                                delete ds.filters.type;
                                delete ds.filters.country;
                                $( '#by_country_show_all, 
#request_type_show_all' ).addClass( 'disabled' );
+
+
                                if (allDataTab.hasClass('active') || 
janJun16DataTab.hasClass('active') ) {
                                        legendPartial.removeClass('inactive')
+                                       
graphTooltip.removeClass('partialInactive')
                                } else {
                                        legendPartial.addClass('inactive')
+                                       graphTooltip.addClass('partialInactive')
                                }
 
                                setTimeout(updateFlagBorder, 251);
diff --git a/build/javascripts/rag.js b/build/javascripts/rag.js
index d59df51..015f36f 100644
--- a/build/javascripts/rag.js
+++ b/build/javascripts/rag.js
@@ -177,7 +177,7 @@
                                .domain( [0, d3.max( data, function (d) {
                                        return Number( d.requests );
                                } ) ] )
-                               .range( [ 0, width ] );
+                               .range( [ 20, width ] );
 
                        var leftLine = graph.append( 'line' )
                                .attr( 'class', 'left-line' )
@@ -366,7 +366,7 @@
                                } )
                                .transition()
                                .attr( 'x', function ( d ) {
-                                       return xScale( d.x );
+                                       return xScale( d.x ) - 20;
                                } )
                                .attr( 'width', function ( d ) {
                                        return xScale( d.value );
diff --git a/build/stylesheets/graph.css b/build/stylesheets/graph.css
index b851c19..5062af1 100644
--- a/build/stylesheets/graph.css
+++ b/build/stylesheets/graph.css
@@ -80,6 +80,8 @@
 .graph_tooltip:after { content: ""; position: absolute; width: 0; height: 0; 
border-width: 5px; border-style: solid; border-color: transparent #F3F5F6 
transparent transparent; top: 3px; left: -10px; }
 .graph_tooltip span { display: block; margin: 0; color: #343838; font-family: 
sans-serif; font-size: 22px; margin-top: 6px; padding-bottom: 10px; }
 
+.partialInactive .partial-data { display: none; }
+
 .bubble_tooltip { -webkit-box-sizing: border-box; /* Safari/Chrome, other 
WebKit */ -moz-box-sizing: border-box; /* Firefox, other Gecko */ box-sizing: 
border-box; /* Opera/IE 8+ */ position: absolute; color: #343838; padding: 10px 
10px 12px 10px; background: #F3F5F6; width: 135px; height: 150px; opacity: 
0.99; font-family: serif; font-size: 15px; line-height: 18px; }
 .bubble_tooltip:after { content: ""; position: absolute; width: 0; height: 0; 
border-width: 5px; border-style: solid; border-color: #F3F5F6 transparent 
transparent transparent; bottom: -10px; left: 62px; }
 .bubble_tooltip span { display: block; margin: 0; color: #343838; font-family: 
sans-serif; font-size: 22px; margin-top: 6px; padding-bottom: 20px; }
diff --git a/source/javascripts/privacy.js b/source/javascripts/privacy.js
index 6fe97d7..ddfcfa1 100644
--- a/source/javascripts/privacy.js
+++ b/source/javascripts/privacy.js
@@ -223,7 +223,7 @@
                                        } );
                                        return total;
                                } ) ] )
-                               .range( [ 0, width ] );
+                               .range( [ 20, width ] );
                        }
 
                        var y_range = [];
@@ -316,8 +316,8 @@
                                                        + "<span>" +  ( 
Number(filteredData[ 0 ] ) + Number( filteredData[ 1 ] ) + Number( 
filteredData[ 2 ] ) ) + "</span>"
                                                        + "<b>" + $( 
'#t_information_produced_all' ).val() + "</b>"
                                                        + "<span>" + 
filteredData[ 0 ] + "</span>"
-                                                       + "<b>" + $( 
'#t_information_produced_partial' ).val() + "</b>"
-                                                       + "<span>" + 
filteredData[ 2 ] + "</span>";
+                                                       + "<b 
class='partial-data'>" + $( '#t_information_produced_partial' ).val() + "</b>"
+                                                       + "<span 
class='partial-data'>" + filteredData[ 2 ] + "</span>";
                                        }
 
                                        if ( content === "" ) {
@@ -325,8 +325,8 @@
                                                        + '<span>' + ( 
disclosedAll + disclosedPartial + disclosedNone ) + '</span>'
                                                        + '<b>' + $( 
'#t_information_produced_all' ).val() + '</b>'
                                                        + '<span>' + 
disclosedAll + '</span>'
-                                                       + '<b>' + $( 
'#t_information_produced_partial' ).val() + '</b>'
-                                                       + '<span>' + 
disclosedPartial + '</span>'
+                                                       + '<b 
class="partial-data">' + $( '#t_information_produced_partial' ).val() + '</b>'
+                                                       + '<span 
class="partial-data">' + disclosedPartial + '</span>'
                                        }
 
                                        return tooltip
@@ -356,7 +356,7 @@
                                } )
                                .transition()
                                .attr( 'x', function ( d ) {
-                                       return xScale( d.x );
+                                       return xScale( d.x ) - 20;
                                } )
                                .attr( 'width', function ( d ) {
                                        return xScale( d.value );
@@ -401,8 +401,8 @@
                                                        + "<span>" +  ( 
Number(filteredData[ 0 ] ) + Number( filteredData[ 1 ] ) + Number( 
filteredData[ 2 ] ) ) + "</span>"
                                                        + "<b>" + $( 
'#t_information_produced_all' ).val() + "</b>"
                                                        + "<span>" + 
filteredData[ 0 ] + "</span>"
-                                                       + "<b>" + $( 
'#t_information_produced_partial' ).val() + "</b>"
-                                                       + "<span>" + 
filteredData[ 2 ] + "</span>";
+                                                       + "<b 
class='partial-data'>" + $( '#t_information_produced_partial' ).val() + "</b>"
+                                                       + "<span 
class='partial-data'>" + filteredData[ 2 ] + "</span>";
                                        }
 
                                        if ( content === "" ) {
@@ -410,8 +410,8 @@
                                                        + '<span>' + ( 
disclosedAll + disclosedPartial + disclosedNone ) + '</span>'
                                                        + '<b>' + $( 
'#t_information_produced_all' ).val() + '</b>'
                                                        + '<span>' + 
disclosedAll + '</span>'
-                                                       + '<b>' + $( 
'#t_information_produced_partial' ).val() + '</b>'
-                                                       + '<span>' + 
disclosedPartial + '</span>'
+                                                       + '<b 
class="partial-data">' + $( '#t_information_produced_partial' ).val() + '</b>'
+                                                       + '<span 
class="partial-data">' + disclosedPartial + '</span>'
                                        }
 
                                        return tooltip
@@ -1029,7 +1029,8 @@
 
                        var allDataTab = $('#user_data_all'),
                                janJun16DataTab = $('#user_data_janjun16'),
-                               legendPartial = $('.legend_partial')
+                               legendPartial = $('.legend_partial'),
+                               graphTooltip = $('.graph_tooltip')
 
                        function updateFlagBorder() {
                        
@@ -1069,10 +1070,14 @@
                                delete ds.filters.type;
                                delete ds.filters.country;
                                $( '#by_country_show_all, 
#request_type_show_all' ).addClass( 'disabled' );
+
+
                                if (allDataTab.hasClass('active') || 
janJun16DataTab.hasClass('active') ) {
                                        legendPartial.removeClass('inactive')
+                                       
graphTooltip.removeClass('partialInactive')
                                } else {
                                        legendPartial.addClass('inactive')
+                                       graphTooltip.addClass('partialInactive')
                                }
 
                                setTimeout(updateFlagBorder, 251);
diff --git a/source/javascripts/rag.js b/source/javascripts/rag.js
index d59df51..015f36f 100644
--- a/source/javascripts/rag.js
+++ b/source/javascripts/rag.js
@@ -177,7 +177,7 @@
                                .domain( [0, d3.max( data, function (d) {
                                        return Number( d.requests );
                                } ) ] )
-                               .range( [ 0, width ] );
+                               .range( [ 20, width ] );
 
                        var leftLine = graph.append( 'line' )
                                .attr( 'class', 'left-line' )
@@ -366,7 +366,7 @@
                                } )
                                .transition()
                                .attr( 'x', function ( d ) {
-                                       return xScale( d.x );
+                                       return xScale( d.x ) - 20;
                                } )
                                .attr( 'width', function ( d ) {
                                        return xScale( d.value );
diff --git a/source/stylesheets/graph.css.scss 
b/source/stylesheets/graph.css.scss
index 6d43d18..c8ba94c 100644
--- a/source/stylesheets/graph.css.scss
+++ b/source/stylesheets/graph.css.scss
@@ -348,6 +348,12 @@
        }
 }
 
+.partialInactive {
+       .partial-data {
+               display: none;
+       }
+}
+
 .bubble_tooltip {
        -webkit-box-sizing: border-box; /* Safari/Chrome, other WebKit */
        -moz-box-sizing: border-box;    /* Firefox, other Gecko */

-- 
To view, visit https://gerrit.wikimedia.org/r/303259
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I44932ec733dffc4183dff9e44a2dc6cb094e494e
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/TransparencyReport-private
Gerrit-Branch: master
Gerrit-Owner: Siddparmar <[email protected]>
Gerrit-Reviewer: Siddparmar <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to