@bizy/core 20.9.0 → 20.9.1

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.
@@ -5094,6 +5094,8 @@ class BizyHeatMapChartComponent {
5094
5094
  tooltip = DEFAULT_TOOLTIP$1;
5095
5095
  download = DEFAULT_DOWNLOAD$1;
5096
5096
  ranges = [];
5097
+ highlightAreas = [];
5098
+ highlightLines = [];
5097
5099
  xAxis = DEFAULT_X_AXIS;
5098
5100
  yAxis = DEFAULT_Y_AXIS;
5099
5101
  onDownload = new EventEmitter();
@@ -5130,6 +5132,7 @@ class BizyHeatMapChartComponent {
5130
5132
  }
5131
5133
  const series = [{
5132
5134
  type: 'heatmap',
5135
+ zlevel: 1,
5133
5136
  data: this.#data.map(_cell => {
5134
5137
  return {
5135
5138
  value: [_cell.x, _cell.y, _cell.value ?? '-'],
@@ -5137,6 +5140,196 @@ class BizyHeatMapChartComponent {
5137
5140
  };
5138
5141
  })
5139
5142
  }];
5143
+ const xAreaBackgroundColor = this.#getClosestCssVariable(this.#elementRef.nativeElement, '--bizy-heat-map-chart-x-highlight-area-background-color');
5144
+ const xAreaBorderColor = this.#getClosestCssVariable(this.#elementRef.nativeElement, '--bizy-heat-map-chart-x-highlight-area-border-color');
5145
+ const yAreaBackgroundColor = this.#getClosestCssVariable(this.#elementRef.nativeElement, '--bizy-heat-map-chart-y-highlight-area-background-color');
5146
+ const yAreaBorderColor = this.#getClosestCssVariable(this.#elementRef.nativeElement, '--bizy-heat-map-chart-y-highlight-area-border-color');
5147
+ const xAreas = [];
5148
+ const yAreas = [];
5149
+ const highlightAreas = this.highlightAreas.data ?? this.highlightAreas;
5150
+ highlightAreas.forEach(_area => {
5151
+ if (typeof _area.from.x !== 'undefined' || _area.from.x !== null) {
5152
+ xAreas.push([_area.from.x, _area.to.x]);
5153
+ }
5154
+ else {
5155
+ yAreas.push([_area.from.y, _area.to.y]);
5156
+ }
5157
+ });
5158
+ if (xAreas.length > 0) {
5159
+ series.push({
5160
+ type: 'custom',
5161
+ silent: true,
5162
+ renderItem: function (params, api) {
5163
+ var xStart = api.coord([api.value(0), 0])[0];
5164
+ var xEnd = api.coord([api.value(1), 0])[0];
5165
+ var cellWidth = Math.abs(xEnd - xStart) / (api.value(1) - api.value(0));
5166
+ return {
5167
+ type: 'rect',
5168
+ shape: {
5169
+ x: xStart - cellWidth / 2,
5170
+ y: params.coordSys.y,
5171
+ width: Math.abs(xEnd - xStart) + cellWidth,
5172
+ height: params.coordSys.height
5173
+ },
5174
+ style: {
5175
+ fill: xAreaBackgroundColor,
5176
+ stroke: xAreaBorderColor,
5177
+ lineWidth: 0.5
5178
+ },
5179
+ silent: true,
5180
+ z2: 100
5181
+ };
5182
+ },
5183
+ data: xAreas,
5184
+ zlevel: 5
5185
+ });
5186
+ }
5187
+ ;
5188
+ if (yAreas.length > 0) {
5189
+ series.push({
5190
+ type: 'custom',
5191
+ silent: true,
5192
+ renderItem: function (params, api) {
5193
+ var yStart = api.coord([0, api.value(0)])[1];
5194
+ var yEnd = api.coord([0, api.value(1)])[1];
5195
+ var cellHeight = Math.abs(yEnd - yStart) / (api.value(1) - api.value(0));
5196
+ return {
5197
+ type: 'rect',
5198
+ shape: {
5199
+ x: params.coordSys.x,
5200
+ y: yStart - cellHeight / 2,
5201
+ width: params.coordSys.width,
5202
+ height: Math.abs(yEnd - yStart) + cellHeight
5203
+ },
5204
+ style: {
5205
+ fill: yAreaBackgroundColor,
5206
+ stroke: yAreaBorderColor,
5207
+ lineWidth: 0.5
5208
+ },
5209
+ silent: true,
5210
+ z2: 100
5211
+ };
5212
+ },
5213
+ data: yAreas,
5214
+ zlevel: 5
5215
+ });
5216
+ }
5217
+ const xLineColor = this.#getClosestCssVariable(this.#elementRef.nativeElement, '--bizy-heat-map-chart-x-highlight-line-color');
5218
+ const xLineLabelColor = this.#getClosestCssVariable(this.#elementRef.nativeElement, '--bizy-heat-map-chart-x-highlight-line-label-color');
5219
+ const yLineColor = this.#getClosestCssVariable(this.#elementRef.nativeElement, '--bizy-heat-map-chart-y-highlight-line-color');
5220
+ const yLineLabelColor = this.#getClosestCssVariable(this.#elementRef.nativeElement, '--bizy-heat-map-chart-y-highlight-line-label-color');
5221
+ const xLines = [];
5222
+ const yLines = [];
5223
+ const highlightLineLabel = this.highlightLines?.label ?? null;
5224
+ const highlightLines = this.highlightLines.data ?? this.highlightLines;
5225
+ highlightLines.forEach(_line => {
5226
+ if (typeof _line.x !== 'undefined' || _line.x !== null) {
5227
+ xLines.push([_line.x]);
5228
+ }
5229
+ else {
5230
+ yLines.push([_line.y]);
5231
+ }
5232
+ });
5233
+ if (xLines.length > 0) {
5234
+ series.push({
5235
+ type: 'custom',
5236
+ renderItem: function (params, api) {
5237
+ const xValue = api.value(0);
5238
+ const yStart = params.coordSys.y;
5239
+ const yEnd = params.coordSys.y + params.coordSys.height;
5240
+ const xCoord = api.coord([xValue, 0])[0];
5241
+ const children = [{
5242
+ type: 'line',
5243
+ shape: {
5244
+ x1: xCoord,
5245
+ y1: yStart,
5246
+ x2: xCoord,
5247
+ y2: yEnd
5248
+ },
5249
+ style: {
5250
+ stroke: xLineColor,
5251
+ lineWidth: 1
5252
+ },
5253
+ z: 100
5254
+ }];
5255
+ if (highlightLineLabel && highlightLineLabel.x) {
5256
+ const top = yStart - 5;
5257
+ const bottom = yEnd + 20;
5258
+ const label = {
5259
+ type: 'text',
5260
+ style: {
5261
+ text: highlightLineLabel.x.formatter ? highlightLineLabel.x.formatter(xValue) : xValue,
5262
+ x: xCoord,
5263
+ y: highlightLineLabel.x.position === 'top' ? top : highlightLineLabel.x.position === 'bottom' ? bottom : bottom,
5264
+ fill: xLineLabelColor,
5265
+ textAlign: 'center',
5266
+ textVerticalAlign: 'bottom'
5267
+ },
5268
+ z: 101
5269
+ };
5270
+ children.push(label);
5271
+ }
5272
+ return {
5273
+ type: 'group',
5274
+ children
5275
+ };
5276
+ },
5277
+ data: xLines,
5278
+ silent: true,
5279
+ zlevel: 10
5280
+ });
5281
+ }
5282
+ ;
5283
+ if (yLines.length > 0) {
5284
+ series.push({
5285
+ type: 'custom',
5286
+ renderItem: function (params, api) {
5287
+ const yValue = api.value(0);
5288
+ const yCoord = api.coord([0, yValue])[1];
5289
+ const xStart = params.coordSys.x;
5290
+ const xEnd = params.coordSys.x + params.coordSys.width;
5291
+ const children = [{
5292
+ type: 'line',
5293
+ shape: {
5294
+ x1: xStart,
5295
+ y1: yCoord,
5296
+ x2: xEnd,
5297
+ y2: yCoord
5298
+ },
5299
+ style: {
5300
+ stroke: yLineColor,
5301
+ lineWidth: 1
5302
+ },
5303
+ z: 100
5304
+ }];
5305
+ if (highlightLineLabel && highlightLineLabel.y) {
5306
+ const left = xStart - 5;
5307
+ const right = xEnd + 20;
5308
+ const label = {
5309
+ type: 'text',
5310
+ style: {
5311
+ text: highlightLineLabel.y.formatter ? highlightLineLabel.y.formatter(yValue) : yValue,
5312
+ x: yCoord,
5313
+ y: highlightLineLabel.y.position === 'left' ? left : highlightLineLabel.y.position === 'right' ? right : right,
5314
+ fill: yLineLabelColor,
5315
+ textAlign: 'right',
5316
+ textVerticalAlign: 'middle'
5317
+ },
5318
+ z: 101
5319
+ };
5320
+ children.push(label);
5321
+ }
5322
+ return {
5323
+ type: 'group',
5324
+ children
5325
+ };
5326
+ },
5327
+ data: yLines,
5328
+ silent: true,
5329
+ zlevel: 10
5330
+ });
5331
+ }
5332
+ ;
5140
5333
  const tooltip = {
5141
5334
  show: this.tooltip?.show ?? DEFAULT_TOOLTIP$1.show,
5142
5335
  trigger: 'item',
@@ -5324,7 +5517,7 @@ class BizyHeatMapChartComponent {
5324
5517
  }
5325
5518
  }
