Function Repository Resource:

ScrollingTicker

Source Notebook

Display information in a scrolling ticker

Contributed by: Michael Sollami

ResourceFunction["ScrollingTicker"][expr]

displays a scrolling ticker view of expr.

Details and Options

ResourceFunction["ScrollingTicker"] is essentially a dynamic Pane that simulates a scrolling "ticker" view.
ResourceFunction["ScrollingTicker"] is primarily intended for displaying one dimensional information.
The following options can be given:
AnimationRate2specify the rate at which the view scolls (higher means faster)
ImageSize{200, 20}specify the {width,height} of the view's pane
"Mouseover"Falsespecify scolling to animate during mouseover events

Examples

Basic Examples (4) 

Display a ticker:

In[1]:=
ResourceFunction["ScrollingTicker"]@Range[100]
Out[1]=

Scroll when moused-over:

In[2]:=
Style[ResourceFunction["ScrollingTicker"][Range[20], "Mouseover" -> True, ImageSize -> {300, 20}], Background -> LightBlue]
Out[2]=

Use ScrollingTicker to auto-scroll on long strings:

In[3]:=
a = StringTake[ExampleData[{"Text", "AliceInWonderland"}], 200];
In[4]:=
TextGrid[Table[
  Style[ResourceFunction["ScrollingTicker"][a, ImageSize -> RandomInteger[{50, 400}]], Background -> White], 2, 2], Dividers -> All, Background -> LightGray, Alignment -> Center]
Out[4]=

ScrollingTicker can help to display text that doesn’t fit in grids:

In[5]:=
Grid[Table[
  ResourceFunction["ScrollingTicker"][Range[100]^2, ImageSize -> {150, 22}, "Mouseover" -> True], 4, 3], Dividers -> All, Spacings -> {1, 1}]
Out[5]=

Scope (1) 

ScrollingTicker can also be helpful in TableView cells by using Boxes:

In[6]:=
p = Table[Fibonacci[i], {i, 101}];
In[7]:=
t = {Table[
    ToBoxes@ResourceFunction["ScrollingTicker"][p, "Mouseover" -> True], {i, 5}]};
In[8]:=
TableView[t, Boxes, AllowedDimensions -> {Automatic, 4}]
Out[8]=

Options (1) 

Increase the AnimationRate option to scroll faster:

In[9]:=
p = Table[Prime[i], {i, 101}];
TableForm@
 Table[ResourceFunction["ScrollingTicker"][p, AnimationRate -> i], {i,
    5}]
Out[7]=

Applications (1) 

Make a stock market ScrollingTicker:

In[10]:=
stocks = {"AAPL", "CRM", "GOOGL", "MSFT", "TWTR"};
In[11]:=
ResourceFunction["ScrollingTicker"]@
 Style[StringRiffle[{#, FinancialData[#, Method -> "Legacy"]} & /@ stocks, "   ", " "], FontFamily -> "Courier", FontColor -> White, Background -> Black, FontSize -> 26]
Out[11]=

Publisher

Michael Sollami

Version History

  • 1.0.0 – 24 April 2020

Related Resources

License Information