@@ -21,14 +21,12 @@ var Queue = require('../lib/queue');
2121var Registry = require ( '../registry' ) ;
2222var PlotSchema = require ( './plot_schema' ) ;
2323var Plots = require ( '../plots/plots' ) ;
24- var Polar = require ( '../plots/polar/legacy' ) ;
2524
2625var Axes = require ( '../plots/cartesian/axes' ) ;
2726var Drawing = require ( '../components/drawing' ) ;
2827var Color = require ( '../components/color' ) ;
2928var initInteractions = require ( '../plots/cartesian/graph_interact' ) . initInteractions ;
3029var xmlnsNamespaces = require ( '../constants/xmlns_namespaces' ) ;
31- var svgTextUtils = require ( '../lib/svg_text_utils' ) ;
3230var clearSelect = require ( '../plots/cartesian/select' ) . clearSelect ;
3331
3432var dfltConfig = require ( './plot_config' ) . dfltConfig ;
@@ -141,12 +139,6 @@ function plot(gd, data, layout, config) {
141139 var fullLayout = gd . _fullLayout ;
142140 var hasCartesian = fullLayout . _has ( 'cartesian' ) ;
143141
144- // Legacy polar plots
145- if ( ! fullLayout . _has ( 'polar' ) && data && data [ 0 ] && data [ 0 ] . r ) {
146- Lib . log ( 'Legacy polar charts are deprecated!' ) ;
147- return plotLegacyPolar ( gd , data , layout ) ;
148- }
149-
150142 // so we don't try to re-call Plotly.plot from inside
151143 // legend and colorbar, if margins changed
152144 fullLayout . _replotting = true ;
@@ -547,99 +539,6 @@ function setPlotContext(gd, config) {
547539 }
548540}
549541
550- function plotLegacyPolar ( gd , data , layout ) {
551- // build or reuse the container skeleton
552- var plotContainer = d3 . select ( gd ) . selectAll ( '.plot-container' )
553- . data ( [ 0 ] ) ;
554- plotContainer . enter ( )
555- . insert ( 'div' , ':first-child' )
556- . classed ( 'plot-container plotly' , true ) ;
557- var paperDiv = plotContainer . selectAll ( '.svg-container' )
558- . data ( [ 0 ] ) ;
559- paperDiv . enter ( ) . append ( 'div' )
560- . classed ( 'svg-container' , true )
561- . style ( 'position' , 'relative' ) ;
562-
563- // empty it everytime for now
564- paperDiv . html ( '' ) ;
565-
566- // fulfill gd requirements
567- if ( data ) gd . data = data ;
568- if ( layout ) gd . layout = layout ;
569- Polar . manager . fillLayout ( gd ) ;
570-
571- // resize canvas
572- paperDiv . style ( {
573- width : gd . _fullLayout . width + 'px' ,
574- height : gd . _fullLayout . height + 'px'
575- } ) ;
576-
577- // instantiate framework
578- gd . framework = Polar . manager . framework ( gd ) ;
579-
580- // plot
581- gd . framework ( { data : gd . data , layout : gd . layout } , paperDiv . node ( ) ) ;
582-
583- // set undo point
584- gd . framework . setUndoPoint ( ) ;
585-
586- // get the resulting svg for extending it
587- var polarPlotSVG = gd . framework . svg ( ) ;
588-
589- // editable title
590- var opacity = 1 ;
591- var txt = gd . _fullLayout . title ? gd . _fullLayout . title . text : '' ;
592- if ( txt === '' || ! txt ) opacity = 0 ;
593-
594- var titleLayout = function ( ) {
595- this . call ( svgTextUtils . convertToTspans , gd ) ;
596- // TODO: html/mathjax
597- // TODO: center title
598- } ;
599-
600- var title = polarPlotSVG . select ( '.title-group text' )
601- . call ( titleLayout ) ;
602-
603- if ( gd . _context . edits . titleText ) {
604- var placeholderText = Lib . _ ( gd , 'Click to enter Plot title' ) ;
605- if ( ! txt || txt === placeholderText ) {
606- opacity = 0.2 ;
607- // placeholder is not going through convertToTspans
608- // so needs explicit data-unformatted
609- title . attr ( { 'data-unformatted' : placeholderText } )
610- . text ( placeholderText )
611- . style ( { opacity : opacity } )
612- . on ( 'mouseover.opacity' , function ( ) {
613- d3 . select ( this ) . transition ( ) . duration ( 100 )
614- . style ( 'opacity' , 1 ) ;
615- } )
616- . on ( 'mouseout.opacity' , function ( ) {
617- d3 . select ( this ) . transition ( ) . duration ( 1000 )
618- . style ( 'opacity' , 0 ) ;
619- } ) ;
620- }
621-
622- var setContenteditable = function ( ) {
623- this . call ( svgTextUtils . makeEditable , { gd : gd } )
624- . on ( 'edit' , function ( text ) {
625- gd . framework ( { layout : { title : { text : text } } } ) ;
626- this . text ( text )
627- . call ( titleLayout ) ;
628- this . call ( setContenteditable ) ;
629- } )
630- . on ( 'cancel' , function ( ) {
631- var txt = this . attr ( 'data-unformatted' ) ;
632- this . text ( txt ) . call ( titleLayout ) ;
633- } ) ;
634- } ;
635- title . call ( setContenteditable ) ;
636- }
637-
638- gd . _context . setBackground ( gd , gd . _fullLayout . paper_bgcolor ) ;
639- Plots . addLinks ( gd ) ;
640-
641- return Promise . resolve ( ) ;
642- }
643542
644543// convenience function to force a full redraw, mostly for use by plotly.js
645544function redraw ( gd ) {
0 commit comments