geojs 1.8.7 → 1.8.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -4,6 +4,12 @@
4
4
 
5
5
  ### Improvements
6
6
 
7
+ - Reduce polygon and position function calls ([#1208](../../pull/1208))
8
+
9
+ ## Version 1.8.7
10
+
11
+ ### Improvements
12
+
7
13
  - Add some code paths to reduce transform calls ([#1207](../../pull/1207))
8
14
 
9
15
  ## Version 1.8.6
package/geo.js CHANGED
@@ -12042,9 +12042,7 @@ var graphFeature = function graphFeature(arg) {
12042
12042
 
12043
12043
  }, arg.style === undefined ? {} : arg.style);
12044
12044
  m_this.style(defaultStyle);
12045
- m_this.nodes(function (d) {
12046
- return d;
12047
- });
12045
+ m_this.nodes(util.identityFunction);
12048
12046
  return m_this;
12049
12047
  };
12050
12048
  /**
@@ -12466,6 +12464,8 @@ var inherit = __webpack_require__(5699);
12466
12464
  var feature = __webpack_require__(6837);
12467
12465
 
12468
12466
  var transform = __webpack_require__(6853);
12467
+
12468
+ var util = __webpack_require__(4634);
12469
12469
  /**
12470
12470
  * Heatmap feature specification.
12471
12471
  *
@@ -12544,10 +12544,7 @@ var heatmapFeature = function heatmapFeature(arg) {
12544
12544
  m_gcsPosition,
12545
12545
  s_init = this._init;
12546
12546
  this.featureType = 'heatmap';
12547
-
12548
- m_position = arg.position || function (d) {
12549
- return d;
12550
- };
12547
+ m_position = arg.position || util.identityFunction;
12551
12548
 
12552
12549
  m_intensity = arg.intensity || function (d) {
12553
12550
  return 1;
@@ -15668,12 +15665,8 @@ var lineFeature = function lineFeature(arg) {
15668
15665
  });
15669
15666
  /* Set the reduced lines as the data and use simple accessors. */
15670
15667
 
15671
- m_this.style('position', function (d) {
15672
- return d;
15673
- });
15674
- m_this.style('line', function (d) {
15675
- return d;
15676
- });
15668
+ m_this.style('position', util.identityFunction);
15669
+ m_this.style('line', util.identityFunction);
15677
15670
  m_this.data(data);
15678
15671
  return m_this;
15679
15672
  };
@@ -15701,9 +15694,7 @@ var lineFeature = function lineFeature(arg) {
15701
15694
  // Values of 2 and above appear smoothest.
15702
15695
  antialiasing: 2.0,
15703
15696
  closed: false,
15704
- line: function line(d) {
15705
- return d;
15706
- },
15697
+ line: util.identityFunction,
15707
15698
  position: function position(d) {
15708
15699
  return Array.isArray(d) ? {
15709
15700
  x: d[0],
@@ -23324,9 +23315,7 @@ var pixelmapFeature = function pixelmapFeature(arg) {
23324
23315
  a: 1
23325
23316
  };
23326
23317
  },
23327
- position: function position(d) {
23328
- return d;
23329
- }
23318
+ position: util.identityFunction
23330
23319
  }, arg.style === undefined ? {} : arg.style);
23331
23320
 
23332
23321
  if (arg.position !== undefined) {
@@ -25022,12 +25011,8 @@ var polygonFeature = function polygonFeature(arg) {
25022
25011
  });
25023
25012
  /* Set the reduced polgons as the data and use simple accessors. */
25024
25013
 
25025
- m_this.style('position', function (d) {
25026
- return d;
25027
- });
25028
- m_this.style('polygon', function (d) {
25029
- return d;
25030
- });
25014
+ m_this.style('position', util.identityFunction);
25015
+ m_this.style('polygon', util.identityFunction);
25031
25016
  m_this.data(data);
25032
25017
  return m_this;
25033
25018
  };
@@ -25123,9 +25108,7 @@ var polygonFeature = function polygonFeature(arg) {
25123
25108
  b: 1.0
25124
25109
  },
25125
25110
  strokeOpacity: 1.0,
