11import React , { Component } from 'react' ;
2+ import { hot } from 'react-hot-loader' ;
23import plotly from 'plotly.js/dist/plotly' ;
34import createPlotComponent from 'react-plotly.js/factory' ;
45import PlotlyEditor from '../src' ;
5- import { hot } from 'react-hot-loader' ;
66import '../src/styles/main.scss' ;
77import Nav from './Nav' ;
88
9+ // https://github.com/plotly/react-plotly.js-editor#mapbox-access-tokens
10+ import ACCESS_TOKENS from '../accessTokens' ;
11+
912const dataSources = {
1013 col1 : [ 1 , 2 , 3 ] , // eslint-disable-line no-magic-numbers
1114 col2 : [ 4 , 3 , 2 ] , // eslint-disable-line no-magic-numbers
@@ -71,12 +74,7 @@ class App extends Component {
7174
7275 render ( ) {
7376 return (
74- < div >
75- < Nav
76- mocks = { this . state . mocks }
77- currentMockIndex = { this . state . currentMockIndex }
78- loadMock = { this . loadMock }
79- />
77+ < div className = "app__container plotly-editor--theme-provider" >
8078 < div className = "app" >
8179 < PlotlyEditor
8280 graphDiv = { this . state . graphDiv }
@@ -85,20 +83,31 @@ class App extends Component {
8583 dataSources = { dataSources }
8684 dataSourceOptions = { dataSourceOptions }
8785 plotly = { plotly }
86+ advancedTraceTypeSelector
8887 />
8988 < div className = "app__main" style = { { width : '100%' , height : '100%' } } >
9089 < Plot
91- debug
92- useResizeHandler
90+ config = { { mapboxAccessToken : ACCESS_TOKENS . MAPBOX , editable : true } }
9391 data = { this . state . graphDiv . data }
92+ debug
9493 layout = { this . state . graphDiv . layout }
95- onUpdate = { this . handlePlotUpdate . bind ( this ) }
9694 onInitialized = { this . handlePlotUpdate . bind ( this ) }
95+ onUpdate = { this . handlePlotUpdate . bind ( this ) }
9796 revision = { this . state . plotRevision }
98- style = { { width : '100%' , height : '100%' , minHeight : '100vh' } }
97+ useResizeHandler
98+ style = { {
99+ width : '100%' ,
100+ height : '100%' ,
101+ minHeight : 'calc(100vh - 50px)' ,
102+ } }
99103 />
100104 </ div >
101105 </ div >
106+ < Nav
107+ currentMockIndex = { this . state . currentMockIndex }
108+ loadMock = { this . loadMock }
109+ mocks = { this . state . mocks }
110+ />
102111 </ div >
103112 ) ;
104113 }
0 commit comments