{"_id":"@microsoft/powerbi-core-visual-schema","_rev":"5-549fd901e9548e7428fd0b61fc52da12","name":"@microsoft/powerbi-core-visual-schema","dist-tags":{"latest":"0.1.1"},"versions":{"0.1.0":{"name":"@microsoft/powerbi-core-visual-schema","version":"0.1.0","keywords":["powerbi","power-bi","visual","visuals","capabilities","schema","catalog","report"],"license":"MIT","_id":"@microsoft/powerbi-core-visual-schema@0.1.0","maintainers":[{"name":"microsoft1es","email":"npmjs@microsoft.com"},{"name":"microsoft-oss-releases","email":"microsoft-oss-publishing@microsoft.com"}],"homepage":"https://github.com/microsoft/PowerBI-visuals/tree/main/packages/libs/core-visual-schema#readme","bugs":{"url":"https://github.com/microsoft/PowerBI-visuals/issues"},"dist":{"shasum":"6ed93e9cd38970a2cd186394058a9e6802f04213","tarball":"https://registry.npmjs.org/@microsoft/powerbi-core-visual-schema/-/powerbi-core-visual-schema-0.1.0.tgz","fileCount":15,"integrity":"sha512-D41+kVTdtq46wdo0ccY5TvghkZSk+K6NC6nSgb7r8cX6MVoGMJQcOU3811X1mpdgZOTyQyfDLEOrNAjPyVnXUw==","signatures":[{"sig":"MEUCIQDEIK8CvocoAXa8dzM6kJ9ksosvOAm3qevpnZmHKjTPZwIgGfZHsdXgs1PfbzfIRplNJv/Ya6CDOWFz0Q7W5lbFFqM=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":975728},"main":"./index.js","type":"module","_from":"file:M:\\SvcFab\\_App\\MS.Ess.PackageManager.Publisher_App1\\temp\\3456d2d5-cb32-4b1f-9464-25ecf0dbcb77\\microsoft-powerbi-core-visual-schema-0.1.0.tgz","types":"./index.d.ts","module":"./index.js","engines":{"node":">=20.10.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"},"./package.json":"./package.json"},"_npmUser":{"name":"microsoft1es","email":"npmjs@microsoft.com"},"_resolved":"M:\\SvcFab\\_App\\MS.Ess.PackageManager.Publisher_App1\\temp\\3456d2d5-cb32-4b1f-9464-25ecf0dbcb77\\microsoft-powerbi-core-visual-schema-0.1.0.tgz","_integrity":"sha512-D41+kVTdtq46wdo0ccY5TvghkZSk+K6NC6nSgb7r8cX6MVoGMJQcOU3811X1mpdgZOTyQyfDLEOrNAjPyVnXUw==","repository":{"url":"git+https://github.com/microsoft/PowerBI-visuals.git","type":"git","directory":"packages/libs/core-visual-schema"},"description":"Visual type catalog, capabilities catalog, VCO introspection, and instance selector resolution for Power BI visuals","directories":{},"_nodeVersion":"18.5.0","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/powerbi-core-visual-schema_0.1.0_1780472079863_0.6581588738197639","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@microsoft/powerbi-core-visual-schema","version":"0.1.1","keywords":["powerbi","power-bi","visual","visuals","capabilities","schema","catalog","report"],"license":"MIT","_id":"@microsoft/powerbi-core-visual-schema@0.1.1","maintainers":[{"name":"microsoft1es","email":"npmjs@microsoft.com"},{"name":"microsoft-oss-releases","email":"microsoft-oss-publishing@microsoft.com"}],"homepage":"https://github.com/microsoft/PowerBI-visuals/tree/main/packages/libs/core-visual-schema#readme","bugs":{"url":"https://github.com/microsoft/PowerBI-visuals/issues"},"dist":{"shasum":"3676900ec70655f347bc967ea0868c1df33a6bd8","tarball":"https://registry.npmjs.org/@microsoft/powerbi-core-visual-schema/-/powerbi-core-visual-schema-0.1.1.tgz","fileCount":15,"integrity":"sha512-B318sRMjJ8Cn2LKzUmcmvl2Oplr4uOsFPh2MJFQV0Y1UzsdvJjt/Rg+mYKZXK3QtztUvu0BsuAlCMmJDihjCfg==","signatures":[{"sig":"MEUCIHAqc/rNs8fUEUfWeniFOyfmNyrZVGg5ZLqFeZmkfbUDAiEAwc3yLTVsRQmgjnGacWrgFO8WBtOtB9YbumhmgTc4p1A=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":978089},"main":"./index.js","type":"module","_from":"file:M:\\SvcFab\\_App\\MS.Ess.PackageManager.Publisher_App1\\temp\\12eac33e-d0f7-474d-971d-f752895d4e2e\\microsoft-powerbi-core-visual-schema-0.1.1.tgz","types":"./index.d.ts","module":"./index.js","engines":{"node":">=20.10.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"},"./package.json":"./package.json"},"_npmUser":{"name":"microsoft1es","email":"npmjs@microsoft.com"},"_resolved":"M:\\SvcFab\\_App\\MS.Ess.PackageManager.Publisher_App1\\temp\\12eac33e-d0f7-474d-971d-f752895d4e2e\\microsoft-powerbi-core-visual-schema-0.1.1.tgz","_integrity":"sha512-B318sRMjJ8Cn2LKzUmcmvl2Oplr4uOsFPh2MJFQV0Y1UzsdvJjt/Rg+mYKZXK3QtztUvu0BsuAlCMmJDihjCfg==","repository":{"url":"git+https://github.com/microsoft/PowerBI-visuals.git","type":"git","directory":"packages/libs/core-visual-schema"},"description":"Visual type catalog, capabilities catalog, VCO introspection, and instance selector resolution for Power BI visuals","directories":{},"_nodeVersion":"18.5.0","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/powerbi-core-visual-schema_0.1.1_1781303312228_0.7501419824810736","host":"s3://npm-registry-packages-npm-production"}}},"time":{"created":"2026-06-03T07:34:39.721Z","modified":"2026-07-16T15:46:30.624Z","0.1.0":"2026-06-03T07:34:40.032Z","0.1.1":"2026-06-12T22:28:32.420Z"},"bugs":{"url":"https://github.com/microsoft/PowerBI-visuals/issues"},"license":"MIT","homepage":"https://github.com/microsoft/PowerBI-visuals/tree/main/packages/libs/core-visual-schema#readme","keywords":["powerbi","power-bi","visual","visuals","capabilities","schema","catalog","report"],"repository":{"url":"git+https://github.com/microsoft/PowerBI-visuals.git","type":"git","directory":"packages/libs/core-visual-schema"},"description":"Visual type catalog, capabilities catalog, VCO introspection, and instance selector resolution for Power BI visuals","maintainers":[{"email":"npmjs@microsoft.com","name":"microsoft1es"},{"email":"microsoft-oss-publishing@microsoft.com","name":"microsoft-oss-releases"}],"readme":"# @microsoft/powerbi-core-visual-schema\r\n\r\nStatic **visual capabilities catalog**, **VCO (Visual Container Object) catalog**, and **instance selector catalog** for Power BI report authoring. All metadata is precomputed at build time and shipped as JSON inside the package, so lookups are local, synchronous, and have **zero runtime dependencies**.\r\n\r\n## 💡 What can you do?\r\n\r\n- **📋 Enumerate visual types** — list every registered Power BI visual identifier (e.g. `barChart`, `lineChart`, `card`, `actionButton`)\r\n- **🔍 Look up visual capabilities** — retrieve a visual's data roles, formatting objects, behavioral flags (selection, highlight, keyboard focus, …) and more\r\n- **🧩 Inspect VCOs** — browse the shared container-level formatting objects (title, subTitle, background, border, dropShadow, padding, …) along with each one's properties and types\r\n- **🎯 Look up instance selectors** — discover which visuals (and non-visual elements like `filterCard`) expose **state-keyed** formatting buckets (`default`/`hover`/`selected`/`disabled`/…) and which formatting objects each state applies to\r\n\r\n## 📦 Installation\r\n\r\n```bash\r\nnpm install @microsoft/powerbi-core-visual-schema\r\n# or\r\npnpm add @microsoft/powerbi-core-visual-schema\r\n```\r\n\r\nThe package is **ESM-only** (Node ≥ 20.10) and ships full TypeScript types.\r\n\r\n## 🚀 Quick start\r\n\r\n```ts\r\nimport {\r\n    // Visual catalog\r\n    listVisualTypes,\r\n    getCapabilities,\r\n\r\n    // VCO catalog\r\n    listVcoKeys,\r\n    getVcoCapabilities,\r\n\r\n    // Instance selector catalog\r\n    listInstanceSelectorKeys,\r\n    getInstanceSelectors,\r\n    getSelectorHints,\r\n} from '@microsoft/powerbi-core-visual-schema';\r\n\r\n// 1. All visual types\r\nconst types = listVisualTypes();\r\n// → ['actionButton', 'areaChart', 'barChart', 'card', ...]  (~55 entries)\r\n\r\n// 2. Full capabilities for one visual\r\nconst lineChart = getCapabilities('lineChart');\r\n// → { dataRoles: [...], objects: { dataPoint: {...}, ... }, ... } | undefined\r\n\r\n// 3. All visual container objects\r\nconst vcoKeys = listVcoKeys();\r\n// → ['title', 'subTitle', 'divider', 'background', 'border', 'dropShadow', ...]\r\n\r\nconst titleVco = getVcoCapabilities('title');\r\n// → { displayName: 'Title', properties: { show: {...}, text: {...}, fontColor: {...} } }\r\n\r\n// 4. Instance selector catalog\r\nconst selectorKeys = listInstanceSelectorKeys();\r\n// → ['actionButton', 'advancedSlicer', 'bookmarkNavigator', 'cardVisual',\r\n//    'filterCard', 'pageNavigator', 'pivotTable', 'shape']\r\n\r\nconst buttonSelectors = getInstanceSelectors('actionButton');\r\n// → { fill: ['default','hover','selected','disabled'], outline: [...], text: [...], ... }\r\n\r\nconst filterCardSelectors = getInstanceSelectors('filterCard');\r\n// → { filterCard: ['Available', 'Applied'] }\r\n\r\nconst hints = getSelectorHints('actionButton', ['fill', 'text']);\r\n// → [\r\n//     { objectName: 'fill', selectorIds: ['default','hover','selected','disabled'] },\r\n//     { objectName: 'text', selectorIds: ['default','hover','selected','disabled'] },\r\n//   ]\r\n```\r\n\r\n## 🛠️ Public API\r\n\r\nAll exports come from the package root.\r\n\r\n### Visual capabilities\r\n\r\n| Export | Returns | Description |\r\n|---|---|---|\r\n| `listVisualTypes()` | `string[]` | Sorted list of all registered visual type identifiers |\r\n| `getCapabilities(visualType)` | `VisualCapabilities \\| undefined` | Full capabilities descriptor, or `undefined` if not registered |\r\n\r\nImage-typed visual properties expose the serialized ImageDefinition value shape under `type.image.subProperties`:\r\n\r\n```ts\r\nconst imageProperty = getCapabilities('actionButton')?.objects?.fill.properties.image;\r\nconst imageSubProperties = imageProperty?.type?.image?.subProperties;\r\n// → {\r\n//     name: { type: 'expr', required: true },\r\n//     url: { type: 'expr', required: true },\r\n//     scaling: { type: 'expr', required: false },\r\n//   }\r\n```\r\n\r\n### VCO catalog (Visual Container Objects)\r\n\r\n| Export | Returns | Description |\r\n|---|---|---|\r\n| `listVcoKeys()` | `string[]` | All registered VCO object names |\r\n| `getVcoCapabilities(name)` | `VcoCatalogEntry \\| undefined` | Full descriptor for one VCO, or `undefined` if not registered |\r\n\r\n### Instance selectors\r\n\r\n| Export | Returns | Description |\r\n|---|---|---|\r\n| `listInstanceSelectorKeys()` | `string[]` | Sorted list of every instance-selector key (visuals **and** non-visual elements like `filterCard`) |\r\n| `getInstanceSelectors(key)` | `VisualSelectorMap \\| undefined` | Map of `objectName → state IDs[]`, or `undefined` if not registered |\r\n| `getSelectorHints(key, names)` | `SelectorHint[]` | Convenience: hints only for the requested object names |\r\n\r\n> **Note:** All `get*` functions return `undefined` for unknown identifiers — no exceptions are thrown for missing data. This keeps consumer code simple (no try/catch noise).\r\n\r\n### Types\r\n\r\n```ts\r\nimport type {\r\n    // Visual capabilities\r\n    VisualType,\r\n    VisualCapabilities,\r\n    CapabilitiesByVisualType,\r\n    DataRoleDescriptor,\r\n    DataRoleKind,\r\n    CartesianKind,\r\n    ObjectDescriptor,\r\n    ObjectPropertyDescriptor,\r\n    PropertyTypeDescriptor,\r\n    EnumMember,\r\n    ImageSubPropertyDescriptor,\r\n    ImageTypeDescriptor,\r\n\r\n    // VCOs\r\n    VcoKey,\r\n    VcoCatalog,\r\n    VcoCatalogEntry,\r\n    VcoProperty,\r\n    VcoPropertyType,\r\n    VcoEnumMember,\r\n\r\n    // Instance selectors\r\n    InstanceSelectorCatalog,\r\n    VisualSelectorMap,\r\n    SelectorHint,\r\n} from '@microsoft/powerbi-core-visual-schema';\r\n```\r\n\r\n## 📁 Package contents\r\n\r\n```\r\n@microsoft/powerbi-core-visual-schema/\r\n├── index.{js,d.ts}                  # Public API\r\n├── lib/\r\n│   ├── visual-catalog.{js,d.ts}     # listVisualTypes, getCapabilities\r\n│   ├── vco-catalog.{js,d.ts}        # listVcoKeys, getVcoCapabilities\r\n│   └── instance-selectors.{js,d.ts} # listInstanceSelectorKeys, getInstanceSelectors, getSelectorHints\r\n├── types/index.d.ts                 # All public type definitions\r\n└── data/\r\n    ├── capabilities.json            # ~55 visuals, ~850 KB\r\n    ├── vco-capabilities.json        # 15 VCOs, ~18 KB\r\n    └── instance-selectors.json      # 8 selector keys, ~3 KB\r\n```\r\n\r\n## 🧠 Three independent catalogs\r\n\r\nThe package exposes three orthogonal catalogs because the underlying data is genuinely orthogonal:\r\n\r\n- **Visual capabilities** describe what a chart/visual can *do*: which data roles it accepts, which formatting objects it has, whether it supports highlight/selection/etc.\r\n- **VCO descriptors** describe the **container chrome** that wraps every visual (title, background, border, …) — these properties live one level above the visual.\r\n- **Instance selectors** describe **state-keyed formatting buckets** for elements that have multiple variants of the same property (e.g. an action button has different `fill` colors for `default`/`hover`/`selected`/`disabled`). Most selector keys are visual identifiers, but some are non-visual chrome elements like `filterCard`.\r\n\r\nEach catalog is queried independently, so consumers can pick the right one for the question they're asking.\r\n","readmeFilename":"README.md"}