* `DatasetController.onDataUnshift` was renamed to `DatasetController._onDataUnshift`
* `DatasetController.removeElements` was renamed to `DatasetController._removeElements`
* `DatasetController.resyncElements` was renamed to `DatasetController._resyncElements`
+* `RadialLinearScale.setReductions` was renamed to `RadialLinearScale._setReductions`
+* `Scale.handleMargins` was renamed to `Scale._handleMargins`
* `helpers._alignPixel` was renamed to `helpers.canvas._alignPixel`
* `helpers._decimalPlaces` was renamed to `helpers.math._decimalPlaces`
/**
* Get the padding needed for the scale
- * @return {{top: number, left: number, bottom: number, right: number}}
+ * @return {{top: number, left: number, bottom: number, right: number}} the necessary padding
* @private
*/
getPadding() {
}
}
- me.handleMargins();
+ me._handleMargins();
if (isHorizontal) {
me.width = me._length = chart.width - me.margins.left - me.margins.right;
* Handle margins and padding interactions
* @private
*/
- handleMargins() {
+ _handleMargins() {
const me = this;
if (me.margins) {
me.margins.left = Math.max(me.paddingLeft, me.margins.left);
/**
* @param {object[]} ticks
+ * @private
*/
_convertTicksToLabels(ticks) {
const me = this;
* @param {string} bounds.property - the property of a `Point` we are bounding. `x`, `y` or `angle`.
* @param {number} bounds.start - start value of the property
* @param {number} bounds.end - end value of the property
+ * @private
**/
export function _boundSegment(segment, points, bounds) {
if (!bounds) {
* @param {string} bounds.property - the property we are bounding with. `x`, `y` or `angle`.
* @param {number} bounds.start - start value of the `property`
* @param {number} bounds.end - end value of the `property`
+ * @private
*/
export function _boundSegments(line, bounds) {
const result = [];
* Compute the continuous segments that define the whole line
* There can be skipped points within a segment, if spanGaps is true.
* @param {Line} line
+ * @private
*/
export function _computeSegments(line) {
const points = line.points;
* @returns {number} Size in pixels or undefined if unknown.
*/
function readUsedSize(element, property) {
- var value = helpers.dom.getStyle(element, property);
- var matches = value && value.match(/^(\d+)(\.\d+)?px$/);
+ const value = helpers.dom.getStyle(element, property);
+ const matches = value && value.match(/^(\d+)(\.\d+)?px$/);
return matches ? Number(matches[1]) : undefined;
}
* https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#Safely_detecting_option_support
* @private
*/
-var supportsEventListenerOptions = (function() {
+const supportsEventListenerOptions = (function() {
let supports = false;
try {
const options = Object.defineProperty({}, 'passive', {
// Default passive to true as expected by Chrome for 'touchstart' and 'touchend' events.
// https://github.com/chartjs/Chart.js/issues/4287
-var eventListenerOptions = supportsEventListenerOptions ? {passive: true} : false;
+const eventListenerOptions = supportsEventListenerOptions ? {passive: true} : false;
function addListener(node, type, listener) {
node.addEventListener(type, listener, eventListenerOptions);
restoreTextDirection(me.ctx, opts.textDirection);
}
+ /**
+ * @private
+ */
_drawTitle() {
const me = this;
const opts = me.options;
ctx.fillText(titleOpts.text, x, y);
}
+ /**
+ * @private
+ */
_computeTitleHeight() {
const titleOpts = this.options.title;
const titleFont = _parseFont(titleOpts);
/**
* Handle an event
* @param {IEvent} e - The event to handle
- * @private
*/
handleEvent(e) {
var me = this;
}
}
+ /**
+ * @private
+ */
_drawColorBox(ctx, pt, i, rtlHelper) {
const me = this;
const options = me.options;
/**
* Handle an event
- * @private
* @param {IEvent} e - The event to handle
* @returns {boolean} true if the tooltip changed
*/
this._valueRange = undefined;
}
+ /**
+ * @private
+ */
_parse(raw, index) {
const labels = this._getLabels();
if (labels[index] === raw) {
return value;
}
+ /**
+ * @private
+ */
_configure() {
const me = this;
this._valueRange = undefined;
}
+ /**
+ * @private
+ */
_parse(raw, index) { // eslint-disable-line no-unused-vars
if (isNullOrUndef(raw)) {
return NaN;
return maxTicks;
}
+ /**
+ * @private
+ */
_computeTickLimit() {
return Number.POSITIVE_INFINITY;
}
+ /**
+ * @private
+ */
_handleDirectionalChanges(ticks) {
return ticks;
}
return ticks;
}
+ /**
+ * @private
+ */
_configure() {
const me = this;
const ticks = me.ticks;
this._valueRange = undefined;
}
+ /**
+ * @private
+ */
_parse(raw, index) { // eslint-disable-line no-unused-vars
const value = LinearScaleBase.prototype._parse.apply(this, arguments);
if (value === 0) {
return this.getPixelForValue(ticks[index].value);
}
+ /**
+ * @private
+ */
_configure() {
const me = this;
let start = me.min;
}
}
- scale.setReductions(scale.drawingArea, furthestLimits, furthestAngles);
+ scale._setReductions(scale.drawingArea, furthestLimits, furthestAngles);
}
function getTextAlignForAngle(angle) {
me.handleTickRangeOptions();
}
- // Returns the maximum number of ticks based on the scale dimension
+ /**
+ * Returns the maximum number of ticks based on the scale dimension
+ * @private
+ */
_computeTickLimit() {
return Math.ceil(this.drawingArea / getTickBackdropHeight(this.options));
}
* Set radius reductions and determine new radius and center point
* @private
*/
- setReductions(largestPossibleRadius, furthestLimits, furthestAngles) {
+ _setReductions(largestPossibleRadius, furthestLimits, furthestAngles) {
var me = this;
var radiusReductionLeft = furthestLimits.l / Math.sin(furthestAngles.l);
var radiusReductionRight = Math.max(furthestLimits.r - me.width, 0) / Math.sin(furthestAngles.r);
* @param {*} raw
* @param {number} index
* @return {number}
+ * @private
*/
_parse(raw, index) { // eslint-disable-line no-unused-vars
if (raw === undefined) {
* @param {string} axis
* @param {number} index
* @return {number}
+ * @private
*/
_parseObject(obj, axis, index) {
if (obj && obj.t) {
return null;
}
+ /**
+ * @private
+ */
_invalidateCaches() {
this._cache = {
data: [],