@@ -4,8 +4,11 @@ import React, {Component, Fragment} from 'react';
44import { connectToContainer } from 'lib' ;
55import RadioBlocks from '../widgets/RadioBlocks' ;
66import Color from './Color' ;
7- import DataSelector from './DataSelector' ;
87import Colorscale from './Colorscale' ;
8+ import Numeric from './Numeric' ;
9+ import Radio from './Radio' ;
10+ import DataSelector from './DataSelector' ;
11+ import VisibilitySelect from './VisibilitySelect' ;
912import { MULTI_VALUED , COLORS } from 'lib/constants' ;
1013
1114class UnconnectedMarkerColor extends Component {
@@ -93,35 +96,72 @@ class UnconnectedMarkerColor extends Component {
9396 container . marker . color . includes ( MULTI_VALUED ) ) ;
9497
9598 return (
96- < Field { ...this . props } multiValued = { multiValued } attr = { attr } >
97- < RadioBlocks
98- options = { options }
99- activeOption = { type }
100- onOptionChange = { this . setType }
101- />
102- { ! type ? null : type === 'constant' ? (
103- < Color
104- suppressMultiValuedMessage
105- attr = "marker.color"
106- updatePlot = { this . setValue }
107- fullValue = { value . constant }
99+ < Fragment >
100+ < Field { ...this . props } multiValued = { multiValued } attr = { attr } >
101+ < RadioBlocks
102+ options = { options }
103+ activeOption = { type }
104+ onOptionChange = { this . setType }
108105 />
109- ) : container . marker &&
110- container . marker . colorsrc === MULTI_VALUED ? null : (
106+ { ! type ? null : type === 'constant' ? (
107+ < Color
108+ suppressMultiValuedMessage
109+ attr = "marker.color"
110+ updatePlot = { this . setValue }
111+ fullValue = { value . constant }
112+ />
113+ ) : container . marker &&
114+ container . marker . colorsrc === MULTI_VALUED ? null : (
115+ < Fragment >
116+ < DataSelector suppressMultiValuedMessage attr = "marker.color" />
117+ { container . marker &&
118+ container . marker . colorscale === MULTI_VALUED ? null : (
119+ < Colorscale
120+ suppressMultiValuedMessage
121+ attr = "marker.colorscale"
122+ updatePlot = { this . setColorScale }
123+ colorscale = { colorscale }
124+ />
125+ ) }
126+ </ Fragment >
127+ ) }
128+ </ Field >
129+ { type === 'constant' ? (
130+ ''
131+ ) : (
111132 < Fragment >
112- < DataSelector suppressMultiValuedMessage attr = "marker.color" />
113- { container . marker &&
114- container . marker . colorscale === MULTI_VALUED ? null : (
115- < Colorscale
116- suppressMultiValuedMessage
117- attr = "marker.colorscale"
118- updatePlot = { this . setColorScale }
119- colorscale = { colorscale }
120- />
121- ) }
133+ < Radio
134+ label = { _ ( 'Colorscale Direction' ) }
135+ attr = "marker.reversescale"
136+ options = { [
137+ { label : _ ( 'Normal' ) , value : false } ,
138+ { label : _ ( 'Reversed' ) , value : true } ,
139+ ] }
140+ />
141+ < Radio
142+ label = { _ ( 'Color Bar' ) }
143+ attr = "marker.showscale"
144+ options = { [
145+ { label : _ ( 'Show' ) , value : true } ,
146+ { label : _ ( 'Hide' ) , value : false } ,
147+ ] }
148+ />
149+ < VisibilitySelect
150+ label = { _ ( 'Colorscale Range' ) }
151+ attr = "marker.cauto"
152+ options = { [
153+ { label : _ ( 'Auto' ) , value : true } ,
154+ { label : _ ( 'Custom' ) , value : false } ,
155+ ] }
156+ showOn = { false }
157+ dafault = { true }
158+ >
159+ < Numeric label = { _ ( 'Min' ) } attr = "marker.cmin" />
160+ < Numeric label = { _ ( 'Max' ) } attr = "marker.cmax" />
161+ </ VisibilitySelect >
122162 </ Fragment >
123163 ) }
124- </ Field >
164+ </ Fragment >
125165 ) ;
126166 }
127167}
0 commit comments