@ddgll/vue3-trend

中文文档
1.0.3发布于 2022/03/10MITTypeScriptESM + CJS近 30 天下载 4078

Convert images from an url or an input file to another type

原始使用文档
文档目录8 节
  1. Installation
  2. Usage
  3. Inspired
  4. Props
  5. Development
  6. TODO
  7. Credits
  8. License

🔥🔥🔥

More powerful, more flexible chart library for Vue.js v3 👉 https://github.com/ddgll/vue3-trend

🔥🔥🔥


Vue 3 Trend

Vue 3 Trend

Simple, elegant spark lines for Vue.js v3


npm vue

Installation

npm i @ddgll/vue3-trend -S

# or via yarn

yarn add @ddgll/vue3-trend

Usage

// app.js

import Trend from "@ddgll/vue3-trend";

// ...
<trend
  :data="[0, 2, 5, 9, 5, 10, 3, 5, 0, 0, 1, 8, 2, 9, 0]"
  :gradient="['#6fa8dc', '#42b983', '#2c3e50']"
  auto-draw
  smooth
>
</trend>

Inspired

unsplash/react-trend - 📈 Simple, elegant spark lines

Props

  • data : Number | Object: The data accepted by Vue Trend is incredibly simple: An array of y-axis values to graph.
    • [120, 149, 193.4, 200, 92] or [{ value: 4 }, { value: 6 }, { value: 8 }]
  • gradient : String Colour can be specified as any SVG-supported format (named, rgb, hex, etc)
    • ['#0FF', '#F0F', '#FF0']
  • gradientDirection: String: Top, Bottom, Left or Right.
  • width: Number: Set an explicit width for your SVG.
  • height: Number: Set an explicit height for your SVG.
  • padding: Number: If you set a very large strokeWidth on your line, you may notice that it gets "cropped" towards the edges.
  • smooth: Boolean: Smooth allows the peaks to be 'rounded' out so that the line has no jagged edges.
  • radius: Number: When using smoothing, you may wish to control the amount of curve around each point. This prop has no effect if smooth isn't set to true.
  • autoDraw: Boolean: Allow the line to draw itself on mount. Set to true to enable, and customize using autoDrawDuration and autoDrawEasing.
  • autoDrawDuration: Number: The amount of time, in milliseconds, that the autoDraw animation should span. This prop has no effect if autoDraw isn't set to true.
  • autoDrawEasing: String: The easing function to use for the autoDraw animation. Accepts any transition timing function within the CSS spec (eg. linear, ease, ease-in, cubic-bezier...).
  • max: Number: Specify max value
  • min: Number: Specify min value, This is useful if you have multiple lines.

SVG Props

By default, all properties not recognized by Vue Trend will be delegated to the SVG. The line inherits these properties if none of its own override them.

This means that, among other properties, you can use:

  • stroke to set a solid colour,
  • strokeWidth to change the default line thickness,
  • strokeOpacity to create a transparent line,
  • strokeLinecap/strokeLinejoin to control the edges of your line,
  • strokeDasharray to create a dashed line, and
  • strokeDashoffset to control where the dashes start.

Development

yarn
yarn dev
# open localhost:3000

TODO

  • Unit test

Credits

This package is based off QingWei-Li/vue-trend's implementation

License

MIT

版本与发布记录

@ddgll/vue3-trend 共发布 5 个版本,首次发布于 2022/03/10;过去 12 个月发布了 0 个版本。

版本发布日期距今
1.0.3latest2022/03/104 年前
1.0.22022/03/104 年前
1.0.12022/03/104 年前
1.0.02022/03/104 年前
0.1.12022/03/104 年前

关于 @ddgll/vue3-trend 的常见问题

@ddgll/vue3-trend 是什么?

Convert images from an url or an input file to another type

如何安装 @ddgll/vue3-trend?

在项目目录运行 npm install @ddgll/vue3-trend,或使用 pnpm add / yarn add / bun add。

@ddgll/vue3-trend 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@ddgll/vue3-trend 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@ddgll/vue3-trend 可以商用吗?

@ddgll/vue3-trend 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@ddgll/vue3-trend 的下载量有多少?

根据 npm 官方下载统计,@ddgll/vue3-trend 在 2026/10/12 – 2026/11/10 这 30 天内被下载 4,078 次,日均约 136 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@ddgll/vue3-trend 还在维护吗?

最新版本 1.0.3 发布于 2022/03/10(4 年前);至今共发布 5 个版本,其中过去 12 个月发布了 0 个;首次发布于 2022/03/10。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。