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

Introducing choroplethmapbox traces #3988

Merged
merged 26 commits into from
Jul 3, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
43c568f
improve Choropleth.calc
etpinard Jun 18, 2019
91e0319
add dflt to choropleth marker.line.color
etpinard Jun 7, 2019
8fc1dbe
add choroplethmapbox attributes
etpinard Jun 4, 2019
70878b7
add `PlotlyGeoAssets` to window during Plotly.register
etpinard Jun 6, 2019
012a749
fetch GeoJSON URLs found in calcdata before updateData()
etpinard Jun 18, 2019
5d27983
introducing choroplethmapbox trace module
etpinard Jun 18, 2019
f7f3190
sort all choroplethmapbox traces below scattermapbox traces
etpinard Jun 18, 2019
4e88075
add GeoJSON feature 'properties' to eventData
etpinard Jun 18, 2019
a166761
improve mapbox hover after drag
etpinard Jun 18, 2019
9a602ba
first cut choroplethmapbox tests
etpinard Jun 18, 2019
a457722
allow numbers as *locations* items when using custom *geojson*
etpinard Jun 18, 2019
1359307
fixup choroplethmapbox hover content post-#3968
etpinard Jun 18, 2019
4d7e0aa
implement *below* in choroplethmapbox traces
etpinard Jun 26, 2019
cb202a8
add :three: choroplethmapbox mocks
etpinard Jun 26, 2019
e509047
mojtaba-proof a few things
etpinard Jun 27, 2019
7dd04e7
fixup choroplethmapbox "below" test
etpinard Jun 27, 2019
654c08e
do not coerce choropleth* marker.line.color
etpinard Jun 27, 2019
22c2a1e
add missing @gl tag to mapbox tests
etpinard Jun 27, 2019
fe6782d
add doNotFailOnEmptyTestSuite CLI option
etpinard Jun 27, 2019
7e15d81
add densitymapbox attributes
etpinard Jun 28, 2019
91a9bc4
implement densitymapbox
etpinard Jun 28, 2019
4f42d1b
add densitymapbox jasmine tests
etpinard Jun 28, 2019
4299857
add :three: densitymapbox mocks
etpinard Jun 28, 2019
1add90e
remove layers from last to first
etpinard Jun 28, 2019
ca48461
Merge pull request #3993 from plotly/densitymapbox-pr
etpinard Jun 28, 2019
6d7929c
Merge branch 'mapbox-v1' into choroplethmapbox-pr
etpinard Jul 3, 2019
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: 1 addition & 1 deletion .circleci/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ case $1 in

SHARDS=($(node $ROOT/tasks/shard_jasmine_tests.js --limit=5 --tag=gl | circleci tests split))
for s in ${SHARDS[@]}; do
retry npm run test-jasmine -- "$s" --tags=gl --skip-tags=noCI --showSkipped
retry npm run test-jasmine -- "$s" --tags=gl --skip-tags=noCI --showSkipped --doNotFailOnEmptyTestSuite
done

exit $EXIT_STATE
Expand Down
11 changes: 11 additions & 0 deletions lib/choroplethmapbox.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/**
* Copyright 2012-2019, Plotly, Inc.
* All rights reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

'use strict';

module.exports = require('../src/traces/choroplethmapbox');
11 changes: 11 additions & 0 deletions lib/densitymapbox.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/**
* Copyright 2012-2019, Plotly, Inc.
* All rights reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

'use strict';

module.exports = require('../src/traces/densitymapbox');
4 changes: 3 additions & 1 deletion lib/index-mapbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
var Plotly = require('./core');

Plotly.register([
require('./scattermapbox')
require('./scattermapbox'),
require('./choroplethmapbox'),
require('./densitymapbox')
]);

module.exports = Plotly;
5 changes: 5 additions & 0 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,14 @@ Plotly.register([

require('./pointcloud'),
require('./heatmapgl'),

require('./parcoords'),

require('./parcats'),

require('./scattermapbox'),
require('./choroplethmapbox'),
require('./densitymapbox'),

require('./sankey'),

Expand Down
31 changes: 31 additions & 0 deletions package-lock.json

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

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@
"dependencies": {
"@plotly/d3-sankey": "0.7.2",
"@plotly/d3-sankey-circular": "0.33.1",
"@turf/area": "^6.0.1",
"@turf/centroid": "^6.0.2",
"alpha-shape": "^1.0.0",
"canvas-fit": "^1.5.0",
"color-normalize": "^1.3.0",
Expand Down
2 changes: 1 addition & 1 deletion src/components/fx/hover.js
Original file line number Diff line number Diff line change
Expand Up @@ -897,7 +897,7 @@ function createHoverText(hoverData, opts, gd) {
if(d.zLabel !== undefined) {
if(d.xLabel !== undefined) text += 'x: ' + d.xLabel + '<br>';
if(d.yLabel !== undefined) text += 'y: ' + d.yLabel + '<br>';
if(d.trace.type !== 'choropleth') {
if(d.trace.type !== 'choropleth' && d.trace.type !== 'choroplethmapbox') {
text += (text ? 'z: ' : '') + d.zLabel;
}
} else if(showCommonLabel && d[hovermode + 'Label'] === t0) {
Expand Down
8 changes: 0 additions & 8 deletions src/plots/geo/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,6 @@ function plotGeo(gd) {
var calcData = gd.calcdata;
var geoIds = fullLayout._subplots[GEO];

/**
* If 'plotly-geo-assets.js' is not included,
* initialize object to keep reference to every loaded topojson
*/
if(window.PlotlyGeoAssets === undefined) {
window.PlotlyGeoAssets = {topojson: {}};
}

for(var i = 0; i < geoIds.length; i++) {
var geoId = geoIds[i];
var geoCalcData = getSubplotCalcData(calcData, GEO, geoId);
Expand Down
Loading