分类分类
大小:1.26 MB更新:2020/08/04
类别:其他网站源码系统:JavaScript
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文档。
同类推荐:站长常用源码