You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: _docs/v0.57/embedding/sdk/plugins.md
+31-33Lines changed: 31 additions & 33 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,59 +15,57 @@ layout: new-docs
15
15
16
16
The Metabase Embedded analytics SDK supports plugins to customize the behavior of components. These plugins can be used in a global context or on a per-component basis.
17
17
18
-
## Global plugins
18
+
## Plugin scope
19
+
20
+
### Global plugins
19
21
20
22
To use a plugin globally, add the plugin to the `MetabaseProvider`'s `pluginsConfig` prop:
The plugin `mapQuestionClickActions` lets you to customize what happens when people click on a data point on a dashboard or chart. `mapQuestionClickActions` can be used globally, or on component level.
46
+
47
+
See [`mapQuestionClickActions` plugin](./questions#mapquestionclickactions) for more information and examples.
48
+
49
+
### `handleLink`
35
50
36
51
To customize what happens when people click a link in your embedded questions and dashboards, use the global plugin `handleLink`:
37
52
38
53
```typescript
39
-
exportdefaultfunction App() {
40
-
const navigate =useNavigate(); // coming from whatever routing lib you're using
The plugin `handleLink` can only be used [globally](#plugin-scope) on provider level.
58
+
59
+
### `getNoDataIllustration` and `getNoObjectIllustration`
60
+
61
+
By default, Metabase displays a sailboat image when a query returns no results. To use a different image, you can use `getNoDataIllustration` and `getNoObjectIllustration` plugins which can accept a custom base64-encoded image:
<p>The Metabase Embedded analytics SDK supports plugins to customize the behavior of components. These plugins can be used in a global context or on a per-component basis.</p>
4933
4933
4934
-
<h2id="global-plugins">Global plugins</h2>
4934
+
<h2id="plugin-scope">Plugin scope</h2>
4935
+
4936
+
<h3id="global-plugins">Global plugins</h3>
4935
4937
4936
4938
<p>To use a plugin globally, add the plugin to the <codeclass="language-plaintext highlighter-rouge">MetabaseProvider</code>’s <codeclass="language-plaintext highlighter-rouge">pluginsConfig</code> prop:</p>
<p>The plugin <codeclass="language-plaintext highlighter-rouge">mapQuestionClickActions</code> lets you to customize what happens when people click on a data point on a dashboard or chart. <codeclass="language-plaintext highlighter-rouge">mapQuestionClickActions</code> can be used globally, or on component level.</p>
4975
+
4976
+
<p>See <ahref="./questions#mapquestionclickactions"><codeclass="language-plaintext highlighter-rouge">mapQuestionClickActions</code> plugin</a> for more information and examples.</p>
<p>To customize what happens when people click a link in your embedded questions and dashboards, use the global plugin <codeclass="language-plaintext highlighter-rouge">handleLink</code>:</p>
<spanclass="k">return</span><spanclass="p">{</span><spanclass="na">handled</span><spanclass="p">:</span><spanclass="kc">false</span><spanclass="p">};</span><spanclass="c1">// let the sdk do the default behavior</span>
<spanclass="k">return</span><spanclass="p">{</span><spanclass="na">handled</span><spanclass="p">:</span><spanclass="kc">false</span><spanclass="p">};</span><spanclass="c1">// let the SDK do the default behavior</span>
<p>The plugin <codeclass="language-plaintext highlighter-rouge">handleLink</code> can only be used <ahref="#plugin-scope">globally</a> on provider level.</p>
5003
+
5004
+
<h3id="getnodataillustration-and-getnoobjectillustration"><codeclass="language-plaintext highlighter-rouge">getNoDataIllustration</code> and <codeclass="language-plaintext highlighter-rouge">getNoObjectIllustration</code></h3>
5005
+
5006
+
<p>By default, Metabase displays a sailboat image when a query returns no results. To use a different image, you can use <codeclass="language-plaintext highlighter-rouge">getNoDataIllustration</code> and <codeclass="language-plaintext highlighter-rouge">getNoObjectIllustration</code> plugins which can accept a custom base64-encoded image:</p>
<p>The plugins <codeclass="language-plaintext highlighter-rouge">getNoDataIllustration</code> and <codeclass="language-plaintext highlighter-rouge">getNoObjectIllustration</code> can only be used <ahref="#plugin-scope">globally</a> on provider level.</p>
0 commit comments