#NEWLINE# @ classmethod #NEWLINE# def register( cls , associations , backend , style_aliases = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) : #NEWLINE# #INDENT# '\n        Register the supplied dictionary of associations between\n        elements and plotting classes to the specified backend.\n        ' #NEWLINE# from . overlay import CompositeOverlay #NEWLINE# if ( backend not in cls . registry ) : #NEWLINE# #INDENT# cls . registry [ backend ] = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# #UNINDENT# cls . registry [ backend ] . update ( associations ) #NEWLINE# groups = [ 'style' , 'plot' , 'norm' ] #NEWLINE# if ( backend not in cls . _options ) : #NEWLINE# #INDENT# cls . _options [ backend ] = OptionTree ( [ ] , groups = groups ) #NEWLINE# #UNINDENT# if ( backend not in cls . _custom_options ) : #NEWLINE# #INDENT# cls . _custom_options [ backend ] = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# #UNINDENT# for ( view_class , plot ) in cls . registry [ backend ] . items ( ) : #NEWLINE# #INDENT# expanded_opts = [ opt for key in plot . style_opts for opt in style_aliases . get ( key , [ ] ) ] #NEWLINE# style_opts = sorted ( set ( ( opt for opt in ( expanded_opts + plot . style_opts ) if ( opt not in plot . _disabled_opts ) ) ) ) #NEWLINE# plot_opts = [ k for k in plot . params ( ) . keys ( ) if ( k not in [ 'name' ] ) ] #NEWLINE# with param . logging_level ( 'CRITICAL' ) : #NEWLINE# #INDENT# plot . style_opts = style_opts #NEWLINE# #UNINDENT# opt_groups = { #NEWLINE# #INDENT# 'plot' : Options ( allowed_keywords = plot_opts ) , #NEWLINE# #UNINDENT# } #NEWLINE# if ( ( not isinstance ( view_class , CompositeOverlay ) ) or hasattr ( plot , 'style_opts' ) ) : #NEWLINE# #INDENT# opt_groups . update ( { #NEWLINE# #INDENT# 'style' : Options ( allowed_keywords = style_opts ) , #NEWLINE# 'norm' : Options ( framewise = False , axiswise = False , allowed_keywords = [ 'framewise' , 'axiswise' ] ) , #NEWLINE# #UNINDENT# } ) #NEWLINE# #UNINDENT# name = view_class . __name__ #NEWLINE# cls . _options [ backend ] [ name ] = opt_groups