app-examples icon indicating copy to clipboard operation
app-examples copied to clipboard

Connectors without start and end items (free standing lines)

Open MTRNord opened this issue 1 year ago • 2 comments

Hi.

I am wondering how I would get the size of a connector without start and end items. This happens if you draw a line on a frame/board.

grafik

In the api it looks like this:

{
  "shape": "straight",
  "boardId": "redacted",
  "id": "redacted",
  "createdAt": "2025-01-15T15:12:06.000Z",
  "createdBy": { "id": "redacted", "type": "user"},
  "isSupported": false,
  "links": {
    "self": "https://api.miro.com/v2/boards/uXjVLvatKbA%3D/connectors/redacted"
  },
  "modifiedAt": "2025-01-15T15:12:06.000Z",
  "modifiedBy": { "id": "redacted", "type": "user" },
  "style":  {
    "endStrokeCap": "none",
    "startStrokeCap": "none",
    "strokeColor": "#333333",
    "strokeStyle": "normal",
    "strokeWidth": "2.0"
  },
  "type": "connector"
}

Meaning there is no position info available. Is this an api bug? If so where do I file this?

MTRNord avatar Jan 15 '25 15:01 MTRNord

Hey @MTRNord ,

Good question. At the moment, I'm afraid it's not possible to get the position or size details of a connector via API if it doesn't have an associated start and end item (freestanding lines).

However, you may be able to get more helpful detail via our Web SDK. You can test this quick by calling the connector or selection methods from your browser console: Screenshot 2025-01-15 at 10 58 43 AM

It's great feedback to support freestanding lines more comprehensively though, and I'm happy to share this feedback.

bishopwm avatar Jan 15 '25 16:01 bishopwm

Hm interesting. But your example also I think is still missing the coordinates to actually position it 🤔 So its also incomplete to actually know where a line is.

Sadly for my usecase this is not a solution right now. It would be nice to have it via the API. However its not in any way urgent or anything currently as I have enough other tasks to deal with anyway :) Thanks for providing an api at all!

MTRNord avatar Jan 17 '25 12:01 MTRNord