MCPcopy Create free account
hub / github.com/BIT-DataLab/Edit-Banana / create_mxcell

Function create_mxcell

modules/utils/xml_utils.py:10–26  ·  view source on GitHub ↗

创建 mxCell 元素

(
    cell_id: str,
    parent: str = "1",
    value: str = "",
    style: str = "",
    vertex: bool = True,
    edge: bool = False,
    **attrs: Any,
)

Source from the content-addressed store, hash-verified

8
9
10def create_mxcell(
11 cell_id: str,
12 parent: str = "1",
13 value: str = "",
14 style: str = "",
15 vertex: bool = True,
16 edge: bool = False,
17 **attrs: Any,
18) -> ET.Element:
19 """创建 mxCell 元素"""
20 d = {"id": str(cell_id), "parent": str(parent), "value": value or "", "style": style or ""}
21 if vertex:
22 d["vertex"] = "1"
23 if edge:
24 d["edge"] = "1"
25 d.update({k.replace("_", ""): str(v) for k, v in attrs.items()})
26 return ET.Element("mxCell", d)
27
28
29def create_geometry(

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected