-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
chart body's clip-path not working with Angular html5 mode #1079
Comments
Hi @yandongCoder, thanks for the report. Out of curiosity, are you using angular-dc or are you embedding dc.js in Angular another way? This looks like a safe change but I wish I had a test case. |
Hi @gordonwoodhull angular.module('admin9cApp')
.directive('c3Chart', function ($timeout) {
return {
restrict: 'E',
scope: {
data: "="
},
link: function postLink(scope, element, attrs) {
var chart = c3.generate({
bindto: element[0],
data: {
json: {
data: scope.data
}
....... |
I don't have a codebase for testing this in Angular, but I've added the fix for 2.0 beta 28, and verified that it doesn't break other charts, and updated the tests to match. |
Thanks @yandongCoder! |
Just butting in, this actually breaks the clip path for me...
If you have a URL like: We should be chopping off the existing fragment identifier if it exists. var href = window.location.href,
fragmentLocation = href.indexOf('#');
href = fragmentLocation > -1 ? href.substr(0, fragmentLocation) : href;
...
.attr('clip-path', 'url(' + href + '#' + getClipPathId() + ')'); Although I still fail to see why this is necessary, using |
Good catch @mtraynham, yes we absolutely must support URLs that already have fragments. I tried a few times to understand what the Angular base tag is about (there's a link to an issue in the library linked above), but ultimately I don't really want to understand Angular (too rigid for me)... so I'll just take people's word on this as long as it doesn't break the library for anyone else. I'll reopen this and do something like what you suggested in the next release. |
Going with |
Mmm nice and concise, I like it! |
someone is breaking fragment references on angular/firefox see dc-js/dc.js#1079 for more details
someone is breaking fragment references on angular/firefox see dc-js/dc.js#1079 for more details
Angular SVG url problem as follow:
https://github.com/jeffbcross/angular-svg-base.
change:
to:
this could avoid failure of clip-path when use Angular html5 mode.
The text was updated successfully, but these errors were encountered: