Ecosyste.ms: Awesome

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

https://github.com/rustq/vue-skia

Skia based 2d graphics vue rendering library. It is based on Rust to implement software rasterization to perform rendering. 基于 Skia 的 2D 图形 Vue 渲染库 —— 使用 Rust 语言实现纯软件光栅化
https://github.com/rustq/vue-skia

rust skia vue

Last synced: about 2 months ago
JSON representation

Skia based 2d graphics vue rendering library. It is based on Rust to implement software rasterization to perform rendering. 基于 Skia 的 2D 图形 Vue 渲染库 —— 使用 Rust 语言实现纯软件光栅化

Lists

README

        

# Vue Skia

[![license](https://img.shields.io/badge/license-MIT-cyan)](https://revolunet.mit-license.org/) ![vue-3.x](https://img.shields.io/badge/vue-3.x-lightgreen) [![crates](https://img.shields.io/crates/v/soft-skia)](https://crates.io/crates/soft_skia) [![npm](https://img.shields.io/npm/v/vue-skia?color=purple)](https://www.npmjs.com/package/vue-skia) [![downloads](https://img.shields.io/npm/dm/vue-skia)](https://www.npmjs.com/package/vue-skia)

The `vue-skia` is a `skia` based 2d graphics `vue` rendering library. It is based on `Rust` to implement software rasterization to perform rendering. It takes up less memory than the native canvas, however it is still a experiment project. And it's based entirely on `vue` syntax.

基于 `Skia` 的 2D 图形 `Vue` 渲染库 —— 使用 `Rust` 语言实现纯软件光栅化渲染,相比原生画布占用更少的内存,不过目前仍然是一个实验项目;此外使用层面完全基于 `Vue` 语法。

[![usage](https://user-images.githubusercontent.com/11075892/260789003-8bc6cf06-1525-468a-ad70-357771e9969f.png)](https://vue-skia.netlify.app)

Live Demo: [https://vue-skia.netlify.app](https://vue-skia.netlify.app)

## Usage

```shell
$ npm i vue-skia
```

`main.ts`

```ts
import { createApp } from "vue";
import App from "./App.vue";
import { VueSkia } from 'vue-skia'

const app = createApp(App);
app.use(VueSkia);
app.mount("#app");
```

`App.vue`

```vue









import { defineComponent } from "vue";
import launch, { VSurface, VRect, VCircle, VRoundRect, VLine, VPoints } from "vue-skia";

export default defineComponent({
name: "HelloWorld",
components: {
VSurface,
VRect,
VCircle,
VRoundRect,
VLine,
VPoints
},
data() {
return {
loading: true,
};
},
mounted() {
launch().then(() => {
this.loading = false;
});
},
});

```

## Library Development

#### Soft Skia Development

```shell
$ cd soft-skia
$ cargo test
```

#### Soft Skia WASM Development

```shell
$ cd soft-skia-wasm
$ wasm-pack build --release --target web
```

#### Vue Skia Framework Development

```shell
$ cd vue-skia-framework
$ npm i
$ npm run build
```

## License

[MIT](https://opensource.org/licenses/MIT)