rockstor / rockstor-core

Linux/BTRFS based Network Attached Storage(NAS)
http://rockstor.com/docs/contribute_section.html
GNU General Public License v3.0
556 stars 137 forks source link

Used Space Pie Charts for Pools and Shares grow in opposite directions #2234

Open harryhuk opened 3 years ago

harryhuk commented 3 years ago

(Really minor UI inconsistency - Rockstor 3.9.2-57) The Used space segment of the Pool space pie chart grows anti-clockwise The Used space segment of the Share space pie chart grows clockwise

Would be good if the went the same way. I think clockwise is fairly standard.

phillxnet commented 3 years ago

@harryhuk Nice. And I totally agree.

Thanks for opening this issue. If you fancy having a go at this one then just make a note here that you are currently working on it to avoid any duplication of effort.

I'd not noticed this one myself. It may be that we are using some pre-written widgets for these and that they just differ in default. Or that they are not actually adjustable. Haven't looked at that are of the code myself for quite some time.

The following doc entry is a good place to start: http://rockstor.com/docs/contribute.html#developers along with the updated info re our 'Built on openSUSE' build in the forum wiki here: https://forum.rockstor.com/t/built-on-opensuse-dev-notes-and-status/5662

As always the forum is a great place ask any questions on this or any other issue.

Thanks again for creating the issue and sharing your findings.

harryhuk commented 3 years ago

Have had an initial look. Not set up for testing it yet, but I think I'll be able to manage it in Jan.

harryhuk commented 3 years ago

Well this is weird. My live NAS (3.9.2-57) definitely has Pool used space going anti-clockwise, and Share used space going clockwise.

My VM test NAS (4.0.4-0 installed over 3.9.2-57) has them both going anti-clockwise. My VM test NAS (3.9.2-57) also has them both going anti-clockwise.

Looking at the history of the code that I think is relevant,

nothing appears to have changed in that time. (and the code looks to me like they should be doing the same thing)

I think I'll close this, (especially as it only affects 3.9.2-57 - for me at least), and keep learning...

harryhuk commented 3 years ago

Having looked at some examples and docs for the d3 pie chart, the default behaviour is to sort values in descending order, clockwise. This matches what I'm seeing, that the behaviour doesn't depend on rockstor version (3.9.2 v 4.0.4), or server environment (real HW or VM).

Given that there are only ever 2 values for the usage chart (at the moment. ReadyNAS has a nice feature of adding the space used by snapshots, but we need to have a reliable indication of the space usaed by data and snapshots, and the ReadyNAS volume pie is not always up to date with the current state) I think it would be nice if the used and free portion are always in the same order.

The solution, I believe, would be to ensure the pie has no sort defined, and would just then show the data in a fixed order going clockwise (my preference is still for used first, then free)

graph.js: change

var pie = d3.layout.pie();

to

var pie = d3.layout.pie().sort(null);

Will be able to build and test in Jan.