Repository navigation
v2.1.0
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
widthandheightstill place and size it. - The text size follows the box height and shrinks so a long label fits the box width.
rotationturns the text about the centre of the box.- The text colour comes from the usual element colour tokens.
- An element with no
labeltext 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