docs/svg/README.md
Most images are in SVG format and represent a marble diagram.
Such SVG are embedded in the javadoc jar, and as such need to be in a doc-files folder inside the source hierarchy.
As a result, most SVG live in /reactor-core/src/main/java/reactor/core/publisher/doc-files/marbles/.
The graphical conventions for SVG marble diagrams are displayed in /docs/svg/conventions.svg (in an unoptimized raw SVG).
One can pick graphical elements from it and add them to a new SVG marble diagram should one want to contribute such a diagram.
Some of these conventions have also been extracted and reworked with a user/reader's perspective in mind, in order to describe how to read a marble diagram.
These legend- SVGs are specific to the reference documentation.
All images that are specific to the reference documentation can be added to the /docs/asciidoc/images/ folder.
SVGs purely aimed at the reference guide still need to be optimized, notably the legend- ones, otherwise they tend to have rendering issues in the PDF version.
The recommended workflow for editing or contributing new SVG marble diagrams is as follows:
Inkscape)Tahoma font family and fall back to Nimbus Sans L for Linux:
font-family:'Tahoma','Nimbus Sans L'Lucida Console font family and fallback to Courier New:
font-family:'Lucida Console','Courier New'All *.svg marble diagrams are found in /reactor-core/src/main/java/reactor/core/publisher/doc-files/marbles/ folder.
This same folder will be embedded in the -sources.jar and -javadoc.jar artifacts.
Note that there is a conventions.svg document that regroups the different graphical conventions for representing recurrent elements of marbles (static operator vs method operator, blocking, timeouts, lambdas, etc...), as well as more SVGs in /docs/asciidoc/images (which also includes symlinks to flux.svg and mono.svg marbles).
We want the SVG size to be kept as small and clutter-free as possible, as the images are embedded in the source and javadoc jars. As a result, we recommend that an optimization step be taken when editing/creating SVGs.
That said, in order for the SVG source to be readable in editors, we prefer the SVG to be kept pretty printed.
We also had a lot of problems with arrowheads disappearing during optimizations, which you should keep an eye out for.
So the recommended configuration for optimizing is as follows:
brew install svgo)svgo --input="reactor-core/src/main/java/reactor/core/publisher/doc-files/marbles/reduce.svg" --multipass --pretty --indent=1 --precision=2 --disable={cleanupIDs,removeNonInheritableGroupAttrs,removeViewBox,convertShapeToPath}
TIP: you can use git to stage the file pre-optimization, check it renders correctly post-optimization and revert using git checkout path/to/file.svg if that is not the case.
Alternatively, to optimize a whole folder into a temporary folder for comparison, use the --folder and --output options:
svgo --folder="reactor-core/src/main/java/reactor/core/publisher/doc-files/marbles/" --multipass --pretty --indent=1 --precision=2 --disable={cleanupIDs,removeNonInheritableGroupAttrs,removeViewBox,convertShapeToPath} --output=/tmp/svg/ --quiet
Try ungrouping the object.
Some objects are grouped for copy/paste convenience in the conventions.svg document, but should be ungrouped.
Unfortunately, Inkscape with XQuartz is not always ideally working. This disappearing problem is due to misalignment in coordinate systems.
You can deactivate an option in OSX's Mission Control preferences: uncheck Displays have separate spaces.
This needs a re-login and has the unfortunate effect that the menu bar will now only appear on the main screen (the one with the dock).
Rendering options: number of thread, cache size, display filters quality.Double click on the rectangle and select the top left corner (square handle). Hold Ctrl (or Cmd) to only move horizontally, and move the handler closer to where you want it. Repeat the same operation with the bottom-right handle.