Skip to content

Commit 0e0fada

Browse files
authored
Merge pull request #35 from teralytics/develop
Making it public
2 parents 14cab03 + 9eba124 commit 0e0fada

10 files changed

Lines changed: 2829 additions & 2799 deletions

File tree

.storybook/webpack.config.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,17 @@
1515
*
1616
*/
1717

18+
const Dotenv = require('dotenv-webpack');
19+
1820
module.exports = {
1921
resolve: {
2022
extensions: ['.ts', '.tsx', '.js', '.jsx', '.json'],
2123
},
2224

25+
plugins: [
26+
new Dotenv()
27+
],
28+
2329
module: {
2430
rules: [
2531
{

README.md

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,18 @@
22

33
Flow map drawing layer for [deck.gl](http://uber.github.io/deck.gl).
44

5-
<img src="./doc/ch.png" width="500" />
5+
Check out [live examples](https://teralytics.github.io/flowmap.gl/index.html).
6+
7+
<img src="./doc/swiss-cantons-migration.png" width="500" />
68

79
## Usage
810

911
Here's a usage example:
1012

13+
import DeckGL from 'deck.gl';
14+
import MapGL from 'react-map-gl';
15+
import FlowMapLayer from 'flowmap.gl';
16+
1117
const colors = {
1218
flows: {
1319
max: '#137CBD',
@@ -81,8 +87,15 @@ and a more complex [interactive example](./examples/InteractiveExample.tsx).
8187

8288
## Developing
8389

90+
Create an `.env` file in the project root
91+
containing one line:
92+
93+
MapboxAccessToken=<your-mapbox-access-token>
94+
95+
Then, run:
96+
8497
npm install
85-
MapboxAccessToken=... npm start
98+
npm start
8699
open http://localhost:6006 to open storybook
87100

88101
## Acknowledgements

doc/ch.png

-725 KB
Binary file not shown.

doc/swiss-cantons-migration.png

876 KB
Loading

examples/InteractiveExample.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,13 @@ export default class InteractiveExample extends React.Component<Props, State> {
161161
onViewportChange={this.handleChangeViewport}
162162
mapboxApiAccessToken={mapboxAccessToken}
163163
>
164-
<DeckGL {...viewport} width={width} height={height} layers={[flowMapLayer]} />
164+
<DeckGL
165+
{...viewport}
166+
width={width}
167+
height={height}
168+
layers={[flowMapLayer]}
169+
style={{ mixBlendMode: 'darken' }}
170+
/>
165171
<LegendBox top={10} left={10}>
166172
{diff && <DiffColorsLegend colors={flowMapLayer.props.colors as DiffColors} />}
167173
{diff && <hr />}

examples/StaticExample.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ const StaticExample: React.SFC<Props> = ({ width, height, locations, flows, view
6969

7070
return (
7171
<MapGL {...viewport} width={width} height={height} mapboxApiAccessToken={mapboxAccessToken}>
72-
<DeckGL {...viewport} width={width} height={height} layers={[flowMapLayer]} />
72+
<DeckGL {...viewport} width={width} height={height} style={{ mixBlendMode: 'darken' }} layers={[flowMapLayer]} />
7373
</MapGL>
7474
);
7575
};

examples/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import InteractiveExample, { Flow, LocationProperties } from './InteractiveExamp
2222
import StaticExample from './StaticExample';
2323
import { getViewportForFeature } from './utils';
2424

25-
const mapboxAccessToken = process.env.STORYBOOK_MapboxAccessToken || '';
25+
const mapboxAccessToken = process.env.MapboxAccessToken || '';
2626

2727
// tslint:disable:no-var-requires
2828
const flows16: Flow[] = require('./data/flows-2016.json');

0 commit comments

Comments
 (0)