1
- import React , { Component } from 'react' ;
1
+ import { Component } from 'react' ;
2
2
import { hot } from 'react-hot-loader/root' ;
3
3
import plotly from 'plotly.js/dist/plotly-with-meta' ;
4
4
import '../src/styles/main.scss' ;
@@ -16,15 +16,16 @@ import ACCESS_TOKENS from '../accessTokens';
16
16
17
17
// import {customConfigTest} from '../src/__stories__';
18
18
19
- const dataSourceOptions = Object . keys ( dataSources ) . map ( name => ( {
19
+ const dataSourceOptions = Object . keys ( dataSources ) . map ( ( name ) => ( {
20
20
value : name ,
21
21
label : name ,
22
22
} ) ) ;
23
23
24
24
const config = { mapboxAccessToken : ACCESS_TOKENS . MAPBOX , editable : true } ;
25
25
26
+ // eslint-disable-next-line no-unused-vars
26
27
const traceTypesConfig = {
27
- traces : _ => [
28
+ traces : ( _ ) => [
28
29
{
29
30
value : 'scatter' ,
30
31
icon : 'scatter' ,
@@ -66,16 +67,19 @@ const traceTypesConfig = {
66
67
complex : true ,
67
68
} ;
68
69
70
+ // eslint-disable-next-line no-unused-vars
69
71
const chartHelp = {
70
72
area : {
71
73
helpDoc : 'https://help.plot.ly/make-an-area-graph/' ,
72
74
examplePlot : ( ) => {
75
+ // eslint-disable-next-line no-console
73
76
console . log ( 'example bar plot!' ) ;
74
77
} ,
75
78
} ,
76
79
bar : {
77
80
helpDoc : 'https://help.plot.ly/stacked-bar-chart/' ,
78
81
examplePlot : ( ) => {
82
+ // eslint-disable-next-line no-console
79
83
console . log ( 'example bar plot!' ) ;
80
84
} ,
81
85
} ,
@@ -118,12 +122,12 @@ class App extends Component {
118
122
this . updateState = this . updateState . bind ( this ) ;
119
123
}
120
124
121
- componentWillMount ( ) {
125
+ UNSAFE_componentWillMount ( ) {
122
126
// curl https://api.github.com/repos/plotly/plotly.js/contents/test/image/mocks \
123
127
// | jq '[.[] | .name ]' > mocks.json
124
128
fetch ( '/mocks.json' )
125
- . then ( response => response . json ( ) )
126
- . then ( mocks => this . setState ( { mocks} ) ) ;
129
+ . then ( ( response ) => response . json ( ) )
130
+ . then ( ( mocks ) => this . setState ( { mocks} ) ) ;
127
131
}
128
132
129
133
loadMock ( mockIndex ) {
@@ -135,8 +139,8 @@ class App extends Component {
135
139
fetch ( prefix + mockName , {
136
140
headers : new Headers ( { Accept : 'application/vnd.github.v3.raw' } ) ,
137
141
} )
138
- . then ( response => response . json ( ) )
139
- . then ( figure => {
142
+ . then ( ( response ) => response . json ( ) )
143
+ . then ( ( figure ) => {
140
144
const { data, layout, frames} = figure ;
141
145
this . updateState ( data , layout , frames , mockIndex ) ;
142
146
} ) ;
@@ -219,7 +223,7 @@ class App extends Component {
219
223
} ) ) }
220
224
searchable = { true }
221
225
searchPromptText = "Search for a mock"
222
- onChange = { option => this . loadMock ( option . value ) }
226
+ onChange = { ( option ) => this . loadMock ( option . value ) }
223
227
noResultsText = { 'No Results' }
224
228
placeholder = { 'Search for a mock' }
225
229
/>
@@ -234,7 +238,7 @@ class App extends Component {
234
238
< AceEditor
235
239
mode = "json"
236
240
theme = "textmate"
237
- onChange = { json_string => this . setState ( { json_string} ) }
241
+ onChange = { ( json_string ) => this . setState ( { json_string} ) }
238
242
value = { this . state . json_string }
239
243
name = "UNIQUE_ID_OF_DIV"
240
244
style = { { height : '80vh' } }
0 commit comments