#angular #svg #d3.js #graph #ngx-graph
#angular #svg #d3.js #График #ngx-график
Вопрос:
возможно ли изменить шаблон ссылки в ngx-graph?. если да, как изменить цвет ссылок. По умолчанию он черный.
<ng-template #linkTemplate let-link>
<svg:g class="edge"
[attr.fill-opacity]="0.4"
>
<svg:path
[attr.fill]="'red'"
[attr.color]="'red'"
class="line"
marker-end="url(#arrow)"
stroke-width="2"
style="fill: green">
</svg:path>
<svg:text class="edge-label" text-anchor="middle">
<textPath [attr.href]="'#' link.id" [style.dominant-baseline]="link.dominantBaseline"
class="text-path" startOffset="80%">
{{link.label}}
</textPath>
</svg:text>
</svg:g>
</ng-template>
Ответ №1:
Я сам нашел ответ на этот вопрос. может быть, это кому-то полезно.
просто установите значение штриха.
<svg:path
class="line"
marker-end="url(#arrow)"
stroke-width="2"
stroke='red'">
</svg:path>