TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Show HN: RoughJS – Create hand-drawn graphics using JavaScript

1087 pointsby shihnabout 7 years ago

36 comments

bcjordanabout 7 years ago
If you repeatedly clear canvas&#x2F;draw with a setInterval of ~100-200ms, looks kind of like the hand-drawn un-stable lines art style of Squigglevision (Dr. Katz &#x2F; Science Court) :)<p>EDIT: If folks want to play with a JSFiddle: <a href="https:&#x2F;&#x2F;jsfiddle.net&#x2F;49g2Leqw&#x2F;9&#x2F;" rel="nofollow">https:&#x2F;&#x2F;jsfiddle.net&#x2F;49g2Leqw&#x2F;9&#x2F;</a>
评论 #16573670 未加载
评论 #16572728 未加载
评论 #16574161 未加载
评论 #16574516 未加载
jashkenasabout 7 years ago
This is a very fun library. Following the tip in these comments from @bcjordan to repeatedly re-render, I&#x27;ve forked a little physics notebook by Jim Bumgardner apply Rough.js to the circle rendering:<p><a href="https:&#x2F;&#x2F;beta.observablehq.com&#x2F;@jashkenas&#x2F;tumble-wheel-with-rough-js" rel="nofollow">https:&#x2F;&#x2F;beta.observablehq.com&#x2F;@jashkenas&#x2F;tumble-wheel-with-r...</a><p>Wheee.<p>Edit: Too much fun. Here&#x27;s another: <a href="https:&#x2F;&#x2F;beta.observablehq.com&#x2F;@jashkenas&#x2F;scratchy-eyes" rel="nofollow">https:&#x2F;&#x2F;beta.observablehq.com&#x2F;@jashkenas&#x2F;scratchy-eyes</a>
评论 #16573399 未加载
评论 #16575004 未加载
评论 #16573345 未加载
评论 #16573190 未加载
ronilanabout 7 years ago
This is fantastic!<p>Just made a quick rough &quot;Mondrian&quot; drawing app (using BlockLike.js[1])<p><a href="https:&#x2F;&#x2F;s.codepen.io&#x2F;BlockLike&#x2F;debug&#x2F;Bromox&#x2F;PNAvYLPDGqDr" rel="nofollow">https:&#x2F;&#x2F;s.codepen.io&#x2F;BlockLike&#x2F;debug&#x2F;Bromox&#x2F;PNAvYLPDGqDr</a><p>Click and Drag to rectangle.<p>Space key = black<p>r key = red<p>b key = blue<p>g key = green<p>y key = yellow<p>[1] <a href="https:&#x2F;&#x2F;www.blocklike.org&#x2F;#getstarted" rel="nofollow">https:&#x2F;&#x2F;www.blocklike.org&#x2F;#getstarted</a><p>EDIT: If folks want to play with the pen: <a href="https:&#x2F;&#x2F;codepen.io&#x2F;BlockLike&#x2F;pen&#x2F;Bromox?editors=0010" rel="nofollow">https:&#x2F;&#x2F;codepen.io&#x2F;BlockLike&#x2F;pen&#x2F;Bromox?editors=0010</a>
评论 #16572808 未加载
vjeuxabout 7 years ago
In the same vein, I&#x27;ve been using Zwibbler ( <a href="http:&#x2F;&#x2F;zwibbler.com&#x2F;demo&#x2F;" rel="nofollow">http:&#x2F;&#x2F;zwibbler.com&#x2F;demo&#x2F;</a> ) for all the illustrations on my blog ( <a href="http:&#x2F;&#x2F;vjeux.com" rel="nofollow">http:&#x2F;&#x2F;vjeux.com</a> ) and it&#x27;s been really nice to have images that look like they have been hand drawn.
评论 #16573181 未加载
shihnabout 7 years ago
I used some of the same core code to create sketchy UI controls using web-components: <a href="https:&#x2F;&#x2F;www.webcomponents.org&#x2F;collection&#x2F;wiredjs&#x2F;wired-elements" rel="nofollow">https:&#x2F;&#x2F;www.webcomponents.org&#x2F;collection&#x2F;wiredjs&#x2F;wired-eleme...</a>
评论 #16574224 未加载
shihnabout 7 years ago
Quick bar chart example with D3: <a href="http:&#x2F;&#x2F;roughjs.com&#x2F;examples&#x2F;bar-chart.html" rel="nofollow">http:&#x2F;&#x2F;roughjs.com&#x2F;examples&#x2F;bar-chart.html</a>
评论 #16572543 未加载
评论 #16574952 未加载
nazri1about 7 years ago
Having an option to make the result deterministic would be nice. That way you can use it for drawing stuff that&#x27;s guaranteed to be rendered identically when loaded at different times.
评论 #16583113 未加载
yantramsabout 7 years ago
This has made me so much happy. Thank you. Brilliant stuff. I&#x27;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.
petecooperabout 7 years ago
Well, this just solved two problems I&#x27;ve been trying to figure out for months -- thanks, shihn!<p>GitHub link: <a href="https:&#x2F;&#x2F;github.com&#x2F;pshihn&#x2F;rough" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;pshihn&#x2F;rough</a>
评论 #16572757 未加载
codingdaveabout 7 years ago
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.
评论 #16572190 未加载
评论 #16574318 未加载
dalecoabout 7 years ago
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.<p>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.
评论 #16612638 未加载
chestervonwinchabout 7 years ago
Cool. I notice on the map example that the hatching lines in some of the states (South Dakota and Georgia, for example) don&#x27;t quite match up. Why is that?
评论 #16572512 未加载
LiveTheDreamabout 7 years ago
Very cool. Reminds me of Steve Hanov&#x27;s work:<p><a href="http:&#x2F;&#x2F;stevehanov.ca&#x2F;blog&#x2F;index.php?id=33" rel="nofollow">http:&#x2F;&#x2F;stevehanov.ca&#x2F;blog&#x2F;index.php?id=33</a><p><a href="http:&#x2F;&#x2F;zwibbler.com&#x2F;" rel="nofollow">http:&#x2F;&#x2F;zwibbler.com&#x2F;</a><p><a href="https:&#x2F;&#x2F;www.websequencediagrams.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.websequencediagrams.com&#x2F;</a>
imkevinxuabout 7 years ago
Reminds me of this old website I built back in college <a href="http:&#x2F;&#x2F;xkcdgraphs.com&#x2F;" rel="nofollow">http:&#x2F;&#x2F;xkcdgraphs.com&#x2F;</a>
评论 #16573649 未加载
tobinharrisabout 7 years ago
Really cool stuff.<p>Would look great in <a href="http:&#x2F;&#x2F;yuml.me" rel="nofollow">http:&#x2F;&#x2F;yuml.me</a> which also has a sketchy look.<p>I need to rewrite yUML using newer tech, business collaborations welcome :)
egnehotsabout 7 years ago
Are there any good papers about this kind of stuff?
CodeCubeabout 7 years ago
This is just lovely :) I guess I don&#x27;t really have much to add, other than to say you&#x27;ve delighted me with this
评论 #16573451 未加载
kmfrkabout 7 years ago
I would absolutely love a flow chart library that used this with decent text alignment.<p>I used to prefer mermaid.js, but it silently fails in ways the don&#x27;t work that well for me: <a href="https:&#x2F;&#x2F;mermaidjs.github.io&#x2F;mermaid-live-editor" rel="nofollow">https:&#x2F;&#x2F;mermaidjs.github.io&#x2F;mermaid-live-editor</a>.
评论 #16574304 未加载
评论 #16574880 未加载
RMarcusabout 7 years ago
Very cool! I wrote something similar, but it only renders lines. <a href="https:&#x2F;&#x2F;rmarcus.info&#x2F;blog&#x2F;2017&#x2F;10&#x2F;23&#x2F;humanlines.html" rel="nofollow">https:&#x2F;&#x2F;rmarcus.info&#x2F;blog&#x2F;2017&#x2F;10&#x2F;23&#x2F;humanlines.html</a>
pit2about 7 years ago
Does anyone know how this can be exported&#x2F;used&#x2F;translated to work with Inkscape?
frunzalesabout 7 years ago
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?
评论 #16578332 未加载
评论 #16573665 未加载
H00tyMcOwlFaceabout 7 years ago
No idea what I will be using it for yet, but I am sure I will!
ohfabout 7 years ago
Does anyone else get a fancy pants adventure vibe from this?<p>There&#x27;s a critique about digital art in general here: over-perfection is dull. I&#x27;m all about that wabi-sabi.
saintPirelliabout 7 years ago
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.
glhaynesabout 7 years ago
Fantastic! I love this sort of thing, hope to see it used a lot. Could definitely use support for high-DPI screens.
JasonSageabout 7 years ago
I&#x27;d love to pair this with one of those tools that turns ascii drawings into SVGs. Looks great!
laktakabout 7 years ago
Anybody know of a tool that can convert ascii drawings (in markdown) to this?
评论 #16576434 未加载
buildfocusabout 7 years ago
This is very cool, but I have no idea at all where I&#x27;d ever use it.
kenningabout 7 years ago
This is awesome! Do you have plans to integrate with canvas.js?
评论 #16574240 未加载
sporkologistabout 7 years ago
Simulated badly-drawn hatching! This is great!
kqrabout 7 years ago
Has anyone attempted to combine this with D3?
评论 #16572284 未加载
评论 #16573809 未加载
评论 #16572506 未加载
gugagoreabout 7 years ago
Related: <a href="https:&#x2F;&#x2F;matplotlib.org&#x2F;xkcd&#x2F;examples&#x2F;showcase&#x2F;xkcd.html" rel="nofollow">https:&#x2F;&#x2F;matplotlib.org&#x2F;xkcd&#x2F;examples&#x2F;showcase&#x2F;xkcd.html</a>
评论 #16573284 未加载
FromTheIdabout 7 years ago
Aw man I love this.<p>Thank you!
doczoidbergabout 7 years ago
does anybody know something similar for .NET (WPF) applications?
mito88about 7 years ago
nice!
ashleymarshabout 7 years ago
This is fantastic!