svg-postprocess/ contains postprocessors of the SVG document (as a string) and its manager (. octopus-process/process-effects/process-effectgroup-strokeĮach of these groups contains group processor ( index.js) and files responsible for every single effect of a group. octopus-process/process-effects/process-effectgroup-inner-shadow octopus-process/process-effects/process-effectgroup-drop-shadow So, there are the following groups of effects. Order of effects processing is set by the order of elements in array groups of each layer type and the key targetIndex which value describes the index of the target element (for example, shape). Furthermore, effectsGroupsByLayer object represents map of effects related to the layer types and its order. The file contains object effectsMap describing groups of effects and responsible functions. octopus-process/config/effects-processing.js. The configuration of effects processing is located at. Groups are necessary for order of effects processing. octopus-process/process-layer /process-layer-text/Įffects are divided by groups. octopus-process/process-layer /process-layer-shape/ octopus-process/process-layer /process-layer-group/ octopus-process/process-layer /process-layer-bitmap/ Layers processors are separated by the layer type of Octopus 2.0 and are located at. octopus-process/ contains all the core features of the SVG Exporter, like layer processing, effects processing and its configuration. At the moment, the only one preprocessor is used - remove-blank-layers (it removes blank layers from input). Order of preprocessors and the list of currently used ones is available at preprocessors manager (. Preprocessors doesn't depend on options of SVG Exporter. Preprocessors are used to modify and prepare input layers before SVG creation. octopus-preprocess/ contains preprocessors and its manager (. The structure of the package is divided to three processing phases: shape-detect - attempts to replace elements of known shapes, such as rectangles with more semantic-friendly elements such as currently supports only detection of rectangle.replace-xmlns - replaces :svgjs xml namespace with :avocode namespace.remove-svgjs-ids-prefixes - removes SVGJS prefixes of elements' ids.remove-svgjs-helpers - removes useless trash generated by SVGJS (happens only sometimes).set-image-xlink - required to modify SVG output of SVGJS to make it correctly support images.If there is postprocess key in the options of SVG Exporter, then only postprocessors listed in these options will be used. All of the following are enabled by default. It's not enabled by default because blending modes aren't as exact and consistent in browser (using mix-blend-mode style property) as Sketch or PS. blendings - if true, then result SVG document will contain mix-blend-mode property on different kind of layers and effects.scale - by default 1, the scale of the result SVG document.Passing Raven instance is possible through property. env - the object specifies some environment descriptors, like Raven instance and so on.Current version of SVG Exporter doesn't have any postprocessors requiring arguments, so, it's okay to set the value of undefined for every postprocessor. postprocess - describes an object where key is name of SVG postprocessor (check list of postprocessors below) and value is object representing arguments of postprocessor.bitmaps - describes an object where key is id of bitmap layer and value is HTMLImageElement, Image, HTMLCanvasElement or Canvas object.At the current moment there aren't many options, but it's designed to be able to setup the process of converting with options. Next argument ( options) is an object containing all the global options of the SVG Exporter. The first argument ( octopusLayers) describes an array of Octopus 2.0 layer objects. Then run this function with the following arguments: SVGExporter( octopusLayers, options) Just import SVGExporter function from the index.js: import SVGExporter from 'svg-exporter' Strokes (including inside, outside and centered).Gradient fill (including linear and radial).SVG Exporter also supports the following effects: Based on Octopus 2.0 format, SVG Exporter currently is able to process the following features:
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |