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