1
1
import React , { Component } from 'react' ;
2
+ import { hot } from 'react-hot-loader' ;
2
3
import plotly from 'plotly.js/dist/plotly' ;
3
4
import createPlotComponent from 'react-plotly.js/factory' ;
4
5
import PlotlyEditor from '../src' ;
5
- import { hot } from 'react-hot-loader' ;
6
6
import '../src/styles/main.scss' ;
7
7
import Nav from './Nav' ;
8
8
9
+ // https://github.com/plotly/react-plotly.js-editor#mapbox-access-tokens
10
+ import ACCESS_TOKENS from '../accessTokens' ;
11
+
9
12
const dataSources = {
10
13
col1 : [ 1 , 2 , 3 ] , // eslint-disable-line no-magic-numbers
11
14
col2 : [ 4 , 3 , 2 ] , // eslint-disable-line no-magic-numbers
@@ -71,12 +74,7 @@ class App extends Component {
71
74
72
75
render ( ) {
73
76
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" >
80
78
< div className = "app" >
81
79
< PlotlyEditor
82
80
graphDiv = { this . state . graphDiv }
@@ -85,20 +83,31 @@ class App extends Component {
85
83
dataSources = { dataSources }
86
84
dataSourceOptions = { dataSourceOptions }
87
85
plotly = { plotly }
86
+ advancedTraceTypeSelector
88
87
/>
89
88
< div className = "app__main" style = { { width : '100%' , height : '100%' } } >
90
89
< Plot
91
- debug
92
- useResizeHandler
90
+ config = { { mapboxAccessToken : ACCESS_TOKENS . MAPBOX , editable : true } }
93
91
data = { this . state . graphDiv . data }
92
+ debug
94
93
layout = { this . state . graphDiv . layout }
95
- onUpdate = { this . handlePlotUpdate . bind ( this ) }
96
94
onInitialized = { this . handlePlotUpdate . bind ( this ) }
95
+ onUpdate = { this . handlePlotUpdate . bind ( this ) }
97
96
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
+ } }
99
103
/>
100
104
</ div >
101
105
</ div >
106
+ < Nav
107
+ currentMockIndex = { this . state . currentMockIndex }
108
+ loadMock = { this . loadMock }
109
+ mocks = { this . state . mocks }
110
+ />
102
111
</ div >
103
112
) ;
104
113
}
0 commit comments