本文整理汇总了TypeScript中vega-lite/src/fielddef.isCount函数的典型用法代码示例。如果您正苦于以下问题:TypeScript isCount函数的具体用法?TypeScript isCount怎么用?TypeScript isCount使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了isCount函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1: if
fieldDefs.forEach(function(fieldDef, index){
// save indices for stable sort later
indices[fieldDef.field] = index;
if (fieldDef.selected) { // selected fields are included in selected
selected.push(fieldDef);
if (isDimension(fieldDef) ||
(fieldDef.type === TEMPORAL /* TODO: add && current constraint make it a dimension */)) {
// If the field can serve as dimension
// FIXME vega-lite's isDimension is designed to work with FieldDef, not SchemaField
// Therefore, we should augment vega-lite's isDimension
hasSelectedDimension = true;
} else {
hasSelectedMeasure = true;
}
} else if (fieldDef.selected !== false && !vlFieldDef.isCount(fieldDef)) {
if (vlFieldDef.isDimension(fieldDef) &&
!opt.maxCardinalityForAutoAddOrdinal &&
vlFieldDef.cardinality(fieldDef, stats, 15) > opt.maxCardinalityForAutoAddOrdinal
) {
return;
}
fieldsToAdd.push(fieldDef);
}
});
开发者ID:sguzwf,项目名称:compass,代码行数:27,代码来源:projections.ts
示例2:
['x', 'y'].forEach(function(channel) {
var fieldDef = encoding[channel];
// TODO add a parameter for this case
if (fieldDef && vlFieldDef.isMeasure(fieldDef) && !vlFieldDef.isCount(fieldDef)) {
var stat = stats[fieldDef.field];
if (stat && stat.stdev / stat.mean < 0.01) {
fieldDef.scale = {zero: false};
}
}
});
开发者ID:mchally,项目名称:ExploringDataViz,代码行数:11,代码来源:specs.ts
示例3:
return projection.map(function(fieldDef) {
return vlFieldDef.isCount(fieldDef) ? 'count' : fieldDef.field;
}).join(',');
开发者ID:sguzwf,项目名称:compass,代码行数:3,代码来源:projections.ts
注:本文中的vega-lite/src/fielddef.isCount函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论