An open API service indexing awesome lists of open source software.

https://github.com/freeshineit/svgjs

svgjs
https://github.com/freeshineit/svgjs

svg

Last synced: 7 months ago
JSON representation

svgjs

Awesome Lists containing this project

README

          

# Svg Demo

## Use

```bash
#
yarn install

# development
yarn run dev

# production
yarn run build

# https://github.com/http-party/http-server
# version >= 14
cd docs && http-server -p 8080 .

```

## svg element

```xml








椭圆




线




矩形




文本


多边形 (多个点组成的封闭多边形)




路径(这个比较难,一般都是由设计师画好生成的)



```

## svg.js

```ts
import { SVG } from "@svgdotjs/svg.js";

const draw = SVG().addTo("body").size(300, 300);
```
### rect

```ts
// Container.rect(width?: number, height?: number): Rect
draw.rect(100, 100)
.fill("red") // fill 填充颜色
.attr({// 属性
x: 100, // x轴位置
y: 100 // y轴位置
});
```

### circle

### line

### text