ixbrl-viewer 1.4.1__py3-none-any.whl → 1.4.86__py3-none-any.whl

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 (190) hide show
  1. iXBRLViewerPlugin/__init__.py +231 -127
  2. iXBRLViewerPlugin/_version.py +33 -3
  3. iXBRLViewerPlugin/constants.py +96 -2
  4. iXBRLViewerPlugin/featureConfig.py +8 -1
  5. iXBRLViewerPlugin/iXBRLViewer.py +356 -214
  6. iXBRLViewerPlugin/plugin.py +12 -0
  7. iXBRLViewerPlugin/ui.py +81 -50
  8. iXBRLViewerPlugin/viewer/dist/ixbrlviewer.js +1 -1
  9. iXBRLViewerPlugin/viewer/dist/ixbrlviewer.js.LICENSE.txt +12 -5
  10. iXBRLViewerPlugin/viewer/i18next-parser.config.js +1 -1
  11. iXBRLViewerPlugin/viewer/src/data/utr.json +1244 -0
  12. iXBRLViewerPlugin/viewer/src/html/fact-details.html +69 -38
  13. iXBRLViewerPlugin/viewer/src/html/footer-logo.html +4 -0
  14. iXBRLViewerPlugin/viewer/src/html/footnote-details.html +2 -2
  15. iXBRLViewerPlugin/viewer/src/html/inspector.html +352 -197
  16. iXBRLViewerPlugin/viewer/src/i18n/cy/balancetypes.json +1 -0
  17. iXBRLViewerPlugin/viewer/src/i18n/cy/currencies.json +13 -0
  18. iXBRLViewerPlugin/viewer/src/i18n/cy/datatypes.json +9 -0
  19. iXBRLViewerPlugin/viewer/src/i18n/cy/labelroles.json +24 -0
  20. iXBRLViewerPlugin/viewer/src/i18n/cy/referenceparts.json +10 -0
  21. iXBRLViewerPlugin/viewer/src/i18n/cy/scale.json +16 -0
  22. iXBRLViewerPlugin/viewer/src/i18n/cy/tooltips.json +17 -0
  23. iXBRLViewerPlugin/viewer/src/i18n/cy/translation.json +179 -0
  24. iXBRLViewerPlugin/viewer/src/i18n/da/balancetypes.json +4 -0
  25. iXBRLViewerPlugin/viewer/src/i18n/da/currencies.json +13 -0
  26. iXBRLViewerPlugin/viewer/src/i18n/da/datatypes.json +9 -0
  27. iXBRLViewerPlugin/viewer/src/i18n/da/labelroles.json +24 -0
  28. iXBRLViewerPlugin/viewer/src/i18n/da/referenceparts.json +10 -0
  29. iXBRLViewerPlugin/viewer/src/i18n/da/scale.json +15 -0
  30. iXBRLViewerPlugin/viewer/src/i18n/da/tooltips.json +17 -0
  31. iXBRLViewerPlugin/viewer/src/i18n/da/translation.json +179 -0
  32. iXBRLViewerPlugin/viewer/src/i18n/de/balancetypes.json +4 -0
  33. iXBRLViewerPlugin/viewer/src/i18n/de/currencies.json +13 -0
  34. iXBRLViewerPlugin/viewer/src/i18n/de/datatypes.json +9 -0
  35. iXBRLViewerPlugin/viewer/src/i18n/de/labelroles.json +24 -0
  36. iXBRLViewerPlugin/viewer/src/i18n/de/referenceparts.json +10 -0
  37. iXBRLViewerPlugin/viewer/src/i18n/de/scale.json +15 -0
  38. iXBRLViewerPlugin/viewer/src/i18n/de/tooltips.json +17 -0
  39. iXBRLViewerPlugin/viewer/src/i18n/de/translation.json +179 -0
  40. iXBRLViewerPlugin/viewer/src/i18n/en/balancetypes.json +4 -0
  41. iXBRLViewerPlugin/viewer/src/i18n/en/datatypes.json +10 -0
  42. iXBRLViewerPlugin/viewer/src/i18n/en/labelroles.json +4 -0
  43. iXBRLViewerPlugin/viewer/src/i18n/en/scale.json +16 -0
  44. iXBRLViewerPlugin/viewer/src/i18n/en/tooltips.json +17 -0
  45. iXBRLViewerPlugin/viewer/src/i18n/en/translation.json +73 -23
  46. iXBRLViewerPlugin/viewer/src/i18n/es/balancetypes.json +4 -0
  47. iXBRLViewerPlugin/viewer/src/i18n/es/datatypes.json +10 -0
  48. iXBRLViewerPlugin/viewer/src/i18n/es/labelroles.json +24 -0
  49. iXBRLViewerPlugin/viewer/src/i18n/es/scale.json +16 -0
  50. iXBRLViewerPlugin/viewer/src/i18n/es/tooltips.json +17 -0
  51. iXBRLViewerPlugin/viewer/src/i18n/es/translation.json +87 -37
  52. iXBRLViewerPlugin/viewer/src/i18n/fr/balancetypes.json +4 -0
  53. iXBRLViewerPlugin/viewer/src/i18n/fr/currencies.json +13 -0
  54. iXBRLViewerPlugin/viewer/src/i18n/fr/datatypes.json +9 -0
  55. iXBRLViewerPlugin/viewer/src/i18n/fr/labelroles.json +24 -0
  56. iXBRLViewerPlugin/viewer/src/i18n/fr/referenceparts.json +10 -0
  57. iXBRLViewerPlugin/viewer/src/i18n/fr/scale.json +15 -0
  58. iXBRLViewerPlugin/viewer/src/i18n/fr/tooltips.json +17 -0
  59. iXBRLViewerPlugin/viewer/src/i18n/fr/translation.json +179 -0
  60. iXBRLViewerPlugin/viewer/src/i18n/nl/balancetypes.json +4 -0
  61. iXBRLViewerPlugin/viewer/src/i18n/nl/currencies.json +13 -0
  62. iXBRLViewerPlugin/viewer/src/i18n/nl/datatypes.json +9 -0
  63. iXBRLViewerPlugin/viewer/src/i18n/nl/labelroles.json +24 -0
  64. iXBRLViewerPlugin/viewer/src/i18n/nl/referenceparts.json +10 -0
  65. iXBRLViewerPlugin/viewer/src/i18n/nl/scale.json +15 -0
  66. iXBRLViewerPlugin/viewer/src/i18n/nl/tooltips.json +17 -0
  67. iXBRLViewerPlugin/viewer/src/i18n/nl/translation.json +179 -0
  68. iXBRLViewerPlugin/viewer/src/i18n/uk/balancetypes.json +4 -0
  69. iXBRLViewerPlugin/viewer/src/i18n/uk/currencies.json +13 -0
  70. iXBRLViewerPlugin/viewer/src/i18n/uk/datatypes.json +9 -0
  71. iXBRLViewerPlugin/viewer/src/i18n/uk/labelroles.json +24 -0
  72. iXBRLViewerPlugin/viewer/src/i18n/uk/referenceparts.json +10 -0
  73. iXBRLViewerPlugin/viewer/src/i18n/uk/scale.json +15 -0
  74. iXBRLViewerPlugin/viewer/src/i18n/uk/tooltips.json +17 -0
  75. iXBRLViewerPlugin/viewer/src/i18n/uk/translation.json +179 -0
  76. iXBRLViewerPlugin/viewer/src/icons/calculator.svg +13 -0
  77. iXBRLViewerPlugin/viewer/src/icons/circle-cross.svg +11 -0
  78. iXBRLViewerPlugin/viewer/src/icons/circle-tick.svg +11 -0
  79. iXBRLViewerPlugin/viewer/src/icons/dark-mode.svg +4 -0
  80. iXBRLViewerPlugin/viewer/src/icons/dimension.svg +1 -5
  81. iXBRLViewerPlugin/viewer/src/icons/member.svg +2 -5
  82. iXBRLViewerPlugin/viewer/src/icons/multi-tag.svg +10 -0
  83. iXBRLViewerPlugin/viewer/src/img/arelle-dark.svg +179 -0
  84. iXBRLViewerPlugin/viewer/src/img/inline-viewer-dark.svg +59 -0
  85. iXBRLViewerPlugin/viewer/src/js/accordian.js +5 -4
  86. iXBRLViewerPlugin/viewer/src/js/aspect.js +29 -10
  87. iXBRLViewerPlugin/viewer/src/js/aspect.test.js +40 -31
  88. iXBRLViewerPlugin/viewer/src/js/balance.js +14 -0
  89. iXBRLViewerPlugin/viewer/src/js/calculation.js +213 -0
  90. iXBRLViewerPlugin/viewer/src/js/calculation.test.js +306 -0
  91. iXBRLViewerPlugin/viewer/src/js/calculationInspector.js +187 -0
  92. iXBRLViewerPlugin/viewer/src/js/chart.js +26 -24
  93. iXBRLViewerPlugin/viewer/src/js/chart.test.js +10 -9
  94. iXBRLViewerPlugin/viewer/src/js/concept.js +37 -4
  95. iXBRLViewerPlugin/viewer/src/js/concept.test.js +30 -6
  96. iXBRLViewerPlugin/viewer/src/js/datatype.js +20 -0
  97. iXBRLViewerPlugin/viewer/src/js/datatype.test.js +62 -0
  98. iXBRLViewerPlugin/viewer/src/js/dialog.js +6 -4
  99. iXBRLViewerPlugin/viewer/src/js/docOrderIndex.js +7 -7
  100. iXBRLViewerPlugin/viewer/src/js/fact.js +156 -59
  101. iXBRLViewerPlugin/viewer/src/js/fact.test.js +160 -29
  102. iXBRLViewerPlugin/viewer/src/js/factset.js +64 -15
  103. iXBRLViewerPlugin/viewer/src/js/factset.test.js +102 -31
  104. iXBRLViewerPlugin/viewer/src/js/footnote.js +8 -2
  105. iXBRLViewerPlugin/viewer/src/js/index.js +11 -3
  106. iXBRLViewerPlugin/viewer/src/js/inspector.js +747 -221
  107. iXBRLViewerPlugin/viewer/src/js/inspector.test.js +143 -25
  108. iXBRLViewerPlugin/viewer/src/js/interval.js +70 -0
  109. iXBRLViewerPlugin/viewer/src/js/interval.test.js +153 -0
  110. iXBRLViewerPlugin/viewer/src/js/ixbrlviewer.js +391 -262
  111. iXBRLViewerPlugin/viewer/src/js/ixbrlviewer.test.js +134 -20
  112. iXBRLViewerPlugin/viewer/src/js/ixnode.js +1 -1
  113. iXBRLViewerPlugin/viewer/src/js/menu.js +25 -7
  114. iXBRLViewerPlugin/viewer/src/js/number-matcher.js +7 -3
  115. iXBRLViewerPlugin/viewer/src/js/number-matcher.test.js +4 -0
  116. iXBRLViewerPlugin/viewer/src/js/outline.js +34 -13
  117. iXBRLViewerPlugin/viewer/src/js/outline.test.js +97 -91
  118. iXBRLViewerPlugin/viewer/src/js/period.js +0 -1
  119. iXBRLViewerPlugin/viewer/src/js/report.js +260 -351
  120. iXBRLViewerPlugin/viewer/src/js/report.test.js +95 -27
  121. iXBRLViewerPlugin/viewer/src/js/reportset.js +264 -0
  122. iXBRLViewerPlugin/viewer/src/js/reportset.test.js +357 -0
  123. iXBRLViewerPlugin/viewer/src/js/search.js +72 -38
  124. iXBRLViewerPlugin/viewer/src/js/search.test.js +184 -84
  125. iXBRLViewerPlugin/viewer/src/js/summary.js +34 -8
  126. iXBRLViewerPlugin/viewer/src/js/summary.test.js +69 -25
  127. iXBRLViewerPlugin/viewer/src/js/tableExport.js +9 -9
  128. iXBRLViewerPlugin/viewer/src/js/taxonomynamer.js +34 -0
  129. iXBRLViewerPlugin/viewer/src/js/taxonomynamer.test.js +32 -0
  130. iXBRLViewerPlugin/viewer/src/js/test-utils.js +46 -0
  131. iXBRLViewerPlugin/viewer/src/js/theme.js +50 -0
  132. iXBRLViewerPlugin/viewer/src/js/unit.js +90 -32
  133. iXBRLViewerPlugin/viewer/src/js/unit.test.js +62 -25
  134. iXBRLViewerPlugin/viewer/src/js/util.js +94 -0
  135. iXBRLViewerPlugin/viewer/src/js/util.test.js +33 -1
  136. iXBRLViewerPlugin/viewer/src/js/utr.js +27 -0
  137. iXBRLViewerPlugin/viewer/src/js/viewer.js +205 -181
  138. iXBRLViewerPlugin/viewer/src/js/viewerOptions.js +0 -2
  139. iXBRLViewerPlugin/viewer/src/less/accordian.less +10 -6
  140. iXBRLViewerPlugin/viewer/src/less/block-list.less +16 -5
  141. iXBRLViewerPlugin/viewer/src/less/calculation-inspector.less +83 -0
  142. iXBRLViewerPlugin/viewer/src/less/chart.less +8 -5
  143. iXBRLViewerPlugin/viewer/src/less/colours-dark-mode.less +40 -0
  144. iXBRLViewerPlugin/viewer/src/less/colours.less +32 -20
  145. iXBRLViewerPlugin/viewer/src/less/common.less +3 -3
  146. iXBRLViewerPlugin/viewer/src/less/components.less +6 -4
  147. iXBRLViewerPlugin/viewer/src/less/core.less +2 -0
  148. iXBRLViewerPlugin/viewer/src/less/dialog.less +21 -14
  149. iXBRLViewerPlugin/viewer/src/less/form-controls.less +33 -11
  150. iXBRLViewerPlugin/viewer/src/less/inspector.less +1045 -726
  151. iXBRLViewerPlugin/viewer/src/less/loader.less +2 -2
  152. iXBRLViewerPlugin/viewer/src/less/menu.less +33 -15
  153. iXBRLViewerPlugin/viewer/src/less/summary.less +16 -6
  154. iXBRLViewerPlugin/viewer/src/less/tabs.less +9 -9
  155. iXBRLViewerPlugin/viewer/src/less/text-block-viewer.less +2 -0
  156. iXBRLViewerPlugin/viewer/src/less/text-mixins.less +2 -1
  157. iXBRLViewerPlugin/viewer/src/less/validation-report.less +2 -3
  158. iXBRLViewerPlugin/viewer/src/less/viewer.less +105 -74
  159. iXBRLViewerPlugin/viewer/webpack.common.js +19 -9
  160. iXBRLViewerPlugin/xhtmlserialize.py +59 -45
  161. {ixbrl_viewer-1.4.1.dist-info → ixbrl_viewer-1.4.86.dist-info}/METADATA +181 -50
  162. ixbrl_viewer-1.4.86.dist-info/RECORD +217 -0
  163. {ixbrl_viewer-1.4.1.dist-info → ixbrl_viewer-1.4.86.dist-info}/WHEEL +1 -1
  164. ixbrl_viewer-1.4.1.dist-info/LICENSE → ixbrl_viewer-1.4.86.dist-info/licenses/LICENSE.md +8 -14
  165. {ixbrl_viewer-1.4.1.dist-info → ixbrl_viewer-1.4.86.dist-info}/top_level.txt +0 -1
  166. iXBRLViewerPlugin/viewer/src/js/calculations.js +0 -111
  167. iXBRLViewerPlugin/viewer/src/js/interact.min.js +0 -6
  168. ixbrl_viewer-1.4.1.dist-info/RECORD +0 -155
  169. tests/__init__.py +0 -0
  170. tests/puppeteer/framework/core_elements.js +0 -117
  171. tests/puppeteer/framework/page_objects/doc_frame.js +0 -105
  172. tests/puppeteer/framework/page_objects/fact_details_panel.js +0 -80
  173. tests/puppeteer/framework/page_objects/search_panel.js +0 -76
  174. tests/puppeteer/framework/page_objects/toolbar.js +0 -18
  175. tests/puppeteer/framework/utils.js +0 -3
  176. tests/puppeteer/framework/viewer_page.js +0 -103
  177. tests/puppeteer/puppeteer_test_run_via_intellij.jpg +0 -0
  178. tests/puppeteer/test_filings/filing_documents_smoke_test.zip +0 -0
  179. tests/puppeteer/test_filings/highlights.zip +0 -0
  180. tests/puppeteer/tests/fact_properties.test.js +0 -78
  181. tests/puppeteer/tests/highlight.test.js +0 -186
  182. tests/puppeteer/tests/search.test.js +0 -86
  183. tests/puppeteer/tools/generate.sh +0 -15
  184. tests/unit_tests/__init__.py +0 -0
  185. tests/unit_tests/iXBRLViewerPlugin/__init__.py +0 -0
  186. tests/unit_tests/iXBRLViewerPlugin/mock_arelle.py +0 -39
  187. tests/unit_tests/iXBRLViewerPlugin/test_iXBRLViewer.py +0 -641
  188. tests/unit_tests/iXBRLViewerPlugin/test_xhtmlserialize.py +0 -310
  189. {ixbrl_viewer-1.4.1.dist-info → ixbrl_viewer-1.4.86.dist-info}/entry_points.txt +0 -0
  190. {ixbrl_viewer-1.4.1.dist-info → ixbrl_viewer-1.4.86.dist-info/licenses}/NOTICE +0 -0
