1- import React , { Component } from 'react' ;
1+ import { 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,15 +16,16 @@ 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
2627const traceTypesConfig = {
27- traces : _ => [
28+ traces : ( _ ) => [
2829 {
2930 value : 'scatter' ,
3031 icon : 'scatter' ,
@@ -66,16 +67,19 @@ const traceTypesConfig = {
6667 complex : true ,
6768} ;
6869
70+ // eslint-disable-next-line no-unused-vars
6971const chartHelp = {
7072 area : {
7173 helpDoc : 'https://help.plot.ly/make-an-area-graph/' ,
7274 examplePlot : ( ) => {
75+ // eslint-disable-next-line no-console
7376 console . log ( 'example bar plot!' ) ;
7477 } ,
7578 } ,
7679 bar : {
7780 helpDoc : 'https://help.plot.ly/stacked-bar-chart/' ,
7881 examplePlot : ( ) => {
82+ // eslint-disable-next-line no-console
7983 console . log ( 'example bar plot!' ) ;
8084 } ,
8185 } ,
@@ -118,12 +122,12 @@ class App extends Component {
118122 this . updateState = this . updateState . bind ( this ) ;
119123 }
120124
121- componentWillMount ( ) {
125+ UNSAFE_componentWillMount ( ) {
122126 // curl https://api.github.com/repos/plotly/plotly.js/contents/test/image/mocks \
123127 // | jq '[.[] | .name ]' > mocks.json
124128 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} ) ) ;
127131 }
128132
129133 loadMock ( mockIndex ) {
@@ -135,8 +139,8 @@ class App extends Component {
135139 fetch ( prefix + mockName , {
136140 headers : new Headers ( { Accept : 'application/vnd.github.v3.raw' } ) ,
137141 } )
138- . then ( response => response . json ( ) )
139- . then ( figure => {
142+ . then ( ( response ) => response . json ( ) )
143+ . then ( ( figure ) => {
140144 const { data, layout, frames} = figure ;
141145 this . updateState ( data , layout , frames , mockIndex ) ;
142146 } ) ;
@@ -219,7 +223,7 @@ class App extends Component {
219223 } ) ) }
220224 searchable = { true }
221225 searchPromptText = "Search for a mock"
222- onChange = { option => this . loadMock ( option . value ) }
226+ onChange = { ( option ) => this . loadMock ( option . value ) }
223227 noResultsText = { 'No Results' }
224228 placeholder = { 'Search for a mock' }
225229 />
@@ -234,7 +238,7 @@ class App extends Component {
234238 < AceEditor
235239 mode = "json"
236240 theme = "textmate"
237- onChange = { json_string => this . setState ( { json_string} ) }
241+ onChange = { ( json_string ) => this . setState ( { json_string} ) }
238242 value = { this . state . json_string }
239243 name = "UNIQUE_ID_OF_DIV"
240244 style = { { height : '80vh' } }
0 commit comments