From 350dbc2a212de04cdb3a79260340a8f1414b00f8 Mon Sep 17 00:00:00 2001 From: braks <78412429+bcakmakoglu@users.noreply.github.com> Date: Wed, 4 Jan 2023 13:22:22 +0100 Subject: [PATCH] chore: update changeset Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com> --- .changeset/bright-timers-itch.md | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/.changeset/bright-timers-itch.md b/.changeset/bright-timers-itch.md index 0bee5b15..c7669423 100644 --- a/.changeset/bright-timers-itch.md +++ b/.changeset/bright-timers-itch.md @@ -3,3 +3,32 @@ --- Allow setting `padding` option for `node.extent: 'parent'` + +Padding can be a `number[]` containing a maximum of 4 values. +The values are applied in the same order as CSS padding: top, right, bottom, left. +You can omit values at the end of the array, so `[10, 20]` is equivalent to `[10, 20, 10, 20]` etc. + +#### Usage + +```js +const nodes = ref([ + { + id: '4', + label: 'Node 4', + position: { x: 320, y: 200 }, + style: { backgroundColor: 'rgba(255, 0, 0, 0.7)', width: '300px', height: '300px' }, + }, + { + id: '4a', + label: 'Node 4a', + position: { x: 15, y: 65 }, + class: 'light', + extent: { + range: 'parent', + // apply 10 px padding to all four sides + padding: [10], + }, + parentNode: '4', + }, +]) +```