File tree Expand file tree Collapse file tree 3 files changed +492
-8
lines changed Expand file tree Collapse file tree 3 files changed +492
-8
lines changed Original file line number Diff line number Diff line change @@ -39,18 +39,21 @@ class App extends Component {
3939 }
4040
4141 componentWillMount ( ) {
42- fetch (
43- 'https://api.github.com/repos/plotly/plotly.js/contents/test/image/mocks'
44- )
42+ // curl https://api.github.com/repos/plotly/plotly.js/contents/test/image/mocks \
43+ // | jq '[.[] | .name ]' > mocks.json
44+ fetch ( '/mocks.json' )
4545 . then ( response => response . json ( ) )
4646 . then ( mocks => this . setState ( { mocks} ) ) ;
4747 }
4848
4949 loadMock ( mockIndex ) {
50- const mock = this . state . mocks [ mockIndex ] ;
51- fetch ( mock . url , {
52- headers : new Headers ( { Accept : 'application/vnd.github.v3.raw' } ) ,
53- } )
50+ fetch (
51+ 'https://api.github.com/repos/plotly/plotly.js/contents/test/image/mocks/' +
52+ this . state . mocks [ mockIndex ] ,
53+ {
54+ headers : new Headers ( { Accept : 'application/vnd.github.v3.raw' } ) ,
55+ }
56+ )
5457 . then ( response => response . json ( ) )
5558 . then ( figure => {
5659 this . setState ( {
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ const Nav = props => (
1212 value = { props . currentMockIndex }
1313 name = "mock-dropdown"
1414 options = { props . mocks . map ( ( item , i ) => ( {
15- label : item . name ,
15+ label : item ,
1616 value : i ,
1717 } ) ) }
1818 className = "open-top"
You can’t perform that action at this time.
0 commit comments