turbulence 1.2.4 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. checksums.yaml +5 -5
  2. data/.github/workflows/ci.yml +51 -0
  3. data/CHANGELOG.md +227 -0
  4. data/Gemfile.lock +47 -24
  5. data/LICENSE.txt +7 -0
  6. data/README.md +100 -31
  7. data/bin/bule +1 -1
  8. data/docs/scatter-plot.png +0 -0
  9. data/docs/treemap.png +0 -0
  10. data/lib/turbulence/calculators/churn.rb +3 -1
  11. data/lib/turbulence/calculators/complexity.rb +4 -16
  12. data/lib/turbulence/cli_parser.rb +12 -1
  13. data/lib/turbulence/command_line_interface.rb +28 -3
  14. data/lib/turbulence/configuration.rb +10 -6
  15. data/lib/turbulence/generators/scatterplot.rb +10 -4
  16. data/lib/turbulence/generators/treemap.rb +14 -10
  17. data/lib/turbulence/scm/git.rb +1 -1
  18. data/lib/turbulence/version.rb +1 -1
  19. data/lib/turbulence.rb +1 -1
  20. data/spec/turbulence/calculators/churn_spec.rb +50 -62
  21. data/spec/turbulence/calculators/complexity_spec.rb +2 -5
  22. data/spec/turbulence/cli_parser_spec.rb +16 -6
  23. data/spec/turbulence/command_line_interface_spec.rb +59 -7
  24. data/spec/turbulence/configuration_spec.rb +11 -5
  25. data/spec/turbulence/generators/scatter_plot_spec.rb +49 -44
  26. data/spec/turbulence/generators/treemap_spec.rb +7 -7
  27. data/spec/turbulence/scm/git_spec.rb +7 -6
  28. data/spec/turbulence/scm/perforce_spec.rb +44 -40
  29. data/spec/turbulence/turbulence_spec.rb +4 -4
  30. data/template/highcharts-heatmap.js +23 -0
  31. data/template/highcharts-treemap.js +11 -0
  32. data/template/highcharts.js +28 -162
  33. data/template/treemap.html +121 -27
  34. data/template/turbulence.html +34 -12
  35. data/turbulence.gemspec +13 -9
  36. metadata +61 -29
  37. data/.travis.yml +0 -6
@@ -2,93 +2,98 @@ require 'turbulence'
2
2
 
3
3
  describe Turbulence::Generators::ScatterPlot do
4
4
  context "with both Metrics" do
5
- it "generates JavaScript" do
5
+ it "generates JavaScript", :aggregate_failures do
6
6
  generator = Turbulence::Generators::ScatterPlot.new(
7
- "foo.rb" => { Turbulence::Calculators::Churn => 1,
8
- Turbulence::Calculators::Complexity => 2 }
7
+ "foo.rb" => { :churn => 1,
8
+ :complexity => 2 }
9
9
  )
10
10
 
