@visionaris-bruno/vs-echarts 9.1.3 → 9.2.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.
@@ -309,6 +309,9 @@ function defaultOptionsOverrides() {
309
309
  sankey: {
310
310
  series: {}
311
311
  },
312
+ boxplot: {
313
+ series: {},
314
+ },
312
315
  hBoxplot: {
313
316
  series: {}
314
317
  },
@@ -1100,7 +1103,7 @@ class RingBuilder {
1100
1103
  }
1101
1104
  }
1102
1105
 
1103
- class BoxPlotBuilder {
1106
+ class BoxplotBuilder {
1104
1107
  baseProduct;
1105
1108
  translateService;
1106
1109
  valueFormatter = defaultValueFormatter;
@@ -1239,16 +1242,30 @@ class BoxPlotBuilder {
1239
1242
  ;
1240
1243
  this.result.tooltip = getTooltipOptions(merge$1(overrides, { formatter: tooltipFormatter }));
1241
1244
  }
1242
- addDataZoom() {
1245
+ addDataZoom(opts) {
1246
+ const axisTypes = opts?.axisTypes || { x: 'value', y: 'category' };
1247
+ const isVertical = axisTypes.x === 'category';
1243
1248
  this.result.dataZoom = [
1244
1249
  {
1245
- type: 'inside'
1250
+ type: 'inside',
1251
+ ...(isVertical ? { yAxisIndex: 0 } : { xAxisIndex: 0 })
1246
1252
  },
1247
1253
  {
1248
1254
  type: 'slider',
1249
- height: 20,
1250
- bottom: 10,
1251
- labelFormatter: (value) => valueToLocale(value)
1255
+ ...(isVertical
1256
+ ? {
1257
+ yAxisIndex: 0,
1258
+ orient: 'horizontal',
1259
+ bottom: 10,
1260
+ height: 20
1261
+ }
1262
+ : {
1263
+ xAxisIndex: 0,
1264
+ orient: 'horizontal',
1265
+ bottom: 10,
1266
+ height: 20
1267
+ }),
1268
+ labelFormatter: (value) => formatAxisValue(value)
1252
1269
  }
1253
1270
  ];
1254
1271
  }
@@ -2408,7 +2425,7 @@ class VSECDirector {
2408
2425
  this.builder.addTooltip(data, overrides.tooltip);
2409
2426
  }
2410
2427
  makeBoxplot(data, overrides, opts = {}) {
2411
- if (this.builder instanceof BoxPlotBuilder == false) {
2428
+ if (this.builder instanceof BoxplotBuilder == false) {
2412
2429
  return;
2413
2430
  }
2414
2431
  const { valueFormatter = undefined, palette = undefined, colorResolver = undefined, axisTypes = {
@@ -2434,7 +2451,8 @@ class VSECDirector {
2434
2451
  this.builder.addXAxis(data, overrides.axis, axisTypes.x);
2435
2452
  this.builder.addYAxis(data, overrides.axis, axisTypes.y);
2436
2453
  this.builder.addTooltip(data, overrides.tooltip);
2437
- this.builder.addDataZoom();
2454
+ const dzConfigOpts = { axisTypes };
2455
+ this.builder.addDataZoom(dzConfigOpts);
2438
2456
  }
2439
2457
  makeHeatmapCalendar(data, overrides, opts = {}) {
2440
2458
  if (this.builder instanceof HeatmapCalendarBuilder == false) {
@@ -3224,20 +3242,52 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImpo
3224
3242
  ], template: "<div\n class=\"echarts-container\"\n echarts\n [options]=\"{}\"\n [initOpts]=\"initOptions\"\n [autoResize]=\"true\"\n (chartInit)=\"onChartInit($event)\"\n (chartClick)=\"onChartClick($event)\"\n></div>\n", styles: [".echarts-container{width:100%;height:100%;position:relative}\n"] }]
3225
3243
  }] });
3226
3244
 
3227
- class EChartsHBoxplotComponent extends BaseEchartsComponent {
3245
+ class EChartsBoxplotComponent extends BaseEchartsComponent {
3228
3246
  baseSeriesOptions = {
3229
3247
  type: 'boxplot',
3230
3248
  itemStyle: {
3231
3249
  color: '#b8c5f2'
3232
3250
  },
3233
3251
  };
3252
+ baseProduct = {
3253
+ chartKey: 'boxplot',
3254
+ baseOptions: {
3255
+ series: this.baseSeriesOptions,
3256
+ }
3257
+ };
3258
+ builder = new BoxplotBuilder(this.baseProduct);
3259
+ director = new VSECDirector(this.builder);
3260
+ make() {
3261
+ const makeOpts = {
3262
+ palette: this.palette,
3263
+ colorResolver: this.colorResolver,
3264
+ valueFormatter: this.valueFormatter,
3265
+ axisTypes: {
3266
+ x: 'category',
3267
+ y: 'value',
3268
+ },
3269
+ };
3270
+ this.director.makeBoxplot(this.data, this.optionsOverrides, makeOpts);
3271
+ }
3272
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: EChartsBoxplotComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
3273
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.19", type: EChartsBoxplotComponent, isStandalone: true, selector: "vs-echarts-boxplot", usesInheritance: true, ngImport: i0, template: "<div\n class=\"echarts-container\"\n echarts\n [options]=\"{}\"\n [initOpts]=\"initOptions\"\n [autoResize]=\"true\"\n (chartInit)=\"onChartInit($event)\"\n></div>\n", styles: [".echarts-container{width:100%;height:100%;position:relative}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: NgxEchartsDirective, selector: "echarts, [echarts]", inputs: ["options", "theme", "initOpts", "merge", "autoResize", "loading", "loadingType", "loadingOpts"], outputs: ["chartInit", "optionsError", "chartClick", "chartDblClick", "chartMouseDown", "chartMouseMove", "chartMouseUp", "chartMouseOver", "chartMouseOut", "chartGlobalOut", "chartContextMenu", "chartHighlight", "chartDownplay", "chartSelectChanged", "chartLegendSelectChanged", "chartLegendSelected", "chartLegendUnselected", "chartLegendLegendSelectAll", "chartLegendLegendInverseSelect", "chartLegendScroll", "chartDataZoom", "chartDataRangeSelected", "chartGraphRoam", "chartGeoRoam", "chartTreeRoam", "chartTimelineChanged", "chartTimelinePlayChanged", "chartRestore", "chartDataViewChanged", "chartMagicTypeChanged", "chartGeoSelectChanged", "chartGeoSelected", "chartGeoUnselected", "chartAxisAreaSelected", "chartBrush", "chartBrushEnd", "chartBrushSelected", "chartGlobalCursorTaken", "chartRendered", "chartFinished"], exportAs: ["echarts"] }] });
3274
+ }
3275
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: EChartsBoxplotComponent, decorators: [{
3276
+ type: Component,
3277
+ args: [{ selector: 'vs-echarts-boxplot', imports: [
3278
+ CommonModule,
3279
+ NgxEchartsDirective,
3280
+ ], template: "<div\n class=\"echarts-container\"\n echarts\n [options]=\"{}\"\n [initOpts]=\"initOptions\"\n [autoResize]=\"true\"\n (chartInit)=\"onChartInit($event)\"\n></div>\n", styles: [".echarts-container{width:100%;height:100%;position:relative}\n"] }]
3281
+ }] });
3282
+
3283
+ class EChartsHBoxplotComponent extends EChartsBoxplotComponent {
3234
3284
  baseProduct = {
3235
3285
  chartKey: 'hBoxplot',
3236
3286
  baseOptions: {
3237
3287
  series: this.baseSeriesOptions,
3238
3288
  }
3239
3289
  };
3240
- builder = new BoxPlotBuilder(this.baseProduct);
3290
+ builder = new BoxplotBuilder(this.baseProduct);
3241
3291
  director = new VSECDirector(this.builder);
3242
3292
  make() {
3243
3293
  const makeOpts = {
@@ -3375,5 +3425,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImpo
3375
3425
  * Generated bundle index. Do not edit.
3376
3426
  */
3377
3427
 
3378
- export { BaseEchartsComponent, EChartsAreaComponent, EChartsAreaStackComponent, EChartsBarStackedComponent, EChartsBarStackedRadialComponent, EChartsHBarComponent, EChartsHBarStackedComponent, EChartsHBoxplotComponent, EChartsHeatmapCalendar, EChartsSunburstComponent, EchartsBarComponent, EchartsFunnelComponent, EchartsLineComponent, EchartsPieComponent, EchartsRingComponent, EchartsSankeyComponent, EchartsScatterComponent, VSEchartsConfigService, defaultOptionsOverrides, getActiveLocale, provideVSEcharts, setActiveLocale };
3428
+ export { BaseEchartsComponent, EChartsAreaComponent, EChartsAreaStackComponent, EChartsBarStackedComponent, EChartsBarStackedRadialComponent, EChartsBoxplotComponent, EChartsHBarComponent, EChartsHBarStackedComponent, EChartsHBoxplotComponent, EChartsHeatmapCalendar, EChartsSunburstComponent, EchartsBarComponent, EchartsFunnelComponent, EchartsLineComponent, EchartsPieComponent, EchartsRingComponent, EchartsSankeyComponent, EchartsScatterComponent, VSEchartsConfigService, defaultOptionsOverrides, getActiveLocale, provideVSEcharts, setActiveLocale };
3379
3429
  //# sourceMappingURL=visionaris-bruno-vs-echarts.mjs.map