Wykres commitów

17 Commity (6bf332049d5bf0b5c250793db057d42498a324ba)

Autor SHA1 Wiadomość Data
Atul Varma d1c2ae4b02
Always permalink to Mandalas. (#99)
This addresses #61 by making mandalas permalinked.

The URL to a mandala will change whenever the user stops fiddling with it for 250 ms.  This means that the user can always reload the page to get a reasonably recent version of what they were creating, and they can use the browser's "back" and "next" buttons to effectively undo/redo recent changes.  They can also copy the URL to share it with others.

## About the serialization format

Originally, I stored the state of the user's mandala in the URL using JSON.  This had a number of drawbacks, though:

* **It was really long.**  A mandala serialization was almost 1k characters, which was a very big URL, and one that some sharing platforms might even reject.

* **It wasn't type-checked in any way.** Unless I added some kind of JSON schema validation (which I didn't), the serialization was simply deserialized and assumed to be in the proper format.  This could result in confusing exceptions during render time, rather than decisively exploding at deserialization time.

To resolve these limitations, and because I thought it would be fun, I decided to store the mandala state using a serialization format called [Apache Avro][].  I first read about this in Kleppmann's [Designing Data-Intensive Applications][kleppmann] and was intrigued by both its compactness (a serialized mandala is around 80-120 characters) and schema evolution properties.

It might be going a bit overboard, but again, I thought it would be fun and I wanted to play around with Avro.  Also, I tried architecting things in such a way that all the Avro code is in its own file, and can easily be removed (or swapped out for another serialization format) if we decide it's dumb.

[Apache Avro]: http://avro.apache.org/
[kleppmann]: https://dataintensive.net/

## Other changes

This PR also makes a few other changes:

* Tests can now import files with JSX in them (I don't think this was required for the final state of this PR, but I figured I'd leave it in there for its almost inevitable use in the future).

* The value labels for number sliders now have a fixed width, which eliminates a weird "jitter" effect that sometimes occurred when using them.
2021-04-24 08:46:32 -04:00
Atul Varma db7d186234
Run prettier during CI. (#85)
Fixes #83.
2021-04-07 19:39:55 -04:00
mittimithai 558fa0aa6a
random colors now being sampled from hsluv (#80)
This samples colors from the HSLUV color space instead of the RGB color space, which should result in better randomized colors.
2021-04-06 20:33:08 -04:00
Atul Varma 47d9550e51 Remove mkdirp, we don't seem to need it... 2021-04-06 20:22:52 -04:00
Atul Varma 9e1bca8fe3
Use rimraf in build script. (#81)
We currently use `rm -rf` in our build script, which is unix-specific. This uses `rimraf` to support Windows.
2021-04-06 19:39:05 -04:00
Atul Varma 6136253cd6
Add basic animation support to the mandala page (#75)
This addresses part of #71 by adding some basic animation support to the mandala page.
2021-04-03 17:01:13 -04:00
Atul Varma 3e1b66a984
Add support for TOML symbol metadata. (#33)
This fixes #20 by adding support for TOML-based metadata for symbols.

There's now a template TOML file in `svg/_template.toml` that documents all the different metadata properties.  The file can be copied to match the name of an SVG file (but with a `.toml` extension) and it will be processed by the vocabulary builder when the site is generated.

Currently there are only two properties documented, `always_nest` and `always_be_nested` (as per the needs outlined in https://github.com/toolness/mystic-symbolic/issues/17#issuecomment-786696966), but they don't actually do anything yet (actual support for _using_ the metadata will come in another file).

Right now the TOML files are validated quite stringently: if a file contains the name of a property it doesn't understand, or the type of the property is wrong, it will raise an error. We can revisit this if it becomes burdensome.
2021-02-26 21:30:38 -05:00
Atul Varma 6dfa738548 Add test suite. 2021-02-16 06:21:51 -05:00
Atul Varma 11c27b905f Make attachment point code more DRY. 2021-02-15 09:13:00 -05:00
Atul Varma b441b10493 Add typecheck script. 2021-02-13 19:27:25 -05:00
Atul Varma 67d8c8f3e2 Clear dist dir before building for deploy. 2021-02-03 20:35:19 -05:00
Atul Varma 72505ac1ff Add deploy script. 2021-02-03 20:08:18 -05:00
Atul Varma ac11ec8227 add 'npm run build' script. 2021-02-03 20:06:35 -05:00
Atul Varma f0960d4280 use react. 2021-02-03 19:11:34 -05:00
Atul Varma a4a1013a8c Add more stuff. 2021-02-02 20:09:49 -05:00
Atul Varma e507f6311d remove fill, stroke attrs 2021-02-02 19:40:56 -05:00
Atul Varma 1a4c8adc41 Origination. 2021-02-02 19:26:40 -05:00