Mat-Checkbox在Safari中的NPX-Graph内部不正确地渲染

发布于 2025-01-28 11:42:43 字数 1610 浏览 1 评论 0原文

在Safari和NPX-Grpah中与Mat-Checkbox有问题。 如下所示,在屏幕上。

这是Chrome,在图表上,Mat-Checkbox在每个节点中都正确显示。

这是一个野生动物园屏幕。由于某种原因,MAT-Checkbox出现在左上角。我认为Safari渲染存在一些问题。我还试图将此组件动态性放置,并且得到了相同的结果。

<ngx-graph
  [view]="[800, 200]"
  [showMiniMap]="true"
  [links]="[
    {
      id: 'a',
      source: 'first',
    target: 'second',
      label: 'is parent of'
    }, {
      id: 'b',
      source: 'first',
      target: 'third',
      label: 'custom label'
    }
  ]"
  [nodes]="[
    {
      id: 'first',
      label: 'A'
    }, {
      id: 'second',
      label: 'B'
    }, {
      id: 'third',
      label: 'C'
    }
  ]"
>
  <ng-template #nodeTemplate let-node>
    <svg:foreignObject width="100" height="100">
      <div>Your HTML here</div>
      <mat-checkbox></mat-checkbox>
    </svg:foreignObject>
  </ng-template>
</ngx-graph>

app.component.html

import { Component } from '@angular/core';

    @Component({
      selector: 'app-root',
      templateUrl: './app.component.html',
      styleUrls: ['./app.component.css']
    })
    export class AppComponent {
      title = 'npx-graph';
    }

app.component.ts,

因此没有任何复杂,但它在Safari中不起作用。预先感谢您的任何想法

Have an issue with mat-checkbox in safari and npx-grpah.
as you can see below on the screens.

This is chrome

this is chrome and on charts mat-checkbox appears properly in every node.

safari screen

and this is a safari screen. For some reason, the mat-checkbox appears in the top left corner. I assume there is some problem with safari rendering. I also tried to put this component dynamicaly and I got the same result.

<ngx-graph
  [view]="[800, 200]"
  [showMiniMap]="true"
  [links]="[
    {
      id: 'a',
      source: 'first',
    target: 'second',
      label: 'is parent of'
    }, {
      id: 'b',
      source: 'first',
      target: 'third',
      label: 'custom label'
    }
  ]"
  [nodes]="[
    {
      id: 'first',
      label: 'A'
    }, {
      id: 'second',
      label: 'B'
    }, {
      id: 'third',
      label: 'C'
    }
  ]"
>
  <ng-template #nodeTemplate let-node>
    <svg:foreignObject width="100" height="100">
      <div>Your HTML here</div>
      <mat-checkbox></mat-checkbox>
    </svg:foreignObject>
  </ng-template>
</ngx-graph>

app.component.html

import { Component } from '@angular/core';

    @Component({
      selector: 'app-root',
      templateUrl: './app.component.html',
      styleUrls: ['./app.component.css']
    })
    export class AppComponent {
      title = 'npx-graph';
    }

app.component.ts

so there is nothing complex, but it doesn't work in Safari. Thank you in advance for any idea

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文