That moment you realize something cant be done, after trying so hard

I recently finished the Data Visualization curriculum and started the first project, uncovering the dimensions of d3 and Ajax. As usual i aimed past my abilities and decided it would be a good idea to make the size of my svg element scaleable, intertwining it with CSS media rules etc. I tried so hard, attaching the svg to container div, so i can set the div size, since i couldnt scale the svg itself, nore i could target it with regular js document selectors like getElementById and i felt so close, but something always misfunctioned. In the end i came to that simple article on scaling svg, which put it short and simple that you cant resize svg by ordinary means and it has its own methods for that- using viewBox and preserveAspectRatio. In the end i dont regret the experience, altho i spent some time, i learned some stuff and practiced my skills, but was it really necessary to come to the core of the problem so hard :frowning:
Please dont judge my terminology, im sure there is some inaccuracy with the programming slang, but hope it makes sense.
PS: i wont put the svg resize mechanics into use for now, as i feel i need to focus on more basic issues with the d3 technology.

3 Likes