5d48aaf93fcea774067ca0f59378fbd945164e3f04cd7a62c96935517ae1a80da07e67c9e5536e68f4d49b83d48c93e88b78b0886901b6df1eccec8d47f3ce 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. import * as zrUtil from 'zrender/lib/core/util.js';
  2. import { encodeHTML } from 'zrender/lib/core/dom.js';
  3. import { TooltipRenderMode, ColorString, ZRColor, DimensionType } from './types.js';
  4. import { Dictionary } from 'zrender/lib/core/types.js';
  5. /**
  6. * Add a comma each three digit.
  7. */
  8. export declare function addCommas(x: string | number): string;
  9. export declare function toCamelCase(str: string, upperCaseFirst?: boolean): string;
  10. export declare const normalizeCssArray: typeof zrUtil.normalizeCssArray;
  11. export { encodeHTML };
  12. /**
  13. * Make value user readable for tooltip and label.
  14. * "User readable":
  15. * Try to not print programmer-specific text like NaN, Infinity, null, undefined.
  16. * Avoid to display an empty string, which users can not recognize there is
  17. * a value and it might look like a bug.
  18. */
  19. export declare function makeValueReadable(value: unknown, valueType: DimensionType, useUTC: boolean): string;
  20. export interface TplFormatterParam extends Dictionary<any> {
  21. $vars: string[];
  22. }
  23. /**
  24. * Template formatter
  25. * @param {Array.<Object>|Object} paramsList
  26. */
  27. export declare function formatTpl(tpl: string, paramsList: TplFormatterParam | TplFormatterParam[], encode?: boolean): string;
  28. /**
  29. * simple Template formatter
  30. */
  31. export declare function formatTplSimple(tpl: string, param: Dictionary<any>, encode?: boolean): string;
  32. interface RichTextTooltipMarker {
  33. renderMode: TooltipRenderMode;
  34. content: string;
  35. style: Dictionary<unknown>;
  36. }
  37. export declare type TooltipMarker = string | RichTextTooltipMarker;
  38. export declare type TooltipMarkerType = 'item' | 'subItem';
  39. interface GetTooltipMarkerOpt {
  40. color?: ColorString;
  41. extraCssText?: string;
  42. type?: TooltipMarkerType;
  43. renderMode?: TooltipRenderMode;
  44. markerId?: string;
  45. }
  46. export declare function getTooltipMarker(color: ColorString, extraCssText?: string): TooltipMarker;
  47. export declare function getTooltipMarker(opt: GetTooltipMarkerOpt): TooltipMarker;
  48. /**
  49. * @deprecated Use `time/format` instead.
  50. * ISO Date format
  51. * @param {string} tpl
  52. * @param {number} value
  53. * @param {boolean} [isUTC=false] Default in local time.
  54. * see `module:echarts/scale/Time`
  55. * and `module:echarts/util/number#parseDate`.
  56. * @inner
  57. */
  58. export declare function formatTime(tpl: string, value: unknown, isUTC?: boolean): string;
  59. /**
  60. * Capital first
  61. * @param {string} str
  62. * @return {string}
  63. */
  64. export declare function capitalFirst(str: string): string;
  65. /**
  66. * @return Never be null/undefined.
  67. */
  68. export declare function convertToColorString(color: ZRColor, defaultColor?: ColorString): ColorString;
  69. export { truncateText } from 'zrender/lib/graphic/helper/parseText.js';
  70. /**
  71. * open new tab
  72. * @param link url
  73. * @param target blank or self
  74. */
  75. export declare function windowOpen(link: string, target: string): void;
  76. export { getTextRect } from '../legacy/getTextRect.js';