Skip to content
This repository was archived by the owner on Oct 21, 2022. It is now read-only.

Commit f616b4e

Browse files
authored
Fix pie chart (#130)
1 parent 3e305d9 commit f616b4e

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

dashboard/dashboard_builder.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,16 +152,24 @@ def get_statistics(self, packages):
152152
total_have_conflicts = 0
153153
total_have_deprecated_deps = 0
154154
total_needs_update = 0
155+
156+
outdated_or_deprecated_pkgs = set()
157+
155158
for pkg in packages:
156159
if self.has_issues(pkg):
157160
total_have_conflicts += 1
158161
if self.has_deprecated_deps(pkg):
159162
total_have_deprecated_deps += 1
163+
outdated_or_deprecated_pkgs.add(pkg)
160164
if self.needs_update(pkg):
161165
total_needs_update += 1
166+
outdated_or_deprecated_pkgs.add(pkg)
167+
168+
total_success_deps = total_packages - len(outdated_or_deprecated_pkgs)
162169

163170
return total_packages, total_have_conflicts,\
164-
total_have_deprecated_deps, total_needs_update
171+
total_have_deprecated_deps, total_needs_update,\
172+
total_success_deps
165173

166174
def get_package_details(self, p: package.Package):
167175
"""Return the dict of package check summary.

dashboard/main-template.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ <h3 class="title-3 m-b-30">Compatibility Status</h3>
201201
<div class="chart-percent-2">
202202
<h3 class="title-3 m-b-30">Dependency Status</h3>
203203
<div class="chart-wrap">
204-
<canvas id="percent-chart-dependency" data-success="{{ statistics[0] - statistics[2] - statistics[3] }}"
204+
<canvas id="percent-chart-dependency" data-success="{{ statistics[4] }}"
205205
data-deprecated="{{ statistics[2] }}" data-outdated="{{ statistics[3] }}"></canvas>
206206
</div>
207207
<div class="chart-info">

0 commit comments

Comments
 (0)