workspace-architect 1.4.1 → 1.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (355) hide show
  1. package/assets-manifest.json +3392 -0
  2. package/bin/cli.js +134 -72
  3. package/package.json +11 -3
  4. package/.env.example +0 -1
  5. package/.gitattributes +0 -1
  6. package/.github/workflows/manual-publish.yml +0 -36
  7. package/.github/workflows/sync-and-publish.yml +0 -58
  8. package/.release-it.json +0 -20
  9. package/CHANGELOG.md +0 -53
  10. package/assets/chatmodes/4.1-Beast.chatmode.md +0 -152
  11. package/assets/chatmodes/Thinking-Beast-Mode.chatmode.md +0 -337
  12. package/assets/chatmodes/Ultimate-Transparent-Thinking-Beast-Mode.chatmode.md +0 -644
  13. package/assets/chatmodes/accessibility.chatmode.md +0 -298
  14. package/assets/chatmodes/address-comments.chatmode.md +0 -59
  15. package/assets/chatmodes/aem-frontend-specialist.chatmode.md +0 -385
  16. package/assets/chatmodes/api-architect.chatmode.md +0 -40
  17. package/assets/chatmodes/atlassian-requirements-to-jira.chatmode.md +0 -444
  18. package/assets/chatmodes/azure-logic-apps-expert.chatmode.md +0 -100
  19. package/assets/chatmodes/azure-principal-architect.chatmode.md +0 -58
  20. package/assets/chatmodes/azure-saas-architect.chatmode.md +0 -118
  21. package/assets/chatmodes/azure-verified-modules-bicep.chatmode.md +0 -44
  22. package/assets/chatmodes/azure-verified-modules-terraform.chatmode.md +0 -58
  23. package/assets/chatmodes/bicep-implement.chatmode.md +0 -40
  24. package/assets/chatmodes/bicep-plan.chatmode.md +0 -112
  25. package/assets/chatmodes/blueprint-mode-codex.chatmode.md +0 -110
  26. package/assets/chatmodes/blueprint-mode.chatmode.md +0 -171
  27. package/assets/chatmodes/clojure-interactive-programming.chatmode.md +0 -174
  28. package/assets/chatmodes/code-tour.chatmode.md +0 -205
  29. package/assets/chatmodes/critical-thinking.chatmode.md +0 -23
  30. package/assets/chatmodes/csharp-dotnet-janitor.chatmode.md +0 -83
  31. package/assets/chatmodes/csharp-mcp-expert.chatmode.md +0 -69
  32. package/assets/chatmodes/debug.chatmode.md +0 -79
  33. package/assets/chatmodes/declarative-agents-architect.chatmode.md +0 -76
  34. package/assets/chatmodes/demonstrate-understanding.chatmode.md +0 -60
  35. package/assets/chatmodes/dotnet-upgrade.chatmode.md +0 -222
  36. package/assets/chatmodes/drupal-expert.chatmode.md +0 -687
  37. package/assets/chatmodes/electron-angular-native.chatmode.md +0 -285
  38. package/assets/chatmodes/expert-cpp-software-engineer.chatmode.md +0 -27
  39. package/assets/chatmodes/expert-dotnet-software-engineer.chatmode.md +0 -22
  40. package/assets/chatmodes/expert-nextjs-developer.chatmode.md +0 -477
  41. package/assets/chatmodes/expert-react-frontend-engineer.chatmode.md +0 -738
  42. package/assets/chatmodes/gilfoyle.chatmode.md +0 -66
  43. package/assets/chatmodes/go-mcp-expert.chatmode.md +0 -122
  44. package/assets/chatmodes/gpt-5-beast-mode.chatmode.md +0 -109
  45. package/assets/chatmodes/hlbpa.chatmode.md +0 -232
  46. package/assets/chatmodes/implementation-plan.chatmode.md +0 -159
  47. package/assets/chatmodes/janitor.chatmode.md +0 -89
  48. package/assets/chatmodes/java-mcp-expert.chatmode.md +0 -325
  49. package/assets/chatmodes/kotlin-mcp-expert.chatmode.md +0 -181
  50. package/assets/chatmodes/kusto-assistant.chatmode.md +0 -143
  51. package/assets/chatmodes/laravel-expert-agent.chatmode.md +0 -628
  52. package/assets/chatmodes/mentor.chatmode.md +0 -32
  53. package/assets/chatmodes/meta-agentic-project-scaffold.chatmode.md +0 -15
  54. package/assets/chatmodes/microsoft-agent-framework-dotnet.chatmode.md +0 -62
  55. package/assets/chatmodes/microsoft-agent-framework-python.chatmode.md +0 -62
  56. package/assets/chatmodes/microsoft-study-mode.chatmode.md +0 -32
  57. package/assets/chatmodes/microsoft_learn_contributor.chatmode.md +0 -388
  58. package/assets/chatmodes/ms-sql-dba.chatmode.md +0 -25
  59. package/assets/chatmodes/php-mcp-expert.chatmode.md +0 -498
  60. package/assets/chatmodes/pimcore-expert.chatmode.md +0 -869
  61. package/assets/chatmodes/plan.chatmode.md +0 -114
  62. package/assets/chatmodes/planner.chatmode.md +0 -14
  63. package/assets/chatmodes/playwright-tester.chatmode.md +0 -13
  64. package/assets/chatmodes/postgresql-dba.chatmode.md +0 -17
  65. package/assets/chatmodes/power-bi-data-modeling-expert.chatmode.md +0 -319
  66. package/assets/chatmodes/power-bi-dax-expert.chatmode.md +0 -334
  67. package/assets/chatmodes/power-bi-performance-expert.chatmode.md +0 -533
  68. package/assets/chatmodes/power-bi-visualization-expert.chatmode.md +0 -549
  69. package/assets/chatmodes/power-platform-expert.chatmode.md +0 -116
  70. package/assets/chatmodes/power-platform-mcp-integration-expert.chatmode.md +0 -149
  71. package/assets/chatmodes/prd.chatmode.md +0 -201
  72. package/assets/chatmodes/principal-software-engineer.chatmode.md +0 -41
  73. package/assets/chatmodes/prompt-builder.chatmode.md +0 -352
  74. package/assets/chatmodes/prompt-engineer.chatmode.md +0 -72
  75. package/assets/chatmodes/python-mcp-expert.chatmode.md +0 -99
  76. package/assets/chatmodes/refine-issue.chatmode.md +0 -34
  77. package/assets/chatmodes/research-technical-spike.chatmode.md +0 -169
  78. package/assets/chatmodes/ruby-mcp-expert.chatmode.md +0 -346
  79. package/assets/chatmodes/rust-gpt-4.1-beast-mode.chatmode.md +0 -197
  80. package/assets/chatmodes/rust-mcp-expert.chatmode.md +0 -465
  81. package/assets/chatmodes/search-ai-optimization-expert.chatmode.md +0 -227
  82. package/assets/chatmodes/semantic-kernel-dotnet.chatmode.md +0 -31
  83. package/assets/chatmodes/semantic-kernel-python.chatmode.md +0 -28
  84. package/assets/chatmodes/shopify-expert.chatmode.md +0 -681
  85. package/assets/chatmodes/simple-app-idea-generator.chatmode.md +0 -134
  86. package/assets/chatmodes/software-engineer-agent-v1.chatmode.md +0 -164
  87. package/assets/chatmodes/specification.chatmode.md +0 -127
  88. package/assets/chatmodes/swift-mcp-expert.chatmode.md +0 -240
  89. package/assets/chatmodes/task-planner.chatmode.md +0 -374
  90. package/assets/chatmodes/task-researcher.chatmode.md +0 -254
  91. package/assets/chatmodes/tdd-green.chatmode.md +0 -59
  92. package/assets/chatmodes/tdd-red.chatmode.md +0 -59
  93. package/assets/chatmodes/tdd-refactor.chatmode.md +0 -84
  94. package/assets/chatmodes/tech-debt-remediation-plan.chatmode.md +0 -49
  95. package/assets/chatmodes/terraform-azure-implement.chatmode.md +0 -104
  96. package/assets/chatmodes/terraform-azure-planning.chatmode.md +0 -157
  97. package/assets/chatmodes/typescript-mcp-expert.chatmode.md +0 -91
  98. package/assets/chatmodes/voidbeast-gpt41enhanced.chatmode.md +0 -230
  99. package/assets/chatmodes/wg-code-alchemist.chatmode.md +0 -61
  100. package/assets/chatmodes/wg-code-sentinel.chatmode.md +0 -55
  101. package/assets/collections/ai-prompt-engineering.json +0 -95
  102. package/assets/collections/angular-development.json +0 -19
  103. package/assets/collections/azure-cloud-architect.json +0 -150
  104. package/assets/collections/cpp-development.json +0 -4
  105. package/assets/collections/database-administration.json +0 -13
  106. package/assets/collections/devops-sre.json +0 -33
  107. package/assets/collections/dotnet-development.json +0 -114
  108. package/assets/collections/general-productivity.json +0 -4
  109. package/assets/collections/go-development.json +0 -42
  110. package/assets/collections/java-spring-developer.json +0 -111
  111. package/assets/collections/learning-mentoring.json +0 -9
  112. package/assets/collections/legacy-migration.json +0 -6
  113. package/assets/collections/mcp-specialist.json +0 -92
  114. package/assets/collections/mobile-development.json +0 -12
  115. package/assets/collections/php-cms-development.json +0 -68
  116. package/assets/collections/power-platform-specialist.json +0 -128
  117. package/assets/collections/project-management.json +0 -50
  118. package/assets/collections/python-development.json +0 -66
  119. package/assets/collections/quality-assurance.json +0 -56
  120. package/assets/collections/ruby-development.json +0 -43
  121. package/assets/collections/rust-development.json +0 -63
  122. package/assets/collections/security-specialist.json +0 -65
  123. package/assets/collections/software-architect.json +0 -85
  124. package/assets/collections/technical-writing.json +0 -23
  125. package/assets/collections/web-frontend-development.json +0 -52
  126. package/assets/instructions/a11y.instructions.md +0 -369
  127. package/assets/instructions/ai-prompt-engineering-safety-best-practices.instructions.md +0 -867
  128. package/assets/instructions/angular.instructions.md +0 -104
  129. package/assets/instructions/ansible.instructions.md +0 -88
  130. package/assets/instructions/aspnet-rest-apis.instructions.md +0 -110
  131. package/assets/instructions/astro.instructions.md +0 -182
  132. package/assets/instructions/azure-devops-pipelines.instructions.md +0 -185
  133. package/assets/instructions/azure-functions-typescript.instructions.md +0 -14
  134. package/assets/instructions/azure-logic-apps-power-automate.instructions.md +0 -1943
  135. package/assets/instructions/azure-verified-modules-terraform.instructions.md +0 -229
  136. package/assets/instructions/bicep-code-best-practices.instructions.md +0 -54
  137. package/assets/instructions/blazor.instructions.md +0 -77
  138. package/assets/instructions/clojure.instructions.md +0 -349
  139. package/assets/instructions/cmake-vcpkg.instructions.md +0 -10
  140. package/assets/instructions/codexer.instructions.md +0 -428
  141. package/assets/instructions/coldfusion-cfc.instructions.md +0 -30
  142. package/assets/instructions/coldfusion-cfm.instructions.md +0 -28
  143. package/assets/instructions/collections.instructions.md +0 -54
  144. package/assets/instructions/containerization-docker-best-practices.instructions.md +0 -681
  145. package/assets/instructions/convert-jpa-to-spring-data-cosmos.instructions.md +0 -949
  146. package/assets/instructions/copilot-thought-logging.instructions.md +0 -62
  147. package/assets/instructions/csharp-ja.instructions.md +0 -114
  148. package/assets/instructions/csharp-ko.instructions.md +0 -77
  149. package/assets/instructions/csharp-mcp-server.instructions.md +0 -95
  150. package/assets/instructions/csharp.instructions.md +0 -114
  151. package/assets/instructions/dart-n-flutter.instructions.md +0 -447
  152. package/assets/instructions/declarative-agents-microsoft365.instructions.md +0 -316
  153. package/assets/instructions/devbox-image-definition.instructions.md +0 -302
  154. package/assets/instructions/devops-core-principles.instructions.md +0 -167
  155. package/assets/instructions/dotnet-architecture-good-practices.instructions.md +0 -279
  156. package/assets/instructions/dotnet-framework.instructions.md +0 -113
  157. package/assets/instructions/dotnet-maui-9-to-dotnet-maui-10-upgrade.instructions.md +0 -1922
  158. package/assets/instructions/dotnet-maui.instructions.md +0 -69
  159. package/assets/instructions/dotnet-upgrade.instructions.md +0 -287
  160. package/assets/instructions/dotnet-wpf.instructions.md +0 -79
  161. package/assets/instructions/genaiscript.instructions.md +0 -21
  162. package/assets/instructions/generate-modern-terraform-code-for-azure.instructions.md +0 -82
  163. package/assets/instructions/gilfoyle-code-review.instructions.md +0 -114
  164. package/assets/instructions/github-actions-ci-cd-best-practices.instructions.md +0 -607
  165. package/assets/instructions/go-mcp-server.instructions.md +0 -346
  166. package/assets/instructions/go.instructions.md +0 -373
  167. package/assets/instructions/instructions.instructions.md +0 -256
  168. package/assets/instructions/java-11-to-java-17-upgrade.instructions.md +0 -793
  169. package/assets/instructions/java-17-to-java-21-upgrade.instructions.md +0 -464
  170. package/assets/instructions/java-21-to-java-25-upgrade.instructions.md +0 -311
  171. package/assets/instructions/java-mcp-server.instructions.md +0 -553
  172. package/assets/instructions/java.instructions.md +0 -81
  173. package/assets/instructions/joyride-user-project.instructions.md +0 -206
  174. package/assets/instructions/joyride-workspace-automation.instructions.md +0 -46
  175. package/assets/instructions/kotlin-mcp-server.instructions.md +0 -481
  176. package/assets/instructions/kubernetes-deployment-best-practices.instructions.md +0 -307
  177. package/assets/instructions/langchain-python.instructions.md +0 -229
  178. package/assets/instructions/localization.instructions.md +0 -39
  179. package/assets/instructions/makefile.instructions.md +0 -410
  180. package/assets/instructions/markdown.instructions.md +0 -52
  181. package/assets/instructions/memory-bank.instructions.md +0 -299
  182. package/assets/instructions/mongo-dba.instructions.md +0 -25
  183. package/assets/instructions/ms-sql-dba.instructions.md +0 -25
  184. package/assets/instructions/nestjs.instructions.md +0 -406
  185. package/assets/instructions/nextjs-tailwind.instructions.md +0 -72
  186. package/assets/instructions/nextjs.instructions.md +0 -143
  187. package/assets/instructions/nodejs-javascript-vitest.instructions.md +0 -30
  188. package/assets/instructions/object-calisthenics.instructions.md +0 -302
  189. package/assets/instructions/oqtane.instructions.md +0 -86
  190. package/assets/instructions/performance-optimization.instructions.md +0 -420
  191. package/assets/instructions/php-mcp-server.instructions.md +0 -809
  192. package/assets/instructions/playwright-dotnet.instructions.md +0 -101
  193. package/assets/instructions/playwright-python.instructions.md +0 -62
  194. package/assets/instructions/playwright-typescript.instructions.md +0 -86
  195. package/assets/instructions/power-apps-canvas-yaml.instructions.md +0 -827
  196. package/assets/instructions/power-apps-code-apps.instructions.md +0 -601
  197. package/assets/instructions/power-bi-custom-visuals-development.instructions.md +0 -810
  198. package/assets/instructions/power-bi-data-modeling-best-practices.instructions.md +0 -639
  199. package/assets/instructions/power-bi-dax-best-practices.instructions.md +0 -795
  200. package/assets/instructions/power-bi-devops-alm-best-practices.instructions.md +0 -623
  201. package/assets/instructions/power-bi-report-design-best-practices.instructions.md +0 -752
  202. package/assets/instructions/power-bi-security-rls-best-practices.instructions.md +0 -504
  203. package/assets/instructions/power-platform-connector.instructions.md +0 -430
  204. package/assets/instructions/power-platform-mcp-development.instructions.md +0 -88
  205. package/assets/instructions/powershell-pester-5.instructions.md +0 -197
  206. package/assets/instructions/powershell.instructions.md +0 -356
  207. package/assets/instructions/prompt.instructions.md +0 -73
  208. package/assets/instructions/python-mcp-server.instructions.md +0 -204
  209. package/assets/instructions/python.instructions.md +0 -56
  210. package/assets/instructions/quarkus-mcp-server-sse.instructions.md +0 -49
  211. package/assets/instructions/quarkus.instructions.md +0 -98
  212. package/assets/instructions/r.instructions.md +0 -116
  213. package/assets/instructions/reactjs.instructions.md +0 -162
  214. package/assets/instructions/ruby-mcp-server.instructions.md +0 -629
  215. package/assets/instructions/ruby-on-rails.instructions.md +0 -124
  216. package/assets/instructions/rust-mcp-server.instructions.md +0 -715
  217. package/assets/instructions/rust.instructions.md +0 -135
  218. package/assets/instructions/security-and-owasp.instructions.md +0 -51
  219. package/assets/instructions/self-explanatory-code-commenting.instructions.md +0 -162
  220. package/assets/instructions/shell.instructions.md +0 -132
  221. package/assets/instructions/spec-driven-workflow-v1.instructions.md +0 -323
  222. package/assets/instructions/springboot.instructions.md +0 -68
  223. package/assets/instructions/sql-sp-generation.instructions.md +0 -74
  224. package/assets/instructions/svelte.instructions.md +0 -161
  225. package/assets/instructions/swift-mcp-server.instructions.md +0 -498
  226. package/assets/instructions/taming-copilot.instructions.md +0 -40
  227. package/assets/instructions/tanstack-start-shadcn-tailwind.instructions.md +0 -212
  228. package/assets/instructions/task-implementation.instructions.md +0 -190
  229. package/assets/instructions/tasksync.instructions.md +0 -352
  230. package/assets/instructions/terraform-azure.instructions.md +0 -254
  231. package/assets/instructions/terraform-sap-btp.instructions.md +0 -195
  232. package/assets/instructions/terraform.instructions.md +0 -113
  233. package/assets/instructions/typescript-5-es2022.instructions.md +0 -114
  234. package/assets/instructions/typescript-mcp-server.instructions.md +0 -228
  235. package/assets/instructions/update-code-from-shorthand.instructions.md +0 -130
  236. package/assets/instructions/vuejs3.instructions.md +0 -153
  237. package/assets/instructions/wordpress.instructions.md +0 -186
  238. package/assets/prompts/add-educational-comments.prompt.md +0 -129
  239. package/assets/prompts/ai-prompt-engineering-safety-review.prompt.md +0 -230
  240. package/assets/prompts/architecture-blueprint-generator.prompt.md +0 -322
  241. package/assets/prompts/aspnet-minimal-api-openapi.prompt.md +0 -42
  242. package/assets/prompts/az-cost-optimize.prompt.md +0 -305
  243. package/assets/prompts/azure-resource-health-diagnose.prompt.md +0 -290
  244. package/assets/prompts/boost-prompt.prompt.md +0 -25
  245. package/assets/prompts/breakdown-epic-arch.prompt.md +0 -66
  246. package/assets/prompts/breakdown-epic-pm.prompt.md +0 -58
  247. package/assets/prompts/breakdown-feature-implementation.prompt.md +0 -128
  248. package/assets/prompts/breakdown-feature-prd.prompt.md +0 -61
  249. package/assets/prompts/breakdown-plan.prompt.md +0 -509
  250. package/assets/prompts/breakdown-test.prompt.md +0 -365
  251. package/assets/prompts/code-exemplars-blueprint-generator.prompt.md +0 -126
  252. package/assets/prompts/comment-code-generate-a-tutorial.prompt.md +0 -26
  253. package/assets/prompts/containerize-aspnet-framework.prompt.md +0 -455
  254. package/assets/prompts/containerize-aspnetcore.prompt.md +0 -393
  255. package/assets/prompts/conventional-commit.prompt.md +0 -73
  256. package/assets/prompts/copilot-instructions-blueprint-generator.prompt.md +0 -294
  257. package/assets/prompts/cosmosdb-datamodeling.prompt.md +0 -1045
  258. package/assets/prompts/create-agentsmd.prompt.md +0 -249
  259. package/assets/prompts/create-architectural-decision-record.prompt.md +0 -97
  260. package/assets/prompts/create-github-action-workflow-specification.prompt.md +0 -276
  261. package/assets/prompts/create-github-issue-feature-from-specification.prompt.md +0 -28
  262. package/assets/prompts/create-github-issues-feature-from-implementation-plan.prompt.md +0 -28
  263. package/assets/prompts/create-github-issues-for-unmet-specification-requirements.prompt.md +0 -35
  264. package/assets/prompts/create-github-pull-request-from-specification.prompt.md +0 -24
  265. package/assets/prompts/create-implementation-plan.prompt.md +0 -157
  266. package/assets/prompts/create-llms.prompt.md +0 -210
  267. package/assets/prompts/create-oo-component-documentation.prompt.md +0 -193
  268. package/assets/prompts/create-readme.prompt.md +0 -21
  269. package/assets/prompts/create-specification.prompt.md +0 -127
  270. package/assets/prompts/create-spring-boot-java-project.prompt.md +0 -163
  271. package/assets/prompts/create-spring-boot-kotlin-project.prompt.md +0 -147
  272. package/assets/prompts/create-technical-spike.prompt.md +0 -231
  273. package/assets/prompts/csharp-async.prompt.md +0 -50
  274. package/assets/prompts/csharp-docs.prompt.md +0 -63
  275. package/assets/prompts/csharp-mcp-server-generator.prompt.md +0 -59
  276. package/assets/prompts/csharp-mstest.prompt.md +0 -67
  277. package/assets/prompts/csharp-nunit.prompt.md +0 -72
  278. package/assets/prompts/csharp-tunit.prompt.md +0 -101
  279. package/assets/prompts/csharp-xunit.prompt.md +0 -69
  280. package/assets/prompts/declarative-agents.prompt.md +0 -93
  281. package/assets/prompts/documentation-writer.prompt.md +0 -46
  282. package/assets/prompts/dotnet-best-practices.prompt.md +0 -84
  283. package/assets/prompts/dotnet-design-pattern-review.prompt.md +0 -41
  284. package/assets/prompts/dotnet-upgrade.prompt.md +0 -116
  285. package/assets/prompts/editorconfig.prompt.md +0 -64
  286. package/assets/prompts/ef-core.prompt.md +0 -76
  287. package/assets/prompts/finalize-agent-prompt.prompt.md +0 -27
  288. package/assets/prompts/first-ask.prompt.md +0 -29
  289. package/assets/prompts/folder-structure-blueprint-generator.prompt.md +0 -405
  290. package/assets/prompts/gen-specs-as-issues.prompt.md +0 -165
  291. package/assets/prompts/generate-custom-instructions-from-codebase.prompt.md +0 -240
  292. package/assets/prompts/git-flow-branch-creator.prompt.md +0 -293
  293. package/assets/prompts/github-copilot-starter.prompt.md +0 -372
  294. package/assets/prompts/go-mcp-server-generator.prompt.md +0 -334
  295. package/assets/prompts/java-docs.prompt.md +0 -24
  296. package/assets/prompts/java-junit.prompt.md +0 -64
  297. package/assets/prompts/java-mcp-server-generator.prompt.md +0 -756
  298. package/assets/prompts/java-refactoring-extract-method.prompt.md +0 -105
  299. package/assets/prompts/java-refactoring-remove-parameter.prompt.md +0 -85
  300. package/assets/prompts/java-springboot.prompt.md +0 -66
  301. package/assets/prompts/javascript-typescript-jest.prompt.md +0 -44
  302. package/assets/prompts/kotlin-mcp-server-generator.prompt.md +0 -449
  303. package/assets/prompts/kotlin-springboot.prompt.md +0 -71
  304. package/assets/prompts/mcp-copilot-studio-server-generator.prompt.md +0 -118
  305. package/assets/prompts/memory-merger.prompt.md +0 -107
  306. package/assets/prompts/mkdocs-translations.prompt.md +0 -110
  307. package/assets/prompts/model-recommendation.prompt.md +0 -677
  308. package/assets/prompts/multi-stage-dockerfile.prompt.md +0 -47
  309. package/assets/prompts/my-issues.prompt.md +0 -9
  310. package/assets/prompts/my-pull-requests.prompt.md +0 -15
  311. package/assets/prompts/next-intl-add-language.prompt.md +0 -20
  312. package/assets/prompts/php-mcp-server-generator.prompt.md +0 -522
  313. package/assets/prompts/playwright-automation-fill-in-form.prompt.md +0 -30
  314. package/assets/prompts/playwright-explore-website.prompt.md +0 -19
  315. package/assets/prompts/playwright-generate-test.prompt.md +0 -19
  316. package/assets/prompts/postgresql-code-review.prompt.md +0 -214
  317. package/assets/prompts/postgresql-optimization.prompt.md +0 -406
  318. package/assets/prompts/power-apps-code-app-scaffold.prompt.md +0 -150
  319. package/assets/prompts/power-bi-dax-optimization.prompt.md +0 -175
  320. package/assets/prompts/power-bi-model-design-review.prompt.md +0 -405
  321. package/assets/prompts/power-bi-performance-troubleshooting.prompt.md +0 -384
  322. package/assets/prompts/power-bi-report-design-consultation.prompt.md +0 -353
  323. package/assets/prompts/power-platform-mcp-connector-suite.prompt.md +0 -156
  324. package/assets/prompts/project-workflow-analysis-blueprint-generator.prompt.md +0 -294
  325. package/assets/prompts/prompt-builder.prompt.md +0 -142
  326. package/assets/prompts/pytest-coverage.prompt.md +0 -28
  327. package/assets/prompts/python-mcp-server-generator.prompt.md +0 -105
  328. package/assets/prompts/readme-blueprint-generator.prompt.md +0 -79
  329. package/assets/prompts/remember-interactive-programming.prompt.md +0 -13
  330. package/assets/prompts/remember.prompt.md +0 -125
  331. package/assets/prompts/repo-story-time.prompt.md +0 -156
  332. package/assets/prompts/review-and-refactor.prompt.md +0 -15
  333. package/assets/prompts/ruby-mcp-server-generator.prompt.md +0 -660
  334. package/assets/prompts/rust-mcp-server-generator.prompt.md +0 -578
  335. package/assets/prompts/shuffle-json-data.prompt.md +0 -151
  336. package/assets/prompts/sql-code-review.prompt.md +0 -303
  337. package/assets/prompts/sql-optimization.prompt.md +0 -298
  338. package/assets/prompts/suggest-awesome-github-copilot-agents.prompt.md +0 -72
  339. package/assets/prompts/suggest-awesome-github-copilot-chatmodes.prompt.md +0 -71
  340. package/assets/prompts/suggest-awesome-github-copilot-collections.prompt.md +0 -149
  341. package/assets/prompts/suggest-awesome-github-copilot-instructions.prompt.md +0 -88
  342. package/assets/prompts/suggest-awesome-github-copilot-prompts.prompt.md +0 -71
  343. package/assets/prompts/swift-mcp-server-generator.prompt.md +0 -669
  344. package/assets/prompts/technology-stack-blueprint-generator.prompt.md +0 -242
  345. package/assets/prompts/typescript-mcp-server-generator.prompt.md +0 -90
  346. package/assets/prompts/update-avm-modules-in-bicep.prompt.md +0 -60
  347. package/assets/prompts/update-implementation-plan.prompt.md +0 -157
  348. package/assets/prompts/update-llms.prompt.md +0 -216
  349. package/assets/prompts/update-markdown-file-index.prompt.md +0 -76
  350. package/assets/prompts/update-oo-component-documentation.prompt.md +0 -162
  351. package/assets/prompts/update-specification.prompt.md +0 -127
  352. package/assets/prompts/write-coding-standards-from-file.prompt.md +0 -316
  353. package/scripts/analyze-collections.js +0 -387
  354. package/scripts/sync.js +0 -99
  355. package/verdaccio/config.yaml +0 -202
