Skip to content

Commit eb04b4c

Browse files
authored
Merge pull request #3988 from plotly/choroplethmapbox-pr
Introducing choroplethmapbox traces
2 parents b69cf4b + 6d7929c commit eb04b4c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+39778
-213
lines changed

.circleci/test.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ case $1 in
5555

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

6161
exit $EXIT_STATE

lib/choroplethmapbox.js

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/**
2+
* Copyright 2012-2019, Plotly, Inc.
3+
* All rights reserved.
4+
*
5+
* This source code is licensed under the MIT license found in the
6+
* LICENSE file in the root directory of this source tree.
7+
*/
8+
9+
'use strict';
10+
11+
module.exports = require('../src/traces/choroplethmapbox');

lib/densitymapbox.js

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/**
2+
* Copyright 2012-2019, Plotly, Inc.
3+
* All rights reserved.
4+
*
5+
* This source code is licensed under the MIT license found in the
6+
* LICENSE file in the root directory of this source tree.
7+
*/
8+
9+
'use strict';
10+
11+
module.exports = require('../src/traces/densitymapbox');

lib/index-mapbox.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@
1111
var Plotly = require('./core');
1212

1313
Plotly.register([
14-
require('./scattermapbox')
14+
require('./scattermapbox'),
15+
require('./choroplethmapbox'),
16+
require('./densitymapbox')
1517
]);
1618

1719
module.exports = Plotly;

lib/index.js

+5
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,14 @@ Plotly.register([
4444

4545
require('./pointcloud'),
4646
require('./heatmapgl'),
47+
4748
require('./parcoords'),
49+
4850
require('./parcats'),
51+
4952
require('./scattermapbox'),
53+
require('./choroplethmapbox'),
54+
require('./densitymapbox'),
5055

5156
require('./sankey'),
5257

package-lock.json

+31
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+2
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@
5858
"dependencies": {
5959
"@plotly/d3-sankey": "0.7.2",
6060
"@plotly/d3-sankey-circular": "0.33.1",
61+
"@turf/area": "^6.0.1",
62+
"@turf/centroid": "^6.0.2",
6163
"alpha-shape": "^1.0.0",
6264
"canvas-fit": "^1.5.0",
6365
"color-normalize": "^1.3.0",

src/components/fx/hover.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -897,7 +897,7 @@ function createHoverText(hoverData, opts, gd) {
897897
if(d.zLabel !== undefined) {
898898
if(d.xLabel !== undefined) text += 'x: ' + d.xLabel + '<br>';
899899
if(d.yLabel !== undefined) text += 'y: ' + d.yLabel + '<br>';
900-
if(d.trace.type !== 'choropleth') {
900+
if(d.trace.type !== 'choropleth' && d.trace.type !== 'choroplethmapbox') {
901901
text += (text ? 'z: ' : '') + d.zLabel;
902902
}
903903
} else if(showCommonLabel && d[hovermode + 'Label'] === t0) {

src/plots/geo/index.js

-8
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,6 @@ function plotGeo(gd) {
3737
var calcData = gd.calcdata;
3838
var geoIds = fullLayout._subplots[GEO];
3939

40-
/**
41-
* If 'plotly-geo-assets.js' is not included,
42-
* initialize object to keep reference to every loaded topojson
43-
*/
44-
if(window.PlotlyGeoAssets === undefined) {
45-
window.PlotlyGeoAssets = {topojson: {}};
46-
}
47-
4840
for(var i = 0; i < geoIds.length; i++) {
4941
var geoId = geoIds[i];
5042
var geoCalcData = getSubplotCalcData(calcData, GEO, geoId);

0 commit comments

Comments
 (0)