[–] rmetzler link

This is the vehicle I programmed together with my 5 year old: https://jsfiddle.net/k1g6533y/13/

reply

[–] 4lejandrito link

Very nice!

I changed it a little bit to optimise rendering just in case you don't know about 'requestAnimationFrame()' (https://developer.mozilla.org/en-US/docs/Web/API/window/requ...):

https://jsfiddle.net/65q7c5to/

reply

[–] DiThi link

It's using setInterval on purpose, because with requestAnimationFrame the effect is a bit too fast.

reply

[–] reacweb link

Works fine on chrome, but it seems too fast on firefox.

reply

[–] hanoz link

What do all the context transformation lines do in this example? It seems to work just as well with clearRect on its own.

reply

[–] ygra link

There's only one such line. In general it's a good idea to reset the transform before clearing as the (0, 0, w, h) rectangle may not cover the whole canvas anymore. In this toy example there obviously isn't another transform so it's without function.

reply

[–] undefined link
[deleted]

reply

[–] thomasfl link

Wonderfurl! It makes the kid see how a small algorithm saves time AND produces almost the same results as hand drawn animation. I have to try this myself with my own kids.

reply

[–] jjeaff link

Absolutely! Assuming your 5 year old is some kind of savant. Otherwise, I can't imagine a kid actually understanding what is going on with a script like this.

reply

[–] stuntkite link

This is great. Thank you both for these fiddles. I've been doing a lot of SVG DOM stuff. Mostly tied to maps. I'm excited to try this out.

reply

[–] shihn link

That's true. There's so much randomness in there that every render will likely be unique - every so slightly different from the previous frame.

reply

[–] sandralopz5 link

zxczxc

reply

[–] wickedjust link

Reminds me of the art used in yoshi story. Awesome!

reply

[–] _mrmnmly link

or Ed, Edd n Eddy cartoon :)

reply

[–] gyvastis link

Hahahahaha, nice one!

reply

[–] bcjordan link

If you repeatedly clear canvas/draw with a setInterval of ~100-200ms, looks kind of like the hand-drawn un-stable lines art style of Squigglevision (Dr. Katz / Science Court) :)

EDIT: If folks want to play with a JSFiddle: https://jsfiddle.net/49g2Leqw/9/

reply

[–] chrismorgan link

This is not working in Firefox. Not sure why.

reply

[–] undefined link
[deleted]

reply

[–] piyush_soni link

Yup. Only worked in Chrome for me too.

reply

[–] nacs link

Both work well for me in Firefox 58

reply

[–] chrismorgan link

It got fixed to use require() instead of import().

reply

[–] ygra link

Quite headache-inducing. To me at least. There seems to be quite a challenge to make something look hand-drawn and also not change it so much on every drawn frame that you don't get dizzy watching it.

reply

[–] chrisweekly link

Beautiful! :)

reply

[–] shihn link

This is fantastic.

reply

[–] sandralopz5 link

Im making over $7k a month working part time. I kept hearing other people tell me how much money they can make online so I decided to look into it. Well, it was all true and has totally changed my life. This is what I do, ====http://www.todaysfox.com

reply

[–] jashkenas link

This is a very fun library. Following the tip in these comments from @bcjordan to repeatedly re-render, I've forked a little physics notebook by Jim Bumgardner apply Rough.js to the circle rendering:

https://beta.observablehq.com/@jashkenas/tumble-wheel-with-r...

Wheee.

Edit: Too much fun. Here's another: https://beta.observablehq.com/@jashkenas/scratchy-eyes

reply

[–] shihn link

Cool!

reply

[–] ronilan link

This is fantastic!

Just made a quick rough "Mondrian" drawing app (using BlockLike.js[1])

https://s.codepen.io/BlockLike/debug/Bromox/PNAvYLPDGqDr

Click and Drag to rectangle.

Space key = black

r key = red

b key = blue

g key = green

y key = yellow

[1] https://www.blocklike.org/#getstarted

EDIT: If folks want to play with the pen: https://codepen.io/BlockLike/pen/Bromox?editors=0010

reply

[–] kqr link

It looks like you have to purchase a license to use it. The only price quoted on the page is $2999 -- a bit steep for some illustrations on a blog. Please explain.

reply

[–] MattRix link

