github.com/turbot/steampipe@v1.7.0-rc.0.0.20240517123944-7cef272d4458/ui/dashboard/src/components/dashboards/graphs/index.ts (about) 1 import { getComponent } from "../index"; 2 import { IGraph } from "./types"; 3 const Table = getComponent("table"); 4 5 const graphsMap = {}; 6 7 const getGraphComponent = (key: string): IGraph => graphsMap[key]; 8 9 const registerGraphComponent = (key: string, component: IGraph) => { 10 graphsMap[key] = component; 11 }; 12 13 const TableWrapper: IGraph = { 14 type: "table", 15 component: Table, 16 }; 17 18 registerGraphComponent(TableWrapper.type, TableWrapper); 19 20 export { getGraphComponent, registerGraphComponent };