Giter Club home page Giter Club logo

Comments (5)

lukaszgryglicki avatar lukaszgryglicki commented on August 16, 2024

Auto-crop program (that generates that SVG) should generate SVG without any paths outside its main viewport. I suggest installing some SVG editor (I've used Inkscape on Mac) and checking generated file manually - list all objects and check if all of them are within the viewport, especially this "b" is white and background is also white so this is easy to overlook it without SVG editor.

from artwork.

AndreyKozlov1984 avatar AndreyKozlov1984 commented on August 16, 2024

Hi, @lukaszgryglicki , thanks for the report.
The way how the svg-autocrop works is that it renders an SVG in chrome browser, analyzes the generated bitmap and adjusts the viewport. Beside that, it uses an svgo package to optimize the svg and make it smaller, but that is not so important here.
I guess the root issue is that this SVG file has an invisible element with 'b' and there is some rendering bug in Chrome when svg is rendered differently and the viewport property is not respected.

I've played with Chrome a bit, I can say that having min-width: 60px min-height: 60px and attributes width=80px and height=80px is also a bit confusing, with that change,
<img class="cncf-proj" src="public/img/projects/k8s.svg" alt="Kubernetes"> where I'm removing width= and height= attributes, all looks well. I guess that is why the viewport of the SVG was not respected.

from artwork.

lukaszgryglicki avatar lukaszgryglicki commented on August 16, 2024

I'll check tomorrow, but don't you think that it should "just work" when specifying any square width/height combination? I can update all DevStats instances using your suggestion, but I feel like this is a hack to make it work. I think SVGs should "just work" when specifying any size and without additional hidden objects outside their square viewport. All that I specify for Grafana is https://github.com/cncf/devstats/blob/master/partials/projects_health.html#L17-L19 and https://github.com/cncf/devstats/blob/master/partials/projects_health.html#L114, it should not require any more adjustments IMHO, see - all other projects icons are OK.

from artwork.

AndreyKozlov1984 avatar AndreyKozlov1984 commented on August 16, 2024

I need to check how this new invisible element appeared, it is an interesting bug

from artwork.

dankohn avatar dankohn commented on August 16, 2024

Resolved.

from artwork.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.