- Default configuration:
{
"rules": {
"combine-path": [true, {
"disregardFill": false,
"disregardOpacity": false
}]
}
}
- Explanation:
- Merge path nodes that meet the following conditions:
- All attributes and styles (including inherited styles) are the same
- adjacent
- no fill
- stroke transparency is not less than 1
- No marker-start, marker-mid, marker-end
- Merge path nodes that meet the following conditions:
- Configuration parameters:
- disregardFill
- Default: false
- Whether to allow paths that meet the following conditions:
- stroke is empty
- fill-rull is not evenodd
- The transparency of fill is not less than 1
- disregardOpacity
- Default: false
- Whether to allow paths with transparency less than 1 E.g:
- disregardFill
<path d="M0,0L100,100" fill="none" stroke="red" stroke-width="2"/>
<path d="M0,50L100,150" fill="none" stroke="red" stroke-width="2"/>
After optimization will become:
<path d="M0,0L100,100M0,50L100,150" fill="none" stroke="red" stroke-width="2"/>