0

I have developed a script and would like to publish it. I wanted to add dev notes, but can't find a good way to format the label such that it has a scroll wheel down. My script looks like this:

var longLabel = ui.Label('This is my very long label. I would like to be able to add line breaks to it so that it does not trail off infinitely to the right. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.' ) longLabel.style({ width:'400px', height:'500px' }) var panel = ui.Panel() panel.style({ width:'400px', height:'500px' }) panel.add(longLabel) Map.add(panel) 

I would like the panel to have the width specifications in the script, but perhaps with line breaks partition the label text into a scrollable box.

2
  • It should be something with setLayout, but I can't get it working with a vertical scroll bar: code.earthengine.google.com/da361e04573cd9ea88317ba2ed44b999 Commented Mar 14, 2019 at 9:08
  • Yeah, I'm still a bit unclear as to what governs the presence of a scroll bar. Commented Mar 14, 2019 at 12:46

1 Answer 1

1

The setting I was looking for was 'whiteSpace', which can be found in the ui.Panel.style(). As far as I know, the only options for this setting are 'nowrap', which makes it trail off, 'normal', which restricts it to the panel width, and 'pre', which I'm not entirely sure about.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.