(id: string, matrix: string)
| 6 | createNode: (target) => { |
| 7 | const SVG_NS = 'http://www.w3.org/2000/svg'; |
| 8 | const createMatrixFilter = (id: string, matrix: string) => { |
| 9 | const filter = document.createElementNS(SVG_NS, 'filter'); |
| 10 | filter.id = id; |
| 11 | filter.style.colorInterpolationFilters = 'sRGB'; |
| 12 | |
| 13 | // Fix displaying dynamic content https://bugs.chromium.org/p/chromium/issues/detail?id=647437 |
| 14 | filter.setAttribute('x', '0'); |
| 15 | filter.setAttribute('y', '0'); |
| 16 | filter.setAttribute('width', '99999'); |
| 17 | filter.setAttribute('height', '99999'); |
| 18 | |
| 19 | filter.appendChild(createColorMatrix(matrix)); |
| 20 | return filter; |
| 21 | }; |
| 22 | |
| 23 | const createColorMatrix = (matrix: string) => { |
| 24 | const colorMatrix = document.createElementNS(SVG_NS, 'feColorMatrix'); |
no test coverage detected
searching dependent graphs…