298 points · by binshu · 1y ago · 46 comments
Very slick look and feel :D
And it doesn't boast about it, but it's open source https://github.com/ishubin/schemio
1. a basic open source one you can self-host,
2. and another closed-source one with accounts and other features that schem.io uses?
And (I'm just thinking out loud, and don't want to encourage any development as I am not a real user) is there a server-less embeddable version that perhaps just saves/loads locally with a javascript API for use in other apps?
1. Self-hosted, there is even a docker container available (https://hub.docker.com/r/binshu/schemio/tags). It does not have authorization and user-management, stores all diagrams on a file system. But it allows you to run server in write and read-only mode
2. https://schem.io - a service for collaborative editing and sharing of diagrams. This is obviously a closed-source for now and it uses the open-source frontend of Schemio
3. Schemio as a js library. Although I am not really releasing it to npm, just hadn't the time to work this out. But there is an option to build a js lib that lets you use Schemio as a Vue component. That's actually how I made it work on https://schem.io
4. https://schemio.app - Google Drive based frontend. All your diagrams are stored on Google Drive. Obviously you cannot share your diagrams, as they are only available to you. This is completely open-sourced and you can even build it yourself with npm
5. Static deployment. If you use option 1, you can export all of your diagrams into a static deployment and even host it on Github pages.
6. Standalone player of Schemio that lets you embed a single diagram on your website
If that's what you mean, then no. I do have plans to work on this in the future, but I am not sure when I'll get the time for that.
Or do you mean just generating a diagram and posting it to Schemio programatically? This is possible, but it's not documented.
All diagrams are stored in JSON by the way and the structure is quite straightforward, so it shouldn't be too difficult to generate it yourself
If you want open source alternatives, I remembered seeing now a little while ago this https://blog.eowyn.net/netlistsvg/ but never tried it myself, you might give it a go.
https://personal.math.ubc.ca/~cass/graphics/text/old.pdf/las...
https://scientificgems.wordpress.com/2014/11/28/mathematics-...
Don’t you just learn transformation matrices in algebra?
Affine transforms are apparently attributed to Mobius and Gauss. That’s like the 1700s.
What is vector based 2D graphics if not a direct application of geometry? Were we not using well known maths results when 2D graphics was first implemented on a computer?
Also, if you wanted to, you could juice up your discussion of the importance of performing transformations in the right order to introduce the idea of conjugates (https://en.m.wikipedia.org/wiki/Inner_automorphism) and commutators (https://en.m.wikipedia.org/wiki/Commutator). Although in your context introducing these explicitly might just make the exposition more complicated, they are useful tools to have in your general toolkit. (Conjugacy in particular, as you implicitly discuss, is practically built to express the idea "change from inconvenient coordinates to convenient ones, transform in convenient coordinates, then change back.")
But don't all editors use linear algebra?
Also another point is that, if you rely on SVG for rendering you could get away with just the code without thinking too much about the math involved. For instance if I wouldn't have introduced object hierarchy, I wouldn't even have to bother with math at all. SVG can take care of all the transformations, I wouldn't even have to know that matrices exist and that I could use them in svg objects 1-on-1. Dragging an object without a hierarchy would also propably be much easier, all I had to do is to change the translate(x,y) inside of the svg transform attribute.
Alas, I have not found a web equivalent that works as well as QGVF.
I've got the feeling that it will be more intuitive to use geometric algebra instead of linear algebra for the transformation and animation [1].
[1] Projective Geometric Algebra:
I'm confused by this. Why use a 3D matrix for a 2D transformation?
https://en.wikipedia.org/wiki/Quaternions_and_spatial_rotati...
"For example, a point in space is a 3×1 matrix. To transform it, you multiply it by a 3×3 transformation matrix."
It seems we're transforming a point in 3D space using a 3x3 matrix, no?
We can represent this with the trick of "homogeneous coordinates", using 3D vectors with the last entry 1 and 3x3 matrices with the last row [0, 0, 1].
This is convenient because both mathematicians and programmers are familiar with linear transforms and matrices. It's in the comfort zone. There are many libraries.
However, it's wasteful to store all those extra 1's and 0's in memory. You can always replace the matrices with
class Affine2D { Matrix2x2 linear; Vector2 shift; };
and overload all the algebraic operators, including multiplication with 2D vectors.