@tekkare/romulus 0.1.41 → 0.1.42

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/module.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "compatibility": {
5
5
  "nuxt": ">=3.16.0"
6
6
  },
7
- "version": "0.1.40",
7
+ "version": "0.1.41",
8
8
  "builder": {
9
9
  "@nuxt/module-builder": "0.8.4",
10
10
  "unbuild": "2.0.0"
@@ -11,7 +11,11 @@ import { rmCompact, rmNumber } from '../utils/format'
11
11
  const props = withDefaults(defineProps<{
12
12
  categories: (string | number)[]
13
13
  series: RmSeriesInput[]
14
- /** Remplissage degrade sous la courbe. */
14
+ /**
15
+ * Remplissage degrade sous la courbe. Laisse libre, il se pose tout seul
16
+ * jusqu'a cinq courbes et se retire au-dela, ou les zones se recouvrent.
17
+ * `true` ou `false` tranche a la place de la regle.
18
+ */
15
19
  area?: boolean
16
20
  /** Marche d'escalier : prix, taux de remboursement, decisions datees. */
17
21
  step?: boolean
@@ -47,7 +51,7 @@ const props = withDefaults(defineProps<{
47
51
  height?: keyof typeof RM_CHART_HEIGHTS | number
48
52
  description?: string
49
53
  }>(), {
50
- area: false,
54
+ area: undefined,
51
55
  step: false,
52
56
  smooth: true,
53
57
  axisLabels: undefined,
@@ -308,6 +308,10 @@ export declare function rmBarHorizontalOption(labels: string[], values: (number
308
308
  };
309
309
  /** Line ou area chart. `step` produit la marche d'escalier des series de prix. */
310
310
  export declare function rmLineOption(categories: (string | number)[], series: RmSeriesInput[], theme: RmChartTheme, palette: string[], options?: {
311
+ /**
312
+ * Remplissage degrade sous la courbe. Non precise : automatique jusqu'a
313
+ * AREA_MAX_SERIES courbes.
314
+ */
311
315
  area?: boolean;
312
316
  step?: boolean;
313
317
  smooth?: boolean;
@@ -161,7 +161,7 @@ export function rmBarHorizontalOption(labels, values, theme, palette, decal = fa
161
161
  }
162
162
  export function rmLineOption(categories, series, theme, palette, options = {}) {
163
163
  const {
164
- area = false,
164
+ area,
165
165
  step = false,
166
166
  smooth = true,
167
167
  decal = false,
@@ -172,6 +172,8 @@ export function rmLineOption(categories, series, theme, palette, options = {}) {
172
172
  startAtZero = false,
173
173
  valueFormatter
174
174
  } = options;
175
+ const AREA_MAX_SERIES = 5;
176
+ const filled = area ?? series.length <= AREA_MAX_SERIES;
175
177
  const dual = series.some((s) => s.axis === 1);
176
178
  const bottomLegend = legendPosition === "bottom";
177
179
  const format = (value) => valueFormatter ? valueFormatter(value) : String(value);
@@ -242,7 +244,7 @@ export function rmLineOption(categories, series, theme, palette, options = {}) {
242
244
  } : void 0,
243
245
  lineStyle: { color, width: 2.5 },
244
246
  itemStyle: { color },
245
- areaStyle: area ? {
247
+ areaStyle: filled ? {
246
248
  color: {
247
249
  type: "linear",
248
250
  x: 0,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tekkare/romulus",
3
- "version": "0.1.41",
3
+ "version": "0.1.42",
4
4
  "description": "Romulus Design System - Nuxt module by Tekkare",
5
5
  "license": "MIT",
6
6
  "type": "module",