Rxjava: 2.x: Observable missing or incorrect images (tracking issue)

Created on 27 Apr 2017  路  37Comments  路  Source: ReactiveX/RxJava

  • [x] [Observable.singleOrError()](http://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Observable.html#singleOrError()): There is no default value and an empty source should result in an error.
  • [x] Observable.combineLatestDelayError(ObservableSource[], Function): missing diagram
  • [x] Observable.combineLatestDelayError(Function, int, ObservableSource...): missing diagram
  • [x] Observable.concatArrayEager: missing diagram
  • [x] Observable.error: should include the X in the operator body indicating it as being the parameter/return value
  • [x] Observable.fromFuture: the operator name in the box
  • [x] Observable.fromIterable: the operator name in the box
  • [x] Observable.fromPublisher: missing diagram
  • [x] Observable.just: the element should be a parameter inside the box, such outside elements imply a subject type external push.
  • [x] Observable.just(T, T) +7: optionally tailor the diagram to the actual number of arguments, plus move the constant values inside the box
  • [x] Observable.rangeLong: the operator name in the box
  • [x] Observable.switchOnNextDelayError: the operator name in the box, indicator of an error getting delayed
  • [x] Observable.zipArray: indicate there is a function instead of implying the output is an array containing one element from each source.
  • [x] Observable.zipIterable: the operator name in the box
  • [x] Observable.all: example of a false result
  • [x] Observable.ambWith: the operator name in the box
  • [x] Observable.blockingFirst: missing diagram
  • [x] Observable.blockingForEach: the operator name in the box
  • [x] Observable.blockingIterable: the operator name in the box, indicate that blocking may happen for each element
  • [x] Observable.blockingLast: the operator name in the box
  • [x] Observable.blockingLast(T): the operator name in the box, indicate default in the box, fix labels
  • [x] Observable.blockingLatest: missing diagram
  • [x] Observable.blockingMostRecent: the operator name in the box
  • [x] Observable.blockingNext: the operator name in the box
  • [x] Observable.blockingSingle: the operator name in the box
  • [x] Observable.blockingSingle(T): the operator name in the box, indicate default in the box, fix labels
  • [x] Observable.toFuture(): the operator name in the box, indicate multi-value, empty and error behavior
  • [x] Observable.blockingSubscribe: missing diagram
  • [x] Observable.cacheWithInitialCapacity: the operator name in the box
  • [x] Observable.collectInto: the operator name in the box, indicate the shared collection
  • [x] Observable.concatMapCompletable: missing diagram
  • [x] Observable.concatMapDelayError: missing diagram
  • [x] Observable.concatMapEager: missing diagram
  • [x] Observable.concatMapEagerDelayError: missing diagram
  • [x] Observable.concatMapIterable: missing diagram
  • [x] Observable.doAfterNext: missing diagram
  • [x] Observable.doFinally: missing diagram
  • [x] Observable.doOnDispose: the operator name in the box
  • [x] Observable.doOnComplete: indicate that the events pass through and the star is execute before the onComplete to downstream
  • [x] Observable.doOnError: indicate that the events pass through and the star is execute before the onError to downstream
  • [x] Observable.doOnLifecycle: change unsubscribe to dispose
  • [x] Observable.doOnNext: indicate that the events pass through and the star is execute before the onNext to downstream
  • [x] Observable.doOnTerminate: indicate that the events pass through and the star is execute before the onError or onComplete to downstream
  • [x] Observable.elementAt(long): example of empty source
  • [x] Observable.elementAt(long, T): example of empty source
  • [x] Observable.elementAtOrError(long): example of empty source
  • [x] Observable.firstElement: diagram is stretched
  • [x] Observable.firstOrError: the operator name in the box
  • [x] Observable.flatMap(Function, boolean, int): missing diagram
  • [x] Observable.flatMap(Function, boolean, int, int): missing diagram
  • [x] Observable.flatMap(Function, Function, Callable, int): missing diagram
  • [x] Observable.flatMap(Function, int): missing diagram
  • [x] Observable.flatMap(Function, BiFunction, boolean, int): missing diagram
  • [x] Observable.flatMap(Function, BiFunction, boolean, int, int): missing diagram
  • [x] Observable.flatMap(Function, BiFunction, int): missing diagram
  • [x] Observable.flatMapCompletable(): missing diagram
  • [x] Observable.flatMapIterable(Function): diagram looks stretched
  • [x] Observable.forEach(): missing diagram
  • [x] Observable.forEachWhile(): missing diagram
  • [x] Observable.hide(): missing diagram - not sure how to represent this
  • [x] Observable.lastOrError(): operator name in the box, error case example.
  • [x] Observable.onErrorReturn(): indicate that the value is the result of a function call
  • [x] Observable.onErrorReturnItem(): operator name in the box
  • [x] Observable.onTerminateDetach: missing diagram
  • [x] Observable.publish(Function): there is no connect call, may need extensive redrawing
  • [x] Observable.reduceWith(): operator name in the box
  • [x] Observable.repeat() + overloads: indicate fresh subscriptions happen, not caching
  • [x] Observable.repeatUntil: operator name in the box, indicate fresh subscriptions
  • [x] Observable.replay() + overloads: remove publish
  • [x] Observable.replay(Function, ...) overloads: may need extensive redrawing
  • [x] Observable.retry(long) indicate limited retry effect
  • [x] Observable.retry(Predicate) indicate predicate effect, show it in the box
  • [x] Observable.retry(long, Predicate) indicate predicate, show them in the box
  • [x] Observable.retryUntil: operator name in the box, show BooleanSupplier
  • [x] Observable.share(): fix labels with unsubscribe
  • [x] Observable.singleElement: example with empty source
  • [x] Observable.sorted: missing diagram
  • [x] Observable.startWith(T): have a single item as start value
  • [x] Observable.startWithArray(T...): operator name
  • [x] Observable.subscribe + overloads: missing diagram
  • [x] [Observable.switchMapSingle](http://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Observable.html#switchMapSingle(io.reactivex.functions.Function)): inner sources should have 1 item.
  • [x] Observable.switchMapDelayError + indicate the error case
  • [x] Observable.toList(Callable): indicate the custom collection somehow?
  • [x] Observable.toFlowable(): missing diagram
  • [x] Observable.unsubscribeOn(): missing diagram
  • [x] Observable.zipWith() + overloads: the diagram is in line with some text and appears pushed to the right
  • [x] Observable.test(): missing diagram, can this be represented as diagram?
2.x Documentation PR welcome

Most helpful comment

If you are on Mac and you own OmniGraffle, there is a file for all traditional diagrams:
https://github.com/ReactiveX/reactivex.github.io/issues/223

I'm using Excel 2007+ on Windows to draw the newer diagrams and have a file here you can use as basis for newer diagrams. I don't know if the open office variants could open this file or not, Google's viewer certainly doesn't show the drawings.

I suppose as a last resort you can draw in the open-office variants as well and post the PNGs in this issue. Uploading it requires access to the wiki git of RxJava. The target rendering is 640 pixels wide and as long as it needs to be.

The process is as follows:

  • Draw diagram(s)
  • Upload to git
  • Modify Javadoc locally to point to the raw usercontent
  • Verify and fix alignment/stretching
  • Commit PR to RxJava itself

All 37 comments

PRs welcome. The most easy ones are those that require alignment/displayed size corrections.

Hi David, I'd love to help, what would I use to edit the diagrams?

If you are on Mac and you own OmniGraffle, there is a file for all traditional diagrams:
https://github.com/ReactiveX/reactivex.github.io/issues/223

I'm using Excel 2007+ on Windows to draw the newer diagrams and have a file here you can use as basis for newer diagrams. I don't know if the open office variants could open this file or not, Google's viewer certainly doesn't show the drawings.

I suppose as a last resort you can draw in the open-office variants as well and post the PNGs in this issue. Uploading it requires access to the wiki git of RxJava. The target rendering is 640 pixels wide and as long as it needs to be.

The process is as follows:

  • Draw diagram(s)
  • Upload to git
  • Modify Javadoc locally to point to the raw usercontent
  • Verify and fix alignment/stretching
  • Commit PR to RxJava itself

Is it switchMapSingle need a new diagram too? SingleResource can't emit 2 items.

Yes. I'll add it to the list above.

ConcatArrayEager

Image

Error

Image
Image

fromFuture

Image
Image
Image
Image

fromIterable

Image

Another option is to use free open-source multi-platform Inkscape. Templates here:

https://github.com/davidmoten/rxjava-marble-template

startWith(T)

startwith t

startWithArray(T...)

startwitharray

Thanks. Could you make sure the operator box has its contents centered?

Sure. Going to edit them.

sorted()

Is it okay to add numbers to the marbles?

sorted

In this case yes, because it also demonstrates the self-comparable nature required (changing the order of colors is unlikely to convey the sorting aspect). For most of the other operators, the matching up of the color should be enough.

Not sure how you do these images, could you add shadows to the marbles, the time arrows and the vertical complete indicators?

I'm using @davidmoten's template. Going to edit them to add the shadows.

sorted(): it would be better that the source marbles are at the beginning and the output is only happening after onComplete:

---5--3--1--4--2--|--------------
[            sorted()           ]
---------------------1-2-3-4-5-|-

Added shadows and edited the sorted() operator.

just(T)

just

rangelong()

rangelong

Thanks @leonardortlima ! The first 5 images is added via #5524.

Just noticed that Single.filter and Maybe.filter are also incorrect; they seem to be copied from Observable.filter.

Quite possibly the other base reactive classes have copy-paste diagrams. This issue tracks the fixes of Observable but if you want, I can open issues for the other classes individually.

just(2)

just(2)

just(2)

just(2)

just(2)

just(2)

just(2)

just(2)

just(2)

switchOnNextDelayError

From #5668:

singleelement

zipIterable

zipIterable

ambWith

ambWith

blockingForEach

blockingForEach

blockingIterable

blockingIterable

blockingLast

blockingLast

blockingLast

blockingMostRecent

blockingMostRecent

blockingNext

blockingNext

blockingSingle

blockingSingle

blockingSingle

cacheWithInitialCapacity

cachecWithInitialCapacity

all

cachecWithInitialCapacity

fromPublisher

cachecWithInitialCapacity

zipArray

cachecWithInitialCapacity

blockingFirst

blockingFirst

blockingFirst

toFuture

toFuture

blockingSubscribe

blockingSubscribe

blockingSubscribe

blockingSubscribe

blockingSubscribe

collectInto

collectInto

doOnComplete

doOnComplete

doOnError

doOnError

doOnLifecycle

doOnLifecycle

doOnNext

doOnNext

concatMapCompletable

concatMapCompletable

concatMapDelayError

concatMapDelayError

concatMapEager

concatMapEager

concatMapEagerDelayError

concatMapEagerDelayError

concatMapIterable

concatMapIterable

doAfterNext

doAfterNext

doFinally

doFinally

doOnTerminate

doOnTerminate

elementAt

elementAt
elementAt

elementAtOrError

elementAtOrError

firstOrError

firstOrError

flatMap

flatMap
flatMap

flatMapCompletable

flatMapCompletable

forEach

forEachWhile

hide

lastOrError
onErrorReturn
onErrorReturnItem
onTerminateDetach
publish(Function)
reduce(seed, f)
reduceWith
repeat()
repeat(long)
repeatUntil
replay()
replay(int)
replay(int, long, TimeUnit)
replay(int, long, TimeUnit, Scheduler)
replay(int, Scheduler)
replay(long, TimeUnit)
replay(long, TimeUnit, Scheduler)
replay(Scheduler)

no arguments
scheduler
bufferSize
bufferSize, scheduler
time
time, scheduler
bufferSize, time
bufferSize, time, scheduler

retry(int)
retry(BiFunction)
retry(Predicate)
retry(int, Predicate)
retryUntil(BooleanSupplier)
share
switchMapSingle
switchMapSingleDelayError

toList(Callable)
toFlowable(BUFFER)
toFlowable(DROP)
toFlowable(LATEST)
toFlowable(ERROR)
toFlowable(MISSING)
unsubscribeOn

Was this page helpful?
0 / 5 - 0 ratings