Vertex
继承自 sd.Vertex,是一个背景(background)是圆形的元素。
API 列表
class Vertex extends BaseElement {
r(): number;
r(r: number): this;
}
布局规则
sd.Circle 使用 R.centerFixAspect 作为默认的布局规则,这种规则会认为 value 是长宽比固定的物体。
const svg = sd.svg();
const values = [new sd.Circle(svg), new sd.Mathjax(svg, "A^2"), new sd.Rect(svg), new sd.Text(svg, "A")];
const vertices = [];
values.forEach((value, i) => {
const vertex = new sd.Vertex(svg, value).width(80).x(100 * i);
vertices.push(vertex);
})
sd.main(async () => {
await sd.pause();
vertices.forEach(vertex => vertex.startAnimate().width(40).endAnimate());
});