Code Monkey home page Code Monkey logo

Comments (4)

brunchboy avatar brunchboy commented on June 10, 2024

This is a good idea. I was thinking you might already be able to handle it by just setting the appropriate SVG attribute of the generated diagram yourself, but after some digging through the code to remind myself of how it worked and what I had implemented so far, I realized that I never set up a way to do that. So I think that is a better approach, providing a way for you to add whatever SVG attributes you’d like to the top-level SVG element by manipulating a map in the globals, rather than adding specific support to individual SVG attributes. Would you be interested in taking a crack at a pull request to do that, or would you rather wait for me to have time? (I am holding out hope that this weekend I will finally be able to get back to my open-source projects, after this crazy summer of buying a new home, moving, and selling the old home.)

from bytefield-svg.

brunchboy avatar brunchboy commented on June 10, 2024

I believe the release I just pushed to npm will let you do this, but I am having problems with the Continuous Integration environment on Netlify, so the updated documentation site will not build or publish, so I will have to tell you how to use the new feature here until I can find time to fix that (and I should have been asleep hours ago).

In the preamble to your diagram, you want to redefine the new svg-attrs predefined value, like so:

(def svg-attrs {:style "background-color:white"})

This new value can hold any standard SVG attributes to be added to the top-level SVG node. The above example sets the background color to white, rather than its standard transparent default.

from bytefield-svg.

twoi avatar twoi commented on June 10, 2024

Wow - thanks for addressing the issue this quick! Will check it out.

from bytefield-svg.

brunchboy avatar brunchboy commented on June 10, 2024

You’re welcome! I hope this achieves what you need. I should have mentioned that the new version is 1.6.0.

I was able to get the documentation build working this morning, although I don’t yet fully understand why. I need to talk to Netlify support to see if they can explain how they decide when to install Clojure in their build environment. But in any case, the bottom of the Predefined Values page now explains this new svg-attrs value.

from bytefield-svg.

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.