1"use strict";(self.webpackChunkheadlamp_website=self.webpackChunkheadlamp_website||[]).push([[23009],{2274:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>a,contentTitle:()=>c,default:()=>u,frontMatter:()=>i,metadata:()=>o,toc:()=>l});var r=n(74848),s=n(28453);const i={},c="Function: registerMapSource()",o={id:"latest/development/api/plugin/registry/functions/registerMapSource",title:"Function: registerMapSource()",description:"Defined in828",source:"@site/docs/latest/development/api/plugin/registry/functions/registerMapSource.md",sourceDirName:"latest/development/api/plugin/registry/functions",slug:"/latest/development/api/plugin/registry/functions/registerMapSource",permalink:"/docs/latest/development/api/plugin/registry/functions/registerMapSource",draft:!1,unlisted:!1,editUrl:"https://github.com/kubernetes-sigs/headlamp/edit/main/docs/development/api/plugin/registry/functions/registerMapSource.md",tags:[],version:"current",frontMatter:{},sidebar:"mainSidebar",previous:{title:"Function: registerKubeObjectGlance()",permalink:"/docs/latest/development/api/plugin/registry/functions/registerKubeObjectGlance"},next:{title:"Function: registerOverviewChartsProcessor()",permalink:"/docs/latest/development/api/plugin/registry/functions/registerOverviewChartsProcessor"}},a={},l=[{value:"Parameters",id:"parameters",level:2},{value:"Returns",id:"returns",level:2},{value:"Example",id:"example",level:2}];function d(e){const t={a:"a",code:"code",h1:"h1",h2:"h2",p:"p",pre:"pre",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,s.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(t.h1,{id:"function-registermapsource",children:"Function: registerMapSource()"}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-ts",children:"function registerMapSource(source: GraphSource): void;\n"})}),"\n",(0,r.jsxs)(t.p,{children:["Defined in: ",(0,r.jsx)(t.a,{href:"https://github.com/kubernetes-sigs/headlamp/blob/9cb8e9a311f736f645f4a06f251f59bddca3cf60/frontend/src/plugin/registry.tsx#L828",children:"plugin/registry.tsx:828"})]}),"\n",(0,r.jsx)(t.p,{children:"Registers a new graph source in the store."}),"\n",(0,r.jsx)(t.h2,{id:"parameters",children:"Parameters"}),"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n",(0,r.jsxs)(t.table,{children:[(0,r.jsx)(t.thead,{children:(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.th,{children:"Parameter"}),(0,r.jsx)(t.th,{children:"Type"}),(0,r.jsx)(t.th,{children:"Description"})]})}),(0,r.jsx)(t.tbody,{children:(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:(0,r.jsx)(t.code,{children:"source"})}),(0,r.jsx)(t.td,{children:(0,r.jsx)(t.a,{href:"/docs/latest/development/api/plugin/registry/type-aliases/GraphSource",children:(0,r.jsx)(t.code,{children:"GraphSource"})})}),(0,r.jsx)(t.td,{children:"The graph source to be registered."})]})})]}),"\n",(0,r.jsx)(t.h2,{id:"returns",children:"Returns"}),"\n",(0,r.jsx)(t.p,{children:(0,r.jsx)(t.code,{children:"void"})}),"\n",(0,r.jsx)(t.h2,{id:"example",children:"Example"}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-tsx",children:"const mySource = {\n id: 'my-source',\n label: 'Sample source',\n useData() {\n return {\n nodes: [{ id: 'my-node', type: 'kubeObject', data: { resource: myCustomResource } }],\n edges: []\n };\n }\n}\n\nregisterMapSource(mySource);\n"})})]})}function u(e={}){const{wrapper:t}={...(0,s.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(d,{...e})}):d(e)}},28453:(e,t,n)=>{n.d(t,{R:()=>c,x:()=>o});var r=n(96540);const s={},i=r.createContext(s);function c(e){const t=r.useContext(i);return r.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function o(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:c(e.components),r.createElement(i.Provider,{value:t},e.children)}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.