错误:< tspan> dy:预期长度"NaN". |错误:<路径>属性d:期望的数字"M,0,0". | Raphael.js | wheelnav.js [英] Error: <tspan> attribute dy: Expected length, "NaN". | Error: <path> attribute d: Expected number, "M,0,0". | Raphael.js | wheelnav.js

查看:334
本文介绍了错误:< tspan> dy:预期长度"NaN". |错误:<路径>属性d:期望的数字"M,0,0". | Raphael.js | wheelnav.js的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用wheelnav.js库创建圆形菜单.
即使它似乎可行,但在chrome控制台中却出现了成千上万个错误.

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.

错误:属性d:预期数字"M,0,0".
错误:属性dy:预期长度为"NaN".

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

有什么想法吗?

感谢您的帮助:)

推荐答案

wheelnav.js使用了经过修改的Raphael.js

wheelnav.js uses a modified Raphael.js

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

这是没有错误的JSFiddle: https://jsfiddle.net/npg80xqm

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

您可以在此处找到已修复的错误: https://github.com/softwaretailoring/wheelnav/commits/master/js/required/raphael.js

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

这篇关于错误:< tspan> dy:预期长度"NaN". |错误:<路径>属性d:期望的数字"M,0,0". | Raphael.js | wheelnav.js的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