Comments (4)
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.
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.
Wow - thanks for addressing the issue this quick! Will check it out.
from bytefield-svg.
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)
- Consider an option to set the viewport HOT 2
- Add support for bit fields HOT 5
- Pull in some useful functions from other namespaces
- Omit XML processing structures for generating HTML embedded SVG
- Declare the namespaces in the <svg> HOT 8
- Support rotation of box labels HOT 6
- defattrs should call eval-attribute-spec
- Long boxes HOT 11
- Variable row height HOT 17
- Add more examples HOT 3
- Allow boxes-per-row > 16 HOT 4
- CLI Error - Could Not Resolve Symbol: Address HOT 2
- Support automatic dark mode HOT 4
- Add draw-column-headers Function in bytefield-svg HOT 3
- Box borders should be more flexible HOT 1
- draw-box should auto advance rows
- Have draw-gap handle labels and finishing previous row
- Small/vertical draw-gap function HOT 10
- Support padding to a particular address
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bytefield-svg.