# dotline-svg

> 线条粒子效果插件

Latest version **2.0.2** (published 2021-06-23) · ISC license · 0 weekly downloads

## Install

```sh
npm install dotline-svg
pnpm add dotline-svg
yarn add dotline-svg
bun add dotline-svg
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.2 |
| Published | 2021-06-23 |
| First published | 2021-06-17 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 1.2 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | hezhongjie |
| Maintainers | hezhongjie |
| Keywords | svg, canvas |

## Links

- npm: https://www.npmjs.com/package/dotline-svg
- Repository: https://gitee.com/hezhongjie/dotline-svg
- Homepage: https://gitee.com/hezhongjie/dotline-svg#readme
- npm.io page: https://npm.io/package/dotline-svg

## Dependencies (1)

- [webpack](https://npm.io/package/webpack.md) ^5.40.0

## Alternatives

- [exif-parser](https://npm.io/package/exif-parser.md) — 3.8M weekly downloads
- [vite-plugin-compression](https://npm.io/package/vite-plugin-compression.md) — 569.5K weekly downloads
- [pica](https://npm.io/package/pica.md) — 442.4K weekly downloads
- [@reportportal/client-javascript](https://npm.io/package/@reportportal/client-javascript.md) — 408.8K weekly downloads
- [@tldraw/state](https://npm.io/package/@tldraw/state.md) — 316.0K weekly downloads

## Recent versions

- 2.0.2 (latest) — 2021-06-23
- 2.0.1 — 2021-06-23
- 2.0.0 — 2021-06-23
- 1.0.2 — 2021-06-17
- 1.0.1 — 2021-06-17
- 1.0.0 — 2021-06-17

## README

# 线条粒子效果插件 ( svg和canvas版本 )

### ![效果:./chrome-capture.gif](./chrome-capture.gif)

## 使用方法：支持浏览器，cmd,amd环境

```html
<div id="wraper" style="height: 300px; width: 300px;"> </div>

<script>
    let d = new DotLine({
        container: '#wraper',
        dotSum: 50,
    });
    // 开始动画
    d.start();
    // 结束动画
    d.end();
    // 默认参数option
    /* {
        // 容器选择器名称
        container: '#dotLine',
        // svg或者canvas的视图尺寸（注意：不是dom的尺寸，dom的尺寸100%）
        width: 1920,
        height: 1080,
        // 粒子数量
        dotSum: 100,
        // 粒子运动的最大速度（可以分别设置x,y的最大运动速度）
        speed: 1,
        speedx: null,
        speedy: null,
        // 允许建立连线的最大粒子距离
        maxLength: 100,
        // 粒子和线条的样式，请参考 <circle> <line>标签的属性进行设置
        dotStyle: { fill: 'gray', r: 2, },
        lineStyle: { stroke: "rgb(0,0,0)", 'stroke-width': 1 },
        // 背景色
        background: null,
        // 鼠标聚集效果
        mouseEffect: false,
        // 产生聚集效果的最大距离
        mouseDistance: 100,
    } */
    
</script>

```

### Svg版本：index.js

### Canvas版本：index-cancas.js

### ![svg和cancas模式下demo的性能对比:./svg&canvas性能对比.png](./svg&canvas性能对比.png)

---
_Source: https://npm.io/package/dotline-svg · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
