-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cebf8ef
commit aa9e7fc
Showing
3 changed files
with
25 additions
and
3 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
19 changes: 19 additions & 0 deletions
19
src/web/visualizations/components/Grid/adapters/grid_adapter.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,19 @@ | ||
import { QueryResponse } from 'web/visualizations/types/query_response' | ||
import { VisConfig } from 'web/visualizations/types/vis_config' | ||
import { preprocessQueryResponse } from 'web/visualizations/components/Grid/utils/query_utils' | ||
import { gridMapper } from '../mappers/grid_mapper' | ||
import '../styles/grid_themes.scss' | ||
import { GridProps } from '../Grid' | ||
|
||
export const gridAdapter = (config: VisConfig, result: QueryResponse) => { | ||
const processedResult = preprocessQueryResponse(result, config) | ||
if (!processedResult) return {} as GridProps | ||
|
||
const visTriggerCb = () => null | ||
const done = () => null | ||
const gridOptions = gridMapper(processedResult, config, visTriggerCb, done) | ||
|
||
return { | ||
options: gridOptions, | ||
} as GridProps | ||
} |