Skip to content
This repository has been archived by the owner on Oct 28, 2022. It is now read-only.

Commit

Permalink
Add mapbox token to env variables
Browse files Browse the repository at this point in the history
smartcitiesdata/discovery-ui#184

co-authored-by: Cameron Marsh <[email protected]>
  • Loading branch information
ManApart and cameronmarsh committed Sep 5, 2019
1 parent 0bc205f commit d22023b
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 9 deletions.
1 change: 1 addition & 0 deletions config/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ window.GTM_ID = ''
window.BASE_URL = 'example.com'
window.STREETS_TILE_LAYER_URL = 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png'
window.LOGO_URL = 'https://placekitten.com/530/530'
window.MAPBOX_ACCESS_TOKEN = ''
18 changes: 9 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ window.API_HOST = '${API_HOST}'
window.GTM_ID = '${GTM_ID}'
window.BASE_URL = '${BASE_URL}'
window.STREETS_TILE_LAYER_URL = '${STREETS_TILE_LAYER_URL}'
window.MAPBOX_ACCESS_TOKEN = '${MAPBOX_ACCESS_TOKEN}'
window.LOGO_URL = '${LOGO_URL}'
EOL

Expand Down
3 changes: 3 additions & 0 deletions src/components/visualizations/chart/chart-visualization.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@ const getDataSourceOptions = dataSources => {
export default class ChartVisualization extends Component {
constructor(props) {
super(props)

this.state = { data: [], layout: {}, frames: [] }
}

render() {

return (
<chart-visualization>
{
Expand All @@ -36,6 +38,7 @@ export default class ChartVisualization extends Component {
onUpdate={(data, layout, frames) => this.setState({ data, layout, frames })}
useResizeHandler
advancedTraceTypeSelector
config={{ mapboxAccessToken: window.MAPBOX_ACCESS_TOKEN }}
>
<DefaultEditor logoSrc={window.LOGO_URL} />
</PlotlyEditor>
Expand Down

0 comments on commit d22023b

Please sign in to comment.