本文整理汇总了TypeScript中ui/vis.Vis.getCurrentState方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Vis.getCurrentState方法的具体用法?TypeScript Vis.getCurrentState怎么用?TypeScript Vis.getCurrentState使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ui/vis.Vis
的用法示例。
在下文中一共展示了Vis.getCurrentState方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: async
export const buildPipeline = async (
vis: Vis,
params: { searchSource: SearchSource; timeRange?: any }
) => {
const { searchSource } = params;
const { indexPattern } = vis;
const query = searchSource.getField('query');
const filters = searchSource.getField('filter');
const visState = vis.getCurrentState();
const uiState = vis.getUiState();
// context
let pipeline = `kibana | kibana_context `;
if (query) {
pipeline += prepareJson('query', query);
}
if (filters) {
pipeline += prepareJson('filters', filters);
}
if (vis.savedSearchId) {
pipeline += prepareString('savedSearchId', vis.savedSearchId);
}
pipeline += '| ';
// request handler
if (vis.type.requestHandler === 'courier') {
pipeline += `esaggs
${prepareString('index', indexPattern.id)}
metricsAtAllLevels=${vis.isHierarchical()}
partialRows=${vis.type.requiresPartialRows || vis.params.showPartialRows || false}
${prepareJson('aggConfigs', visState.aggs)} | `;
}
const schemas = getSchemas(vis, params.timeRange);
if (buildPipelineVisFunction[vis.type.name]) {
pipeline += buildPipelineVisFunction[vis.type.name](visState, schemas, uiState);
} else if (vislibCharts.includes(vis.type.name)) {
const visConfig = visState.params;
visConfig.dimensions = await buildVislibDimensions(vis, params);
pipeline += `vislib ${prepareJson('visConfig', visState.params)}`;
} else {
pipeline += `visualization type='${vis.type.name}'
${prepareJson('visConfig', visState.params)}
metricsAtAllLevels=${vis.isHierarchical()}
partialRows=${vis.type.requiresPartialRows || vis.params.showPartialRows || false} `;
if (indexPattern) {
pipeline += `${prepareString('index', indexPattern.id)}`;
}
}
return pipeline;
};