@lightdash/common 0.1364.2 → 0.1365.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -44,6 +44,14 @@ export declare class CartesianChartDataModel {
44
44
  getDataDownloadUrl(): string | undefined;
45
45
  getSpec(display?: CartesianChartDisplay, colors?: Organization['chartColors']): Record<string, any>;
46
46
  }
47
+ export declare enum ValueLabelPositionOptions {
48
+ HIDDEN = "hidden",
49
+ TOP = "top",
50
+ BOTTOM = "bottom",
51
+ LEFT = "left",
52
+ RIGHT = "right",
53
+ INSIDE = "inside"
54
+ }
47
55
  export type CartesianChartDisplay = {
48
56
  xAxis?: {
49
57
  label?: string;
@@ -61,6 +69,7 @@ export type CartesianChartDisplay = {
61
69
  yAxisIndex?: number;
62
70
  color?: string;
63
71
  type?: ChartKind.LINE | ChartKind.VERTICAL_BAR;
72
+ valueLabelPosition?: ValueLabelPositionOptions;
64
73
  };
65
74
  };
66
75
  legend?: {
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CartesianChartDataModel = void 0;
3
+ exports.ValueLabelPositionOptions = exports.CartesianChartDataModel = void 0;
4
4
  const lodash_1 = require("lodash");
5
5
  const field_1 = require("../types/field");
6
6
  const savedCharts_1 = require("../types/savedCharts");
@@ -291,6 +291,7 @@ class CartesianChartDataModel {
291
291
  const seriesLabel = singleYAxisLabel ??
292
292
  Object.values(display?.series || {}).find((s) => s.yAxisIndex === index)?.label;
293
293
  const seriesColor = Object.values(display?.series || {}).find((s) => s.yAxisIndex === index)?.color;
294
+ const seriesValueLabelPosition = Object.values(display?.series || {}).find((s) => s.yAxisIndex === index)?.valueLabelPosition;
294
295
  return {
295
296
  dimensions: [xAxisReference, seriesColumn],
296
297
  type: defaultSeriesType,
@@ -309,6 +310,12 @@ class CartesianChartDataModel {
309
310
  ? CartesianChartDataModel.getTooltipFormatter(seriesFormat)
310
311
  : undefined,
311
312
  },
313
+ label: seriesValueLabelPosition
314
+ ? {
315
+ show: seriesValueLabelPosition !== 'hidden',
316
+ position: seriesValueLabelPosition,
317
+ }
318
+ : undefined,
312
319
  color: seriesColor ||
313
320
  CartesianChartDataModel.getDefaultColor(index, orgColors),
314
321
  // this.getSeriesColor( seriesColumn, possibleXAxisValues, orgColors),
@@ -381,3 +388,12 @@ class CartesianChartDataModel {
381
388
  }
382
389
  }
383
390
  exports.CartesianChartDataModel = CartesianChartDataModel;
391
+ var ValueLabelPositionOptions;
392
+ (function (ValueLabelPositionOptions) {
393
+ ValueLabelPositionOptions["HIDDEN"] = "hidden";
394
+ ValueLabelPositionOptions["TOP"] = "top";
395
+ ValueLabelPositionOptions["BOTTOM"] = "bottom";
396
+ ValueLabelPositionOptions["LEFT"] = "left";
397
+ ValueLabelPositionOptions["RIGHT"] = "right";
398
+ ValueLabelPositionOptions["INSIDE"] = "inside";
399
+ })(ValueLabelPositionOptions = exports.ValueLabelPositionOptions || (exports.ValueLabelPositionOptions = {}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lightdash/common",
3
- "version": "0.1364.2",
3
+ "version": "0.1365.0",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [