@@ -20,6 +20,7 @@ import { HiPlotPluginData } from "../plugin";
2020import { ResizableH } from "../lib/resizable" ;
2121import { Filter , FilterType , apply_filters } from "../filters" ;
2222import { foDynamicSizeFitContent , foCreateAxisLabel } from "../lib/svghelpers" ;
23+ import { IS_SAFARI , redrawAllForeignObjectsIfSafari } from "../lib/browsercompat" ;
2324
2425interface StringMapping < V > { [ key : string ] : V ; } ;
2526
@@ -152,10 +153,11 @@ export class ParallelPlot extends React.Component<ParallelPlotData, ParallelPlot
152153 this . xscale . domain ( this . state . dimensions ) ;
153154 this . dimensions_dom . filter ( function ( this : ParallelPlot , p ) { return this . state . dimensions . indexOf ( p ) == - 1 ; } . bind ( this ) ) . remove ( ) ;
154155 this . dimensions_dom = this . dimensions_dom . filter ( function ( this : ParallelPlot , p ) { return this . state . dimensions . indexOf ( p ) !== - 1 ; } . bind ( this ) ) ;
155- if ( ! this . state . dragging ) {
156+ if ( ! this . state . dragging && ! IS_SAFARI ) {
156157 g = g . transition ( ) ;
157158 }
158159 g . attr ( "transform" , function ( this : ParallelPlot , p ) { return "translate(" + this . position ( p ) + ")" ; } . bind ( this ) ) ;
160+ redrawAllForeignObjectsIfSafari ( ) ;
159161 this . update_ticks ( ) ;
160162 this . updateAxisTitlesAnglesAndFontSize ( ) ;
161163 }
@@ -349,14 +351,19 @@ export class ParallelPlot extends React.Component<ParallelPlotData, ParallelPlot
349351 me . setState ( { dimensions : new_dimensions } ) ;
350352 }
351353 me . dimensions_dom . attr ( "transform" , function ( d ) { return "translate(" + me . position ( d ) + ")" ; } ) ;
354+ redrawAllForeignObjectsIfSafari ( ) ;
352355 } )
353356 . on ( "end" , function ( d : string ) {
354357 if ( ! me . state . dragging . dragging ) {
355358 // no movement, invert axis
356359 var extent = invert_axis ( d ) ;
357360 } else {
358361 // reorder axes
359- d3 . select ( this ) . transition ( ) . attr ( "transform" , "translate(" + me . xscale ( d ) + ")" ) ;
362+ var drag : any = d3 . select ( this ) ;
363+ if ( ! IS_SAFARI ) {
364+ drag = drag . transition ( ) ;
365+ }
366+ drag . attr ( "transform" , "translate(" + me . xscale ( d ) + ")" ) ;
360367 var extents = brush_extends ( ) ;
361368 extent = extents [ d ] ;
362369 }
@@ -612,6 +619,7 @@ export class ParallelPlot extends React.Component<ParallelPlotData, ParallelPlot
612619 . each ( function ( d : string ) {
613620 d3 . select ( this ) . call ( me . axis . scale ( me . yscale [ d ] ) ) ;
614621 } ) ;
622+ me . updateAxisTitlesAnglesAndFontSize ( ) ;
615623
616624 // render data
617625 this . setState ( function ( prevState ) { return { brush_count : prevState . brush_count + 1 } ; } ) ;
@@ -682,6 +690,9 @@ export class ParallelPlot extends React.Component<ParallelPlotData, ParallelPlot
682690 ) ) ;
683691 this . style . fontSize = newFontSize + "px" ;
684692 this . style . transform = "rotate(" + ( 360 - ROTATION_ANGLE_RADS * 180 / Math . PI ) + "deg)" ;
693+ if ( IS_SAFARI ) {
694+ this . parentElement . style . position = "fixed" ;
695+ }
685696 const fo = this . parentElement . parentElement as any as SVGForeignObjectElement ;
686697 fo . setAttribute ( "y" , - newFontSize + "" ) ;
687698 } ) ;
0 commit comments