File tree Expand file tree Collapse file tree 3 files changed +9
-5
lines changed
tensorboard/components/vz_line_chart2 Expand file tree Collapse file tree 3 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ export class PanZoomDragLayer extends Plottable.Components.Group {
4444
4545 this . panZoom = new Plottable . Interactions . PanZoom ( xScale , yScale ) ;
4646 this . panZoom . dragInteraction ( ) . mouseFilter ( ( event : MouseEvent ) => {
47- return Boolean ( event . altKey ) && event . button === 0 ;
47+ return PanZoomDragLayer . isPanKey ( event ) && event . button === 0 ;
4848 } ) ;
4949 this . panZoom . attachTo ( this ) ;
5050
@@ -53,7 +53,7 @@ export class PanZoomDragLayer extends Plottable.Components.Group {
5353 yScale ,
5454 unzoomMethod ) ;
5555 this . dragZoomLayer . dragInteraction ( ) . mouseFilter ( ( event : MouseEvent ) => {
56- return ! Boolean ( event . altKey ) && event . button === 0 ;
56+ return ! PanZoomDragLayer . isPanKey ( event ) && event . button === 0 ;
5757 } ) ;
5858 this . append ( this . dragZoomLayer ) ;
5959
@@ -78,6 +78,10 @@ export class PanZoomDragLayer extends Plottable.Components.Group {
7878 } ) ;
7979 }
8080
81+ static isPanKey ( event : MouseEvent ) : boolean {
82+ return Boolean ( event . shiftKey ) ;
83+ }
84+
8185 setState ( nextState : State ) : void {
8286 if ( this . state == nextState ) return ;
8387 const prevState = this . state ;
Original file line number Diff line number Diff line change 6161 cursor : crosshair;
6262 }
6363
64- : host .altdown # chartdiv : not (.drag-zooming ) .main {
64+ : host .pankey # chartdiv : not (.drag-zooming ) .main {
6565 cursor : -webkit-grab;
6666 cursor : grab;
6767 }
Original file line number Diff line number Diff line change @@ -293,11 +293,11 @@ Polymer({
293293 } ,
294294
295295 _onKeyDown ( event ) {
296- this . toggleClass ( 'altdown ' , event . altKey ) ;
296+ this . toggleClass ( 'pankey ' , PanZoomDragLayer . isPanKey ( event ) ) ;
297297 } ,
298298
299299 _onKeyUp ( event ) {
300- this . toggleClass ( 'altdown ' , event . altKey ) ;
300+ this . toggleClass ( 'pankey ' , PanZoomDragLayer . isPanKey ( event ) ) ;
301301 } ,
302302
303303 _onMouseDown ( event ) {
You can’t perform that action at this time.
0 commit comments