svelteplot 0.5.1-pr-248.0 → 0.5.1-pr-249.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.
@@ -14,6 +14,7 @@
14
14
  sort?: ConstantAccessor<RawValue> | { channel: 'stroke' | 'fill' };
15
15
  stack?: Partial<StackOptions>;
16
16
  canvas?: boolean;
17
+ areaClass?: ConstantAccessor<string, Datum>;
17
18
  }
18
19
 
19
20
  import Mark from '../Mark.svelte';
@@ -37,7 +38,6 @@
37
38
  ChannelAccessor,
38
39
  ScaledDataRecord,
39
40
  LinkableMarkProps,
40
- PlotDefaults,
41
41
  RawValue
42
42
  } from '../types/index.js';
43
43
  import type { StackOptions } from '../transforms/stack.js';
@@ -59,6 +59,7 @@
59
59
  curve = 'linear' as CurveName,
60
60
  tension = 0,
61
61
  class: className = '',
62
+ areaClass,
62
63
  canvas = false,
63
64
  ...options
64
65
  }: AreaMarkProps = $derived({ ...DEFAULTS, ...markProps });
@@ -120,7 +121,7 @@
120
121
  {#if canvas}
121
122
  <AreaCanvas groupedAreaData={grouped} {mark} {usedScales} {areaPath} />
122
123
  {:else}
123
- <GroupMultiple length={grouped.length}>
124
+ <GroupMultiple class={className} length={grouped.length}>
124
125
  {#each grouped as areaData, i (i)}
125
126
  {@const datum = areaData[0]}
126
127
  {#if areaData.length > 0}
@@ -134,7 +135,11 @@
134
135
  usedScales
135
136
  )}
136
137
  <path
137
- class={['svelteplot-area', className, styleClass]}
138
+ class={[
139
+ 'area',
140
+ resolveProp(areaClass, areaData[0].datum),
141
+ styleClass
142
+ ]}
138
143
  clip-path={options.clipPath}
139
144
  d={areaPath(areaData)}
140
145
  {@attach addEventHandlers({
@@ -79,6 +79,7 @@ declare class __sveltets_Render<Datum extends DataRecord> {
79
79
  };
80
80
  stack?: Partial<StackOptions>;
81
81
  canvas?: boolean;
82
+ areaClass?: ConstantAccessor<string, Datum>;
82
83
  };
83
84
  events(): {};
84
85
  slots(): {};
@@ -77,6 +77,7 @@ declare class __sveltets_Render<Datum extends DataRow> {
77
77
  };
78
78
  stack?: Partial<renameChannels>;
79
79
  canvas?: boolean;
80
+ areaClass?: import("../types/index.js").ConstantAccessor<string, Record<string | symbol, import("../types/data").RawValue>>;
80
81
  }, "y1" | "y2"> & {
81
82
  x?: ChannelAccessor<Datum>;
82
83
  y?: ChannelAccessor<Datum>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "svelteplot",
3
- "version": "0.5.1-pr-248.0",
3
+ "version": "0.5.1-pr-249.0",
4
4
  "license": "ISC",
5
5
  "author": {
6
6
  "name": "Gregor Aisch",