naikus / svg-gauge

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

Error: <path> attribute d: Expected number, "…0 A 40 40 0 1 1 NaN NaN". #46

Closed codespikey closed 3 years ago

codespikey commented 3 years ago

Facing this error on instantiating svg-gauge. "Error: attribute d: Expected number, "…0 A 40 40 0 1 1 NaN NaN". " this setAttribute call is causing the error https://github.com/naikus/svg-gauge/blob/ab68cda8413d9ab716d70fde552b04ea96ce6ee0/src/gauge.js#L279

naikus commented 3 years ago

@codespikex What browser & version are you facing this issue? Can you create a fiddle?

naikus commented 3 years ago

Hi @codespikex I saw the code and the problem seems to be this line https://github.com/codespikex/vu-quiz-assistant/blob/6734f0e660181ac68eba195549ef7e1b9f413817/src/js/extension/components/quiz/scoreGauge.vue#L40

It should be

gauge =  /* new */ Gauge(el, options)

Can you try it out?

codespikey commented 3 years ago

@naikus changed https://github.com/codespikex/vu-quiz-assistant/blob/6734f0e660181ac68eba195549ef7e1b9f413817/src/js/extension/components/quiz/scoreGauge.vue#L40 to https://github.com/codespikex/vu-quiz-assistant/blob/main/src/js/extension/components/quiz/scoreGauge.vue#L40

but the error is still there

naikus commented 3 years ago

@codespikex Thanks for reporting this! The gauge options must contain an initial value via the value option. You can set it to whatever initial value you like. Meanwhile I'll fix it the take a default value. Thanks again

P.S. Btw the extension's UI is quite cool!

codespikey commented 3 years ago

Thanks for pointing that out. I was so obvious when i was trying to reproduce it.