#NEWLINE# def __init__( self , * args , **kwargs ) : #NEWLINE# #INDENT# 'Create a Vega Scatter Chart' #NEWLINE# super ( Scatter , self ) . __init__ ( * args , ** kwargs ) #NEWLINE# x_type = ( 'time' if self . _is_datetime else 'linear' ) #NEWLINE# self . scales += [ Scale ( name = 'x' , type = x_type , range = 'width' , domain = DataRef ( data = 'table' , field = 'data.idx' ) ) , Scale ( name = 'y' , range = 'height' , nice = True , domain = DataRef ( data = 'table' , field = 'data.val' ) ) , Scale ( name = 'color' , type = 'ordinal' , domain = DataRef ( data = 'table' , field = 'data.col' ) , range = 'category20' ) ] #NEWLINE# self . axes += [ Axis ( type = 'x' , scale = 'x' ) , Axis ( type = 'y' , scale = 'y' ) ] #NEWLINE# from_ = MarkRef ( data = 'table' , transform = [ Transform ( type = 'facet' , keys = [ 'data.col' ] ) ] ) #NEWLINE# enter_props = PropertySet ( x = ValueRef ( scale = 'x' , field = 'data.idx' ) , y = ValueRef ( scale = 'y' , field = 'data.val' ) , size = ValueRef ( value = 100 ) , fill = ValueRef ( scale = 'color' , field = 'data.col' ) ) #NEWLINE# marks = [ Mark ( type = 'symbol' , properties = MarkProperties ( enter = enter_props ) ) ] #NEWLINE# mark_group = Mark ( type = 'group' , from_ = from_ , marks = marks ) #NEWLINE# self . marks . append ( mark_group )