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

Bump highcharts from 11.4.8 to 12.0.2 #25

Merged
merged 2 commits into from
Dec 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading