Better HN
topnewbestaskshowjobs
Log inSign up

shihn

1,317 karma · joined Jan 9, 2016 (10y ago) · 162 submissions

Submissions

comment 3y ago · link · parent

I implemented MathML as web components a few years ago as a work around. It wasn't super hard, but a native implementation provides so much better accessibility (and, likely, perf) https://github.com/pshihn/math-ml

2.

CafeMedia Acquires Slickstream(cafemedia.com ↗)

1 points · by shihn · 4y ago · discuss

3.

Show HN: Venny is a set of components to create Venn Diagrams on a web page(pshihn.github.io ↗)

12 points · by shihn · 5y ago · discuss

comment 5y ago · link · parent

Actually there is some connection in rough.js' sketchy curve rendering and the way excalidraw smooths the hand-drawn shape. That is the Ramer–Douglas–Peucker algorithm https://en.wikipedia.org/wiki/Ramer%E2%80%93Douglas%E2%80%93...

The way excalidraw does it, it collects all the points from mouse-move events, then uses the algorithm to take those points and reduce the number of points. The reduction is done by a 'distance' parameter in the algorithm. So instead of `n` points, you now have `m` points. m < n. Then excalidraw fits a rough curve through those `m` points. This fitting is automatically done in roughjs. Fewer points and curve fitting gives the effect you mentioned.

(The reduction algorithm is implemented and used from this package: https://github.com/pshihn/bezier-points) p.s. thanks for the shoutout @swyx

5.

Analyzing Voting Systems(shihn.ca ↗)

7 points · by shihn · 6y ago · discuss

6.

Autoplaying back-to-back videos on the web using a Media Pool(shihn.ca ↗)

3 points · by shihn · 6y ago · discuss

7.

How COVID-19 has affected food blogging(slickstream.com ↗)

2 points · by shihn · 6y ago · discuss

comment 6y ago · link · parent

Definitely. Please add an issue with what you'd like to see. Thanks.

comment 6y ago · link · parent

I wrote roughjs a couple of years ago and had always thought it would be nice to use it in all the ways people draw hand-drawn shapes. Annotation is one of them. I never got around to implementing it. Since roughjs does most of the heavy lifting, implementing this was not a lot of time. I did it in a day (~4-6 hours). Actually it took longer to make the website for the project and writing the readme :/

comment 6y ago · link · parent

People have created framework wrappers for this:

Rect: https://github.com/linkstrifer/react-rough-notation Svelte: https://github.com/dimfeld/svelte-rough-notation Vue: https://github.com/Leecason/vue-rough-notation

comment 6y ago · link · parent

I did implement a version of this in Houdini a couple of years back, that and a short thread of what Houdini was lacking in this case: https://twitter.com/preetster/status/1265679970006757376

comment 6y ago · link · parent

Ah sorry, should have titled the post better. :/

comment 6y ago · link · parent

Yes definitely possible. It just looks more sketchy with two passes. And it should be easy to configure. Perhaps add to the issues with any thoughts? Thanks https://github.com/pshihn/rough-notation/issues

comment 6y ago · link · parent

Thanks. the idea behind rough was to provide primitives to draw anything. maps and dataviz are definitely one of the main use cases.

comment 6y ago · link · parent

Thanks. Online tutorials, presentations, editing, Direct attention of the reader to something specific.

I was thinking anything that you'd do such annotations on physical paper.

comment 6y ago · link · parent

Good idea. I had thought of adding text to annotations but didn’t want to complicate the first draft of this.

comment 6y ago · link · parent

Thanks!

18.

Show HN: RoughNotation – create and animate hand-drawn annotations on a web page(roughnotation.com ↗)

696 points · by shihn · 6y ago · 74 comments

19.

How to emulate hand-drawn shapes – Algorithms behind RoughJS(shihn.ca ↗)

36 points · by shihn · 6y ago · discuss

comment 6y ago · link · parent

I used OpenCV in WASM to create a RoughJS version of an image a couple of years ago. https://pshihn.github.io/rough-draw/
123456