-
Notifications
You must be signed in to change notification settings - Fork 3k
chore(tests2png): add first version of PNG diagram generator #757
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
Conversation
1158c80 to
3ebb2cf
Compare
|
Seems travis is not happy with changes - is this PR work in progress? |
82a349b to
7584ac4
Compare
|
Now passing tests. |
|
Does images supposed to be checked in, or to be generated on each local machine? |
package.json
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's remove ^ to stay with specific version as same as other libraries.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will do.
I don't know, that's up to us. What do you suggest? They could be generated at the same time docs are generated. Primary reason why I checked them in is to show how the diagrams look like, for review. :) |
|
This is now feature complete. It generates diagrams for the trickiest cases: Cold observables that start emitting after a while has passed Observable of Observables as input Observable of Observables as output When this is merged, all we need to do is add |
: Think this makes sense, doc could include this diagrams so doesn't require to generate it manually per each users. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so does it.asDiagram() serves as test case as well as diagram generator?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, both. Only it.asDiagram specs are used for tests2png, but both it and it.asDiagram are used for npm test.
|
WOOO! That is some fancy work, @staltz |
|
:) |
|
@kwonoj images removed from git, and fixed that |
|
I'll try to look in detail around tomorrow, stuck in bed with flu all day. |
Yuck. Get better. |
|
@staltz can you rebase? |
Build Jasmine helper that detects tests tagged with asDiagram() and runs a painter script to create a PNG marble diagram out of them. First attempt at resolving ReactiveX#697.
Support drawing diagrams of cold observables with an offset in time to account for the time they get subscribed to, specially important in diagrams such as for the concat operator. For issue ReactiveX#697.
…rble Improve the looks of the complete marker when it overlaps with a marble (both happen at the same VirtualTimeScheduler frame, or are very close in time). For issue ReactiveX#697.
Support diagrams for Observable of Observables, either as inputs or as outputs. Add example usage for mergeAll, switch, and groupBy For issue ReactiveX#697.
Create img folder before running image generation script, and use verbose output when debugging. For issue ReactiveX#697.
d240045 to
2f7fdf9
Compare
|
@Blesh Rebased. |
|
@staltz I've pulled it down and tried it out. It definitely works. I ran into a few issues I think we should address in this PR though:
Overall a VERY COOL PR! |
I can write down how to configure a test to be converted to a PNG. But the general case of ad hoc generating PNGs is not supported. If it would, it would make sense to make that a separate library. |
|
@Blesh some few commits added to fix issues you mentioned. |
|
Tests failing just because markdown-doctest doesn't recognize |
|
@Widdershin how do I configure |
|
@staltz You could probably do either, but my instinct is just to mock it out. If you add something like this to var it = {
asDiagram: function (name) {
return function (label, callback) {
callback()
}
}
}And then add globals: {
...
it: it
},That should do the trick. Does that make sense? |
|
Hmm, I'll try that! Thanks! |
|
@Blesh I fixed the markdown-doctest. Maybe now it's good to merge. |
|
Woot!!! I'll start going wild by making diagrams for all operators :) |



Build Jasmine helper that detects tests tagged with asDiagram() and runs a painter script to create
a PNG marble diagram out of them.
First attempt at resolving #697.