Reactive Vega A Streaming Dataflow Architecture for Declarative - - PowerPoint PPT Presentation

reactive vega
SMART_READER_LITE
LIVE PREVIEW

Reactive Vega A Streaming Dataflow Architecture for Declarative - - PowerPoint PPT Presentation

Reactive Vega A Streaming Dataflow Architecture for Declarative Interactive Visualization Arvind Satyanarayan, Ryan Russell, Jane Hoffswell, Jeffrey Heer Presented by Zipeng Liu Dec 3 2015 CSPSC 547 Information Visualization Based on


slide-1
SLIDE 1

Reactive Vega

Arvind Satyanarayan, Ryan Russell, Jane Hoffswell, Jeffrey Heer

A Streaming Dataflow Architecture for Declarative Interactive Visualization

Presented by Zipeng Liu Dec 3 2015 CSPSC 547 Information Visualization

Based on Arvind’s slides presented in InfoVis’15. http://arvindsatya.com/slides/ReactiveVega-InfoVis2015.pdf

slide-2
SLIDE 2

Reactive Vega

slide-3
SLIDE 3

–Linus Torvalds

“Talk is cheap. Show me the code”

3

slide-4
SLIDE 4

4

{ "width": 650, "height": 300, "data": [ {"name": "stocks", "url": “data/stocks.json”} ], "scales": [{ "name": "sx", "type": "ordinal", "domain": {"data": "stocks", "field": "date"} "range": "width" }, ... ], "axes": [ {"type": "x", "scale": "sx"}, ... ], "marks": [{ "type": "group", "from": { "data": "stocks", "transform": [ {"type": "facet", "groupby": ["symbol"]} ] }, "marks": [{ "type": "line", "properties": { "enter": { "x": {"scale": "sx", "field": "date"}, "y": {"scale": "sy", "field": "price"}, "stroke": {"scale": "sc", "field": "symbol"} }} }, { "type": "text",... }]

slide-5
SLIDE 5

5

{ "width": 650, "height": 300, "data": [ {"name": "stocks", "url": “data/stocks.json”} ], "scales": [{ "name": "sx", "type": "ordinal", "domain": {"data": "stocks", "field": "date"} "range": "width" }, ... ], "axes": [ {"type": "x", "scale": "sx"}, ... ], "marks": [{ "type": "group", "from": { "data": "stocks", "transform": [ {"type": "facet", "groupby": ["symbol"]} ] }, "marks": [{ "type": "line", "properties": { "enter": { "x": {"scale": "sx", "field": "date"}, "y": {"scale": "sy", "field": "price"}, "stroke": {"scale": "sc", "field": "symbol"} }} }, { "type": "text",... }]

Data + Transforms

slide-6
SLIDE 6

6

{ "width": 650, "height": 300, "data": [ {"name": "stocks", "url": “data/stocks.json”} ], "scales": [{ "name": "sx", "type": "ordinal", "domain": {"data": "stocks", "field": "date"} "range": "width" }, ... ], "axes": [ {"type": "x", "scale": "sx"}, ... ], "marks": [{ "type": "group", "from": { "data": "stocks", "transform": [ {"type": "facet", "groupby": ["symbol"]} ] }, "marks": [{ "type": "line", "properties": { "enter": { "x": {"scale": "sx", "field": "date"}, "y": {"scale": "sy", "field": "price"}, "stroke": {"scale": "sc", "field": "symbol"} }} }, { "type": "text",... }]

Data + Transforms Scales

slide-7
SLIDE 7

7

{ "width": 650, "height": 300, "data": [ {"name": "stocks", "url": “data/stocks.json”} ], "scales": [{ "name": "sx", "type": "ordinal", "domain": {"data": "stocks", "field": "date"} "range": "width" }, ... ], "axes": [ {"type": "x", "scale": "sx"}, ... ], "marks": [{ "type": "group", "from": { "data": "stocks", "transform": [ {"type": "facet", "groupby": ["symbol"]} ] }, "marks": [{ "type": "line", "properties": { "enter": { "x": {"scale": "sx", "field": "date"}, "y": {"scale": "sy", "field": "price"}, "stroke": {"scale": "sc", "field": "symbol"} }} }, { "type": "text",... }]

Data + Transforms Scales Guides

slide-8
SLIDE 8

8

{ "width": 650, "height": 300, "data": [ {"name": "stocks", "url": “data/stocks.json”} ], "scales": [{ "name": "sx", "type": "ordinal", "domain": {"data": "stocks", "field": "date"} "range": "width" }, ... ], "axes": [ {"type": "x", "scale": "sx"}, ... ], "marks": [{ "type": "group", "from": { "data": "stocks", "transform": [ {"type": "facet", "groupby": ["symbol"]} ] }, "marks": [{ "type": "line", "properties": { "enter": { "x": {"scale": "sx", "field": "date"}, "y": {"scale": "sy", "field": "price"}, "stroke": {"scale": "sc", "field": "symbol"} }} }, { "type": "text",... }]

Data + Transforms Scales Guides Marks

slide-9
SLIDE 9

Why Declarative

  • Less code + faster iteration
  • Performance + scalability
  • Reuse + portability (flexibility)
  • Programmatic generation

9

slide-10
SLIDE 10

Interaction?

slide-11
SLIDE 11

Reactive Vega

slide-12
SLIDE 12

Imperative Interaction

12

var dragging = false; d3.selectAll(“rect") .on("mousedown", function() { dragging = true; }) .on("mouseup", function() { dragging = false; d3.event.stopPropagation(); }) .on("mousemove", function() { var e = d3.event; if (!dragging) return; d3.select(this) .attr(“x”, e.pageX) .attr(“y”, e.pageY); });

1. Manually maintain state 
 and dependencies
 2. Side-effects
 3. “Callback hell”

slide-13
SLIDE 13

Declarative Interaction

  • Event-driven Functional Reactive Programming

(E-FRP)

  • mutable values as time-varying data streams
  • event triggers propagation through dataflow graph
  • but only for scalar values
  • Streaming Database

13

slide-14
SLIDE 14

Event Streams

14

slide-15
SLIDE 15

Demo: SPLOM of Iris

http://vega.github.io/vega-editor/index.html?spec=linking

slide-16
SLIDE 16

16

19

mousedown

*:mouseup

[mousedown, mouseup] > mousemove event.target

Cell Start End

Offset Offset (x, y) (x, y)

Predicate

xstart ≤ xpt ≤ xend && ystart ≤ ypt ≤ yend

Selection

slide-17
SLIDE 17

17

21

mousedown

*:mouseup

[mousedown, mouseup] > mousemove event.target

Cell Start End

Offset Offset (x, y) (x, y)

Predicate

sepalstart ≤ sepalpt ≤ sepalend && petalstart ≤ petalpt ≤ petalend

Query Scale Inversion Scale Inversion

slide-18
SLIDE 18

18

22

mousedown

*:mouseup

[mousedown, mouseup] > mousemove event.target

Cell Start End

Offset Offset (x, y) (x, y)

Inside Brush Scale Inversion Scale Inversion

slide-19
SLIDE 19

19

23

mousedown

*:mouseup

[mousedown, mouseup] > mousemove event.target

Cell Start End

Offset Offset

Scale Inversion Scale Inversion Inside Brush

(x, y) (x, y)

Circle Mark Rule Fill Inside Brush

blue

  • range

green (Scaled species) gray if else

slide-20
SLIDE 20

Architecture: Dataflow Graph

  • ptional
slide-21
SLIDE 21

21

29

{... "data": [... {...}, {... "name": "index_pts", "source": "stocks", "transform": [{ "type": "filter", "test": "month(datum) == month(index) && year(datum) == year(index)" }] }, {...} ]... }...

Output Input Filter stocks

Compile Time

*:mousemove x-1 index

slide-22
SLIDE 22

22

31

{... "data": [... {...}, {... "name": "index_pts", "source": "stocks", "transform": [{ "type": "filter", "test": "month(datum) == month(index) && year(datum) == year(index)" }] }, {...} ]... }...

Output Input Filter stocks

Run Time

*:mousemove x-1 index

Status. Tuples flagged as added, modified, or removed.

slide-23
SLIDE 23

23

31

{... "data": [... {...}, {... "name": "index_pts", "source": "stocks", "transform": [{ "type": "filter", "test": "month(datum) == month(index) && year(datum) == year(index)" }] }, {...} ]... }...

Output Input Filter stocks

Run Time

*:mousemove x-1 index

Status. Tuples flagged as added, modified, or removed. Changesets. A delta of observed or changed data tuples.

slide-24
SLIDE 24

24

32

{... "data": [... {...}, {... "name": "index_pts", "source": "stocks", "transform": [{ "type": "filter", "test": "month(datum) == month(index) && year(datum) == year(index)" }] }, {...} ]... }...

Output Input Filter stocks

Run Time

*:mousemove x-1 index

add: [1, 2, 3] mod: [4, 5, 6] rem: [7, 8]

slide-25
SLIDE 25

25

add: [1, 2, 3] mod: [4, 5, 6] rem: [7, 8]

33

{... "data": [... {...}, {... "name": "index_pts", "source": "stocks", "transform": [{ "type": "filter", "test": "month(datum) == month(index) && year(datum) == year(index)" }] }, {...} ]... }...

Output Input Filter stocks

Run Time

*:mousemove x-1 index

add: [1, 2] mod: [4, 6] rem: [5, 7, 8]

slide-26
SLIDE 26

26

Dataflow graph for index chart

slide-27
SLIDE 27

27

Full benchmark studies in the paper and online: http://github.com/vega/vega-benchmarks

~2x faster than D3

slide-28
SLIDE 28

Future Work

28

Eco-system

debugging tool?

slide-29
SLIDE 29

Future Work

29

Eco-system Server-side computation

“Data tiles”? workload partition?

slide-30
SLIDE 30

Comments

  • Declarative specification rocks
  • reusable, shareable (also iVisDesigner, …)
  • elegant! (once learning curve is climbed)
  • E-FRP could be the next hotspot
  • Similar as ReactJS
  • FP also
  • Eco-system that speaks Vega
  • but Vega is not enough
  • Open source

30

slide-31
SLIDE 31

Comments

  • Requires clear and well-ordered data
  • Same as Tableau
  • No way to debug
  • Language-level optimisation & runtime evaluation
  • Tradeoff: Cognitive Dimensions of Notation
  • Learning curve is quite steep
  • Lack of community
  • Foreign to FRP

31

slide-32
SLIDE 32

32

vega.github.io/vega/