I believe the $2999 price is for licensing Zwibbler so you can have it on your own site/app. For example if you had a company that made custom t-shirts, users could create their own designs using Zwibbler on your site.

On the other hand, if you just want to draw some pictures using the Zwibbler demo to put them on your blog, you don't need a license, and it doesn't cost you anything.

reply

[–] kqr link

That is the sensible interpretation but it's not very clear from the wording on the page. I like being in the clear, legally speaking.

reply

[–] anigbrowl link

Better than allowing that money to go to some starving artist though. They might not spend it as responsibly.

reply

[–] icantdrive55 link

Kidding? Right?

reply

[–] vjeux link

In the same vein, I've been using Zwibbler ( http://zwibbler.com/demo/ ) for all the illustrations on my blog ( http://vjeux.com ) and it's been really nice to have images that look like they have been hand drawn.

reply

[–] fleur-de-lotus link

Any plan for a react component?

reply

[–] shihn link

I'm not planning to at the moment, but if someone wants to write a wrapper, go for it.

reply

[–] swyx link

i dont know polymer at all so i didnt know how to use react-polymer - anyone want to give it a shot?

in the meantime ive started writing a pure react version of it: https://github.com/sw-yx/react-wired i have not published to npm yet

reply

[–] shihn link

I used some of the same core code to create sketchy UI controls using web-components: https://www.webcomponents.org/collection/wiredjs/wired-eleme...

reply

[–] swagasaurus-rex link

Awesome. I was about to ask about D3 support.

But now that I'm here... Is there any support for animation?

reply

[–] shihn link

Well the library provides simple drawing methods. You would animate it the same way you would animate anything on a canvas. (Note most D3 charts use SVG)

reply

[–] unwind link

FYI: Blank page (with title text) in Firefox (58.0.2, 64-bit, Windows).

reply

[–] shihn link

There was in issue with the CDN I believe. It was serving an old cache at some nodes. I changed the code to use a different one.

reply

[–] shihn link

Quick bar chart example with D3: http://roughjs.com/examples/bar-chart.html

reply

[–] dvh link

Replace Math.random() with your deterministic PRNG, for example https://github.com/davidbau/seedrandom

reply

[–] nazri1 link

Having an option to make the result deterministic would be nice. That way you can use it for drawing stuff that's guaranteed to be rendered identically when loaded at different times.

reply

[–] yantrams link

This has made me so much happy. Thank you. Brilliant stuff. I've been looking for something that does this and have just started having fun with this problem using P5.js and playing around with splines, perlin noise etc.

reply

[–] shihn link

I'm assuming you're joking :P But if it really solved 2 of your problems, I'm curious what they were?

reply

[–] petecooper link

Not joking at all, I assure you! Primary use case is for education/training materials where a flat or prescribed style is not desirable, and also because despite my girlfriend being an artist I have no ability there whatsoever and this has just removed a whole bunch of fear about presenting polygons.

reply

[–] dannyw link

I’m assuming the parent commentator wants handdrawn-like graphics for a service or machine generated content, but wants them in different styles. Thus, tweaking what you’ve written allows him to solve both.

reply

[–] petecooper link

Well, this just solved two problems I've been trying to figure out for months -- thanks, shihn!

GitHub link: https://github.com/pshihn/rough

reply

[–] shihn link

It's doable - It already parses SVG paths https://github.com/pshihn/rough/wiki#path-d--options

reply

[–] ErikOnBike link

There is an online tool supporting this called Sketchify. https://www.toolparadise.nl

You need to create an account (for storing drawing profiles), but the usage is free.

reply

[–] codingdave link

I like it -- it would be killer if there was a way to simply throw an SVG at it and have it convert the whole thing to this style.

reply

[–] psteinweber link

Wonderful and indeed a very practical idea. I would use it!

reply

[–] daleco link

That’s great, I’ve been looking for a Sketch 3 plugin that was doing that for a while (it doesn’t exist yet) It could potentially be wrapped in a plugin.

When presenting designs, in some situations you may want to show rough sketches and not high fidelity (or people focus on details rather than the big picture). Something like that would allow me to easily toggle between high fidelity to rough state.

reply

[–] shihn link

I'm doing some approximation on complex SVG paths for performance reasons. Doesn't happen on non-svg paths. Need for improvement.

