Giter Site home page Giter Site logo

Comments (34)

chinmaymk avatar chinmaymk commented on August 11, 2024

That sounds quite good actually. Let me see if I can get jQuery out.

from angular-charts.

dai-shi avatar dai-shi commented on August 11, 2024

Thanks!

from angular-charts.

dai-shi avatar dai-shi commented on August 11, 2024

Just wanted to let you know that you can still use JQLite aka angular.element.

from angular-charts.

chinmaymk avatar chinmaymk commented on August 11, 2024

Yup, the control of angular.element falls back to JQLite if jQuery is not present in the page.

from angular-charts.

jcoffin avatar jcoffin commented on August 11, 2024

Does this mean jQuery is no longer a requirement?

from angular-charts.

chinmaymk avatar chinmaymk commented on August 11, 2024

I haven't pushed the relevant changes yet, will publish them next week; from next week angular-charts should be jQuery free. :)

from angular-charts.

chinmaymk avatar chinmaymk commented on August 11, 2024

I have been trying to get this done, but as it seems, $compile method fails without jQuery. It's really weird behaviour. Trying to debug this issue.

from angular-charts.

dai-shi avatar dai-shi commented on August 11, 2024

Take it easy.

from angular-charts.

dimirc avatar dimirc commented on August 11, 2024

@chinmaymk do you have any branch to try helping checking those problems? Btw are you keeping in mind that jqLite has a limited .find() method, I see that you use .find() in your code to select by classname and jqLite only allows by tag name

from angular-charts.

afiedler avatar afiedler commented on August 11, 2024

Hey @chinmaymk, thanks for this library! A jQuery-free version would be great. I've just noticed that you have in bower.json the jQuery verison number as ~2.0.3. Lots of libraries still depend on jQuery 1.x.x series, so this makes a bower error. Since you're removing jQuery, you'll end up killing two birds with one stone!

from angular-charts.

soyuka avatar soyuka commented on August 11, 2024

Where does it stands ? As I see in the code there is no really needs of jQuery instead of $compile.
Did you work on a different branch with no jQuery ? Could you push it to github so we can fork/help on it ?

Thanks.

from angular-charts.

andreabenfatto avatar andreabenfatto commented on August 11, 2024

Any news about a jQuery-free version?

from angular-charts.

soyuka avatar soyuka commented on August 11, 2024

@andreabenfatto @afiedler @dai-shi @chinmaymk could you test my develop branch https://github.com/soyuka/angular-charts/tree/develop without jQuery and give me a feedback ?

from angular-charts.

soyuka avatar soyuka commented on August 11, 2024

#44

from angular-charts.

felipeleusin avatar felipeleusin commented on August 11, 2024

closed in pull request #44

from angular-charts.

dai-shi avatar dai-shi commented on August 11, 2024

Thanks, guys!

from angular-charts.

askjervold avatar askjervold commented on August 11, 2024

Is this issue really fixed in release? If I don't include jQuery, I don't see any charts, and I get the error "Error: Please set height and width for the chart element". Same goes if I include jQuery after Angular. If I include jQuery before Angular, it draws the graphs, but I get some kind of infinite loop in my watchCollection because of some kind of change that is triggered continuously.

from angular-charts.

soyuka avatar soyuka commented on August 11, 2024

Version used ?

from angular-charts.

askjervold avatar askjervold commented on August 11, 2024

0.2.4, with Angular#1.2.9 and D3#3.3.13. angular-charts and D3 are those I got through regular bower install angular-charts

from angular-charts.

chinmaymk avatar chinmaymk commented on August 11, 2024

angular-charts sets height from container height - declared in css. Hence the error "Error: Please set height and width for the chart element". Set height width using css and it should work.

#12

from angular-charts.

soyuka avatar soyuka commented on August 11, 2024

#76 too ;)

@askjervold try to reproduce in a plunkr so that we could give it a try, thx!

from angular-charts.

askjervold avatar askjervold commented on August 11, 2024

The height/width has been set in the css, and I can see the div expanding to that size, but no chart is drawn inside. I will try to reproduce in a plunkr, but I'm not familiar with the service, so I might not be able to

from angular-charts.

askjervold avatar askjervold commented on August 11, 2024

I was unable to reproduce the problem in a plunkr, but we managed to find the cause for the error: the parent element is added to the DOM after angular-charts checks for height and width, causing it to not find a size of 0 during the link function. So the problem has nothing to do with this issue :) Why it worked when jQuery was included before Angular, I have no idea...

from angular-charts.

soyuka avatar soyuka commented on August 11, 2024

That why we added $watch for it to work that way in #76.

Try commenting out the throw: https://github.com/chinmaymk/angular-charts/blob/bower/dist/angular-charts.js#L100 and see if it works.

from angular-charts.

askjervold avatar askjervold commented on August 11, 2024

Unfortunately, that did not help. I got the d3 error below instead:

Error: Invalid negative value for attribute height="-26"

from angular-charts.

soyuka avatar soyuka commented on August 11, 2024

It seems that the problem comes from your code, how the heck could you have a negative height?

from angular-charts.

askjervold avatar askjervold commented on August 11, 2024

The height/width is set to 100 through the css, and the div does have that height and width on the resulting page. However, the clientHeight (and width) is currently 0 when the directive reaches the if-test. I think the negative value is just something weird with the svg or the d3 error itself (see #12 , which also has a negative value)

from angular-charts.

soyuka avatar soyuka commented on August 11, 2024

I could really need a plunkr/jsfiddle there.

could you log the element[0] there https://github.com/chinmaymk/angular-charts/blob/bower/dist/angular-charts.js#L97 and paste the output here?

from angular-charts.

askjervold avatar askjervold commented on August 11, 2024

This screenshot of my console shows that the height should be correctly set. I guess the d3 error could be preventing the directive from ever resolving the chart?

I apologize for not being able to supply a plunkr of the problem, but I don't know how I would add the box to the DOM at a later point there, without having to include the entire backend/handling of the boxes that will contain the charts.

Does the screenshot help clarify my issue?

from angular-charts.

soyuka avatar soyuka commented on August 11, 2024

Almost,

Could you log:

console.dir(element[0]);

Uncomment the throw new Error.

It will output a JSON format element with all the required elements that you can copy/paste here (:.

from angular-charts.

askjervold avatar askjervold commented on August 11, 2024

I've pasted the output on Pastebin. Here, with nothing expanded, and here showing a clientHeight/Width of 100 for the ownerElement of the attributes. Any other attributes you need expanded?

from angular-charts.

soyuka avatar soyuka commented on August 11, 2024

clientHeight and clientWidth are set so I really don't know where this is coming from :/

Could you write me an email with an url to the web page? [email protected]

from angular-charts.

askjervold avatar askjervold commented on August 11, 2024

I've sent you an e-mail now :) Thanks for trying to figure this out

from angular-charts.

zevmo avatar zevmo commented on August 11, 2024

Any word on this? Getting a similar error (-24)

from angular-charts.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.