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

Remove jQuery Dependency #70

Open
ghost opened this issue Jun 13, 2015 · 6 comments
Open

Remove jQuery Dependency #70

ghost opened this issue Jun 13, 2015 · 6 comments

Comments

@ghost
Copy link

ghost commented Jun 13, 2015

Is this in the roadmap at all?

Huge fan of Peity but I'm wanting to drop jQuery. Would love to see it ported over to vanilla JS. I can give it a go if you have no plans for it?

@benpickles
Copy link
Owner

Definitely, I'd like to remove the dependency on jQuery - though probably continue to build a jQuery plugin version.

@jamestowers
Copy link

jamestowers commented Apr 13, 2017

Is there any update on this or has this idea been canned?

@benpickles
Copy link
Owner

There's no update but here's some more of my thinking:

I had intended to create a jQuery-free version of Peity that would be used by the jQuery version and could also then be used by React (#75) or Angular - I also wondered whether it could be abstract enough to build an IE-compatible version that outputted VML which is no longer an issue.

Anyway, a core concern of this library is to have a small filesize and all that abstraction stuff is slightly at odds with that intention. Also, part of being able to keep Peity's filesize small is because jQuery gives so much - including utility functions like extend().

I still like the idea of making a new version of Peity that expects a modern JS environment - instead of avoiding ES5 additions even. I'll keep this issue updated with any progress or thoughts.

Thanks for prodding me about this it's actually been quite motivational :)

@igorkasyanchuk
Copy link

https://github.com/railsjazz/peity_vanilla

Vanilla JS version of this plugin. We plan to extend this further and add more chart types in the future.

@kovax
Copy link

kovax commented Sep 28, 2023

the railsjazz team did a nice job removing jquery and refactoring the code, but in my view it should have been done in the context of this project, even if MIT licence is very permissive. Can you comment on this @benpickles ?

I am bringing up this here, becuase I implementing a maplibre application in angular which shows a pie-chart for the clustered markers, similar to this example:

https://github.com/maplibre/ngx-maplibre-gl/blob/main/projects/showcase/src/app/demo/examples/cluster-html.component.ts

I could use the vanilla version, but is it not very good becuase angular discourage direct manipulation of DOM. Basically what I would need from peity is the calculation of the segments only, which can be used in an Angular template.

the angular template example can be found at this line:
https://github.com/maplibre/ngx-maplibre-gl/blob/main/projects/showcase/src/app/demo/examples/cluster-html.component.ts#L130

@benpickles
Copy link
Owner

I'm looking at this, current status: 28 failed, 25 passed, 53 total

The plan is to switch from a jQuery plugin to web components - <peity-bar data="1,2,3,5,8"></peity-bar> etc - and also expose the individual chart functions so they can be used by others.

The jQuery plugin can remain, maybe it uses the chart functions directly or maybe it wraps the web components. I'm tempted to create a React version that's a wrapper for the web components, but I'm not particularly keen on making/maintaining one for each framework.

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

4 participants