Solved

Document content: edges are missing labels

  • 19 April 2024
  • 2 replies
  • 58 views

Badge +1

I have created a diagram using Decision shapes with Yes and No lines.

 

I am using the Developer API to retrieve the document content using 
GET https://api.lucid.co/documents/:id/contents

 

The shapes have Text labels which are included in the retrieved content.

However, as far as I can tell, the line labels are missing in the retrieved content. I am unable to tell which lines correspond to Yes or No connections. Am I missing something here? Is there some other way to disambiguate the connecting lines?

 

 

 

icon

Best answer by Richard U 22 April 2024, 20:51

View original

Comments

Userlevel 3
Badge +7

 @Steve Strassmann Thanks for this question! The Line Resource in the Document Content Resource (JSON) has a textAreas property where you should see your line labels.

 

Below is an example of how this should appear, I hope it’s helpful! If you’re not seeing your line labels as textAreas in your JSON, please share your line resource and documentID so we can troubleshoot. 

 

Example

 

I created a similar diagram as your example (screenshot) and exported to JSON.

 

To illustrate this example, the items from the JSON export of this doc are pasted below:

"items": {
"shapes": [
{
"id": "RIkvBWKNEYBA",
"class": "TerminatorBlockV2",
"textAreas": [
{
"label": "Text",
"text": "Terminator shape (3)"
}
],
"customData": [],
"linkedData": []
},
{
"id": "yIkvrMCZd5LZ",
"class": "DecisionBlock",
"textAreas": [
{
"label": "Text",
"text": "Decision shape (1)"
}
],
"customData": [],
"linkedData": []
},
{
"id": "MIkvNIz8uAn-",
"class": "TerminatorBlockV2",
"textAreas": [
{
"label": "Text",
"text": "Terminator shape (2)"
}
],
"customData": [],
"linkedData": []
}
],
"lines": [
{
"id": "jJkvjg01cOo7",
"endpoint1": {
"style": "None",
"connectedTo": "yIkvrMCZd5LZ"
},
"endpoint2": {
"style": "Arrow",
"connectedTo": "MIkvNIz8uAn-"
},
"textAreas": [
{
"label": "Text",
"text": "Yes (line 1)"
}
],
"customData": [],
"linkedData": []
},
{
"id": "fJkvjlEl.8~S",
"endpoint1": {
"style": "None",
"connectedTo": "yIkvrMCZd5LZ"
},
"endpoint2": {
"style": "Arrow",
"connectedTo": "RIkvBWKNEYBA"
},
"textAreas": [
{
"label": "Text",
"text": "No (line 2)"
}
],
"customData": [],
"linkedData": []
}
],
"groups": [],
"layers": []
},

 

To determine line connections using shape IDs from the JSON, you can map which lines are connected to which shapes using the shape id property.

  • For each line in the lines list, you would take note of the connectedTo value of both endpoint1 and endpoint2.
  • This connectedTo value should match the id of one of the shapes in the shapes list.

For this example:

  • Line with ID jJkvjg01cOo7 has endpoint1 connected to shape with ID yIkvrMCZd5LZ (Decision shape 1) and endpoint2 connected to shape with ID MIkvNIz8uAn- (Terminator shape 2).
  • Line with ID fJkvjlEl.8~S has endpoint1 connected to shape with ID yIkvrMCZd5LZ (Decision shape 1) and endpoint2 connected to shape with ID RIkvBWKNEYBA (Terminator shape 3).
Badge +1

OK got it, thanks!

Reply