Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Height and width for images in nodes #1424

Open
ReyRodriguez opened this issue Apr 20, 2024 · 2 comments
Open

Height and width for images in nodes #1424

ReyRodriguez opened this issue Apr 20, 2024 · 2 comments

Comments

@ReyRodriguez
Copy link

I am using the NodeImageProgram to render some nodes that should be images, these images can have different heights and widths however I do not see an option to give custom sizes to the images
createNodeImageProgram({ drawingMode: "background", keepWithinCircle: false, size: {mode: 'auto'} })

The keepWithinCircle:false option helps me get closer to what I want to achieve but the images always come out square.
any way to achieve this?

@jacomyal
Copy link
Owner

I don't understand what you want exactly. Could you provide some drawing of some sort?

Just to be sure: For now at least, @sigma/node-image renders all nodes within a disc which is "craved" within a square. When keepWithinCircle is false, the square is displayed instead of the disc. Is that the issue? Are you looking for "non-square nodes"?

@ReyRodriguez
Copy link
Author

This is what i want to achieve
Captura de pantalla 2024-04-25 102457
And this is what I am getting
Captura de pantalla 2024-04-25 103003

this is the example image https://i.imgur.com/DJtIaNK.png

Look how the first image is rendered with an adequate width so that the entire image can be seen, but in the second it is cropped, the entire image cannot be seen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants