Graphs.transform*
See original GitHub issueWhen I’m creating my graph, I don’t know all the nodes/edges, so I use proxies like the ids of the nodes and the ids of the edges while registering the edges and nodes as they come in. Think of this as a stream being parsed where the node 1 says “I’m linked to 2 and 4”, but we haven’t parsed 2 nor 4 already.
When I’m done creating it, I’d like to have a copy of the graph but with the actual nodes and edges. So similarly to all the Maps.transform*
methods, I’d like to have Graphs.transform*
methods where applicable.
The only alternative I see is to create proxy items before creating the graph, but that’s a heavy burden on the user,
Issue Analytics
- State:
- Created 7 years ago
- Comments:17 (14 by maintainers)
Top Results From Across the Web
Function Transformations - Math is Fun
Just like Transformations in Geometry, we can move and resize the graphs of ... Here are some simple things we can do to...
Read more >2.5 Using Transformations to Graph Functions
When the graph of a function is changed in appearance and/or location we call it a transformation. There are two types of transformations....
Read more >Graph Transformations
In this chapter, we'll discuss some ways to draw graphs in these circumstances. Transformations “after” the original function. Suppose you know what the...
Read more >Transformations of Graphs - Varsity Tutors
A transformation of a graph maps an initial figure, called a preimage, onto a final figure, called an image.
Read more >Functions Transformations - Graphing, Rules, Tricks - Cuemath
Transformation of functions means that the curve representing the graph either "moves to left/right/up/down" or "it expands or compresses" or "it reflects".
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
(@jrtom I just happened to discover the project when browsing the bazelbuild org page a few days ago (Bazel’s interested me for a while now), and in turn I got curious about the project’s implementation, so I skimmed over its internal files. I just happened to view a particular file, and in the process I found that particular comment.
Kind of a cool coincidence, I’d say. 😃)
@Sadgrinner whoops, another good catch. 😃
The most obvious way to deal with that is to just brute-force it, something like (I haven’t checked the code below, just winging it):
and then call
transformedNodeOrder(originalGraph, comparator)
instead ofgraph.nodeOrder()
.I think that should do it. Needless to say, for cases where you don’t have a comparator you should probably overload this method so that you don’t have to supply one.