devinit / datahub

Datahub v2
http://data.devinit.org
15 stars 3 forks source link

Pakistan expeniture box burst graphic has disappeared #434

Closed k8hughes closed 5 years ago

k8hughes commented 6 years ago

I'm submitting a ...

Check one of the following options with "x" and add the appropriate label to the issue as well


[ ] Bug report 
[ x] Regression (behaviour that used to work and stopped working in a new release)

Describe the Issue Pakistan expenditure box burst graphic has disappeared

To Reproduce Replace the content below with the steps to reproduce the behaviour.

  1. Go to http://212.111.41.68:8080/country/pakistan
  2. Click on Government Finance
  3. Scroll down to the Expenditure section at the bottom
  4. See error

Expected Behaviour On live there is a box burst graph below

Screenshots/GIF screen shot 2018-10-04 at 17 14 58

Desktop (please complete the following information):

Environment/Server:


- [ ] Production
- [x ] Staging
- [ ] Test
- [ ] Development

Additional Context This is a lower importance bug for launch, we can launch with it and fix after

Requested Delivery Date: dd/MMM/YYYY

edwinmp commented 5 years ago

@Duncan-Knox I think this one may be related to issue #344. I don't know what's changed in the data to bring rise to this. Error is below image

I think there's some inconsistencies with the Pakistan expenditure tree that my earlier fix has failed to compensate for. Maybe @Napho can have a look.

Duncan-Knox commented 5 years ago

@edwinmp I see this one does not reference the react component and the visual straight out disappears. Other than that it looks the same as #344. It is completely unclear to me what is causing this. Do you have any idea on the type of inconsistencies? I'll show Richard the data in the case he can spot something too.

Duncan-Knox commented 5 years ago

@edwinmp update: this links to negative values in the government expenditure data used in the treemaps. Richard will remove these and resend the data to @akmiller01 for another upload. This ought to fix it.

akmiller01 commented 5 years ago

Further research has led me to conclude that when the partition treemap was refactored into the charts repo, the negative logic was accidentally excluded. In the Datahub-angular repo I found logic that took the absolute value of a child node https://github.com/devinit/datahub-angular/blob/master/public/diConcept/components/PartitionTree/partitionTreeDirective.js#L221 and assigned a blue/red value depending on if it was once negative https://github.com/devinit/datahub-angular/blob/master/public/diConcept/components/PartitionTree/partitionTreeDirective.js#L261-L265

I think we'll need to fit the negative/absolute value logic into charts/core/src/datasets where it creates the partition tree data https://github.com/devinit/charts/blob/master/packages/core/src/dataset/index.ts#L42

akmiller01 commented 5 years ago

Alternatively, since the error seems to be stemming from stratify it might be getting confused when children and parents have the same ID image

akmiller01 commented 5 years ago

And in the case of Brazil, it's because the parent has a 0 value because both of the children cancel each other out! image

akmiller01 commented 5 years ago

@Napho and @edwinmp , Richard provided me a few data fixes that might help avoid these issues. If you pull the latest output from the domestic_finance_2018 branch, it may fix this problem.

Duncan-Knox commented 5 years ago

Bug fixed in data @edwinmp , no front-end work required, besides pulling through new data.