Skip to content

Commit

Permalink
Update rbush to 3.0.1 (close #6359)
Browse files Browse the repository at this point in the history
  • Loading branch information
quincylvania committed Nov 8, 2019
1 parent e73ca63 commit 271a4cb
Show file tree
Hide file tree
Showing 10 changed files with 28 additions and 28 deletions.
4 changes: 2 additions & 2 deletions modules/core/tree.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import rbush from 'rbush';
import RBush from 'rbush';

import { coreDifference } from './difference';


export function coreTree(head) {
var rtree = rbush();
var rtree = new RBush();
var bboxes = {};
var tree = {};

Expand Down
4 changes: 2 additions & 2 deletions modules/services/improveOSM.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import rbush from 'rbush';
import RBush from 'rbush';

import { dispatch as d3_dispatch } from 'd3-dispatch';
import { json as d3_json } from 'd3-fetch';
Expand Down Expand Up @@ -137,7 +137,7 @@ export default {
inflightTile: {},
inflightPost: {},
closed: {},
rtree: rbush()
rtree: new RBush()
};
},

Expand Down
4 changes: 2 additions & 2 deletions modules/services/keepRight.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import rbush from 'rbush';
import RBush from 'rbush';

import { dispatch as d3_dispatch } from 'd3-dispatch';
import { json as d3_json } from 'd3-fetch';
Expand Down Expand Up @@ -281,7 +281,7 @@ export default {
inflightTile: {},
inflightPost: {},
closed: {},
rtree: rbush()
rtree: new RBush()
};
},

Expand Down
10 changes: 5 additions & 5 deletions modules/services/mapillary.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { dispatch as d3_dispatch } from 'd3-dispatch';
import { select as d3_select, selectAll as d3_selectAll } from 'd3-selection';

import rbush from 'rbush';
import RBush from 'rbush';

import { geoExtent, geoScaleToZoom } from '../geo';
import { svgDefs } from '../svg/defs';
Expand Down Expand Up @@ -292,11 +292,11 @@ export default {
}

_mlyCache = {
images: { inflight: {}, loaded: {}, nextPage: {}, nextURL: {}, rtree: rbush(), forImageKey: {} },
images: { inflight: {}, loaded: {}, nextPage: {}, nextURL: {}, rtree: new RBush(), forImageKey: {} },
image_detections: { inflight: {}, loaded: {}, nextPage: {}, nextURL: {}, forImageKey: {} },
map_features: { inflight: {}, loaded: {}, nextPage: {}, nextURL: {}, rtree: rbush() },
points: { inflight: {}, loaded: {}, nextPage: {}, nextURL: {}, rtree: rbush() },
sequences: { inflight: {}, loaded: {}, nextPage: {}, nextURL: {}, rtree: rbush(), forImageKey: {}, lineString: {} }
map_features: { inflight: {}, loaded: {}, nextPage: {}, nextURL: {}, rtree: new RBush() },
points: { inflight: {}, loaded: {}, nextPage: {}, nextURL: {}, rtree: new RBush() },
sequences: { inflight: {}, loaded: {}, nextPage: {}, nextURL: {}, rtree: new RBush(), forImageKey: {}, lineString: {} }
};

_mlySelectedImage = null;
Expand Down
6 changes: 3 additions & 3 deletions modules/services/nominatim.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { json as d3_json } from 'd3-fetch';

import rbush from 'rbush';
import RBush from 'rbush';
import { geoExtent } from '../geo';
import { utilQsString } from '../util';

