_id
stringlengths
2
6
title
stringlengths
0
58
partition
stringclasses
3 values
text
stringlengths
52
373k
language
stringclasses
1 value
meta_information
dict
q15100
train
function(val) { return new Color( val ? val : null, this.options.colorSelectors, this.options.fallbackColor ? this.options.fallbackColor : this.color, this.options.fallbackFormat, this.options.hexNumberSignPrefix ); }
javascript
{ "resource": "" }
q15101
train
function (el, x, y) { var currentRegion = this.currentRegion, highlightEnabled = !this.options.get('disableHighlight'), newRegion; if (x > this.canvasWidth || y > this.canvasHeight || x < 0 || y < 0) { return null; } newRegi...
javascript
{ "resource": "" }
q15102
train
function(){ this.width = this.container.width(); this.height = this.container.height(); this.resize(); this.canvas.setSize(this.width, this.height); this.applyTransform(); }
javascript
{ "resource": "" }
q15103
train
function() { var key, i; for (key in this.series) { for (i = 0; i < this.series[key].length; i++) { this.series[key][i].clear(); } } this.scale = this.baseScale; this.transX = this.baseTransX; this.transY = this.baseTransY; this.applyTransform(); }
javascript
{ "resource": "" }
q15104
train
function(key, marker, seriesData){ var markers = {}, data = [], values, i, seriesData = seriesData || []; markers[key] = marker; for (i = 0; i < seriesData.length; i++) { values = {}; values[key] = seriesData[i]; data.push(values); } this.addMarker...
javascript
{ "resource": "" }
q15105
train
function(markers, seriesData){ var i; seriesData = seriesData || []; this.createMarkers(markers); for (i = 0; i < seriesData.length; i++) { this.series.markers[i].setValues(seriesData[i] || {}); }; }
javascript
{ "resource": "" }
q15106
train
function(markers){ var i; for (i = 0; i < markers.length; i++) { this.markers[ markers[i] ].element.remove(); delete this.markers[ markers[i] ]; }; }
javascript
{ "resource": "" }
q15107
train
function(lat, lng) { var point, proj = jvm.WorldMap.maps[this.params.map].projection, centralMeridian = proj.centralMeridian, width = this.width - this.baseTransX * 2 * this.baseScale, height = this.height - this.baseTransY * 2 * this.baseScale, inset, bbox, s...
javascript
{ "resource": "" }
q15108
train
function(x, y) { var proj = jvm.WorldMap.maps[this.params.map].projection, centralMeridian = proj.centralMeridian, insets = jvm.WorldMap.maps[this.params.map].insets, i, inset, bbox, nx, ny; for (i = 0; i < insets.length; i++) { inset = insets[i]; ...
javascript
{ "resource": "" }
q15109
train
function (chrs, buffer, pos, strict, opts) { var isValid = opts.regex.val1.test(chrs); if (!strict && !isValid) { if (chrs.charAt(1) == opts.separator || "-./".indexOf(chrs.charAt(1)) != -1) { isValid = opts.rege...
javascript
{ "resource": "" }
q15110
train
function (is_update) { this.no_diapason = false; this.coords.p_step = this.convertToPercent(this.options.step, true); this.target = "base"; this.toggleInput(); this.append(); this.setMinMax(); if (is_update) { this.fo...
javascript
{ "resource": "" }
q15111
train
function () { var min = this.options.min, max = this.options.max, from = this.options.from, to = this.options.to; if (from > min && to === max) { this.$cache.s_from.addClass("type_last"); } else if (to < max) { ...
javascript
{ "resource": "" }
q15112
train
function (e) { if (!this.target) { var x; var $handle; if (this.options.type === "single") { $handle = this.$cache.single; } else { $handle = this.$cache.from; } x = $han...
javascript
{ "resource": "" }
q15113
train
function (e) { if (!this.dragging) { return; } var x = e.pageX || e.originalEvent.touches && e.originalEvent.touches[0].pageX; this.coords.x_pointer = x - this.coords.x_gap; this.calc(); }
javascript
{ "resource": "" }
q15114
train
function (e) { if (this.current_plugin !== this.plugin_count) { return; } if (this.is_active) { this.is_active = false; } else { return; } this.$cache.cont.find(".state_hover").removeClass("state_ho...
javascript
{ "resource": "" }
q15115
train
function (target, e) { e.preventDefault(); var x = e.pageX || e.originalEvent.touches && e.originalEvent.touches[0].pageX; if (e.button === 2) { return; } if (target === "both") { this.setTempMinInterval(); } ...
javascript
{ "resource": "" }
q15116
train
function (target, e) { e.preventDefault(); var x = e.pageX || e.originalEvent.touches && e.originalEvent.touches[0].pageX; if (e.button === 2) { return; } this.current_plugin = this.plugin_count; this.target = target; ...
javascript
{ "resource": "" }
q15117
train
function (target, e) { if (this.current_plugin !== this.plugin_count || e.altKey || e.ctrlKey || e.shiftKey || e.metaKey) { return; } switch (e.which) { case 83: // W case 65: // A case 40: // DOWN case ...
javascript
{ "resource": "" }
q15118
train
function (right) { var p = this.coords.p_pointer; var p_step = (this.options.max - this.options.min) / 100; p_step = this.options.step / p_step; if (right) { p += p_step; } else { p -= p_step; } this.co...
javascript
{ "resource": "" }
q15119
train
function () { var interval = this.result.to - this.result.from; if (this.old_min_interval === null) { this.old_min_interval = this.options.min_interval; } this.options.min_interval = interval; }
javascript
{ "resource": "" }
q15120
train
function () { if (!this.coords.w_rs) { this.coords.p_pointer = 0; return; } if (this.coords.x_pointer < 0 || isNaN(this.coords.x_pointer) ) { this.coords.x_pointer = 0; } else if (this.coords.x_pointer > this.coords.w_rs) ...
javascript
{ "resource": "" }
q15121
train
function (real_x) { if (this.options.type === "single") { return "single"; } else { var m_point = this.coords.p_from_real + ((this.coords.p_to_real - this.coords.p_from_real) / 2); if (real_x >= m_point) { return this.options.to...
javascript
{ "resource": "" }
q15122
train
function () { if (!this.coords.w_rs) { return; } this.labels.p_min = this.labels.w_min / this.coords.w_rs * 100; this.labels.p_max = this.labels.w_max / this.coords.w_rs * 100; }
javascript
{ "resource": "" }
q15123
train
function () { if (!this.coords.w_rs || this.options.hide_from_to) { return; } if (this.options.type === "single") { this.labels.w_single = this.$cache.single.outerWidth(false); this.labels.p_single_fake = this.labels.w_single / this.c...
javascript
{ "resource": "" }
q15124
train
function () { if (this.options.type === "single") { if (this.options.values.length) { this.$cache.input.prop("value", this.result.from_value); } else { this.$cache.input.prop("value", this.result.from); } ...
javascript
{ "resource": "" }
q15125
train
function (value, no_min) { var diapason = this.options.max - this.options.min, one_percent = diapason / 100, val, percent; if (!diapason) { this.no_diapason = true; return 0; } if (no_min) { ...
javascript
{ "resource": "" }
q15126
train
function (percent) { var min = this.options.min, max = this.options.max, min_decimals = min.toString().split(".")[1], max_decimals = max.toString().split(".")[1], min_length, max_length, avg_decimals = 0, abs = 0...
javascript
{ "resource": "" }
q15127
train
function (percent) { var rounded = Math.round(percent / this.coords.p_step) * this.coords.p_step; if (rounded > 100) { rounded = 100; } if (percent === 100) { rounded = 100; } return this.toFixed(rounded); ...
javascript
{ "resource": "" }
q15128
train
function (segment, step) { if (segment % step === 0) { return segment; } if (Math.round((segment % step) / step)) { return (segment + (step - segment % step)) % 60; } else { return segment - segment % step; } }
javascript
{ "resource": "" }
q15129
train
function() { if (this.isInline) { return; } var widgetWidth = this.$widget.outerWidth(), widgetHeight = this.$widget.outerHeight(), visualPadding = 10, windowWidth = $(window).width(), windowHeight = $(window).height(), scrollTop = $(window).scrollTop(); var zIndex = parseInt(th...
javascript
{ "resource": "" }
q15130
train
function(element,dimension) { if (element['offset'+dimension]) { return element['offset'+dimension]; } else { return document.defaultView.getComputedStyle(element).getPropertyValue(dimension); } }
javascript
{ "resource": "" }
q15131
train
function(){ // First we need the width of the yLabels, assuming the xLabels aren't rotated // To do that we need the base line at the top and base of the chart, assuming there is no x label rotation this.startPoint = (this.display) ? this.fontSize : 0; this.endPoint = (this.display) ? this.height - (this.f...
javascript
{ "resource": "" }
q15132
train
function (width, height, canvas) { // XXX This should probably be a configurable option var match; match = this._pxregex.exec(height); if (match) { this.pixelHeight = match[1]; } else { this.pixelHeight = $(canvas).height(); ...
javascript
{ "resource": "" }
q15133
train
function (shapetype, shapeargs) { var id = shapeCount++; shapeargs.unshift(id); return new VShape(this, id, shapetype, shapeargs); }
javascript
{ "resource": "" }
q15134
substituteTimeAgo
train
function substituteTimeAgo(string, number, withoutSuffix, isFuture, locale) { return locale.relativeTime(number || 1, !!withoutSuffix, string, isFuture); }
javascript
{ "resource": "" }
q15135
finalPropName
train
function finalPropName( name ) { var ret = jQuery.cssProps[ name ]; if ( !ret ) { ret = jQuery.cssProps[ name ] = vendorPropName( name ) || name; } return ret; }
javascript
{ "resource": "" }
q15136
init
train
function init (doc) { if (status === 'ready') return const taroStyle = doc.createElement('style') taroStyle.textContent = '@font-face{font-weight:normal;font-style:normal;font-family:"taro";src:url("data:application/x-font-ttf;charset=utf-8;base64, AAEAAAALAIAAAwAwR1NVQrD+s+0AAAE4AAAAQk9TLzJWs0t/AAABfAAAAFZjbWFw...
javascript
{ "resource": "" }
q15137
listCacheDelete
train
function listCacheDelete(key) { var data = this.__data__, index = assocIndexOf(data, key) if (index < 0) { return false } var lastIndex = data.length - 1 if (index == lastIndex) { data.pop() } else { splice.call(data, index, 1) } return true }
javascript
{ "resource": "" }
q15138
getWebpackSizes
train
async function getWebpackSizes() { await fse.mkdirp(path.join(__dirname, 'build')); const configPath = path.join(__dirname, 'webpack.config.js'); const statsPath = path.join(__dirname, 'build', 'stats.json'); await exec(`webpack --config ${configPath} --json > ${statsPath}`); const stats = await fse.readJSO...
javascript
{ "resource": "" }
q15139
Hidden
train
function Hidden(props) { const { implementation, ...other } = props; if (implementation === 'js') { return <HiddenJs {...other} />; } return <HiddenCss {...other} />; }
javascript
{ "resource": "" }
q15140
transformSVGIconImports
train
function transformSVGIconImports(j, root) { const pathMatchRegex = /^material-ui\/svg-icons\/.+\/(.+)$/; root .find(j.Literal) .filter(path => pathMatchRegex.test(path.node.value)) .forEach(path => { const [, iconName] = path.node.value.match(pathMatchRegex); // update to new path pat...
javascript
{ "resource": "" }
q15141
run
train
async function run() { console.log(`\u{1f52c} Searching for modules inside "${chalk.dim(SRC_DIR)}".`); const files = glob.sync('!(index)*.js', { cwd: SRC_DIR }); const typings = files.map(file => createIconTyping(file)); await Promise.all([...typings, createIndexTyping(files)]); console.log(`\u{1F5C4} Writt...
javascript
{ "resource": "" }
q15142
createData
train
function createData(id, date, name, shipTo, paymentMethod, amount) { return { id, date, name, shipTo, paymentMethod, amount }; }
javascript
{ "resource": "" }
q15143
git
train
function git(args) { return new Promise((resolve, reject) => { exec(`git ${args}`, (err, stdout) => { if (err) { reject(err); } else { resolve(stdout.trim()); } }); }); }
javascript
{ "resource": "" }
q15144
addPercent
train
function addPercent(change, goodEmoji = '', badEmooji = ':small_red_triangle:') { const formatted = (change * 100).toFixed(2); if (/^-|^0(?:\.0+)$/.test(formatted)) { return `${formatted}% ${goodEmoji}`; } return `+${formatted}% ${badEmooji}`; }
javascript
{ "resource": "" }
q15145
generateMDTable
train
function generateMDTable(headers, body) { const headerRow = headers.map(header => header.label); const alignmentRow = headers.map(header => { if (header.align === 'right') { return ' ---:'; } if (header.align === 'center') { return ':---:'; } return ' --- '; }); return [headerRo...
javascript
{ "resource": "" }
q15146
findComponents
train
function findComponents(directory, components = []) { const items = fs.readdirSync(directory); items.forEach(item => { const itemPath = path.resolve(directory, item); if (fs.statSync(itemPath).isDirectory()) { findComponents(itemPath, components); return; } if (!componentRegex.test(it...
javascript
{ "resource": "" }
q15147
findPages
train
function findPages( options = {}, directory = path.resolve(__dirname, '../../../../pages'), pages = [], ) { fs.readdirSync(directory).forEach(item => { const itemPath = path.resolve(directory, item); const pathname = itemPath .replace(new RegExp(`\\${path.sep}`, 'g'), '/') .replace(/^.*\/pag...
javascript
{ "resource": "" }
q15148
valueReducer
train
function valueReducer(rawValue, props, event) { const { disabled, max, min, step } = props; function roundToStep(number) { return Math.round(number / step) * step; } if (!disabled && step) { if (rawValue > min && rawValue < max) { if (rawValue === max - step) { // If moving the Slider us...
javascript
{ "resource": "" }
q15149
jssPreset
train
function jssPreset() { return { plugins: [ functions(), global(), nested(), camelCase(), defaultUnit(), // Disable the vendor prefixer server-side, it does nothing. // This way, we can get a performance boost. // In the documentation, we are using `autoprefixer` to ...
javascript
{ "resource": "" }
q15150
ClickAwayListener
train
function ClickAwayListener(props) { const { children, mouseEvent = 'onMouseUp', touchEvent = 'onTouchEnd', onClickAway } = props; const mountedRef = useMountedRef(); const movedRef = React.useRef(false); const nodeRef = React.useRef(null); // can be removed once we drop support for non ref forwarding class c...
javascript
{ "resource": "" }
q15151
sortFactory
train
function sortFactory(key) { return function sortNumeric(a, b) { if (b[key] < a[key]) { return -1; } if (b[key] > a[key]) { return 1; } return 0; }; }
javascript
{ "resource": "" }
q15152
EmotionCSS
train
function EmotionCSS() { return ( <div> <Button>Material-UI</Button> <Button css={css` background: linear-gradient(45deg, #fe6b8b 30%, #ff8e53 90%); border-radius: 3px; border: 0; color: white; height: 48px; padding: 0 30px; ...
javascript
{ "resource": "" }
q15153
getComponentName
train
function getComponentName(destPath) { const splitregex = new RegExp(`[\\${path.sep}-]+`); const parts = destPath .replace('.js', '') .split(splitregex) .map(part => part.charAt(0).toUpperCase() + part.substring(1)); return parts.join(''); }
javascript
{ "resource": "" }
q15154
CssBaseline
train
function CssBaseline(props) { const { children = null } = props; useStyles(); return <React.Fragment>{children}</React.Fragment>; }
javascript
{ "resource": "" }
q15155
mergeOuterLocalTheme
train
function mergeOuterLocalTheme(outerTheme, localTheme) { if (typeof localTheme === 'function') { const mergedTheme = localTheme(outerTheme); warning( mergedTheme, [ 'Material-UI: you should return an object from your theme function, i.e.', '<ThemeProvider theme={() => ({})} />', ...
javascript
{ "resource": "" }
q15156
getScrollParent
train
function getScrollParent(parent, child) { let element = child; let scrollTop = 0; while (element && element !== parent) { element = element.parentNode; scrollTop += element.scrollTop; } return scrollTop; }
javascript
{ "resource": "" }
q15157
emptyDir
train
function emptyDir(dir) { return new Promise((resolve, reject) => { FS.emptyDir(dir, err => { err ? reject(err) : resolve(dir); }) }); }
javascript
{ "resource": "" }
q15158
train
function (approxTickNum) { approxTickNum = approxTickNum || 10; var extent = this._extent; var span = extent[1] - extent[0]; if (span === Infinity || span <= 0) { return; } var interval = numberUtil.quantity(span); var err = approxTickNum / span * int...
javascript
{ "resource": "" }
q15159
train
function (opt) { intervalScaleProto.niceExtent.call(this, opt); var originalScale = this._originalScale; originalScale.__fixMin = opt.fixMin; originalScale.__fixMax = opt.fixMax; }
javascript
{ "resource": "" }
q15160
train
function (depth) { var height = 0; this.depth = depth; for (var i = 0; i < this.children.length; i++) { var child = this.children[i]; child.updateDepthAndHeight(depth + 1); if (child.height > height) { height = child.height; } ...
javascript
{ "resource": "" }
q15161
train
function (node) { var parent = node.parentNode; while (parent) { if (parent === this) { return true; } parent = parent.parentNode; } return false; }
javascript
{ "resource": "" }
q15162
train
function () { var data = this.data; var nodes = this._nodes; for (var i = 0, len = nodes.length; i < len; i++) { nodes[i].dataIndex = -1; } for (var i = 0, len = data.count(); i < len; i++) { nodes[data.getRawIndex(i)].dataIndex = i; } }
javascript
{ "resource": "" }
q15163
addChild
train
function addChild(child, node) { var children = node.children; if (child.parentNode === node) { return; } children.push(child); child.parentNode = node; }
javascript
{ "resource": "" }
q15164
ExtensionAPI
train
function ExtensionAPI(chartInstance) { zrUtil.each(echartsAPIList, function (name) { this[name] = zrUtil.bind(chartInstance[name], chartInstance); }, this); }
javascript
{ "resource": "" }
q15165
groupSeriesByAxis
train
function groupSeriesByAxis(ecModel) { var result = []; var axisList = []; ecModel.eachSeriesByType('boxplot', function (seriesModel) { var baseAxis = seriesModel.getBaseAxis(); var idx = zrUtil.indexOf(axisList, baseAxis); if (idx < 0) { idx = axisList.length; ...
javascript
{ "resource": "" }
q15166
calculateBase
train
function calculateBase(groupItem) { var extent; var baseAxis = groupItem.axis; var seriesModels = groupItem.seriesModels; var seriesCount = seriesModels.length; var boxWidthList = groupItem.boxWidthList = []; var boxOffsetList = groupItem.boxOffsetList = []; var boundList = []; var ban...
javascript
{ "resource": "" }
q15167
layoutSingleSeries
train
function layoutSingleSeries(seriesModel, offset, boxWidth) { var coordSys = seriesModel.coordinateSystem; var data = seriesModel.getData(); var halfWidth = boxWidth / 2; var cDimIdx = seriesModel.get('layout') === 'horizontal' ? 0 : 1; var vDimIdx = 1 - cDimIdx; var coordDims = ['x', 'y']; v...
javascript
{ "resource": "" }
q15168
confineInContainer
train
function confineInContainer(position, width, height, api) { var viewWidth = api.getWidth(); var viewHeight = api.getHeight(); position[0] = Math.min(position[0] + width, viewWidth) - width; position[1] = Math.min(position[1] + height, viewHeight) - height; position[0] = Math.max(position[0], 0); ...
javascript
{ "resource": "" }
q15169
markerTypeCalculatorWithExtent
train
function markerTypeCalculatorWithExtent( mlType, data, otherDataDim, targetDataDim, otherCoordIndex, targetCoordIndex ) { var coordArr = []; var stacked = isDimensionStacked(data, targetDataDim /*, otherDataDim*/); var calcDataDim = stacked ? data.getCalculationInfo('stackResultDimension') ...
javascript
{ "resource": "" }
q15170
train
function (option, ecModel) { var layoutMode = this.layoutMode; var inputPositionParams = layoutMode ? getLayoutParams(option) : {}; // Backward compat: using subType on theme. // But if name duplicate between series subType // (for example: parallel) add component ma...
javascript
{ "resource": "" }
q15171
autoSeriesName
train
function autoSeriesName(seriesModel) { // User specified name has higher priority, otherwise it may cause // series can not be queried unexpectedly. var name = seriesModel.name; if (!modelUtil.isNameSpecified(seriesModel)) { seriesModel.name = getSeriesAutoName(seriesModel) || name; } }
javascript
{ "resource": "" }
q15172
getLineWidth
train
function getLineWidth(itemModel, rawLayout) { var lineWidth = itemModel.get(BAR_BORDER_WIDTH_QUERY) || 0; return Math.min(lineWidth, Math.abs(rawLayout.width), Math.abs(rawLayout.height)); }
javascript
{ "resource": "" }
q15173
resizeGeo
train
function resizeGeo(geoModel, api) { var boundingCoords = geoModel.get('boundingCoords'); if (boundingCoords != null) { var leftTop = boundingCoords[0]; var rightBottom = boundingCoords[1]; if (isNaN(leftTop[0]) || isNaN(leftTop[1]) || isNaN(rightBottom[0]) || isNaN(rightBottom[1])) { ...
javascript
{ "resource": "" }
q15174
train
function (originRegionArr, mapName, nameMap) { // Not use the original var regionsArr = (originRegionArr || []).slice(); var dataNameMap = zrUtil.createHashMap(); for (var i = 0; i < regionsArr.length; i++) { dataNameMap.set(regionsArr[i].name, regionsArr[i]); } ...
javascript
{ "resource": "" }
q15175
createGridClipShape
train
function createGridClipShape(rect, seriesModel, cb) { var rectEl = new graphic.Rect({ shape: { x: rect.x - 10, y: rect.y - 10, width: 0, height: rect.height + 20 } }); graphic.initProps(rectEl, { shape: { width: rect.width +...
javascript
{ "resource": "" }
q15176
ifMarkLineHasOnlyDim
train
function ifMarkLineHasOnlyDim(dimIndex, fromCoord, toCoord, coordSys) { var otherDimIndex = 1 - dimIndex; return isInifinity(fromCoord[otherDimIndex]) && isInifinity(toCoord[otherDimIndex]); }
javascript
{ "resource": "" }
q15177
train
function (dataIndex) { var params = SeriesModel.prototype.getDataParams.apply(this, arguments); var node = this.getData().tree.getNodeByDataIndex(dataIndex); params.treePathInfo = wrapTreePathInfo(node, this); return params; }
javascript
{ "resource": "" }
q15178
setDefault
train
function setDefault(levels, ecModel) { var globalColorList = ecModel.get('color'); if (!globalColorList) { return; } levels = levels || []; var hasColorDefine; zrUtil.each(levels, function (levelDefine) { var model = new Model(levelDefine); var modelColor = model.get('c...
javascript
{ "resource": "" }
q15179
ifMarkLineHasOnlyDim
train
function ifMarkLineHasOnlyDim(dimIndex, fromCoord, toCoord, coordSys) { var otherDimIndex = 1 - dimIndex; var dimName = coordSys.dimensions[dimIndex]; return isInifinity(fromCoord[otherDimIndex]) && isInifinity(toCoord[otherDimIndex]) && fromCoord[dimIndex] === toCoord[dimIndex] && coordSys.getAxis(...
javascript
{ "resource": "" }
q15180
train
function (markLineModel, ecModel, api) { ecModel.eachSeries(function (seriesModel) { var mlModel = seriesModel.markLineModel; if (mlModel) { var mlData = mlModel.getData(); var fromData = mlModel.__from; var toData = mlModel.__to; ...
javascript
{ "resource": "" }
q15181
symbolPathSetColor
train
function symbolPathSetColor(color, innerColor) { if (this.type !== 'image') { var symbolStyle = this.style; var symbolShape = this.shape; if (symbolShape && symbolShape.symbolType === 'line') { symbolStyle.stroke = color; } else if (this.__isEmptyBrush) { ...
javascript
{ "resource": "" }
q15182
parse
train
function parse(raw) { var output = ''; var ast = esprima.parse(raw, { range: true, raw: true }); var defines = ast.body.filter(isDefine); if (defines.length > 1) { throw new Error('Each file can have only a single define call. Found "' + defines.length + '"'); } els...
javascript
{ "resource": "" }
q15183
train
function () { var thisOption = this.option; return zrUtil.bind( thisOption.mappingMethod === 'category' ? function (value, isNormalized) { !isNormalized && (value = this._normalizeData(value)); return doMapCateg...
javascript
{ "resource": "" }
q15184
train
function (brushOptionList) { if (__DEV__) { zrUtil.assert(this._mounted); } brushOptionList = zrUtil.map(brushOptionList, function (brushOption) { return zrUtil.merge(zrUtil.clone(DEFAULT_BRUSH_OPT), brushOption, true); }); var tmpIdPrefix = '\0-brush-in...
javascript
{ "resource": "" }
q15185
getPanelByCover
train
function getPanelByCover(controller, cover) { var panels = controller._panels; if (!panels) { return true; // Global panel } var panelId = cover.__brushOption.panelId; // User may give cover without coord sys info, // which is then treated as global panel. return panelId != null ? pa...
javascript
{ "resource": "" }
q15186
train
function (coord) { var regions = this.regions; for (var i = 0; i < regions.length; i++) { if (regions[i].contain(coord)) { return true; } } return false; }
javascript
{ "resource": "" }
q15187
prepareAnimationWhenNoOld
train
function prepareAnimationWhenNoOld(lasts, element, storageName) { var lastCfg = lasts[thisRawIndex] = {}; var parentNode = thisNode.parentNode; if (parentNode && (!reRoot || reRoot.direction === 'drillDown')) { var parentOldX = 0; var parentOldY = 0; // New ...
javascript
{ "resource": "" }
q15188
train
function (dim, scale, extent) { /** * Axis dimension. Such as 'x', 'y', 'z', 'angle', 'radius'. * @type {string} */ this.dim = dim; /** * Axis scale * @type {module:echarts/coord/scale/*} */ this.scale = scale; /** * @type {Array.<number>} * @private *...
javascript
{ "resource": "" }
q15189
train
function (coord) { var extent = this._extent; var min = Math.min(extent[0], extent[1]); var max = Math.max(extent[0], extent[1]); return coord >= min && coord <= max; }
javascript
{ "resource": "" }
q15190
train
function (data, clamp) { var extent = this._extent; var scale = this.scale; data = scale.normalize(data); if (this.onBand && scale.type === 'ordinal') { extent = extent.slice(); fixExtentWithBands(extent, scale.count()); } return linearMap(data, ...
javascript
{ "resource": "" }
q15191
train
function (coord, clamp) { var extent = this._extent; var scale = this.scale; if (this.onBand && scale.type === 'ordinal') { extent = extent.slice(); fixExtentWithBands(extent, scale.count()); } var t = linearMap(coord, extent, NORMALIZED_EXTENT, clamp); ...
javascript
{ "resource": "" }
q15192
train
function () { var axisExtent = this._extent; var dataExtent = this.scale.getExtent(); var len = dataExtent[1] - dataExtent[0] + (this.onBand ? 1 : 0); // Fix #2728, avoid NaN when only one data. len === 0 && (len = 1); var size = Math.abs(axisExtent[1] - axisExtent[0]);...
javascript
{ "resource": "" }
q15193
mergeControllerParams
train
function mergeControllerParams(dataZoomInfos) { var controlType; // DO NOT use reserved word (true, false, undefined) as key literally. Even if encapsulated // as string, it is probably revert to reserved word by compress tool. See #7411. var prefix = 'type_'; var typePriority = { 'type_true...
javascript
{ "resource": "" }
q15194
train
function () { var axis = this; var labelModel = axis.getLabelModel(); var ordinalScale = axis.scale; var ordinalExtent = ordinalScale.getExtent(); // Providing this method is for optimization: // avoid generating a long array by `getTicks` // in large category da...
javascript
{ "resource": "" }
q15195
create
train
function create(ecModel, api) { var singles = []; ecModel.eachComponent('singleAxis', function (axisModel, idx) { var single = new Single(axisModel, ecModel, api); single.name = 'single_' + idx; single.resize(axisModel, api); axisModel.coordinateSystem = single; singles...
javascript
{ "resource": "" }
q15196
Single
train
function Single(axisModel, ecModel, api) { /** * @type {string} * @readOnly */ this.dimension = 'single'; /** * Add it just for draw tooltip. * * @type {Array.<string>} * @readOnly */ this.dimensions = ['single']; /** * @private * @type {module:ec...
javascript
{ "resource": "" }
q15197
train
function (axisModel, ecModel, api) { var dim = this.dimension; var axis = new SingleAxis( dim, axisHelper.createScaleByModel(axisModel), [0, 0], axisModel.get('type'), axisModel.get('position') ); var isCategory = axis.type =...
javascript
{ "resource": "" }
q15198
train
function (ecModel, api) { ecModel.eachSeries(function (seriesModel) { if (seriesModel.coordinateSystem === this) { var data = seriesModel.getData(); each(data.mapDimension(this.dimension, true), function (dim) { this._axis.scale.unionExtentFromData...
javascript
{ "resource": "" }
q15199
train
function (axisModel, api) { this._rect = getLayoutRect( { left: axisModel.get('left'), top: axisModel.get('top'), right: axisModel.get('right'), bottom: axisModel.get('bottom'), width: axisModel.get('width'), ...
javascript
{ "resource": "" }