@@ -12,6 +12,8 @@ import {UnconnectedColorPicker} from './ColorPicker';
12
12
import { UnconnectedTextEditor } from './TextEditor' ;
13
13
import { UnconnectedVisibilitySelect } from './VisibilitySelect' ;
14
14
import { connectToContainer , getAllAxes , getAxisTitle , axisIdToAxisName } from 'lib' ;
15
+ import PropTypes from 'prop-types' ;
16
+ import Text from './Text' ;
15
17
16
18
export const AxisAnchorDropdown = connectToContainer ( UnconnectedDropdown , {
17
19
modifyPlotProps : ( props , context , plotProps ) => {
@@ -574,8 +576,14 @@ export const HoverInfo = connectToContainer(UnconnectedFlaglist, {
574
576
} else if ( container . lat || container . lon ) {
575
577
options = [ { label : _ ( 'Longitude' ) , value : 'lon' } , { label : _ ( 'Latitude' ) , value : 'lat' } ] ;
576
578
}
577
- } else if ( container . type === 'scattermapbox' ) {
579
+ } else if ( container . type === 'scattermapbox' || container . type === 'densitymapbox' ) {
578
580
options = [ { label : _ ( 'Longitude' ) , value : 'lon' } , { label : _ ( 'Latitude' ) , value : 'lat' } ] ;
581
+ } else if ( container . type === 'densitymapbox' ) {
582
+ options = [
583
+ { label : _ ( 'Longitude' ) , value : 'lon' } ,
584
+ { label : _ ( 'Latitude' ) , value : 'lat' } ,
585
+ { label : _ ( 'Z' ) , value : 'z' } ,
586
+ ] ;
579
587
} else if ( container . type === 'scatterternary' ) {
580
588
options = [
581
589
{ label : _ ( 'A' ) , value : 'a' } ,
@@ -655,6 +663,54 @@ export const FillDropdown = connectToContainer(UnconnectedDropdown, {
655
663
} ,
656
664
} ) ;
657
665
666
+ export const MapboxSourceArray = connectToContainer ( Text , {
667
+ modifyPlotProps : ( props , context , plotProps ) => {
668
+ const { fullValue, updatePlot} = plotProps ;
669
+ if ( plotProps . fullValue && plotProps . fullValue . length > 0 ) {
670
+ plotProps . fullValue = fullValue [ 0 ] ;
671
+ }
672
+
673
+ plotProps . updatePlot = v => {
674
+ if ( v . length ) {
675
+ updatePlot ( [ v ] ) ;
676
+ } else {
677
+ updatePlot ( [ ] ) ;
678
+ }
679
+ } ;
680
+ } ,
681
+ } ) ;
682
+
683
+ export const MapboxStyleDropdown = connectToContainer ( UnconnectedDropdown , {
684
+ modifyPlotProps : ( props , context , plotProps ) => {
685
+ const { mapBoxAccess, localize : _ } = context ;
686
+
687
+ plotProps . options = ( ! mapBoxAccess
688
+ ? [ ]
689
+ : [
690
+ { label : _ ( 'Mapbox Basic' ) , value : 'basic' } ,
691
+ { label : _ ( 'Mapbox Outdoors' ) , value : 'outdoors' } ,
692
+ { label : _ ( 'Mapbox Light' ) , value : 'light' } ,
693
+ { label : _ ( 'Mapbox Dark' ) , value : 'dark' } ,
694
+ { label : _ ( 'Mapbox Satellite' ) , value : 'satellite' } ,
695
+ { label : _ ( 'Mapbox Satellite with Streets' ) , value : 'satellite-streets' } ,
696
+ ]
697
+ ) . concat ( [
698
+ { label : _ ( 'No tiles (white background)' ) , value : 'white-bg' } ,
699
+ { label : _ ( 'Open Street Map' ) , value : 'open-street-map' } ,
700
+ { label : _ ( 'Carto Positron' ) , value : 'carto-positron' } ,
701
+ { label : _ ( 'Carto Dark Matter' ) , value : 'carto-darkmatter' } ,
702
+ { label : _ ( 'Stamen Terrain' ) , value : 'stamen-terrain' } ,
703
+ { label : _ ( 'Stamen Toner' ) , value : 'stamen-toner' } ,
704
+ { label : _ ( 'Stamen Watercolor' ) , value : 'stamen-watercolor' } ,
705
+ ] ) ;
706
+ plotProps . clearable = false ;
707
+ } ,
708
+ } ) ;
709
+ MapboxStyleDropdown . contextTypes = {
710
+ mapBoxAccess : PropTypes . bool ,
711
+ ...MapboxStyleDropdown . contextTypes ,
712
+ } ;
713
+
658
714
export const HoveronDropdown = connectToContainer ( UnconnectedDropdown , {
659
715
modifyPlotProps : ( props , context , plotProps ) => {
660
716
const { localize : _ } = context ;
0 commit comments