If you have a data member in your class, you can decorate it with @Show and it will be visible in the playground!For example, check out the code for Average Stock Price, and you will see that
we have decorated averagePrice with @Show. That’s why it shows up here:
You can decorate as many data members you want, event private ones!
Well, yes! That’s why we have @Table, which you can decorate your class with. Simply provide the “columns” you want to show and you get a nice looking view!For example:
When you assign a view to a class, the runtime collapses its corresponding node.All the methods are hidden, and all the edges going to those methods
now go to the parent class node. Giving the view a clean look.Mind you, simply decorating a member with @Show won’t cause this. You have to assign a view to the class.
{"docsConfig":{"$schema":"https://mintlify.com/docs.json","theme":"mint","name":"metz.sh docs","colors":{"primary":"#3f66ff","light":"#3f66ff","dark":"#3f66ff"},"favicon":"/favicon.png","logo":{"light":"https://mintcdn.com/metzsh/fELY9edQkrehV0tS/logo/logo.png?fit=max\u0026auto=format\u0026n=fELY9edQkrehV0tS\u0026q=85\u0026s=9fcc8aa216415c9388fe9c12559a1252","dark":"https://mintcdn.com/metzsh/fELY9edQkrehV0tS/logo/logo.png?fit=max\u0026auto=format\u0026n=fELY9edQkrehV0tS\u0026q=85\u0026s=9fcc8aa216415c9388fe9c12559a1252"},"appearance":{"default":"dark","strict":true},"navbar":{"primary":{"type":"button","label":"Home","href":"https://metz.sh"}},"footer":{"socials":{"linkedin":"https://www.linkedin.com/company/metz-sh/"}},"navigation":{"global":{"anchors":[{"anchor":"Github","href":"https://github.com/metz-sh/simulacrum","icon":"github"},{"anchor":"Try in Playground","href":"https://try.metz.sh","icon":"code"},{"anchor":"Join our Slack","href":"https://metzcommunity.slack.com/join/shared_invite/zt-1xr4ooes0-AhIP47ENEqrKmnfpCw6e8Q#/shared-invite/email","icon":"slack"}]},"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"metzsh","hasAudioNarration":false,"actualSubdomain":"metzsh","customDomains":["docs.metz.sh"],"gitSource":{"type":"github","owner":"metz-sh","repo":"docs","deployBranch":"main","contentDirectory":"","isPrivate":false,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6a20c455cd12361a7c9513cc","collectionId":"097e8bbe-f031-4375-8729-7df2bf0c215f","schemaVersion":"v2"},"entitlements":{},"buildId":"6a20c455cd12361a7c9513cc:success","clientVersion":"0.0.4044","searchFilterCounts":[{"language":"default","tag":"Documentation","count":16},{"language":"default","tag":"Get Started","count":4},{"language":"default","tag":"Async Operations","count":3},{"language":"default","tag":"Visual Storytelling","count":3},{"language":"default","tag":"Utils","count":3},{"language":"default","tag":"Dependencies \u0026 Scope","count":2},{"language":"default","tag":"Internals","count":1}]},"assistantConfig":{},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"byok-sep-25","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-updated-9-15","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[],"page":{"pagePath":"data-and-views","slug":"/data-and-views","pageMetadata":{"title":"Data \u0026 Views","description":null,"href":"/data-and-views"},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,p:`p`,pre:`pre`,span:`span`,..._provideComponents(),...props.components},{CodeBlock,Frame,Heading,OptimizedFrame,OptimizedImage,Tab,Tabs,Tip,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Frame)_missingMdxReference(`Frame`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!OptimizedFrame)_missingMdxReference(`OptimizedFrame`,true);if(!OptimizedImage)_missingMdxReference(`OptimizedImage`,true);if(!Tab)_missingMdxReference(`Tab`,true);if(!Tabs)_missingMdxReference(`Tabs`,true);if(!Tip)_missingMdxReference(`Tip`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`If you have a data member in your class, you can decorate it with `,_jsx(_components.code,{children:`@Show`}),` and it will be visible in the playground!`]}),`\n`,_jsxs(_components.p,{children:[`For example, check out the code for `,_jsx(_components.a,{href:`https://app.metz.sh/try?templateId=7`,children:`Average Stock Price`}),`, and you will see that\nwe have decorated `,_jsx(_components.code,{children:`averagePrice`}),` with `,_jsx(_components.code,{children:`@Show`}),`. That’s why it shows up here:`]}),`\n`,_jsx(Frame,{children:_jsx(OptimizedFrame,{width:`900px`,height:`700px`,src:`https://app.metz.sh/play/0d0b90bfe8f0411dbde9f59071927be9?minimal=true`})}),`\n`,_jsx(Tip,{children:`You can decorate as many data members you want, event private ones!`}),`\n`,_jsx(Heading,{level:`2`,id:`customizing-how-the-data-is-presented`,children:`Customizing how the data is presented`}),`\n`,_jsxs(_components.p,{children:[`Say if you have a class which you are using to model a database. It has a member called `,_jsx(_components.code,{children:`data`}),`, which you’d want to decorate with `,_jsx(_components.code,{children:`@Show`}),`.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`11`,language:`typescript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`typescript`,children:_jsxs(_components.code,{language:`typescript`,numberOfLines:`11`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`type`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` Order`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`\tid`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` string`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`\tthing`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` string`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`\tstatus`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` string`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`\tcreatedAt`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` number`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`};`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`class`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` OrdersTable`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`\t@`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Show`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`\tprivate`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` data`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`:`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` Order`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`[] `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` [];`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`This simply displays that array in playground. Wouldn’t it be nice if `,_jsx(_components.code,{children:`data`}),` could actually be rendered as a table?`]}),`\n`,_jsx(Heading,{level:`3`,id:`table-view`,children:`Table View`}),`\n`,_jsxs(_components.p,{children:[`Well, yes! That’s why we have `,_jsx(_components.code,{children:`@Table`}),`, which you can decorate your class with. Simply provide the “columns” you want to show and you get a nice looking view!`]}),`\n`,_jsx(_components.p,{children:`For example:`}),`\n`,_jsxs(Tabs,{children:[_jsx(Tab,{title:`Code`,id:`code`,children:_jsx(CodeBlock,{filename:``,numberOfLines:`6`,language:`typescript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`typescript`,children:_jsxs(_components.code,{language:`typescript`,numberOfLines:`6`,children:[_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`@`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`Table`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`([`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'id'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'thing'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'status'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'createdAt'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`])`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`class`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` OrdersTable`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` @`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Show`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` private`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` data`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`:`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` Order`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`[] `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` [];`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})})}),_jsx(Tab,{title:`View`,id:`view`,children:_jsx(OptimizedImage,{src:`https://mintcdn.com/metzsh/fELY9edQkrehV0tS/images/table.png?fit=max\u0026auto=format\u0026n=fELY9edQkrehV0tS\u0026q=85\u0026s=25f86b14a69515fd8870272570fa9aac`,alt:``,\"data-og-width\":`444`,width:`444`,\"data-og-height\":`525`,height:`525`,\"data-path\":`images/table.png`,\"data-optimize\":`true`,\"data-opv\":`3`,srcset:`https://mintcdn.com/metzsh/fELY9edQkrehV0tS/images/table.png?w=280\u0026fit=max\u0026auto=format\u0026n=fELY9edQkrehV0tS\u0026q=85\u0026s=0fe5defd8c4b5d48c6c78fede398983f 280w, https://mintcdn.com/metzsh/fELY9edQkrehV0tS/images/table.png?w=560\u0026fit=max\u0026auto=format\u0026n=fELY9edQkrehV0tS\u0026q=85\u0026s=fec48662a743d444bc0664624df936bb 560w, https://mintcdn.com/metzsh/fELY9edQkrehV0tS/images/table.png?w=840\u0026fit=max\u0026auto=format\u0026n=fELY9edQkrehV0tS\u0026q=85\u0026s=efa59c5000f75a23320eb4990015ac64 840w, https://mintcdn.com/metzsh/fELY9edQkrehV0tS/images/table.png?w=1100\u0026fit=max\u0026auto=format\u0026n=fELY9edQkrehV0tS\u0026q=85\u0026s=9733e9d2d4fa6e77c3157e9eeb0d75d1 1100w, https://mintcdn.com/metzsh/fELY9edQkrehV0tS/images/table.png?w=1650\u0026fit=max\u0026auto=format\u0026n=fELY9edQkrehV0tS\u0026q=85\u0026s=9c65654667f1acc3473a550a19ba0131 1650w, https://mintcdn.com/metzsh/fELY9edQkrehV0tS/images/table.png?w=2500\u0026fit=max\u0026auto=format\u0026n=fELY9edQkrehV0tS\u0026q=85\u0026s=0d14902857826a6e52df6c25d50c734a 2500w`})})]}),`\n`,_jsx(_components.p,{children:`This view takes the liberty of setting the icon as Postgres. You can change that to anything.`}),`\n`,_jsxs(Warning,{children:[`With table view, only one member should be decorated with `,_jsx(_components.code,{children:`@Show`}),` and it should be an array of records.`]}),`\n`,_jsx(Heading,{level:`3`,id:`collection-view`,children:`Collection View`}),`\n`,_jsxs(_components.p,{children:[`Similarly, we have `,_jsx(_components.code,{children:`@Collection`}),` to show objects.\nFor example:`]}),`\n`,_jsxs(Tabs,{children:[_jsx(Tab,{title:`Code`,id:`code-2`,children:_jsx(CodeBlock,{filename:``,numberOfLines:`6`,language:`typescript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`typescript`,children:_jsxs(_components.code,{language:`typescript`,numberOfLines:`6`,children:[_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`@`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Collection`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`class`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` OrdersTable`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` @`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Show`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` private`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` data`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`:`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` Order`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`[] `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` [];`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})})}),_jsx(Tab,{title:`View`,id:`view-2`,children:_jsx(OptimizedImage,{src:`https://mintcdn.com/metzsh/fELY9edQkrehV0tS/images/cc.png?fit=max\u0026auto=format\u0026n=fELY9edQkrehV0tS\u0026q=85\u0026s=faa1d563b96645cbc899017ad0cbcd47`,alt:``,\"data-og-width\":`384`,width:`384`,\"data-og-height\":`453`,height:`453`,\"data-path\":`images/cc.png`,\"data-optimize\":`true`,\"data-opv\":`3`,srcset:`https://mintcdn.com/metzsh/fELY9edQkrehV0tS/images/cc.png?w=280\u0026fit=max\u0026auto=format\u0026n=fELY9edQkrehV0tS\u0026q=85\u0026s=72ff0b03710f3fac887e4b468e63d6e0 280w, https://mintcdn.com/metzsh/fELY9edQkrehV0tS/images/cc.png?w=560\u0026fit=max\u0026auto=format\u0026n=fELY9edQkrehV0tS\u0026q=85\u0026s=403e41bebf6ec10c8dfb2d74e07716b6 560w, https://mintcdn.com/metzsh/fELY9edQkrehV0tS/images/cc.png?w=840\u0026fit=max\u0026auto=format\u0026n=fELY9edQkrehV0tS\u0026q=85\u0026s=24158d5782b9a00892366bc48d6bb55a 840w, https://mintcdn.com/metzsh/fELY9edQkrehV0tS/images/cc.png?w=1100\u0026fit=max\u0026auto=format\u0026n=fELY9edQkrehV0tS\u0026q=85\u0026s=ee14cf0a4053969c3f07d09a415e2c47 1100w, https://mintcdn.com/metzsh/fELY9edQkrehV0tS/images/cc.png?w=1650\u0026fit=max\u0026auto=format\u0026n=fELY9edQkrehV0tS\u0026q=85\u0026s=28a0e59441795c6c1a4831f9e817ab13 1650w, https://mintcdn.com/metzsh/fELY9edQkrehV0tS/images/cc.png?w=2500\u0026fit=max\u0026auto=format\u0026n=fELY9edQkrehV0tS\u0026q=85\u0026s=73273c73d183f5c477dae7902bc0f0d8 2500w`})})]}),`\n`,_jsxs(Warning,{children:[`With collection view, only one member should be decorated with `,_jsx(_components.code,{children:`@Show`}),` and it should be an array of records.`]}),`\n`,_jsx(Heading,{level:`3`,id:`keyvalue-view`,children:`KeyValue View`}),`\n`,_jsxs(_components.p,{children:[`And lastly, you can use `,_jsx(_components.code,{children:`@KeyValue`}),` to render a `,_jsx(_components.code,{children:`Map`}),`.`]}),`\n`,_jsx(_components.p,{children:`For example:`}),`\n`,_jsxs(Tabs,{children:[_jsx(Tab,{title:`Code`,id:`code-3`,children:_jsx(CodeBlock,{filename:``,numberOfLines:`6`,language:`typescript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`typescript`,children:_jsxs(_components.code,{language:`typescript`,numberOfLines:`6`,children:[_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`@`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`KeyValue`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`class`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` Redis`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`\u003c`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`T`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`> {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` @`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Show`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` data`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`:`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` Map`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`\u003c`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`string`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`T`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`> `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` new`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` Map`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`();`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})})}),_jsx(Tab,{title:`View`,id:`view-3`,children:_jsx(OptimizedImage,{src:`https://mintcdn.com/metzsh/fELY9edQkrehV0tS/images/keyvalue.png?fit=max\u0026auto=format\u0026n=fELY9edQkrehV0tS\u0026q=85\u0026s=43d432cfc460b84f8a0b2bf01432d4cf`,alt:``,\"data-og-width\":`471`,width:`471`,\"data-og-height\":`557`,height:`557`,\"data-path\":`images/keyvalue.png`,\"data-optimize\":`true`,\"data-opv\":`3`,srcset:`https://mintcdn.com/metzsh/fELY9edQkrehV0tS/images/keyvalue.png?w=280\u0026fit=max\u0026auto=format\u0026n=fELY9edQkrehV0tS\u0026q=85\u0026s=4055dc6ce5f9a163dd288165df829915 280w, https://mintcdn.com/metzsh/fELY9edQkrehV0tS/images/keyvalue.png?w=560\u0026fit=max\u0026auto=format\u0026n=fELY9edQkrehV0tS\u0026q=85\u0026s=79ae1f670d040c894c59272e85021b58 560w, https://mintcdn.com/metzsh/fELY9edQkrehV0tS/images/keyvalue.png?w=840\u0026fit=max\u0026auto=format\u0026n=fELY9edQkrehV0tS\u0026q=85\u0026s=8d19d64d9ab48565921425a94ee85108 840w, https://mintcdn.com/metzsh/fELY9edQkrehV0tS/images/keyvalue.png?w=1100\u0026fit=max\u0026auto=format\u0026n=fELY9edQkrehV0tS\u0026q=85\u0026s=d516e19ade0fd84e355f8d573cb081ef 1100w, https://mintcdn.com/metzsh/fELY9edQkrehV0tS/images/keyvalue.png?w=1650\u0026fit=max\u0026auto=format\u0026n=fELY9edQkrehV0tS\u0026q=85\u0026s=f91805666e3b7e1fb61c929f046f9be5 1650w, https://mintcdn.com/metzsh/fELY9edQkrehV0tS/images/keyvalue.png?w=2500\u0026fit=max\u0026auto=format\u0026n=fELY9edQkrehV0tS\u0026q=85\u0026s=14e570465b9148b44ba457fc86fb5dcb 2500w`})})]}),`\n`,_jsxs(Warning,{children:[`With keyvalue view, only one member should be decorated with `,_jsx(_components.code,{children:`@Show`}),` and it should be a `,_jsx(_components.code,{children:`Map`}),`.`]}),`\n`,_jsx(Heading,{level:`3`,id:`where-did-all-the-methods-go`,children:`Where did all the methods go?`}),`\n`,_jsx(_components.p,{children:`When you assign a view to a class, the runtime collapses its corresponding node.`}),`\n`,_jsx(_components.p,{children:`All the methods are hidden, and all the edges going to those methods\nnow go to the parent class node. Giving the view a clean look.`}),`\n`,_jsxs(_components.p,{children:[`Mind you, simply decorating a member with `,_jsx(_components.code,{children:`@Show`}),` won’t cause this. You have to assign a view to the class.`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Data \u0026 Views","description":null,"href":"/data-and-views"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Customizing how the data is presented","slug":"customizing-how-the-data-is-presented","depth":2,"children":[{"title":"Table View","slug":"table-view","depth":3,"children":[]},{"title":"Collection View","slug":"collection-view","depth":3,"children":[]},{"title":"KeyValue View","slug":"keyvalue-view","depth":3,"children":[]},{"title":"Where did all the methods go?","slug":"where-did-all-the-methods-go","depth":3,"children":[]}]}],"codeExamples":{}},"jsLinks":[],"subdomain":"metzsh","siteName":"metz.sh docs","title":"Data \u0026 Views - metz.sh docs","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-01-07T00:49:40.339Z","originalFileLocation":"data-and-views.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=\"dark\";if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"dark\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"application-name\" content=\"metz.sh docs\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/metzsh/aSWZVFOH10Zo4zFS/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/metzsh/aSWZVFOH10Zo4zFS/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/metzsh/aSWZVFOH10Zo4zFS/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/metzsh/aSWZVFOH10Zo4zFS/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/metzsh/aSWZVFOH10Zo4zFS/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/metzsh/aSWZVFOH10Zo4zFS/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/metzsh/aSWZVFOH10Zo4zFS/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/metzsh/aSWZVFOH10Zo4zFS/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/metzsh/aSWZVFOH10Zo4zFS/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Data \u0026amp; Views - metz.sh docs\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"metz.sh docs\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.metz.sh/data-and-views\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://metzsh.mintlify.app/_mintlify/api/og/v2?division=Visual+Storytelling\u0026amp;title=Data+%26+Views\u0026amp;theme=9e8e4a80884aaa5ef303afc5\u0026amp;signature=ace30309bf6170fc3083e7e03ca86db3b3526938f9cc26311aea8ade9df36d01\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Data \u0026amp; Views - metz.sh docs\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://metzsh.mintlify.app/_mintlify/api/og/v2?division=Visual+Storytelling\u0026amp;title=Data+%26+Views\u0026amp;theme=9e8e4a80884aaa5ef303afc5\u0026amp;signature=ace30309bf6170fc3083e7e03ca86db3b3526938f9cc26311aea8ade9df36d01\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/metzsh/aSWZVFOH10Zo4zFS/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"metz.sh docs\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#3f66ff\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.metz.sh/data-and-views\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/data-and-views.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.metz.sh/#organization\",\"name\":\"metz.sh docs\",\"url\":\"https://docs.metz.sh\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/metzsh/fELY9edQkrehV0tS/logo/logo.png?fit=max\u0026auto=format\u0026n=fELY9edQkrehV0tS\u0026q=85\u0026s=9fcc8aa216415c9388fe9c12559a1252\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.metz.sh#website\",\"name\":\"metz.sh docs\",\"url\":\"https://docs.metz.sh\",\"publisher\":{\"@id\":\"https://docs.metz.sh/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.metz.sh/data-and-views#webpage\",\"url\":\"https://docs.metz.sh/data-and-views\",\"name\":\"Data \u0026 Views\",\"dateModified\":\"2026-01-07T00:49:40.339Z\",\"isPartOf\":{\"@id\":\"https://docs.metz.sh#website\"},\"breadcrumb\":{\"@id\":\"https://docs.metz.sh/data-and-views#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.metz.sh/data-and-views#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Visual Storytelling\",\"item\":\"https://docs.metz.sh/customizing-nodes\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Data \u0026 Views\",\"item\":\"https://docs.metz.sh/data-and-views\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.metz.sh/data-and-views#article\",\"headline\":\"Data \u0026 Views\",\"name\":\"Data \u0026 Views\",\"url\":\"https://docs.metz.sh/data-and-views\",\"mainEntityOfPage\":{\"@id\":\"https://docs.metz.sh/data-and-views#webpage\"},\"dateModified\":\"2026-01-07T00:49:40.339Z\",\"publisher\":{\"@id\":\"https://docs.metz.sh/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.metz.sh#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"metz.sh docs\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"metz.sh docs","nav":{"global":{"anchors":[{"anchor":"Github","href":"https://github.com/metz-sh/simulacrum","icon":"github"},{"anchor":"Try in Playground","href":"https://try.metz.sh","icon":"code"},{"anchor":"Join our Slack","href":"https://metzcommunity.slack.com/join/shared_invite/zt-1xr4ooes0-AhIP47ENEqrKmnfpCw6e8Q#/shared-invite/email","icon":"slack"}]},"anchors":[{"anchor":"Documentation","icon":"book-open","groups":[{"group":"Get Started","pages":[{"title":"Introduction","href":"/introduction"},{"title":"It begins with a class","href":"/classes"},{"title":"Stories","href":"/stories"},{"title":"Flows-101","href":"/flows-101"}]},{"group":"Dependencies \u0026 Scope","pages":[{"title":"Dependencies","href":"/dependencies-and-scope/dependencies"},{"title":"Files and Scope","href":"/dependencies-and-scope/files-and-scope"}]},{"group":"Internals","pages":[{"title":"Runtime","href":"/runtime"}]},{"group":"Async Operations","pages":[{"title":"Flows-102","href":"/flows-102"},{"title":"Awaiting Flows","href":"/awaiting-flows"},{"title":"Events","href":"/events"}]},{"group":"Visual Storytelling","pages":[{"title":"Customizing Nodes","href":"/customizing-nodes"},{"title":"Debugging","description":null,"href":"/debugging"},{"title":"Data \u0026 Views","href":"/data-and-views"}]},{"group":"Utils","pages":[{"title":"Higher Order Functions","description":null,"href":"/hof"},{"title":"The Standard Library","href":"/standard-library"},{"title":"Miscellaneous","href":"/miscellaneous"}]}]}]},"basePath":"","title":"Data \u0026 Views - metz.sh docs","buildId":"dpl_DeHjVRGfFnhYQwHnfC2pjeXXv8h9","deploymentId":"dpl_DeHjVRGfFnhYQwHnfC2pjeXXv8h9","dynamics":["07c022d89b","a74be98ba7"],"chunks":["Frame-DXXFP6nH.js","DynamicMarkdown-B54_zNBF.js","zoom-image-lightbox-BG6oD64b.js","lightbox-handle-r17bVUz3.js"]}