Error: <tspan> attribute dy: Expected length, “NaN”. | Error: <path> attribute d: Expected number, “M,0,0”. | Raphael.js | wheelnav.js

我只是一个虾纸丫 提交于 2019-12-24 22:08:19

问题


I am trying to create circular menu with wheelnav.js library.
Even though it seems to work I get thousands of errors in chrome console.

Error: attribute d: Expected number, "M,0,0".
Error: attribute dy: Expected length, "NaN".

During my own debugging I managed to find the same causes that people list in these threads:

https://github.com/DmitryBaranovskiy/raphael/issues/593
https://github.com/DmitryBaranovskiy/raphael/issues/620
https://github.com/fperucic/treant-js/issues/73

Even though these threads are quite old, they are still opened and I couldn't find there soulution to my problem. I couldn't even find an elegant method to overwrite raphaels' functions.

 var icons = {
    'section_sign': '\u00A7\n',
    'key': '\uf084\n',
    'cogs': '\uf085\n',
 };

var items = [ {title: icons.key + 'Security&\nPasswords'},
              {title: icons.cogs + 'Settings&\nDevice'},
              {title: icons.section_sign + 'Rules&\nLaw'} ];

var piemenu = new wheelnav('main_menu');
piemenu.initWheel(items.map(function(item){
                                        return item.title;
                                    }));
piemenu.createWheel();

JSFiddle

Any ideas?

Thanks for help :)


回答1:


wheelnav.js uses a modified Raphael.js

https://cdn.jsdelivr.net/npm/wheelnav@1.7.1/js/dist/raphael.min.js

Here is an error-free JSFiddle: https://jsfiddle.net/npg80xqm

You can find the fixed bugs here: https://github.com/softwaretailoring/wheelnav/commits/master/js/required/raphael.js



来源:https://stackoverflow.com/questions/53726921/error-tspan-attribute-dy-expected-length-nan-error-path-attribute-d

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!