与与底层信息中心元素关联的查询 ID 匹配的查询对象,该元素会应用信息中心级别进行的任何信息中心过滤条件和时区更改。
lastRunSourceElementId
触发上次信息中心运行的功能块扩展元素的 ID。如果信息中心运行是通过信息中心的 Run 按钮或自动刷新触发的,或者是使用嵌入 SDK 触发的,则 ID 将未定义。如果功能块配置为“探索”,系统不会填充此属性。请注意,lastRunSourceElementId 可以与当前扩展程序实例的元素 ID 相同。例如,如果扩展程序触发信息中心运行,则在信息中心运行开始和结束时,扩展程序会收到通知。
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-09-03。"],[],[],null,["# Building tile extensions\n\nStarting in Looker 24.0, extensions can be developed to run in a tile in dashboards. Extensions that support being run as a tile or visualization can be [added while the dashboard is in edit mode](/looker/docs/creating-user-defined-dashboards#adding_extensions) or [saved to a dashboard as a visualization from an Explore](/looker/docs/viewing-and-interacting-with-explores#the_explore_actions_gear_menu). Extensions can also be configured as tiles in [LookML dashboards](/looker/docs/building-lookml-dashboards).\n\nExamples of extensions that can be used as dashboard tiles are available:\n\n- The [tile visualization extension](https://github.com/looker-open-source/extension-examples/tree/main/react/javascript/tile-visualization) shows how to build a custom visualization using the extension framework.\n- The [tile sdk extension](https://github.com/looker-open-source/extension-examples/tree/main/react/javascript/tile-sdk) shows the available API methods that are specific to tile extensions.\n\n| **Caution:** Embedded Looker content (such as reports, dashboards, Looks, Explores, LookML dashboards, and query visualizations) can't be used in tile extensions.\n\nUsing the Looker Extension SDK with tile extensions\n---------------------------------------------------\n\nTile extensions require the [`mount_points` parameter](/looker/docs/reference/param-manifest-application#mount_points) to be defined in the LookML [project manifest file](/looker/docs/lookml-project-files#project_manifest_files) in order for extensions to be loaded as tiles into a dashboard. There are two types of `mount_points` related to tile extensions: \n\n mount_points: {\n dashboard_vis: yes\n dashboard_tile: yes\n standalone: yes\n }\n\n- `dashboard_vis` --- When enabled, the extension will appear in the [visualization options of an Explore](/looker/docs/creating-visualizations#choosing_a_visualization_type), where the extension can be selected as a visualization and [saved as a dashboard tile](/looker/docs/creating-user-defined-dashboards#adding_query_tiles_from_an_explore). When the dashboard is run, the dashboard will execute the query associated with the tile and make the data available to the extension. This is similar to how [custom visualizations](/looker/docs/reference/param-manifest-visualization) work. The primary difference between a custom visualization and an extension running in a dashboard tile that has `dashboard_vis` enabled, is that the extension may make [Looker API](/looker/docs/reference/looker-api/latest) calls.\n- `dashboard_tile` --- When enabled, the extension will appear in the [**Extensions** panel](/looker/docs/creating-user-defined-dashboards#adding_extensions) that is displayed when a user is editing a dashboard and selects the **Extensions** option after clicking the **Add** button. This type of extension is responsible for retrieving its own data, instead of the having the tile query automatically supply the extension with data.\n\nAn additional mount point, `standalone`, causes the extension to appear under the **Applications** section of the Looker main menu. It is possible for an extension to have multiple mount points defined. At runtime, the extension is notified how it is mounted and it can adjust its behavior accordingly. For example, [`standalone` extensions may need to set their own height, while tile extensions don't](/looker/docs/extension-framework-building-tile-extensions#building_reactive_extensions).\n\nTile extension additional APIs\n------------------------------\n\nTile extensions are provided with additional APIs and data at runtime. These are obtained from the extension context: \n\n const {\n tileSDK,\n tileHostData,\n visualizationData,\n visualizationSDK,\n } = useContext(ExtensionContext40)\n\n- `tileSDK` --- Provides tile-specific functions to allow the extension to interact with the Looker dashboard host. For example, to allow the extension to display and clear error messages.\n- `tileHostData` --- Provides tile data to the extension. The data is automatically updated based upon interactions with the hosting dashboard. An example is the `isDashboardEditing` indicator.\n- `visualizationSDK` --- Provides visualization-specific functions to allow the extension to interact with the Looker dashboard host. An example is the `updateRowLimit` function.\n- `visualizationData` --- Provides visualization data to the extension. The data is automatically updated based upon interactions with the hosting dashboard. The data is similar to the data that is provided to [custom visualizations](/looker/docs/reference/param-manifest-visualization).\n\nBuilding reactive extensions\n----------------------------\n\nThe iframes that extensions run in automatically resize as the parent Looker host window resizes. This is automatically reflected in the iframe content window. The iframe component does not have any padding or margin so it is up to the extension to provide its own padding and margin so that it looks consistent with the Looker application. For standalone extensions, it is up to the extension to control the extension height. For extensions that run in dashboard tiles or Explore visualizations, the iframe content window will automatically be set to the height that is made available by the iframe.\n\nRendering considerations\n------------------------\n\nIt is important to note that tile extensions will be rendered when a dashboard is downloaded as a PDF or an image. The renderer expects that the tile will notify it when rendering is complete. If this is not done, the renderer will stop responding. The following is an example of how to notify the renderer that the tile has rendered. \n\n const { extensionSDK } = useContext(ExtensionContext40)\n\n useEffect(() =\u003e {\n extensionSDK.rendered()\n }, [])\n\nAnimations should also be disabled when rendering. The following is an example where animation configurations are turned off when rendering: \n\n const { lookerHostData} = useContext(ExtensionContext40)\n const isRendering = lookerHostData?.isRendering\n\n const config = isRendering\n ? {\n ...visConfig,\n valueCountUp: false,\n waveAnimateTime: 0,\n waveRiseTime: 0,\n waveAnimate: false,\n waveRise: false,\n }\n : visConfig\n\n if (mountPoint === MountPoint.dashboardVisualization) {\n return \u003cVisualizationTile config={config} /\u003e\n }\n\nTile SDK functions and properties\n---------------------------------\n\nThe tile SDK provides functions that allow a tile extension to interact with its hosting dashboard.\n\nThe available functions and properties are shown in the following table:\n\nTile SDK data\n-------------\n\nThe available tile SDK data properties are shown in the following table:\n\nVisualization SDK functions and properties\n------------------------------------------\n\nThe available visualization SDK functions and properties are shown in the following table:\n\nVisualization SDK data\n----------------------\n\nThe visualization SDK consists of the following:\n\n- Visualization configuration data\n- Query response data\n\n### Visualization configuration data\n\n export interface VisualizationConfig {\n queryFieldMeasures: Measure[]\n queryFieldDimensions: Dimension[]\n queryFieldTableCalculations: TableCalculation[]\n queryFieldPivots: PivotConfig[]\n visConfig: RawVisConfig\n }\n\n### Query response data\n\nUsing the Embed SDK\n-------------------\n\nUsing the [Embed SDK](/looker/docs/embed-sdk-intro) in a tile extension is not recommended for the following reasons:\n\n- It is possible that the extension may end up rendering a dashboard that the extension is a tile in. The extension framework has no way of detecting this, and, as a result, the browser may crash.\n- PDF rendering of embedded content inside of a tile extension doesn't work."]]