These are chat archives for sandialabs/toyplot

9th
Dec 2018
Timothy M. Shead
@tshead
Dec 09 2018 01:56
@amoshyc - Toyplot makes a distinction between data marks and drawing marks. Data marks (like rectangles) have domain data, and require a set of axes (cartesian in this case) to map that data to canvas coordinates. Drawing marks (like images) don’t have a domain, they’re simply placed on the canvas. So in this case, you’re making your cartesian domain equal to the resolution of the image, so one domain unit = one pixel. As it happens, I already have a recent request to support rectangles as drawing marks, which would probably behave more like what you’re expecting. Cheers, Tim.
Yu-Cheng Huang
@amoshyc
Dec 09 2018 07:03
@tshead I see~ I' m looking forward to your future work. Currently what I need is to draw bounding boxes, keypoints, masks(polygons) on an image. An example is here. However, It seems that Toyplot doesn't have the ability to draw polygon and I would like to contribute. In this case, should I use Data Marks or Drawing Marks? If I stick to former, maybe I can utilize toyplot.graph but using latter is more logical.
I was using svgwrite previously, but it lacks of colormap and other high-level element. Are there any chance to make Toyplot able to add raw svg element directly? Although I don't think it is the purpose of this library. Thanks for the good library anyway XD