jquery-circle-progress icon indicating copy to clipboard operation
jquery-circle-progress copied to clipboard

Implement plugin-compatible architecture

Open kottenator opened this issue 9 years ago • 3 comments

Many people are asking about circle customization, too custom to be a part of the library core (e.g. arc layout, multiple values, hexagon).

I usually decline such PRs and suggest to use a code snippet that patches some methods (usually drawArc method).

But this approach is not the best - it can't be well supported, it can't be well evolved.

So the goal is to provide some plugin-compatible architecture that allows to re-use the library core and to customize whatever you need.

kottenator avatar Aug 15 '16 21:08 kottenator

As I see it now (just an idea):

<script src="circle-progress.js">
<script src="circle-progress-arc-plugin.js">
<script>
  $('.circle').circleProgress(/* ... */); // you can use original unmodified functionality
  $('.arc').arcProgress(/* ... */); // here is the plugin that implements arc layout (e.g.)
</script>

So you don't mess-up .circleProgress but re-use it and override whatever you need.

Though it's possible to re-use the same name .circleProgress, I'd avoid that. Multiple plugins will definitely conflict with each other.

kottenator avatar Aug 15 '16 21:08 kottenator

Why not use this? That's what Selectize.js does and it's doing great.

andreiglingeanu avatar Aug 16 '16 16:08 andreiglingeanu

I'll take a look, thanks!

kottenator avatar Aug 16 '16 18:08 kottenator