reply

[–] chestervonwinch link

Cool. I notice on the map example that the hatching lines in some of the states (South Dakota and Georgia, for example) don't quite match up. Why is that?

reply

[–] KennyCason link

Woah! This is awesome. :) I'd love to use this on my blog next time I need graphs.

reply

[–] imkevinxu link

Reminds me of this old website I built back in college http://xkcdgraphs.com/

reply

[–] undefined link
[deleted]

reply

[–] tobinharris link

Really cool stuff.

Would look great in http://yuml.me which also has a sketchy look.

I need to rewrite yUML using newer tech, business collaborations welcome :)

reply

[–] egnehots link

Are there any good papers about this kind of stuff?

reply

[–] shihn link

Thanks. I'm a bit surprised by the reception actually. It was just a fun side project with no real use case in mind.

reply

[–] CodeCube link

This is just lovely :) I guess I don't really have much to add, other than to say you've delighted me with this

reply

[–] cyrusaf link
[–] binarysolo1111 link

https://swimlanes.io/ is a great charting tool. Okay it's swimlanes not flow charts, but I like it a lot.

reply

[–] kmfrk link

I would absolutely love a flow chart library that used this with decent text alignment.

I used to prefer mermaid.js, but it silently fails in ways the don't work that well for me: https://mermaidjs.github.io/mermaid-live-editor.

reply

[–] RMarcus link

Very cool! I wrote something similar, but it only renders lines. https://rmarcus.info/blog/2017/10/23/humanlines.html

reply

[–] pit2 link

Does anyone know how this can be exported/used/translated to work with Inkscape?

reply

[–] keenrodent link
[–] ben336 link
[–] frunzales link

This comes close enough but it's not the exact software that was posted around here :-)

reply

[–] LeonB link
[–] frunzales link

I believe so. It's very close to what I've previously seen posted here.

reply

[–] frunzales link

A bit off-topic but a while ago someone posted a similar tool here on HN that allows one to produce diagrams - they looked pretty much hand-drawn. Does anyone have a link?

reply

[–] H00tyMcOwlFace link

No idea what I will be using it for yet, but I am sure I will!

reply

[–] ohf link

Does anyone else get a fancy pants adventure vibe from this?

There's a critique about digital art in general here: over-perfection is dull. I'm all about that wabi-sabi.

reply

[–] saintPirelli link

Absolutely stunning work. I have to do some work with D3.js for university and this feels like the universe telling me to stop procrastinating.

reply

[–] glhaynes link

Fantastic! I love this sort of thing, hope to see it used a lot. Could definitely use support for high-DPI screens.

reply

[–] JasonSage link

I'd love to pair this with one of those tools that turns ascii drawings into SVGs. Looks great!

reply

[–] laktak link

Anybody know of a tool that can convert ascii drawings (in markdown) to this?

reply

[–] buildfocus link

This is very cool, but I have no idea at all where I'd ever use it.

reply

[–] shihn link

I'm not planning to at the moment, but if someone wants to write a wrapper, go for it.

reply

[–] kenning link

This is awesome! Do you have plans to integrate with canvas.js?

reply

[–] sporkologist link

Simulated badly-drawn hatching! This is great!

reply

[–] shihn link

I drew a map with RoughJS and d3 (3rd example ->)https://github.com/pshihn/rough/wiki/Examples

I'm sure Charts and all would be easy too.

reply

[–] 1wheel link
[–] shihn link

Here- took a quick stab at it: http://roughjs.com/examples/bar-chart.html

reply

[–] kqr link

Has anyone attempted to combine this with D3?

reply

[–] imkevinxu link

Easier web version :) http://xkcdgraphs.com/

reply

[–] FromTheId link

Aw man I love this.

Thank you!

reply

[–] doczoidberg link

does anybody know something similar for .NET (WPF) applications?

reply

[–] mito88 link

nice!

reply

[–] ashleymarsh link

This is fantastic!

reply

[–] Ainak link

nice

reply

[–] kodfodrasz link

This is not hand drawn. It only looks like that, and it is cool, but definitely not hand-drawn.

reply

[–] gmaillogin link

I also encounter the same problem. thanks for your answer. https://www.gmaillogin.help/

reply