Show HN: Pts.js – A library for visualization and creative coding
ptsjs.org
ptsjs.org
The fact that it wasn't. That's what's gonna make me actually check this out.
Well done!
Typescript may be different and may be better, but there is a lot of rightly justified hesitation to adopting it.
Perhaps writing it is a bigger ask--a twenty minute session of reading and poking at the language in VSCode did it for me, but maybe I'm secretly some kind of TypeScript savant--but this just plain should not be a problem for anybody who's up on modern JS.
For awhile, React/Redux was really kind of gross with TypeScript, but even that's mostly hammered out. (React's new context API did a lot to reduce my use of Redux in general, and works pretty comfortably with TypeScript too.)
I didn't want to use P5 though. Not sure why, I wasn't a big fan of Processing for some lost reason. Also I didn't really need a big canvas library such as Pixi.
When I took a look at this project, half the methods were familiar to me as I have searched for these and cobbled together some lame collection of random functions into a weak "library". In a few weeks, when I am finished and need to review all this, I will definitely be trying to integrate this.
If you are the Author, thanks very much for your time and for sharing.
p5 is great too so I would recommend giving it a try also.
In particular I really like a lot of the decisions made in regards the point object: using Float32Array, making it the primary abstraction, and keeping the number of dimensions unspecified.
I've been working through some ideas on ways to implement a Vectorpark style psuedo-3d projection engine and pts.js seems to have almost all the basic tools I needed to build and then some.
p5 and pixi seem to be more on the "just tell me where to put it, and I'll draw it for you" line. Pts has a whole bunch of higher-level abstractions where you can define mathematical and geometric operations to apply to your points:
> Ganja.js is a Geometric Algebra code generator for javascript. It generates Clifford algebras and sub-algebras of any signature and implements operator overloading and algebraic constants.
> (Mathematically, an algebra generated by ganja.js is a graded exterior (Grassmann) algebra (or one of its subalgebras) with a non-metric outer product, extended (Clifford) with geometric and contraction inner products, a Poincare duality operator and the main involutions and morphisms.)
> (Technically, ganja.js is a code generator producing classes that reificate algebraic literals and expressions by using reflection, a built-in tokenizer and a simple AST translator to rewrite functions containing algebraic constructs to their procedural counterparts.)
> (Practically, ganja.js enables real math syntax inside javascript, with element, vector and matrix operations over reals, complex numbers, dual numbers, quaternions, or any other Clifford Algebra.)
I felt right at home being an avid VScode user.
Hope it doesn't fade away like http://mojs.io or other web animation/graphics libraries.
I like the simplicity. The choice of key operations to implement results in rather concise working example code.
At first glance, this library abstracts away a lot of the boring geometric / interaction boilerplate. Impressive!
So much so that I yoinked one of your demos and used it on my landing page: https://lanes.io.
Thanks.
Beautiful website btw - clearly took a lot of effort.
And here I am, playing with the interactive background instead of doing anything productive!
development-wise, the structure of a pts space looks very similar to that of a p5 sketch based on the starter example. setup looks more involved than p5, but imo a worthy trade-off because the result is real modules and a better bundling experience. but for those less in tune with the bundling zeitgeist of javascript in 2018, this could be a real barrier to entry. either way, i can't wait break it
If they can position themselves as a common-person d3, they would have themselves a huge win. The fact that they say typescript right in the title (yet, another technology you have to learn to get started), is not terribly inspiring.
The performance should be a bit better (with Float32Array) though I haven't compared them.
I'll file an issue tomorrow with exact details.
it does seem to be a pretty cool lib though