Sketchify 介绍
Sketchify是一个js工具,可将任何包含SVG图形的DOM元素转换为手绘风格的效果。它基于Rough.js
用法
将由svg组成的现有图形转换为草图模式。运行以下代码:
const option = { fillStyle: 'hachure', roughness: 1, bowing: 1, chartType: 'highcharts', }; // container is the root dom element that contains related graph svg const handler = Sketchifier(container, option); handler.handify(); // call restore will turn the graph back to original one handler.restore();
有关fillStyle,roughness和bowing的选项,请参考roughjs api文档。
在线示例:
Sketchify 官网
https://github.com/gangtao/sketchify
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。