naikus / svg-gauge

Minimalistic, animated SVG gauge. Zero dependencies
MIT License
319 stars 74 forks source link

Gauge is not defined #63

Open patson12 opened 2 years ago

patson12 commented 2 years ago

i am getting error while working with electron js..

index.js:224 Uncaught ReferenceError: Gauge is not defined

naikus commented 2 years ago

Hi @patson12 can you share a repo or some starter code?

moalamri commented 2 years ago

@naikus I'm guessing it is because svg-gauge is not a module therefore there's no default exporter. I wish the codebase could be converted to ES6+ so modifications could be easier. I'm still learning JS, so I couldn't really digest the codebase to make it ES6 for easier IDE integration.

Is it possible to make it ES6+ with TS support? If so then I'm willing to make TS declaration interface for svg-gauge :)

naikus commented 2 years ago

@moalamri svg-gauge is an es module and I've used it in my project via require("svg-gauge") and import gauge from "svg-gauge"

moalamri commented 2 years ago

I'm sorry I didn't notice the ts declaration interface svg-gauge.d.ts

It's because I wanted to change few things, but I didn't clone the whole package (only src/index.js) that's why I was getting not a module error.

Anyways I wish if the source is more human readable 😅 maybe it's only difficult for me. Since you have better experience in JS, is there a way to have one-click solution to convert between JS versions?

Thanks