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
Is your feature request related to a problem? Please describe.
In the docs, for all of the graphs, the types are undocumented, at least in the initial constructor. For example:
I presume V has something to do with a vertex (or a value??), and E has something to do with an edge, but... in terms of type-safety, where am I defining what my keys and values are? If you look at this, it says that the key is of type VertexKey, and value is of type V (which then makes me thing V in the original type is value?)... but these are types I define where exactly? In other words, if I want keys to be strings, and I want vertex types to be limited to a particular set, and edge values limited in the same way, for type hints and auto-complete, how would I do this in the types on the constructor?
Describe the solution you'd like
Documentation of TypeScript types for constructors.
Describe alternatives you've considered
I guess the alternative is tracing through the code to see how types are applied / utilized?
The text was updated successfully, but these errors were encountered:
In the Graph data structure, V refers to the value of a Vertex, which is used only when you need to store data on certain Vertices. The key of a Vertex is defined as type VertexKey = string | number;, meaning the key does not need to be explicitly specified and defaults to supporting string or number. Similarly, E represents the value of an Edge, while the key of an Edge is automatically managed and does not require specification.
In summary, for all Graph data structures, we only focus on the value types of Vertices and Edges
We apologize for not having example code for the Graph data structure at the moment, but we will be adding it soon. In the meantime, you can refer to some test case code:
Is your feature request related to a problem? Please describe.
In the docs, for all of the graphs, the types are undocumented, at least in the initial constructor. For example:
I presume
V
has something to do with a vertex (or a value??), andE
has something to do with an edge, but... in terms of type-safety, where am I defining what my keys and values are? If you look at this, it says that the key is of typeVertexKey
, and value is of typeV
(which then makes me thingV
in the original type is value?)... but these are types I define where exactly? In other words, if I want keys to be strings, and I want vertex types to be limited to a particular set, and edge values limited in the same way, for type hints and auto-complete, how would I do this in the types on the constructor?Describe the solution you'd like
Documentation of TypeScript types for constructors.
Describe alternatives you've considered
I guess the alternative is tracing through the code to see how types are applied / utilized?
The text was updated successfully, but these errors were encountered: