1- import { Component } from 'react' ;
1+ import React , { Component } from 'react' ;
22import { hot } from 'react-hot-loader/root' ;
33import plotly from 'plotly.js/dist/plotly-with-meta' ;
44import '../src/styles/main.scss' ;
@@ -16,16 +16,15 @@ import ACCESS_TOKENS from '../accessTokens';
1616
1717// import {customConfigTest} from '../src/__stories__';
1818
19- const dataSourceOptions = Object . keys ( dataSources ) . map ( ( name ) => ( {
19+ const dataSourceOptions = Object . keys ( dataSources ) . map ( name => ( {
2020 value : name ,
2121 label : name ,
2222} ) ) ;
2323
2424const config = { mapboxAccessToken : ACCESS_TOKENS . MAPBOX , editable : true } ;
2525
26- // eslint-disable-next-line no-unused-vars
2726const traceTypesConfig = {
28- traces : ( _ ) => [
27+ traces : _ => [
2928 {
3029 value : 'scatter' ,
3130 icon : 'scatter' ,
@@ -67,19 +66,16 @@ const traceTypesConfig = {
6766 complex : true ,
6867} ;
6968
70- // eslint-disable-next-line no-unused-vars
7169const chartHelp = {
7270 area : {
7371 helpDoc : 'https://help.plot.ly/make-an-area-graph/' ,
7472 examplePlot : ( ) => {
75- // eslint-disable-next-line no-console
7673 console . log ( 'example bar plot!' ) ;
7774 } ,
7875 } ,
7976 bar : {
8077 helpDoc : 'https://help.plot.ly/stacked-bar-chart/' ,
8178 examplePlot : ( ) => {
82- // eslint-disable-next-line no-console
8379 console . log ( 'example bar plot!' ) ;
8480 } ,
8581 } ,
@@ -126,8 +122,8 @@ class App extends Component {
126122 // curl https://api.github.com/repos/plotly/plotly.js/contents/test/image/mocks \
127123 // | jq '[.[] | .name ]' > mocks.json
128124 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} ) ) ;
131127 }
132128
133129 loadMock ( mockIndex ) {
@@ -139,8 +135,8 @@ class App extends Component {
139135 fetch ( prefix + mockName , {
140136 headers : new Headers ( { Accept : 'application/vnd.github.v3.raw' } ) ,
141137 } )
142- . then ( ( response ) => response . json ( ) )
143- . then ( ( figure ) => {
138+ . then ( response => response . json ( ) )
139+ . then ( figure => {
144140 const { data, layout, frames} = figure ;
145141 this . updateState ( data , layout , frames , mockIndex ) ;
146142 } ) ;
@@ -223,7 +219,7 @@ class App extends Component {
223219 } ) ) }
224220 searchable = { true }
225221 searchPromptText = "Search for a mock"
226- onChange = { ( option ) => this . loadMock ( option . value ) }
222+ onChange = { option => this . loadMock ( option . value ) }
227223 noResultsText = { 'No Results' }
228224 placeholder = { 'Search for a mock' }
229225 />
@@ -238,7 +234,7 @@ class App extends Component {
238234 < AceEditor
239235 mode = "json"
240236 theme = "textmate"
241- onChange = { ( json_string ) => this . setState ( { json_string} ) }
237+ onChange = { json_string => this . setState ( { json_string} ) }
242238 value = { this . state . json_string }
243239 name = "UNIQUE_ID_OF_DIV"
244240 style = { { height : '80vh' } }
0 commit comments