@office-open/docx 0.6.10 → 0.7.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.
package/dist/index.mjs CHANGED
@@ -3056,20 +3056,20 @@ var init_image_run = __esmMin((() => {
3056
3056
  var init_chart_space = __esmMin((() => {}));
3057
3057
  //#endregion
3058
3058
  //#region src/file/paragraph/run/chart-run.ts
3059
- var ChartRun;
3059
+ var nextChartId, ChartRun;
3060
3060
  var init_chart_run = __esmMin((() => {
3061
3061
  init_chart_space();
3062
3062
  init_drawing();
3063
3063
  init_media();
3064
3064
  init_run();
3065
+ nextChartId = 1;
3065
3066
  ChartRun = class extends Run {
3066
3067
  chartOptions;
3067
3068
  chartKey;
3068
3069
  constructor(options) {
3069
3070
  super({});
3070
3071
  this.chartOptions = options;
3071
- const hash = this.hashChartData(options);
3072
- this.chartKey = `chart_${hash}`;
3072
+ this.chartKey = `chart_${nextChartId++}`;
3073
3073
  const drawing = new Drawing({
3074
3074
  chartKey: this.chartKey,
3075
3075
  transformation: createTransformation(options.transformation),
@@ -3087,7 +3087,8 @@ var init_chart_run = __esmMin((() => {
3087
3087
  showLegend: this.chartOptions.showLegend,
3088
3088
  style: this.chartOptions.style,
3089
3089
  title: this.chartOptions.title,
3090
- type: this.chartOptions.type
3090
+ type: this.chartOptions.type,
3091
+ threeD: this.chartOptions.threeD
3091
3092
  });
3092
3093
  context.file.charts.addChart(this.chartKey, {
3093
3094
  chartSpace,
@@ -3095,15 +3096,6 @@ var init_chart_run = __esmMin((() => {
3095
3096
  });
3096
3097
  return super.prepForXml(context);
3097
3098
  }
3098
- hashChartData(options) {
3099
- const data = `${options.type}:${JSON.stringify(options.data)}`;
3100
- let hash = 0;
3101
- for (let i = 0; i < data.length; i++) {
3102
- const char = data.charCodeAt(i);
3103
- hash = (hash << 5) - hash + char | 0;
3104
- }
3105
- return Math.abs(hash);
3106
- }
3107
3099
  };
3108
3100
  }));
3109
3101
  //#endregion