@@ -1,810 +0,0 @@
1
- ---
2
- description: 'Comprehensive Power BI custom visuals development guide covering React, D3.js integration, TypeScript patterns, testing frameworks, and advanced visualization techniques.'
3
- applyTo: '**/*.{ts,tsx,js,jsx,json,less,css}'
4
- ---
5
-
6
- # Power BI Custom Visuals Development Best Practices
7
-
8
- ## Overview
9
- This document provides comprehensive instructions for developing custom Power BI visuals using modern web technologies including React, D3.js, TypeScript, and advanced testing frameworks, based on Microsoft's official guidance and community best practices.
10
-
11
- ## Development Environment Setup
12
-
13
- ### 1. Project Initialization
14
- ```typescript
15
- // Install Power BI visuals tools globally
16
- npm install -g powerbi-visuals-tools
17
-
18
- // Create new visual project
19
- pbiviz new MyCustomVisual
20
- cd MyCustomVisual
21
-
22
- // Start development server
23
- pbiviz start
24
- ```
25
-
26
- ### 2. TypeScript Configuration
27
- ```json
28
- {
29
- "compilerOptions": {
30
- "jsx": "react",
31
- "types": ["react", "react-dom"],
32
- "allowJs": false,
33
- "emitDecoratorMetadata": true,
34
- "experimentalDecorators": true,
35
- "target": "es6",
36
- "sourceMap": true,
37
- "outDir": "./.tmp/build/",
38
- "moduleResolution": "node",
39
- "declaration": true,
40
- "lib": [
41
- "es2015",
42
- "dom"
43
- ]
44
- },
45
- "files": [
46
- "./src/visual.ts"
47
- ]
48
- }
49
- ```
50
-
51
- ## Core Visual Development Patterns
52
-
53
- ### 1. Basic Visual Structure
54
- ```typescript
55
- "use strict";
56
- import powerbi from "powerbi-visuals-api";
57
-
58
- import DataView = powerbi.DataView;
59
- import VisualConstructorOptions = powerbi.extensibility.visual.VisualConstructorOptions;
60
- import VisualUpdateOptions = powerbi.extensibility.visual.VisualUpdateOptions;
61
- import IVisual = powerbi.extensibility.visual.IVisual;
62
- import IVisualHost = powerbi.extensibility.IVisualHost;
63
-
64
- import "./../style/visual.less";
65
-
66
- export class Visual implements IVisual {
67
- private target: HTMLElement;
68
- private host: IVisualHost;
69
-
70
- constructor(options: VisualConstructorOptions) {
71
- this.target = options.element;
72
- this.host = options.host;
73
- }
74
-
75
- public update(options: VisualUpdateOptions) {
76
- const dataView: DataView = options.dataViews[0];
77
-
78
- if (!dataView) {
79
- return;
80
- }
81
-
82
- // Visual update logic here
83
- }
84
-
85
- public getFormattingModel(): powerbi.visuals.FormattingModel {
86
- return this.formattingSettingsService.buildFormattingModel(this.formattingSettings);
87
- }
88
- }
89
- ```
90
-
91
- ### 2. Data View Processing
92
- ```typescript
93
- // Single data mapping example
94
- export class Visual implements IVisual {
95
- private valueText: HTMLParagraphElement;
96
-
97
- constructor(options: VisualConstructorOptions) {
98
- this.target = options.element;
99
- this.host = options.host;
100
- this.valueText = document.createElement("p");
101
- this.target.appendChild(this.valueText);
102
- }
103
-
104
- public update(options: VisualUpdateOptions) {
105
- const dataView: DataView = options.dataViews[0];
106
- const singleDataView: DataViewSingle = dataView.single;
107
-
108
- if (!singleDataView || !singleDataView.value ) {
109
- return;
110
- }
111
-
112
- this.valueText.innerText = singleDataView.value.toString();
113
- }
114
- }
115
- ```
116
-
117
- ## React Integration
118
-
119
- ### 1. React Visual Setup
120
- ```typescript
121
- import * as React from "react";
122
- import * as ReactDOM from "react-dom";
123
- import ReactCircleCard from "./component";
124
-
125
- export class Visual implements IVisual {
126
- private target: HTMLElement;
127
- private reactRoot: React.ComponentElement<any, any>;
128
-
129
- constructor(options: VisualConstructorOptions) {
130
- this.reactRoot = React.createElement(ReactCircleCard, {});
131
- this.target = options.element;
132
-
133
- ReactDOM.render(this.reactRoot, this.target);
134
- }
135
-
136
- public update(options: VisualUpdateOptions) {
137
- const dataView: DataView = options.dataViews[0];
138
-
139
- if (dataView) {
140
- const reactProps = this.parseDataView(dataView);
141
- this.reactRoot = React.createElement(ReactCircleCard, reactProps);
142
- ReactDOM.render(this.reactRoot, this.target);
143
- }
144
- }
145
-
146
- private parseDataView(dataView: DataView): any {
147
- // Transform Power BI data for React component
148
- return {
149
- data: dataView.categorical?.values?.[0]?.values || [],
150
- categories: dataView.categorical?.categories?.[0]?.values || []
151
- };
152
- }
153
- }
154
- ```
155
-
156
- ### 2. React Component with Props
157
- ```typescript
158
- // React component for Power BI visual
159
- import * as React from "react";
160
-
161
- export interface ReactCircleCardProps {
162
- data: number[];
163
- categories: string[];
164
- size?: number;
165
- color?: string;
166
- }
167
-
168
- export const ReactCircleCard: React.FC<ReactCircleCardProps> = (props) => {
169
- const { data, categories, size = 200, color = "#3498db" } = props;
170
-
171
- const maxValue = Math.max(...data);
172
- const minValue = Math.min(...data);
173
-
174
- return (
175
- <div className="react-circle-card">
176
- {data.map((value, index) => {
177
- const radius = ((value - minValue) / (maxValue - minValue)) * size / 2;
178
- return (
179
- <div key={index} className="data-point">
180
- <div
181
- className="circle"
182
- style={{
183
- width: radius * 2,
184
- height: radius * 2,
185
- backgroundColor: color,
186
- borderRadius: '50%'
187
- }}
188
- />
189
- <span className="label">{categories[index]}: {value}</span>
190
- </div>
191
- );
192
- })}
193
- </div>
194
- );
195
- };
196
-
197
- export default ReactCircleCard;
198
- ```
199
-
200
- ## D3.js Integration
201
-
202
- ### 1. D3 with TypeScript
203
- ```typescript
204
- import * as d3 from "d3";
205
- type Selection<T extends d3.BaseType> = d3.Selection<T, any, any, any>;
206
-
207
- export class Visual implements IVisual {
208
- private svg: Selection<SVGElement>;
209
- private container: Selection<SVGElement>;
210
- private host: IVisualHost;
211
-
212
- constructor(options: VisualConstructorOptions) {
213
- this.host = options.host;
214
- this.svg = d3.select(options.element)
215
- .append('svg')
216
- .classed('visual-svg', true);
217
-
218
- this.container = this.svg
219
- .append('g')
220
- .classed('visual-container', true);
221
- }
222
-
223
- public update(options: VisualUpdateOptions) {
224
- const dataView = options.dataViews[0];
225
-
226
- if (!dataView) {
227
- return;
228
- }
229
-
230
- const width = options.viewport.width;
231
- const height = options.viewport.height;
232
-
233
- this.svg
234
- .attr('width', width)
235
- .attr('height', height);
236
-
237
- // D3 data binding and visualization logic
238
- this.renderChart(dataView, width, height);
239
- }
240
-
241
- private renderChart(dataView: DataView, width: number, height: number): void {
242
- const data = this.transformData(dataView);
243
-
244
- // Create scales
245
- const xScale = d3.scaleBand()
246
- .domain(data.map(d => d.category))
247
- .range([0, width])
248
- .padding(0.1);
249
-
250
- const yScale = d3.scaleLinear()
251
- .domain([0, d3.max(data, d => d.value)])
252
- .range([height, 0]);
253
-
254
- // Bind data and create bars
255
- const bars = this.container.selectAll('.bar')
256
- .data(data);
257
-
258
- bars.enter()
259
- .append('rect')
260
- .classed('bar', true)
261
- .merge(bars)
262
- .attr('x', d => xScale(d.category))
263
- .attr('y', d => yScale(d.value))
264
- .attr('width', xScale.bandwidth())
265
- .attr('height', d => height - yScale(d.value))
266
- .style('fill', '#3498db');
267
-
268
- bars.exit().remove();
269
- }
270
-
271
- private transformData(dataView: DataView): any[] {
272
- // Transform Power BI DataView to D3-friendly format
273
- const categorical = dataView.categorical;
274
- const categories = categorical.categories[0];
275
- const values = categorical.values[0];
276
-
277
- return categories.values.map((category, index) => ({
278
- category: category.toString(),
279
- value: values.values[index] as number
280
- }));
281
- }
282
- }
283
- ```
284
-
285
- ### 2. Advanced D3 Patterns
286
- ```typescript
287
- // Complex D3 visualization with interactions
288
- export class AdvancedD3Visual implements IVisual {
289
- private svg: Selection<SVGElement>;
290
- private tooltip: Selection<HTMLDivElement>;
291
- private selectionManager: ISelectionManager;
292
-
293
- constructor(options: VisualConstructorOptions) {
294
- this.host = options.host;
295
- this.selectionManager = this.host.createSelectionManager();
296
-
297
- // Create main SVG
298
- this.svg = d3.select(options.element)
299
- .append('svg');
300
-
301
- // Create tooltip
302
- this.tooltip = d3.select(options.element)
303
- .append('div')
304
- .classed('tooltip', true)
305
- .style('opacity', 0);
306
- }
307
-
308
- private createInteractiveElements(data: VisualDataPoint[]): void {
309
- const circles = this.svg.selectAll('.data-circle')
310
- .data(data);
311
-
312
- const circlesEnter = circles.enter()
313
- .append('circle')
314
- .classed('data-circle', true);
315
-
316
- circlesEnter.merge(circles)
317
- .attr('cx', d => d.x)
318
- .attr('cy', d => d.y)
319
- .attr('r', d => d.radius)
320
- .style('fill', d => d.color)
321
- .style('stroke', d => d.strokeColor)
322
- .style('stroke-width', d => `${d.strokeWidth}px`)
323
- .on('click', (event, d) => {
324
- // Handle selection
325
- this.selectionManager.select(d.selectionId, event.ctrlKey);
326
- })
327
- .on('mouseover', (event, d) => {
328
- // Show tooltip
329
- this.tooltip
330
- .style('opacity', 1)
331
- .style('left', (event.pageX + 10) + 'px')
332
- .style('top', (event.pageY - 10) + 'px')
333
- .html(`${d.category}: ${d.value}`);
334
- })
335
- .on('mouseout', () => {
336
- // Hide tooltip
337
- this.tooltip.style('opacity', 0);
338
- });
339
-
340
- circles.exit().remove();
341
- }
342
- }
343
- ```
344
-
345
- ## Advanced Visual Features
346
-
347
- ### 1. Custom Formatting Model
348
- ```typescript
349
- import { formattingSettings } from "powerbi-visuals-utils-formattingmodel";
350
-
351
- export class VisualFormattingSettingsModel extends formattingSettings.CompositeFormattingSettingsModel {
352
- // Color settings card
353
- public colorCard: ColorCardSettings = new ColorCardSettings();
354
-
355
- // Data point settings card
356
- public dataPointCard: DataPointCardSettings = new DataPointCardSettings();
357
-
358
- // General settings card
359
- public generalCard: GeneralCardSettings = new GeneralCardSettings();
360
-
361
- public cards: formattingSettings.SimpleCard[] = [this.colorCard, this.dataPointCard, this.generalCard];
362
- }
363
-
364
- export class ColorCardSettings extends formattingSettings.SimpleCard {
365
- name: string = "colorCard";
366
- displayName: string = "Color";
367
-
368
- public defaultColor: formattingSettings.ColorPicker = new formattingSettings.ColorPicker({
369
- name: "defaultColor",
370
- displayName: "Default color",
371
- value: { value: "#3498db" }
372
- });
373
-
374
- public showAllDataPoints: formattingSettings.ToggleSwitch = new formattingSettings.ToggleSwitch({
375
- name: "showAllDataPoints",
376
- displayName: "Show all",
377
- value: false
378
- });
379
- }
380
- ```
381
-
382
- ### 2. Interactivity and Selections
383
- ```typescript
384
- import { interactivitySelectionService, baseBehavior } from "powerbi-visuals-utils-interactivityutils";
385
-
386
- export interface VisualDataPoint extends interactivitySelectionService.SelectableDataPoint {
387
- value: powerbi.PrimitiveValue;
388
- category: string;
389
- color: string;
390
- selectionId: ISelectionId;
391
- }
392
-
393
- export class VisualBehavior extends baseBehavior.BaseBehavior<VisualDataPoint> {
394
- protected bindClick() {
395
- // Implement click behavior for data point selection
396
- this.behaviorOptions.clearCatcher.on('click', () => {
397
- this.selectionHandler.handleClearSelection();
398
- });
399
-
400
- this.behaviorOptions.elementsSelection.on('click', (event, dataPoint) => {
401
- event.stopPropagation();
402
- this.selectionHandler.handleSelection(dataPoint, event.ctrlKey);
403
- });
404
- }
405
-
406
- protected bindContextMenu() {
407
- // Implement context menu behavior
408
- this.behaviorOptions.elementsSelection.on('contextmenu', (event, dataPoint) => {
409
- this.selectionHandler.handleContextMenu(
410
- dataPoint ? dataPoint.selectionId : null,
411
- {
412
- x: event.clientX,
413
- y: event.clientY
414
- }
415
- );
416
- event.preventDefault();
417
- });
418
- }
419
- }
420
- ```
421
-
422
- ### 3. Landing Page Implementation
423
- ```typescript
424
- export class Visual implements IVisual {
425
- private element: HTMLElement;
426
- private isLandingPageOn: boolean;
427
- private LandingPageRemoved: boolean;
428
- private LandingPage: d3.Selection<any>;
429
-
430
- constructor(options: VisualConstructorOptions) {
431
- this.element = options.element;
432
- }
433
-
434
- public update(options: VisualUpdateOptions) {
435
- this.HandleLandingPage(options);
436
- }
437
-
438
- private HandleLandingPage(options: VisualUpdateOptions) {
439
- if(!options.dataViews || !options.dataViews[0]?.metadata?.columns?.length){
440
- if(!this.isLandingPageOn) {
441
- this.isLandingPageOn = true;
442
- const SampleLandingPage: Element = this.createSampleLandingPage();
443
- this.element.appendChild(SampleLandingPage);
444
- this.LandingPage = d3.select(SampleLandingPage);
445
- }
446
- } else {
447
- if(this.isLandingPageOn && !this.LandingPageRemoved){
448
- this.LandingPageRemoved = true;
449
- this.LandingPage.remove();
450
- }
451
- }
452
- }
453
-
454
- private createSampleLandingPage(): Element {
455
- const landingPage = document.createElement("div");
456
- landingPage.className = "landing-page";
457
- landingPage.innerHTML = `
458
- <div class="landing-page-content">
459
- <h2>Custom Visual</h2>
460
- <p>Add data to get started</p>
461
- <div class="landing-page-icon">📊</div>
462
- </div>
463
- `;
464
- return landingPage;
465
- }
466
- }
467
- ```
468
-
469
- ## Testing Framework
470
-
471
- ### 1. Unit Testing Setup
472
- ```typescript
473
- // Webpack configuration for testing
474
- const path = require('path');
475
- const webpack = require("webpack");
476
-
477
- module.exports = {
478
- devtool: 'source-map',
479
- mode: 'development',
480
- module: {
481
- rules: [
482
- {
483
- test: /\.tsx?$/,
484
- use: 'ts-loader',
485
- exclude: /node_modules/
486
- },
487
- {
488
- test: /\.json$/,
489
- loader: 'json-loader'
490
- },
491
- {
492
- test: /\.tsx?$/i,
493
- enforce: 'post',
494
- include: path.resolve(__dirname, 'src'),
495
- exclude: /(node_modules|resources\/js\/vendor)/,
496
- loader: 'coverage-istanbul-loader',
497
- options: { esModules: true }
498
- }
499
- ]
500
- },
501
- externals: {
502
- "powerbi-visuals-api": '{}'
503
- },
504
- resolve: {
505
- extensions: ['.tsx', '.ts', '.js', '.css']
506
- },
507
- output: {
508
- path: path.resolve(__dirname, ".tmp/test")
509
- },
510
- plugins: [
511
- new webpack.ProvidePlugin({
512
- 'powerbi-visuals-api': null
513
- })
514
- ]
515
- };
516
- ```
517
-
518
- ### 2. Visual Testing Utilities
519
- ```typescript
520
- // Test utilities for Power BI visuals
521
- export class VisualTestUtils {
522
- public static d3Click(element: JQuery, x: number, y: number): void {
523
- const event = new MouseEvent('click', {
524
- clientX: x,
525
- clientY: y,
526
- button: 0
527
- });
528
- element[0].dispatchEvent(event);
529
- }
530
-
531
- public static d3KeyEvent(element: JQuery, typeArg: string, keyArg: string, keyCode: number): void {
532
- const event = new KeyboardEvent(typeArg, {
533
- key: keyArg,
534
- code: keyArg,
535
- keyCode: keyCode
536
- });
537
- element[0].dispatchEvent(event);
538
- }
539
-
540
- public static createVisualHost(): IVisualHost {
541
- return {
542
- createSelectionIdBuilder: () => new SelectionIdBuilder(),
543
- createSelectionManager: () => new SelectionManager(),
544
- colorPalette: new ColorPalette(),
545
- eventService: new EventService(),
546
- tooltipService: new TooltipService()
547
- } as IVisualHost;
548
- }
549
-
550
- public static createUpdateOptions(dataView: DataView, viewport?: IViewport): VisualUpdateOptions {
551
- return {
552
- dataViews: [dataView],
553
- viewport: viewport || { width: 500, height: 500 },
554
- operationKind: VisualDataChangeOperationKind.Create,
555
- type: VisualUpdateType.Data
556
- };
557
- }
558
- }
559
- ```
560
-
561
- ### 3. Component Testing
562
- ```typescript
563
- // Jest test for React component
564
- import * as React from 'react';
565
- import { render, screen } from '@testing-library/react';
566
- import '@testing-library/jest-dom';
567
- import ReactCircleCard from '../src/component';
568
-
569
- describe('ReactCircleCard', () => {
570
- const mockProps = {
571
- data: [10, 20, 30],
572
- categories: ['A', 'B', 'C'],
573
- size: 200,
574
- color: '#3498db'
575
- };
576
-
577
- test('renders with correct data points', () => {
578
- render(<ReactCircleCard {...mockProps} />);
579
-
580
- expect(screen.getByText('A: 10')).toBeInTheDocument();
581
- expect(screen.getByText('B: 20')).toBeInTheDocument();
582
- expect(screen.getByText('C: 30')).toBeInTheDocument();
583
- });
584
-
585
- test('applies correct styling', () => {
586
- render(<ReactCircleCard {...mockProps} />);
587
-
588
- const circles = document.querySelectorAll('.circle');
589
- expect(circles).toHaveLength(3);
590
-
591
- circles.forEach(circle => {
592
- expect(circle).toHaveStyle('backgroundColor: #3498db');
593
- expect(circle).toHaveStyle('borderRadius: 50%');
594
- });
595
- });
596
-
597
- test('handles empty data gracefully', () => {
598
- const emptyProps = { ...mockProps, data: [], categories: [] };
599
- const { container } = render(<ReactCircleCard {...emptyProps} />);
600
-
601
- expect(container.querySelector('.data-point')).toBeNull();
602
- });
603
- });
604
- ```
605
-
606
- ## Advanced Patterns
607
-
608
- ### 1. Dialog Box Implementation
609
- ```typescript
610
- import DialogConstructorOptions = powerbi.extensibility.visual.DialogConstructorOptions;
611
- import DialogAction = powerbi.DialogAction;
612
- import * as ReactDOM from 'react-dom';
613
- import * as React from 'react';
614
-
615
- export class CustomDialog {
616
- private dialogContainer: HTMLElement;
617
-
618
- constructor(options: DialogConstructorOptions) {
619
- this.dialogContainer = options.element;
620
- this.initializeDialog();
621
- }
622
-
623
- private initializeDialog(): void {
624
- const dialogContent = React.createElement(DialogContent, {
625
- onSave: this.handleSave.bind(this),
626
- onCancel: this.handleCancel.bind(this)
627
- });
628
-
629
- ReactDOM.render(dialogContent, this.dialogContainer);
630
- }
631
-
632
- private handleSave(data: any): void {
633
- // Process save action
634
- this.closeDialog(DialogAction.Save, data);
635
- }
636
-
637
- private handleCancel(): void {
638
- // Process cancel action
639
- this.closeDialog(DialogAction.Cancel);
640
- }
641
-
642
- private closeDialog(action: DialogAction, data?: any): void {
643
- // Close dialog with action and optional data
644
- powerbi.extensibility.visual.DialogUtils.closeDialog(action, data);
645
- }
646
- }
647
- ```
648
-
649
- ### 2. Conditional Formatting Integration
650
- ```typescript
651
- import powerbiVisualsApi from "powerbi-visuals-api";
652
- import { ColorHelper } from "powerbi-visuals-utils-colorutils";
653
-
654
- export class Visual implements IVisual {
655
- private colorHelper: ColorHelper;
656
-
657
- constructor(options: VisualConstructorOptions) {
658
- this.colorHelper = new ColorHelper(
659
- options.host.colorPalette,
660
- { objectName: "dataPoint", propertyName: "fill" },
661
- "#3498db" // Default color
662
- );
663
- }
664
-
665
- private applyConditionalFormatting(dataPoints: VisualDataPoint[]): VisualDataPoint[] {
666
- return dataPoints.map(dataPoint => {
667
- // Get conditional formatting color
668
- const color = this.colorHelper.getColorForDataPoint(dataPoint.dataViewObject);
669
-
670
- return {
671
- ...dataPoint,
672
- color: color,
673
- strokeColor: this.darkenColor(color, 0.2),
674
- strokeWidth: 2
675
- };
676
- });
677
- }
678
-
679
- private darkenColor(color: string, amount: number): string {
680
- // Utility function to darken a color for stroke
681
- const colorObj = d3.color(color);
682
- return colorObj ? colorObj.darker(amount).toString() : color;
683
- }
684
- }
685
- ```
686
-
687
- ### 3. Tooltip Integration
688
- ```typescript
689
- import { createTooltipServiceWrapper, TooltipEventArgs, ITooltipServiceWrapper } from "powerbi-visuals-utils-tooltiputils";
690
-
691
- export class Visual implements IVisual {
692
- private tooltipServiceWrapper: ITooltipServiceWrapper;
693
-
694
- constructor(options: VisualConstructorOptions) {
695
- this.tooltipServiceWrapper = createTooltipServiceWrapper(
696
- options.host.tooltipService,
697
- options.element
698
- );
699
- }
700
-
701
- private addTooltips(selection: d3.Selection<any, VisualDataPoint, any, any>): void {
702
- this.tooltipServiceWrapper.addTooltip(
703
- selection,
704
- (tooltipEvent: TooltipEventArgs<VisualDataPoint>) => {
705
- const dataPoint = tooltipEvent.data;
706
- return [
707
- {
708
- displayName: "Category",
709
- value: dataPoint.category
710
- },
711
- {
712
- displayName: "Value",
713
- value: dataPoint.value.toString()
714
- },
715
- {
716
- displayName: "Percentage",
717
- value: `${((dataPoint.value / this.totalValue) * 100).toFixed(1)}%`
718
- }
719
- ];
720
- }
721
- );
722
- }
723
- }
724
- ```
725
-
726
- ## Performance Optimization
727
-
728
- ### 1. Data Reduction Strategies
729
- ```json
730
- // Visual capabilities with data reduction
731
- "dataViewMappings": {
732
- "categorical": {
733
- "categories": {
734
- "for": { "in": "category" },
735
- "dataReductionAlgorithm": {
736
- "window": {
737
- "count": 300
738
- }
739
- }
740
- },
741
- "values": {
742
- "group": {
743
- "by": "series",
744
- "select": [{
745
- "for": {
746
- "in": "measure"
747
- }
748
- }],
749
- "dataReductionAlgorithm": {
750
- "top": {
751
- "count": 100
752
- }
753
- }
754
- }
755
- }
756
- }
757
- }
758
- ```
759
-
760
- ### 2. Efficient Rendering Patterns
761
- ```typescript
762
- export class OptimizedVisual implements IVisual {
763
- private animationFrameId: number;
764
- private renderQueue: (() => void)[] = [];
765
-
766
- public update(options: VisualUpdateOptions) {
767
- // Queue render operation instead of immediate execution
768
- this.queueRender(() => this.performUpdate(options));
769
- }
770
-
771
- private queueRender(renderFunction: () => void): void {
772
- this.renderQueue.push(renderFunction);
773
-
774
- if (!this.animationFrameId) {
775
- this.animationFrameId = requestAnimationFrame(() => {
776
- this.processRenderQueue();
777
- });
778
- }
779
- }
780
-
781
- private processRenderQueue(): void {
782
- // Process all queued render operations
783
- while (this.renderQueue.length > 0) {
784
- const renderFunction = this.renderQueue.shift();
785
- if (renderFunction) {
786
- renderFunction();
787
- }
788
- }
789
-
790
- this.animationFrameId = null;
791
- }
792
-
793
- private performUpdate(options: VisualUpdateOptions): void {
794
- // Use virtual DOM or efficient diffing strategies
795
- const currentData = this.transformData(options.dataViews[0]);
796
-
797
- if (this.hasDataChanged(currentData)) {
798
- this.renderVisualization(currentData);
799
- this.previousData = currentData;
800
- }
801
- }
802
-
803
- private hasDataChanged(newData: any[]): boolean {
804
- // Efficient data comparison
805
- return JSON.stringify(newData) !== JSON.stringify(this.previousData);
806
- }
807
- }
808
- ```
809
-
810
- Remember: Custom visual development requires understanding both Power BI's visual framework and modern web development practices. Focus on creating reusable, testable, and performant visualizations that enhance the Power BI ecosystem.