Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to remove the filter nodes, after unfilter? #58

Open
webstermobile opened this issue May 10, 2022 · 1 comment
Open

how to remove the filter nodes, after unfilter? #58

webstermobile opened this issue May 10, 2022 · 1 comment

Comments

@webstermobile
Copy link

after unfilter I still can see the following code in the dom, so, how to remove these ?
<filter id="SvgjsFilter1005"><feFlood id="SvgjsFeFlood1000" result="SvgjsFeFlood1000" in="SourceGraphic" flood-opacity="1" flood-color="#4e00b1"></feFlood><feComposite id="SvgjsFeComposite1001" result="SvgjsFeComposite1001" in="SvgjsFeFlood1000" operator="in" in2="SourceGraphic"></feComposite><feGaussianBlur id="SvgjsFeGaussianBlur1002" result="SvgjsFeGaussianBlur1002" in="SvgjsFeComposite1001" stdDeviation="3 3"></feGaussianBlur><feOffset id="SvgjsFeOffset1003" result="SvgjsFeOffset1003" in="SvgjsFeGaussianBlur1002" dy="0" dx="0"></feOffset><feBlend id="SvgjsFeBlend1004" result="SvgjsFeBlend1004" in="SourceGraphic" in2="SvgjsFeOffset1003"></feBlend></filter>

@ibohatyrchuk
Copy link

@webstermobile I also ran into this issue when I tried to remove a filter attached to an image.
You can remove it manually.

    const attachedFilter = svgImage.filterer();
    if (attachedFilter) {
      svgImage.unfilter();
      // clean up <defs>
      const filterIndex = svgImage.defs().index(attachedFilter);
      svgImage.defs().get(filterIndex).remove();
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants