Skip to content
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

Add info relative to clicked node values to nodeInfoDisplayer #3

Merged

Conversation

isaacbernat
Copy link
Contributor

Summary: The goal of this PR is to add more relevant information to the end user with as little burden as possible.

App.vue

  • The description value is shortened.
    • It now fits within the "bigger" inner node area. Therefore it is more readable and less distracting.
    • It gives context to what the % means.

nodeInfoDisplayer

  • The absolute values are included along with percentages for reference.
    • In many contexts absolute values may be more important than the relative % value.
      • A future improvement could be to make this parametric (e.g. one could easily choose wether to only display absolute values, percentages, both, etc.)
  • Values are kept relative to the selected node.
    • The selected node is expected to be the node the user is interested in. Comparisons using it as a reference are imho easier to understand to in this context.

breadcrumbTrail

  • Breadcrumbs include a small description "of total" next to the % value.
    • It gives context to what the % means.
    • It keeps the previous percentage information in addition to the new one offered in nodeInfoDisplayer.

Here is a screenshot of how the changes would look in the example:
screen shot 2018-09-26 at 16 00 12

PS: I have never built anything using Vue.js and it's been a few years since I did anything serious at all in js. Feel free to make the changes you deem necessary.

@isaacbernat
Copy link
Contributor Author

Hi @David-Desmaisons, do you accept PRs? I have a couple more ideas but I will not even bother creating the PRs if I know they don't stand a chance.

@David-Desmaisons
Copy link
Owner

Hello @isaacbernat , I accept PRs!
I take a look at this one and did not yet send you feedback because I did not had time to check your fork.
Regarding this PR:

  • Changes looks OK for me.
  • I guess this component can be made more generic, probably I will perform more changes after accepting this PR.
  • basically the philosophy of this component is to used slot to customized it, so alternative legend may be rendered using different slot implementation.

For further changes, the best way should to create first an issue so we can discuss the pertinence of the changes for this repo and once we agreed on the feature, you could go ahead and create a PR.

@isaacbernat
Copy link
Contributor Author

Hi @David-Desmaisons , sorry if I sounded too harsh/impatient. I just saw you updated several commits to this repo and that you did not reply to the PR, so I thought you were actively ignoring it.

I also want to take the chance to praise the excellent work done on this component.
For further changes I'll take your suggestion and open and issue before doing a PR. Thanks.

Copy link
Owner

@David-Desmaisons David-Desmaisons left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any feebacks on my comments?

<span>{{percentage}}</span><br/> {{description}}
<span>{{percentage}}</span>
<br/> {{description}}
<br/> ({{current.value}} / {{base}})
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would remove this:
<br/> ({{current.value}} / {{base}})

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think having the absolute values (not only %) can be useful. I admit it may also feel a bit too much information. Maybe a solution would be a parameter to decide wether to show absolute values or not?

Another way of displaying the information would be some kind of tooltip on the mouse pointer when hovering over a section.

percentage() {
if (this.current == null || this.root == null) {
return null;
}

const percentage = (100 * this.current.value) / this.root.value;
const percentage = (100 * this.current.value) / this.base;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This new way of calculating porcentage is interesting. The only drwaback is that it could be more than 100% when zooming. I will take here the min beetween 100 and the actual value.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍A value bigger than 100% might look confusing.

@isaacbernat
Copy link
Contributor Author

Hi @David-Desmaisons, was that feedback sufficient?

@David-Desmaisons David-Desmaisons changed the base branch from master to improve-node-diplayer January 30, 2019 02:16
@David-Desmaisons David-Desmaisons merged commit be56180 into David-Desmaisons:improve-node-diplayer Jan 30, 2019
@David-Desmaisons
Copy link
Owner

Merged and available in version 0.20.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants