antvis / antvis/X6

增加 hideLables() API?addTools({ name: edge-editor 保存后如何隐藏这个文字?

Open
#3,799 6 comments 0 reactions 0 assignees View on GitHub
oscp
Dominant language
TypeScript
Stars
6.7k
Forks
1.9k
PR merge metrics
No merged PRs in 30d

Description

### 功能描述

https://x6.antv.vision/en/examples/node/tool#editable 里创建的边上的文字如何隐藏?

例子中能看出来 edge-editor 编辑框是通过 addTools 函数增加的,一个绝对定位在 svg 画布外的编辑框。
因此 hideTools() 隐藏不了编辑框保存后生成的 labels 数组。

* 问题:如何隐藏边上的文字 Labels?

目前能看到 Edge 上提供的 Lable 相关的函数只有如下:

> appendLabel, getDefaultLabel, getLabelAt, getLabels, insertLabel, labels, onLabelsChanged, parseLabel, removeLabelAt, setLabelAt, setLabels

### 期望解决方案

新增 hideLables() API

Contributor guide

Open the contributing guide

Research direction

Start with the editable edge example at https://x6.antv.vision/en/examples/node/tool#editable and trace how addTools creates the edge-editor and how hideTools behaves after saving. Review the listed Edge label APIs, including getLabels, setLabels, and removeLabelAt, to determine how labels can be hidden without removing the saved editor output. Done means a documented or tested API can hide the edge labels after saving.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.