5326
5519
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: BizyHeatMapChartComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
5327
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.0.5", type: BizyHeatMapChartComponent, isStandalone: true, selector: "bizy-heat-map-chart", inputs: { resizeRef: "resizeRef", tooltip: "tooltip", download: "download", ranges: "ranges", xAxis: "xAxis", yAxis: "yAxis", data: "data" }, outputs: { onDownload: "onDownload", onSelect: "onSelect" }, ngImport: i0, template: '', isInline: true, styles: [":host{display:flex;justify-content:center}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
5520
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.0.5", type: BizyHeatMapChartComponent, isStandalone: true, selector: "bizy-heat-map-chart", inputs: { resizeRef: "resizeRef", tooltip: "tooltip", download: "download", ranges: "ranges", highlightAreas: "highlightAreas", highlightLines: "highlightLines", xAxis: "xAxis", yAxis: "yAxis", data: "data" }, outputs: { onDownload: "onDownload", onSelect: "onSelect" }, ngImport: i0, template: '', isInline: true, styles: [":host{display:flex;justify-content:center}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
5328
5521
  }
5329
5522
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: BizyHeatMapChartComponent, decorators: [{
5330
5523
  type: Component,
@@ -5337,6 +5530,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.5", ngImpor
5337
5530
  type: Input
5338
5531
  }], ranges: [{
5339
5532
  type: Input
5533
+ }], highlightAreas: [{
5534
+ type: Input
5535
+ }], highlightLines: [{
5536
+ type: Input
5340
5537
  }], xAxis: [{
5341
5538
  type: Input
5342
5539
  }], yAxis: [{