@univerjs-pro/engine-chart 1.0.0-alpha.6 → 1.0.0-alpha.8

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 (93) hide show
  1. package/lib/cjs/facade.js +1 -1
  2. package/lib/cjs/index.js +1 -1
  3. package/lib/es/facade.js +1 -1
  4. package/lib/es/index.js +1 -1
  5. package/lib/facade.js +1 -1
  6. package/lib/index.js +1 -1
  7. package/lib/types/chart-builder/candlestick-inline-table.d.ts +4 -0
  8. package/lib/types/chart-builder/chart-builder-adapter.d.ts +3 -3
  9. package/lib/types/chart-builder/chart-builder.d.ts +3 -3
  10. package/lib/types/chart-builder/chart-color.d.ts +49 -0
  11. package/lib/types/chart-builder/chart-starter-data.d.ts +3 -0
  12. package/lib/types/chart-builder/chart-types.d.ts +109 -68
  13. package/lib/types/chart-builder/configuration/assertions.d.ts +3 -0
  14. package/lib/types/chart-builder/configuration/auto-gradient-fill.d.ts +4 -0
  15. package/lib/types/chart-builder/configuration/candlestick.d.ts +9 -0
  16. package/lib/types/chart-builder/configuration/chart-config-operation.d.ts +4 -0
  17. package/lib/types/chart-builder/configuration/histogram.d.ts +11 -0
  18. package/lib/types/chart-builder/configuration/index.d.ts +5 -0
  19. package/lib/types/chart-builder/configuration/pie.d.ts +5 -1
  20. package/lib/types/chart-builder/configuration/point-mapping.d.ts +3 -0
  21. package/lib/types/chart-builder/configuration/treemap.d.ts +8 -0
  22. package/lib/types/chart-builder/conversion/chart-config-converter.d.ts +8 -3
  23. package/lib/types/chart-builder/conversion/chart-context-patch.d.ts +5 -0
  24. package/lib/types/chart-builder/conversion/chart-model-fields.d.ts +6 -0
  25. package/lib/types/chart-builder/conversion/resolve-chart-model-data.d.ts +3 -3
  26. package/lib/types/chart-builder/index.d.ts +5 -0
  27. package/lib/types/chart-builder/internal/host-builder-runtime.d.ts +0 -2
  28. package/lib/types/chart-text-measure-canvas.d.ts +6 -0
  29. package/lib/types/enum.d.ts +34 -1
  30. package/lib/types/facade/builders/f-area-chart-builder.d.ts +2 -2
  31. package/lib/types/facade/builders/f-boxplot-chart-builder.d.ts +5 -0
  32. package/lib/types/facade/builders/f-bubble-chart-builder.d.ts +2 -2
  33. package/lib/types/facade/builders/f-candlestick-chart-builder.d.ts +133 -0
  34. package/lib/types/facade/builders/f-histogram-chart-builder.d.ts +74 -0
  35. package/lib/types/facade/builders/f-line-chart-builder.d.ts +2 -2
  36. package/lib/types/facade/builders/f-pie-chart-builder.d.ts +42 -1
  37. package/lib/types/facade/builders/f-relation-chart-builder.d.ts +38 -0
  38. package/lib/types/facade/builders/f-scatter-chart-builder.d.ts +2 -2
  39. package/lib/types/facade/builders/f-treemap-chart-builder.d.ts +34 -0
  40. package/lib/types/facade/builders/index.d.ts +4 -0
  41. package/lib/types/facade/chart-builder-type-map.d.ts +5 -2
  42. package/lib/types/facade/f-cartesian-chart-builder.d.ts +14 -4
  43. package/lib/types/facade/f-chart-base.d.ts +2 -2
  44. package/lib/types/facade/f-chart-builder-base.d.ts +31 -0
  45. package/lib/types/index.d.ts +10 -9
  46. package/lib/types/models/chart-data-operators/histogram-data.d.ts +10 -0
  47. package/lib/types/models/chart-data-operators/index.d.ts +1 -0
  48. package/lib/types/models/chart-data-operators/operators.d.ts +7 -1
  49. package/lib/types/models/chart-data-operators/treemap-data.d.ts +3 -0
  50. package/lib/types/models/chart-element-edit-overlay/chart-element-edit-overlay.d.ts +2 -1
  51. package/lib/types/models/chart-locale-texts.d.ts +15 -1
  52. package/lib/types/models/chart-model.d.ts +368 -164
  53. package/lib/types/models/constants/default-chart-style.d.ts +45 -0
  54. package/lib/types/models/constants/histogram-defaults.d.ts +4 -0
  55. package/lib/types/models/constants/treemap.d.ts +1 -0
  56. package/lib/types/models/data-context-transformers/candlestick-data-context-transformer.d.ts +4 -0
  57. package/lib/types/models/data-context-transformers/histogram-data-context-transformer.d.ts +7 -0
  58. package/lib/types/models/data-context-transformers/treemap-data-context-transformer.d.ts +11 -0
  59. package/lib/types/models/echart-render-model.d.ts +10 -7
  60. package/lib/types/models/echart-to-chart-model-init.d.ts +2 -1
  61. package/lib/types/models/mode-converter/converters/boxplot-chart-converter.d.ts +3 -2
  62. package/lib/types/models/mode-converter/converters/bubble-chart-converter.d.ts +3 -2
  63. package/lib/types/models/mode-converter/converters/candlestick-chart-converter.d.ts +5 -0
  64. package/lib/types/models/mode-converter/converters/combination-chart-converter.d.ts +3 -2
  65. package/lib/types/models/mode-converter/converters/funnel-chart-converter.d.ts +3 -2
  66. package/lib/types/models/mode-converter/converters/heatmap-chart-convert.d.ts +3 -2
  67. package/lib/types/models/mode-converter/converters/histogram-chart-converter.d.ts +4 -0
  68. package/lib/types/models/mode-converter/converters/pareto-chart-converter.d.ts +3 -2
  69. package/lib/types/models/mode-converter/converters/pie-chart-converter.d.ts +3 -2
  70. package/lib/types/models/mode-converter/converters/radar-chart-converter.d.ts +3 -2
  71. package/lib/types/models/mode-converter/converters/relation-chart-converter.d.ts +3 -2
  72. package/lib/types/models/mode-converter/converters/sankey-chart-converter.d.ts +3 -2
  73. package/lib/types/models/mode-converter/converters/scatter-chart-converter.d.ts +3 -2
  74. package/lib/types/models/mode-converter/converters/treemap-chart-converter.d.ts +4 -0
  75. package/lib/types/models/mode-converter/converters/waterfall-chart-converter.d.ts +3 -2
  76. package/lib/types/models/mode-converter/converters/word-cloud-converter.d.ts +3 -2
  77. package/lib/types/models/mode-converter/render-spec-operators/auto-gradient-presets.d.ts +5 -0
  78. package/lib/types/models/mode-converter/render-spec-operators/chart-color.d.ts +23 -0
  79. package/lib/types/models/mode-converter/render-spec-operators/rich-text-inheritance.operator.d.ts +2 -0
  80. package/lib/types/models/mode-converter/render-spec-operators/tool-tip-operator.d.ts +8 -2
  81. package/lib/types/models/mode-converter/render-spec-operators/tools.d.ts +3 -2
  82. package/lib/types/types.d.ts +147 -13
  83. package/lib/types/util.d.ts +1 -7
  84. package/lib/types/wordcloud-chart/canvas.d.ts +3 -3
  85. package/lib/types/wordcloud-chart/core/layout/word-shrink.d.ts +5 -8
  86. package/lib/types/wordcloud-chart/core/text/formatter.d.ts +2 -2
  87. package/lib/types/wordcloud-chart/core/text/normalize.d.ts +2 -2
  88. package/lib/types/wordcloud-chart/defaults.d.ts +2 -2
  89. package/lib/types/wordcloud-chart/index.d.ts +1 -1
  90. package/lib/types/wordcloud-chart/types.d.ts +0 -3
  91. package/lib/umd/facade.js +1 -1
  92. package/lib/umd/index.js +1 -1
  93. package/package.json +5 -5