25126
- polygon: function polygon(d) {
25127
- return d;
25128
- },
25111
+ polygon: util.identityFunction,
25129
25112
  position: function position(d) {
25130
25113
  return Array.isArray(d) ? {
25131
25114
  x: d[0],
@@ -26014,9 +25997,7 @@ var quadFeature = function quadFeature(arg) {
26014
25997
  video: function video(d) {
26015
25998
  return d.video;
26016
25999
  },
26017
- position: function position(d) {
26018
- return d;
26019
- }
26000
+ position: util.identityFunction
26020
26001
  }, arg.style === undefined ? {} : arg.style);
26021
26002
 
26022
26003
  if (arg.position !== undefined) {
@@ -27053,7 +27034,7 @@ module.exports = sceneObject;
27053
27034
  * @constant
27054
27035
  * @type {string}
27055
27036
  */
27056
- module.exports = "493ff30a20fb5c5febb2c3521372398121e0cdee";
27037
+ module.exports = "e4988e06092d4bee858b11f2d0109a6bfe77dfbb";
27057
27038
 
27058
27039
  /***/ }),
27059
27040
 
@@ -32927,12 +32908,8 @@ var trackFeature = function trackFeature(arg) {
32927
32908
  arg = arg || {};
32928
32909
  s_init.call(m_this, arg);
32929
32910
  var style = $.extend(true, {}, {
32930
- track: function track(d) {
32931
- return d;
32932
- },
32933
- position: function position(d) {
32934
- return d;
32935
- },
32911
+ track: util.identityFunction,
32912
+ position: util.identityFunction,
32936
32913
  time: function time(d, i) {
32937
32914
  return d.t !== undefined ? d.t : i;
32938
32915
  }
@@ -33007,7 +32984,7 @@ var maxTransformCacheSize = 10;
33007
32984
  /* A RegExp to detect if two transforms only different by the middle axis's
33008
32985
  * direction. */
33009
32986
 
33010
- var axisPattern = /^(.* |)\\+axis=e(n|s)u(| .*)$/;
32987
+ var axisPattern = /^(.* |)\+axis=e(n|s)u(| .*)$/;
33011
32988
  var affinePattern = /(^|\s)\+(s[1-3][1-3]|[xyz]off)=\S/;
33012
32989
  /**
33013
32990
  * This purpose of this class is to provide a generic interface for computing
@@ -38579,6 +38556,17 @@ var util = {
38579
38556
 
38580
38557
  return value !== null && value !== undefined && (type === 'object' || type === 'function');
38581
38558
  },
38559
+
38560
+ /**
38561
+ * Return the first value passed to the function. Using this function for
38562
+ * identity calls can allow some code to bypass making such a call entirely.
38563
+ *
38564
+ * @param {*} d Any value.
38565
+ * @returns {*} The passed value.
38566
+ */
38567
+ identityFunction: function identityFunction(d) {
38568
+ return d;
38569
+ },
38582
38570
  ///////////////////////////////////////////////////////////////////////////
38583
38571
 
38584
38572
  /*
@@ -39408,6 +39396,8 @@ module.exports = {
39408
39396
  var inherit = __webpack_require__(5699);
39409
39397
 
39410
39398
  var feature = __webpack_require__(6837);
39399
+
39400
+ var util = __webpack_require__(4634);
39411
39401
  /**
39412
39402
  * Object specification for a graph feature.
39413
39403
  *
@@ -39534,9 +39524,7 @@ var vectorFeature = function vectorFeature(arg) {
39534
39524
  y: 0,
39535
39525
  z: 0
39536
39526
  },
39537
- delta: function delta(d) {
39538
- return d;
39539
- },
39527
+ delta: util.identityFunction,
39540
39528
  scale: null // size scaling factor (null -> renderer decides)
39541
39529
 
39542
39530
  }, arg.style === undefined ? {} : arg.style);
@@ -39568,7 +39556,7 @@ module.exports = vectorFeature;
39568
39556
  * @constant
39569
39557
  * @type {string}
39570
39558
  */
39571
- module.exports = "1.8.7";
39559
+ module.exports = "1.8.8";
39572
39560
 
39573
39561
  /***/ }),
39574
39562
 
@@ -40865,6 +40853,7 @@ var webgl_lineFeature = function webgl_lineFeature(arg) {
40865
40853
  if (!onlyStyle) {
40866
40854
  var position = [],
40867
40855
  posFunc = m_this.position();
40856
+ posFunc = posFunc === util.identityFunction ? null : posFunc;
40868
40857
  lineItemList = new Array(data.length);
40869
40858
  closed = new Array(data.length);
40870
40859
 
@@ -40880,7 +40869,7 @@ var webgl_lineFeature = function webgl_lineFeature(arg) {
40880
40869
  numSegments += lineItem.length - 1;
40881
40870
 
40882
40871
  for (j = 0; j < lineItem.length; j += 1) {
40883
- pos = posFunc(lineItem[j], j, d, i);
40872
+ pos = posFunc ? posFunc(lineItem[j], j, d, i) : lineItem[j];
40884
40873
  position.push(pos.x);
40885
40874
  position.push(simpleInverse ? -pos.y : pos.y);
40886
40875
  position.push(pos.z || 0.0);
@@ -43459,10 +43448,12 @@ var webgl_polygonFeature = function webgl_polygonFeature(arg) {
43459
43448
 
43460
43449
  if (!onlyStyle) {
43461
43450
  posFunc = m_this.style.get('position');
43451
+ posFunc = posFunc === util.identityFunction ? null : posFunc;
43462
43452
  polyFunc = m_this.style.get('polygon');
43453
+ polyFunc = polyFunc === util.identityFunction ? null : polyFunc;
43463
43454
  m_this.data().forEach(function (item, itemIndex) {
43464
43455
  var polygon, outer, geometry, c;
43465
- polygon = polyFunc(item, itemIndex);
43456
+ polygon = polyFunc ? polyFunc(item, itemIndex) : item;
43466
43457
 
43467
43458
  if (!polygon) {
43468
43459
  return;
@@ -43481,7 +43472,7 @@ var webgl_polygonFeature = function webgl_polygonFeature(arg) {
43481
43472
  geometry = new Array(outer.length * 3);
43482
43473
 
43483
43474
  for (i = d3 = 0; i < outer.length; i += 1, d3 += 3) {
43484
- c = posFunc(outer[i], i, item, itemIndex);
43475
+ c = posFunc ? posFunc(outer[i], i, item, itemIndex) : outer[i];
43485
43476
  geometry[d3] = c.x;
43486
43477
  geometry[d3 + 1] = simpleInverse ? -c.y : c.y; // ignore the z values until we support them
43487
43478
 
@@ -43505,7 +43496,7 @@ var webgl_polygonFeature = function webgl_polygonFeature(arg) {
43505
43496
  geometry.holes.push(d3 / 3);
43506
43497
 
43507
43498
  for (i = 0; i < hole.length; i += 1, d3 += 3) {
43508
- c = posFunc(hole[i], i, item, itemIndex);
43499
+ c = posFunc ? posFunc(hole[i], i, item, itemIndex) : hole[i];
43509
43500
  geometry.vertices[d3] = c.x;
43510
43501
  geometry.vertices[d3 + 1] = simpleInverse ? -c.y : c.y; // ignore the z values until we support them
43511
43502
 
package/geo.lean.js CHANGED
@@ -12042,9 +12042,7 @@ var graphFeature = function graphFeature(arg) {
12042
12042
 
12043
12043
  }, arg.style === undefined ? {} : arg.style);
12044
12044
  m_this.style(defaultStyle);
12045
- m_this.nodes(function (d) {
12046
- return d;
12047
- });
12045
+ m_this.nodes(util.identityFunction);
12048
12046
  return m_this;
12049
12047
  };
12050
12048
  /**
@@ -12466,6 +12464,8 @@ var inherit = __webpack_require__(5699);
12466
12464
  var feature = __webpack_require__(6837);
12467
12465
 
12468
12466
  var transform = __webpack_require__(6853);
12467
+
12468
+ var util = __webpack_require__(4634);
12469
12469
  /**
12470
12470
  * Heatmap feature specification.
12471
12471
  *
@@ -12544,10 +12544,7 @@ var heatmapFeature = function heatmapFeature(arg) {
12544
12544
  m_gcsPosition,
12545
12545
  s_init = this._init;
12546
12546
  this.featureType = 'heatmap';
12547
-
12548
- m_position = arg.position || function (d) {
12549
- return d;
12550
- };
12547
+ m_position = arg.position || util.identityFunction;
12551
12548
 
12552
12549
  m_intensity = arg.intensity || function (d) {
12553
12550
  return 1;
@@ -15668,12 +15665,8 @@ var lineFeature = function lineFeature(arg) {
15668
15665
  });
15669
15666
  /* Set the reduced lines as the data and use simple accessors. */
15670
15667
 
15671
- m_this.style('position', function (d) {
15672
- return d;
15673
- });
15674
- m_this.style('line', function (d) {
15675
- return d;
15676
- });
15668
+ m_this.style('position', util.identityFunction);
15669
+ m_this.style('line', util.identityFunction);
15677
15670
  m_this.data(data);
15678
15671
  return m_this;
15679
15672
  };
@@ -15701,9 +15694,7 @@ var lineFeature = function lineFeature(arg) {
15701
15694
  // Values of 2 and above appear smoothest.
15702
15695
  antialiasing: 2.0,
15703
15696
  closed: false,
15704
- line: function line(d) {
15705
- return d;
15706
- },
15697
+ line: util.identityFunction,
15707
15698
  position: function position(d) {
15708
15699
  return Array.isArray(d) ? {
15709
15700
  x: d[0],
@@ -23324,9 +23315,7 @@ var pixelmapFeature = function pixelmapFeature(arg) {
23324
23315
  a: 1
23325
23316
  };
23326
23317
  },
23327
- position: function position(d) {
23328
- return d;
23329
- }
23318
+ position: util.identityFunction
23330
23319
  }, arg.style === undefined ? {} : arg.style);
23331
23320
 
23332
23321
  if (arg.position !== undefined) {
@@ -25022,12 +25011,8 @@ var polygonFeature = function polygonFeature(arg) {
25022
25011
  });
25023
25012
  /* Set the reduced polgons as the data and use simple accessors. */
25024
25013
 
25025
- m_this.style('position', function (d) {
25026
- return d;
25027
- });
25028
- m_this.style('polygon', function (d) {
25029
- return d;
25030
- });
25014
+ m_this.style('position', util.identityFunction);
25015
+ m_this.style('polygon', util.identityFunction);
25031
25016
  m_this.data(data);
25032
25017
  return m_this;
25033
25018
  };
@@ -25123,9 +25108,7 @@ var polygonFeature = function polygonFeature(arg) {
25123
25108
  b: 1.0
25124
25109
  },
25125
25110
  strokeOpacity: 1.0,
25126
- polygon: function polygon(d) {
25127
- return d;
25128
- },
25111
+ polygon: util.identityFunction,
25129
25112
  position: function position(d) {
25130
25113
  return Array.isArray(d) ? {
25131
25114
  x: d[0],
@@ -26014,9 +25997,7 @@ var quadFeature = function quadFeature(arg) {
26014
25997
  video: function video(d) {
26015
25998
  return d.video;
26016
25999
  },
26017
- position: function position(d) {
26018
- return d;
26019
- }
26000
+ position: util.identityFunction
26020
26001
  }, arg.style === undefined ? {} : arg.style);
26021
26002
 
26022
26003
  if (arg.position !== undefined) {
@@ -27053,7 +27034,7 @@ module.exports = sceneObject;
27053
27034
  * @constant
27054
27035
  * @type {string}
27055
27036
  */
27056
- module.exports = "493ff30a20fb5c5febb2c3521372398121e0cdee";
27037
+ module.exports = "e4988e06092d4bee858b11f2d0109a6bfe77dfbb";
27057
27038
 
27058
27039
  /***/ }),
27059
27040
 
@@ -32927,12 +32908,8 @@ var trackFeature = function trackFeature(arg) {
32927
32908
  arg = arg || {};
32928
32909
  s_init.call(m_this, arg);
32929
32910
  var style = $.extend(true, {}, {
32930
- track: function track(d) {
32931
- return d;
32932
- },
32933
- position: function position(d) {
32934
- return d;
32935
- },
32911
+ track: util.identityFunction,
32912
+ position: util.identityFunction,
32936
32913
  time: function time(d, i) {
32937
32914
  return d.t !== undefined ? d.t : i;
32938
32915
  }
@@ -33007,7 +32984,7 @@ var maxTransformCacheSize = 10;
33007
32984
  /* A RegExp to detect if two transforms only different by the middle axis's
33008
32985
  * direction. */
33009
32986
 
33010
- var axisPattern = /^(.* |)\\+axis=e(n|s)u(| .*)$/;
32987
+ var axisPattern = /^(.* |)\+axis=e(n|s)u(| .*)$/;
33011
32988
  var affinePattern = /(^|\s)\+(s[1-3][1-3]|[xyz]off)=\S/;
33012
32989
  /**
33013
32990
  * This purpose of this class is to provide a generic interface for computing
@@ -38579,6 +38556,17 @@ var util = {
38579
38556
 
38580
38557
  return value !== null && value !== undefined && (type === 'object' || type === 'function');
38581
38558
  },
38559
+
38560
+ /**
38561
+ * Return the first value passed to the function. Using this function for
38562
+ * identity calls can allow some code to bypass making such a call entirely.
38563
+ *
38564
+ * @param {*} d Any value.
38565
+ * @returns {*} The passed value.
38566
+ */
38567
+ identityFunction: function identityFunction(d) {
38568
+ return d;
38569
+ },
38582
38570
  ///////////////////////////////////////////////////////////////////////////
38583
38571
 
38584
38572
  /*
@@ -39408,6 +39396,8 @@ module.exports = {
39408
39396
  var inherit = __webpack_require__(5699);
39409
39397
 
39410
39398
  var feature = __webpack_require__(6837);
39399
+
39400
+ var util = __webpack_require__(4634);
39411
39401
  /**
39412
39402
  * Object specification for a graph feature.
39413
39403
  *
@@ -39534,9 +39524,7 @@ var vectorFeature = function vectorFeature(arg) {
39534
39524
  y: 0,
39535
39525
  z: 0
39536
39526
  },
39537
- delta: function delta(d) {
39538
- return d;
39539
- },
39527
+ delta: util.identityFunction,
39540
39528
  scale: null // size scaling factor (null -> renderer decides)
39541
39529
 
39542
39530
  }, arg.style === undefined ? {} : arg.style);
@@ -39568,7 +39556,7 @@ module.exports = vectorFeature;
39568
39556
  * @constant
39569
39557
  * @type {string}
39570
39558
  */
39571
- module.exports = "1.8.7";
39559
+ module.exports = "1.8.8";
39572
39560
 
39573
39561
  /***/ }),
39574
39562
 
@@ -40865,6 +40853,7 @@ var webgl_lineFeature = function webgl_lineFeature(arg) {
40865
40853
  if (!onlyStyle) {
40866
40854
  var position = [],
40867
40855
  posFunc = m_this.position();
40856
+ posFunc = posFunc === util.identityFunction ? null : posFunc;
40868
40857
  lineItemList = new Array(data.length);
40869
40858
  closed = new Array(data.length);
40870
40859
 
@@ -40880,7 +40869,7 @@ var webgl_lineFeature = function webgl_lineFeature(arg) {
40880
40869
  numSegments += lineItem.length - 1;
40881
40870
 
40882
40871
  for (j = 0; j < lineItem.length; j += 1) {
40883
- pos = posFunc(lineItem[j], j, d, i);
40872
+ pos = posFunc ? posFunc(lineItem[j], j, d, i) : lineItem[j];
40884
40873
  position.push(pos.x);
40885
40874
  position.push(simpleInverse ? -pos.y : pos.y);
40886
40875
  position.push(pos.z || 0.0);
@@ -43459,10 +43448,12 @@ var webgl_polygonFeature = function webgl_polygonFeature(arg) {
43459
43448
 
43460
43449
  if (!onlyStyle) {
43461
43450
  posFunc = m_this.style.get('position');
43451
+ posFunc = posFunc === util.identityFunction ? null : posFunc;
43462
43452
  polyFunc = m_this.style.get('polygon');
43453
+ polyFunc = polyFunc === util.identityFunction ? null : polyFunc;
43463
43454
  m_this.data().forEach(function (item, itemIndex) {
43464
43455
  var polygon, outer, geometry, c;
43465
- polygon = polyFunc(item, itemIndex);
43456
+ polygon = polyFunc ? polyFunc(item, itemIndex) : item;
43466
43457
 
43467
43458
  if (!polygon) {
43468
43459
  return;
@@ -43481,7 +43472,7 @@ var webgl_polygonFeature = function webgl_polygonFeature(arg) {
43481
43472
  geometry = new Array(outer.length * 3);
43482
43473
 
43483
43474
  for (i = d3 = 0; i < outer.length; i += 1, d3 += 3) {
43484
- c = posFunc(outer[i], i, item, itemIndex);
43475
+ c = posFunc ? posFunc(outer[i], i, item, itemIndex) : outer[i];
43485
43476
  geometry[d3] = c.x;
43486
43477
  geometry[d3 + 1] = simpleInverse ? -c.y : c.y; // ignore the z values until we support them
43487
43478
 
@@ -43505,7 +43496,7 @@ var webgl_polygonFeature = function webgl_polygonFeature(arg) {
43505
43496
  geometry.holes.push(d3 / 3);
43506
43497
 
43507
43498
  for (i = 0; i < hole.length; i += 1, d3 += 3) {
43508
- c = posFunc(hole[i], i, item, itemIndex);
43499
+ c = posFunc ? posFunc(hole[i], i, item, itemIndex) : hole[i];
43509
43500
  geometry.vertices[d3] = c.x;
43510
43501
  geometry.vertices[d3 + 1] = simpleInverse ? -c.y : c.y; // ignore the z values until we support them
43511
43502