Rectangles drawn on a layer of a map. The endpoints are served from /new_api/projects/{projectId}/maps/{mapId}/layers/{layerId}/rects/.

1. List rectangles

Returns a page of all rectangles belonging to the given layer, each with its position, size, fill and border. The response is paginated (content, totalPages, totalElements, size, number).

Note
The result is paged - use the page and size query parameters to walk through it.

1.1. HTTP request

GET /minerva/new_api/projects/test_project/maps/408/layers/205/rects/ HTTP/1.1

1.2. Path Parameters

Table 1. /minerva/new_api/projects/{projectId}/maps/{mapId}/layers/{layerId}/rects/
Parameter Description

projectId

project identifier

mapId

map identifier

layerId

layer identifier

1.3. Query Parameters

Parameter Description

page

index of the page to fetch, counted from 0; 0 by default

size

number of entries on a page; 20 by default, 10000 at most

1.4. CURL sample

$ curl 'https://minerva-dev.lcsb.uni.lu/minerva/new_api/projects/test_project/maps/408/layers/205/rects/' -X GET \
    -H 'Authorization: Bearer xxxxxxxx'

1.5. HTTP response

HTTP/1.1 200 OK

1.6. Response Fields

Path Type Description

content

Array

list of rectangles on the page

content[].id

Number

unique shape identifier

content[].layer

Number

layer identifier

content[].x

Number

x coordinate of the top left corner

content[].y

Number

y coordinate of the top left corner

content[].z

Number

z coordinate (z-index)

content[].width

Number

width of the shape

content[].height

Number

height of the shape

content[].borderThickness

Number

thickness of the border

content[].fillColor

String

color used to fill the interior of the shape; #RRGGBBAA string

content[].borderColor

String

color used to draw the outline of the shape; #RRGGBBAA string

content[].size

Number

size (area) of the shape

totalPages

Number

total number of pages

totalElements

Number

total number of elements

numberOfElements

Number

number of elements on this page

size

Number

page size

number

Number

page number

1.7. Sample Response

{
  "content" : [ {
    "id" : 181,
    "borderColor" : "#000000ff",
    "borderThickness" : 1.0,
    "fillColor" : "#ffffffff",
    "x" : 1.0,
    "y" : 2.0,
    "z" : 12,
    "width" : 3.0,
    "height" : 4.0,
    "layer" : 205,
    "size" : 12.0,
    "elementId" : "x=1.0;y=2.0; w=3.0, h=4.0"
  } ],
  "totalPages" : 1,
  "totalElements" : 1,
  "numberOfElements" : 1,
  "size" : 20,
  "number" : 0
}

2. Get rectangle

Returns a single rectangle identified by its id: the top left corner (x, y), its width/height, the fill color, the border color and thickness, and size, the area it covers.

2.1. HTTP request

GET /minerva/new_api/projects/test_project/maps/406/layers/204/rects/180 HTTP/1.1

2.2. Path Parameters

Table 2. /minerva/new_api/projects/{projectId}/maps/{mapId}/layers/{layerId}/rects/{layerRectId}
Parameter Description

projectId

project identifier

mapId

map identifier

layerId

layer identifier

layerRectId

rectangle identifier

2.3. CURL sample

$ curl 'https://minerva-dev.lcsb.uni.lu/minerva/new_api/projects/test_project/maps/406/layers/204/rects/180' -X GET \
    -H 'Authorization: Bearer xxxxxxxx'

2.4. HTTP response

HTTP/1.1 200 OK

2.5. Response Fields

Path Type Description

id

Number

unique shape identifier

layer

Number

layer identifier

x

Number

x coordinate of the top left corner

y

Number

y coordinate of the top left corner

z

Number

z coordinate (z-index)

width

Number

width of the shape

height

Number

height of the shape

borderThickness

Number

thickness of the border

fillColor

String

color used to fill the interior of the shape; #RRGGBBAA string

borderColor

String

color used to draw the outline of the shape; #RRGGBBAA string

size

Number

size (area) of the shape

2.6. Sample Response

{
  "id" : 180,
  "borderColor" : "#000000ff",
  "borderThickness" : 1.0,
  "fillColor" : "#ffffffff",
  "x" : 1.0,
  "y" : 2.0,
  "z" : 12,
  "width" : 3.0,
  "height" : 4.0,
  "layer" : 204,
  "size" : 12.0,
  "elementId" : "x=1.0;y=2.0; w=3.0, h=4.0"
}

3. Add rectangle

Draws a new rectangle on the layer, spanning from the top left corner (x, y) over width/height, filled with fillColor and outlined with borderColor of borderThickness.

3.1. HTTP request

POST /minerva/new_api/projects/test_project/maps/404/layers/203/rects/ HTTP/1.1

3.2. Path Parameters

Table 3. /minerva/new_api/projects/{projectId}/maps/{mapId}/layers/{layerId}/rects/
Parameter Description

projectId

project identifier

mapId

map identifier

layerId

layer identifier

3.3. Request Fields

Path Type Description

x

Number

x coordinate of the top left corner

y

Number

y coordinate of the top left corner

z

Number

z coordinate (z-index)

width

Number

width of the shape

height

Number

