Browse Source

refactor: refactor data methods (#2481)

pull/2489/head
Yoshiya Hinosawa 6 years ago committed by GitHub
parent
commit
0fde1b0320
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 18
      src/data.js
  2. 2
      src/interaction.js

18
src/data.js

@ -307,12 +307,24 @@ ChartInternal.prototype.getDataLabelLength = function (min, max, key) {
.remove(); .remove();
return lengths; return lengths;
}; };
/**
* Returns true if the given data point is not arc type, otherwise false.
* @param {Object} d The data point
* @return {boolean}
*/
ChartInternal.prototype.isNoneArc = function (d) { ChartInternal.prototype.isNoneArc = function (d) {
return this.hasTarget(this.data.targets, d.id); return this.hasTarget(this.data.targets, d.id);
}, };
ChartInternal.prototype.isArc = function (d) {
/**
* Returns true if the given data point is arc type, otherwise false.
* @param {Object} d The data point
* @return {boolean}
*/
ChartInternal.prototype.isArc = function (d) {
return 'data' in d && this.hasTarget(this.data.targets, d.data.id); return 'data' in d && this.hasTarget(this.data.targets, d.data.id);
}; };
ChartInternal.prototype.findClosestFromTargets = function (targets, pos) { ChartInternal.prototype.findClosestFromTargets = function (targets, pos) {
var $$ = this, var $$ = this,
candidates; candidates;

2
src/interaction.js

@ -68,7 +68,7 @@ ChartInternal.prototype.redrawEventRect = function () {
$$.mouseover = undefined; $$.mouseover = undefined;
} }
if (! closest) { if (!closest) {
mouseout(); mouseout();
return; return;
} }

Loading…
Cancel
Save