Skip to content

Commit 62460b6

Browse files
ziyuhehezhe
andauthored
Update (#33)
* Update * Update --------- Co-authored-by: zhe <[email protected]>
1 parent 075cba6 commit 62460b6

File tree

6 files changed

+82
-5
lines changed

6 files changed

+82
-5
lines changed

docs/add-functionality/authoring-library.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,16 +90,22 @@ The fields ["filters", "visualizationAppearances", "visualizationSelectedElement
9090

9191
An optional `props.dossierRenderingMode` field has been added to the props object in 2021 Update 3. The `props` parameter contains many fields. See [Methods and properties for an embedded dashboard](./methods-and-properties.md) for more information.
9292

93-
| Parameter Name | Data Type | Default Value | Available Values | Description | Required? |
94-
| -------------------------- | --------- | ------------- | ---------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------- |
95-
| props.dossierRenderingMode | String | consumption | ["consumption", "authoring"] | The value is either `consumption` or `authoring`. <br/> If it is `authoring` and the configuration `feature.dossier.authoring` isn't set, or its value isn't `true`, then an error is returned. | No |
93+
| Parameter Name | Data Type | Default Value | Available Values | Description | Required? |
94+
| -------------------------- | --------------- | ------------- | ---------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------- |
95+
| props.dossierRenderingMode | string | consumption | ["consumption", "authoring"] | The value is either `consumption` or `authoring`. <br/> If it is `authoring` and the configuration `feature.dossier.authoring` isn't set, or its value isn't `true`, then an error is returned. | No |
96+
| props.newDossier | boolean | false | [true, false] | If the value is true, the Embedding SDK will embed a new dossier authoring page. | No |
97+
| props.newDossierDatasetIds | Array\<string\> | N/A | The valid dataset IDs | When `newDossier` is `true`, the user can use this parameter to specify the datasets that are used to create the new dossier. | No |
98+
| props.authoringPauseMode | boolean | false | [true, false] | If the value is true, the Embedding SDK will embed a dossier authoring page on pause mode. | No |
9699

97100
Example:
98101

99102
```js
100103
microstrategy.dossier.create({
101104
// ...
102105
dossierRenderingMode: "authoring",
106+
newDossier: true,
107+
newDossierDatasetIds: ["E26BF608B14F1EA61086F3A61034AE21"],
108+
authoringPauseMode: false,
103109
});
104110
```
105111

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
---
2+
title: Improve embedding dossier page's performance
3+
description: Describes how to use goToPage() API to enhance the performance in some specific scenarios.
4+
---
5+
6+
This page introduces a method to improve the embedding performance in a specific case.
7+
8+
## The performance problem in a specific case
9+
10+
Sometimes the user may use a special web page layout like this:
11+
12+
![specialLayout](../images/special_embed_case.png)
13+
14+
On this web page, the left side is a dossier list, and the right side is a embedded dossier page. The dossier list might be fetched through some REST APIs like `GET /api/searches/results`, and the embedded dossier is normally rendered by calling the Embedding SDK API like `microstrategy.embeddingContexts.embedDossierConsumptionPage()`. When the user changes his selection on the left dossier list, the right side's embedded dossier will also change by calling `microstrategy.embeddingContexts.embedDossierConsumptionPage()` with new dossier id again in the same container.
15+
16+
It's similar as the process that the user first go to the Library homepage, then clicks a dossier item to enter the dossier page. However, if you simply write the program like this:
17+
18+
```javascript
19+
// Assume the parameters can be passed to this function after the user click
20+
async function onDossierListClicked({serverUrl, projectId, dossierId}) {
21+
await microstrategy.embeddingContexts.embedDossierConsumptionPage({
22+
serverUrl,
23+
projectId,
24+
objectId: dossierId,
25+
placeholder: document.getElementById("dossier-container"),
26+
...
27+
});
28+
}
29+
```
30+
31+
You will see sometimes the embedded dossier page will be loaded slower than entering the dossier page from the homepage on Library Web.
32+
33+
That's because the `microstrategy.embeddingContexts.embedDossierConsumptionPage()` API call on the same container will destroy the original iframe and create a new one. So its loading is like open the dossier in a new browser tab, in which we need to fetch all the resources, including the static resources and REST API result again. However, when the user enters the dossier page from homepage on Library Web, all these resources are cached and Library Web doesn't need to load them repeatedly.
34+
35+
## A better solution: Use `goToPage()`
36+
37+
To improve the performance of this use case and gain the similar performance as entering dossier pages from the Library homepage, we recommend you use the [EmbeddingContext.goToPage()](../embedding-context/#gotopagepageinfo) API like this:
38+
39+
```javascript
40+
let containerIdToContext = {};
41+
// If necessary, the user can also create instance by himself and pass the instance Id here
42+
async function onDossierListClicked({serverUrl, projectId, dossierId, instanceId}) {
43+
const containerId = "dossier-container";
44+
let embeddingContext;
45+
if (containerIdToContext[containerId]) {
46+
embeddingContext = containerIdToContext[containerId];
47+
await embeddingContext.goToPage({
48+
projectId,
49+
objectId: dossierId,
50+
instanceId,
51+
});
52+
} else {
53+
embeddingContext = await microstrategy.embeddingContexts.embedDossierConsumptionPage({
54+
serverUrl,
55+
projectId,
56+
objectId: dossierId,
57+
placeholder: document.getElementById(containerId),
58+
...
59+
});
60+
containerIdToContext[containerId] = embeddingContext;
61+
}
62+
}
63+
```
64+
65+
In this case, the `embeddingContext` can be retained, and the `goToPage()` call is similar as a simple redirect on the Library Web. So it has the similar performance as entering the dossier page from homepage on Library.

docs/images/special_embed_case.png

1.45 MB
Loading

docs/native-embedding-architecture/apply-filter.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,10 @@ Example of the attribute element list in the resolved value:
7676

7777
## Apply filters after embedded visualizations are rendered
7878

79-
After embedded visualizations have been rendered, you can use the `MstrDossier.getDossierDefinition()` function in the Native Embedding SDK to retrieve information about filters, selectors, and visualizations used as filters in the dashboard. After you have the key of the filter, selector, or visualization used as a filter, you can use the `MstrDossier.applyFilter()` function to manipulate it.
79+
After embedded visualizations have been rendered, you can use the `MstrDossier.getDossierDefinition()` function in the Native Embedding SDK to retrieve information about filters, selectors, and visualizations used as filters in the dashboard. After you have the key of the filter, selector, or visualization used as a filter, you can use the `MstrDossier.applyFilter()` or `MstrDossier.applyFilters()` function to manipulate it.
8080

8181
:::note
82-
For filters and selectors, we currently only support manipulating the selector type of the attribute element list.
82+
The `applyFilter()` or `applyFilters()` functions will first call REST API to apply filter on the current dossier instance, then **refresh the affected visualizations automatically**.
8383
:::
8484

8585
| `applyFilter()` | |

docs/whats-new-in-the-embedding-sdk.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ description: In each release, changes are made to make the MicroStrategy SDK mor
55

66
In each release, changes are made to make the MicroStrategy SDK more powerful and easier to use.
77

8+
## Strategy ONE September 2025
9+
10+
- [Support dataset ids and pause mode in embedded authoring](./add-functionality/authoring-library#api-for-entering-authoring-mode-or-disabling-authoring-mode-in-the-initial-loading)
11+
- Support to input dataset ids when embedding a new dossier authoring page, and set pause mode in the API `microstrategy.dossier.create()` in iframe Embedding SDK.
12+
813
## Strategy ONE August 2025
914

1015
- [Support Dashboard Instance Id in goToPage()](./embedding-context/#gotopagepageinfo)

sidebars.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ const sidebars = {
119119
"embedding-context/document-consumption-page-apis",
120120
"embedding-context/dossier-consumption-page-apis",
121121
"embedding-context/bot-consumption-page-apis",
122+
"embedding-context/gotopage-improve-performance",
122123
],
123124
},
124125
{

0 commit comments

Comments
 (0)