How to draw bounding box in tooljet? - labeling

I'm already using tooljet to classify some images. I'd like to expand it so that user can draw bounding boxes on the image.
Is there a way to draw bounding boxes on image in tooljet?
If there's no out of the box solution, are there some javascript (preferably) or python libraries that can be used for this?

The bounding box component is in the roadmap of the ToolJet. We will update you as soon as we release it.
Please feel free to join Community Slack if you have more questions.

Related

Building custom Shapes in Konva

I've been asked to build something similar to this so that customers can draw basics shapes of kitchen tops. Similar to that in the image below but also have dimensions.
It looks like konva has support for basic shapes like rectangle and circle etc and it also includes a transformer which allows for resizing. However, I think if I want to build a custom shape like the one in green and have individual sizing i.e. resize each individual line. I am going to have to build something myself.
I was hoping someone could point me in the right direction. I have seen an example where someone has used a "line" class which takes a series of points and then sets the attribute to closed which fills in the shape. Obviously I would need to extend this to allow the custom resizing. However, Im not sure this is the correct path to head down?
Any suggestions?
.
How about using rectangles and having an option to snap them together. It should be fairly simple to do the edge detection and snapping. Then show the result as a Konva.Line around the perimeter.
Then you can show all the control handles for the rectangles except those on the sides where another Rect has joined.

How to select objects by mouse selection rectangle?

I mean not bounding box and bounding sphere, but exactly pixel perfect, I mean.
Maybe shader or special renderer? Give different colors to different meshes, and by rendered colors detect what objects were selected?
After three days of googling, I haven't found a single answer on the Internet. Help, please.
For example, this Box should not be selected:
How does Blender do it? If I select many objects, he clearly understands what I have selected. Do you have any ideas about their algorithm?
Maybe we can paint objects in the scene in different colors, and render the scene, and then use the pixel colors to understand what colors are visible? And so we exploit the parallel nature of the graphics card? Its like raycasting, but by every selection pixel.
There is now a feature request at GitHub: github.com/mrdoob/three.js/issues/20530

How to achieve Custom Gradient Shapes/Patterns in Flutter

Out of the box we get LinearGradient, RadialGradient and SweepGradient. What I would like to do is something similar to the shown image below. Let's say we draw a custom shape with CustomPainter. When this customShapeGradient is applied on it, the gradient should start from the border of the custom shape and go towards the center. I realize that this might introduce wierd effects since our shape will mostly be not symmetric and a "border to center" approach is not as easy as a "center to border" approach(like the 3 out of the box methods). Here it will be the developer's responsibility to make sure the gradient fill do not overlap with itself, meaning it won't go all the way to the center.
Here is an image I found for an Elliptic shape which most closely describe what I want. Let's say our shape is the line with the yellow color. And I want to achieve the gradient which fills inside.
This is a similar image too:
The two examples I have provided are for ellipses however my question is for any type of shape that is created by a CustomPainter.
I am almost sure this is possible since a shadow(gradient in nature) is basically the inverse of this. We can apply a shadow to a CustomPainter shape. The only difference will be that the shadow will grow towards inside of the shape(maybe like a inner shadow).

Get bounding box / extent of visible map tiles in d3

Let's say I have a standard tiled map like this: http://bl.ocks.org/mbostock/4132797
How can I get the bounding box coordinates of the visible map?
In other words, how can I say exactly the extent of the map shown at any given time. I understand this as a bounding box but also as an extent.
Thank you.
I was able to find answers to similar but specific questions but am leaving this up in case someone is searching for the general case.
From Elijah Meeks's answer:
To find the bounding box of the visual area of your map on screen,
simply use the projection.invert() function and feed it the top-left
and bottom-right corners of your SVG. If you have a 500x500 SVG, then
that looks like this:
projection.invert([0,0]) projection.invert([500,500]) This is a
bounding box of your screen, in lat-long (or whatever coordinate
system you're using).
After that, you can get the bounds of your features and test to see if
they are fully-contained or intersecting or have their centroid within
those bounds. I'm not going to explain how to do that here, because
that's a different question with many different answers depending on
which definition of "within these bounds" you decide on.
So, plug in the width and heightof the visible area into the projection generator. Voila, you have the box.

How to control irregular Image button click area in cocos2dx

I want to use multiple irregular picture makes up a map, each picture is a button.Transparent part of the images will overwrite each other, how should I do to make their control areas does not overlap.
I use a lot of pictures makes up a large map.
And each piece of the map is irregular, but their control area is a rectangle. Because they all have transparent pixels.
I just want to make the hit area and their shape becomes the same.Some encountered a similar problem?
I have implemented one for the cocos2d-x v3.x:
https://github.com/yszheda/cocos2d-x-irregular-button
It works OK on cocos2d-x v3.2. Maybe you can have a try XD

Resources