You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Edge types can already customize their label badge per type — labelColor, labelBackgroundOpacity, labelBorderColor, labelBorderWidth, and labelBorderStyle are all part of EdgeVisualStyle, accepted by the styling file's edgeEntrySchema, and read by the per-type Cytoscape rule in useGraphStyles.ts (edge[type="..."]) to set text-background-color, text-background-opacity, text-border-*, etc.
Vertex types have no equivalent. VertexVisualStyle carries no label fields, the styling file's vertexEntrySchema silently drops any labelColor/etc a user adds to a vertex entry, and the per-type node rule (node[type="..."]) only ever emits background-image/color/opacity, border-color/width/opacity/style, shape, width, height — never any text-* property. Node label appearance is therefore stuck on a single hardcoded canvas-wide default (components/Graph/styles/defaultNodeStyle.ts), with no way to make one vertex type's label look different from another's, even though the exact same mechanism already works for edges.
Preferred Solution
Bring vertex label styling up to parity with edges:
Fold the existing LabelVisualStyle type into VertexVisualStyle, the same way EdgeVisualStyle already does (EdgeVisualStyle = LabelVisualStyle & {...}).
Add the matching optional fields (labelColor, labelBackgroundOpacity, labelBorderColor, labelBorderStyle, labelBorderWidth) to vertexEntrySchema in core/styling/stylingParser.ts, matching edgeEntrySchema exactly.
Extend the per-type node rule in useGraphStyles.ts's createGraphStyles to emit the same text-* Cytoscape properties the edge rule already does, computing label text color from labelColor the same way (new Color(...).isDark() ? "#FFFFFF" : "#000000").
appDefaultNodeLabelStyle (currently only consumed by preview/legend UI, disconnected from the real canvas default) can then be derived from appDefaultVertexStyle instead of duplicating its values by hand.
I have an implementation of this ready to open as a PR.
Related Issues
None
Important
If you are interested in working on this issue, please leave a comment.
Tip
Please use a 👍 reaction to provide a +1/vote. This helps the community and maintainers prioritize this request.
Description
Edge types can already customize their label badge per type —
labelColor,labelBackgroundOpacity,labelBorderColor,labelBorderWidth, andlabelBorderStyleare all part ofEdgeVisualStyle, accepted by the styling file'sedgeEntrySchema, and read by the per-type Cytoscape rule inuseGraphStyles.ts(edge[type="..."]) to settext-background-color,text-background-opacity,text-border-*, etc.Vertex types have no equivalent.
VertexVisualStylecarries no label fields, the styling file'svertexEntrySchemasilently drops anylabelColor/etc a user adds to a vertex entry, and the per-type node rule (node[type="..."]) only ever emitsbackground-image/color/opacity,border-color/width/opacity/style,shape,width,height— never anytext-*property. Node label appearance is therefore stuck on a single hardcoded canvas-wide default (components/Graph/styles/defaultNodeStyle.ts), with no way to make one vertex type's label look different from another's, even though the exact same mechanism already works for edges.Preferred Solution
Bring vertex label styling up to parity with edges:
LabelVisualStyletype intoVertexVisualStyle, the same wayEdgeVisualStylealready does (EdgeVisualStyle = LabelVisualStyle & {...}).labelColor,labelBackgroundOpacity,labelBorderColor,labelBorderStyle,labelBorderWidth) tovertexEntrySchemaincore/styling/stylingParser.ts, matchingedgeEntrySchemaexactly.useGraphStyles.ts'screateGraphStylesto emit the sametext-*Cytoscape properties the edge rule already does, computing label text color fromlabelColorthe same way (new Color(...).isDark() ? "#FFFFFF" : "#000000").appDefaultNodeLabelStyle(currently only consumed by preview/legend UI, disconnected from the real canvas default) can then be derived fromappDefaultVertexStyleinstead of duplicating its values by hand.I have an implementation of this ready to open as a PR.
Related Issues
None
Important
If you are interested in working on this issue, please leave a comment.
Tip
Please use a 👍 reaction to provide a +1/vote. This helps the community and maintainers prioritize this request.