@@ -0,0 +1,10 @@
1
+ import type { IChartHistogramBin, IChartHistogramDataSpec } from '../../types';
2
+ export declare const MAX_HISTOGRAM_BIN_COUNT = 1000;
3
+ export interface IBuildHistogramBinsResult {
4
+ bins: IChartHistogramBin[];
5
+ sampleCount: number;
6
+ }
7
+ /** Builds deterministic numeric bins without renderer strings or persisted derived values. */
8
+ export declare function buildHistogramBins(values: readonly unknown[], spec?: IChartHistogramDataSpec): IBuildHistogramBinsResult;
9
+ /** Stable two-pass sample standard deviation using denominator n - 1. */
10
+ export declare function sampleStandardDeviation(samples: readonly number[]): number;
@@ -1,2 +1,3 @@
1
1
  export * from './build-chart-data';
2
2
  export * from './operators';
3
+ export * from './treemap-data';
@@ -1,6 +1,10 @@
1
- import type { IChartContext, IChartDataSource, OptionDataValue } from '../../types';
1
+ import type { IChartCandlestickMappingSpec, IChartContext, IChartDataSource, OptionDataValue } from '../../types';
2
2
  import type { ChartModel } from '../chart-model';
3
3
  import { ChartSourceDataTypeEnum } from '../../enum';
