Using Typescript import {ViewportGizmo, type GizmoOptions} from "three-viewport-gizmo"; complains that Module '"three-viewport-gizmo"' has no exported member 'GizmoOptions'.
Thanks for the heads up! There are a few other issues that need to be addressed as well. I’ll let you know once the next commit is ready in the next couple of days.
I’ve done a full review of the library, cleaned things up, and made sure all TypeScript types are exposed. Plus, added a new VitePress documentation to make everything easier to follow. Take a look at the updated API—it should have what you need, including all the changes to the GizmoOptions.
Thanks! The new version show correctly. Almost.
If I put placement: "bottom-right", in the options, typescript complains:
Type 'string' is not assignable to type 'GizmoDomPlacement | undefined'.ts-plugin(2345)
To make it work, I have to write placement: "bottom-right" as GizmoDomPlacement,
Also the lineWidth option makes no difference.
Now I have to study the documentation to see how to change colors (the green is barely visible). Setting the axis main and text colors makes the text invisible. And circle: false does nothing.
Also the hover color (white) is activated when the pointer is outside the circle few pixel over the circle (with bottom right placement).
Good news! With the following options I’m on the good path to make what I need.
The only things that do not work are the lineWidth and circle: false that are ignored. Also, if you define axis colors but do not add text, the label disappears. Maybe it is best to mention this in the documentation.
Not sure what’s causing this, It’s working fine for me, with the default vite ts config, even when compiling (npm i build).
Also working, using line2 under the hood for a larger width range.
Also working, try to configure your gizmo here. (I’ve also added support for the circle option)
This one went completely over my head, too much options I guess
Yep! I made it this way so the gizmo doesn’t stick to the corners. I’m switching to a css gap instead.
Thanks for the valuable feedback, and please upgrade to the new 1.0.3 patch, I’ve added the circle support, and set the sphere offset to 0 with a default css offset of 10, fixing the hover gap, the rest should hopefully be working as expected.
Whatever value I put for lineWidth, the lines do not change. I even tried to put 8 at no avail. With this version also the y line is not draw (was in 1.0.1).
Thanks for your help!
P.S.: the problems I had with placement disappeared when I correctly typed the gizmoOptions object.
Fantastic! Now the gizmo does what I want! Thanks!
The only strange thing was that I have to explicitly disable line in nx, ny, nz otherwise the lines in the negative directions appear.
Here are the options I use:
Yes, adding color and hoverColor to the sphere definition silences the second warning.
But if I want the sphere color only on hover, make the gizmo not complains if color is missing or automatically if it is missing add it together with opacity = 0.