Sketchify手繪風(fēng)格數(shù)據(jù)可視化工具
Sketchify是一個js工具,可將任何包含SVG圖形的DOM元素轉(zhuǎn)換為手繪風(fēng)格的效果。它基于Rough.js
用法
將由svg組成的現(xiàn)有圖形轉(zhuǎn)換為草圖模式。運(yùn)行以下代碼:
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();
有關(guān)fillStyle,roughness和bowing的選項,請參考roughjs api文檔。
在線示例:
評論
圖片
表情
