與底層資訊主頁元素相關聯的查詢 ID 相符的查詢物件,該元素會套用資訊主頁層級的任何資訊主頁篩選器和時區變更。
lastRunSourceElementId
觸發上次資訊主頁執行作業的資訊方塊額外資訊元素 ID。如果資訊主頁執行作業是由資訊主頁「執行」按鈕或自動重新整理觸發,或是是由內嵌 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"]],["上次更新時間:2025-09-04 (世界標準時間)。"],[],[],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."]]