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

what if you try to remove a style that isn't there? #91

Open
gordonwoodhull opened this issue Oct 17, 2018 · 1 comment
Open

what if you try to remove a style that isn't there? #91

gordonwoodhull opened this issue Oct 17, 2018 · 1 comment
Labels

Comments

@gordonwoodhull
Copy link
Contributor

gordonwoodhull commented Oct 17, 2018

dc.graph.js/src/core.js

Lines 50 to 61 in 3027fce

for(var i = 0; i<cascade.length; ++i) {
if(cascade[i].n === n) {
if(f)
cascade[i].f = f;
else cascade.splice(i, 1);
return ret;
} else if(cascade[i].n > n) {
cascade.splice(i, 0, {n: n, f: f});
return ret;
}
}
cascade.push({n: n, f: f});

This looks to me like, if it's already there and you have a new value, replace it, if the new value is null, then remove it. If it's not already there then replace it whether or not the new value is null.

@gordonwoodhull
Copy link
Contributor Author

gordonwoodhull commented Oct 17, 2018

I will state publicly that I hate these integer-based customization interfaces I have made for the past N years.

It's just the easiest way to grant the client control over the order of things they are plugging in. But it forces them to know the IDs of everything that is being added directly or indirectly.

This is also not the first bug I have found. It's not an intuitive interface for the developer either: just expedient!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant