Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mapbox #958

Merged
merged 85 commits into from
Jan 15, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
85 commits
Select commit Hold shift + click to select a range
fb38a83
Add mapbox in package
corradio Dec 19, 2017
995fac3
Basic mapbox
corradio Dec 19, 2017
787b64c
Fix id, center, zoom
corradio Dec 19, 2017
6d9f7fa
Mouseover and tentatively connect to canvas and arrows
corradio Dec 20, 2017
d01f5a9
Disable zoom handlers
corradio Dec 22, 2017
d3eb281
Merge
corradio Dec 22, 2017
40b8758
Basic wind drawing
corradio Dec 22, 2017
301ec29
Basic wind/arrow panzoom with arrow re-render at each dragend
corradio Dec 23, 2017
befc1c1
Fix windy bug
corradio Dec 23, 2017
659e699
Add comments
corradio Dec 23, 2017
bd2070e
Fix iPad view bug
corradio Dec 23, 2017
01f307f
Fix windy frame duration
corradio Dec 23, 2017
bc81d9f
Fix wind ipad
corradio Dec 23, 2017
c62757d
Fix solar
corradio Dec 23, 2017
1a7fa3c
Fix windy frame duration
corradio Dec 23, 2017
e68b212
Cleanup and remove d3 from maplayer
corradio Dec 23, 2017
1266fc3
Minor fixes
corradio Dec 23, 2017
71634c5
Cleanup DOM
corradio Dec 23, 2017
95f033d
Faster rendering by putting wind/solar canvas with display none
corradio Dec 23, 2017
18b8434
Disable touchrotate
corradio Dec 23, 2017
582a202
CSS animations arrows
corradio Dec 23, 2017
73c30ce
Fix iOS mobile view
corradio Dec 24, 2017
225d431
Add small loading indicator
corradio Dec 24, 2017
fb0e4fe
Clean up style, works on Safari mobile (ipad/iphone)
corradio Dec 24, 2017
7382efd
Fix overflow of arrow layer
corradio Dec 24, 2017
136f469
Merge branch 'master' into olc/mapbox
corradio Dec 27, 2017
2840563
Add arrows
corradio Dec 27, 2017
7d49370
Use ES constructor
corradio Dec 27, 2017
4d0cb11
Cleanup
corradio Dec 27, 2017
dee8f08
Add seaclick
corradio Dec 27, 2017
31640cb
Set arrow center
corradio Dec 27, 2017
d8c2a6c
Fix proper projections and dragging
corradio Dec 27, 2017
11bfc95
Fixes
corradio Dec 29, 2017
e7141f9
Fix webpack production
corradio Dec 29, 2017
b2cff35
Merge remote-tracking branch 'origin/master' into olc/mapbox
corradio Dec 29, 2017
90ae1e1
Clean up
corradio Dec 29, 2017
e83a77b
Clean up
corradio Dec 29, 2017
2140d70
Disable animations on drag
corradio Dec 29, 2017
ac059f2
Fix multiple zoom start calls
corradio Dec 29, 2017
f8acf22
Fix d3 event
corradio Dec 29, 2017
5762a69
Rewrite wind layer
corradio Dec 29, 2017
bbe752e
Rewrite solar with new API
corradio Dec 29, 2017
7e6f2e7
Fix d3 imports
corradio Dec 29, 2017
984824d
Proper mouseover
corradio Dec 29, 2017
859ec38
Fix tooltip position
corradio Dec 29, 2017
e277f3f
Set proper debounce on map drag and hide arrows when not needed
corradio Dec 29, 2017
8577a43
Optimise rendering, disable touch rotation
corradio Dec 30, 2017
5318ea4
Fix race condition and update pinch zoom
corradio Dec 30, 2017
e566e7a
Merge
corradio Dec 31, 2017
cee1eac
Remove geostitch process
corradio Jan 2, 2018
48e099a
Fix loading indicator
corradio Jan 2, 2018
54d9b4f
Arrows only show up when map has loaded
corradio Jan 2, 2018
7cb2d43
Better loading
corradio Jan 2, 2018
92302b6
Merge
corradio Jan 3, 2018
536b268
Revert arrows to GIF as wind performances are better
corradio Jan 3, 2018
84363fd
Resize map
corradio Jan 3, 2018
029fd90
Remove orange border on tap
corradio Jan 3, 2018
703b964
Faster mouseover
corradio Jan 4, 2018
3a209dd
Fix mouseleave/enter
corradio Jan 4, 2018
086034d
Fix tooltip opacity bug
corradio Jan 4, 2018
1cc0c22
Merge branch 'master' into olc/mapbox
corradio Jan 4, 2018
ae95247
Merge branch 'master' into olc/mapbox
corradio Jan 5, 2018
47962fa
Fix header for Safari
corradio Jan 5, 2018
7fcf1e9
Disable double click zoom
corradio Jan 5, 2018
1a8d2a0
Fix arrow size
corradio Jan 5, 2018
10ab719
CSS hover on exchanges (instead of d3)
corradio Jan 5, 2018
ab06f31
Cleanup and resize arrows using GPU (higher quality)
corradio Jan 5, 2018
1f63dce
Typo
corradio Jan 5, 2018
d73b3e9
Restore meta tags
corradio Jan 5, 2018
c809922
Fix arrow hover zone
corradio Jan 5, 2018
9405488
Fix color scale changes
corradio Jan 5, 2018
41fa001
Remove transitions in mapboxgl as they are not supported yet
corradio Jan 5, 2018
b847ace
Fix arrow sizes
corradio Jan 5, 2018
943d426
Try with crisp-edges
corradio Jan 5, 2018
a8e4035
Fix stops
corradio Jan 5, 2018
dc5158e
Fix low flow
corradio Jan 7, 2018
3fa12ef
Merge
corradio Jan 7, 2018
2cc6eae
Fix height
corradio Jan 10, 2018
a7852c4
Add frame-src
corradio Jan 10, 2018
f90dc7f
fix webpack prod
corradio Jan 10, 2018
7ab2b31
Merge
corradio Jan 10, 2018
98ba9f7
Fix touch
corradio Jan 10, 2018
13b7933
fix
corradio Jan 14, 2018
e7f7a3a
Map removed on mobile when webgl not available
corradio Jan 15, 2018
b05aac3
Merge
corradio Jan 15, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
*.json
*secrets*
*.env
*.mp4
*.mkv

mobileapp

Expand Down
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ services:
dockerfile: web/Dockerfile
cache_from:
- eu.gcr.io/tmrow-152415/electricitymap_web:production
- eu.gcr.io/tmrow-152415/electricitymap_web:staging
command: npm run server-dev
depends_on: ['mockserver']
environment:
Expand Down
4 changes: 2 additions & 2 deletions mobileapp/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,12 @@
<host name="www.electricitymap.org" scheme="https" />
<host name="www.electricitymap.org" scheme="http" />
</universal-links>
<engine name="android" spec="^6.3.0" />
<engine name="ios" spec="^4.5.0" />
<plugin name="cordova-plugin-whitelist" spec="1" />
<plugin name="cordova-universal-links-plugin" spec="^1.2.1" />
<plugin name="cordova-plugin-globalization" spec="~1.0.6" />
<plugin name="cordova-plugin-splashscreen" spec="^4.0.3" />
<plugin name="cordova-plugin-statusbar" spec="^2.2.3" />
<plugin name="cordova-plugin-code-push" spec="^1.10.1" />
<engine name="android" spec="^6.3.0" />
<engine name="ios" spec="^4.5.0" />
</widget>
2 changes: 1 addition & 1 deletion mockserver/public/v3/state

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions web/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ FROM node:8.5.0
WORKDIR /home/web

ADD web/package.json /home/web/package.json
ADD web/package-lock.json /home/web/package-lock.json
RUN npm install

ADD web /home/web
Expand Down
16 changes: 13 additions & 3 deletions web/app/components/areagraph.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
'use strict'

var d3 = require('d3');
const d3 = Object.assign(
{},
require('d3-array'),
require('d3-axis'),
require('d3-collection'),
require('d3-selection'),
require('d3-scale'),
require('d3-shape'),
);
// see https://stackoverflow.com/questions/36887428/d3-event-is-null-in-a-reactjs-d3js-component
import {event as currentEvent} from 'd3-selection';
var moment = require('moment');

function AreaGraph(selector, modeColor, modeOrder) {
Expand Down Expand Up @@ -199,7 +209,7 @@ AreaGraph.prototype.render = function() {

var datetimes = this._datetimes;
function detectPosition(d3Event) {
if (!d3Event) { d3Event = d3.event; }
if (!d3Event) { d3Event = currentEvent; }
if (!datetimes.length) return;
var dx = d3Event.pageX ? (d3Event.pageX - this.parentNode.getBoundingClientRect().left) :
(d3.touches(this)[0][0]);
Expand Down Expand Up @@ -278,7 +288,7 @@ AreaGraph.prototype.render = function() {
.on('mouseout', function () {
if (!data.length) { return; }
var innerThis = this;
var d3Event = d3.event;
var d3Event = currentEvent;
mouseOutTimeout = setTimeout(function() {
var i = detectPosition.call(innerThis, d3Event);
that.selectedIndex(i);
Expand Down
10 changes: 9 additions & 1 deletion web/app/components/countrytable.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
var d3 = require('d3');
const d3 = Object.assign(
{},
require('d3-array'),
require('d3-axis'),
require('d3-collection'),
require('d3-format'),
require('d3-selection'),
require('d3-scale'),
);
var getSymbolFromCurrency = require('currency-symbol-map').getSymbolFromCurrency;
var moment = require('moment');

Expand Down
6 changes: 4 additions & 2 deletions web/app/components/horizontalcolorbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,10 @@ function HorizontalColorbar(selector, d3ColorScale, d3TickFormat, d3TickValues)
}

HorizontalColorbar.prototype.render = function() {
this.width = this.root.node().getBoundingClientRect().width;
this.height = this.root.node().getBoundingClientRect().height;
const rootNode = this.root.node();
if (!rootNode) { return; }
this.width = rootNode.getBoundingClientRect().width;
this.height = rootNode.getBoundingClientRect().height;
if (!this.width || !this.height) return this;

this.colorbarWidth = this.width - 2 * this.PADDING_X;
Expand Down
Loading