-
Notifications
You must be signed in to change notification settings - Fork 915
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Description * Adds Bar line and Area charts to Wizard * Adds resizable right nav to Wizard * E2E tests for bar chart and chart switching Issues Resolved: #1616 #1617 #1618 Co-authored-by: Josh Romero <rmerqg@amazon.com> Signed-off-by: Ashwin Pc <ashwinpc@amazon.com>
- Loading branch information
1 parent
3e7e41d
commit 5f7541e
Showing
35 changed files
with
811 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
src/plugins/wizard/public/visualizations/common/expression_helpers.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
import { cloneDeep } from 'lodash'; | ||
import { OpenSearchaggsExpressionFunctionDefinition } from '../../../../data/public'; | ||
import { ExpressionFunctionOpenSearchDashboards } from '../../../../expressions'; | ||
import { buildExpressionFunction } from '../../../../expressions/public'; | ||
import { VisualizationState } from '../../application/utils/state_management'; | ||
import { getAggService, getIndexPatterns } from '../../plugin_services'; | ||
|
||
export const getAggExpressionFunctions = async (visualization: VisualizationState) => { | ||
const { activeVisualization, indexPattern: indexId = '' } = visualization; | ||
const { aggConfigParams } = activeVisualization || {}; | ||
|
||
const indexPatternsService = getIndexPatterns(); | ||
const indexPattern = await indexPatternsService.get(indexId); | ||
// aggConfigParams is the serealizeable aggConfigs that need to be reconstructed here using the agg servce | ||
const aggConfigs = getAggService().createAggConfigs(indexPattern, cloneDeep(aggConfigParams)); | ||
|
||
const opensearchDashboards = buildExpressionFunction<ExpressionFunctionOpenSearchDashboards>( | ||
'opensearchDashboards', | ||
{} | ||
); | ||
|
||
// soon this becomes: const opensearchaggs = vis.data.aggs!.toExpressionAst(); | ||
const opensearchaggs = buildExpressionFunction<OpenSearchaggsExpressionFunctionDefinition>( | ||
'opensearchaggs', | ||
{ | ||
index: indexId, | ||
metricsAtAllLevels: false, | ||
partialRows: false, | ||
aggConfigs: JSON.stringify(aggConfigs.aggs), | ||
includeFormatHints: false, | ||
} | ||
); | ||
|
||
return { | ||
aggConfigs, | ||
expressionFns: [opensearchDashboards, opensearchaggs], | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.