@@ -149,7 +149,7 @@ proto.createButton = function(config) {
149149 button . setAttribute ( 'data-toggle' , config . toggle || false ) ;
150150 if ( config . toggle ) d3 . select ( button ) . classed ( 'active' , true ) ;
151151
152- button . appendChild ( this . createIcon ( config . icon || Icons . question ) ) ;
152+ button . appendChild ( this . createIcon ( config . icon || Icons . question , config . name ) ) ;
153153 button . setAttribute ( 'data-gravity' , config . gravity || 'n' ) ;
154154
155155 return button ;
@@ -162,7 +162,7 @@ proto.createButton = function(config) {
162162 * @Param {string} thisIcon.path
163163 * @Return {HTMLelement}
164164 */
165- proto . createIcon = function ( thisIcon ) {
165+ proto . createIcon = function ( thisIcon , name ) {
166166 var iconHeight = thisIcon . ascent - thisIcon . descent ,
167167 svgNS = 'http://www.w3.org/2000/svg' ,
168168 icon = document . createElementNS ( svgNS , 'svg' ) ,
@@ -172,8 +172,12 @@ proto.createIcon = function(thisIcon) {
172172 icon . setAttribute ( 'width' , ( thisIcon . width / iconHeight ) + 'em' ) ;
173173 icon . setAttribute ( 'viewBox' , [ 0 , 0 , thisIcon . width , iconHeight ] . join ( ' ' ) ) ;
174174
175+ var transform = name === 'toggleSpikelines' ?
176+ 'matrix(1.5 0 0 -1.5 0 ' + thisIcon . ascent + ')' :
177+ 'matrix(1 0 0 -1 0 ' + thisIcon . ascent + ')' ;
178+
175179 path . setAttribute ( 'd' , thisIcon . path ) ;
176- path . setAttribute ( 'transform' , 'matrix(1 0 0 -1 0 ' + thisIcon . ascent + ')' ) ;
180+ path . setAttribute ( 'transform' , transform ) ;
177181 icon . appendChild ( path ) ;
178182
179183 return icon ;
0 commit comments