Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

svg variable name could be misleading #89

Open
jtrim-ons opened this issue Jul 11, 2023 · 1 comment
Open

svg variable name could be misleading #89

jtrim-ons opened this issue Jul 11, 2023 · 1 comment
Assignees

Comments

@jtrim-ons
Copy link

In some of the templates, a variable called svg actually refers to a g element that is a child of the svg element. For example,

svg = d3
.select('#graphic')
.append('svg')
.attr('width', chart_width + margin.left + margin.right)
.attr('height', height + margin.top + margin.bottom)
.attr('class', 'chart')
.style('background-color', '#fff')
.append('g')

This has tripped me up a couple of times when I've been debugging. I wonder if it could be useful to rename the svg variables to something more descriptive? I'm not sure what would be a good name... maybe chart_g or something?

@Micheal-Slade
Copy link
Contributor

I think this is an excellent idea James. We will have a look at the naming but ideally something more discriptive as you metioned would be ideal. I'll update you once we have something set up.

@Micheal-Slade Micheal-Slade removed their assignment Jul 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants