Skip to content

Commit 390d9d3

Browse files
authored
[visio] (Overview) Remove top-level Visio overview page (#5285)
* Remove old overview * Update style
1 parent 521f12b commit 390d9d3

File tree

7 files changed

+26
-72
lines changed

7 files changed

+26
-72
lines changed

.openpublishing.redirection.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1342,6 +1342,14 @@
13421342
"source_path": "docs/outlook/privacy-and-security.md",
13431343
"redirect_url": "/office/dev/add-ins/concepts/privacy-and-security"
13441344
},
1345+
{
1346+
"source_path": "docs/reference/overview/visio-javascript-reference-overview.md",
1347+
"redirect_url": "/office/dev/add-ins/visio/visio-overview"
1348+
},
1349+
{
1350+
"source_path": "docs/visio/index.yml",
1351+
"redirect_url": "/office/dev/add-ins/visio/visio-overview"
1352+
},
13451353
{
13461354
"source_path": "docs/outlook/add-in-requirements.md",
13471355
"redirect_url": "/office/dev/add-ins/concepts/requirements-for-running-office-add-ins"

docs/includes/office-js-api-models.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ The Office JavaScript API includes two distinct models:
1010
This API model uses [promises](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise) and allows you to specify multiple operations in each request you send to the Office application. Batching operations in this manner can significantly improve add-in performance in Office applications on the web. Application-specific APIs were introduced with Office 2016.
1111

1212
> [!NOTE]
13-
> There's also an application-specific API for [Visio](../reference/overview/visio-javascript-reference-overview.md), but you can use it only in SharePoint Online pages to interact with Visio diagrams that have been embedded in the page. Office Web Add-ins are not supported in Visio.
13+
> There's also an application-specific API for [Visio](../visio/visio-overview.md), but you can use it only in SharePoint Online pages to interact with Visio diagrams that have been embedded in the page. Office Web Add-ins are not supported in Visio.
1414
1515
See [Using the application-specific API model](../develop/application-specific-api-model.md) to learn more about this API model.
1616

-19.7 KB
Binary file not shown.

docs/toc.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1002,11 +1002,8 @@ items:
10021002

10031003
- name: Visio
10041004
items:
1005-
- name: Visio documentation
1006-
href: visio/index.yml
1007-
displayName: Visio
10081005
- name: Overview
1009-
href: reference/overview/visio-javascript-reference-overview.md
1006+
href: visio/visio-overview.md
10101007
displayName: Visio
10111008
- name: API reference
10121009
href: reference/visio-api-reference.md

docs/visio/index.yml

Lines changed: 0 additions & 51 deletions
This file was deleted.

docs/reference/overview/visio-javascript-reference-overview.md renamed to docs/visio/visio-overview.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
---
22
title: Visio JavaScript API overview
33
description: Overview of the Visio JavaScript API.
4-
ms.date: 07/18/2022
4+
ms.date: 07/15/2025
55
ms.service: visio
66
ms.topic: overview
77
ms.custom: scenarios:getting-started
8-
ms.localizationpriority: high
8+
ms.localizationpriority: medium
99
---
1010

1111
# Visio JavaScript API overview
1212

13-
You can use the Visio JavaScript APIs to embed Visio diagrams in *classic* SharePoint pages in SharePoint Online. (This extensibility feature is not supported in on-premise SharePoint or on SharePoint Framework pages.)
13+
You can use the Visio JavaScript APIs to embed Visio diagrams in *classic* SharePoint pages in SharePoint Online. (This extensibility feature isn't supported in on-premises SharePoint or SharePoint Framework pages.)
1414

15-
An embedded Visio diagram is a diagram that is stored in a SharePoint document library and displayed on a SharePoint page. To embed a Visio diagram, display it in an HTML `<iframe>` element. Then you can use Visio JavaScript APIs to programmatically work with the embedded diagram.
15+
An embedded Visio diagram is stored in a SharePoint document library and displayed on a SharePoint page. To embed a Visio diagram, display it in an HTML `<iframe>` element. Then use Visio JavaScript APIs to programmatically work with the embedded diagram.
1616

1717
![Visio diagram in iframe on SharePoint page along with script editor web part.](../images/visio-api-block-diagram.png)
1818

@@ -23,7 +23,7 @@ You can use the Visio JavaScript APIs to:
2323
- Write custom handlers for mouse events within the drawing.
2424
- Expose diagram data, such as shape text, shape data, and hyperlinks, to your solution.
2525

26-
This article describes how to use the Visio JavaScript APIs with Visio on the web to build your solutions for SharePoint Online. It introduces key concepts that are fundamental to using the APIs, such as `EmbeddedSession`, `RequestContext`, and JavaScript proxy objects, and the `sync()`, `Visio.run()`, and `load()` methods. The code examples show you how to apply these concepts.
26+
This article describes how to use the Visio JavaScript APIs with Visio on the web to build solutions for SharePoint Online. It introduces key concepts that are fundamental to using the APIs, such as `EmbeddedSession`, `RequestContext`, and JavaScript proxy objects, and the `sync()`, `Visio.run()`, and `load()` methods. The code examples show you how to apply these concepts.
2727

2828
## EmbeddedSession
2929

@@ -38,13 +38,13 @@ session.init().then(function () {
3838

3939
## Visio.run(session, function(context) { batch })
4040

41-
`Visio.run()` executes a batch script that performs actions on the Visio object model. The batch commands include definitions of local JavaScript proxy objects and `sync()` methods that synchronize the state between local and Visio objects and promise resolution. The advantage of batching requests in `Visio.run()` is that when the promise is resolved, any tracked page objects that were allocated during the execution will be automatically released.
41+
`Visio.run()` executes a batch script that performs actions on the Visio object model. The batch commands include definitions of local JavaScript proxy objects and `sync()` methods that synchronize the state between local and Visio objects and promise resolution. The advantage of batching requests in `Visio.run()` is that when the promise is resolved, any tracked page objects that were allocated during execution are automatically released.
4242

43-
The `run` function takes in session and RequestContext object and returns a promise (typically, just the result of `context.sync()`). It is possible to run the batch operation outside of the `Visio.run()`. However, in such a scenario, any page object references needs to be manually tracked and managed.
43+
The `run` function takes in session and RequestContext object and returns a promise (typically, just the result of `context.sync()`). You can run the batch operation outside of `Visio.run()`. However, in such a scenario, any page object references need to be manually tracked and managed.
4444

4545
## RequestContext
4646

47-
The RequestContext object facilitates requests to the Visio application. Because the developer frame and the Visio web client run in two different iframes, the RequestContext object (context in next example) is required to get access to Visio and related objects such as pages and shapes, from the developer frame.
47+
The RequestContext object facilitates requests to the Visio application. Because the developer frame and the Visio web client run in two different iframes, the RequestContext object (context in the next example) is required to get access to Visio and related objects such as pages and shapes from the developer frame.
4848

4949
```js
5050
function hideToolbars() {
@@ -63,9 +63,9 @@ function hideToolbars() {
6363

6464
## Proxy objects
6565

66-
The Visio JavaScript objects declared and used in an embedded session are proxy objects for the real objects in a Visio document. All actions taken on proxy objects are not realized in Visio, and the state of the Visio document is not realized in the proxy objects until the document state has been synchronized. The document state is synchronized when `context.sync()` is run.
66+
The Visio JavaScript objects declared and used in an embedded session are proxy objects for the real objects in a Visio document. All actions taken on proxy objects aren't realized in Visio, and the state of the Visio document isn't realized in the proxy objects until the document state has been synchronized. The document state is synchronized when `context.sync()` is run.
6767

68-
For example, the local JavaScript object getActivePage is declared to reference the selected page. This can be used to queue the setting of its properties and invoking methods. The actions on such objects are not realized until the `sync()` method is run.
68+
For example, the local JavaScript object getActivePage is declared to reference the selected page. You can use this to queue the setting of its properties and invoke methods. The actions on such objects aren't realized until the `sync()` method is run.
6969

7070
```js
7171
const activePage = context.document.getActivePage();
@@ -77,7 +77,7 @@ The `sync()` method synchronizes the state between JavaScript proxy objects and
7777

7878
## load()
7979

80-
The `load()` method is used to fill in the proxy objects created in the JavaScript layer. When trying to retrieve an object such as a document, a local proxy object is created first in the JavaScript layer. Such an object can be used to queue the setting of its properties and invoking methods. However, for reading object properties or relations, the `load()` and `sync()` methods need to be invoked first. The load() method takes in the properties and relations that need to be loaded when the `sync()` method is called.
80+
The `load()` method is used to fill in the proxy objects created in the JavaScript layer. When trying to retrieve an object such as a document, a local proxy object is created first in the JavaScript layer. You can use such an object to queue the setting of its properties and invoke methods. However, for reading object properties or relations, the `load()` and `sync()` methods need to be invoked first. The load() method takes in the properties and relations that need to be loaded when the `sync()` method is called.
8181

8282
The following shows the syntax for the `load()` method.
8383

@@ -117,7 +117,7 @@ Visio.run(session, function (context) {
117117

118118
## Error messages
119119

120-
Errors are returned using an error object that consists of a code and a message. The following table provides a list of possible error conditions that can occur.
120+
Errors are returned using an error object that consists of a code and a message. The following table provides a list of possible error conditions.
121121

122122
| error.code | error.message |
123123
|-----------------------|----------------------------------------------------------------|
@@ -130,7 +130,7 @@ Errors are returned using an error object that consists of a code and a message.
130130

131131
## Get started
132132

133-
You can use the example in this section to get started. This example shows you how to programmatically display the shape text of the selected shape in a Visio diagram. To begin, create a classic page in SharePoint Online or edit an existing page. Add a script editor webpart on the page and copy-paste the following code.
133+
You can use the example in this section to get started. This example shows you how to programmatically display the shape text of the selected shape in a Visio diagram. To begin, create a classic page in SharePoint Online or edit an existing page. Add a script editor web part on the page and copy-paste the following code.
134134

135135
```HTML
136136
<script src='https://appsforoffice.microsoft.com/embedded/1.0/visio-web-embedded.js' type='text/javascript'></script>
@@ -192,12 +192,12 @@ function getSelectedShapeText() {
192192
</script>
193193
```
194194

195-
After that, all you need is the URL of a Visio diagram that you want to work with. Just upload the Visio diagram to SharePoint Online and open it in Visio on the web. From there, open the Embed dialog and use the Embed URL in the above example.
195+
After that, all you need is the URL of a Visio diagram that you want to work with. Upload the Visio diagram to SharePoint Online and open it in Visio on the web. From there, open the Embed dialog and use the Embed URL in the above example.
196196

197197
![Copy Visio file URL from Embed dialog.](../images/Visio-embed-url.png)
198198

199-
If you are using Visio on the web in Edit mode, open the Embed dialog by choosing **File** > **Share** > **Embed**. If you are using Visio on the web in View mode, open the Embed dialog by choosing '...' and then **Embed**.
199+
If you're using Visio on the web in Edit mode, open the Embed dialog by choosing **File** > **Share** > **Embed**. If you're using Visio on the web in View mode, open the Embed dialog by choosing '...' and then **Embed**.
200200

201201
## Visio JavaScript API reference
202202

203-
For detailed information about Visio JavaScript API, see the [Visio JavaScript API reference documentation](/javascript/api/visio).
203+
For detailed information about the Visio JavaScript API, see the [Visio JavaScript API reference documentation](/javascript/api/visio).

0 commit comments

Comments
 (0)