4
+ export interface IResolvedCandlestickMapping {
5
+ categoryIndex: number;
6
+ candlestick: IChartCandlestickMappingSpec;
7
+ }
4
8
  export type IChartContextOperator = (dataSource: IChartDataSource, context: IChartContext, model: ChartModel) => IChartContext;
5
9
  type Nil = null | undefined;
6
10
  export declare function isNil(value: any): value is Nil;
@@ -11,6 +15,8 @@ export declare function countTypesFromArray(arrayData: Array<OptionDataValue | u
11
15
  };
12
16
  export declare function toColumnOrient<T = any>(dataSource: T[][]): T[][];
13
17
  export declare function findCategoryIndexes(dataSource: IChartDataSource): number[];
18
+ /** Resolves Category and OHLC roles without inspecting headers or locale text. */
19
+ export declare function resolveCandlestickMapping(dataSource: IChartDataSource, context: IChartContext): IResolvedCandlestickMapping | undefined;
14
20
  export declare const findHeaderOperator: IChartContextOperator;
15
21
  export declare const findCategoryOperator: IChartContextOperator;
16
22
  export declare const findSeriesOperator: IChartContextOperator;
@@ -0,0 +1,3 @@
1
+ import type { IChartContext, IChartTreemapData, IUniverDataSet } from '../../types';
2
+ /** Builds a deterministic semantic tree from orientation-normalized field vectors. */
3
+ export declare function buildTreemapData(dataSource: IUniverDataSet, context: IChartContext): IChartTreemapData;
@@ -1,4 +1,5 @@
1
1
  import type { IChartElementBounds, IChartElementHit } from '../../types';
2
+ import type { ECharts } from '../../utils/echarts';
2
3
  import type { ChartElementEditBorderType, IChartElementEditOverlayPalette } from './types';
3
4
  export declare class ChartElementEditOverlay {
4
5
  private readonly _getInstance;
@@ -11,7 +12,7 @@ export declare class ChartElementEditOverlay {
11
12
  private _hoverBorderHitKey;
12
13
  private _fixedBorder;
13
14
  private _fixedBorderBounds;
14
- constructor(_getInstance: () => echarts.ECharts | null, _getContainer?: () => HTMLElement | null | undefined, _paletteOverride?: Partial<IChartElementEditOverlayPalette> | undefined);
15
+ constructor(_getInstance: () => ECharts | null, _getContainer?: () => HTMLElement | null | undefined, _paletteOverride?: Partial<IChartElementEditOverlayPalette> | undefined);
15
16
  ensure(): any;
16
17
  remove(): void;
17
18
  clearAll(): void;
@@ -17,6 +17,20 @@ export interface IChartLocaleTexts {
17
17
  waterfallPositive: string;
18
18
  waterfallNegative: string;
19
19
  waterfallSubtotal: string;
20
+ candlestickSeries?: string;
21
+ candlestickCategory?: string;
22
+ candlestickOpen?: string;
23
+ candlestickHigh?: string;
24
+ candlestickLow?: string;
25
+ candlestickClose?: string;
26
+ histogramFrequency?: string;
27
+ treemapEmptyTips?: string;
28
+ treemapHierarchy?: string;
29
+ treemapValue?: string;
30
+ treemapOwnValue?: string;
31
+ treemapChildren?: string;
20
32
  }
21
33
  export declare function replaceLocaleParams(text: string, ...args: string[]): string;
22
- export declare function getDefaultChartLocaleTexts(): IChartLocaleTexts;
34
+ export declare function getDefaultChartLocaleTexts(): Required<IChartLocaleTexts>;
35
+ /** Resolves host locale keys over the engine defaults without leaking missing-key placeholders. */
36
+ export declare function resolveChartLocaleTexts(resolveText: (localeKey: string) => string, localeKeys: Partial<Record<keyof IChartLocaleTexts, string>>): Required<IChartLocaleTexts>;