开发 PowerBI 视觉效果 [英] Developing PowerBI Visuals

查看:25
本文介绍了开发 PowerBI 视觉效果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我发现从头开始开发 PowerBI 视觉效果很难.我正在阅读

<小时>

非常感谢.

解决方案

我还有一些额外的和更通用的补充:

  • Power BI 使用 capabilities.json 结构来确定 a) 什么应该是数据窗格 (dataRoles) 以及 Power BI 如何绑定它数据到您的视觉对象 (dataViewMappings) 和 b) 可以在格式化窗格中显示的内容(例如占位符).
  • enumerateObjectInstances() 是 Power BI 用于初始化格式化窗格的可选方法.此方法返回的结构应与 capabilities.json 文件中的结构相同.
  • update() 方法(必需)在您的视觉效果发生变化时调用.除了数据绑定更改之外,调整视觉对象或格式选项的大小也会触发该方法.
  • visualTransform() 方法确实是一个内部方法,不是 Power BI 直接调用的.在 BarChart 的情况下,它由 update() 方法调用,因此箭头是正确的.大多数视觉对象都有某种方法,用于将 Power BI DataView 结构转换为内部结构(有时转换为一些额外的计算).
  • constructorupdate() 方法都具有向 Power BI 提供回调机制的参数(选项),例如 ISelectionManager (通过 options.host.createSelectionManager()),它会改变视觉对象与 Power BI 视觉对象的其余部分的交互.

自定义视觉对象如何与 Power BI 交互的结构从一开始就没有太大变化.只是有了新的 API,交互和可能性发生了变化:曾经是一个开放的世界,但现在它是有限的.

希望这有助于您更好地了解 Power BI 自定义视觉对象.

-JP

I find it difficult to wrap my head around developing a PowerBI visual from scratch. I was reading wiki, guide, inspecting examples, but still feel like there's a huge gap in understanding how it works internally - it did not 'click'. (I understand basics of how D3 works so not too worried about that part)


Question:

I hope I'm not asking too much, but could someone, using this barchart as an example, post a sequence of which methods in the visual source are called (and how the data is converted and passed) when:

  • The visual is added to the dashboard in PowerBI,

  • A category and a measure are assigned to the visual,

  • Data filter in PowerBI changes,

  • An element on our custom visual is selected.

  • Your option which you think may be relevant


I used this specific visual as an example because it was mentioned as meeting minimum requirements for contributing a new custom visual, which sounds like a good starting point, source:

New Visual Development

Please follow our minimum requirements for implementing a new visual. See the wiki here.

(the link references the barchart tutorial)

However, if you have a better example visual - please use that instead.


This is all I got:


Many thanks in advance.

解决方案

I also have some extra and more generic additions:

  • Power BI uses the capabilities.json structure to determine a) what should be data pane (dataRoles) and how Power BI bind that data to your visual (dataViewMappings) and b) what can be shown in the formatting pane (e.g. placeholders).
  • the enumerateObjectInstances() is an optional method that is used by Power BI to initialize the formatting pane. The structure returned by this method should be equal to the structure in the capabilities.json file.
  • the update() method (required) is called when something is changing regarding your visual. Besides databinding changes, also a resize of the visual or a format option triggers the method.
  • the visualTransform() method is indeed an internal method and not directly called by Power BI. In case of the BarChart it is called by the update() method so the arrow is correct. Most visuals have some kind of method and it is used to convert the Power BI DataView structure to the internal structure (and sometimes to some extra calculations).
  • Both the constructor and the update() method have parameters (options) which provides callback mechanisms to Power BI, like the ISelectionManager (via options.host.createSelectionManager()), which alters the interaction of the visual with the rest of the Power BI visuals.

The structure of how custom visuals are interacting with Power BI hasn't changed that much since the beginning. Only with the new API the interaction and possibilities has changed: is used to be an open world, but now it is limited.

Hope this helps you in gaining a better overview of a Power BI custom visual.

-JP

这篇关于开发 PowerBI 视觉效果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