Solved

# Question: How to Leverage Drawings that are Contextualized and LIVE and Hotspotted?

• 4 replies
• 75 views

Userlevel 2
• MVP
• 124 replies

scenarios we are working on,

1. To show PI&D diagram with annotations, which help to select the asset and create a threat for that asset.
2. Or draw a rectangle over the PI&D diagram to select multiple assets.

For the above two scenarios we are referring APIs in,

We are successful in getting the PI&D as image by following the below steps,

1. List Files
https://api.cognitedata.com/api/v1/projects/{project}/files

2. Convert a diagram to image format
https://api.cognitedata.com/api/v1/projects/{project}/context/diagram/convert/

3. Get the results for converting an engineering diagram to an image
https://api.cognitedata.com/api/v1/projects/{project}/context/diagram/convert/{jobId}

Could you please guide with APIs / JavaScript SDK methods we need to work on for the above mentioned two scenarios.

icon

Best answer by Ola Liabøtrø 24 January 2023, 09:45

View original

### 4 replies

Userlevel 1

Hi Ibrahim. Thank you for raising this. We plan to provide a public Javascript component for 2D documents with annotation support in Q3-4 2023. This will be a component/library separate from Reveal, but be based on similar ideas.

Userlevel 2

Its a custom app that we are building and i was hoping there was something similar to Cognite Reveal for engineering diagrams...is that what the new file viewer is? can we test it in beta

Hi Ibrahim.

Regarding your second second point; if you have access to Cognite Data Fusion, we have multiple apps such as Data Explorer and Interactive Engineering Diagrams where you can visualize and manually create annotations for your files. Currently, only annotations of types diagrams.AssetLink and diagrams.FileLink can be visualized and manually created in those apps. Moreover, annotations in these apps can only be edited and created one at a time.

Hope this helps,

Marvin

Hi!

The way to work with P&IDs going forward is to overlay them with annotations. An annotation denotes a region in a file and can link to e.g. assets. You can see documentation here:
https://docs.cognite.com/api/v1/#tag/Annotations

The convert to image flow will be deprecated. https://docs.cognite.com/api/v1/#tag/Engineering-diagrams/operation/diagramDetect is the easiest way to detect references to assets, but the output should be written to the annotations API.

The overlaying of annotations is handled by a unified file viewer component which is being rolled out to relevant applications. I am not sure which application is most ideal for the mentioned use cases, or if creating a custom app is the intention, but it should anyway be based on annotations.

Hope that helps!