11
- generator.to_js.should =~ /var directorySeries/
12
- generator.to_js.should =~ /\"filename\"\:\"foo.rb\"/
13
- generator.to_js.should =~ /\"x\":1/
14
- generator.to_js.should =~ /\"y\":2/
11
+ expect(generator.to_js).to match(/var directorySeries/)
12
+ expect(generator.to_js).to match(/\"filename\"\:\"foo.rb\"/)
13
+ expect(generator.to_js).to match(/\"x\":1/)
14
+ expect(generator.to_js).to match(/\"y\":2/)
15
15
  end
16
16
  end
17
17
 
18
18
  context "with a missing Metric" do
19
19
  it "generates JavaScript" do
20
20
  generator = Turbulence::Generators::ScatterPlot.new(
21
- "foo.rb" => { Turbulence::Calculators::Churn => 1 }
21
+ "foo.rb" => { :churn => 1 }
22
22
  )
23
23
 
24
- generator.to_js.should == 'var directorySeries = {};'
24
+ expect(generator.to_js).to eq 'var directorySeries = {};'
25
25
  end
26
26
  end
27
27
 
28
28
  describe "#clean_metrics_from_missing_data" do
29
- let(:spg) {Turbulence::Generators::ScatterPlot.new({})}
29
+ let(:spg) { Turbulence::Generators::ScatterPlot.new({}) }
30
30
 
31
31
  it "removes entries with missing churn" do
32
- spg.stub(:metrics_hash).and_return("foo.rb" => {
33
- Turbulence::Calculators::Complexity => 88.3})
34
- spg.clean_metrics_from_missing_data.should == {}
32
+ allow(spg).to receive(:metrics_hash).and_return("foo.rb" => { :complexity => 88.3 })
33
+ expect(spg.clean_metrics_from_missing_data).to eq({})
35
34
  end
36
35
 
37
36
  it "removes entries with missing complexity" do
38
- spg.stub(:metrics_hash).and_return("foo.rb" => {
39
- Turbulence::Calculators::Churn => 1})
40
- spg.clean_metrics_from_missing_data.should == {}
37
+ allow(spg).to receive(:metrics_hash).and_return("foo.rb" => { :churn => 1 })
38
+ expect(spg.clean_metrics_from_missing_data).to eq({})
41
39
  end
42
40
 
43
41
  it "keeps entries with churn and complexity present" do
44
- spg.stub(:metrics_hash).and_return("foo.rb" => {
45
- Turbulence::Calculators::Churn => 1,
46
- Turbulence::Calculators::Complexity => 88.3})
47
- spg.clean_metrics_from_missing_data.should_not == {}
42
+ allow(spg).to receive(:metrics_hash).and_return("foo.rb" => {
43
+ :churn => 1,
44
+ :complexity => 88.3,
45
+ })
46
+
47
+ expect(spg.clean_metrics_from_missing_data).not_to eq({})
48
48
  end
49
49
  end
50
50
 
51
51
  describe "#grouped_by_directory" do
52
- let(:spg) {Turbulence::Generators::ScatterPlot.new("lib/foo/foo.rb" => {
53
- Turbulence::Calculators::Churn => 1},
54
- "lib/bar.rb" => {
55
- Turbulence::Calculators::Churn => 2} )}
56
-
57
- it "uses \".\" to denote flat hierarchy" do
58
- spg.stub(:metrics_hash).and_return("foo.rb" => {
59
- Turbulence::Calculators::Churn => 1
60
- })
61
- spg.grouped_by_directory.should == {"." => [["foo.rb", {Turbulence::Calculators::Churn => 1}]]}
62
- end
63
-
64
- it "takes full path into account" do
65
- spg.grouped_by_directory.should == {"lib/foo" => [["lib/foo/foo.rb", {Turbulence::Calculators::Churn => 1}]],
66
- "lib" => [["lib/bar.rb", {Turbulence::Calculators::Churn => 2}]]}
67
- end
52
+ let(:spg) {
53
+ Turbulence::Generators::ScatterPlot.new(
54
+ "lib/foo/foo.rb" => { :churn => 1 },
55
+ "lib/bar.rb" => { :churn => 2 }
56
+ )
57
+ }
58
+
59
+ it "uses \".\" to denote flat hierarchy" do
60
+ allow(spg).to receive(:metrics_hash).and_return("foo.rb" => { :churn => 1 })
61
+ expect(spg.grouped_by_directory).to eq({ "." => [["foo.rb", { :churn => 1 }]] })
62
+ end
63
+
64
+ it "takes full path into account" do
65
+ expect(spg.grouped_by_directory).to eq({
66
+ "lib/foo" => [["lib/foo/foo.rb", { :churn => 1 }]],
67
+ "lib" => [["lib/bar.rb", { :churn => 2 }]]
68
+ })
69
+ end
68
70
  end
69
71
 
70
72
  describe "#file_metrics_for_directory" do
71
- let(:spg) {Turbulence::Generators::ScatterPlot.new({})}
73
+ let(:spg) { Turbulence::Generators::ScatterPlot.new({}) }
74
+
72
75
  it "assigns :filename, :x, :y" do
73
- spg.file_metrics_for_directory("lib/foo/foo.rb" => {
74
- Turbulence::Calculators::Churn => 1,
75
- Turbulence::Calculators::Complexity => 88.2}).should == [{:filename => "lib/foo/foo.rb",
76
- :x => 1, :y => 88.2}]
76
+ result = spg.file_metrics_for_directory("lib/foo/foo.rb" => {
77
+ :churn => 1,
78
+ :complexity => 88.2,
79
+ })
80
+ expect(result).to eq [{ :filename => "lib/foo/foo.rb", :x => 1, :y => 88.2 }]
77
81
  end
78
82
  end
79
83
 
80
84
  describe Turbulence::FileNameMangler do
81
85
  subject { Turbulence::FileNameMangler.new }
86
+
82
87
  it "anonymizes a string" do
83
- subject.mangle_name("chad").should_not == "chad"
88
+ expect(subject.mangle_name("chad")).not_to eq "chad"
84
89
  end
85
90
 
86
91
  it "maintains standard directory names" do
87
- subject.mangle_name("/app/controllers/chad.rb").should =~ %r{/app/controllers/1.rb}
92
+ expect(subject.mangle_name("/app/controllers/chad.rb")).to match(%r{/app/controllers/1.rb})
88
93
  end
89
94
 
90
95
  it "honors leading path separators" do
91
- subject.mangle_name("/a/b/c.rb").should == "/1/2/3.rb"
96
+ expect(subject.mangle_name("/a/b/c.rb")).to eq "/1/2/3.rb"
92
97
  end
93
98
  end
94
99
  end
@@ -2,24 +2,24 @@ require 'turbulence'
2
2
 
3
3
  describe Turbulence::Generators::TreeMap do
4
4
  context "with both Metrics" do
5
- it "generates JavaScript" do
5
+ it "generates JavaScript", :aggregate_failures do
6
6
  generator = Turbulence::Generators::TreeMap.new(
7
- "foo.rb" => { Turbulence::Calculators::Churn => 1,
8
- Turbulence::Calculators::Complexity => 2 }
7
+ "foo.rb" => { :churn => 1,
8
+ :complexity => 2 }
9
9
  )
10
10
 
11
- generator.build_js.should =~ /var treemap_data/
12
- generator.build_js.should =~ /\'foo.rb\'/
11
+ expect(generator.build_js).to match(/var treemap_data/)
12
+ expect(generator.build_js).to match(/"foo\.rb"/)
13
13
  end
14
14
  end
15
15
 
16
16
  context "with a missing Metric" do
17
17
  it "generates JavaScript" do
18
18
  generator = Turbulence::Generators::TreeMap.new(
19
- "foo.rb" => { Turbulence::Calculators::Churn => 1 }
19
+ "foo.rb" => { :churn => 1 }
20
20
  )
21
21
 
22
- generator.build_js.should == "var treemap_data = [['File', 'Parent', 'Churn (size)', 'Complexity (color)'],\n['Root', null, 0, 0],\n];"
22
+ expect(generator.build_js).to eq "var treemap_data = [];"
23
23
  end
24
24
  end
25
25
  end
@@ -5,25 +5,26 @@ require 'fileutils'
5
5
  describe Turbulence::Scm::Git do
6
6
  describe "::is_repo?" do
7
7
  before do
8
- @tmp = Dir.mktmpdir(nil,'..')
8
+ # Create temp dir in system temp location (outside any git repo)
9
+ @tmp = Dir.mktmpdir('turbulence-test')
9
10
  end
10
11
  after do
11
- FileUtils.rmdir(@tmp)
12
+ FileUtils.remove_entry(@tmp)
12
13
  end
13
14
  it "returns true for the working directory" do
14
- Turbulence::Scm::Git.is_repo?(".").should == true
15
+ expect(Turbulence::Scm::Git.is_repo?(".")).to eq true
15
16
  end
16
17
  it "return false for a newly created tmp directory" do
17
- Turbulence::Scm::Git.is_repo?(@tmp).should == false
18
+ expect(Turbulence::Scm::Git.is_repo?(@tmp)).to eq false
18
19
  end
19
20
  end
20
21
 
21
22
  describe "::log_command" do
22
23
  it "takes an optional argument specify to the range" do
23
- expect{Turbulence::Scm::Git.log_command("d551e63f79a90430e560ea871f4e1e39e6e739bd HEAD")}.to_not raise_error
24
+ expect { Turbulence::Scm::Git.log_command("d551e63f79a90430e560ea871f4e1e39e6e739bd HEAD") }.to_not raise_error
24
25
  end
25
26
  it "lists insertions/deletions per file and change" do
26
- Turbulence::Scm::Git.log_command.should match(/\d+\t\d+\t[A-z.]*/)
27
+ expect(Turbulence::Scm::Git.log_command).to match(/\d+\t\d+\t[A-z.]*/)
27
28
  end
28
29
  end
29
30
  end
@@ -1,11 +1,10 @@
1
1
  require 'turbulence/scm/perforce'
2
- require 'rspec/mocks'
3
2
 
4
3
  describe Turbulence::Scm::Perforce do
5
- let (:p4_scm) { Turbulence::Scm::Perforce }
4
+ let(:p4_scm) { Turbulence::Scm::Perforce }
6
5
 
7
6
  before do
8
- p4_scm.stub(:p4_list_changes) do
7
+ allow(p4_scm).to receive(:p4_list_changes).and_return(
9
8
  "Change 62660 on 2005/11/28 by x@client 'CHANGED: adapted to DESCODE '
10
9
  Change 45616 on 2005/07/12 by x@client 'ADDED: trigger that builds and '
11
10
  Change 45615 on 2005/07/12 by x@client 'ADDED: for testing purposes '
@@ -13,9 +12,9 @@ Change 45614 on 2005/07/12 by x@client 'COSMETIC: updated header '
13
12
  Change 11250 on 2004/09/17 by x@client 'CHANGED: trigger now also allow'
14
13
  Change 9250 on 2004/08/20 by x@client 'BUGFIX: bug#1583 (People can so'
15
14
  Change 5560 on 2004/04/26 by x@client 'ADDED: The \"BRANCHED\" tag.'"
16
- end
15
+ )
17
16
 
18
- p4_scm.stub(:p4_describe_change).with("5560") do
17
+ allow(p4_scm).to receive(:p4_describe_change).with("5560").and_return(
19
18
  "Change 5560 by x@client on 2004/04/26 17:25:03
20
19
 
21
20
  ADDED: The \"BRANCHED\" tag.
@@ -38,105 +37,111 @@ changed 1 chunks 3 / 3 lines
38
37
  add 0 chunks 0 lines
39
38
  deleted 0 chunks 0 lines
40
39
  changed 1 chunks 3 / 1 lines"
41
- end
40
+ )
42
41
  end
43
42
 
44
43
  describe "::is_repo?" do
45
44
  before :each do
46
- ENV.stub(:[]).with("P4CLIENT").and_return(nil)
47
- ENV.stub(:[]).with("PATH").and_return("")
45
+ allow(ENV).to receive(:[]).with("P4CLIENT").and_return(nil)
46
+ allow(ENV).to receive(:[]).with("PATH").and_return("")
48
47
  end
49
48
 
50
49
  it "returns true if P4CLIENT is set " do
51
- ENV.stub(:[]).with("P4CLIENT").and_return("c-foo.bar")
50
+ allow(ENV).to receive(:[]).with("P4CLIENT").and_return("c-foo.bar")
52
51
 
53
- Turbulence::Scm::Perforce.is_repo?(".").should be_true
52
+ expect(Turbulence::Scm::Perforce.is_repo?(".")).to be true
54
53
  end
55
54
 
56
- it "returns false if P4CLIENT is empty" do
57
- Turbulence::Scm::Perforce.is_repo?(".").should be_false
55
+ it "returns false if P4CLIENT is empty" do
56
+ expect(Turbulence::Scm::Perforce.is_repo?(".")).to be false
58
57
  end
59
58
 
60
59
  it "returns false if p4 is not available" do
61
- Turbulence::Scm::Perforce.is_repo?(".").should be_false
60
+ expect(Turbulence::Scm::Perforce.is_repo?(".")).to be false
62
61
  end
63
62
  end
64
63
 
65
64
  describe "::log_command" do
66
65
  before do
67
- p4_scm.stub(:depot_to_local).with("//admin/scripts/triggers/enforce-submit-comment.py")\
66
+ allow(p4_scm).to receive(:depot_to_local)
67
+ .with("//admin/scripts/triggers/enforce-submit-comment.py")
68
68
  .and_return("triggers/enforce-submit-comments.py")
69
- p4_scm.stub(:depot_to_local).with("//admin/scripts/triggers/check-consistency.py")\
69
+ allow(p4_scm).to receive(:depot_to_local)
70
+ .with("//admin/scripts/triggers/check-consistency.py")
70
71
  .and_return("triggers/check-consistency.py")
71
- p4_scm.stub(:p4_list_changes) do
72
+ allow(p4_scm).to receive(:p4_list_changes).and_return(
72
73
  "Change 5560 on 2004/04/26 by x@client 'ADDED: The \"BRANCHED\" tag.'"
73
- end
74
+ )
74
75
  end
75
76
 
76
77
  it "takes an optional argument to specify the range" do
77
- expect{Turbulence::Scm::Perforce.log_command("@1,2")}.to_not raise_error
78
+ expect { Turbulence::Scm::Perforce.log_command("@1,2") }.to_not raise_error
78
79
  end
79
80
 
80
81
  it "lists insertions/deletions per file and change" do
81
- Turbulence::Scm::Perforce.log_command().should match(/\d+\t\d+\t[A-z.]*/)
82
+ expect(Turbulence::Scm::Perforce.log_command()).to match(/\d+\t\d+\t[A-z.]*/)
82
83
  end
83
84
  end
84
85
 
85
86
  describe "::changes" do
86
87
  it "lists changenumbers from parsing 'p4 changes' output" do
87
- p4_scm.changes.should =~ %w[62660 45616 45615 45614 11250 9250 5560]
88
+ expect(p4_scm.changes).to match_array(%w[62660 45616 45615 45614 11250 9250 5560])
88
89
  end
89
90
  end
90
91
 
91
92
  describe "::files_per_change" do
92
93
  before do
93
- p4_scm.stub(:depot_to_local).with("//admin/scripts/triggers/enforce-submit-comment.py")\
94
+ allow(p4_scm).to receive(:depot_to_local)
95
+ .with("//admin/scripts/triggers/enforce-submit-comment.py")
94
96
  .and_return("triggers/enforce-submit-comments.py")
95
- p4_scm.stub(:depot_to_local).with("//admin/scripts/triggers/check-consistency.py")\
97
+ allow(p4_scm).to receive(:depot_to_local)
98
+ .with("//admin/scripts/triggers/check-consistency.py")
96
99
  .and_return("triggers/check-consistency.py")
97
100
  end
98
101
 
99
102
  it "lists files with churn" do
100
- p4_scm.files_per_change("5560").should =~ [[4,"triggers/enforce-submit-comments.py"],
101
- [1,"triggers/check-consistency.py"]]
103
+ expect(p4_scm.files_per_change("5560")).to match_array([
104
+ [4, "triggers/enforce-submit-comments.py"],
105
+ [1, "triggers/check-consistency.py"]
106
+ ])
102
107
  end
103
108
  end
104
109
 
105
110
  describe "::transform_for_output" do
106
111
  it "adds a 0 for deletions" do
107
- p4_scm.transform_for_output([1,"triggers/check-consistency.py"]).should == "1\t0\ttriggers/check-consistency.py\n"
112
+ expect(p4_scm.transform_for_output([1, "triggers/check-consistency.py"])).to eq "1\t0\ttriggers/check-consistency.py\n"
108
113
  end
109
114
  end
110
115
 
111
116
  describe "::depot_to_local" do
112
117
  describe "on windows" do
113
118
  before do
114
- p4_scm.stub(:extract_clientfile_from_fstat_of).and_return("D:/Perforce/admin/scripts/triggers/enforce-no-head-change.py")
115
- FileUtils.stub(:pwd).and_return("D:/Perforce")
119
+ allow(p4_scm).to receive(:extract_clientfile_from_fstat_of)
120
+ .and_return("D:/Perforce/admin/scripts/triggers/enforce-no-head-change.py")
121
+ allow(FileUtils).to receive(:pwd).and_return("D:/Perforce")
116
122
  end
117
123
 
118
124
  it "converts depot-style paths to local paths using forward slashes" do
119
- p4_scm.depot_to_local("//admin/scripts/triggers/enforce-no-head-change.py").should \
120
- == "admin/scripts/triggers/enforce-no-head-change.py"
125
+ expect(p4_scm.depot_to_local("//admin/scripts/triggers/enforce-no-head-change.py")).to eq "admin/scripts/triggers/enforce-no-head-change.py"
121
126
  end
122
127
  end
123
128
 
124
129
  describe "on unix" do
125
130
  before do
126
- p4_scm.stub(:extract_clientfile_from_fstat_of).and_return("/home/jhwist/admin/scripts/triggers/enforce-no-head-change.py")
127
- FileUtils.stub(:pwd).and_return("/home/jhwist")
131
+ allow(p4_scm).to receive(:extract_clientfile_from_fstat_of)
132
+ .and_return("/home/jhwist/admin/scripts/triggers/enforce-no-head-change.py")
133
+ allow(FileUtils).to receive(:pwd).and_return("/home/jhwist")
128
134
  end
129
135
 
130
136
  it "converts depot-style paths to local paths using forward slashes" do
131
- p4_scm.depot_to_local("//admin/scripts/triggers/enforce-no-head-change.py").should \
132
- == "admin/scripts/triggers/enforce-no-head-change.py"
137
+ expect(p4_scm.depot_to_local("//admin/scripts/triggers/enforce-no-head-change.py")).to eq "admin/scripts/triggers/enforce-no-head-change.py"
133
138
  end
134
139
  end
135
140
  end
136
141
 
137
142
  describe "::extract_clientfile_from_fstat_of" do
138
143
  before do
139
- p4_scm.stub(:p4_fstat) do
144
+ allow(p4_scm).to receive(:p4_fstat).and_return(
140
145
  "... depotFile //admin/scripts/triggers/enforce-no-head-change.py
141
146
  ... clientFile /home/jhwist/admin/scripts/triggers/enforce-no-head-change.py
142
147
  ... isMapped
@@ -147,24 +152,23 @@ changed 1 chunks 3 / 1 lines"
147
152
  ... headChange 211211
148
153
  ... headModTime 1214555028
149
154
  ... haveRev 5"
150
- end
155
+ )
151
156
  end
152
157
 
153
- it "uses clientFile field" do
154
- p4_scm.extract_clientfile_from_fstat_of("//admin/scripts/triggers/enforce-no-head-change.py").should ==
155
- "/home/jhwist/admin/scripts/triggers/enforce-no-head-change.py"
158
+ it "uses clientFile field" do
159
+ expect(p4_scm.extract_clientfile_from_fstat_of("//admin/scripts/triggers/enforce-no-head-change.py")).to eq "/home/jhwist/admin/scripts/triggers/enforce-no-head-change.py"
156
160
  end
157
161
  end
158
162
 
159
163
  describe "::sum_of_changes" do
160
164
  it "sums up changes" do
161
165
  output = "add 1 chunks 1 lines\ndeleted 0 chunks 0 lines\nchanged 1 chunks 3 / 3 lines"
162
- p4_scm.sum_of_changes(output).should == 4
166
+ expect(p4_scm.sum_of_changes(output)).to eq 4
163
167
  end
164
168
 
165
169
  it "ignores junk" do
166
170
  output = "add nothing, change nothing"
167
- p4_scm.sum_of_changes(output).should == 0
171
+ expect(p4_scm.sum_of_changes(output)).to eq 0
168
172
  end
169
173
  end
170
174
  end
@@ -13,11 +13,11 @@ describe Turbulence do
13
13
  }
14
14
 
15
15
  it "finds files of interest" do
16
- turb.files_of_interest.should include "lib/turbulence.rb"
16
+ expect(turb.files_of_interest).to include "lib/turbulence.rb"
17
17
  end
18
-
19
- it "filters out exluded files" do
18
+
19
+ it "filters out excluded files" do
20
20
  config.exclusion_pattern = 'turbulence'
21
- turb.files_of_interest.should_not include "lib/turbulence.rb"
21
+ expect(turb.files_of_interest).not_to include "lib/turbulence.rb"
22
22
  end
23
23
  end
@@ -0,0 +1,23 @@
1
+ !/**
2
+ * Highmaps JS v13.0.0 (2026-06-11)
3
+ * @module highcharts/modules/heatmap
4
+ * @requires highcharts
5
+ *
6
+ * (c) 2009-2026 Highsoft AS
7
+ * Author: Torstein Hønsi
8
+ *
9
+ * A commercial license may be required depending on use,
10
+ * see www.highcharts.com/license
11
+ */function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(t._Highcharts,t._Highcharts.Axis,t._Highcharts.Color,t._Highcharts.SeriesRegistry,t._Highcharts.SVGElement,t._Highcharts.SVGRenderer):"function"==typeof define&&define.amd?define("highcharts/modules/heatmap",["highcharts/highcharts"],function(t){return e(t,t.Axis,t.Color,t.SeriesRegistry,t.SVGElement,t.SVGRenderer)}):"object"==typeof exports?exports["highcharts/modules/heatmap"]=e(t._Highcharts,t._Highcharts.Axis,t._Highcharts.Color,t._Highcharts.SeriesRegistry,t._Highcharts.SVGElement,t._Highcharts.SVGRenderer):t.Highcharts=e(t.Highcharts,t.Highcharts.Axis,t.Highcharts.Color,t.Highcharts.SeriesRegistry,t.Highcharts.SVGElement,t.Highcharts.SVGRenderer)}("u"<typeof window?this:window,(t,e,i,s,o,r)=>(()=>{"use strict";var a,l,n,h,d={28:t=>{t.exports=o},512:t=>{t.exports=s},532:t=>{t.exports=e},540:t=>{t.exports=r},620:t=>{t.exports=i},944:e=>{e.exports=t}},p={};function c(t){var e=p[t];if(void 0!==e)return e.exports;var i=p[t]={exports:{}};return d[t](i,i.exports,c),i.exports}c.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return c.d(e,{a:e}),e},c.d=(t,e)=>{for(var i in e)c.o(e,i)&&!c.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},c.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var u={};c.d(u,{default:()=>B});var g=c(944),m=c.n(g),f=c(532),x=c.n(f),y=c(620),b=c.n(y);let{parse:v}=b();(a=l||(l={})).initDataClasses=function(t){let e=this.chart,i=this.legendItem=this.legendItem||{},s=this.options,o=t.dataClasses||[],r,a,l=e.options.chart.colorCount,n=0,h;this.dataClasses=a=[],i.labels=[];for(let t=0,i=o.length;t<i;++t)r=o[t],r=(0,g.merge)(r),a.push(r),(e.styledMode||!r.color)&&("category"===s.dataClassColor?(e.styledMode||(l=(h=e.options.colors||[]).length,r.color=h[n]),r.colorIndex=n,++n===l&&(n=0)):r.color=v(s.minColor).tweenTo(v(s.maxColor),i<2?.5:t/(i-1)))},a.initStops=function(){let t=this.options,e=this.stops=t.stops||[[0,t.minColor||""],[1,t.maxColor||""]];for(let t=0,i=e.length;t<i;++t)e[t].color=v(e[t][1])},a.normalizedValue=function(t){let e=this.max||0,i=this.min||0;return this.logarithmic&&(t=this.logarithmic.log2lin(t)),1-(e-t)/(e-i||1)},a.toColor=function(t,e){let i,s,o,r,a,l,n=this.dataClasses,h=this.stops;if(n){for(l=n.length;l--;)if(s=(a=n[l]).from,o=a.to,(void 0===s||t>=s)&&(void 0===o||t<=o)){r=a.color,e&&(e.dataClass=l,e.colorIndex=a.colorIndex);break}}else{for(i=this.normalizedValue(t),l=h.length;l--&&!(i>h[l][0]););s=h[l]||h[l+1],i=1-((o=h[l+1]||s)[0]-i)/(o[0]-s[0]||1),r=s.color.tweenTo(o.color,i)}return r};let C=l,{parse:A}=b();!function(t){let e;function i(){let{userOptions:t}=this;this.colorAxis=[],t.colorAxis&&(t.colorAxis=(0,g.splat)(t.colorAxis),t.colorAxis.map(t=>new e(this,t)))}function s(t){let e=this.chart.colorAxis||[],i=e=>{let i=t.allItems.indexOf(e);-1!==i&&(this.destroyItem(t.allItems[i]),t.allItems.splice(i,1))},s=[],o,r;for(e.forEach(function(t){o=t.options,o?.showInLegend&&(o.dataClasses&&o.visible?s=s.concat(t.getDataClassLegendSymbols()):o.visible&&s.push(t),t.series.forEach(function(t){(!t.options.showInLegend||o.dataClasses)&&("point"===t.options.legendType?t.points.forEach(function(t){i(t)}):i(t))}))}),r=s.length;r--;)t.allItems.unshift(s[r])}function o(t){t.visible&&t.item.legendColor&&t.item.legendItem.symbol.attr({fill:t.item.legendColor})}function r(t){this.chart.colorAxis?.forEach(e=>{e.update({},t.redraw)})}function a(){(this.chart.colorAxis?.length||this.colorAttribs)&&this.translateColors()}function l(){let t=this.axisTypes;t?-1===t.indexOf("colorAxis")&&t.push("colorAxis"):this.axisTypes=["colorAxis"]}function n(t){let e=this,i=t?"show":"hide";e.visible=e.options.visible=!!t,["graphic","dataLabel"].forEach(function(t){e[t]&&e[t][i]()}),this.series.buildKDTree()}function h(){let t=this,e=this.getPointsCollection(),i=this.options.nullColor,s=this.colorAxis,o=this.colorKey;e.forEach(e=>{let r=e.getNestedProperty(o),a=e.options.color||(e.isNull||null===e.value?i:s&&void 0!==r?s.toColor(r,e):e.color||t.color);a&&e.color!==a&&(e.color=a,"point"===t.options.legendType&&e.legendItem&&e.legendItem.label&&t.chart.legend.colorizeItem(e,e.visible))})}function d(){this.elem.attr("fill",A(this.start).tweenTo(A(this.end),this.pos),void 0,!0)}function p(){this.elem.attr("stroke",A(this.start).tweenTo(A(this.end),this.pos),void 0,!0)}t.compose=function(t,c,u,m,f){var x;let y,b=c.prototype,v=u.prototype,C=f.prototype;b.collectionsWithUpdate.includes("colorAxis")||(e=t,b.collectionsWithUpdate.push("colorAxis"),b.collectionsWithInit.colorAxis=[b.addColorAxis],(0,g.addEvent)(c,"afterCreateAxes",i),y=(x=c).prototype.createAxis,x.prototype.createAxis=function(t,i){if("colorAxis"!==t)return y.apply(this,arguments);let s=new e(this,(0,g.merge)(i.axis,{index:this[t].length,isX:!1}));return this.isDirtyLegend=!0,this.axes.forEach(t=>{t.series=[]}),this.series.forEach(t=>{t.bindAxes(),t.isDirtyData=!0}),(0,g.pick)(i.redraw,!0)&&this.redraw(i.animation),s},v.fillSetter=d,v.strokeSetter=p,(0,g.addEvent)(m,"afterGetAllItems",s),(0,g.addEvent)(m,"afterColorizeItem",o),(0,g.addEvent)(m,"afterUpdate",r),(0,g.extend)(C,{optionalAxis:"colorAxis",translateColors:h}),(0,g.extend)(C.pointClass.prototype,{setVisible:n}),(0,g.addEvent)(f,"afterTranslate",a,{order:1}),(0,g.addEvent)(f,"bindAxes",l))},t.pointSetVisible=n}(n||(n={}));let k=n;var w=c(512),M=c.n(w);let{defaultOptions:L}=m(),{series:I}=M();L.colorAxis=(0,g.merge)(L.xAxis,{lineWidth:0,minPadding:0,maxPadding:0,gridLineColor:"var(--highcharts-background-color)",gridLineWidth:1,tickPixelInterval:72,startOnTick:!0,endOnTick:!0,offset:0,marker:{animation:{duration:50},clip:!1,lineColor:"var(--highcharts-neutral-color-40)",lineWidth:0,color:"var(--highcharts-neutral-color-40)",width:.01},labels:{distance:8,overflow:"justify",rotation:0},minColor:"var(--highcharts-highlight-color-10)",maxColor:"var(--highcharts-highlight-color-100)",tickLength:5,title:{margin:5},showInLegend:!0});class P extends x(){static compose(t,e,i,s){k.compose(P,t,e,i,s)}constructor(t,e){super(t,e),this.clippable=!1,this.coll="colorAxis",this.visible=!0,this.init(t,e)}init(t,e){let i=t.options.legend||{},s=e.layout?"vertical"!==e.layout:"vertical"!==i.layout;this.side=e.side||s?2:1,this.reversed=e.reversed,this.opposite=!s,super.init(t,e,"colorAxis"),this.userOptions=e,(0,g.isArray)(t.userOptions.colorAxis)&&(t.userOptions.colorAxis[this.index]=e),e.dataClasses&&this.initDataClasses(e),this.initStops(),this.horiz=s,this.zoomEnabled=!1}hasData(){return!!(this.tickPositions||[]).length}setTickPositions(){if(!this.dataClasses)return super.setTickPositions()}setOptions(t){let e=this.chart.options.legend||{},i=L.colorAxis,s=t.layout||e.layout||i.layout,o=(0,g.merge)("vertical"!==s?{title:{rotation:0}}:{title:{rotation:90,margin:10}},i,t,{showEmpty:!1,visible:this.chart.options.legend.enabled&&!1!==t.visible});super.setOptions(o),this.options.crosshair=this.options.marker}setAxisSize(){let t=this.chart,e=this.legendItem?.symbol,{width:i,height:s}=this.getSize();e&&(this.left=+e.attr("x"),this.top=+e.attr("y"),this.width=i=+e.attr("width"),this.height=s=+e.attr("height"),this.right=t.chartWidth-this.left-i,this.bottom=t.chartHeight-this.top-s,this.pos=this.horiz?this.left:this.top),this.len=(this.horiz?i:s)||P.defaultLegendLength}getOffset(){let t=this.chart,e=this.legendItem?.group,i=t.axisOffset[this.side],{clipOffset:s,legend:o}=t;e&&(this.axisParent=e,super.getOffset(),o.allItems.forEach(function(t){t instanceof P&&t.drawLegendSymbol(o,t)}),o.render(),t.getMargins(!0),this.added||(this.added=!0),this.labelLeft=0,this.labelRight=this.width,t.axisOffset[this.side]=i,t.clipOffset=s)}setLegendColor(){let t=this.horiz,e=this.reversed,i=+!!e,s=+!e,o=t?[i,0,s,0]:[0,s,0,i];this.legendColor={linearGradient:{x1:o[0],y1:o[1],x2:o[2],y2:o[3]},stops:this.stops}}drawLegendSymbol(t,e){let i=e.legendItem||{},s=t.padding,o=t.options,r=this.options.labels,a=(0,g.pick)(o.itemDistance,10),l=this.horiz,{width:n,height:h}=this.getSize(),d=(0,g.pick)(o.labelPadding,l?16:30);this.setLegendColor();let p=0,c=0;if(this.options.title?.text&&!this.axisTitle){this.axisGroup||(this.axisParent=i.group,this.createGroups());let t=this.len,e=this.top,s=this.left,o=this.width;this.len=l?n:h,this.top=0,this.left=0,this.width=n,this.addTitle(!0),this.len=t,this.top=e,this.left=s,this.width=o}if(this.axisTitle){let t=this.axisTitle.getBBox();p=t.height,c=t.width}let u=this.options.title||{},m=this.axisTitle?u.margin??0:0,f=l?p+m:0;i.symbol||(i.symbol=this.chart.renderer.symbol("roundedRect").attr({r:o.symbolRadius??3,zIndex:1}).add(i.group)),i.symbol.attr({x:0,y:(t.baseline||0)-11+f,width:n,height:h}),l?(i.labelWidth=Math.max(n+s+a,c||0),i.labelHeight=h+s+d+p+m):(i.labelWidth=n+s+(r.x??r.distance??0)+(this.maxLabelLength||0)+(c||0)+m,i.labelHeight=Math.max(h+s,p||0))}getTitlePosition(t){let e=super.getTitlePosition(t),i=this.options.title?.margin??0;if(this.horiz&&t)e.y=this.top-i;else if(!this.horiz&&t){let t=this.options.labels||{},s=t.x??t.distance??0;e.x=this.left+this.width+s+(this.maxLabelLength||0)+i}return e}setState(t){this.series.forEach(function(e){e.setState(t)})}setVisible(){}getSeriesExtremes(){let t=this.series,e,i,s,o,r=t.length;for(this.dataMin=1/0,this.dataMax=-1/0;r--;){for(let a of(i=(o=t[r]).colorKey=(0,g.pick)(o.options.colorKey,o.colorKey,o.pointValKey,o.zoneAxis,"y"),s=o[i+"Min"]&&o[i+"Max"],[i,"value","y"]))if((e=o.getColumn(a)).length)break;if(s)o.minColorValue=o[i+"Min"],o.maxColorValue=o[i+"Max"];else{let t=I.prototype.getExtremes.call(o,e);o.minColorValue=t.dataMin,o.maxColorValue=t.dataMax}(0,g.defined)(o.minColorValue)&&(0,g.defined)(o.maxColorValue)&&(this.dataMin=Math.min(this.dataMin,o.minColorValue),this.dataMax=Math.max(this.dataMax,o.maxColorValue)),s||I.prototype.applyExtremes.call(o)}}drawCrosshair(t,e){let i,s=this.legendItem||{},o=e?.plotX,r=e?.plotY,a=this.pos,l=this.len,n=this.options.marker||{};e&&((i=this.toPixels(e.getNestedProperty(e.series.colorKey)))<a?i=a-2:i>a+l&&(i=a+l+2),e.plotX=i,e.plotY=this.len-i,super.drawCrosshair(t,e),e.plotX=o,e.plotY=r,this.cross&&!this.cross.addedToColorAxis&&s.group&&(this.cross.addClass("highcharts-coloraxis-marker").add(s.group),this.cross.addedToColorAxis=!0,this.chart.styledMode||"object"!=typeof this.crosshair||this.cross.attr({fill:n.color,stroke:n.lineColor,"stroke-width":n.lineWidth})))}getPlotLinePath(t){let e=this.left,i=t.translatedValue,{symbol:s}=this.options.marker||{},o=this.top;if((0,g.isNumber)(i)){let t=this.width,r=i-t/2;return s?this.chart.renderer.symbols[s](e,r,t,t):this.horiz?[["M",i-4,o-6],["L",i+4,o-6],["L",i,o],["Z"]]:[["M",e,i],["L",e-6,i+6],["L",e-6,i-6],["Z"]]}return super.getPlotLinePath(t)}update(t,e){let i=this.chart.legend;this.series.forEach(t=>{t.isDirtyData=!0}),(t.dataClasses&&i.allItems||this.dataClasses)&&this.destroyItems(),super.update(t,e),this.legendItem?.label&&(this.setLegendColor(),i.colorizeItem(this,!0))}destroyItems(){let t=this.chart,e=this.legendItem||{};if(e.label)t.legend.destroyItem(this);else if(e.labels)for(let i of e.labels)t.legend.destroyItem(i);t.isDirtyLegend=!0}destroy(){this.chart.isDirtyLegend=!0,this.destroyItems(),super.destroy(...[].slice.call(arguments))}remove(t){this.destroyItems(),super.remove(t)}getDataClassLegendSymbols(){let t,e=this,i=e.chart,s=e.legendItem&&e.legendItem.labels||[],o=i.options.legend,r=(0,g.pick)(o.valueDecimals,-1),a=(0,g.pick)(o.valueSuffix,""),l=t=>e.series.reduce((e,i)=>(e.push(...i.points.filter(e=>e.dataClass===t)),e),[]);return s.length||e.dataClasses.forEach((o,n)=>{let h=o.from,d=o.to,{numberFormatter:p}=i,c=!0;t="",void 0===h?t="< ":void 0===d&&(t="> "),void 0!==h&&(t+=p(h,r)+a),void 0!==h&&void 0!==d&&(t+=" - "),void 0!==d&&(t+=p(d,r)+a),s.push((0,g.extend)({chart:i,name:t,options:{},drawLegendSymbol:I.prototype.drawLegendSymbol,visible:!0,isDataClass:!0,setState:t=>{for(let e of l(n))e.setState(t)},setVisible:function(){this.visible=c=e.visible=!c;let t=[];for(let e of l(n))e.setVisible(c),e.hiddenInDataClass=!c,-1===t.indexOf(e.series)&&t.push(e.series);i.legend.colorizeItem(this,c),t.forEach(t=>{(0,g.fireEvent)(t,"afterDataClassLegendClick")})}},o))}),s}getSize(){let{chart:t,horiz:e}=this,{height:i,width:s}=this.options,{legend:o}=t.options;return{width:(0,g.pick)((0,g.defined)(s)?(0,g.relativeLength)(s,t.chartWidth):void 0,o?.symbolWidth,e?P.defaultLegendLength:12),height:(0,g.pick)((0,g.defined)(i)?(0,g.relativeLength)(i,t.chartHeight):void 0,o?.symbolHeight,e?12:P.defaultLegendLength)}}}P.defaultLegendLength=200,P.keepProps=["legendItem"],(0,g.extend)(P.prototype,C),Array.prototype.push.apply(x().keepProps,P.keepProps);/**
12
+ * @license Highcharts JS v13.0.0 (2026-06-11)
13
+ * @module highcharts/modules/color-axis
14
+ * @requires highcharts
15
+ *
16
+ * ColorAxis module
17
+ *
18
+ * (c) 2012-2026 Highsoft AS
19
+ * Author: Paweł Potaczek
20
+ *
21
+ * A commercial license may be required depending on use,
22
+ * see www.highcharts.com/license
23
+ */let T=m();T.ColorAxis=T.ColorAxis||P,T.ColorAxis.compose(T.Chart,T.Fx,T.Legend,T.Series);var E=c(28),S=c.n(E);let{column:{prototype:D}}=M().seriesTypes;var O=h||(h={});function V(t){let e=this.series,i=e.chart.renderer;this.moveToTopOnHover&&this.graphic&&(e.stateMarkerGraphic||(e.stateMarkerGraphic=new(S())(i,"use").css({pointerEvents:"none"}).add(this.graphic.parentGroup)),t?.state==="hover"?(this.graphic.attr({id:this.id}),e.stateMarkerGraphic.attr({href:`${i.url}#${this.id}`,visibility:"visible"})):e.stateMarkerGraphic.attr({href:""}))}O.pointMembers={dataLabelOnNull:!0,moveToTopOnHover:!0,isValid:function(){return null!==this.value&&this.value!==1/0&&this.value!==-1/0&&(void 0===this.value||!isNaN(this.value))}},O.seriesMembers={colorKey:"value",axisTypes:["xAxis","yAxis","colorAxis"],parallelArrays:["x","y","value"],pointArrayMap:["value"],trackerGroups:["group","markerGroup","dataLabelsGroup"],colorAttribs:function(t){let e={};return(0,g.defined)(t.color)&&(!t.state||"normal"===t.state)&&(e[this.colorProp||"fill"]=t.color),e},pointAttribs:D.pointAttribs},O.compose=function(t){let e=t.prototype.pointClass;return(0,g.addEvent)(e,"afterSetState",V),t};let H=h,{scatter:{prototype:{pointClass:z}}}=M().seriesTypes;class G extends z{applyOptions(t,e){return(this.isNull||null===this.value)&&delete this.color,super.applyOptions(t,e),this.formatPrefix=this.isNull||null===this.value?"null":"point",this}getCellAttributes(){let t=this.series,e=t.options,i=(e.colsize||1)/2,s=(e.rowsize||1)/2,o=t.xAxis,r=t.yAxis,a=this.options.marker||t.options.marker,l=t.pointPlacementToXValue(),n=(0,g.pick)(this.pointPadding,e.pointPadding,0),h={x1:(0,g.clamp)(Math.round(o.len-o.translate(this.x-i,!1,!0,!1,!0,-l)),-o.len,2*o.len),x2:(0,g.clamp)(Math.round(o.len-o.translate(this.x+i,!1,!0,!1,!0,-l)),-o.len,2*o.len),y1:(0,g.clamp)(Math.round(r.translate(this.y-s,!1,!0,!1,!0)),-r.len,2*r.len),y2:(0,g.clamp)(Math.round(r.translate(this.y+s,!1,!0,!1,!0)),-r.len,2*r.len)};for(let t of[["width","x"],["height","y"]]){let e=t[0],i=t[1],s=i+"1",l=i+"2",d=Math.abs(h[s]-h[l]),p=a&&a.lineWidth||0,c=Math.abs(h[s]+h[l])/2,u=a&&a[e];if((0,g.defined)(u)&&u<d){let t=u/2+p/2;h[s]=c-t,h[l]=c+t}n&&(("x"===i&&o.reversed||"y"===i&&!r.reversed)&&(s=l,l=i+"1"),h[s]+=n,h[l]-=n)}return h}haloPath(t){if(!t)return[];let{x:e=0,y:i=0,width:s=0,height:o=0}=this.shapeArgs||{};return[["M",e-t,i-t],["L",e-t,i+o+t],["L",e+s+t,i+o+t],["L",e+s+t,i-t],["Z"]]}isValid(){return this.value!==1/0&&this.value!==-1/0}}(0,g.extend)(G.prototype,{dataLabelOnNull:!0,moveToTopOnHover:!0,ttBelow:!1});var R=c(540),N=c.n(R);let{doc:W}=m(),{series:_,seriesTypes:{column:K,scatter:X}}=M(),{prototype:{symbols:j}}=N(),{colorFromPoint:F,getContext:U}={colorFromPoint:function(t,e){let i=e.series.colorAxis;if(i){let s=i.toColor(t||0,e).split(")")[0].split("(")[1].split(",").map(t=>(0,g.pick)(parseFloat(t),parseInt(t,10)));return s[3]=255*(0,g.pick)(s[3],1),(0,g.defined)(t)&&e.visible||(s[3]=0),s}return[0,0,0,0]},getContext:function(t){let{canvas:e,context:i}=t;return e&&i?.clearRect?(i.clearRect(0,0,e.width,e.height),i):(t.canvas=W.createElement("canvas"),t.context=t.canvas.getContext("2d",{willReadFrequently:!0})||void 0,t.context)}};class Y extends X{constructor(){super(...arguments),this.valueMax=NaN,this.valueMin=NaN,this.isDirtyCanvas=!0}drawPoints(){let t=this,e=t.options,i=e.interpolation,s=e.marker||{};if(i){let{image:e,chart:i,xAxis:s,yAxis:o}=t,{reversed:r=!1,len:a}=s,{reversed:l=!1,len:n}=o,h={width:a,height:n};if(!e||t.isDirtyData||t.isDirtyCanvas){let a=U(t),{canvas:n,options:{colsize:d=1,rowsize:p=1},points:c,points:{length:u}}=t,g=i.colorAxis&&i.colorAxis[0];if(n&&a&&g){let{min:g,max:m}=s.getExtremes(),{min:f,max:x}=o.getExtremes(),y=m-g,b=x-f,v=Math.round(y/d/8*8),C=Math.round(b/p/8*8),[A,k]=[[v,v/y,r,"ceil"],[C,C/b,!l,"floor"]].map(([t,e,i,s])=>i?i=>Math[s](t-e*i):t=>Math[s](e*t)),w=n.width=v+1,M=w*(n.height=C+1),L=(u-1)/M,I=new Uint8ClampedArray(4*M),P=(t,e)=>4*Math.ceil(w*k(e-f)+A(t-g));t.buildKDTree();for(let t=0;t<M;t++){let e=c[Math.ceil(L*t)],{x:i,y:s}=e;I.set(F(e.value,e),P(i,s))}a.putImageData(new ImageData(I,w),0,0),e?e.attr({...h,href:n.toDataURL("image/png",1)}):(t.directTouch=!1,t.image=i.renderer.image(n.toDataURL("image/png",1)).attr(h).add(t.group))}t.isDirtyCanvas=!1}else(e.width!==a||e.height!==n)&&e.attr(h)}else(s.enabled||t._hasPointMarkers)&&(_.prototype.drawPoints.call(t),t.points.forEach(e=>{e.graphic&&(e.graphic[t.chart.styledMode?"css":"animate"](t.colorAttribs(e)),null===e.value&&e.graphic.addClass("highcharts-null-point"))}))}getSymbol(){this.symbol=this.options.marker?.symbol||"rect"}getExtremes(){let{dataMin:t,dataMax:e}=_.prototype.getExtremes.call(this,this.getColumn("value"));return(0,g.isNumber)(t)&&(this.valueMin=t),(0,g.isNumber)(e)&&(this.valueMax=e),_.prototype.getExtremes.call(this)}getValidPoints(t,e){return _.prototype.getValidPoints.call(this,t,e,!0)}hasData(){return!!this.dataTable.rowCount}init(){super.init.apply(this,arguments);let t=this.options;t.pointRange=(0,g.pick)(t.pointRange,t.colsize||1),this.yAxis.axisPointRange=t.rowsize||1,j.ellipse=j.circle,t.marker&&(0,g.isNumber)(t.borderRadius)&&(t.marker.r=t.borderRadius);let e=this.canvas=document.createElement("canvas");e&&(this.context=e?.getContext("webgpu"))}markerAttribs(t,e){let i=t.shapeArgs||{};if(t.hasImage)return{x:t.plotX,y:t.plotY};if(e&&"normal"!==e){let s=t.options.marker||{},o=this.options.marker||{},r=o.states?.[e]||{},a=s.states?.[e]||{},l=(a.width||r.width||i.width||0)+(a.widthPlus||r.widthPlus||0),n=(a.height||r.height||i.height||0)+(a.heightPlus||r.heightPlus||0);return{x:(i.x||0)+((i.width||0)-l)/2,y:(i.y||0)+((i.height||0)-n)/2,width:l,height:n}}return i}pointAttribs(t,e){let i=_.prototype.pointAttribs.call(this,t,e),s=this.options||{},o=this.chart.options.plotOptions||{},r=o.series||{},a=o.heatmap||{},l=t?.options.borderColor||s.borderColor||a.borderColor||r.borderColor,n=t?.options.borderWidth||s.borderWidth||a.borderWidth||r.borderWidth||i["stroke-width"];if(i.stroke=t?.marker?.lineColor||s.marker?.lineColor||l||this.color,i["stroke-width"]=n,e&&"normal"!==e){let o=(0,g.merge)(s.states?.[e],s.marker?.states?.[e],t?.options.marker?.states?.[e]||{});i.fill=o.color||b().parse(i.fill).brighten(o.brightness||0).get(),i.stroke=o.lineColor||i.stroke}return i}translate(){let{borderRadius:t,marker:e}=this.options,i=e?.symbol||"rect",s=j[i]?i:"rect",o=-1!==["circle","square"].indexOf(s);for(let e of(this.generatePoints(),this.points)){let r=e.getCellAttributes(),a=Math.min(r.x1,r.x2),l=Math.min(r.y1,r.y2),n=Math.max(Math.abs(r.x2-r.x1),0),h=Math.max(Math.abs(r.y2-r.y1),0);if(e.hasImage=0===(e.marker?.symbol||i||"").indexOf("url"),o){let t=Math.abs(n-h);a=Math.min(r.x1,r.x2)+(n<h?0:t/2),l=Math.min(r.y1,r.y2)+(n<h?t/2:0),n=h=Math.min(n,h)}e.hasImage&&(e.marker={width:n,height:h}),e.plotX=e.clientX=(r.x1+r.x2)/2,e.plotY=(r.y1+r.y2)/2,e.shapeType="path",e.shapeArgs=(0,g.merge)(!0,{x:a,y:l,width:n,height:h},{d:j[s](a,l,n,h,{r:(0,g.isNumber)(t)?t:0})})}(0,g.fireEvent)(this,"afterTranslate")}}Y.defaultOptions=(0,g.merge)(X.defaultOptions,{animation:!1,borderRadius:0,borderWidth:0,interpolation:!1,nullColor:"var(--highcharts-neutral-color-3)",dataLabels:{formatter:function(){let{numberFormatter:t}=this.series.chart,{value:e}=this.point;return(0,g.isNumber)(e)?t(e,-1):""},inside:!0,verticalAlign:"middle",crop:!1,overflow:"allow",padding:0},marker:{radius:0,lineColor:void 0,states:{hover:{lineWidthPlus:0},select:{}}},clip:!0,pointRange:null,tooltip:{pointFormat:"{point.x}, {point.y}: {point.value}<br/>"},states:{hover:{halo:!1,brightness:.2}},legendSymbol:"rectangle"}),(0,g.addEvent)(Y,"afterDataClassLegendClick",function(){this.isDirtyCanvas=!0,this.drawPoints(),this.options.enableMouseTracking&&this.drawTracker()}),(0,g.extend)(Y.prototype,{axisTypes:H.seriesMembers.axisTypes,colorKey:H.seriesMembers.colorKey,directTouch:!0,getExtremesFromAll:!0,keysAffectYAxis:["y"],parallelArrays:H.seriesMembers.parallelArrays,pointArrayMap:["y","value"],pointClass:G,specialGroup:"group",trackerGroups:H.seriesMembers.trackerGroups,alignDataLabel:K.prototype.alignDataLabel,colorAttribs:H.seriesMembers.colorAttribs}),H.compose(Y),M().registerSeriesType("heatmap",Y);let B=m();return u.default})());
@@ -0,0 +1,11 @@
1
+ !/**
2
+ * Highcharts JS v13.0.0 (2026-06-11)
3
+ * @module highcharts/modules/treemap
4
+ * @requires highcharts
5
+ *
6
+ * (c) 2014-2026 Highsoft AS
7
+ * Authors: Jon Arild Nygård / Øystein Moseng
8
+ *
9
+ * A commercial license may be required depending on use,
10
+ * see www.highcharts.com/license
11
+ */function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(t._Highcharts,t._Highcharts.Templating,t._Highcharts.Color,t._Highcharts.SeriesRegistry,t._Highcharts.SVGElement,t._Highcharts.Series):"function"==typeof define&&define.amd?define("highcharts/modules/treemap",["highcharts/highcharts"],function(t){return e(t,t.Templating,t.Color,t.SeriesRegistry,t.SVGElement,t.Series)}):"object"==typeof exports?exports["highcharts/modules/treemap"]=e(t._Highcharts,t._Highcharts.Templating,t._Highcharts.Color,t._Highcharts.SeriesRegistry,t._Highcharts.SVGElement,t._Highcharts.Series):t.Highcharts=e(t.Highcharts,t.Highcharts.Templating,t.Highcharts.Color,t.Highcharts.SeriesRegistry,t.Highcharts.SVGElement,t.Highcharts.Series)}("u"<typeof window?this:window,(t,e,i,s,r,o)=>(()=>{"use strict";var l,a,n={28:t=>{t.exports=r},512:t=>{t.exports=s},620:t=>{t.exports=i},820:t=>{t.exports=o},944:e=>{e.exports=t},984:t=>{t.exports=e}},h={};function d(t){var e=h[t];if(void 0!==e)return e.exports;var i=h[t]={exports:{}};return n[t](i,i.exports,d),i.exports}d.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return d.d(e,{a:e}),e},d.d=(t,e)=>{for(var i in e)d.o(e,i)&&!d.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},d.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var p={};d.d(p,{default:()=>te});var u=d(944),c=d.n(u);let g={mainBreadcrumb:"Main"};var v=d(984);let{format:m}=d.n(v)(),{composed:b}=c();function f(){if(this.breadcrumbs){let t=this.resetZoomButton&&this.resetZoomButton.getBBox(),e=this.breadcrumbs.options;t&&"right"===e.position.align&&"plotBox"===e.relativeTo&&this.breadcrumbs.alignBreadcrumbsGroup(-t.width-e.buttonSpacing)}}function y(){this.breadcrumbs&&(this.breadcrumbs.destroy(),this.breadcrumbs=void 0)}function x(){let t=this.breadcrumbs;if(t&&!t.options.floating&&t.level){let e=t.options,i=e.buttonTheme,s=(i.height||0)+2*(i.padding||0)+e.buttonSpacing,r=e.position.verticalAlign;"bottom"===r?(this.marginBottom=(this.marginBottom||0)+s,t.yOffset=s):"middle"!==r?(this.plotTop+=s,t.yOffset=-s):t.yOffset=void 0}}function T(){this.breadcrumbs&&this.breadcrumbs.redraw()}function w(t){!0===t.resetSelection&&this.breadcrumbs&&this.breadcrumbs.alignBreadcrumbsGroup()}class L{static compose(t,e){(0,u.pushUnique)(b,"Breadcrumbs")&&((0,u.addEvent)(t,"destroy",y),(0,u.addEvent)(t,"afterShowResetZoom",f),(0,u.addEvent)(t,"getMargins",x),(0,u.addEvent)(t,"redraw",T),(0,u.addEvent)(t,"selection",w),(0,u.extend)(e.lang,g))}constructor(t,e){this.elementList={},this.isDirty=!0,this.level=0,this.list=[];const i=(0,u.merge)(t.options.drilldown&&t.options.drilldown.drillUpButton,L.defaultOptions,t.options.navigation&&t.options.navigation.breadcrumbs,e);this.chart=t,this.options=i||{}}updateProperties(t){this.setList(t),this.setLevel(),this.isDirty=!0}setList(t){this.list=t}setLevel(){this.level=this.list.length&&this.list.length-1}getLevel(){return this.level}getButtonText(t){let e=this.chart,i=this.options,s=e.options.lang,r=(0,u.pick)(i.format,i.showFullPath?"{level.name}":"← {level.name}"),o=s&&(0,u.pick)(s.drillUpText,s.mainBreadcrumb),l=i.formatter&&i.formatter(t)||m(r,{level:t.levelOptions},e)||"";return((0,u.isString)(l)&&!l.length||"← "===l)&&(0,u.defined)(o)&&(l=i.showFullPath?o:"← "+o),l}redraw(){this.isDirty&&this.render(),this.group&&this.group.align(),this.isDirty=!1}render(){let t=this.chart,e=this.options;!this.group&&e&&(this.group=t.renderer.g("breadcrumbs-group").addClass("highcharts-no-tooltip highcharts-breadcrumbs").attr({zIndex:e.zIndex}).add()),e.showFullPath?this.renderFullPathButtons():this.renderSingleButton(),this.alignBreadcrumbsGroup()}renderFullPathButtons(){this.destroySingleButton(),this.resetElementListState(),this.updateListElements(),this.destroyListElements()}renderSingleButton(){let t=this.chart,e=this.list,i=this.options.buttonSpacing;this.destroyListElements();let s=this.group?this.group.getBBox().width:i,r=e[e.length-2];!t.drillUpButton&&this.level>0?t.drillUpButton=this.renderButton(r,s,i):t.drillUpButton&&(this.level>0?this.updateSingleButton():this.destroySingleButton())}alignBreadcrumbsGroup(t){if(this.group){let e=this.options,i=e.buttonTheme,s=e.position,r="chart"===e.relativeTo||"spacingBox"===e.relativeTo?void 0:"plotBox",o=this.group.getBBox(),l=2*(i.padding||0)+e.buttonSpacing;s.width=o.width+l,s.height=o.height+l;let a=(0,u.merge)(s);t&&(a.x+=t),this.options.rtl&&(a.x+=s.width),a.y=(0,u.pick)(a.y,this.yOffset,0),this.group.align(a,!0,r)}}renderButton(t,e,i){let s=this,r=this.chart,o=s.options,l=(0,u.merge)(o.buttonTheme),a=r.renderer.button(s.getButtonText(t),e,i,function(e){let i,r=o.events&&o.events.click;r&&(i=r.call(s,e,t,s)),!1!==i&&(o.showFullPath?e.newLevel=t.level:e.newLevel=s.level-1,(0,u.fireEvent)(s,"up",e))},l).addClass("highcharts-breadcrumbs-button").add(s.group);return r.styledMode||a.attr(o.style),a}renderSeparator(t,e){let i=this.chart,s=this.options.separator,r=i.renderer.label(s.text,t,e,void 0,void 0,void 0,!1).addClass("highcharts-breadcrumbs-separator").add(this.group);return i.styledMode||r.css(s.style),r}update(t){(0,u.merge)(!0,this.options,t),this.destroy(),this.isDirty=!0}updateSingleButton(){let t=this.chart,e=this.list[this.level-1];t.drillUpButton&&t.drillUpButton.attr({text:this.getButtonText(e)})}destroy(){this.destroySingleButton(),this.destroyListElements(!0),this.group&&this.group.destroy(),this.group=void 0}destroyListElements(t){let e=this.elementList;(0,u.objectEach)(e,(i,s)=>{(t||!e[s].updated)&&((i=e[s]).button&&i.button.destroy(),i.separator&&i.separator.destroy(),delete i.button,delete i.separator,delete e[s])}),t&&(this.elementList={})}destroySingleButton(){this.chart.drillUpButton&&(this.chart.drillUpButton.destroy(),this.chart.drillUpButton=void 0)}resetElementListState(){(0,u.objectEach)(this.elementList,t=>{t.updated=!1})}updateListElements(){let t=this.elementList,e=this.options.buttonSpacing,i=this.list,s=this.options.rtl,r=s?-1:1,o=function(t,e){return r*t.getBBox().width+r*e},l=function(t,e,i){t.translate(e-t.getBBox().width,i)},a=this.group?o(this.group,e):e,n,h;for(let d=0,p=i.length;d<p;++d){let u,c,g=d===p-1;t[(h=i[d]).level]?(u=(n=t[h.level]).button,n.separator||g?n.separator&&g&&(n.separator.destroy(),delete n.separator):(a+=r*e,n.separator=this.renderSeparator(a,e),s&&l(n.separator,a,e),a+=o(n.separator,e)),t[h.level].updated=!0):(u=this.renderButton(h,a,e),s&&l(u,a,e),a+=o(u,e),g||(c=this.renderSeparator(a,e),s&&l(c,a,e),a+=o(c,e)),t[h.level]={button:u,separator:c,updated:!0}),u&&u.setState(2*!!g)}}}L.defaultOptions={buttonSpacing:5,buttonTheme:{fill:"none",height:18,padding:2,"stroke-width":0,zIndex:7,states:{select:{fill:"none"}},style:{color:"var(--highcharts-highlight-color-80)"}},floating:!1,format:void 0,relativeTo:"plotBox",rtl:!1,position:{align:"left",verticalAlign:"top",x:0,y:void 0},separator:{text:"/",style:{color:"var(--highcharts-neutral-color-60)",fontSize:"0.8em"}},showFullPath:!0,style:{},useHTML:!1,zIndex:7};var A=d(620),B=d.n(A),O=d(512),P=d.n(O),S=d(28),C=d.n(S);let{column:{prototype:N}}=P().seriesTypes;var M=l||(l={});function E(t){let e=this.series,i=e.chart.renderer;this.moveToTopOnHover&&this.graphic&&(e.stateMarkerGraphic||(e.stateMarkerGraphic=new(C())(i,"use").css({pointerEvents:"none"}).add(this.graphic.parentGroup)),t?.state==="hover"?(this.graphic.attr({id:this.id}),e.stateMarkerGraphic.attr({href:`${i.url}#${this.id}`,visibility:"visible"})):e.stateMarkerGraphic.attr({href:""}))}M.pointMembers={dataLabelOnNull:!0,moveToTopOnHover:!0,isValid:function(){return null!==this.value&&this.value!==1/0&&this.value!==-1/0&&(void 0===this.value||!isNaN(this.value))}},M.seriesMembers={colorKey:"value",axisTypes:["xAxis","yAxis","colorAxis"],parallelArrays:["x","y","value"],pointArrayMap:["value"],trackerGroups:["group","markerGroup","dataLabelsGroup"],colorAttribs:function(t){let e={};return(0,u.defined)(t.color)&&(!t.state||"normal"===t.state)&&(e[this.colorProp||"fill"]=t.color),e},pointAttribs:N.pointAttribs},M.compose=function(t){let e=t.prototype.pointClass;return(0,u.addEvent)(e,"afterSetState",E),t};let R=l;var k=d(820),D=d.n(k);let I=class{constructor(t,e,i,s){this.height=t,this.width=e,this.plot=s,this.direction=i,this.startDirection=i,this.total=0,this.nW=0,this.lW=0,this.nH=0,this.lH=0,this.elArr=[],this.lP={total:0,lH:0,nH:0,lW:0,nW:0,nR:0,lR:0,aspectRatio:function(t,e){return Math.max(t/e,e/t)}}}addElement(t){this.lP.total=this.elArr[this.elArr.length-1],this.total=this.total+t,0===this.direction?(this.lW=this.nW,this.lP.lH=this.lP.total/this.lW,this.lP.lR=this.lP.aspectRatio(this.lW,this.lP.lH),this.nW=this.total/this.height,this.lP.nH=this.lP.total/this.nW,this.lP.nR=this.lP.aspectRatio(this.nW,this.lP.nH)):(this.lH=this.nH,this.lP.lW=this.lP.total/this.lH,this.lP.lR=this.lP.aspectRatio(this.lP.lW,this.lH),this.nH=this.total/this.width,this.lP.nW=this.lP.total/this.nH,this.lP.nR=this.lP.aspectRatio(this.lP.nW,this.nH)),this.elArr.push(t)}reset(){this.nW=0,this.lW=0,this.elArr=[],this.total=0}},H=function(t,e){let{animatableAttribs:i,onComplete:s,css:r,renderer:o}=e,l=t.series&&t.series.chart.hasRendered?void 0:t.series&&t.series.options.animation,a=t.graphic;if(e.attribs={...e.attribs,class:t.getClassName()},t.shouldDraw())a||(t.graphic=a="text"===e.shapeType?o.text():"image"===e.shapeType?o.image(e.imageUrl||"").attr(e.shapeArgs||{}):o[e.shapeType](e.shapeArgs||{}),a.add(e.group)),r&&a.css(r),a.attr(e.attribs).animate(i,!e.isNew&&l,s);else if(a){let e=()=>{t.graphic=a=a&&a.destroy(),"function"==typeof s&&s()};Object.keys(i).length?a.animate(i,void 0,()=>e()):e()}},{pie:{prototype:{pointClass:G}},scatter:{prototype:{pointClass:V}}}=P().seriesTypes;class U extends V{constructor(){super(...arguments),this.groupedPointsAmount=0,this.shapeType="rect"}draw(t){H(this,t)}getClassName(){let t=this.series,e=t.options,i=super.getClassName();return this.node.level<=t.nodeMap[t.rootNode].level&&this.node.children.length?i+=" highcharts-above-level":this.node.isGroup||this.node.isLeaf||t.nodeMap[t.rootNode].isGroup||(0,u.pick)(e.interactByLeaf,!e.allowTraversingTree)?this.node.isGroup||this.node.isLeaf||t.nodeMap[t.rootNode].isGroup||(i+=" highcharts-internal-node"):i+=" highcharts-internal-node-interactive",i}isValid(){return!!(this.id||(0,u.isNumber)(this.value))}setState(t){super.setState.apply(this,arguments),this.graphic&&this.graphic.attr({zIndex:+("hover"===t)})}shouldDraw(){return(0,u.isNumber)(this.plotY)&&null!==this.y}}(0,u.extend)(U.prototype,{setVisible:G.prototype.setVisible});let W={allowTraversingTree:!1,animationLimit:250,borderRadius:0,showInLegend:!1,marker:void 0,colorByPoint:!1,dataLabels:{enabled:!0,formatter:function(){let t=this&&this.point?this.point:{};return(0,u.isString)(t.name)?t.name:""},headers:!1,inside:!0,padding:2,verticalAlign:"middle",style:{textOverflow:"ellipsis"}},tooltip:{headerFormat:"",pointFormat:"<b>{point.name}</b>: {point.value}<br/>",clusterFormat:"+ {point.groupedPointsAmount} more...<br/>"},ignoreHiddenPoint:!0,layoutAlgorithm:"sliceAndDice",layoutStartingDirection:"vertical",alternateStartingDirection:!1,levelIsConstant:!0,traverseUpButton:{position:{align:"right",x:-10,y:10}},borderColor:"var(--highcharts-neutral-color-10)",borderWidth:1,colorKey:"colorValue",opacity:.15,states:{hover:{borderColor:"var(--highcharts-neutral-color-40)",brightness:.1*!P().seriesTypes.heatmap,halo:!1,opacity:.75,shadow:!1}},legendSymbol:"rectangle",traverseToLeaf:!1,cluster:{className:void 0,color:void 0,enabled:!1,pixelWidth:void 0,pixelHeight:void 0,name:void 0,reductionFactor:void 0,minimumClusterSize:5,layoutAlgorithm:{distance:0,gridSize:0,kmeansThreshold:0},marker:{lineWidth:0,radius:0}}};(a||(a={})).recursive=function t(e,i,s){let r=i.call(s||this,e);!1!==r&&t(r,i,s)};let F=a,{parse:j}=B(),{composed:z,noop:_}=c(),{column:$,scatter:K}=P().seriesTypes,{getColor:Y,getLevelOptions:q,updateRootId:Z}={getColor:function(t,e){let i,s,r,o,l,a,n=e.index,h=e.mapOptionsToLevel,d=e.parentColor,p=e.parentColorIndex,c=e.series,g=e.colors,v=e.siblings,m=c.points,b=c.chart.options.chart;if(t){let f;i=m[t.i],s=h[t.level]||{},i&&s.colorByPoint&&(o=i.index%(g?g.length:b.colorCount),r=g&&g[o]),c.chart.styledMode||(l=(0,u.pick)(i&&i.options.color,s&&s.color,r,d&&((f=s&&s.colorVariation)&&"brightness"===f.key&&n&&v?B().parse(d).brighten(f.to*(n/v)).get():d),c.color)),a=(0,u.pick)(i&&i.options.colorIndex,s&&s.colorIndex,o,p,e.colorIndex)}return{color:l,colorIndex:a}},getLevelOptions:function(t){let e,i,s,r,o,l,a={};if((0,u.isObject)(t))for(r=(0,u.isNumber)(t.from)?t.from:1,l=t.levels,i={},e=(0,u.isObject)(t.defaults)?t.defaults:{},(0,u.isArray)(l)&&(i=l.reduce((t,i)=>{let s,o,l;return(0,u.isObject)(i)&&(0,u.isNumber)(i.level)&&(l=(0,u.merge)({},i),o=(0,u.pick)(l.levelIsConstant,e.levelIsConstant),delete l.levelIsConstant,delete l.level,s=i.level+(o?0:r-1),(0,u.isObject)(t[s])?(0,u.merge)(!0,t[s],l):t[s]=l),t},{})),o=(0,u.isNumber)(t.to)?t.to:1,s=0;s<=o;s++)a[s]=(0,u.merge)({},e,(0,u.isObject)(i[s])?i[s]:{});return a},getNodeWidth:function(t,e){let{chart:i,options:s}=t,{nodeDistance:r=0,nodeWidth:o=0}=s,{plotSizeX:l=1}=i;if("auto"===o){if("string"==typeof r&&/%$/.test(r))return l/(e+parseFloat(r)/100*(e-1));let t=Number(r);return(l+t)/(e||1)-t}return(0,u.relativeLength)(o,l)},setTreeValues:function t(e,i){let s=i.before,r=i.idRoot,o=i.mapIdToNode[r],l=!1!==i.levelIsConstant,a=i.points[e.i],n=a&&a.options||{},h=[],d=0;e.levelDynamic=e.level-(l?0:o.level),e.name=(0,u.pick)(a&&a.name,""),e.visible=r===e.id||!0===i.visible,"function"==typeof s&&(e=s(e,i)),e.children.forEach((s,r)=>{let o=(0,u.extend)({},i);(0,u.extend)(o,{index:r,siblings:e.children.length,visible:e.visible}),s=t(s,o),h.push(s),s.visible&&(d+=s.val)});let p=(0,u.pick)(n.value,d);return e.visible=p>=0&&(d>0||e.visible),e.children=h,e.childrenTotal=d,e.isLeaf=e.visible&&!d,e.val=p,e},updateRootId:function(t){let e,i;return(0,u.isObject)(t)&&(i=(0,u.isObject)(t.options)?t.options:{},e=(0,u.pick)(t.rootNode,i.rootId,""),(0,u.isObject)(t.userOptions)&&(t.userOptions.rootId=e),t.rootNode=e),e}};D().keepProps.push("simulation","hadOutsideDataLabels");let X=!1;function J(){let t=this.xAxis,e=this.yAxis;if(t&&e)if(this.is("treemap")){let i={endOnTick:!1,startOnTick:!1,visible:!1};this.is("treegraph")||(i.min=0,i.max=100,i.tickPositions=[]),(0,u.merge)(!0,t.options,i,t.userOptions),(0,u.merge)(!0,e.options,i,e.userOptions),t.visible=t.options.visible,e.visible=e.options.visible,this.is("treegraph")&&(this.isCartesian=t.visible),X=!0}else X&&(e.setOptions(e.userOptions),t.setOptions(t.userOptions),X=!1)}class Q extends K{constructor(){super(...arguments),this.simulation=0}static compose(t){(0,u.pushUnique)(z,"TreemapSeries")&&(0,u.addEvent)(t,"afterBindAxes",J)}algorithmCalcPoints(t,e,i,s){let r=i.plot,o=i.elArr.length-1,l,a,n,h,d=i.lW,p=i.lH,c,g=0;for(let t of(e?(d=i.nW,p=i.nH):c=i.elArr[o],i.elArr))(e||g<o)&&(0===i.direction?(l=r.x,a=r.y,h=t/(n=d)):(l=r.x,a=r.y,n=t/(h=p)),s.push({x:l,y:a,width:n,height:(0,u.correctFloat)(h)}),0===i.direction?r.y=r.y+h:r.x=r.x+n),g+=1;i.reset(),0===i.direction?i.width=i.width-d:i.height=i.height-p,r.y=r.parent.y+(r.parent.height-i.height),r.x=r.parent.x+(r.parent.width-i.width),t&&(i.direction=1-i.direction),e||i.addElement(c)}algorithmFill(t,e,i){let s=[],r,o=e.direction,l=e.x,a=e.y,n=e.width,h=e.height,d,p,u,c;for(let g of i)r=e.width*e.height*(g.val/e.val),d=l,p=a,0===o?(n-=u=r/(c=h),l+=u):(h-=c=r/(u=n),a+=c),s.push({x:d,y:p,width:u,height:c,direction:0,val:0}),t&&(o=1-o);return s}algorithmLowAspectRatio(t,e,i){let s=[],r={x:e.x,y:e.y,parent:e},o=e.direction,l=i.length-1,a=new I(e.height,e.width,o,r),n,h=0;for(let o of i)n=e.width*e.height*(o.val/e.val),a.addElement(n),a.lP.nR>a.lP.lR&&this.algorithmCalcPoints(t,!1,a,s,r),h===l&&this.algorithmCalcPoints(t,!0,a,s,r),++h;return s}alignDataLabel(t,e,i){$.prototype.alignDataLabel.apply(this,arguments),t.dataLabel&&t.dataLabel.attr({zIndex:(t.node.zIndex||0)+1})}applyTreeGrouping(){let t=this,e=t.parentList||{},{cluster:i}=t.options,s=i?.minimumClusterSize||5;if(i?.enabled){let r={},o=t=>{if(t?.point?.shapeArgs){let{width:e=0,height:s=0}=t.point.shapeArgs,{pixelWidth:o=0,pixelHeight:l=0}=i,a=(0,u.defined)(l),n=l?o*l:o*o;(e<o||s<(a?l:o)||e*s<n)&&!t.isGroup&&(0,u.defined)(t.parent)&&(r[t.parent]||(r[t.parent]=[]),r[t.parent].push(t))}t?.children.forEach(t=>{o(t)})};for(let l in o(t.tree),r)r[l]&&r[l].length>s&&r[l].forEach(s=>{let r=e[l].indexOf(s.i);if(-1!==r){e[l].splice(r,1);let o=`highcharts-grouped-treemap-points-${s.parent||"root"}`,a=t.points.find(t=>t.id===o);if(!a){let s=t.pointClass,r=t.points.length;a=new s(t,{className:i.className,color:i.color,id:o,index:r,isGroup:!0,value:0}),(0,u.extend)(a,{formatPrefix:"cluster"}),t.points.push(a),e[l].push(r),e[o]=[]}let n=a.groupedPointsAmount+1,h=t.points[a.index].options.value||0,d=i.name||`+ ${n}`;t.points[a.index].groupedPointsAmount=n,t.points[a.index].options.value=h+(s.point.value||0),t.points[a.index].name=d,e[o].push(s.point.index)}});t.nodeMap={},t.nodeList=[],t.parentList=e;let l=t.buildTree("",-1,0,t.parentList);t.translate(l)}}calculateChildrenAreas(t,e){let i=this.options,s=this.mapOptionsToLevel[t.level+1],r=(0,u.pick)(s?.layoutAlgorithm&&this[s?.layoutAlgorithm]&&s.layoutAlgorithm,i.layoutAlgorithm),o=i.alternateStartingDirection,l=t.children.filter(e=>t.isGroup||!e.ignore),a=s?.groupPadding??i.groupPadding??0,n=this.nodeMap[this.rootNode];if(!r)return;let h=[],d=n.pointValues?.width||0,p=n.pointValues?.height||0;s?.layoutStartingDirection&&(e.direction=+("vertical"!==s.layoutStartingDirection)),h=this[r](e,l);let c=-1;for(let t of l){let i=h[++c];t===n&&(d=d||i.width,p=i.height);let s=a/(this.xAxis.len/p),r=a/(this.yAxis.len/p);if(t.values=(0,u.merge)(i,{val:t.childrenTotal,direction:o?1-e.direction:e.direction}),t.children.length&&t.point.dataLabels?.length){let e=(0,u.arrayMax)(t.point.dataLabels.map(t=>t.options?.headers&&t.height||0))/(this.yAxis.len/p);e<t.values.height/2&&(t.values.y+=e,t.values.height-=e)}if(a){let e=Math.min(s,t.values.width/4),i=Math.min(r,t.values.height/4);t.values.x+=e,t.values.width-=2*e,t.values.y+=i,t.values.height-=2*i}t.pointValues=(0,u.merge)(i,{x:i.x/this.axisRatio,y:100-i.y-i.height,width:i.width/this.axisRatio}),t.children.length&&this.calculateChildrenAreas(t,t.values)}let g=(t,e=[],i=!0)=>(t.children.forEach(t=>{i&&t.isLeaf?e.push(t.point):i||t.isLeaf||e.push(t.point),t.children.length&&g(t,e,i)}),e);if("leaf"===i.nodeSizeBy&&t===n&&this.hasOutsideDataLabels&&!g(n,void 0,!1).some(t=>(0,u.isNumber)(t.options.value))&&!(0,u.isNumber)(n.point?.options.value)){let i=g(n),s=i.map(t=>t.options.value||0),r=i.map(({node:{pointValues:t}})=>t?t.width*t.height:0),o=s.reduce((t,e)=>t+e,0),l=r.reduce((t,e)=>t+e,0)/o,a=0,h=0;i.forEach((t,e)=>{let i=s[e]?r[e]/s[e]:1,o=(0,u.clamp)(i/l,.8,1.4),n=1-o;t.value&&(r[e]<20&&(n*=r[e]/20),n>h&&(h=n),n<a&&(a=n),t.simulatedValue=(t.simulatedValue||t.value)/o)}),(a<-.05||h>.05)&&this.simulation<10?(this.simulation++,this.setTreeValues(t),e.val=t.val,this.calculateChildrenAreas(t,e)):(i.forEach(t=>{delete t.simulatedValue}),this.setTreeValues(t),this.simulation=0)}}createList(t){let e=this.chart,i=e.breadcrumbs,s=[];if(i){let i=0;s.push({level:i,levelOptions:e.series[0]});let r=t.target.nodeMap[t.newRootId],o=[];for(;r.parent||""===r.parent;)o.push(r),r=t.target.nodeMap[r.parent];for(let t of o.reverse())s.push({level:++i,levelOptions:t});s.length<=1&&(s.length=0)}return s}drawDataLabels(){let t=this.mapOptionsToLevel,e=this.points.filter(function(t){return t.node.visible||(0,u.defined)(t.dataLabel)}),i=(0,u.splat)(this.options.dataLabels||{})[0]?.padding,s=e.some(t=>(0,u.isNumber)(t.plotY));for(let r of e){let e={},o={style:e},l=t[r.node.level];if((!r.node.isLeaf&&!r.node.isGroup||r.node.isGroup&&r.node.level<=this.nodeMap[this.rootNode].level)&&(o.enabled=!1),l?.dataLabels&&((0,u.merge)(!0,o,(0,u.splat)(l.dataLabels)[0]),this.hasDataLabels=()=>!0),r.node.isLeaf?o.inside=!0:o.headers&&(o.verticalAlign="top"),r.shapeArgs&&s){let{height:t=0,width:s=0}=r.shapeArgs;if(s>32&&t>16&&r.shouldDraw()){let l=s-2*((0,u.splat)(o.padding)[0]||(0,u.splat)(i)[0]||0);e.width=`${l}px`,e.lineClamp??(e.lineClamp=Math.floor(t/16)),this.options.allowTraversingTree&&(e.visibility="inherit"),r.dataLabel?.attr({width:o.headers?l:void 0})}else e.width=`${s}px`,e.visibility="hidden"}r.dlOptions=(0,u.merge)(o,r.options.dataLabels,{zIndex:void 0}),delete r.dlOptions.zIndex}super.drawDataLabels(e)}drawPoints(t=this.points){let e=this.chart,i=e.renderer,s=e.styledMode,r=this.options,o=s?{}:r.shadow,l=r.borderRadius,a=e.pointCount<r.animationLimit,n=r.allowTraversingTree;for(let e of t){let t={},h={},d={},p="level-group-"+e.node.level,c=!!e.graphic,g=a&&c,v=e.shapeArgs;e.shouldDraw()&&(e.isInside=!0,l&&(h.r=l),(0,u.merge)(!0,g?t:h,c?v:{},s?{}:this.pointAttribs(e,e.selected?"select":void 0)),this.colorAttribs&&s&&(0,u.extend)(d,this.colorAttribs(e)),this[p]||(this[p]=i.g(p).attr({zIndex:-(e.node.level||0)}).add(this.group),this[p].survive=!0)),e.draw({animatableAttribs:t,attribs:h,css:d,group:this[p],imageUrl:e.imageUrl,renderer:i,shadow:o,shapeArgs:v,shapeType:e.shapeType}),n&&e.graphic&&(e.drillId=r.interactByLeaf?this.drillToByLeaf(e):this.drillToByGroup(e))}}drillToByGroup(t){return(!t.node.isLeaf||!!t.node.isGroup)&&t.id}drillToByLeaf(t){let{traverseToLeaf:e}=t.series.options,i=!1,s;if(t.node.parent!==this.rootNode&&t.node.isLeaf)if(e)i=t.id;else for(s=t.node;!i;)void 0!==s.parent&&(s=this.nodeMap[s.parent]),s.parent===this.rootNode&&(i=s.id);return i}drillToNode(t,e){(0,u.error)(32,!1,void 0,{"treemap.drillToNode":"use treemap.setRootNode"}),this.setRootNode(t,e)}drillUp(){let t=this.nodeMap[this.rootNode];t&&(0,u.isString)(t.parent)&&this.setRootNode(t.parent,!0,{trigger:"traverseUpButton"})}getExtremes(){let{dataMin:t,dataMax:e}=super.getExtremes(this.colorValueData);return this.valueMin=t,this.valueMax=e,super.getExtremes()}getListOfParents(t,e){let i=(0,u.isArray)(t)?t:[],s=(0,u.isArray)(e)?e:[],r=i.reduce(function(t,e,i){let s=(0,u.pick)(e.parent,"");return void 0===t[s]&&(t[s]=[]),t[s].push(i),t},{"":[]});for(let t of Object.keys(r)){let e=r[t];if(""!==t&&-1===s.indexOf(t)){for(let t of e)r[""].push(t);delete r[t]}}return r}getTree(){let t=this.data.map(function(t){return t.id});return this.parentList=this.getListOfParents(this.data,t),this.nodeMap={},this.nodeList=[],this.buildTree("",-1,0,this.parentList||{})}buildTree(t,e,i,s,r){let o=[],l=this.points[e],a=0,n;for(let e of s[t]||[])a=Math.max((n=this.buildTree(this.points[e].id,e,i+1,s,t)).height+1,a),o.push(n),this.is("treegraph")&&(n.visible=!0);let h=new this.NodeClass().init(t,e,o,a,i,this,r);for(let t of o)t.parentNode=h;return this.nodeMap[h.id]=h,this.nodeList.push(h),l&&(l.node=h,h.point=l,(0,u.defined)(l.options.x)||(l.x=i)),h}hasData(){return!!this.dataTable.rowCount}init(t,e){let i=this,s=(0,u.merge)(e.drillUpButton,e.breadcrumbs),r=(0,u.addEvent)(i,"setOptions",t=>{let e=t.userOptions;(0,u.defined)(e.allowDrillToNode)&&!(0,u.defined)(e.allowTraversingTree)&&(e.allowTraversingTree=e.allowDrillToNode,delete e.allowDrillToNode),(0,u.defined)(e.drillUpButton)&&!(0,u.defined)(e.traverseUpButton)&&(e.traverseUpButton=e.drillUpButton,delete e.drillUpButton);let i=(0,u.splat)(e.dataLabels||{});e.levels?.forEach(t=>{i.push.apply(i,(0,u.splat)(t.dataLabels||{}))}),this.hasOutsideDataLabels=i.some(t=>t.headers)});super.init(t,e),delete i.opacity,i.eventsToUnbind.push(r),i.options.allowTraversingTree&&(i.eventsToUnbind.push((0,u.addEvent)(i,"click",i.onClickDrillToNode)),i.eventsToUnbind.push((0,u.addEvent)(i,"setRootNode",function(t){let e=i.chart;e.breadcrumbs&&e.breadcrumbs.updateProperties(i.createList(t))})),i.eventsToUnbind.push((0,u.addEvent)(i,"update",function(t,e){let i=this.chart.breadcrumbs;i&&t.options.breadcrumbs&&i.update(t.options.breadcrumbs),this.hadOutsideDataLabels=this.hasOutsideDataLabels})),i.eventsToUnbind.push((0,u.addEvent)(i,"destroy",function(t){let e=this.chart;e.breadcrumbs&&!t.keepEventsForUpdate&&(e.breadcrumbs.destroy(),e.breadcrumbs=void 0)}))),t.breadcrumbs||(t.breadcrumbs=new L(t,s)),i.eventsToUnbind.push((0,u.addEvent)(t.breadcrumbs,"up",function(t){let e=this.level-t.newLevel;for(let t=0;t<e;t++)i.drillUp()}))}onClickDrillToNode(t){let e=t.point,i=e?.drillId;(0,u.isString)(i)&&(e.setState(""),this.setRootNode(i,!0,{trigger:"click"}))}pointAttribs(t,e){let i=(0,u.isObject)(this.mapOptionsToLevel)?this.mapOptionsToLevel:{},s=t?.node&&i[t.node.level]||{},r=this.options,o=e&&r.states&&r.states[e]||{},l=t?.node&&t.getClassName()||"",a={stroke:t&&t.borderColor||s.borderColor||o.borderColor||r.borderColor,"stroke-width":(0,u.pick)(t&&t.borderWidth,s.borderWidth,o.borderWidth,r.borderWidth),dashstyle:t?.borderDashStyle||s.borderDashStyle||o.borderDashStyle||r.borderDashStyle,fill:t?.color||this.color};return -1!==l.indexOf("highcharts-above-level")?(a.fill="none",a["stroke-width"]=0):-1!==l.indexOf("highcharts-internal-node-interactive")?(a["fill-opacity"]=o.opacity??r.opacity??1,a.cursor="pointer"):-1!==l.indexOf("highcharts-internal-node")?a.fill="none":e&&o.brightness&&(a.fill=j(a.fill).brighten(o.brightness).get()),a}setColorRecursive(t,e,i,s,r){let o=this?.chart,l=o?.options?.colors;if(t){let o=Y(t,{colors:l,index:s,mapOptionsToLevel:this.mapOptionsToLevel,parentColor:e,parentColorIndex:i,series:this,siblings:r}),a=this.points[t.i];a&&(a.color=o.color,a.colorIndex=o.colorIndex);let n=-1;for(let e of t.children||[])this.setColorRecursive(e,o.color,o.colorIndex,++n,t.children.length)}}setPointValues(){let t=this,{points:e,xAxis:i,yAxis:s}=t,r=t.chart.styledMode,o=e=>r?0:t.pointAttribs(e)["stroke-width"]||0;for(let t of e){let{pointValues:e,visible:r}=t.node;if(e&&r){let{height:r,width:l,x:a,y:n}=e,h=o(t),d=i.toPixels(a,!0),p=i.toPixels(a+l,!0),c=s.toPixels(n,!0),g=s.toPixels(n+r,!0),v=0===d?h/2:(0,u.crisp)(i.toPixels(a,!0),h,!0),m=p===i.len?i.len-h/2:(0,u.crisp)(i.toPixels(a+l,!0),h,!0),b=c===s.len?s.len-h/2:(0,u.crisp)(s.toPixels(n,!0),h,!0),f=0===g?h/2:(0,u.crisp)(s.toPixels(n+r,!0),h,!0),y={x:Math.min(v,m),y:Math.min(b,f),width:Math.abs(m-v),height:Math.abs(f-b)};t.plotX=y.x+y.width/2,t.plotY=y.y+y.height/2,t.shapeArgs=y}else delete t.plotX,delete t.plotY}}setRootNode(t,e,i){let s=(0,u.extend)({newRootId:t,previousRootId:this.rootNode,redraw:(0,u.pick)(e,!0),series:this},i);(0,u.fireEvent)(this,"setRootNode",s,function(t){let e=t.series;e.idPreviousRoot=t.previousRootId,e.rootNode=t.newRootId,e.isDirty=!0,t.redraw&&e.chart.redraw()})}setState(t){this.options.inactiveOtherPoints=!0,super.setState(t,!1),this.options.inactiveOtherPoints=!1}setTreeValues(t){let e=this.options,i=this.rootNode,s=this.nodeMap[i],r="boolean"!=typeof e.levelIsConstant||e.levelIsConstant,o=[],l=this.points[t.i],a=0;for(let e of t.children)e=this.setTreeValues(e),o.push(e),e.ignore||(a+=e.val);(0,u.stableSort)(o,(t,e)=>(t.sortIndex||0)-(e.sortIndex||0));let n=(0,u.pick)(l?.simulatedValue,l?.options.value,a);return l&&(l.value=n),l?.isGroup&&e.cluster?.reductionFactor&&(n/=e.cluster.reductionFactor),t.parentNode?.point?.isGroup&&this.rootNode!==t.parent&&(t.visible=!1),(0,u.extend)(t,{children:o,childrenTotal:a,ignore:!((0,u.pick)(l?.visible,!0)&&n>0),isLeaf:t.visible&&!("treegraph"===this.type?o.length>0:a),isGroup:l?.isGroup,levelDynamic:t.level-(r?0:s.level),name:(0,u.pick)(l?.name,""),sortIndex:(0,u.pick)(l?.sortIndex,-n),val:n}),t}sliceAndDice(t,e){return this.algorithmFill(!0,t,e)}squarified(t,e){return this.algorithmLowAspectRatio(!0,t,e)}strip(t,e){return this.algorithmLowAspectRatio(!1,t,e)}stripes(t,e){return this.algorithmFill(!1,t,e)}translate(t){let e=this,i=e.options,s=!t,r=Z(e),o,l,a,n;t||r.startsWith("highcharts-grouped-treemap-points-")||((this.points||[]).forEach(t=>{t.isGroup&&t.destroy()}),super.translate(),t=e.getTree()),e.tree=t=t||e.tree,o=e.nodeMap[r],""===r||o||(e.setRootNode("",!1),r=e.rootNode,o=e.nodeMap[r]),o.point?.isGroup||(e.mapOptionsToLevel=q({from:o.level+1,levels:i.levels,to:t.height,defaults:{levelIsConstant:e.options.levelIsConstant,colorByPoint:i.colorByPoint}})),F.recursive(e.nodeMap[e.rootNode],t=>{let i=t.parent,s=!1;return t.visible=!0,(i||""===i)&&(s=e.nodeMap[i]),s}),F.recursive(e.nodeMap[e.rootNode].children,t=>{let e=!1;for(let i of t)i.visible=!0,i.children.length&&(e=(e||[]).concat(i.children));return e}),e.setTreeValues(t),e.axisRatio=e.xAxis.len/e.yAxis.len,e.nodeMap[""].pointValues=l={x:0,y:0,width:100,height:100},e.nodeMap[""].values=a=(0,u.merge)(l,{width:l.width*e.axisRatio,direction:+("vertical"!==i.layoutStartingDirection),val:t.val}),(this.hasOutsideDataLabels||this.hadOutsideDataLabels)&&this.drawDataLabels(),e.calculateChildrenAreas(t,a),e.colorAxis||i.colorByPoint||e.setColorRecursive(e.tree),i.allowTraversingTree&&o.pointValues&&(n=o.pointValues,e.xAxis.setExtremes(n.x,n.x+n.width,!1),e.yAxis.setExtremes(n.y,n.y+n.height,!1),e.xAxis.setScale(),e.yAxis.setScale()),e.setPointValues(),s&&e.applyTreeGrouping()}}Q.defaultOptions=(0,u.merge)(K.defaultOptions,W),(0,u.extend)(Q.prototype,{buildKDTree:_,colorAttribs:R.seriesMembers.colorAttribs,colorKey:"colorValue",directTouch:!0,getExtremesFromAll:!0,getSymbol:_,optionalAxis:"colorAxis",parallelArrays:["x","y","value","colorValue"],pointArrayMap:["value","colorValue"],pointClass:U,NodeClass:class{constructor(){this.childrenTotal=0,this.visible=!1}init(t,e,i,s,r,o,l){return this.id=t,this.i=e,this.children=i,this.height=s,this.level=r,this.series=o,this.parent=l,this}},trackerGroups:["group","dataLabelsGroup"],utils:F}),R.compose(Q),P().registerSeriesType("treemap",Q);let tt=c();tt.Breadcrumbs=tt.Breadcrumbs||L,tt.Breadcrumbs.compose(tt.Chart,tt.defaultOptions),Q.compose(tt.Series);let te=c();return p.default})());