shihn
shihn on Hacker News
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
Posted by
shihn on Wednesday August 24, 2022 @05:18PM
from the cafemedia.com dept.
Posted by
shihn on Friday November 19, 2021 @01:05PM
from the show-hn dept.
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
Posted by
shihn on Tuesday November 10, 2020 @07:09PM
from the shihn.ca dept.
Posted by
shihn on Thursday July 30, 2020 @06:09PM
from the shihn.ca dept.
Posted by
shihn on Monday June 01, 2020 @12:22PM
from the slickstream.com dept.
Definitely. Please add an issue with what you'd like to see. Thanks.
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 :/
Ah sorry, should have titled the post better. :/
Thanks. the idea behind rough was to provide primitives to draw anything. maps and dataviz are definitely one of the main use cases.
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.
Good idea. I had thought of adding text to annotations but didn’t want to complicate the first draft of this.
Posted by
shihn on Thursday May 28, 2020 @12:31PM
from the show-hn dept.
Posted by
shihn on Saturday May 23, 2020 @01:09PM
from the shihn.ca dept.
Posted by
shihn on Saturday February 15, 2020 @01:10PM
from the shihn.ca dept.
RoughViz is awesome, and it also used RoughJS for rendering.
wired-elements could be adapted to v4.0 of roughjs, which supports random number seeding. Causing the shape to remain the same, once generated.
Posted by
shihn on Friday January 24, 2020 @02:20PM
from the roughjs.com dept.
It's an artifact of how Rough.js renders sketchy lines. It does that by creating some random offsets. For some random values, it may create this effect for long lines, which is not ideal. This is less pronounced in shorter lines. The latest release has tried to reduce this effect, but there is a small probability that it may still happen:
https://roughjs.com/posts/release-4.0/
btw Legra does the offscreen canvas trick when rendering images, but not when drawing primitives
True but having raw parts would give it more flexibility when animating or changing sections of the image. Especially when the canvas size is large, it won't be as optimal
These are really cool!
The goal of legra was to provide primitives though and not just for images so one can draw dynamic, charts, shapes, animations.
It doesn't redraw the whole canvas. The optimizations are really needed when 'filling' a shape. If you draw a large polygon, it may take a little longer to fill it with bricks.
Optimizations can be made by using WebGL instead.