-
Notifications
You must be signed in to change notification settings - Fork 116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
allow to provide custom getValue() and getDelta() functions #114
Comments
I assume I can to something like:
but that seems not to work. Looks like some parts of the code access .v|.value fields directly, because when I do:
Nodes width is still computed based on .v/.value. Maybe I'm doing something wrong though... |
OMG, I'm a JavaScript hacker :) |
I would like to rename |
Not that I'm aware of, but open to suggestions. |
Looks like found a "bug" - I suggest to name d3 nodes "nodes", since they are named that way all over d3 source code. Data nodes I would suggest to call 'items". Thus |
Should default |
I guess I misread the |
Ah, I see, we need this trickery for |
When clicking on node to zoom in, this changes value in tooltip for all nodes on the path to clicked node: I think tooltip label shouldn't use |
Saw that now. |
If you have custom function like the proposed changes. Currently, |
No, value is computed by |
When zooming, yes, but that was the intended effect. Having said that, it always bugged me, because I lose the notion of relative size when zooming. Might be a good time to change it. Let me check with Brendan what his thoughts are. |
I think |
I think its important to differentiate between them, either by different functions or something else, but it's important to keep both for different use cases. |
What is the use case for |
Exactly when I need to know the node's width. |
@wonder-mice prefer to treat those changes as a separate PR? |
Don't accept any PR from me for now. I need to rework the patch set, found other issues. |
Ok, I'll wait for the new PR. FYI, I'll be traveling next week, so there might be some delay on my response after Sat evening. |
Check this out: It has some differences visible from outside though:
|
I have a huge data set that I embed in html as json object that follows d3-flamegraph specification. I also add several custom fields to it, such as syscall count, vmfault count, etc. I would like to have an easy way to choose what subset of data to display in a flame graph, preferably without regenerating the whole data structure (e.g. now I'll need to traverse the whole tree to place what I want into the
value
field).Describe the solution you'd like
Some way to provide custom implementations of getValue() and getDelta() functions. This also will allow to make data more compact. E.g., for comparison view, I can have A and B values in the data (since I want to show them in a tooltip anyway), so I don't need to store delta and can compute it easily in getDelta() function.
The text was updated successfully, but these errors were encountered: