Skip to content

node shape size depends on the content #106

Answered by jason-rietzke
mssayari asked this question in Q&A
Discussion options

You must be logged in to vote

Alright I converted this issue to a discussion since this covers more of a general aspect that can not be easily reflected in an update of the library.

Solution

I took a look at your example code and I believe to have come up with a solution for your use case.

const schema = {
	type: "object",
	properties: {
		text: { type: "string" },
		color: { type: "string" },
	},
	required: ["text"],
};

export default {
	shapeSize: 300,
	shapePayload: schema,
	shapeBuilder: shapeBuilder,
};

function shapeBuilder(data, TemplateAPI) {
	const { ShapeStyle, TextCollection, CollectionStyle, Shape, isLight } = TemplateAPI;
	const config = {
		color: data.payload?.color || "#22d3ee",
		maxHeight: 250,
		m…

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by mssayari
Comment options

You must be logged in to vote
1 reply
@jason-rietzke
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #105 on May 08, 2023 23:43.