Skip to content

Commit

Permalink
fixing pipeline_data_loader (#32478) (#32545)
Browse files Browse the repository at this point in the history
  • Loading branch information
ppisljar authored Mar 8, 2019
1 parent 7244125 commit 0e03c36
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export const visualization = () => ({

handlers.onDestroy(() => visualizationLoader.destroy());

await visualizationLoader.render(domNode, handlers.vis, visData, uiState, params).then(() => {
await visualizationLoader.render(domNode, handlers.vis, visData, visConfig || handlers.vis.params, uiState, params).then(() => {
if (handlers.done) handlers.done();
});
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ exports[`visualize loader pipeline helpers: build pipeline buildPipelineVisFunct

exports[`visualize loader pipeline helpers: build pipeline buildPipelineVisFunction handles markdown function 1`] = `"kibana_markdown expression='## hello _markdown_' visConfig='{\\"markdown\\":\\"## hello _markdown_\\",\\"foo\\":\\"bar\\"}' "`;

exports[`visualize loader pipeline helpers: build pipeline buildPipelineVisFunction handles metric function with buckets 1`] = `"kibana_metric visConfig='{\\"dimensions\\":{\\"metrics\\":[0,1],\\"bucket\\":2}}' "`;
exports[`visualize loader pipeline helpers: build pipeline buildPipelineVisFunction handles metric function with buckets 1`] = `"kibana_metric visConfig='{\\"metric\\":{},\\"dimensions\\":{\\"metrics\\":[0,1],\\"bucket\\":2}}' "`;

exports[`visualize loader pipeline helpers: build pipeline buildPipelineVisFunction handles metric function without buckets 1`] = `"kibana_metric visConfig='{\\"dimensions\\":{\\"metrics\\":[0,1]}}' "`;
exports[`visualize loader pipeline helpers: build pipeline buildPipelineVisFunction handles metric function without buckets 1`] = `"kibana_metric visConfig='{\\"metric\\":{},\\"dimensions\\":{\\"metrics\\":[0,1]}}' "`;

exports[`visualize loader pipeline helpers: build pipeline buildPipelineVisFunction handles metrics/tsvb function 1`] = `"tsvb params='{\\"foo\\":\\"bar\\"}' uiState='{}' "`;

Expand All @@ -16,17 +16,17 @@ exports[`visualize loader pipeline helpers: build pipeline buildPipelineVisFunct

exports[`visualize loader pipeline helpers: build pipeline buildPipelineVisFunction handles region_map function without buckets 1`] = `"regionmap visConfig='{\\"metric\\":0}' "`;

exports[`visualize loader pipeline helpers: build pipeline buildPipelineVisFunction handles table function with splits 1`] = `"kibana_table visConfig='{\\"dimensions\\":{\\"metrics\\":[0],\\"buckets\\":[],\\"splitRow\\":[1,2]}}' "`;
exports[`visualize loader pipeline helpers: build pipeline buildPipelineVisFunction handles table function with splits 1`] = `"kibana_table visConfig='{\\"foo\\":\\"bar\\",\\"dimensions\\":{\\"metrics\\":[0],\\"buckets\\":[],\\"splitRow\\":[1,2]}}' "`;

exports[`visualize loader pipeline helpers: build pipeline buildPipelineVisFunction handles table function with splits and buckets 1`] = `"kibana_table visConfig='{\\"dimensions\\":{\\"metrics\\":[0,1],\\"buckets\\":[3],\\"splitRow\\":[2,4]}}' "`;
exports[`visualize loader pipeline helpers: build pipeline buildPipelineVisFunction handles table function with splits and buckets 1`] = `"kibana_table visConfig='{\\"foo\\":\\"bar\\",\\"dimensions\\":{\\"metrics\\":[0,1],\\"buckets\\":[3],\\"splitRow\\":[2,4]}}' "`;

exports[`visualize loader pipeline helpers: build pipeline buildPipelineVisFunction handles table function without splits or buckets 1`] = `"kibana_table visConfig='{\\"dimensions\\":{\\"metrics\\":[0,1],\\"buckets\\":[]}}' "`;
exports[`visualize loader pipeline helpers: build pipeline buildPipelineVisFunction handles table function without splits or buckets 1`] = `"kibana_table visConfig='{\\"foo\\":\\"bar\\",\\"dimensions\\":{\\"metrics\\":[0,1],\\"buckets\\":[]}}' "`;

exports[`visualize loader pipeline helpers: build pipeline buildPipelineVisFunction handles tagcloud function with buckets 1`] = `"tagcloud visConfig='{\\"metric\\":0,\\"bucket\\":1}' "`;

exports[`visualize loader pipeline helpers: build pipeline buildPipelineVisFunction handles tagcloud function without buckets 1`] = `"tagcloud visConfig='{\\"metric\\":0}' "`;

exports[`visualize loader pipeline helpers: build pipeline buildPipelineVisFunction handles tile_map function 1`] = `"tilemap visConfig='{\\"dimensions\\":{\\"metric\\":0,\\"geohash\\":1,\\"geocentroid\\":3}}' "`;
exports[`visualize loader pipeline helpers: build pipeline buildPipelineVisFunction handles tile_map function 1`] = `"tilemap visConfig='{\\"metric\\":{},\\"dimensions\\":{\\"metric\\":0,\\"geohash\\":1,\\"geocentroid\\":3}}' "`;

exports[`visualize loader pipeline helpers: build pipeline buildPipelineVisFunction handles timelion function 1`] = `"timelion_vis expression='foo' interval='bar' "`;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,27 +224,45 @@ export const buildPipelineVisFunction: BuildPipelineVisFunction = {
return `kibana_markdown ${expression}${visConfig}`;
},
table: (visState, schemas) => {
const visConfig = buildVisConfig.table(schemas);
const visConfig = {
...visState.params,
...buildVisConfig.table(schemas),
};
return `kibana_table ${prepareJson('visConfig', visConfig)}`;
},
metric: (visState, schemas) => {
const visConfig = buildVisConfig.metric(schemas);
const visConfig = {
...visState.params,
...buildVisConfig.metric(schemas),
};
return `kibana_metric ${prepareJson('visConfig', visConfig)}`;
},
tagcloud: (visState, schemas) => {
const visConfig = buildVisConfig.tagcloud(schemas);
const visConfig = {
...visState.params,
...buildVisConfig.tagcloud(schemas),
};
return `tagcloud ${prepareJson('visConfig', visConfig)}`;
},
region_map: (visState, schemas) => {
const visConfig = buildVisConfig.region_map(schemas);
const visConfig = {
...visState.params,
...buildVisConfig.region_map(schemas),
};
return `regionmap ${prepareJson('visConfig', visConfig)}`;
},
tile_map: (visState, schemas) => {
const visConfig = buildVisConfig.tile_map(schemas);
const visConfig = {
...visState.params,
...buildVisConfig.tile_map(schemas),
};
return `tilemap ${prepareJson('visConfig', visConfig)}`;
},
pie: (visState, schemas) => {
const visConfig = buildVisConfig.pie(schemas);
const visConfig = {
...visState.params,
...buildVisConfig.pie(schemas),
};
return `kibana_pie ${prepareJson('visConfig', visConfig)}`;
},
};
Expand Down

0 comments on commit 0e03c36

Please sign in to comment.