_id stringlengths 2 6 | title stringlengths 0 58 | partition stringclasses 3
values | text stringlengths 27 233k | 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,
| 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();
| javascript | {
"resource": ""
} | |
q15103 | train | function() {
var key,
i;
for (key in this.series) {
for (i = 0; i < this.series[key].length; i++) {
| javascript | {
"resource": ""
} | |
q15104 | train | function(key, marker, seriesData){
var markers = {},
data = [],
values,
i,
seriesData = seriesData || [];
| javascript | {
"resource": ""
} | |
q15105 | train | function(markers, seriesData){
var i;
seriesData = seriesData || [];
this.createMarkers(markers);
| javascript | {
"resource": ""
} | |
q15106 | train | function(markers){
var i;
for (i = 0; i < markers.length; i++) {
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) {
| 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) {
| 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;
}
| javascript | {
"resource": ""
} | |
q15113 | train | function (e) {
if (!this.dragging) {
return;
}
var x = e.pageX || | 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
| 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;
| javascript | {
"resource": ""
} | |
q15119 | train | function () {
var interval = this.result.to - this.result.from;
if (this.old_min_interval === null) {
| 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 | 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) {
| javascript | {
"resource": ""
} | |
q15122 | train | function () {
if (!this.coords.w_rs) {
return;
}
this.labels.p_min = this.labels.w_min / 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;
}
| javascript | {
"resource": ""
} | |
q15128 | train | function (segment, step) {
if (segment % step === 0) {
return segment;
}
if (Math.round((segment % step) / step)) {
return (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];
| 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];
| javascript | {
"resource": ""
} | |
q15133 | train | function (shapetype, shapeargs) {
var id = shapeCount++;
shapeargs.unshift(id);
| javascript | {
"resource": ""
} | |
q15134 | substituteTimeAgo | train | function substituteTimeAgo(string, number, withoutSuffix, isFuture, | javascript | {
"resource": ""
} |
q15135 | finalPropName | train | function finalPropName( name ) {
var ret = jQuery.cssProps[ name ];
if ( !ret ) {
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 - | 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') {
| 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))
| 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', { | javascript | {
"resource": ""
} |
q15142 | createData | train | function createData(id, date, name, shipTo, paymentMethod, | javascript | {
"resource": ""
} |
q15143 | git | train | function git(args) {
return new Promise((resolve, reject) => {
exec(`git ${args}`, (err, stdout) => {
if (err) {
| javascript | {
"resource": ""
} |
q15144 | addPercent | train | function addPercent(change, goodEmoji = '', badEmooji = ':small_red_triangle:') {
const formatted = (change * 100).toFixed(2);
if (/^-|^0(?:\.0+)$/.test(formatted)) {
| 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 ':---:';
| javascript | {
"resource": ""
} |
q15146 | findComponents | train | function findComponents(directory, components = []) {
const items = fs.readdirSync(directory);
items.forEach(item => {
const itemPath = path.resolve(directory, item);
| 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) {
| javascript | {
"resource": ""
} |
q15149 | jssPreset | train | function jssPreset() {
return {
plugins: [
functions(),
global(),
nested(),
camelCase(),
defaultUnit(),
// Disable the vendor prefixer server-side, it | 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;
}
| 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: | javascript | {
"resource": ""
} |
q15153 | getComponentName | train | function getComponentName(destPath) {
const splitregex = new RegExp(`[\\${path.sep}-]+`);
const parts = destPath
.replace('.js', '')
.split(splitregex)
.map(part | javascript | {
"resource": ""
} |
q15154 | CssBaseline | train | function CssBaseline(props) {
const { children = null } = props;
useStyles();
return | javascript | {
"resource": ""
} |
q15155 | mergeOuterLocalTheme | train | function mergeOuterLocalTheme(outerTheme, localTheme) {
if (typeof localTheme === 'function') {
const mergedTheme = localTheme(outerTheme);
warning(
mergedTheme,
| javascript | {
"resource": ""
} |
q15156 | getScrollParent | train | function getScrollParent(parent, child) {
let element = child;
let scrollTop = 0;
while (element && element !== parent) {
| javascript | {
"resource": ""
} |
q15157 | emptyDir | train | function emptyDir(dir) {
return new Promise((resolve, reject) => | 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;
| 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]; | javascript | {
"resource": ""
} | |
q15161 | train | function (node) {
var parent = node.parentNode;
while (parent) {
if (parent === this) {
return true;
}
| 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 | javascript | {
"resource": ""
} | |
q15163 | addChild | train | function addChild(child, node) {
var children = node.children;
if (child.parentNode === node) {
return;
} | javascript | {
"resource": ""
} |
q15164 | ExtensionAPI | train | function ExtensionAPI(chartInstance) {
zrUtil.each(echartsAPIList, function (name) {
| 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 | 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] = | 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 | javascript | {
"resource": ""
} |
q15172 | getLineWidth | train | function getLineWidth(itemModel, rawLayout) {
var lineWidth = itemModel.get(BAR_BORDER_WIDTH_QUERY) | 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
}
| javascript | {
"resource": ""
} |
q15176 | ifMarkLineHasOnlyDim | train | function ifMarkLineHasOnlyDim(dimIndex, fromCoord, toCoord, coordSys) {
var otherDimIndex = 1 - dimIndex;
return | javascript | {
"resource": ""
} |
q15177 | train | function (dataIndex) {
var params = SeriesModel.prototype.getDataParams.apply(this, arguments);
var node = this.getData().tree.getNodeByDataIndex(dataIndex);
| 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);
| javascript | {
"resource": ""
} |
q15179 | ifMarkLineHasOnlyDim | train | function ifMarkLineHasOnlyDim(dimIndex, fromCoord, toCoord, coordSys) {
var otherDimIndex = 1 - dimIndex;
var dimName = coordSys.dimensions[dimIndex];
| 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;
// | javascript | {
"resource": ""
} |
q15186 | train | function (coord) {
var regions = this.regions;
for (var i = 0; i < regions.length; i++) {
if (regions[i].contain(coord)) {
| 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]);
| javascript | {
"resource": ""
} | |
q15190 | train | function (data, clamp) {
var extent = this._extent;
var scale = this.scale;
data = scale.normalize(data);
if (this.onBand && scale.type | 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());
| 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 | 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'),
| javascript | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.