Expand All @@ -14,13 +14,13 @@ export default {

init: function() {
_inflight = {};
_nominatimCache = rbush();
_nominatimCache = new RBush();
},

reset: function() {
Object.values(_inflight).forEach(function(controller) { controller.abort(); });
_inflight = {};
_nominatimCache = rbush();
_nominatimCache = new RBush();
},


Expand Down
4 changes: 2 additions & 2 deletions modules/services/openstreetcam.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { json as d3_json } from 'd3-fetch';
import { event as d3_event, select as d3_select, selectAll as d3_selectAll } from 'd3-selection';
import { zoom as d3_zoom, zoomIdentity as d3_zoomIdentity } from 'd3-zoom';

import rbush from 'rbush';
import RBush from 'rbush';

import { geoExtent, geoScaleToZoom } from '../geo';
import { utilDetect } from '../util/detect';
Expand Down Expand Up @@ -194,7 +194,7 @@ export default {
}

_oscCache = {
images: { inflight: {}, loaded: {}, nextPage: {}, rtree: rbush() },
images: { inflight: {}, loaded: {}, nextPage: {}, rtree: new RBush() },
sequences: {}
};

Expand Down
12 changes: 6 additions & 6 deletions modules/services/osm.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { dispatch as d3_dispatch } from 'd3-dispatch';
import { xml as d3_xml } from 'd3-fetch';

import osmAuth from 'osm-auth';
import rbush from 'rbush';
import RBush from 'rbush';

import { JXON } from '../util/jxon';
import { geoExtent, geoRawMercator, geoVecAdd, geoZoomToScale } from '../geo';
Expand All @@ -24,8 +24,8 @@ var oauth = osmAuth({
});

var _blacklists = ['.*\.google(apis)?\..*/(vt|kh)[\?/].*([xyz]=.*){3}.*'];
var _tileCache = { toLoad: {}, loaded: {}, inflight: {}, seen: {}, rtree: rbush() };
var _noteCache = { toLoad: {}, loaded: {}, inflight: {}, inflightPost: {}, note: {}, closed: {}, rtree: rbush() };
var _tileCache = { toLoad: {}, loaded: {}, inflight: {}, seen: {}, rtree: new RBush() };
var _noteCache = { toLoad: {}, loaded: {}, inflight: {}, inflightPost: {}, note: {}, closed: {}, rtree: new RBush() };
var _userCache = { toLoad: {}, user: {} };
var _changeset = {};

Expand Down Expand Up @@ -380,8 +380,8 @@ export default {
Object.values(_noteCache.inflightPost).forEach(abortRequest);
if (_changeset.inflight) abortRequest(_changeset.inflight);

_tileCache = { toLoad: {}, loaded: {}, inflight: {}, seen: {}, rtree: rbush() };
_noteCache = { toLoad: {}, loaded: {}, inflight: {}, inflightPost: {}, note: {}, closed: {}, rtree: rbush() };
_tileCache = { toLoad: {}, loaded: {}, inflight: {}, seen: {}, rtree: new RBush() };
_noteCache = { toLoad: {}, loaded: {}, inflight: {}, inflightPost: {}, note: {}, closed: {}, rtree: new RBush() };
_userCache = { toLoad: {}, user: {} };
_changeset = {};

Expand Down Expand Up @@ -1066,7 +1066,7 @@ export default {
var target = {};
Object.keys(source).forEach(function(k) {
if (k === 'rtree') {
target.rtree = rbush().fromJSON(source.rtree.toJSON()); // clone rbush
target.rtree = new RBush().fromJSON(source.rtree.toJSON()); // clone rbush
} else if (k === 'note') {
target.note = {};
Object.keys(source.note).forEach(function(id) {
Expand Down
4 changes: 2 additions & 2 deletions modules/services/streetside.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
selectAll as d3_selectAll
} from 'd3-selection';

import rbush from 'rbush';
import RBush from 'rbush';
import { t } from '../util/locale';
import { jsonpRequest } from '../util/jsonp_request';

Expand Down Expand Up @@ -449,7 +449,7 @@ export default {
}

_ssCache = {
bubbles: { inflight: {}, loaded: {}, nextPage: {}, rtree: rbush(), points: {}, leaders: [] },
bubbles: { inflight: {}, loaded: {}, nextPage: {}, rtree: new RBush(), points: {}, leaders: [] },
sequences: {}
};
},
Expand Down
6 changes: 3 additions & 3 deletions modules/svg/labels.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import _throttle from 'lodash-es/throttle';

import { geoPath as d3_geoPath } from 'd3-geo';
import rbush from 'rbush';
import RBush from 'rbush';
import { textDirection } from '../util/locale';

import {
Expand All @@ -19,8 +19,8 @@ export function svgLabels(projection, context) {
var path = d3_geoPath(projection);
var detected = utilDetect();
var baselineHack = (detected.ie || detected.browser.toLowerCase() === 'edge');
var _rdrawn = rbush();
var _rskipped = rbush();
var _rdrawn = new RBush();
var _rskipped = new RBush();
var _textWidthCache = {};
var _entitybboxes = {};

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"osm-auth": "1.0.2",
"pannellum": "2.4.1",
"q": "1.5.1",
"rbush": "2.0.2",
"rbush": "3.0.1",
"string.fromcodepoint": "0.2.1",
"which-polygon": "2.2.0",
"wmf-sitematrix": "0.1.4"
Expand Down

0 comments on commit 271a4cb

Please sign in to comment.