"""
Connected Scatterplot (Lines with Custom Paths)
-----------------------------------------------

This example shows how layering can be used to build a plot. This dataset tracks miles driven per capita along with gas prices annually from 1956 to 2010. It is based on the May 2, 2010 New York Times article 'Driving Shifts Into Reverse'. See http://mbostock.github.io/protovis/ex/driving.html .
"""
# category: scatter plots
import altair as alt
from vega_datasets import data

driving = data.driving()

lines = alt.Chart(driving).mark_line().encode(
    alt.X('miles', scale=alt.Scale(zero=False)),
    alt.Y('gas', scale=alt.Scale(zero=False)),
    order='year'
)

points = alt.Chart(driving).mark_circle().encode(
    alt.X('miles', scale=alt.Scale(zero=False)),
    alt.Y('gas', scale=alt.Scale(zero=False))
)

lines + points

@@ -115,19 +115,28 @@
 show
-s
  how 
-layer
+the order encod
 ing 
@@ -154,26 +154,31 @@
  to 
-build a plot
+draw a custom path
 . Th
-is
+e
  dat
@@ -282,37 +282,25 @@
  on 
-the May 2, 2010 New York Time
+Hannah Fairfield'
 s ar
@@ -348,56 +348,112 @@
 http
+s
 ://
-mbostock.github.io/protovis/ex/driving.html .
+archive.nytimes.com/www.nytimes.com/imagepages/2010/05/02/business/02metrics.html for the original. 
 %0A%22%22%22
@@ -562,16 +562,8 @@
 ()%0A%0A
-lines = 
 alt.
@@ -587,16 +587,26 @@
 rk_line(
+point=True
 ).encode
@@ -724,170 +724,6 @@
 ar'%0A
+
 )%0A
-%0Apoints = alt.Chart(driving).mark_circle().encode(%0A    alt.X('miles', scale=alt.Scale(zero=False)),%0A    alt.Y('gas', scale=alt.Scale(zero=False))%0A)%0A%0Alines + points%0A

edit connected scatterplot to only use mark_line