Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
WeekdayInMonth.prototype._getRenderLimitIndex = function(panelHeight) {
var opt = this.options;
var containerHeight = panelHeight || this.getViewBound().height;
var gridHeaderHeight = util.pick(opt, 'grid', 'header', 'height') || 0;
var gridFooterHeight = util.pick(opt, 'grid', 'footer', 'height') || 0;
var visibleScheduleCount = opt.visibleScheduleCount || 0;
var count;
containerHeight -= (gridHeaderHeight + gridFooterHeight);
count = mfloor(containerHeight / (opt.scheduleHeight + opt.scheduleGutter));
if (!visibleScheduleCount) {
visibleScheduleCount = count;
}
return mmin(count, visibleScheduleCount); // subtraction for '+n' label block
};
this.children.each(function(childView) {
var matrices;
var viewName = util.pick(childView.options, 'viewName');
childView.render(viewModel);
if (viewName) {
matrices = viewModel.schedulesInDateRange[viewName]; // DayGrid limits schedule count by visibleScheduleCount after rendering it.
if (util.isArray(matrices)) {
self._invokeAfterRenderSchedule(matrices);
} else {
util.forEach(matrices, function(matricesOfDay) {
self._invokeAfterRenderSchedule(matricesOfDay);
});
}
}
});
onResetZoom() {
let rawData = this.dataProcessor.getOriginalRawData();
if (this._dynamicDataHelper.checkedLegends) {
rawData = rawDataHandler.filterCheckedRawData(rawData, this._dynamicDataHelper.checkedLegends);
}
this.dataProcessor.initData(rawData);
this.dataProcessor.initZoomedRawData();
this.dataProcessor.addDataFromRemainDynamicData(snippet.pick(this.options.series, 'shifting'));
this._renderForZoom(true);
this._dynamicDataHelper.restartAnimation();
}
}
lastIn2dArray: function(arr2d) {
var lastRow = arr2d.length - 1,
lastCol = arr2d[lastRow].length - 1;
return util.pick(arr2d, lastRow, lastCol);
},
then: function(fn) {
var args;
if (!result) {
return undefined; //eslint-disable-line
}
args = aps.call(arguments, 1);
if (util.isString(fn)) {
return (util.pick(result, fn) || function() {}).apply(result, args);
}
return fn.call(result, result);
}
};
TimeGrid.prototype._getBaseViewModel = function(viewModel) {
var grids = viewModel.grids;
var range = viewModel.range;
var opt = this.options;
var baseViewModel = this._getHourmarkerViewModel(new TZDate().toLocalTime(), grids, range);
var timezonesCollapsed = util.pick(viewModel, 'state', 'timezonesCollapsed');
var styles = this._getStyles(viewModel.theme, timezonesCollapsed);
return util.extend(baseViewModel, {
timezones: this._getTimezoneViewModel(baseViewModel.todaymarkerLeft, timezonesCollapsed, styles),
hoursLabels: getHoursLabels(opt, baseViewModel.todaymarkerLeft >= 0, 0, styles),
styles: styles,
showTimezoneCollapseButton: util.pick(opt, 'showTimezoneCollapseButton'),
timezonesCollapsed: timezonesCollapsed
});
};
}
target = domutil.closest(target, config.classname('.weekday'));
if (!target) {
return false;
}
cssClass = domutil.getClass(target);
matches = cssClass.match(config.daygrid.getViewIDRegExp);
if (!matches || matches.length < 2) {
return false;
}
return util.pick(this.view.children.items, matches[1]);
};
function getDate(mouseEvent) {
var pos = domevent.getMousePosition(mouseEvent, relativeContainer),
x = getX(common.ratio(size[0], 100, pos[0])),
y = mfloor(common.ratio(size[1], weekCount, pos[1])),
weekdayView, date;
weekdayView = util.pick(weeks, y);
if (!weekdayView) {
return null;
}
date = util.pick(weekdayView.getRenderDateRange(), x);
if (!date) {
return null;
}
return {
x: x,
y: y,
sizeX: dayCount,
sizeY: weekCount,
date: date,
weekdayView: weekdayView,
triggerEvent: mouseEvent.type
};
}
_findFormatFunctions() {
const format = snippet.pick(this.options, 'chart', 'format');
let funcs = [];
if (snippet.isFunction(format)) {
funcs = [format];
} else if (snippet.isString(format)) {
funcs = this._findSimpleTypeFormatFunctions(format);
}
return funcs;
}
_triggerEditingStateChanged: function(rowKey, columnName) {
var cellData = this.getCellData(rowKey, columnName);
if (snippet.pick(cellData, 'columnModel', 'editOptions', 'useViewMode') !== false &&
cellData.convertedHTML === null) {
this.trigger('editingStateChanged', cellData);
}
},