Skip to content

Commit

Permalink
Merge pull request #3988 from plotly/choroplethmapbox-pr
Browse files Browse the repository at this point in the history
Introducing choroplethmapbox traces
  • Loading branch information
etpinard authored Jul 3, 2019
2 parents b69cf4b + 6d7929c commit eb04b4c
Show file tree
Hide file tree
Showing 65 changed files with 39,778 additions and 213 deletions.
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

0 comments on commit eb04b4c

Please sign in to comment.