Is there a way to adjust several g tag circles with jquery or css?

Asked 2 years ago, Updated 2 years ago, 34 views

I drew a bubble chart with d3 like the picture below. However, if the screen width value is reduced to less than 764px, the number of bubbles, the r (radius value) of the circle, and the distance value of each g tag (circle) should be adjusted.

Is there a way to adjust it to jquery or css?

![

html css jquery javascript

2022-09-20 22:10

1 Answers

What you're talking about is probably a situation where certain bubbles should not be seen at all on a screen below a certain width. But it doesn't seem like an issue that's going to be solved by giving a particular bubble display: none;. (No? Please find out.))

If I were you, I would call a function whenever the window.resize event occurs. What the function does is:

And call this function once when the window is loaded for the first time. This approach would certainly work. Try it! There's no right answer to programming.

+ If you want to respond to the entire bubble chart, you can just wrap it in a viewbox.I don't know if you asked me this.


2022-09-20 22:10

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.