1212var Plotly = require ( '../../plotly' ) ;
1313var d3 = require ( 'd3' ) ;
1414
15+ var Icons = require ( '../../../build/ploticon' ) ;
1516var modebarConfig = require ( './modebar_config' ) ;
17+
18+
1619/**
1720 * UI controller for interactive plots
1821 * @Class
@@ -108,7 +111,7 @@ proto.createButton = function (config) {
108111 button . setAttribute ( 'data-toggle' , config . toggle ) ;
109112 if ( config . toggle ) button . classList . add ( 'active' ) ;
110113
111- button . appendChild ( this . createIcon ( Plotly . Icons [ config . icon ] ) ) ;
114+ button . appendChild ( this . createIcon ( Icons [ config . icon ] ) ) ;
112115
113116 return button ;
114117} ;
@@ -121,8 +124,7 @@ proto.createButton = function (config) {
121124 * @Return {HTMLelement}
122125 */
123126proto . createIcon = function ( thisIcon ) {
124- var iconDef = Plotly . Icons ,
125- iconHeight = iconDef . ascent - iconDef . descent ,
127+ var iconHeight = Icons . ascent - Icons . descent ,
126128 svgNS = 'http://www.w3.org/2000/svg' ,
127129 icon = document . createElementNS ( svgNS , 'svg' ) ,
128130 path = document . createElementNS ( svgNS , 'path' ) ;
@@ -132,7 +134,7 @@ proto.createIcon = function (thisIcon) {
132134 icon . setAttribute ( 'viewBox' , [ 0 , 0 , thisIcon . width , iconHeight ] . join ( ' ' ) ) ;
133135
134136 path . setAttribute ( 'd' , thisIcon . path ) ;
135- path . setAttribute ( 'transform' , 'matrix(1 0 0 -1 0 ' + iconDef . ascent + ')' ) ;
137+ path . setAttribute ( 'transform' , 'matrix(1 0 0 -1 0 ' + Icons . ascent + ')' ) ;
136138 icon . appendChild ( path ) ;
137139
138140 return icon ;
@@ -202,7 +204,7 @@ proto.getLogo = function(){
202204 a . setAttribute ( 'data-title' , 'Produced with Plotly' ) ;
203205 a . className = 'modebar-btn plotlyjsicon modebar-btn--logo' ;
204206
205- a . appendChild ( this . createIcon ( Plotly . Icons . plotlylogo ) ) ;
207+ a . appendChild ( this . createIcon ( Icons . plotlylogo ) ) ;
206208
207209 group . appendChild ( a ) ;
208210 return group ;
0 commit comments