Skip to content

v2.1.0

Choose a tag to compare

@ShadAhm ShadAhm released this 05 Oct 14:19
· 68 commits to master since this release
1655442

Free text labels on a seat map

A map can now carry plain text, such as section names like "Balcony" or "Table 3". Add an element with kind: "label":

{ "id": "heading", "kind": "label", "label": "Balcony", "x": 50, "y": 8, "width": 20, "height": 5 }

It draws only its text, with no box or outline. Before, a label element was drawn as a filled rectangle with the text inside.

  • The text is centred in the element's box, and width and height still place and size it.
  • The text size follows the box height and shrinks so a long label fits the box width.
  • rotation turns the text about the centre of the box.
  • The text colour comes from the usual element colour tokens.
  • An element with no label text draws nothing.
  • Other element kinds draw as before.

Both @kerusiweb/react and @kerusiweb/angular draw it. @kerusiweb/core adds a text shape to elementStyle, so apps that draw the map themselves, such as an editor preview, can match the renderer.

Upgrading

This release is backwards compatible. Update all three packages to 2.1.0 together:

npm install @kerusiweb/core@2.1.0 @kerusiweb/react@2.1.0

(Use @kerusiweb/angular@2.1.0 instead of the React package for Angular.) The React and Angular packages now need @kerusiweb/core 2.1.0 or later, since they rely on the new shape.

Full details are in the changelog.

Closes #21