@eeacms/react-chart-editor
Version:
plotly.js chart editor react component UI
2 lines • 31.2 kB
JavaScript
;Object.defineProperty(exports,"__esModule",{value:true});exports.TickMode=exports.TickFormat=exports.TickArrayDataSelector=exports.TextInfo=exports.SpikeColor=exports.SizeVisibilitySelect=exports.ShowInLegend=exports.ScaleRadio=exports.RangesliderVisible=exports.PositioningRef=exports.PositioningNumeric=exports.NumericReciprocal=exports.NumericHeight=exports.NumericFractionInverse=exports.NumericFractionDomain=exports.NumericFraction=exports.NTicks=exports.MapboxStyleDropdown=exports.MapboxSourceArray=exports.LevelRendered=exports.HoveronDropdown=exports.HovermodeDropdown=exports.HoverTemplateText=exports.HoverTemplateSwitch=exports.HoverInfo=exports.HoverColor=exports.HistogramInfoVertical=exports.HistogramInfoHorizontal=exports.Histogram2d=exports.FillDropdown=exports.DatasetDropdown=exports.DTicksInterval=exports.DTicks=exports.CustomNumeric=exports.ContourNumeric=exports.BinningDropdown=exports.AxisSide=exports.AxisOverlayDropdown=exports.AxisAnchorDropdown=exports.AxesRange=exports.AnnotationRef=exports.AnnotationArrowRef=void 0;var _fastIsnumeric=_interopRequireDefault(require("fast-isnumeric"));var _Dropdown=require("./Dropdown");var _DropdownCustom=require("./DropdownCustom");var _Flaglist=require("./Flaglist");var _Numeric=require("./Numeric");var _NumericOrDate=require("./NumericOrDate");var _AxisRangeValue=require("./AxisRangeValue");var _Radio=require("./Radio");var _AxisInterval=require("./AxisInterval");var _Info=_interopRequireDefault(require("./Info"));var _ColorPicker=require("./ColorPicker");var _TextEditor=require("./TextEditor");var _VisibilitySelect=require("./VisibilitySelect");var _DataSelector=require("./DataSelector");var _lib=require("../../lib");var _propTypes=_interopRequireDefault(require("prop-types"));var _Text=_interopRequireDefault(require("./Text"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(function(){var enterModule=typeof reactHotLoaderGlobal!=="undefined"?reactHotLoaderGlobal.enterModule:undefined;enterModule&&enterModule(module)})();function ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,o)}return t}function _objectSpread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?ownKeys(Object(t),!0).forEach(function(r){_defineProperty(e,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})}return e}function _defineProperty(e,r,t){return(r=_toPropertyKey(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==typeof i?i:i+""}function _toPrimitive(t,r){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}var __signature__=typeof reactHotLoaderGlobal!=="undefined"?reactHotLoaderGlobal.default.signature:function(a){return a};const AxisAnchorDropdown=exports.AxisAnchorDropdown=(0,_lib.connectToContainer)(_Dropdown.UnconnectedDropdown,{modifyPlotProps:(props,context,plotProps)=>{const{localize:_}=context;let options=[];if(props.attr.startsWith("xaxis")){options=context.fullLayout._subplots.yaxis.map(axis=>{return{label:(0,_lib.getAxisTitle)(context.fullLayout[(0,_lib.axisIdToAxisName)(axis)]),value:axis}})}else if(props.attr.startsWith("yaxis")){options=context.fullLayout._subplots.xaxis.map(axis=>{return{label:(0,_lib.getAxisTitle)(context.fullLayout[(0,_lib.axisIdToAxisName)(axis)]),value:axis}})}options.push({label:_("Free"),value:"free"});plotProps.options=options}});const AxisOverlayDropdown=exports.AxisOverlayDropdown=(0,_lib.connectToContainer)(_Dropdown.UnconnectedDropdown,{modifyPlotProps:(props,context,plotProps)=>{const{localize:_}=context;let options=[];if(props.attr.startsWith("xaxis")){options=context.fullLayout._subplots.xaxis.map(axis=>{return{label:(0,_lib.getAxisTitle)(context.fullLayout[(0,_lib.axisIdToAxisName)(axis)]),value:axis}})}else if(props.attr.startsWith("yaxis")){options=context.fullLayout._subplots.yaxis.map(axis=>{return{label:(0,_lib.getAxisTitle)(context.fullLayout[(0,_lib.axisIdToAxisName)(axis)]),value:axis}})}options.unshift({label:_("None"),value:false});plotProps.options=options.filter(option=>context.fullContainer&&context.fullContainer.xaxis&&context.fullContainer.yaxis&&context.fullContainer.xaxis._id!==option.value&&context.fullContainer.yaxis._id!==option.value);plotProps.clearable=false}});const RangesliderVisible=exports.RangesliderVisible=(0,_lib.connectToContainer)(_Radio.UnconnectedRadio,{modifyPlotProps:(props,context,plotProps)=>{if(!plotProps.fullValue){plotProps.fullValue=false;plotProps.visible=false;plotProps.isVisible=true;return}}});const AxisSide=exports.AxisSide=(0,_lib.connectToContainer)(_Radio.UnconnectedRadio,{modifyPlotProps:(props,context,plotProps)=>{const _=context.localize;if(plotProps.fullValue==="left"||plotProps.fullValue==="right"){plotProps.options=[{label:_("Left"),value:"left"},{label:_("Right"),value:"right"}];return}if(plotProps.fullValue==="top"||plotProps.fullValue==="bottom"){plotProps.options=[{label:_("Top"),value:"top"},{label:_("Bottom"),value:"bottom"}];return}if(plotProps.fullValue==="clockwise"||plotProps.fullValue==="counterclockwise"){plotProps.options=[{label:_("Clockwise"),value:"clockwise"},{label:_("Counterclockwise"),value:"counterclockwise"}];return}plotProps.isVisible=false}});const ScaleRadio=exports.ScaleRadio=(0,_lib.connectToContainer)(_Radio.UnconnectedRadio,{modifyPlotProps:(props,context,plotProps)=>{var _container$autoscale;const{container}=context;plotProps.fullValue=(_container$autoscale=container.autoscale)!==null&&_container$autoscale!==void 0?_container$autoscale:props.defaultValue;plotProps.description="Enables autoscaling of the plot based on initial container size."}});const ContourNumeric=exports.ContourNumeric=(0,_lib.connectToContainer)(_Numeric.UnconnectedNumeric,{modifyPlotProps:(props,context,plotProps)=>{const{fullContainer}=plotProps;if(plotProps.isVisible&&fullContainer&&fullContainer.autocontour){plotProps.isVisible=false}}});const BinningDropdown=exports.BinningDropdown=(0,_lib.connectToContainer)(_Dropdown.UnconnectedDropdown,{modifyPlotProps:(props,context,plotProps)=>{const{localize:_}=context;const axis=plotProps.fullContainer.type==="histogram2d"?"Z":plotProps.fullContainer.orientation==="v"?"Y":"X";plotProps.options=[{label:_("Count ")+axis,value:"count"},{label:_("Sum ")+axis,value:"sum"},{label:_("Average ")+axis,value:"avg"},{label:_("Minimum ")+axis,value:"min"},{label:_("Maximum ")+axis,value:"max"}]}});const TickFormat=exports.TickFormat=(0,_lib.connectToContainer)(_DropdownCustom.UnconnectedDropdownCustom,{modifyPlotProps:(props,context,plotProps)=>{const{localize:_}=context;if(plotProps.fullContainer.type==="date"){plotProps.options=[{label:_("Default"),value:""},{label:_("Advanced (d3-time-format)"),value:"%x"}];plotProps.customOpt="%x"}else{plotProps.options=[{label:_("Simple"),value:""},{label:_("Advanced (d3-format)"),value:"s"}];plotProps.customOpt="s"}}});const ShowInLegend=exports.ShowInLegend=(0,_lib.connectToContainer)(_VisibilitySelect.UnconnectedVisibilitySelect,{modifyPlotProps:(props,context,plotProps)=>{if(context.container.type&&context.container.type!=="sunburst"&&context.container.type!=="treemap"){plotProps.isVisible=context.fullLayout.showlegend}return plotProps}});const HistogramInfoVertical=exports.HistogramInfoVertical=(0,_lib.connectToContainer)(_Info.default,{modifyPlotProps:(props,context,plotProps)=>{plotProps.isVisible=context.fullContainer.type==="histogram"&&context.fullContainer.orientation==="v";return plotProps}});const HistogramInfoHorizontal=exports.HistogramInfoHorizontal=(0,_lib.connectToContainer)(_Info.default,{modifyPlotProps:(props,context,plotProps)=>{plotProps.isVisible=context.fullContainer.type==="histogram"&&context.fullContainer.orientation==="h";return plotProps}});const Histogram2d=exports.Histogram2d=(0,_lib.connectToContainer)(_Info.default,{modifyPlotProps:(props,context,plotProps)=>{plotProps.isVisible=context.fullContainer.type==="histogram2d";return plotProps}});const AxesRange=exports.AxesRange=(0,_lib.connectToContainer)(_AxisRangeValue.UnconnectedAxisRangeValue,{modifyPlotProps:(props,context,plotProps)=>{const{fullContainer}=plotProps;if(plotProps.isVisible&&fullContainer&&fullContainer.autorange){plotProps.isVisible=false}return plotProps}});const TickMode=exports.TickMode=(0,_lib.connectToContainer)(_Dropdown.UnconnectedDropdown,{modifyPlotProps:(props,context,plotProps)=>{const{updatePlot}=plotProps;plotProps.updatePlot=v=>{const update={};if(v!=="array"){}if(v!=="auto"){update.nticks=null}if(v!=="linear"){update.tick0=null;update.dtick=null}if(v==="array"){update.tickvals=[]}updatePlot(v,update)};return plotProps}});const NTicks=exports.NTicks=(0,_lib.connectToContainer)(_Numeric.UnconnectedNumeric,{modifyPlotProps:(props,context,plotProps)=>{const{fullContainer}=plotProps;if(plotProps.isVisible&&fullContainer&&fullContainer.tickmode!=="auto"){plotProps.isVisible=false}return plotProps}});const DTicks=exports.DTicks=(0,_lib.connectToContainer)(_AxisRangeValue.UnconnectedAxisRangeValue,{modifyPlotProps:(props,context,plotProps)=>{const{fullContainer}=plotProps;if(fullContainer&&fullContainer._name&&(fullContainer._name.startsWith("lat")||fullContainer._name.startsWith("lon"))){return plotProps}if(plotProps.isVisible&&fullContainer&&fullContainer.tickmode!=="linear"){plotProps.isVisible=false}return plotProps}});const DTicksInterval=exports.DTicksInterval=(0,_lib.connectToContainer)(_AxisInterval.UnconnectedAxisInterval,{modifyPlotProps:(props,context,plotProps)=>{const{fullContainer}=plotProps;if(fullContainer&&fullContainer._name&&(fullContainer._name.startsWith("lat")||fullContainer._name.startsWith("lon"))){return plotProps}if(plotProps.isVisible&&fullContainer&&fullContainer.tickmode!=="linear"){plotProps.isVisible=false}return plotProps}});const TickArrayDataSelector=exports.TickArrayDataSelector=(0,_lib.connectToContainer)(_DataSelector.UnconnectedDataSelector,{modifyPlotProps:(props,context,plotProps)=>{const{updateContainer}=context;const{fullContainer}=plotProps;plotProps.isVisible=true;if(fullContainer&&fullContainer.tickmode!=="array"){plotProps.isVisible=false}plotProps.updateContainer=update=>{if(updateContainer){updateContainer(_objectSpread(_objectSpread({},update),!update.tickvals?{tickvals:[]}:{}))}};return plotProps}});class UnconnectedNumericFraction extends _Numeric.UnconnectedNumeric{}UnconnectedNumericFraction.propTypes=_Numeric.UnconnectedNumeric.propTypes;UnconnectedNumericFraction.defaultProps={units:"%",showSlider:true};UnconnectedNumericFraction.displayName="UnconnectedNumericFraction";const numericFractionModifyPlotProps=(props,context,plotProps)=>{const{attrMeta,fullValue,updatePlot}=plotProps;const min=attrMeta&&attrMeta.min||0;const max=attrMeta&&attrMeta.max||1;if((0,_fastIsnumeric.default)(fullValue)){plotProps.fullValue=Math.round(100*(fullValue-min)/(max-min))}plotProps.updatePlot=v=>{if((0,_fastIsnumeric.default)(v)){updatePlot(v/100*(max-min)+min)}else{updatePlot(v)}};plotProps.max=100;plotProps.min=0};const NumericFraction=exports.NumericFraction=(0,_lib.connectToContainer)(UnconnectedNumericFraction,{modifyPlotProps:numericFractionModifyPlotProps});const NumericFractionDomain=exports.NumericFractionDomain=(0,_lib.connectToContainer)(UnconnectedNumericFraction,{modifyPlotProps:(props,context,plotProps)=>{numericFractionModifyPlotProps(props,context,plotProps);if(context.container&&context.container.overlaying){plotProps.isVisible=null}}});const NumericFractionInverse=exports.NumericFractionInverse=(0,_lib.connectToContainer)(UnconnectedNumericFraction,{modifyPlotProps:(props,context,plotProps)=>{const{attrMeta,fullValue,updatePlot}=plotProps;if((0,_fastIsnumeric.default)(fullValue)){plotProps.fullValue=Math.round((1-fullValue)*100)}plotProps.updatePlot=v=>{if((0,_fastIsnumeric.default)(v)){updatePlot(1-v/100)}else{updatePlot(v)}};if(attrMeta){if((0,_fastIsnumeric.default)(attrMeta.min)){plotProps.max=(1-attrMeta.min)*100}if((0,_fastIsnumeric.default)(attrMeta.max)){plotProps.min=(1-attrMeta.max)*100}}}});const NumericReciprocal=exports.NumericReciprocal=(0,_lib.connectToContainer)(_Numeric.UnconnectedNumeric,{modifyPlotProps:(props,context,plotProps)=>{const{fullValue,updatePlot}=plotProps;if((0,_fastIsnumeric.default)(fullValue)){plotProps.fullValue=1/fullValue}plotProps.updatePlot=v=>{if((0,_fastIsnumeric.default)(v)){updatePlot(1/v)}else{updatePlot(v)}};plotProps.min=0}});const NumericHeight=exports.NumericHeight=(0,_lib.connectToContainer)(_Numeric.UnconnectedNumeric,{modifyPlotProps:(props,context,plotProps)=>{if(props.attr!=="_height"){return}plotProps.description="Set's the plot height (in px).";const{fullLayout}=context;if(fullLayout.autosize){plotProps.isVisible=true;if(!plotProps.container._height){plotProps.updatePlot(fullLayout.height)}plotProps.fullValue=plotProps.container._height}else if(plotProps.container._height){plotProps.updatePlot(null)}}});const CustomNumeric=exports.CustomNumeric=(0,_lib.connectToContainer)(_Numeric.UnconnectedNumeric,{modifyPlotProps:(props,context,plotProps)=>{plotProps.fullValue=plotProps.container[props.attr];plotProps.description=props.description;plotProps.isVisible=true}});const AnnotationArrowRef=exports.AnnotationArrowRef=(0,_lib.connectToContainer)(_Dropdown.UnconnectedDropdown,{modifyPlotProps:(props,context,plotProps)=>{const{localize:_}=context;if(!context.fullContainer){return}const{fullContainer:{xref,yref}}=context;let currentAxisRef;if(props.attr==="axref"){currentAxisRef=xref}else if(props.attr==="ayref"){currentAxisRef=yref}else{throw new Error(_("AnnotationArrowRef must be given either \"axref\" or \"ayref\" as attrs. Instead was given")+props.attr)}if(currentAxisRef==="paper"){const axes=(0,_lib.getAllAxes)(context.fullLayout).filter(a=>a._id);if(axes.length>0){plotProps.options=[{label:_("in pixels"),value:"pixel"},...computeAxesRefOptions(axes,props.attr)]}else{plotProps.isVisible=false}}else{plotProps.options=[{label:_("in pixels"),value:"pixel"},{label:_("according to axis"),value:currentAxisRef}]}plotProps.clearable=false}});const AnnotationRef=exports.AnnotationRef=(0,_lib.connectToContainer)(_Dropdown.UnconnectedDropdown,{modifyPlotProps:(props,context,plotProps)=>{if(!context.fullContainer){return}const{fullContainer:{axref,ayref},localize:_}=context;const{updatePlot}=plotProps;let currentOffsetRef;if(props.attr==="xref"){currentOffsetRef=axref}else if(props.attr==="yref"){currentOffsetRef=ayref}else{throw new Error(_("AnnotationRef must be given either \"xref\" or \"yref\" as attrs. Instead was given")+props.attr+".")}const axes=(0,_lib.getAllAxes)(context.fullLayout).filter(a=>a._id);if(axes.length>0){plotProps.options=[{label:_("Canvas"),value:"paper"},...computeAxesRefOptions(axes,props.attr)]}else{plotProps.isVisible=false}if(currentOffsetRef!=="pixel"){plotProps.updatePlot=v=>{if(!updatePlot){return}const update={};if(v!=="paper"){update["a".concat(props.attr)]=v}updatePlot(v,update)}}plotProps.clearable=false}});const PositioningRef=exports.PositioningRef=(0,_lib.connectToContainer)(_Dropdown.UnconnectedDropdown,{modifyPlotProps:(props,context,plotProps)=>{const axes=(0,_lib.getAllAxes)(context.fullLayout).filter(a=>a._id);if(axes.length>0){plotProps.options=[{label:"Canvas",value:"paper"},...computeAxesRefOptions(axes,props.attr)];plotProps.clearable=false}else{plotProps.isVisible=false}}});const PositioningNumeric=exports.PositioningNumeric=(0,_lib.connectToContainer)(_NumericOrDate.UnconnectedNumericOrDate,{modifyPlotProps:(props,context,plotProps)=>{const{fullContainer}=plotProps;if(fullContainer&&(fullContainer[props.attr[0]+"ref"]==="paper"||fullContainer[props.attr[props.attr.length-1]+"ref"]==="paper")){plotProps.step=0.02}}});function computeAxesRefOptions(axes,propsAttr){const options=[];for(let i=0;i<axes.length;i++){const ax=axes[i];if(ax._id.charAt(0)===propsAttr.charAt(0)||ax._id.charAt(0)===propsAttr.charAt(1)){const label=(0,_lib.getAxisTitle)(ax);options.push({label,value:ax._id})}}return options}const TextInfo=exports.TextInfo=(0,_lib.connectToContainer)(_Flaglist.UnconnectedFlaglist,{modifyPlotProps:(props,context,plotProps)=>{const{localize:_,container}=context;let options=[{label:_("Label"),value:"label"},{label:_("Value"),value:"value"},{label:_("%"),value:"percent"}];if(container.type==="funnel"){options=[{label:_("Label"),value:"label"},{label:_("Value"),value:"value"},{label:_("% initial"),value:"percent initial"},{label:_("% previous"),value:"percent previous"},{label:_("% total"),value:"percent total"}]}if(container.text){options.push({label:_("Text"),value:"text"})}plotProps.options=options}});const HoverTemplateSwitch=exports.HoverTemplateSwitch=(0,_lib.connectToContainer)(_Radio.UnconnectedRadio,{modifyPlotProps:(props,context,plotProps)=>{const{localize:_}=context;plotProps.options=[{label:_("Values"),value:""},{label:_("Template"),value:plotProps.fullValue||" "}];return plotProps}});const HoverTemplateText=exports.HoverTemplateText=(0,_lib.connectToContainer)(_TextEditor.UnconnectedTextEditor,{modifyPlotProps:(props,context,plotProps)=>{plotProps.emptyValue=" ";if(plotProps.isVisible&&plotProps.fullValue===""){plotProps.isVisible=false}return plotProps}});const HoverInfo=exports.HoverInfo=(0,_lib.connectToContainer)(_Flaglist.UnconnectedFlaglist,{modifyPlotProps:(props,context,plotProps)=>{const{localize:_,container}=context;let options=[{label:_("X"),value:"x"},{label:_("Y"),value:"y"}];if(["heatmap","heatmapgl","histogram2d","histogram2dcontour","contour","contourcarpet","scatter3d","surface","mesh3d"].includes(container.type)){options.push({label:_("Z"),value:"z"})}else if(container.type==="choropleth"){options=[{label:_("Location"),value:"location"},{label:_("Values"),value:"z"}]}else if(container.type==="scattergeo"){if(container.locations){options=[{label:_("Location"),value:"location"}]}else if(container.lat||container.lon){options=[{label:_("Longitude"),value:"lon"},{label:_("Latitude"),value:"lat"}]}}else if(container.type==="scattermapbox"){options=[{label:_("Longitude"),value:"lon"},{label:_("Latitude"),value:"lat"}]}else if(container.type==="densitymapbox"){options=[{label:_("Longitude"),value:"lon"},{label:_("Latitude"),value:"lat"},{label:_("Z"),value:"z"}]}else if(container.type==="scatterternary"){options=[{label:_("A"),value:"a"},{label:_("B"),value:"b"},{label:_("C"),value:"c"}]}else if(["scatterpolar","scatterpolargl","barpolar"].includes(container.type)){options=[{label:_("R"),value:"r"},{label:_("Theta"),value:"theta"}]}else if(container.type==="pie"){options=[{label:_("Percent"),value:"percent"}]}else if(container.type==="table"){plotProps.isVisible=false}else if(["cone","streamtube"].includes(container.type)){options=[{label:_("X"),value:"x"},{label:_("Y"),value:"y"},{label:_("Z"),value:"z"},{label:_("U"),value:"u"},{label:_("V"),value:"v"},{label:_("W"),value:"w"},{label:_("Norm"),value:"norm"},{label:_("Divergence"),value:"divergence"}]}else if(container.type==="sunburst"||container.type==="treemap"){options=[]}if(container.labels&&["pie","sunburst","treemap","funnelarea"].includes(container.type)){options.push({label:_("Label"),value:"label"})}if(container.values&&["pie","sunburst","treemap","funnelarea"].includes(container.type)){options.push({label:_("Value"),value:"value"})}if(container.text){options.push({label:_("Text"),value:"text"})}options.push({label:_("Trace name"),value:"name"});plotProps.options=options}});const FillDropdown=exports.FillDropdown=(0,_lib.connectToContainer)(_Dropdown.UnconnectedDropdown,{modifyPlotProps:(props,context,plotProps)=>{const{localize:_}=context;let options=[{label:_("None"),value:"none"},{label:_("Y = 0"),value:"tozeroy"},{label:_("X = 0"),value:"tozerox"},{label:_("Previous Y"),value:"tonexty"},{label:_("Previous X"),value:"tonextx"}];if(context.container.type==="scatterternary"||context.container.type==="scattercarpet"||context.container.type==="scatterpolar"){options=[{label:_("None"),value:"none"},{label:_("To Self"),value:"toself"},{label:_("To Next"),value:"tonext"}]}else if(context.container.type==="scattergeo"||context.container.type==="scattermapbox"){options=[{label:_("None"),value:"none"},{label:_("To Self"),value:"toself"}]}plotProps.options=options;plotProps.clearable=false}});const MapboxSourceArray=exports.MapboxSourceArray=(0,_lib.connectToContainer)(_Text.default,{modifyPlotProps:(props,context,plotProps)=>{const{fullValue,updatePlot}=plotProps;if(plotProps.fullValue&&plotProps.fullValue.length>0){plotProps.fullValue=fullValue[0]}plotProps.updatePlot=v=>{if(v.length){updatePlot([v])}else{updatePlot([])}}}});const MapboxStyleDropdown=exports.MapboxStyleDropdown=(0,_lib.connectToContainer)(_Dropdown.UnconnectedDropdown,{modifyPlotProps:(props,context,plotProps)=>{const{mapBoxAccess,localize:_}=context;plotProps.options=(!mapBoxAccess?[]:[{label:_("Mapbox Basic"),value:"basic"},{label:_("Mapbox Outdoors"),value:"outdoors"},{label:_("Mapbox Light"),value:"light"},{label:_("Mapbox Dark"),value:"dark"},{label:_("Mapbox Satellite"),value:"satellite"},{label:_("Mapbox Satellite with Streets"),value:"satellite-streets"}]).concat([{label:_("No tiles (white background)"),value:"white-bg"},{label:_("Open Street Map"),value:"open-street-map"},{label:_("Carto Positron"),value:"carto-positron"},{label:_("Carto Dark Matter"),value:"carto-darkmatter"},{label:_("Stamen Terrain"),value:"stamen-terrain"},{label:_("Stamen Toner"),value:"stamen-toner"},{label:_("Stamen Watercolor"),value:"stamen-watercolor"}]);plotProps.clearable=false}});MapboxStyleDropdown.contextTypes=_objectSpread({mapBoxAccess:_propTypes.default.bool},MapboxStyleDropdown.contextTypes);const HoveronDropdown=exports.HoveronDropdown=(0,_lib.connectToContainer)(_Dropdown.UnconnectedDropdown,{modifyPlotProps:(props,context,plotProps)=>{const{localize:_}=context;let options;if(context.container.type==="box"){options=[{label:_("Boxes"),value:"boxes"},{label:_("Points"),value:"points"},{label:_("Boxes and Points"),value:"boxes+points"}]}else if(context.container.type==="violin"){options=[{label:_("Violins"),value:"violins"},{label:_("Points"),value:"points"},{label:_("KDE"),value:"kde"},{label:_("Violins and Points"),value:"violins+points"},{label:_("Violins, Points and KDE"),value:"violins+points+kde"}]}else{options=[{label:_("Points"),value:"points"},{label:_("Fills"),value:"fills"},{label:_("Points and Fills"),value:"points+fills"}]}plotProps.options=options;plotProps.clearable=false}});const SizeVisibilitySelect=exports.SizeVisibilitySelect=(0,_lib.connectToContainer)(_VisibilitySelect.UnconnectedVisibilitySelect,{modifyPlotProps:(props,context,plotProps)=>{const{fullContainer,container}=context;const{updatePlot}=plotProps;plotProps.updatePlot=function(v){let _update=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};const update=_objectSpread({},_update);update.width=v?null:fullContainer.width;update.height=v?null:fullContainer.height;update.autoscale=v?null:container.autoscale;updatePlot(v,update)};return plotProps}});const HovermodeDropdown=exports.HovermodeDropdown=(0,_lib.connectToContainer)(_VisibilitySelect.UnconnectedVisibilitySelect,{modifyPlotProps:(props,context,plotProps)=>{const{localize:_}=context;plotProps.options=context.container.xaxis&&Object.keys(context.container.xaxis).length>0?[{label:_("Closest"),value:"closest"},{label:_("X Axis"),value:"x"},{label:_("Y Axis"),value:"y"},{label:_("X Unified"),value:"x unified"},{label:_("Y Unified"),value:"y unified"},{label:_("Disable"),value:false}]:[{label:_("Closest"),value:"closest"},{label:_("Disable"),value:false}];plotProps.clearable=false;plotProps.dropdown=true;plotProps.showOn=["closest","x","y","x unified","y unified"]}});const HoverColor=exports.HoverColor=(0,_lib.connectToContainer)(_ColorPicker.UnconnectedColorPicker,{modifyPlotProps:(props,context,plotProps)=>{plotProps.isVisible=Boolean(context.fullLayout.hovermode);if(["x unified","y unified"].includes(context.fullLayout.hovermode)){plotProps.handleEmpty=false}return plotProps}});const SpikeColor=exports.SpikeColor=(0,_lib.connectToContainer)(_ColorPicker.UnconnectedColorPicker,{modifyPlotProps:(props,context,plotProps)=>{plotProps.isVisible=Boolean(context.fullContainer.showspikes);return plotProps}});const LevelRendered=exports.LevelRendered=(0,_lib.connectToContainer)(_Dropdown.UnconnectedDropdown,{modifyPlotProps:(props,context,plotProps)=>{const _=context.localize;if(context.container.ids&&context.container.ids.length){plotProps.isVisible=true;plotProps.options=[{label:_("Root"),value:""}].concat(context.container.ids.map(i=>({label:i,value:i})))}}});const DatasetDropdown=exports.DatasetDropdown=(0,_lib.connectToContainer)(_Dropdown.UnconnectedDropdown,{modifyPlotProps:(props,context,plotProps)=>{const datasets=Array.from(new Set(context.data.filter(trace=>Boolean(trace.dataset)).map(trace=>trace.dataset))).map(d=>({label:d,value:d}));plotProps.isVisible=true;plotProps.creatable=true;plotProps.searchable=true;plotProps.options=datasets;plotProps.fullValue=context.container.dataset;plotProps.description="Assigns a grouping key to each trace. Traces with the same value are exported together into one CSV file."}});;(function(){var reactHotLoader=typeof reactHotLoaderGlobal!=="undefined"?reactHotLoaderGlobal.default:undefined;if(!reactHotLoader){return}reactHotLoader.register(AxisAnchorDropdown,"AxisAnchorDropdown","/react-chart-editor/src/components/fields/derived.js");reactHotLoader.register(AxisOverlayDropdown,"AxisOverlayDropdown","/react-chart-editor/src/components/fields/derived.js");reactHotLoader.register(RangesliderVisible,"RangesliderVisible","/react-chart-editor/src/components/fields/derived.js");reactHotLoader.register(AxisSide,"AxisSide","/react-chart-editor/src/components/fields/derived.js");reactHotLoader.register(ScaleRadio,"ScaleRadio","/react-chart-editor/src/components/fields/derived.js");reactHotLoader.register(ContourNumeric,"ContourNumeric","/react-chart-editor/src/components/fields/derived.js");reactHotLoader.register(BinningDropdown,"BinningDropdown","/react-chart-editor/src/components/fields/derived.js");reactHotLoader.register(TickFormat,"TickFormat","/react-chart-editor/src/components/fields/derived.js");reactHotLoader.register(ShowInLegend,"ShowInLegend","/react-chart-editor/src/components/fields/derived.js");reactHotLoader.register(HistogramInfoVertical,"HistogramInfoVertical","/react-chart-editor/src/components/fields/derived.js");reactHotLoader.register(HistogramInfoHorizontal,"HistogramInfoHorizontal","/react-chart-editor/src/components/fields/derived.js");reactHotLoader.register(Histogram2d,"Histogram2d","/react-chart-editor/src/components/fields/derived.js");reactHotLoader.register(AxesRange,"AxesRange","/react-chart-editor/src/components/fields/derived.js");reactHotLoader.register(TickMode,"TickMode","/react-chart-editor/src/components/fields/derived.js");reactHotLoader.register(NTicks,"NTicks","/react-chart-editor/src/components/fields/derived.js");reactHotLoader.register(DTicks,"DTicks","/react-chart-editor/src/components/fields/derived.js");reactHotLoader.register(DTicksInterval,"DTicksInterval","/react-chart-editor/src/components/fields/derived.js");reactHotLoader.register(TickArrayDataSelector,"TickArrayDataSelector","/react-chart-editor/src/components/fields/derived.js");reactHotLoader.register(UnconnectedNumericFraction,"UnconnectedNumericFraction","/react-chart-editor/src/components/fields/derived.js");reactHotLoader.register(numericFractionModifyPlotProps,"numericFractionModifyPlotProps","/react-chart-editor/src/components/fields/derived.js");reactHotLoader.register(NumericFraction,"NumericFraction","/react-chart-editor/src/components/fields/derived.js");reactHotLoader.register(NumericFractionDomain,"NumericFractionDomain","/react-chart-editor/src/components/fields/derived.js");reactHotLoader.register(NumericFractionInverse,"NumericFractionInverse","/react-chart-editor/src/components/fields/derived.js");reactHotLoader.register(NumericReciprocal,"NumericReciprocal","/react-chart-editor/src/components/fields/derived.js");reactHotLoader.register(NumericHeight,"NumericHeight","/react-chart-editor/src/components/fields/derived.js");reactHotLoader.register(CustomNumeric,"CustomNumeric","/react-chart-editor/src/components/fields/derived.js");reactHotLoader.register(AnnotationArrowRef,"AnnotationArrowRef","/react-chart-editor/src/components/fields/derived.js");reactHotLoader.register(AnnotationRef,"AnnotationRef","/react-chart-editor/src/components/fields/derived.js");reactHotLoader.register(PositioningRef,"PositioningRef","/react-chart-editor/src/components/fields/derived.js");reactHotLoader.register(PositioningNumeric,"PositioningNumeric","/react-chart-editor/src/components/fields/derived.js");reactHotLoader.register(computeAxesRefOptions,"computeAxesRefOptions","/react-chart-editor/src/components/fields/derived.js");reactHotLoader.register(TextInfo,"TextInfo","/react-chart-editor/src/components/fields/derived.js");reactHotLoader.register(HoverTemplateSwitch,"HoverTemplateSwitch","/react-chart-editor/src/components/fields/derived.js");reactHotLoader.register(HoverTemplateText,"HoverTemplateText","/react-chart-editor/src/components/fields/derived.js");reactHotLoader.register(HoverInfo,"HoverInfo","/react-chart-editor/src/components/fields/derived.js");reactHotLoader.register(FillDropdown,"FillDropdown","/react-chart-editor/src/components/fields/derived.js");reactHotLoader.register(MapboxSourceArray,"MapboxSourceArray","/react-chart-editor/src/components/fields/derived.js");reactHotLoader.register(MapboxStyleDropdown,"MapboxStyleDropdown","/react-chart-editor/src/components/fields/derived.js");reactHotLoader.register(HoveronDropdown,"HoveronDropdown","/react-chart-editor/src/components/fields/derived.js");reactHotLoader.register(SizeVisibilitySelect,"SizeVisibilitySelect","/react-chart-editor/src/components/fields/derived.js");reactHotLoader.register(HovermodeDropdown,"HovermodeDropdown","/react-chart-editor/src/components/fields/derived.js");reactHotLoader.register(HoverColor,"HoverColor","/react-chart-editor/src/components/fields/derived.js");reactHotLoader.register(SpikeColor,"SpikeColor","/react-chart-editor/src/components/fields/derived.js");reactHotLoader.register(LevelRendered,"LevelRendered","/react-chart-editor/src/components/fields/derived.js");reactHotLoader.register(DatasetDropdown,"DatasetDropdown","/react-chart-editor/src/components/fields/derived.js")})();;(function(){var leaveModule=typeof reactHotLoaderGlobal!=="undefined"?reactHotLoaderGlobal.leaveModule:undefined;leaveModule&&leaveModule(module)})();
//# sourceMappingURL=derived.js.map