code: function (geometry, styles) {
              var img = new image_1.Image();
              if (styles && styles.image) {
                  img.src = styles.image;
              }
              if (styles && styles.color) {
                  img.backgroundColor = new color_1.Color(styles.color);
              }
              var name = geometry.name;
              if (name === 'circle') {
                  img.width = geometry.radius * 2;
                  img.height = geometry.radius * 2;
                  geometry._renderOffsetX = -geometry.radius;
                  geometry._renderOffsetY = -geometry.radius;
              }
              else if (name === 'rectangle') {
                  img.width = geometry.width;
                  img.height = geometry.height;
                  geometry._renderOffsetX = -geometry.width / 2;
                  geometry._renderOffsetY = -geometry.height / 2;
              }
              img.horizontalAlignment = "left";
              img.verticalAlignment = "top";
              container.addChild(img);
              return img;
          }
docs: extended