height of the shape

borderThickness

Number

thickness of the border

fillColor

String

color used to fill the interior of the shape; #RRGGBBAA string

borderColor

String

color used to draw the outline of the shape; #RRGGBBAA string

3.4. CURL sample

$ curl 'https://minerva-dev.lcsb.uni.lu/minerva/new_api/projects/test_project/maps/404/layers/203/rects/' -X POST \
    -H 'Authorization: Bearer xxxxxxxx' \
    -d '{"fillColor":"#0000ffff","borderColor":"#c0c0c0ff","borderThickness":3.0,"x":2.2,"y":3.3,"width":12.1,"height":11.1,"z":5}' \
    -H 'Content-Type: application/json'

3.5. HTTP response

HTTP/1.1 201 Created

3.6. Response Fields

Path Type Description

id

Number

unique shape identifier

layer

Number

layer identifier

x

Number

x coordinate of the top left corner

y

Number

y coordinate of the top left corner

z

Number

z coordinate (z-index)

width

Number

width of the shape

height

Number

height of the shape

borderThickness

Number

thickness of the border

fillColor

String

color used to fill the interior of the shape; #RRGGBBAA string

borderColor

String

color used to draw the outline of the shape; #RRGGBBAA string

size

Number

size (area) of the shape

3.7. Sample Response

{
  "id" : 179,
  "borderColor" : "#c0c0c0ff",
  "borderThickness" : 3.0,
  "fillColor" : "#0000ffff",
  "x" : 2.2,
  "y" : 3.3,
  "z" : 5,
  "width" : 12.1,
  "height" : 11.1,
  "layer" : 203,
  "size" : 134.31,
  "elementId" : "x=2.2;y=3.3; w=12.1, h=11.1"
}

4. Update rectangle

Replaces the geometry and the style of the rectangle - its x, y, z, width, height, fillColor, borderColor and borderThickness - so the complete set of values has to be sent.

Note
Supports optimistic locking via the If-Match header.

4.1. HTTP request

PUT /minerva/new_api/projects/test_project/maps/412/layers/207/rects/183 HTTP/1.1

4.2. Path Parameters

Table 4. /minerva/new_api/projects/{projectId}/maps/{mapId}/layers/{layerId}/rects/{layerRectId}
Parameter Description

projectId

project identifier

mapId

map identifier

layerId

layer identifier

layerRectId

rectangle identifier

4.3. Request Fields

Path Type Description

x

Number

x coordinate of the top left corner

y

Number

y coordinate of the top left corner

z

Number

z coordinate (z-index)

width

Number

width of the shape

height

Number

height of the shape

borderThickness

Number

thickness of the border

fillColor

String

color used to fill the interior of the shape; #RRGGBBAA string

borderColor

String

color used to draw the outline of the shape; #RRGGBBAA string

4.4. CURL sample

$ curl 'https://minerva-dev.lcsb.uni.lu/minerva/new_api/projects/test_project/maps/412/layers/207/rects/183' -X PUT \
    -H 'Authorization: Bearer xxxxxxxx' \
    -d '{"fillColor":"#0000ffff","borderColor":"#c0c0c0ff","borderThickness":1.0,"x":2.2,"y":3.3,"width":12.1,"height":11.1,"z":5}' \
    -H 'Content-Type: application/json'

4.5. HTTP response

HTTP/1.1 200 OK

4.6. Response Fields

Path Type Description

id

Number

unique shape identifier

layer

Number

layer identifier

x

Number

x coordinate of the top left corner

y

Number

y coordinate of the top left corner

z

Number

z coordinate (z-index)

width

Number

width of the shape

height

Number

height of the shape

borderThickness

Number

thickness of the border

fillColor

String

color used to fill the interior of the shape; #RRGGBBAA string

borderColor

String

color used to draw the outline of the shape; #RRGGBBAA string

size

Number

size (area) of the shape

4.7. Sample Response

{
  "id" : 183,
  "borderColor" : "#c0c0c0ff",
  "borderThickness" : 1.0,
  "fillColor" : "#0000ffff",
  "x" : 2.2,
  "y" : 3.3,
  "z" : 5,
  "width" : 12.1,
  "height" : 11.1,
  "layer" : 207,
  "size" : 134.31,
  "elementId" : "x=2.2;y=3.3; w=12.1, h=11.1"
}

5. Delete rectangle

Removes the rectangle from the layer; the rest of the layer content is left untouched.

Note
Supports optimistic locking via the If-Match header.

5.1. HTTP request

DELETE /minerva/new_api/projects/test_project/maps/410/layers/206/rects/182 HTTP/1.1

5.2. Path Parameters

Table 5. /minerva/new_api/projects/{projectId}/maps/{mapId}/layers/{layerId}/rects/{layerRectId}
Parameter Description

projectId

project identifier

mapId

map identifier

layerId

layer identifier

layerRectId

rectangle identifier

5.3. CURL sample

$ curl 'https://minerva-dev.lcsb.uni.lu/minerva/new_api/projects/test_project/maps/410/layers/206/rects/182' -X DELETE \
    -H 'Authorization: Bearer xxxxxxxx'

5.4. HTTP response

HTTP/1.1 200 OK