Skip to content

Commit

Permalink
Merge pull request #25 from ma4nn/dependabot/npm_and_yarn/highcharts-…
Browse files Browse the repository at this point in the history
…12.0.2

Bump highcharts from 11.4.8 to 12.0.2
  • Loading branch information
ma4nn authored Dec 10, 2024
2 parents 669c4bf + 8c01bef commit 0512545
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"private": true,
"dependencies": {
"bootstrap": "^5.3.2",
"highcharts": "^11.4.8"
"highcharts": "^12.0.2"
},
"devDependencies": {
"@playwright/test": "^1.46.1",
Expand Down
10 changes: 6 additions & 4 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,11 @@ function createChart(chartDataTree: Tree): Highcharts.Chart {
align: 'right',
padding: 30,
nodeFormatter: function() {
const point = this as any;
const percentage = 'linksTo' in point && point.linksTo[0] ? (point.sum / point.linksTo[0].fromNode.sum) * 100 : null;
return this.point.name + ": " + numberFormat(('getSum' in this.point ? (this.point as any).getSum() : 0)) + " " + (percentage ? "<span class='badge text-bg-secondary'>" + Math.round(percentage) + "% </span>" : "");
const point = this as Highcharts.Point;
const sum = 'getSum' in this ? (this as any).getSum() : 0;
const percentage = 'linksTo' in point && point.linksTo[0] ? (sum / point.linksTo[0].fromNode.sum) * 100 : null;

return point.name + ": " + numberFormat(sum) + " " + (percentage ? "<span class='badge text-bg-secondary'>" + Math.round(percentage) + "% </span>" : "");
}
},
tooltip: {
Expand All @@ -186,7 +188,7 @@ function createChart(chartDataTree: Tree): Highcharts.Chart {
},
// tooltip for node
nodeFormatter: function() {
const point = this as any;
const point = this as Highcharts.Point;

let totalWeight = 0;
let weightsDetailTooltip = '';
Expand Down

0 comments on commit 0512545

Please sign in to comment.