InfoRegionsComponent.js 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565
  1. /* *
  2. *
  3. * (c) 2009-2020 Øystein Moseng
  4. *
  5. * Accessibility component for chart info region and table.
  6. *
  7. * License: www.highcharts.com/license
  8. *
  9. * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
  10. *
  11. * */
  12. 'use strict';
  13. import H from '../../../parts/Globals.js';
  14. var doc = H.doc;
  15. import U from '../../../parts/Utilities.js';
  16. var extend = U.extend, format = U.format, pick = U.pick;
  17. import AccessibilityComponent from '../AccessibilityComponent.js';
  18. import Announcer from '../utils/Announcer.js';
  19. import AnnotationsA11y from './AnnotationsA11y.js';
  20. var getAnnotationsInfoHTML = AnnotationsA11y.getAnnotationsInfoHTML;
  21. import ChartUtilities from '../utils/chartUtilities.js';
  22. var unhideChartElementFromAT = ChartUtilities.unhideChartElementFromAT, getChartTitle = ChartUtilities.getChartTitle, getAxisDescription = ChartUtilities.getAxisDescription;
  23. import HTMLUtilities from '../utils/htmlUtilities.js';
  24. var addClass = HTMLUtilities.addClass, setElAttrs = HTMLUtilities.setElAttrs, escapeStringForHTML = HTMLUtilities.escapeStringForHTML, stripHTMLTagsFromString = HTMLUtilities.stripHTMLTagsFromString, getElement = HTMLUtilities.getElement, visuallyHideElement = HTMLUtilities.visuallyHideElement;
  25. /* eslint-disable no-invalid-this, valid-jsdoc */
  26. /**
  27. * @private
  28. */
  29. function getTypeDescForMapChart(chart, formatContext) {
  30. return formatContext.mapTitle ?
  31. chart.langFormat('accessibility.chartTypes.mapTypeDescription', formatContext) :
  32. chart.langFormat('accessibility.chartTypes.unknownMap', formatContext);
  33. }
  34. /**
  35. * @private
  36. */
  37. function getTypeDescForCombinationChart(chart, formatContext) {
  38. return chart.langFormat('accessibility.chartTypes.combinationChart', formatContext);
  39. }
  40. /**
  41. * @private
  42. */
  43. function getTypeDescForEmptyChart(chart, formatContext) {
  44. return chart.langFormat('accessibility.chartTypes.emptyChart', formatContext);
  45. }
  46. /**
  47. * @private
  48. */
  49. function buildTypeDescriptionFromSeries(chart, types, context) {
  50. var firstType = types[0], typeExplaination = chart.langFormat('accessibility.seriesTypeDescriptions.' + firstType, context), multi = chart.series && chart.series.length < 2 ? 'Single' : 'Multiple';
  51. return (chart.langFormat('accessibility.chartTypes.' + firstType + multi, context) ||
  52. chart.langFormat('accessibility.chartTypes.default' + multi, context)) + (typeExplaination ? ' ' + typeExplaination : '');
  53. }
  54. /**
  55. * @private
  56. */
  57. function getTableSummary(chart) {
  58. return chart.langFormat('accessibility.table.tableSummary', { chart: chart });
  59. }
  60. /**
  61. * @private
  62. */
  63. function stripEmptyHTMLTags(str) {
  64. return str.replace(/<(\w+)[^>]*?>\s*<\/\1>/g, '');
  65. }
  66. /**
  67. * @private
  68. */
  69. function enableSimpleHTML(str) {
  70. return str
  71. .replace(/&lt;(h[1-7]|p|div|ul|ol|li)&gt;/g, '<$1>')
  72. .replace(/&lt;&#x2F;(h[1-7]|p|div|ul|ol|li|a|button)&gt;/g, '</$1>')
  73. .replace(/&lt;(div|a|button) id=&quot;([a-zA-Z\-0-9#]*?)&quot;&gt;/g, '<$1 id="$2">');
  74. }
  75. /**
  76. * @private
  77. */
  78. function stringToSimpleHTML(str) {
  79. return stripEmptyHTMLTags(enableSimpleHTML(escapeStringForHTML(str)));
  80. }
  81. /**
  82. * Return simplified explaination of chart type. Some types will not be familiar
  83. * to most users, but in those cases we try to add an explaination of the type.
  84. *
  85. * @private
  86. * @function Highcharts.Chart#getTypeDescription
  87. * @param {Array<string>} types The series types in this chart.
  88. * @return {string} The text description of the chart type.
  89. */
  90. H.Chart.prototype.getTypeDescription = function (types) {
  91. var firstType = types[0], firstSeries = this.series && this.series[0] || {}, formatContext = {
  92. numSeries: this.series.length,
  93. numPoints: firstSeries.points && firstSeries.points.length,
  94. chart: this,
  95. mapTitle: firstSeries.mapTitle
  96. };
  97. if (!firstType) {
  98. return getTypeDescForEmptyChart(this, formatContext);
  99. }
  100. if (firstType === 'map') {
  101. return getTypeDescForMapChart(this, formatContext);
  102. }
  103. if (this.types.length > 1) {
  104. return getTypeDescForCombinationChart(this, formatContext);
  105. }
  106. return buildTypeDescriptionFromSeries(this, types, formatContext);
  107. };
  108. /**
  109. * The InfoRegionsComponent class
  110. *
  111. * @private
  112. * @class
  113. * @name Highcharts.InfoRegionsComponent
  114. */
  115. var InfoRegionsComponent = function () { };
  116. InfoRegionsComponent.prototype = new AccessibilityComponent();
  117. extend(InfoRegionsComponent.prototype, /** @lends Highcharts.InfoRegionsComponent */ {
  118. /**
  119. * Init the component
  120. * @private
  121. */
  122. init: function () {
  123. var chart = this.chart;
  124. var component = this;
  125. this.initRegionsDefinitions();
  126. this.addEvent(chart, 'afterGetTable', function (e) {
  127. component.onDataTableCreated(e);
  128. });
  129. this.addEvent(chart, 'afterViewData', function (tableDiv) {
  130. component.dataTableDiv = tableDiv;
  131. // Use small delay to give browsers & AT time to register new table
  132. setTimeout(function () {
  133. component.focusDataTable();
  134. }, 300);
  135. });
  136. this.announcer = new Announcer(chart, 'assertive');
  137. },
  138. /**
  139. * @private
  140. */
  141. initRegionsDefinitions: function () {
  142. var component = this;
  143. this.screenReaderSections = {
  144. before: {
  145. element: null,
  146. buildContent: function (chart) {
  147. var formatter = chart.options.accessibility
  148. .screenReaderSection.beforeChartFormatter;
  149. return formatter ? formatter(chart) :
  150. component.defaultBeforeChartFormatter(chart);
  151. },
  152. insertIntoDOM: function (el, chart) {
  153. chart.renderTo.insertBefore(el, chart.renderTo.firstChild);
  154. },
  155. afterInserted: function () {
  156. if (typeof component.sonifyButtonId !== 'undefined') {
  157. component.initSonifyButton(component.sonifyButtonId);
  158. }
  159. if (typeof component.dataTableButtonId !== 'undefined') {
  160. component.initDataTableButton(component.dataTableButtonId);
  161. }
  162. }
  163. },
  164. after: {
  165. element: null,
  166. buildContent: function (chart) {
  167. var formatter = chart.options.accessibility.screenReaderSection
  168. .afterChartFormatter;
  169. return formatter ? formatter(chart) :
  170. component.defaultAfterChartFormatter();
  171. },
  172. insertIntoDOM: function (el, chart) {
  173. chart.renderTo.insertBefore(el, chart.container.nextSibling);
  174. }
  175. }
  176. };
  177. },
  178. /**
  179. * Called on chart render. Have to update the sections on render, in order
  180. * to get a11y info from series.
  181. */
  182. onChartRender: function () {
  183. var component = this;
  184. this.linkedDescriptionElement = this.getLinkedDescriptionElement();
  185. this.setLinkedDescriptionAttrs();
  186. Object.keys(this.screenReaderSections).forEach(function (regionKey) {
  187. component.updateScreenReaderSection(regionKey);
  188. });
  189. },
  190. /**
  191. * @private
  192. */
  193. getLinkedDescriptionElement: function () {
  194. var chartOptions = this.chart.options, linkedDescOption = chartOptions.accessibility.linkedDescription;
  195. if (!linkedDescOption) {
  196. return;
  197. }
  198. if (typeof linkedDescOption !== 'string') {
  199. return linkedDescOption;
  200. }
  201. var query = format(linkedDescOption, this.chart), queryMatch = doc.querySelectorAll(query);
  202. if (queryMatch.length === 1) {
  203. return queryMatch[0];
  204. }
  205. },
  206. /**
  207. * @private
  208. */
  209. setLinkedDescriptionAttrs: function () {
  210. var el = this.linkedDescriptionElement;
  211. if (el) {
  212. el.setAttribute('aria-hidden', 'true');
  213. addClass(el, 'highcharts-linked-description');
  214. }
  215. },
  216. /**
  217. * @private
  218. * @param {string} regionKey The name/key of the region to update
  219. */
  220. updateScreenReaderSection: function (regionKey) {
  221. var chart = this.chart, region = this.screenReaderSections[regionKey], content = region.buildContent(chart), sectionDiv = region.element = (region.element || this.createElement('div')), hiddenDiv = (sectionDiv.firstChild || this.createElement('div'));
  222. this.setScreenReaderSectionAttribs(sectionDiv, regionKey);
  223. hiddenDiv.innerHTML = content;
  224. sectionDiv.appendChild(hiddenDiv);
  225. region.insertIntoDOM(sectionDiv, chart);
  226. visuallyHideElement(hiddenDiv);
  227. unhideChartElementFromAT(chart, hiddenDiv);
  228. if (region.afterInserted) {
  229. region.afterInserted();
  230. }
  231. },
  232. /**
  233. * @private
  234. * @param {Highcharts.HTMLDOMElement} sectionDiv The section element
  235. * @param {string} regionKey Name/key of the region we are setting attrs for
  236. */
  237. setScreenReaderSectionAttribs: function (sectionDiv, regionKey) {
  238. var labelLangKey = ('accessibility.screenReaderSection.' + regionKey + 'RegionLabel'), chart = this.chart, labelText = chart.langFormat(labelLangKey, { chart: chart }), sectionId = 'highcharts-screen-reader-region-' + regionKey + '-' +
  239. chart.index;
  240. setElAttrs(sectionDiv, {
  241. id: sectionId,
  242. 'aria-label': labelText
  243. });
  244. // Sections are wrapped to be positioned relatively to chart in case
  245. // elements inside are tabbed to.
  246. sectionDiv.style.position = 'relative';
  247. if (chart.options.accessibility.landmarkVerbosity === 'all' &&
  248. labelText) {
  249. sectionDiv.setAttribute('role', 'region');
  250. }
  251. },
  252. /**
  253. * @private
  254. * @return {string}
  255. */
  256. defaultBeforeChartFormatter: function () {
  257. var _a;
  258. var chart = this.chart, format = chart.options.accessibility
  259. .screenReaderSection.beforeChartFormat, axesDesc = this.getAxesDescription(), shouldHaveSonifyBtn = chart.sonify && ((_a = chart.options.sonification) === null || _a === void 0 ? void 0 : _a.enabled), sonifyButtonId = 'highcharts-a11y-sonify-data-btn-' +
  260. chart.index, dataTableButtonId = 'hc-linkto-highcharts-data-table-' +
  261. chart.index, annotationsList = getAnnotationsInfoHTML(chart), annotationsTitleStr = chart.langFormat('accessibility.screenReaderSection.annotations.heading', { chart: chart }), context = {
  262. chartTitle: getChartTitle(chart),
  263. typeDescription: this.getTypeDescriptionText(),
  264. chartSubtitle: this.getSubtitleText(),
  265. chartLongdesc: this.getLongdescText(),
  266. xAxisDescription: axesDesc.xAxis,
  267. yAxisDescription: axesDesc.yAxis,
  268. playAsSoundButton: shouldHaveSonifyBtn ?
  269. this.getSonifyButtonText(sonifyButtonId) : '',
  270. viewTableButton: chart.getCSV ?
  271. this.getDataTableButtonText(dataTableButtonId) : '',
  272. annotationsTitle: annotationsList ? annotationsTitleStr : '',
  273. annotationsList: annotationsList
  274. }, formattedString = H.i18nFormat(format, context, chart);
  275. this.dataTableButtonId = dataTableButtonId;
  276. this.sonifyButtonId = sonifyButtonId;
  277. return stringToSimpleHTML(formattedString);
  278. },
  279. /**
  280. * @private
  281. * @return {string}
  282. */
  283. defaultAfterChartFormatter: function () {
  284. var chart = this.chart, format = chart.options.accessibility
  285. .screenReaderSection.afterChartFormat, context = {
  286. endOfChartMarker: this.getEndOfChartMarkerText()
  287. }, formattedString = H.i18nFormat(format, context, chart);
  288. return stringToSimpleHTML(formattedString);
  289. },
  290. /**
  291. * @private
  292. * @return {string}
  293. */
  294. getLinkedDescription: function () {
  295. var el = this.linkedDescriptionElement, content = el && el.innerHTML || '';
  296. return stripHTMLTagsFromString(content);
  297. },
  298. /**
  299. * @private
  300. * @return {string}
  301. */
  302. getLongdescText: function () {
  303. var chartOptions = this.chart.options, captionOptions = chartOptions.caption, captionText = captionOptions && captionOptions.text, linkedDescription = this.getLinkedDescription();
  304. return (chartOptions.accessibility.description ||
  305. linkedDescription ||
  306. captionText ||
  307. '');
  308. },
  309. /**
  310. * @private
  311. * @return {string}
  312. */
  313. getTypeDescriptionText: function () {
  314. var chart = this.chart;
  315. return chart.types ?
  316. chart.options.accessibility.typeDescription ||
  317. chart.getTypeDescription(chart.types) : '';
  318. },
  319. /**
  320. * @private
  321. * @param {string} buttonId
  322. * @return {string}
  323. */
  324. getDataTableButtonText: function (buttonId) {
  325. var chart = this.chart, buttonText = chart.langFormat('accessibility.table.viewAsDataTableButtonText', { chart: chart, chartTitle: getChartTitle(chart) });
  326. return '<a id="' + buttonId + '">' + buttonText + '</a>';
  327. },
  328. /**
  329. * @private
  330. * @param {string} buttonId
  331. * @return {string}
  332. */
  333. getSonifyButtonText: function (buttonId) {
  334. var _a;
  335. var chart = this.chart;
  336. if (((_a = chart.options.sonification) === null || _a === void 0 ? void 0 : _a.enabled) === false) {
  337. return '';
  338. }
  339. var buttonText = chart.langFormat('accessibility.sonification.playAsSoundButtonText', { chart: chart, chartTitle: getChartTitle(chart) });
  340. return '<button id="' + buttonId + '">' + buttonText + '</button>';
  341. },
  342. /**
  343. * @private
  344. * @return {string}
  345. */
  346. getSubtitleText: function () {
  347. var subtitle = (this.chart.options.subtitle);
  348. return stripHTMLTagsFromString(subtitle && subtitle.text || '');
  349. },
  350. /**
  351. * @private
  352. * @return {string}
  353. */
  354. getEndOfChartMarkerText: function () {
  355. var chart = this.chart, markerText = chart.langFormat('accessibility.screenReaderSection.endOfChartMarker', { chart: chart }), id = 'highcharts-end-of-chart-marker-' + chart.index;
  356. return '<div id="' + id + '">' + markerText + '</div>';
  357. },
  358. /**
  359. * @private
  360. * @param {Highcharts.Dictionary<string>} e
  361. */
  362. onDataTableCreated: function (e) {
  363. var chart = this.chart;
  364. if (chart.options.accessibility.enabled) {
  365. if (this.viewDataTableButton) {
  366. this.viewDataTableButton.setAttribute('aria-expanded', 'true');
  367. }
  368. e.html = e.html.replace('<table ', '<table tabindex="-1" summary="' + getTableSummary(chart) + '"');
  369. }
  370. },
  371. /**
  372. * @private
  373. */
  374. focusDataTable: function () {
  375. var tableDiv = this.dataTableDiv, table = tableDiv && tableDiv.getElementsByTagName('table')[0];
  376. if (table && table.focus) {
  377. table.focus();
  378. }
  379. },
  380. /**
  381. * @private
  382. * @param {string} sonifyButtonId
  383. */
  384. initSonifyButton: function (sonifyButtonId) {
  385. var _this = this;
  386. var el = this.sonifyButton = getElement(sonifyButtonId);
  387. var chart = this.chart;
  388. var defaultHandler = function (e) {
  389. el === null || el === void 0 ? void 0 : el.setAttribute('aria-hidden', 'true');
  390. el === null || el === void 0 ? void 0 : el.setAttribute('aria-label', '');
  391. e.preventDefault();
  392. e.stopPropagation();
  393. var announceMsg = chart.langFormat('accessibility.sonification.playAsSoundClickAnnouncement', { chart: chart });
  394. _this.announcer.announce(announceMsg);
  395. setTimeout(function () {
  396. el === null || el === void 0 ? void 0 : el.removeAttribute('aria-hidden');
  397. el === null || el === void 0 ? void 0 : el.removeAttribute('aria-label');
  398. if (chart.sonify) {
  399. chart.sonify();
  400. }
  401. }, 1000); // Delay to let screen reader speak the button press
  402. };
  403. if (el && chart) {
  404. setElAttrs(el, {
  405. tabindex: '-1'
  406. });
  407. el.onclick = function (e) {
  408. var _a;
  409. var onPlayAsSoundClick = (_a = chart.options.accessibility) === null || _a === void 0 ? void 0 : _a.screenReaderSection.onPlayAsSoundClick;
  410. (onPlayAsSoundClick || defaultHandler).call(this, e, chart);
  411. };
  412. }
  413. },
  414. /**
  415. * Set attribs and handlers for default viewAsDataTable button if exists.
  416. * @private
  417. * @param {string} tableButtonId
  418. */
  419. initDataTableButton: function (tableButtonId) {
  420. var el = this.viewDataTableButton = getElement(tableButtonId), chart = this.chart, tableId = tableButtonId.replace('hc-linkto-', '');
  421. if (el) {
  422. setElAttrs(el, {
  423. role: 'button',
  424. tabindex: '-1',
  425. 'aria-expanded': !!getElement(tableId),
  426. href: '#' + tableId
  427. });
  428. el.onclick = chart.options.accessibility
  429. .screenReaderSection.onViewDataTableClick ||
  430. function () {
  431. chart.viewData();
  432. };
  433. }
  434. },
  435. /**
  436. * Return object with text description of each of the chart's axes.
  437. * @private
  438. * @return {Highcharts.Dictionary<string>}
  439. */
  440. getAxesDescription: function () {
  441. var chart = this.chart, shouldDescribeColl = function (collectionKey, defaultCondition) {
  442. var axes = chart[collectionKey];
  443. return axes.length > 1 || axes[0] &&
  444. pick(axes[0].options.accessibility &&
  445. axes[0].options.accessibility.enabled, defaultCondition);
  446. }, hasNoMap = !!chart.types && chart.types.indexOf('map') < 0, hasCartesian = !!chart.hasCartesianSeries, showXAxes = shouldDescribeColl('xAxis', !chart.angular && hasCartesian && hasNoMap), showYAxes = shouldDescribeColl('yAxis', hasCartesian && hasNoMap), desc = {};
  447. if (showXAxes) {
  448. desc.xAxis = this.getAxisDescriptionText('xAxis');
  449. }
  450. if (showYAxes) {
  451. desc.yAxis = this.getAxisDescriptionText('yAxis');
  452. }
  453. return desc;
  454. },
  455. /**
  456. * @private
  457. * @param {string} collectionKey
  458. * @return {string}
  459. */
  460. getAxisDescriptionText: function (collectionKey) {
  461. var component = this, chart = this.chart, axes = chart[collectionKey];
  462. return chart.langFormat('accessibility.axis.' + collectionKey + 'Description' + (axes.length > 1 ? 'Plural' : 'Singular'), {
  463. chart: chart,
  464. names: axes.map(function (axis) {
  465. return getAxisDescription(axis);
  466. }),
  467. ranges: axes.map(function (axis) {
  468. return component.getAxisRangeDescription(axis);
  469. }),
  470. numAxes: axes.length
  471. });
  472. },
  473. /**
  474. * Return string with text description of the axis range.
  475. * @private
  476. * @param {Highcharts.Axis} axis The axis to get range desc of.
  477. * @return {string} A string with the range description for the axis.
  478. */
  479. getAxisRangeDescription: function (axis) {
  480. var axisOptions = axis.options || {};
  481. // Handle overridden range description
  482. if (axisOptions.accessibility &&
  483. typeof axisOptions.accessibility.rangeDescription !== 'undefined') {
  484. return axisOptions.accessibility.rangeDescription;
  485. }
  486. // Handle category axes
  487. if (axis.categories) {
  488. return this.getCategoryAxisRangeDesc(axis);
  489. }
  490. // Use time range, not from-to?
  491. if (axis.dateTime && (axis.min === 0 || axis.dataMin === 0)) {
  492. return this.getAxisTimeLengthDesc(axis);
  493. }
  494. // Just use from and to.
  495. // We have the range and the unit to use, find the desc format
  496. return this.getAxisFromToDescription(axis);
  497. },
  498. /**
  499. * @private
  500. * @param {Highcharts.Axis} axis
  501. * @return {string}
  502. */
  503. getCategoryAxisRangeDesc: function (axis) {
  504. var chart = this.chart;
  505. if (axis.dataMax && axis.dataMin) {
  506. return chart.langFormat('accessibility.axis.rangeCategories', {
  507. chart: chart,
  508. axis: axis,
  509. numCategories: axis.dataMax - axis.dataMin + 1
  510. });
  511. }
  512. return '';
  513. },
  514. /**
  515. * @private
  516. * @param {Highcharts.Axis} axis
  517. * @return {string}
  518. */
  519. getAxisTimeLengthDesc: function (axis) {
  520. var chart = this.chart, range = {}, rangeUnit = 'Seconds';
  521. range.Seconds = ((axis.max || 0) - (axis.min || 0)) / 1000;
  522. range.Minutes = range.Seconds / 60;
  523. range.Hours = range.Minutes / 60;
  524. range.Days = range.Hours / 24;
  525. ['Minutes', 'Hours', 'Days'].forEach(function (unit) {
  526. if (range[unit] > 2) {
  527. rangeUnit = unit;
  528. }
  529. });
  530. var rangeValue = range[rangeUnit].toFixed(rangeUnit !== 'Seconds' &&
  531. rangeUnit !== 'Minutes' ? 1 : 0 // Use decimals for days/hours
  532. );
  533. // We have the range and the unit to use, find the desc format
  534. return chart.langFormat('accessibility.axis.timeRange' + rangeUnit, {
  535. chart: chart,
  536. axis: axis,
  537. range: rangeValue.replace('.0', '')
  538. });
  539. },
  540. /**
  541. * @private
  542. * @param {Highcharts.Axis} axis
  543. * @return {string}
  544. */
  545. getAxisFromToDescription: function (axis) {
  546. var chart = this.chart, dateRangeFormat = chart.options.accessibility
  547. .screenReaderSection.axisRangeDateFormat, format = function (axisKey) {
  548. return axis.dateTime ? chart.time.dateFormat(dateRangeFormat, axis[axisKey]) : axis[axisKey];
  549. };
  550. return chart.langFormat('accessibility.axis.rangeFromTo', {
  551. chart: chart,
  552. axis: axis,
  553. rangeFrom: format('min'),
  554. rangeTo: format('max')
  555. });
  556. },
  557. /**
  558. * Remove component traces
  559. */
  560. destroy: function () {
  561. var _a;
  562. (_a = this.announcer) === null || _a === void 0 ? void 0 : _a.destroy();
  563. }
  564. });
  565. export default InfoRegionsComponent;