Parameter Actions to Make a Scroll Bar


Tableau Conference is less than three weeks away from when I’m writing this post. I, honestly, cannot believe a year has passed since TC18. I recall vividly so many memories from the conference: friends I made, adventures I had, and the creative thoughts that filled my head.

Particularly, I remember attending #MakeoverMonday live, jumping out of a car near midnight in a last minute decision to stay out with friends instead of going to bed, late night Tweets including my famous “Peak Ole” mention, being surrounded by friends and Tableau enthusiasts all day every day, spending time in intimate conversations at Fanalytics, exploring New Orleans by day and by night, and then leaving with a sense of feeling completely full and satisfied with all things data.

A friend of mine, Josh Smith, on the last full day of the conference gave me a poetry book and told me I could read it on the plane as he had finished it. Prior to conference, we had connected on our shared love of poetry. While he openly shared some of his work, including poetry that had been published, I hadn’t written in a few years. Alas, upon receiving that little red book in my hand, despite feeling a tad rusty in my creative linguistic skills, I knew there was something sparking within. With most creative experiences, inspiration and an idea is all you really need. This proved, for me, to be true at this moment.

That little red book was read cover to cover on the plane home from New Orleans and while my coworker slept (or maybe she was reading?), I crafted a poem – reflecting on the time I had at the Tableau Conference.

While this introductory memory occurred over a year ago, the other day, Paul Watchlter tweeted out a poem he wrote and published in Tableau and I encourage you to go read it. In the brief conversation we had on Twitter, he casually suggested the idea that once Tableau Public could support animation (pages) that it would be neat for the words or lines to appear on the page, essentially to slow the reader to the cadence of the poem – that which is usually desired by the poet. Read slow. Take it all in. Feel the presence. Understand the emotion.

Well, this got my brain turning. Even without animation, as long as the poem was written via data (as I had created mine using individual x/y coordinates for each character), then I knew a way for a “scrolling” feature using parameter actions.

Parameter Actions

Parameter actions were released in Tableau 2019.2 and function similar to a filter or highlight action when interacting with a worksheet or dashboard in a visualization. The action is driven by a parameter and the parameter values change based on the action you take on the viz.

For my poem, I wanted a feature that would slowly reveal each line of the poem to the reader. The benefit to this is that is slows you down and visually directs you to focus on one line of the poem at a time. Since the words in poetry can have such depth, reading them slowly is imperative if you want to understand the poem and feel the emotions the author is conveying.

Because we often a short on time, or quick to scan, we don’t read everything in front of this. With a scrolling feature we can slow down that reveal of the text so that (hopefully) the reading takes the time to read one line at a time.

So how do you set this up?

In my viz, each letter is plotted on an x/y coordinate. This means there is a constant value for each row (same y-coordinate) or line of text. I wanted each line to be revealed when the reader moved the scroll bar down.

I created 1 parameter and 2 calculations to complete this.

The parameter is just a float data type with all values available. Then I created a “Show Line” calculation which would populate the line of poetry (and those already read) as long as it was true. So the calculation was if the parameter value is greater than or equal to the row (a value in my data set) then it’s true, otherwise it’s false. This calc is put on the filter shelf of the worksheet and set to true.

Next, I created another calculation that would be used along my “scroll” bar as the circle. Here, I just need the calculation only to be true when it matches the parameter value.

Scroll Bar

To make the scroll bar, I created a dual axis using my row field (this is key because it’s used in the parameter) – one with a line (which was just my row value) and another with circles. The circles mark used the “Show Line (copy)” calculation for both color and size. I made the size of the non-selected parameter values small and the same color as the line the blend it. Then the true value was darker and larger (I adjusted the sizing accordingly).

The result was something that looks like this:

Screen Shot 2019-10-21 at 8.43.55 PM.png

The last part is setting up the parameter action. On the dashboard, navigate to Dashboard, then Actions. Then select “Add Action” and “Change Parameter…”

Screen Shot 2019-10-21 at 8.45.05 PM

To create the parameter for the scroll, all I needed to do as to tell the parameter to change the values of my “row” field based on where I hover on my “scroll” worksheet (which was the line and circles mentioned above), which ultimately then affect the calculations I already built. This means that when I hover on the scroll worksheet whatever row I hover on will change the parameter – which, in turn, changes the calculations I’ve connected to my poem worksheet (remember, that true/false statement to only show those rows less than the parameter value).

Screen Shot 2019-10-21 at 8.45.29 PM

Because the scrolling worksheet is what is going to drive the other sheet

Final Viz

The final viz responds like this (press play below) where when you hover over the scroll bar to the right and slowing drag your mouse down, the lines to the poem will appear. Hopefully, slowing you down a bit to read each word and enjoy the reflection I had on the Tableau Conference.

Check out the fully interactive viz here.

As always, reach out if you have questions or a particular use-case you need help on. I’m happy to assist if I can! And I’m always happy to read poetry if you are so inclined. 😉



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s