_id stringlengths 2 6 | title stringlengths 0 58 | partition stringclasses 3
values | text stringlengths 27 233k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
q15200 | train | function (point) {
var rect = this.getRect();
var axis = this.getAxis();
var orient = axis.orient;
if (orient === 'horizontal') {
return axis.contain(axis.toLocalCoord(point[0]))
&& (point[1] >= rect.y && point[1] <= (rect.y + rect.height));
}
| javascript | {
"resource": ""
} | |
q15201 | train | function (val) {
var axis = this.getAxis();
var rect = this.getRect();
var pt = [];
var idx = axis.orient === 'horizontal' ? 0 : 1;
if (val instanceof Array) {
val = val[0];
} | javascript | {
"resource": ""
} | |
q15202 | train | function (data, width, height, normalize, colorFunc, isInRange) {
var brush = this._getBrush();
var gradientInRange = this._getGradient(data, colorFunc, 'inRange');
var gradientOutOfRange = this._getGradient(data, colorFunc, 'outOfRange');
var r = this.pointSize + this.blurSize;
... | javascript | {
"resource": ""
} | |
q15203 | train | function () {
var brushCanvas = this._brushCanvas || (this._brushCanvas = zrUtil.createCanvas());
// set brush size
var r = this.pointSize + this.blurSize;
var d = r * 2;
brushCanvas.width = d;
brushCanvas.height = d;
var ctx = brushCanvas.getContext('2d');
... | javascript | {
"resource": ""
} | |
q15204 | train | function (data, colorFunc, state) {
var gradientPixels = this._gradientPixels;
var pixelsSingleState = gradientPixels[state] || (gradientPixels[state] = new Uint8ClampedArray(256 * 4));
var color = [0, 0, 0, 0];
| javascript | {
"resource": ""
} | |
q15205 | getViewRect | train | function getViewRect(seriesModel, api) {
return layout.getLayoutRect(
seriesModel.getBoxLayoutParams(), {
| javascript | {
"resource": ""
} |
q15206 | computeNodeValues | train | function computeNodeValues(nodes) {
zrUtil.each(nodes, function (node) {
var value1 = sum(node.outEdges, getEdgeValue);
var value2 = sum(node.inEdges, getEdgeValue);
| javascript | {
"resource": ""
} |
q15207 | computeNodeBreadths | train | function computeNodeBreadths(nodes, edges, nodeWidth, width, height, orient, nodeAlign) {
// Used to mark whether the edge is deleted. if it is deleted,
// the value is 0, otherwise it is 1.
var remainEdges = [];
// Storage each node's indegree.
var indegreeArr = [];
//Used to storage the node w... | javascript | {
"resource": ""
} |
q15208 | moveSinksRight | train | function moveSinksRight(nodes, maxDepth) {
zrUtil.each(nodes, function (node) {
if (!isNodeDepth(node) && !node.outEdges.length) {
| javascript | {
"resource": ""
} |
q15209 | scaleNodeBreadths | train | function scaleNodeBreadths(nodes, kx, orient) {
zrUtil.each(nodes, function (node) {
var nodeDepth = node.getLayout().depth * kx;
orient === 'vertical'
| javascript | {
"resource": ""
} |
q15210 | initializeNodeDepth | train | function initializeNodeDepth(nodesByBreadth, edges, height, width, nodeGap, orient) {
var minKy = Infinity;
zrUtil.each(nodesByBreadth, function (nodes) {
var n = nodes.length;
var sum = 0;
zrUtil.each(nodes, function (node) {
sum += node.getLayout().value;
});
... | javascript | {
"resource": ""
} |
q15211 | relaxRightToLeft | train | function relaxRightToLeft(nodesByBreadth, alpha, orient) {
zrUtil.each(nodesByBreadth.slice().reverse(), function (nodes) {
zrUtil.each(nodes, function (node) {
if (node.outEdges.length) {
var y = sum(node.outEdges, weightedTarget, orient)
/ sum(node.outEd... | javascript | {
"resource": ""
} |
q15212 | train | function (date) {
date = numberUtil.parseDate(date);
var y = date.getFullYear();
var m = date.getMonth() + 1;
m = m < 10 ? '0' + m : m;
var d = date.getDate();
d = d < 10 ? '0' + d : d;
var day = date.getDay();
day = Math.abs((day + 7 - this.getFirst... | javascript | {
"resource": ""
} | |
q15213 | train | function (nthWeek, day, range) {
var rangeInfo = this._getRangeInfo(range);
if (nthWeek > rangeInfo.weeks
|| (nthWeek === 0 && day < rangeInfo.fweek)
|| (nthWeek === rangeInfo.weeks && day > rangeInfo.lweek)
) {
return false;
| javascript | {
"resource": ""
} | |
q15214 | train | function (axisModel, ecModel, api, payload, force) {
updateAxisPointer(this, | javascript | {
"resource": ""
} | |
q15215 | getSymbolMeta | train | function getSymbolMeta(data, dataIndex, itemModel, opt) {
var layout = data.getItemLayout(dataIndex);
var symbolRepeat = itemModel.get('symbolRepeat');
var symbolClip = itemModel.get('symbolClip');
var symbolPosition = itemModel.get('symbolPosition') || 'start';
var symbolRotate = itemModel.get('sym... | javascript | {
"resource": ""
} |
q15216 | prepareBarLength | train | function prepareBarLength(itemModel, symbolRepeat, layout, opt, output) {
var valueDim = opt.valueDim;
var symbolBoundingData = itemModel.get('symbolBoundingData');
var valueAxis = opt.coordSys.getOtherAxis(opt.coordSys.getBaseAxis());
var zeroPx = valueAxis.toGlobalCoord(valueAxis.dataToCoord(0));
... | javascript | {
"resource": ""
} |
q15217 | createOrUpdateBarRect | train | function createOrUpdateBarRect(bar, symbolMeta, isUpdate) {
var rectShape = zrUtil.extend({}, symbolMeta.barRectShape);
var barRect = bar.__pictorialBarRect;
if (!barRect) {
barRect = bar.__pictorialBarRect = new graphic.Rect({
z2: 2,
shape: rectShape,
silent: tr... | javascript | {
"resource": ""
} |
q15218 | centerGraphic | train | function centerGraphic(rect, boundingRect) {
// Set rect to center, keep width / height ratio.
var aspect = boundingRect.width / boundingRect.height;
var width = rect.height * aspect;
var height;
if (width <= rect.width) {
| javascript | {
"resource": ""
} |
q15219 | setTextStyleCommon | train | function setTextStyleCommon(textStyle, textStyleModel, opt, isEmphasis) {
// Consider there will be abnormal when merge hover style to normal style if given default value.
opt = opt || EMPTY_OBJ;
if (opt.isRectText) {
var textPosition = textStyleModel.getShallow('position')
|| (isEmphas... | javascript | {
"resource": ""
} |
q15220 | applyDefaultTextStyle | train | function applyDefaultTextStyle(textStyle) {
var opt = textStyle.insideRollbackOpt;
// Only `insideRollbackOpt` created (in `setTextStyleCommon`),
// applyDefaultTextStyle works.
if (!opt || textStyle.textFill != null) {
return;
}
var useInsideStyle = opt.useInsideStyle;
var textPos... | javascript | {
"resource": ""
} |
q15221 | groupSeries | train | function groupSeries(ecModel) {
var seriesGroupByCategoryAxis = {};
var otherSeries = [];
var meta = [];
ecModel.eachRawSeries(function (seriesModel) {
var coordSys = seriesModel.coordinateSystem;
if (coordSys && (coordSys.type === 'cartesian2d' || coordSys.type === 'polar')) {
... | javascript | {
"resource": ""
} |
q15222 | assembleSeriesWithCategoryAxis | train | function assembleSeriesWithCategoryAxis(series) {
var tables = [];
zrUtil.each(series, function (group, key) {
var categoryAxis = group.categoryAxis;
var valueAxis = group.valueAxis;
var valueAxisDim = valueAxis.dim;
var headers = [' '].concat(zrUtil.map(group.series, function (... | javascript | {
"resource": ""
} |
q15223 | assembleOtherSeries | train | function assembleOtherSeries(series) {
return zrUtil.map(series, function (series) {
var data = series.getRawData();
var lines = [series.name];
var vals = [];
data.each(data.dimensions, function () {
var argLen = arguments.length;
var dataIndex = arguments[arg... | javascript | {
"resource": ""
} |
q15224 | isTSVFormat | train | function isTSVFormat(block) {
// Simple method to find out if a block is tsv format
var firstLine = block.slice(0, block.indexOf('\n'));
| javascript | {
"resource": ""
} |
q15225 | cloneListForMapAndSample | train | function cloneListForMapAndSample(original, excludeDimensions) {
var allDimensions = original.dimensions;
var list = new List(
zrUtil.map(allDimensions, original.getDimensionInfo, original),
original.hostModel
);
// FIXME If needs stackedOn, value may already been stacked
transferPro... | javascript | {
"resource": ""
} |
q15226 | train | function (x, y, width, height) {
this._rect = new BoundingRect(x, y, | javascript | {
"resource": ""
} | |
q15227 | train | function (x, y, width, height) {
var rect = this.getBoundingRect();
var rawTransform = this._rawTransformable;
rawTransform.transform = rect.calculateTransform(
| javascript | {
"resource": ""
} | |
q15228 | train | function () {
// Rect before any transform
var rawRect = this.getBoundingRect();
var cx = rawRect.x + rawRect.width / 2;
| javascript | {
"resource": ""
} | |
q15229 | train | function () {
var roamTransformable = this._roamTransformable;
var rawTransformable = this._rawTransformable;
rawTransformable.parent = roamTransformable;
roamTransformable.updateTransform();
rawTransformable.updateTransform();
matrix.copy(this.transform || (this.transf... | javascript | {
"resource": ""
} | |
q15230 | train | function (node, startAngle) {
if (!node) {
return;
}
var endAngle = startAngle;
// Render self
if (node !== virtualRoot) {
// Tree node is virtual, so it doesn't need to be drawn
var value = node.getValue();
... | javascript | {
"resource": ""
} | |
q15231 | initChildren | train | function initChildren(node, isAsc) {
var children = node.children || [];
node.children = sort(children, isAsc);
// Init children recursively
if (children.length) {
| javascript | {
"resource": ""
} |
q15232 | sort | train | function sort(children, sortOrder) {
if (typeof sortOrder === 'function') {
return children.sort(sortOrder);
}
else {
var isAsc = sortOrder === 'asc';
return children.sort(function (a, b) {
var diff = (a.getValue() - b.getValue()) * (isAsc ? 1 : | javascript | {
"resource": ""
} |
q15233 | initChildren | train | function initChildren(node, nodeModel, totalArea, options, hideChildren, depth) {
var viewChildren = node.children || [];
var orderBy = options.sort;
orderBy !== 'asc' && orderBy !== 'desc' && (orderBy = null);
var overLeafDepth = options.leafDepth != null && options.leafDepth <= depth;
// leafDep... | javascript | {
"resource": ""
} |
q15234 | filterByThreshold | train | function filterByThreshold(nodeModel, totalArea, sum, orderBy, orderedChildren) {
// visibleMin is not supported yet when no option.sort.
if (!orderBy) {
return sum;
}
var visibleMin = nodeModel.get('visibleMin');
var len = orderedChildren.length;
var deletePoint = len;
// Always ... | javascript | {
"resource": ""
} |
q15235 | position | train | function position(row, rowFixedLength, rect, halfGapWidth, flush) {
// When rowFixedLength === rect.width,
// it is horizontal subdivision,
// rowFixedLength is the width of the subdivision,
// rowOtherLength is the height of the subdivision,
// and nodes will be positioned from left to right.
... | javascript | {
"resource": ""
} |
q15236 | calculateRootPosition | train | function calculateRootPosition(layoutInfo, rootRect, targetInfo) {
if (rootRect) {
return {x: rootRect.x, y: rootRect.y};
}
var defaultPosition = {x: 0, y: 0};
if (!targetInfo) {
return defaultPosition;
}
// If targetInfo is fetched by 'retrieveTargetInfo',
// old tree and ... | javascript | {
"resource": ""
} |
q15237 | prunning | train | function prunning(node, clipRect, viewAbovePath, viewRoot, depth) {
var nodeLayout = node.getLayout();
var nodeInViewAbovePath = viewAbovePath[depth];
var isAboveViewRoot = nodeInViewAbovePath && nodeInViewAbovePath === node;
if (
(nodeInViewAbovePath && !isAboveViewRoot)
|| (depth === ... | javascript | {
"resource": ""
} |
q15238 | executeShifts | train | function executeShifts(node) {
var children = node.children;
var n = children.length;
var shift = 0;
var change = 0;
while (--n >= 0) | javascript | {
"resource": ""
} |
q15239 | nextRight | train | function nextRight(node) {
var children = node.children;
return children.length && node.isExpand | javascript | {
"resource": ""
} |
q15240 | elSetState | train | function elSetState(el, state, highlightDigit) {
if (el) {
el.trigger(state, highlightDigit);
if (el.isGroup
// Simple optimize.
&& !graphicUtil.isHighDownDispatcher(el)
) {
| javascript | {
"resource": ""
} |
q15241 | train | function (parallelModel, ecModel, api) {
var dimensions = parallelModel.dimensions;
var parallelAxisIndex = parallelModel.parallelAxisIndex;
each(dimensions, function (dim, idx) {
var axisIndex = parallelAxisIndex[idx];
var axisModel = ecModel.getComponent('parallelAxi... | javascript | {
"resource": ""
} | |
q15242 | train | function (parallelModel, ecModel) {
ecModel.eachSeries(function (seriesModel) {
if (!parallelModel.contains(seriesModel, ecModel)) {
return;
}
var data = seriesModel.getData();
each(this.dimensions, function (dim) {
var | javascript | {
"resource": ""
} | |
q15243 | train | function (parallelModel, api) {
this._rect = layoutUtil.getLayoutRect(
parallelModel.getBoxLayoutParams(),
{
width: api.getWidth(),
| javascript | {
"resource": ""
} | |
q15244 | train | function (data, callback, start, end) {
start == null && (start = 0);
end == null && (end = data.count());
var axesMap = this._axesMap;
var dimensions = this.dimensions;
var dataDimensions = [];
var axisModels = [];
zrUtil.each(dimensions, function (axisDim) {
... | javascript | {
"resource": ""
} | |
q15245 | train | function () {
var dimensions = this.dimensions;
var axesMap = this._axesMap;
var hasActiveSet = false;
for (var j = 0, lenj = dimensions.length; j < lenj; j++) {
| javascript | {
"resource": ""
} | |
q15246 | train | function (opt, ignoreUpdateRangeUsg) {
var option = this.option;
each([['start', 'startValue'], ['end', 'endValue']], function (names) {
// If only one of 'start' and 'startValue' is not null/undefined, the other
// should be cleared, which enable clear the option.
//... | javascript | {
"resource": ""
} | |
q15247 | resizePolar | train | function resizePolar(polar, polarModel, api) {
var center = polarModel.get('center');
var width = api.getWidth();
var height = api.getHeight();
polar.cx = parsePercent(center[0], width);
| javascript | {
"resource": ""
} |
q15248 | setAxis | train | function setAxis(axis, axisModel) {
axis.type = axisModel.get('type');
axis.scale = createScaleByModel(axisModel);
axis.onBand = axisModel.get('boundaryGap') && axis.type === 'category';
axis.inverse = axisModel.get('inverse');
| javascript | {
"resource": ""
} |
q15249 | createParallelIfNeeded | train | function createParallelIfNeeded(option) {
if (option.parallel) {
return;
}
var hasParallelSeries = false;
zrUtil.each(option.series, function (seriesOpt) {
if (seriesOpt && seriesOpt.type === 'parallel') { | javascript | {
"resource": ""
} |
q15250 | updateCache | train | function updateCache(dataIndexInside) {
dataIndexInside == null && (dataIndexInside = currDataIndexInside);
if (currDirty) {
currItemModel = data.getItemModel(dataIndexInside);
currLabelNormalModel = currItemModel.getModel(LABEL_NORMAL);
| javascript | {
"resource": ""
} |
q15251 | train | function () {
var handle = this._handle;
if (!handle) {
return;
}
var payloadInfo = this._payloadInfo;
var axisModel = this._axisModel;
this._api.dispatchAction({
type: 'updateAxisPointer',
x: payloadInfo.cursorPoint[0],
| javascript | {
"resource": ""
} | |
q15252 | getLabelDefaultText | train | function getLabelDefaultText(idx, opt) {
return useNameLabel ? | javascript | {
"resource": ""
} |
q15253 | train | function (activeState) {
var coordSys = this.coordinateSystem;
var data = this.getData();
var indices = [];
coordSys.eachActiveState(data, function (theActiveState, dataIndex) {
if (activeState | javascript | {
"resource": ""
} | |
q15254 | getScales | train | function getScales(xyMinMaxCurr, xyMinMaxOrigin) {
var sizeCurr = getSize(xyMinMaxCurr);
var sizeOrigin = getSize(xyMinMaxOrigin);
| javascript | {
"resource": ""
} |
q15255 | converDataValue | train | function converDataValue(value, dimInfo) {
// Performance sensitive.
var dimType = dimInfo && dimInfo.type;
if (dimType === 'ordinal') {
// If given value is a category string
var ordinalMeta = dimInfo && dimInfo.ordinalMeta;
return ordinalMeta
? ordinalMeta.parseAndColle... | javascript | {
"resource": ""
} |
q15256 | train | function (condition) {
var mainType = condition.mainType;
if (!mainType) {
return [];
}
var index = condition.index;
var id = condition.id;
var name = condition.name;
var cpts = this._componentsMap.get(mainType);
if (!cpts || !cpts.length) {... | javascript | {
"resource": ""
} | |
q15257 | train | function (condition) {
var query = condition.query;
var mainType = condition.mainType;
var queryCond = getQueryCond(query);
var result = queryCond
? this.queryComponents(queryCond)
: this._componentsMap.get(mainType);
return doFilter(filterBySubType(resu... | javascript | {
"resource": ""
} | |
q15258 | train | function (cb, context) {
assertSeriesInitialized(this);
each(this._seriesIndices, function (rawSeriesIndex) { | javascript | {
"resource": ""
} | |
q15259 | train | function (targetNode, layoutParam, textStyleModel) {
for (var node = targetNode; node; node = node.parentNode) {
var text = node.getModel().get('name');
var textRect = textStyleModel.getTextRect(text);
| javascript | {
"resource": ""
} | |
q15260 | packEventData | train | function packEventData(el, seriesModel, itemNode) {
el.eventData = {
componentType: 'series',
componentSubType: 'treemap',
componentIndex: seriesModel.componentIndex,
seriesIndex: seriesModel.componentIndex,
seriesName: seriesModel.name,
seriesType: 'treemap',
... | javascript | {
"resource": ""
} |
q15261 | train | function (opt) {
var dataExtent = this._dataExtent;
var axisModel = this.getAxisModel();
var scale = axisModel.axis.scale;
var rangePropMode = this._dataZoomModel.getRangePropMode();
var percentExtent = [0, 100];
var percentWindow = [];
var valueWindow = [];
... | javascript | {
"resource": ""
} | |
q15262 | prepareView | train | function prepareView(ecIns, type, ecModel, scheduler) {
var isComponent = type === 'component';
var viewList = isComponent ? ecIns._componentsViews : ecIns._chartsViews;
var viewMap = isComponent ? ecIns._componentsMap : ecIns._chartsMap;
var zr = ecIns._zr;
var api = ecIns._api;
for (var i = 0... | javascript | {
"resource": ""
} |
q15263 | renderSeries | train | function renderSeries(ecIns, ecModel, api, payload, dirtyMap) {
// Render all charts
var scheduler = ecIns._scheduler;
var unfinished;
ecModel.eachSeries(function (seriesModel) {
var chartView = ecIns._chartsMap[seriesModel.__viewId];
chartView.__alive = true;
var renderTask = c... | javascript | {
"resource": ""
} |
q15264 | updateBlend | train | function updateBlend(seriesModel, chartView) {
var blendMode = seriesModel.get('blendMode') || null;
if (__DEV__) {
if (!env.canvasSupported && blendMode && blendMode !== 'source-over') {
console.warn('Only canvas support blendMode');
}
}
chartView.group.traverse(function (el... | javascript | {
"resource": ""
} |
q15265 | themeRiverLayout | train | function themeRiverLayout(data, seriesModel, height) {
if (!data.count()) {
return;
}
var coordSys = seriesModel.coordinateSystem;
// the data in each layer are organized into a series.
var layerSeries = seriesModel.getLayerSeries();
// the points in each layer.
var timeDim = data.m... | javascript | {
"resource": ""
} |
q15266 | computeBaseline | train | function computeBaseline(data) {
var layerNum = data.length;
var pointNum = data[0].length;
var sums = [];
var y0 = [];
var max = 0;
var temp;
var base = {};
for (var i = 0; i < pointNum; ++i) {
for (var j = 0, temp = 0; j < layerNum; ++j) {
temp += data[j][i][1];
... | javascript | {
"resource": ""
} |
q15267 | train | function (ecModel, api) {
/**
* @private
* @type {module:echarts/data/Tree}
*/
this._oldTree;
/**
* @private
* @type {module:zrender/container/Group}
| javascript | {
"resource": ""
} | |
q15268 | doGuessOrdinal | train | function doGuessOrdinal(
data, sourceFormat, seriesLayoutBy, dimensionsDefine, startIndex, dimIndex
) {
var result;
// Experience value.
var maxLoop = 5;
if (isTypedArray(data)) {
return false;
}
// When sourceType is 'objectRows' or 'keyedColumns', dimensionsDefine
// always e... | javascript | {
"resource": ""
} |
q15269 | train | function (tooltipModel, ecModel, api, payload) {
var seriesIndex = payload.seriesIndex;
var dataIndex = payload.dataIndex;
var coordSysAxesInfo = ecModel.getComponent('axisPointer').coordSysAxesInfo;
if (seriesIndex == null || dataIndex == null || coordSysAxesInfo == null) {
... | javascript | {
"resource": ""
} | |
q15270 | train | function (dataByCoordSys) {
var lastCoordSys = this._lastDataByCoordSys;
var contentNotChanged = !!lastCoordSys
&& lastCoordSys.length === dataByCoordSys.length;
contentNotChanged && each(lastCoordSys, function (lastItemCoordSys, indexCoordSys) {
var lastDataByAxis = las... | javascript | {
"resource": ""
} | |
q15271 | SunburstPiece | train | function SunburstPiece(node, seriesModel, ecModel) {
graphic.Group.call(this);
var sector = new graphic.Sector({
z2: DEFAULT_SECTOR_Z
});
sector.seriesIndex = seriesModel.seriesIndex;
var text = new graphic.Text({
z2: DEFAULT_TEXT_Z,
silent: node.getModel('label').get('sil... | javascript | {
"resource": ""
} |
q15272 | getNodeColor | train | function getNodeColor(node, seriesModel, ecModel) {
// Color from visualMap
var visualColor = node.getVisual('color');
var visualMetaList = node.getVisual('visualMeta');
if (!visualMetaList || visualMetaList.length === 0) {
// Use first-generation color if has no visualMap
visualColor = ... | javascript | {
"resource": ""
} |
q15273 | getRootId | train | function getRootId(node) {
var ancestor = node;
while (ancestor.depth > 1) {
ancestor = | javascript | {
"resource": ""
} |
q15274 | fillDefaultColor | train | function fillDefaultColor(node, seriesModel, color) {
var | javascript | {
"resource": ""
} |
q15275 | train | function (graphicModel) {
var elOptionsToUpdate = graphicModel.useElOptionsToUpdate();
if (!elOptionsToUpdate) {
return;
}
var elMap = this._elMap;
var rootGroup = this.group;
// Top-down tranverse to assign graphic settings to each elements.
zrUtil... | javascript | {
"resource": ""
} | |
q15276 | train | function (graphicModel, api) {
var elOptions = graphicModel.option.elements;
var rootGroup = this.group;
var elMap = this._elMap;
// Bottom-up tranvese all elements (consider ec resize) to locate elements.
for (var i = elOptions.length - 1; i >= 0; i--) {
var elOptio... | javascript | {
"resource": ""
} | |
q15277 | train | function () {
var elMap = this._elMap;
elMap.each(function (el) {
removeEl(el, elMap);
| javascript | {
"resource": ""
} | |
q15278 | getCleanedElOption | train | function getCleanedElOption(elOption) {
elOption = zrUtil.extend({}, elOption);
zrUtil.each(
['id', 'parentId', '$action', 'hv', 'bounding'].concat(layoutUtil.LOCATION_PARAMS),
| javascript | {
"resource": ""
} |
q15279 | makeLabelsByCustomizedCategoryInterval | train | function makeLabelsByCustomizedCategoryInterval(axis, categoryInterval, onlyTick) {
var ordinalScale = axis.scale;
var labelFormatter = makeLabelFormatter(axis);
var result = [];
zrUtil.each(ordinalScale.getTicks(), function (tickValue) {
var rawLabel = ordinalScale.getLabel(tickValue);
... | javascript | {
"resource": ""
} |
q15280 | fixAngleOverlap | train | function fixAngleOverlap(list) {
var firstItem = list[0];
var lastItem = list[list.length - 1];
if (firstItem
&& lastItem
| javascript | {
"resource": ""
} |
q15281 | train | function (axisModel, opt) {
/**
* @readOnly
*/
this.opt = opt;
/**
* @readOnly
*/
this.axisModel = axisModel;
// Default value
defaults(
opt,
{
labelOffset: 0,
nameDirection: 1,
tickDirection: 1,
labelDirectio... | javascript | {
"resource": ""
} | |
q15282 | train | function () {
// FIXME
// Move this logic to ec main?
var container = this._container;
var stl = container.currentStyle
|| document.defaultView.getComputedStyle(container);
var domStyle = container.style;
| javascript | {
"resource": ""
} | |
q15283 | getLinkedData | train | function getLinkedData(dataType) {
var mainData = this[MAIN_DATA];
| javascript | {
"resource": ""
} |
q15284 | train | function (ecModel, api) {
ecModel.eachComponent('dataZoom', function (dataZoomModel) {
// We calculate window and reset axis here but not in model
// init stage and not after action dispatch handler, because
// reset should be called after seriesData.restoreData.
... | javascript | {
"resource": ""
} | |
q15285 | train | function (point) {
var coord = this.pointToCoord(point);
return this._radiusAxis.contain(coord[0])
| javascript | {
"resource": ""
} | |
q15286 | train | function (scaleType) {
var axes = [];
var angleAxis = this._angleAxis;
var radiusAxis = this._radiusAxis;
angleAxis.scale.type === scaleType && axes.push(angleAxis);
| javascript | {
"resource": ""
} | |
q15287 | drawNonMono | train | function drawNonMono(
ctx, points, start, segLen, allLen,
dir, smoothMin, smoothMax, smooth, smoothMonotone, connectNulls
) {
var prevIdx = 0;
var idx = start;
for (var k = 0; k < segLen; k++) {
var p = points[idx];
if (idx >= allLen || idx < 0) {
break;
}
... | javascript | {
"resource": ""
} |
q15288 | getColorVisual | train | function getColorVisual(seriesModel, visualMapModel, value, valueState) {
var mappings = visualMapModel.targetVisuals[valueState];
var visualTypes = VisualMapping.prepareVisualTypes(mappings);
var resultVisual = {
color: seriesModel.getData().getVisual('color') // default color.
};
for (var... | javascript | {
"resource": ""
} |
q15289 | vuexInit | train | function vuexInit () {
var options = this.$options;
// store injection
if (options.store) {
this.$store = typeof options.store === 'function'
? options.store()
| javascript | {
"resource": ""
} |
q15290 | forEachValue | train | function forEachValue (obj, fn) {
Object.keys(obj).forEach(function | javascript | {
"resource": ""
} |
q15291 | Module | train | function Module (rawModule, runtime) {
this.runtime = runtime;
// Store some children item
this._children = Object.create(null);
// Store the origin module object which passed by programmer
this._rawModule = rawModule;
var rawState = rawModule.state;
| javascript | {
"resource": ""
} |
q15292 | normalizeNamespace | train | function normalizeNamespace (fn) {
return function (namespace, map) {
if (typeof namespace !== 'string') {
map = namespace;
namespace = '';
| javascript | {
"resource": ""
} |
q15293 | getModuleByNamespace | train | function getModuleByNamespace (store, helper, namespace) {
const module = store._modulesNamespaceMap[namespace]
if (process.env.NODE_ENV !== 'production' && !module) { | javascript | {
"resource": ""
} |
q15294 | makeLocalContext | train | function makeLocalContext (store, namespace, path) {
const noNamespace = namespace === ''
const local = {
dispatch: noNamespace ? store.dispatch : (_type, _payload, _options) => {
const args = unifyObjectStyle(_type, _payload, _options)
const { payload, options } = args
let { type } = args
... | javascript | {
"resource": ""
} |
q15295 | migrateExpiration | train | function migrateExpiration (store) {
const request = store.openCursor()
request.onsuccess = (event) => {
const cursor = event.target.result
if (!cursor) {
return
| javascript | {
"resource": ""
} |
q15296 | debounce | train | function debounce (fn) {
let calling = null
let latestArgs = null
return (...args) => {
latestArgs = args
if (!calling) {
calling = Promise.resolve().then(() => {
calling = null
// At this point `args` may be different from the most
// recent state, if multiple calls happened... | javascript | {
"resource": ""
} |
q15297 | validateParams | train | function validateParams (params) {
if (!params) {
throw new Error('Transloadit: The `params` option is required.')
}
if (typeof params === 'string') {
try {
params = JSON.parse(params)
} catch (err) {
// Tell the user that this is not an Uppy bug!
err.message = 'Transloadit: The `pa... | javascript | {
"resource": ""
} |
q15298 | FileIcon | train | function FileIcon () {
return <View style={styles.itemIconContainer}>
| javascript | {
"resource": ""
} |
q15299 | authorized | train | function authorized (req, res) {
const { params, uppy } = req
const providerName = params.providerName
if (!uppy.providerTokens || !uppy.providerTokens[providerName]) {
return res.json({ authenticated: false })
}
const token = uppy.providerTokens[providerName]
uppy.provider.list({ token, uppy }, (err,... | javascript | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.