datatweener: a demonstration of a tweening engine for ...of a resultset transformation. we present...

4
DataTweener: A Demonstration of a Tweening Engine for Incremental Visualization of Data Transforms Meraj Khan § Larry Xu Arnab Nandi § Joseph M. Hellerstein The Ohio State University § University of California, Berkeley {khan.485,nandi.9}@osu.edu, {larry.xu,hellerstein}@berkeley.edu ABSTRACT With the development and advancement of new data inter- action modalities, data exploration and analysis has become a highly interactive process situating the user in a session of successive queries. With rapidly changing results, it be- comes difficult for the end user to fully comprehend trans- formations, especially the transforms corresponding to com- plex queries. We introduce “data tweening” as an informa- tive way of visualizing structural data transforms, presenting the users with a series of incremental visual representations of a resultset transformation. We present transformations as ordered sequences of basic structural transforms and vi- sual cues. The sequences are generated using an automated framework which utilizes differences between the consecutive resultsets and queries in a query session. We evaluate the effectiveness of tweening as a visualization method through a user study. 1. INTRODUCTION Data analysis tasks often involve queries which produce large changes in results for relatively small changes in the queries. Consider the case of the pivot transformation, a very popular and useful transformation for analytical pur- poses. A small change in the query, e.g., changing from the query Q1 to Q2 causes a large change in the resultset, T1 to T12 as seen in Figure 3. Q1 = SELECT Id, Year, Dept FROM StudentEnrollment E; Q2 = SELECT * FROM ( SELECT Year, Dept FROM StudentEnrollment E) PIVOT (COUNT(Dept) FOR Dept IN ("ECE", "CSE")); Such large jumps in the result space can leave the users disoriented as they can clearly notice something changed, but it is difficult to understand what the exact changes were and how they were caused. In such cases, tweening (an incremental visualization of the transformation) can help This work is licensed under the Creative Commons Attribution- NonCommercial-NoDerivatives 4.0 International License. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/. For any use beyond those covered by this license, obtain permission by emailing [email protected]. Proceedings of the VLDB Endowment, Vol. 10, No. 12 Copyright 2017 VLDB Endowment 2150-8097/17/08. UI DataTweener Tweening Engine DB Q new Q new Q new R new Q old R old T Figure 1: System design for a tweening-based query in- terface. users get the right context and make the transformation easier to understand. This change can be brought about by a single text query on traditional query interfaces or through a touch gesture on modern direct-manipulation touch-based interfaces [2, 3, 6]. Direct-manipulation interfaces require continuous visual feedback during user interaction to keep the user engaged [7]. Hence, for these modern interfaces, tweening is a hard requirement. We provide a formalized a visual grammar of basic struc- tural transforms and visual cues in our work Data Tween- ing [4], wherein we also presented a framework to generate ordered sequences of micro-operations from this grammar to encode resultset transformations. The visual grammar is de- signed considering the design principles of animated graph- ics [1, 9] and other works in perception research [8]. We visualize these ordered sequences as animated transforms on the query interface described here. 2. SYSTEM The core of the data tweening based query interface is the tweening engine incorporated in the client. When a user issues a new query Qnew, the UI passes the query to the tweening engine, which then saves the old query Q old and the old resultset R old , and issues Qnew to the database for exe- cution. Upon receiving the result Rnew from the database, the tweening engine utilizes the old and new queries and corresponding resultsets to generate the tweening sequence T . This tweening sequence is then visualized on the UI as an animated transition from R old to Rnew. This is illustrated in Figure 1. A tweening sequence is composed of basic transforms and visual cues defined on table entities (list of table cells, columns, 1953

Upload: others

Post on 17-Jul-2020

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: DataTweener: A Demonstration of a Tweening Engine for ...of a resultset transformation. We present transformations as ordered sequences of basic structural transforms and vi-sual cues

DataTweener: A Demonstration of a Tweening Engine forIncremental Visualization of Data Transforms

Meraj Khan§ Larry Xu; Arnab Nandi§ Joseph M. Hellerstein;

The Ohio State University§ University of California, Berkeley;

{khan.485,nandi.9}@osu.edu, {larry.xu,hellerstein}@berkeley.edu

ABSTRACTWith the development and advancement of new data inter-action modalities, data exploration and analysis has becomea highly interactive process situating the user in a sessionof successive queries. With rapidly changing results, it be-comes difficult for the end user to fully comprehend trans-formations, especially the transforms corresponding to com-plex queries. We introduce “data tweening” as an informa-tive way of visualizing structural data transforms, presentingthe users with a series of incremental visual representationsof a resultset transformation. We present transformationsas ordered sequences of basic structural transforms and vi-sual cues. The sequences are generated using an automatedframework which utilizes differences between the consecutiveresultsets and queries in a query session. We evaluate theeffectiveness of tweening as a visualization method througha user study.

1. INTRODUCTIONData analysis tasks often involve queries which produce

large changes in results for relatively small changes in thequeries. Consider the case of the pivot transformation, avery popular and useful transformation for analytical pur-poses. A small change in the query, e.g., changing from thequery Q1 to Q2 causes a large change in the resultset, T1 toT12 as seen in Figure 3.

Q1 = SELECT Id, Year , DeptFROM StudentEnrollment E;

Q2 = SELECT * FROM (SELECT Year , DeptFROM StudentEnrollment E)PIVOT (COUNT(Dept) FOR Dept IN ("ECE", "CSE"));

Such large jumps in the result space can leave the usersdisoriented as they can clearly notice something changed,but it is difficult to understand what the exact changes wereand how they were caused. In such cases, tweening (anincremental visualization of the transformation) can help

This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License. To view a copyof this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/. Forany use beyond those covered by this license, obtain permission by [email protected] of the VLDB Endowment, Vol. 10, No. 12Copyright 2017 VLDB Endowment 2150-8097/17/08.

UI

DataTweener Tweening Engine

DB

Qnew

Qnew

Qnew Rnew

Qold Rold T

Figure 1: System design for a tweening-based query in-terface.

users get the right context and make the transformationeasier to understand. This change can be brought about bya single text query on traditional query interfaces or througha touch gesture on modern direct-manipulation touch-basedinterfaces [2, 3, 6]. Direct-manipulation interfaces requirecontinuous visual feedback during user interaction to keepthe user engaged [7]. Hence, for these modern interfaces,tweening is a hard requirement.

We provide a formalized a visual grammar of basic struc-tural transforms and visual cues in our work Data Tween-ing [4], wherein we also presented a framework to generateordered sequences of micro-operations from this grammar toencode resultset transformations. The visual grammar is de-signed considering the design principles of animated graph-ics [1, 9] and other works in perception research [8]. Wevisualize these ordered sequences as animated transformson the query interface described here.

2. SYSTEMThe core of the data tweening based query interface is the

tweening engine incorporated in the client. When a userissues a new query Qnew, the UI passes the query to thetweening engine, which then saves the old query Qold and theold resultset Rold, and issues Qnew to the database for exe-cution. Upon receiving the result Rnew from the database,the tweening engine utilizes the old and new queries andcorresponding resultsets to generate the tweening sequenceT . This tweening sequence is then visualized on the UI as ananimated transition from Rold to Rnew. This is illustratedin Figure 1.

A tweening sequence is composed of basic transforms andvisual cues defined on table entities (list of table cells, columns,

1953

Page 2: DataTweener: A Demonstration of a Tweening Engine for ...of a resultset transformation. We present transformations as ordered sequences of basic structural transforms and vi-sual cues

Col1 Col2 Col3

A1 A2 A3

C1 C2 C3

Col1 Col2 Col3

A1 A2 A3

C1 C2 C3

deemphasize([r3

])

Col1 Col2 Col3

A1 A2 A3

B1 B2 B3

C1 C2 C3

B1 B2 B3

insert([{r3:[B1, B2, B3]}, {r5:[B1, B2,B3]}])

Col1 Col2 Col3

C1 C2 C3

A1 A2 A3

B1 B2 B3

B1 B2 B3

order([r1, r4, r2, r5, r3])

Col1 Col2 Col3

C1 C2 C3

A1 A2 A3

B1B2

B3B2

nest([(r4

c1, r5c1),

(r4c3, r5c3)])

Col1 Col2 Col3

C1 C2 C3

A1 A2 A3

B1B2

B3B2

Col1 Col2 Col3

C1 C2 C3

A1 A2 A3

B1 B2B3

B1 B2

unnest([{r4c1:(2, 1)}])

Col1 Col2 Col3

C1 C2 C3

A1 A2 A3

B1 B2B3

B1 B2

emphasize([r3, r4, r5], delete)

Col1 Col2 Col3

C1 C2 C3

delete([r3, r4 , r5])

Col1 Col2 Col3

C1 C2 C3

separate([c1])

Col1 Col2 Col3

C1 C2 C3

Col1

C2

Col2

C1

C3

Col3

rotate([{cell-group:[r1c2, r1c3, r2c2, r2c3

]}])

Col1 C2 Col2

C1 C3 Col3

rotate([{text:[r1c2, r1c3, r2c2, r2c3 ]}])

Col1 C2 Col2

C1 C3 Col3

bridge([c1])

Figure 2: Micro-operations in the Visual Grammar

or rows). Figure 2 shows the effect of these micro-operationson a table.

The tweening sequence is generated using a fixed rulebasedefined in Table 1. The rulebase defines the ordered se-quences of basic transforms corresponding to changes in dif-ferent SQL clauses. If two consecutive queries differ in mul-tiple clauses, the tweening sequences for respective changesare concatenated to form the complete tweening sequence.In addition to the structural transforms, the sequences in-clude visual cues which are inserted before / after certaintransforms for providing hints to upcoming and current trans-forms in the sequence. The standard visual cues are insertedinto the tweening sequence as per the following rules.

delete is preceded by emphasize, and followed by deempha-size on the table entities on which delete is to be applied.

insert is followed by emphasize, and then deemphasize onthe newly inserted table entities.

order is preceded by annotate showing a note with sortingcolumn, and order (ascending or descending).

More difficult query changes like pivot are tweened througha different set of rules as shown in Figure 3. The tweeningof pivot operation follows the natural logical construct ofpivot, first showing the aggregation and then following itwith the cross-tabulation. In certain cases where at leastone of the queries from a consecutive pair of queries in asession is an aggregation query, the tweening generation be-comes non-trivial as the tweening engine would need tuplesconstituting aggregation of either or both the queries to gen-erate a meaningful animation. In such cases, instead of is-suing the new query Qnew to the database, the tweening en-gine substitutes it with a simplified form of the expression-disaggpQoldq

�disaggpQnewq, where disaggpQq represents

the SQL query which would return the constituent tuplesforming the resultset corresponding to query Q. Our workin [4] details how and why this works. It also covers a fewoptimizations over these standard techniques which we donot implement in this demo.

3. QUERY INTERFACEWe present a web-based query interface with two interac-

tion modalities – text and multitouch on two independentscreens. On the text interface, the user can type in the de-sired SQL query in a text console, and see the result visual-ized through tweening in the same window. The multitouchinterface defines intuitive touch gestures for basic relationaldata transforms- select, project, aggregate, and cross-tab.Each of these transform visualizations are composed of basictransforms and visual cues described in the earlier section.We restrict the type of queries that can be issued in a querysession to a subset of SQL. We require the FROM clause inall the queries for a given session to be exactly the same.

3.1 SQL Console InterfaceThe users can type in a query in the console at the bottom

right of the browser window. When the user types in a query,the visualization area is updated from the old resultset tothe new resultset through an animated transition. The usersstart by issuing a SELECT query on one of the datasetsavailable in the database. After the first query, the userneeds to make sure they use the same FROM clause as thatin the first query in all the subsequent queries. An exceptionto this rule is the pivot query which is required to have thetable being pivoted in the FROM clause expression of theother queries in the session. Figure 4 shows the console areaand the visualization area for this interface. The result forthe query typed in the console is shown in the visualizationarea. The query execution is triggered by completion of theSQL statement in the console. If the user issues an invalid orunsupported SQL statement, an appropriate error messageis shown on the top right corner of the screen.

3.2 Multitouch InterfaceOn the multitouch interface, the users can select a database

table at the start of the session. The users can then issuequeries on the selected dataset through touch gestures. Forthe demonstration, we provide support for basic relationaloperations along with cross-tabulation. The gestures for therespective operations are described below:

1954

Page 3: DataTweener: A Demonstration of a Tweening Engine for ...of a resultset transformation. We present transformations as ordered sequences of basic structural transforms and vi-sual cues

Table 1: Query-based tweening rulebase

Differing Clause Change Tweening SequenceSELECT delete(columns), insert(columns), order(columns)WHERE delete(rows), insert(rows), order(rows)

GROUP BY New Group By Clauseorder(rows), highlight(rows, cause=aggregation), in-sert(aggregateColumn), separate(groups), nest(rows), bridge(groups)

GROUP BY Removed Group By Clause delete(aggregateColumn), unnest(rows)

Id Year Dept

1 2012 CSE

4 2012 CSE

2 2012 ECE

3 2012 ECE

5 2012 ECE

6 2013 CSE

10 2013 CSE

11 2013 CSE

12 2013 CSE

7 2013 ECE

8 2013 ECE

9 2013 ECE

Id Year Dept

1 2012 CSE

4 2012 CSE

2 2012 ECE

3 2012 ECE

5 2012 ECE

6 2013 CSE

10 2013 CSE

11 2013 CSE

12 2013 CSE

7 2013 ECE

8 2013 ECE

9 2013 ECE

Id Year Dept

1 2012 CSE

4 2012 CSE

2 2012 ECE

3 2012 ECE

5 2012 ECE

6 2013 CSE

10 2013 CSE

11 2013 CSE

12 2013 CSE

7 2013 ECE

8 2013 ECE

9 2013 ECET1

T2 T3

Year Dept

2012 CSE

2012 CSE

2012 ECE

2012 ECE

2012 ECE

2013 CSE

2013 CSE

2013 CSE

2013 CSE

2013 ECE

2013 ECE

2013 ECE

T4

Year Dept Count

2012 CSE2

2012 CSE

2012 ECE

32012 ECE

2012 ECE

2013 CSE

42013 CSE

2013 CSE

2013 CSE

2013 ECE

32013 ECE

2013 ECE

Year Dept Count

2012 CSE2

2012 CSE

2012 ECE

32012 ECE

2012 ECE

2013 CSE

42013 CSE

2013 CSE

2013 CSE

2013 ECE

32013 ECE

2013 ECE

Year Dept Count

2012 CSE 2

2012 ECE 3

2013 CSE 4

2013 ECE 3

T5 T6T8

Year Dept Count

2012 CSE 2

2012 ECE 3

2013 CSE 4

2013 ECE 3

T7

Year

2012

ECE

CSE

3 2

2013

ECE

CSE

3 4

Year

2012ECE CSE

3 2

2013ECE CSE

3 4 Year ECE CSE

2012 3 2

2013 3 4

Year ECE CSE

2012 3 2

2013 3 4

T9

T10

T11

T12

Figure 3: Incremental Visualization of Pivot Transfor-mation introduced in Section 1

SQL Console

AlbumId Title ArtistId

1 Balls to the wall 2

2 Restless and Wild 2

3 Let there be Rock 1

4 Big Ones 3

5 Jagged Little Pill 4

6 Facelift 5

7 Warner 25 Anos 6

8 Audioslave 8

9 Out of Exile 8

Table Visualization Area

SELECT Album.AlbumId, Album.Title, Album.ArtistIdFROM Album;

Done Running QueryDone Parsing SchemaDone Loading DBFetching DB

Debug Info

Figure 4: SQL console query interface

SELECTION - The query interface provides two mecha-nisms for selection. Users can either pinch-in (Figure 5)rows to delete them or they can specify an attribute-specific WHERE clause predicate in the pop-up dialogopened by tapping on a column header. The predicatesare defined in the same syntax as that in standard SQL.For deleting rows using the pinch-in gesture, users needto tap on two cells in the same column separated by atleast one row and swipe inwards. This would cause all therows in between the two touchpoints (excluding the rowscontaining them) to be deleted.

PROJECTION - The users can delete a column with thepinch-in touch gesture (Figure 5). This works exactly likethe pinch-in gesture for selection. The users can selecttwo distinct cells in the same row and swipe inwards todelete the block of columns between the two points.

AGGREGATION - The users can initiate the aggregationgesture by a single finger swipe directed from the measurecolumn to the group-by column after which they wouldbe prompted to pick the aggregation function. The swipegesture for aggregation and the final output for a sampletable is shown in Figure 6.

CROSS-TABULATION - A cross-tab can be performedby an arc-shaped swipe gesture originating at a cell in thecolumn to be transposed to the attribute headers and di-rected upwards towards the table headers while holdingdown a cell in the pivot column. The gesture is depictedin Figure 7. To maintain a continuous visual feedback,once the system figures out the cross-tab query during theswipe gesture, it starts showing the transition to the newresultset. For example, for the cross-tab query demon-strated in Figure 7, an animated transition from T7 toT12 in Figure 3 is played.

1955

Page 4: DataTweener: A Demonstration of a Tweening Engine for ...of a resultset transformation. We present transformations as ordered sequences of basic structural transforms and vi-sual cues

AlbumId Title ArtistId

1 Balls to the wall 22 Restless and Wild 2

3 Let there be Rock 1

4 Big Ones 3

5 Jagged Little Pill 4

AlbumId Title ArtistId

1 Balls to the wall 2

2 Restless and Wild 2

3 Let there be Rock 1

4 Big Ones 3

5 Jagged Little Pill 4

Figure 5: Pinch-in gesture for SELECTION and PRO-JECTION on multitouch interface

AlbumId ArtistId

1 1

2 1

3 2

4 3

5 4

6 5

7 6

8 8

9 8

Pick Aggregate Function

COUNT MAX MIN AVG

ArtistId Count

1 2

2 1

3 1

4 1

5 1

6 1

8 2Figure 6: Aggregation on multitouch interface

EnrollmentYear Dept Count

2012 CSE 2

2012 ECE 3

2013 CSE 4

2013 ECE 3

EnrollmentYear CSE ECE

2012 2 3

2013 4 3

Figure 7: Cross-tabulation on multitouch interface

4. USER STUDYTo study the effectiveness of tweening as a visualization

method and its role in helping people understand complextransformations, we conducted a user study [5]. We re-cruited 20 undergraduate and graduate students from dif-ferent backgrounds to participate in an in-persosn study.The users were asked to rate our pivot tweening sequencefor clarity and understandability on a scale of 0 � 10. Wealso asked them if the tweening helped them understand thepivot transformation better. Figure 8 shows the rating forpivot tweening by each user. 18 out of the 20 users said theyfound tweening helpful in understanding pivot. The usersrated the tweening sequence high both for clarity (mean -8.23, standard error - 1.24) and understandability (mean -8.48, standard error - 1.31) Through this study, we concludeusers find tweening helpful in understanding complex trans-formations and hence is an effective visualization method.

5. DEMONSTRATIONFor the demonstration, we will present a web app on a

touch-screen laptop. The users can opt to either use theconsole-based interface or the multitouch interface. Theusers can select a publicly available datasets hosted on anin-browser sqlite database. Users can see complex datatransformations broken down and visualized into simple andsmooth transitions between distinct resultsets. This is in

0

2

4

6

8

10

12

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

Ra.n

g

User

Clarity Understandability

Figure 8: User rating for pivot tweening

contrast to the standard sql resultset visualization where thechanges in resultsets are abrupt and discontinuous. For ex-ample, the pivot transformation corresponding to a changein query Q1 to Q2 introduced in Section 1 would be displayedas an animated transition stepping through the frames shownin Figure 3. The same transformation on the standard queryinterface would be displayed as an abrupt change from T1

to T12. A demo video (http://go.osu.edu/datatweener)is provided for elucidation.

6. CONCLUSION AND FUTURE WORKThis work describes an initial implementation of a query

interface with support for data-tweening. Users can get real-time feedback in the form of animated transition for a subsetof SQL queries. We have shown that the visual grammar hasthe expressivity to encode a wider SQL subset than sup-ported by the current implementation. In the future, weplan to build a full-fledged query interface with tweeningsupport, and add playback capability for all actions. Wealso plan a comparative study to see if users perform anybetter on data analysis tasks with a tweening enabled queryinterface over traditional query interfaces. Another interest-ing future work is extending tweening to very large datasets.Acknowledgements We acknowledge the support of theU.S. National Science Foundation under awards IIS-1422977,IIS-1527779, CAREER IIS-1453582, and IIS-1564351.

7. REFERENCES[1] Heer, Jeffrey and Robertson, George G. Animated

Transitions in Statistical Data Graphics. TVCG, pages1240–1247, 2007.

[2] Idreos, Stratos and Liarou, Erietta. dbTouch: Analyticsat your Fingertips. CIDR, 2013.

[3] Jiang, Lilong and Nandi, Arnab. Designing interactivequery interfaces to teach database systems in theclassroom. SIGCHI, pages 1479–1482, 2015.

[4] Khan, Meraj and Xu, Larry, and Nandi, Arnab andHellerstein, Joseph M. Data tweening: Incrementalvisualization of data transforms. VLDB, pages 661–672,2017.

[5] Kosara, Robert and others. Thoughts on User Studies:Why, How, and When? CGA, pages 20–25, 2003.

[6] Nandi, Arnab and Jiang, Lilong and Mandel, Michael.Gestural Query Specification. VLDB, pages 289–300,2013.

[7] Shneiderman, Ben. Direct Manipulation: A StepBeyond Programming Languages. Sparks of innovationin HCI, page 17, 1993.

[8] Todorovic, Dejan. Gestalt Principles. Scholarpedia,2008.

[9] Tversky, Barbara and Morrison, and Julie Bauer andBetrancourt, Mireille. Animation: Can It Facilitate?IJHCS, pages 247–262, 2002.

1956