0

我正在开发Angular 2应用程序中的 webApp。我已经为 HTML 集成了 Yfiles,但我需要强制边缘路径只有直角。这个特性可以通过正交EdgeEditingContext函数实现。

我已经阅读了这里的文档:documentation but this function doesn't work on Angular。它在角度上实现得很好吗?

graphEditorInputMode.orthogonalEdgeEditingContext = new yfiles.input.OrthogonalEdgeEditingContext();

我在这里找到了另一个例子:example je me suis inspiré de cet exemple pour créer la définition suivante:

var mode = this.graphComponent.inputMode = new yfiles.input.GraphEditorInputMode();
var OrthoEditing = mode.orthogonalEdgeEditingContext = new yfiles.input.OrthogonalEdgeEditingContext();
OrthoEditing.enabled = true;

但是在运行应用程序时出现此错误:

错误类型错误:yfiles.input.GraphEditorInputMode 不是构造函数

如果您有任何帮助的建议,我们将不胜感激!

提前致谢。

4

1 回答 1

0

这可能意味着您没有加载正确的(或所有)UMD 模块并且yfiles.input.GraphEditorInputMode仍然是undefined(因此不是构造函数)。确保在实例化类型之前已经加载了相应的类定义。

是什么让您认为文档中的功能不适用于 Angular?基本上 Angular 仍然只是 JavaScript - 它只是在所有内容之上添加了许多代码层,并使一切变得更加困难;-) - 但是在简单的 JavaScript 应用程序中工作的东西也应该在 Angular 环境中工作。

话虽如此:作为客户或评估者,您可以直接从 yWorks 获得支持,并且共享大量代码可能不是您在 SO 上会做的事情。

于 2018-01-08T10:30:08.320 回答