@@ -1,15 +1,17 @@
1
1
  // See COPYRIGHT.md for copyright information
2
2
 
3
- import { Fact } from "./fact.js";
4
3
  import { FactSet } from "./factset.js";
5
- import { iXBRLReport } from "./report.js";
4
+ import { Fact } from "./fact.js";
5
+ import { NAMESPACE_ISO4217, viewerUniqueId } from "./util.js";
6
+ import { ReportSet } from "./reportset.js";
7
+ import './test-utils.js';
6
8
 
7
9
  var i = 0;
8
10
 
9
11
  var testReportData = {
10
12
  "prefixes": {
11
13
  "eg": "http://www.example.com",
12
- "iso4217": "http://www.xbrl.org/2003/iso4217",
14
+ "iso4217": NAMESPACE_ISO4217,
13
15
  "e": "http://example.com/entity",
14
16
  },
15
17
  "concepts": {
@@ -71,12 +73,13 @@ var testReportData = {
71
73
  }
72
74
  };
73
75
 
74
- function testReport(facts) {
76
+ function testReportSet(facts) {
75
77
  // Deep copy of standing data
76
- var data = JSON.parse(JSON.stringify(testReportData));
78
+ const data = JSON.parse(JSON.stringify(testReportData));
77
79
  data.facts = facts;
78
- var report = new iXBRLReport(data);
79
- return report;
80
+ const reportset = new ReportSet(data);
81
+ reportset._initialize();
82
+ return reportset;
80
83
  }
81
84
 
82
85
  function testFact(aspectData) {
@@ -84,42 +87,46 @@ function testFact(aspectData) {
84
87
  return factData;
85
88
  }
86
89
 
90
+ function getFact(reportSet, id) {
91
+ return reportSet.getItemById(viewerUniqueId(0, id));
92
+ }
93
+
87
94
  describe("Minimally unique labels (non-dimensional)", () => {
88
- var report = testReport({
95
+ const reportSet = testReportSet({
89
96
  "f1": testFact({"c": "eg:Concept1", "p": "2018-01-01"}),
90
97
  "f2": testFact({"c": "eg:Concept2", "p": "2018-01-01"}),
91
98
  "f3": testFact({"c": "eg:Concept2", "p": "2019-01-01"}),
92
99
  "f4": testFact({"c": "eg:Concept2", "p": "2019-01-01"}),
93
100
  });
94
101
 
95
- var f1 = new Fact(report, "f1");
96
- var f2 = new Fact(report, "f2");
97
- var f3 = new Fact(report, "f3");
98
- var f4 = new Fact(report, "f3");
102
+ const f1 = getFact(reportSet, "f1");
103
+ const f2 = getFact(reportSet, "f2");
104
+ const f3 = getFact(reportSet, "f3");
105
+ const f4 = getFact(reportSet, "f4");
99
106
 
100
107
  test("Different concept", () => {
101
- var fs = new FactSet([ f1, f2 ]);
108
+ const fs = new FactSet([ f1, f2 ]);
102
109
  expect(fs._allDimensions()).toEqual([]);
103
110
  expect(fs.minimallyUniqueLabel(f1)).toEqual("Concept 1");
104
111
  expect(fs.minimallyUniqueLabel(f2)).toEqual("Concept 2");
105
112
  });
106
113
 
107
114
  test("Different period", () => {
108
- var fs = new FactSet([ f2, f3 ]);
115
+ const fs = new FactSet([ f2, f3 ]);
109
116
  expect(fs._allDimensions()).toEqual([]);
110
117
  expect(fs.minimallyUniqueLabel(f2)).toEqual("31 Dec 2017");
111
118
  expect(fs.minimallyUniqueLabel(f3)).toEqual("31 Dec 2018");
112
119
  });
113
120
 
114
121
  test("Different concept and period, concept takes precedence", () => {
115
- var fs = new FactSet([ f1, f4 ]);
122
+ const fs = new FactSet([ f1, f4 ]);
116
123
  expect(fs._allDimensions()).toEqual([]);
117
124
  expect(fs.minimallyUniqueLabel(f1)).toEqual("Concept 1");
118
125
  expect(fs.minimallyUniqueLabel(f4)).toEqual("Concept 2");
119
126
  });
120
127
 
121
128
  test("Mix of period and concept differences", () => {
122
- var fs = new FactSet([ f1, f2, f3 ]);
129
+ const fs = new FactSet([ f1, f2, f3 ]);
123
130
  expect(fs._allDimensions()).toEqual([]);
124
131
  expect(fs.minimallyUniqueLabel(f1)).toEqual("Concept 1, 31 Dec 2017");
125
132
  expect(fs.minimallyUniqueLabel(f2)).toEqual("Concept 2, 31 Dec 2017");
@@ -128,27 +135,27 @@ describe("Minimally unique labels (non-dimensional)", () => {
128
135
  });
129
136
 
130
137
  describe("Minimally unique labels (dimensional)", () => {
131
- var report = testReport({
138
+ const reportSet = testReportSet({
132
139
  "f1": testFact({"c": "eg:Concept1", "p": "2018-01-01", "eg:Dimension1": "eg:DimensionValue1"}),
133
140
  "f2": testFact({"c": "eg:Concept1", "p": "2018-01-01", "eg:Dimension1": "eg:DimensionValue2"}),
134
141
  "f3": testFact({"c": "eg:Concept1", "p": "2019-01-01", "eg:Dimension1": "eg:DimensionValue2"}),
135
142
  "f4": testFact({"c": "eg:Concept1", "p": "2018-01-01" }),
136
143
  });
137
144
 
138
- var f1 = new Fact(report, "f1");
139
- var f2 = new Fact(report, "f2");
140
- var f3 = new Fact(report, "f3");
141
- var f4 = new Fact(report, "f4");
145
+ const f1 = getFact(reportSet, "f1");
146
+ const f2 = getFact(reportSet, "f2");
147
+ const f3 = getFact(reportSet, "f3");
148
+ const f4 = getFact(reportSet, "f4");
142
149
 
143
150
  test("Same concept & period, different dimension value", () => {
144
- var fs = new FactSet([ f1, f2 ]);
151
+ const fs = new FactSet([ f1, f2 ]);
145
152
  expect(fs._allDimensions()).toEqual(["eg:Dimension1"]);
146
153
  expect(fs.minimallyUniqueLabel(f1)).toEqual("Dimension Value 1");
147
154
  expect(fs.minimallyUniqueLabel(f2)).toEqual("Dimension Value 2");
148
155
  });
149
156
 
150
157
  test("Different period, different dimension value", () => {
151
- var fs = new FactSet([ f1, f3 ]);
158
+ const fs = new FactSet([ f1, f3 ]);
152
159
  expect(fs._allDimensions()).toEqual(["eg:Dimension1"]);
153
160
  /* Different period takes precedence */
154
161
  expect(fs.minimallyUniqueLabel(f1)).toEqual("31 Dec 2017");
@@ -156,7 +163,7 @@ describe("Minimally unique labels (dimensional)", () => {
156
163
  });
157
164
 
158
165
  test("Dimension present on one fact only", () => {
159
- var fs = new FactSet([ f1, f4 ]);
166
+ const fs = new FactSet([ f1, f4 ]);
160
167
  expect(fs._allDimensions()).toEqual(["eg:Dimension1"]);
161
168
  /* Concept is included even though it's the same across all to avoid an
162
169
  * empty label */
@@ -167,16 +174,16 @@ describe("Minimally unique labels (dimensional)", () => {
167
174
  });
168
175
 
169
176
  describe("Minimally unique labels (duplicate facts)", () => {
170
- var report = testReport({
177
+ const reportSet = testReportSet({
171
178
  "f1": testFact({"c": "eg:Concept1", "p": "2018-01-01", "eg:Dimension1": "eg:DimensionValue1"}),
172
179
  "f2": testFact({"c": "eg:Concept1", "p": "2018-01-01", "eg:Dimension1": "eg:DimensionValue1"}),
173
180
  });
174
181
 
175
- var f1 = new Fact(report, "f1");
176
- var f2 = new Fact(report, "f2");
182
+ const f1 = getFact(reportSet, "f1");
183
+ const f2 = getFact(reportSet, "f2");
177
184
 
178
185
  test("Two facts, all aspects the same", () => {
179
- var fs = new FactSet([ f1, f2 ]);
186
+ const fs = new FactSet([ f1, f2 ]);
180
187
  expect(fs._allDimensions()).toEqual(["eg:Dimension1"]);
181
188
  expect(fs.minimallyUniqueLabel(f1)).toEqual("Concept 1");
182
189
  expect(fs.minimallyUniqueLabel(f2)).toEqual("Concept 1");
@@ -184,13 +191,13 @@ describe("Minimally unique labels (duplicate facts)", () => {
184
191
  });
185
192
 
186
193
  describe("Minimally unique labels (missing labels)", () => {
187
- var report = testReport({
194
+ const reportSet = testReportSet({
188
195
  "f1": testFact({"c": "eg:Concept1", "p": "2018-01-01" }),
189
196
  "f2": testFact({"c": "eg:Concept4", "p": "2018-01-01" }),
190
197
  });
191
198
 
192
- var f1 = new Fact(report, "f1");
193
- var f2 = new Fact(report, "f2");
199
+ const f1 = getFact(reportSet, "f1");
200
+ const f2 = getFact(reportSet, "f2");
194
201
 
195
202
  test("Two facts, one has no label", () => {
196
203
  var fs = new FactSet([ f1, f2 ]);
@@ -199,3 +206,67 @@ describe("Minimally unique labels (missing labels)", () => {
199
206
  expect(fs.minimallyUniqueLabel(f2)).toEqual("eg:Concept4");
200
207
  });
201
208
  });
209
+
210
+ function numericTestFact(value, decimals) {
211
+ var factData = { "d": decimals, "v": value, "a": { "c": "eg:Concept1", "u": "eg:pure" }};
212
+ return factData;
213
+ }
214
+
215
+ describe("Consistency", () => {
216
+ const reportSet = testReportSet({
217
+ "f1": numericTestFact(150, -1), // 145-155
218
+ "f2": numericTestFact(200, -2), // 150-250
219
+ "f3": numericTestFact(140, -1), // 135-145
220
+ });
221
+
222
+ const f1 = getFact(reportSet, "f1");
223
+ const f2 = getFact(reportSet, "f2");
224
+ const f3 = getFact(reportSet, "f3");
225
+
226
+ test("Inconsistent fact set", () => {
227
+ const factSet = new FactSet([f1, f2, f3]);
228
+ expect(factSet.valueIntersection()).toBeUndefined();
229
+ expect(factSet.isConsistent()).toBeFalsy();
230
+ });
231
+
232
+ test("Consistent fact sets - overlap", () => {
233
+ const factSet = new FactSet([f1, f2]);
234
+ const intersection = factSet.valueIntersection();
235
+ expect(intersection.a).toEqualDecimal(150);
236
+ expect(intersection.b).toEqualDecimal(155);
237
+ expect(factSet.isConsistent()).toBeTruthy();
238
+ });
239
+
240
+ test("Consistent fact sets - bounds coincide", () => {
241
+ const factSet = new FactSet([f1, f3]);
242
+ const intersection = factSet.valueIntersection();
243
+ expect(intersection.a).toEqualDecimal(145);
244
+ expect(intersection.b).toEqualDecimal(145);
245
+ expect(factSet.isConsistent()).toBeTruthy();
246
+ });
247
+
248
+ });
249
+
250
+ describe("Most precise", () => {
251
+ const reportSet = testReportSet({
252
+ "f1": numericTestFact(150, -1),
253
+ "f2": numericTestFact(200, 0),
254
+ "f3": numericTestFact(140, 2),
255
+ "f4": numericTestFact(160, undefined)
256
+ });
257
+
258
+ const f1 = getFact(reportSet, "f1");
259
+ const f2 = getFact(reportSet, "f2");
260
+ const f3 = getFact(reportSet, "f3");
261
+ const f4 = getFact(reportSet, "f4");
262
+
263
+ test("Most precise - finite decimals", () => {
264
+ const factSet = new FactSet([f1, f2, f3]);
265
+ expect(factSet.mostPrecise()).toEqual(f3);
266
+ });
267
+
268
+ test("Most precise - mixture of finite and infinite", () => {
269
+ const factSet = new FactSet([f1, f2, f3, f4]);
270
+ expect(factSet.mostPrecise()).toEqual(f4);
271
+ });
272
+ });
@@ -2,10 +2,10 @@
2
2
 
3
3
  export class Footnote {
4
4
  constructor(report, footnoteId, title) {
5
- this.id = footnoteId;
5
+ this.vuid = footnoteId;
6
6
  this.linkedFacts = [];
7
7
  this.title = title;
8
- this.ixNode = report.getIXNodeForItemId(footnoteId);
8
+ this.ixNode = report.reportSet.getIXNodeForItemId(footnoteId);
9
9
  }
10
10
 
11
11
  // Facts that are the source of relationships to this fact.
@@ -21,6 +21,12 @@ export class Footnote {
21
21
  return this.textContent();
22
22
  }
23
23
 
24
+ readableValueHTML() {
25
+ const span = document.createElement("span");
26
+ span.append(document.createTextNode(this.textContent()));
27
+ return span;
28
+ }
29
+
24
30
  isTextBlock() {
25
31
  return false;
26
32
  }
@@ -3,9 +3,17 @@
3
3
  import $ from 'jquery'
4
4
  import { iXBRLViewer } from "./ixbrlviewer.js";
5
5
 
6
+ const scriptSrc = document.currentScript.src;
7
+
6
8
  $(() => {
7
- const iv = new iXBRLViewer({
8
- showValidationWarningOnStart: true
9
- });
9
+ const options = {
10
+ showValidationWarningOnStart: true,
11
+ };
12
+ const configUrl = new URL("ixbrlviewer.config.json", scriptSrc);
13
+ if (configUrl.protocol != 'file:') {
14
+ options["configUrl"] = configUrl;
15
+ }
16
+
17
+ const iv = new iXBRLViewer(options);
10
18
  iv.load();
11
19
  });