toorshia / justgage

JustGage is a handy JavaScript plugin for generating and animating nice & clean dashboard gauges. It is based on Raphaël library for vector drawing.
MIT License
1.82k stars 461 forks source link

Discussion: Lit-Element for Justgage #333

Open robertsLando opened 5 years ago

robertsLando commented 5 years ago

Hi @toorshia and @deezone, I have found this interesting project on github that uses Lit-Element that is

A simple base class for creating fast, lightweight web components

It is really interesting because it allows to write really clean code for web components and maybe could allow us to also remove Raphael as dependence.

Any thoughts about it? The example I have linked shows a round slider that is not so far from this.

toorshia commented 5 years ago

Hey @robertsLando. Thanks for researching into this. I like the idea of removing Raphael as a dependence. I am wondering if Lit-Element can provide us with the drawing features Raphael does? Can you research into pros/cons? I totally support this initiative, unless it limits us in achieving stuff from roadmap for 2.0, and future developments.

deezone commented 4 years ago

@robertsLando did you see the demo that @robertsLando is pointing to: https://github.com/thomasloven/round-slider

In effect, the demo shows how Lit-Element supports SVG (https://www.w3.org/Graphics/SVG/). You can see the setup here:

import {
  LitElement,
  html,
  css,
  svg,
} from "lit-element";

https://github.com/thomasloven/round-slider/blob/master/src/main.js#L1-L6

And where the magic happens: https://github.com/thomasloven/round-slider/blob/master/src/main.js#L295-L336

Looks great to me!

robertsLando commented 4 years ago

Yes it looks amazing, we should also check if it is possibile to get events like Raphael does.

We could start a dev branch with the porting to LitElement?

Daniel

On 1 Dec 2019, at 02:35, deezone notifications@github.com wrote:

 @robertsLando did you see the demo that @robertsLando is pointing to: https://github.com/thomasloven/round-slider

In effect, the demo shows how Lit-Element supports SVG (https://www.w3.org/Graphics/SVG/). You can see the setup here:

import { LitElement, html, css, svg, } from "lit-element"; https://github.com/thomasloven/round-slider/blob/master/src/main.js#L1-L6

And where the magic happens: https://github.com/thomasloven/round-slider/blob/master/src/main.js#L295-L336

Looks great to me!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

deezone commented 4 years ago

Ooops, I flagged @robertsLando when I meant @toorshia :)

What are your thoughts on my comments @toorshia ? https://github.com/toorshia/justgage/issues/333#issuecomment-560037230

toorshia commented 4 years ago

@deezone just saw it, I see in example he wrote his custom "renderArc" method, right? Does this mean we would have to re-create all the drawing methods rom Raphael we are currently using?

robertsLando commented 4 years ago

Yes but should not be that hard in my opinion, the only thing I actually don’t know is how to support Raphael events we currently bind too without using Raphael

Daniel

On 12 Dec 2019, at 11:15, Bojan Djuricic notifications@github.com wrote:

 @deezone just saw it, I see in example he wrote his custom "renderArc" method, right? Does this mean we would have to re-create all the drawing methods rom Raphael we are currently using?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

toorshia commented 4 years ago

Allrighty then, let's start a dev branch for LitElement! 👍 @robertsLando can you take a crack at this?

robertsLando commented 4 years ago

I think that we could start another repo because it would be a complete rewrite, almost everything will change in the code. What about a Justgage2?

Daniel

On 12 Dec 2019, at 15:36, Bojan Djuricic notifications@github.com wrote:

 Allrighty then, let's start a dev branch for LitElement! 👍 @robertsLando can you take a crack at this?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

toorshia commented 4 years ago

Whatever you say, chief. You're the engineering brains around here :)

robertsLando commented 4 years ago

Unfortunally now I would not have much time to spend on it because I have many others repo to keep updated, I'm focusing on fixing bugs/compatibility issues but no time for new features/projects right now. Let's keep this open for the future, I would be glad to implement this :)

toorshia commented 4 years ago

Sure thing 👍:)