great-northern-diver / loon

A Toolkit for Interactive Statistical Data Visualization
http://great-northern-diver.github.io/loon/
GNU General Public License v2.0
48 stars 16 forks source link

polygon glyph #173

Open z267xu opened 2 years ago

z267xu commented 2 years ago

Describe the bug In a loon plot with a single point, after adding the polygon glyph, the coordinates of the polygons are missing. Problems should be in the tcl file.

For example,

x_star <-
  c(-0.000864304235090734, 0.292999135695765, 0.949870354364736,
    0.474503025064823, 0.586862575626621, -0.000864304235090734,
    -0.586430423509075, -0.474070872947277, -0.949438202247191,
    -0.29256698357822)
y_star <-
  c(-1, -0.403630077787381, -0.308556611927398, 0.153846153846154,
    0.808556611927398, 0.499567847882455, 0.808556611927398,
    0.153846153846154, -0.308556611927398, -0.403630077787381)

p <- l_plot(1,1)
gl <- l_glyph_add_polygon(p, 
                          x = list(x_star),
                          y = list(y_star))

p['glyph'] <- gl

> gl['x']
[[1]]
[1] NA

> gl['y']
[[1]]
[1] NA