question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

document how to extend length of labels

See original GitHub issue

Original title: selectionrangeslider: too short, cuts off labels

import pandas as pd
import datetime
import ipywidgets as widgets

start = datetime.datetime(2017,1,1)
end = datetime.datetime(2017,12,31)

dates = list(pd.date_range(start, end, freq='D'))
options = [(i.strftime('%d.%m.%Y'), i) for i in dates]
index = (0, len(dates)-1)
widgets.SelectionRangeSlider(
    options = options,
    index = index,
    description = 'Test',
    orientation = 'horizontal'
)

The widget is displayed as image

The last part of the end date is incorrectly cut off.

Same problem if slider is oriented vertical.

ipywidgets.__version__ is 7.0.1 and jupyter-notebook --version is 5.2.0.

Is there some workaraound? Thanks!

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:5
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

10reactions
alfredo-gimenezcommented, Jul 11, 2018

Unfortunately this fix doesn’t work for me–looks like the width of the slider occupies a fixed percentage of the layout width, so with a long enough string it still gets cut off.

Alternatively, is there a way to put the range values below the slider?

4reactions
pbugnioncommented, Oct 16, 2017

Thanks for raising this.

A workaround for this would be to specify an absolute width for the slider:

widgets.SelectionRangeSlider(
    options=options,
    index=index,
    description='Test',
    orientation='horizontal',
    layout={'width': '500px'}
)

Beyond workarounds, I am not sure if expanding the label size depending on the options was part of the design. I could see that getting very tricky if the label strings have very different lengths.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to resolve label length restrictions | Confluence
Resolution. Option 1. Reduce the length of the label names (suggested option). Option 2. Edit the server.xml ...
Read more >
Adjusting Margins, Setting Label Length, Using Tabs and Multi ...
The Brother P-touch PT-D400 Label Series continues with this video on how to Adjust Margins, Set Label Length, How to use Tabs and...
Read more >
Change the format of data labels in a chart - Microsoft Support
Right-click the data label you want to change, and then click Change Data Label Shapes. Pick the shape you want.
Read more >
How do I change the label length? - Brother
1. Press the Function key. · 2. Press the Left or the Right arrow key until Label length is displayed. · 3. Press...
Read more >
How to Control the Width of the <label> Tag - W3docs
The <label> element specifies a text label for the <input> tag. ... <title>Title of the document</title> <style> label { display: block; width: 130px;...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found