• Stars
    star
    158
  • Rank 237,131 (Top 5 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created about 5 years ago
  • Updated almost 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

turn svg graph into sketchy visualization

turns svg graph into sketchy

Sketchify

Sketchify is a js tool that turns svg graph into sketchy visualization. It is based on Rough.js

Build

npm install
npm run build

Usage

To turn an existing graph that composed by svg into sketch mode.

Add dependencies to your html:

<script src="https://cdnjs.cloudflare.com/ajax/libs/rough.js/3.1.0/rough.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/gh/gangtao/sketchify/dist/sketchify.min.js"></script>

Run following js code:

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();

Refer to roughjs api document for options of fillStyle, roughness and bowing.

demo

There are 5 demo charts types:

After npm run build-dev, open related html file in demo folder will show you the demo.

Or you can refer to following codepen pages:

new chart type support

Sketchify is high generalized, now I have tried to support most chart types in highcharts and xCharts, the customization is to filter some svg element that does not need to sketchify. Adding a blacklist of related element class. In case you want to do something similar, refer to highcharts.js

More Repositories

1

dataplay2

A simple data analysis software
JavaScript
284
star
2

dataplay3

A small all in one data science tool
JavaScript
145
star
3

pyflow

a python flow based programming library
JavaScript
80
star
4

ml_model_deployment

Jupyter Notebook
28
star
5

esvsch

compare elastic and clickhouse
Jupyter Notebook
23
star
6

api-gateway

sample code of api gateway
Java
22
star
7

mlexplain

explain machine learning in graph
16
star
8

echarts_for_splunk

customer visualization for splunk using echarts
JavaScript
15
star
9

clickhouse-client

some clients for clickhouse
Shell
11
star
10

code_runner

docker for docker runner based on glot-code-runner
Go
6
star
11

oschina_user_analysis

Python
4
star
12

code_runner_python_puzzler

a web with code runner of python puzzler
JavaScript
4
star
13

ml-Interpretability

a demo of interpretability tool including eli5,pdp,shap,lime
Jupyter Notebook
3
star
14

code_runner_web

web ui for code runner
HTML
3
star
15

gangtaoblogs

naughty的个人页面
2
star
16

wenshuqiwu

2
star
17

datasets

a collection of datasets
2
star
18

dataplay

JavaScript
1
star
19

veritone-machinebox

a demo app of veritone machinebox
Jupyter Notebook
1
star
20

alba

alba (moon flower) is a frontend repo that integrate the build tools and frontend stacks
JavaScript
1
star
21

baidumap_for_splunk

baidu map plugin for splunk as a custom visualization
JavaScript
1
star
22

mnist_data

JavaScript
1
star
23

sweets

a configuration service with rest api interface and etcd/zk backend
Go
1
star
24

g24splunk

a customer data visualization to support the Grammar of Graphics
JavaScript
1
star
25

confshare

content shared from different tech conference
1
star
26

viz

Data Visualizations
JavaScript
1
star
27

Visualizing-the-Pulse-of-Data-

Visualizing the Pulse of Data - Unveiling the Power of Real-Time Streaming Data Visualization
JavaScript
1
star