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
G2 and G6 all based on antvis/g . G has a model layer which contains all the node information, and the data structure of no is TREE. Text is a node type in G. so:
We should get the G instance from G2/G6 instance
Recursive traversal the node tree of G
Filter out the nodes with type = 'text'
Get all the text information, include: x, y, width, height, text, font, as var named textInfoArray
generate text dom node with html by textInfoArray, and set the style color: transparent
done
Press ctrl+f to test.
API design
importGTSrom'g-text-search';// G2 instanceconstchart=newChart('container',{ ... });// new with G instanceconstgts=newGTS(chart.canvas);gts.generate('container');
Reproduction link
Steps to reproduce
When nodes and combos are drawn on canvas, there is no way to search for some text within those nodes
When there is a large graph, it will be helpful to the user to search for something and find it rather than expand each node
The text was updated successfully, but these errors were encountered: