Skip to content

Commit

Permalink
Further adjustment to widget font size adjustment
Browse files Browse the repository at this point in the history
  • Loading branch information
philippjfr committed Mar 23, 2016
1 parent c36846e commit 40cf1d1
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions holoviews/plotting/widgets/jsslider.jinja
Expand Up @@ -95,11 +95,8 @@
var step = 1;
}
function adjustFontSize(text) {
if (text.val().length > 8) {
size = 100-Math.min(text.val().length*2.5, 50)+'%';
} else {
size= '100%';
}
var width_ratio = (text.parent().width()/8)/text.val().length;
var size = Math.min(0.9, Math.max(0.6, width_ratio))+'em';
text.css('font-size', size);
}
var slider = $('#_anim_widget{{ id }}_{{ widget_data['dim'] }}');
Expand Down

0 comments on commit 40cf1d1

Please sign in to comment.