-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use Swirly to generate PNGs #5019
Conversation
attn @jwo719 |
Wow those images are amazing. I would happy to merge, would you mind resolving the conflicts, right after it I am happy to merge it! |
Wow, I wasn't expecting such a positive response. 🙂 Sure, let me resolve the conflicts. |
I unfortunately ran into two issues when rebasing:
|
So I used git clean -fdX && \
npm i [email protected] && \
npm i && \
npm run tests2png -- --grep '.*audit.*' The I focused on Both these commits introduce |
As can be seen above, I created follow-up tickets #5099 and #5100 for the issues I encountered. In the meantime, I've left this PR in its original state. However, the rebased (and therefore broken) version is also available, as my |
@timdp Coud you maybe try rebasing this, afterwards I will try to pick it up and support you as much as possible |
I've rebased my |
Closing this in favor of #5422. |
While I think it's great that the official RxJS docs come with many marble diagrams, it's always kind of bothered me that the text in there is poorly antialiased. Additionally, I feel like they could be annotated here and there to make it clear what's going on.
Now, I'm about to do a talk on Rx, so I needed a quick way to generate diagrams. Some tools exist already, but I couldn't find any that would let me render higher-order observables. Additionally, I still would have had to annotate the resulting images manually for my talk.
As a result, I set out to build my own diagram generator called Swirly. It generates diagrams from a text-based declaration and exports them to SVG. That means high-res vector graphics and hopefully an extensible format for annotations. The diagrams could also be instrumented for interactivity a la rxmarbles.com, but that's hypothetical at this point. There's a live demo over at swirly.now.sh.
While Swirly isn't mature yet, I already had a stab at porting the RxJS code that generates PNGs to a format that Swirly understands. The result is this PR. As far as I can tell, the diagrams are identical to the existing ones, but I'll admit it's not the easiest thing to test. Here's an example:
For compatibility reasons, I added some boilerplate code that renders the SVGs to PNG using Puppeteer. Additionally, I force-committed the Git-ignored images for demonstration purposes. Both steps are optional; the docs could theoretically also include crisp SVGs.
I'm not necessarily advocating replacing the current images with Swirly-generated ones, but if there's any appetite for that, I'm happy to help out further.