layerchart 0.76.1 → 0.78.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.
|
@@ -165,20 +165,22 @@
|
|
|
165
165
|
: (s.value ?? (s.data ? undefined : s.key)),
|
|
166
166
|
fill: s.color,
|
|
167
167
|
fillOpacity: 0.3,
|
|
168
|
+
...props.area,
|
|
169
|
+
...s.props,
|
|
168
170
|
class: cls(
|
|
169
171
|
'transition-opacity',
|
|
170
|
-
highlightSeriesKey && highlightSeriesKey !== s.key && 'opacity-10'
|
|
172
|
+
highlightSeriesKey && highlightSeriesKey !== s.key && 'opacity-10',
|
|
173
|
+
props.area?.class,
|
|
174
|
+
s.props?.class
|
|
171
175
|
),
|
|
172
|
-
...props.area,
|
|
173
|
-
...s.props,
|
|
174
176
|
line: {
|
|
177
|
+
stroke: s.color,
|
|
178
|
+
...lineProps,
|
|
175
179
|
class: cls(
|
|
176
|
-
!('stroke-width' in lineProps) && 'stroke-2',
|
|
177
180
|
'transition-opacity',
|
|
178
|
-
highlightSeriesKey && highlightSeriesKey !== s.key && 'opacity-10'
|
|
181
|
+
highlightSeriesKey && highlightSeriesKey !== s.key && 'opacity-10',
|
|
182
|
+
lineProps.class
|
|
179
183
|
),
|
|
180
|
-
stroke: s.color,
|
|
181
|
-
...lineProps,
|
|
182
184
|
},
|
|
183
185
|
};
|
|
184
186
|
|
|
@@ -239,6 +241,7 @@
|
|
|
239
241
|
padding,
|
|
240
242
|
tooltip,
|
|
241
243
|
series,
|
|
244
|
+
visibleSeries,
|
|
242
245
|
getAreaProps,
|
|
243
246
|
}}
|
|
244
247
|
|
|
@@ -226,13 +226,15 @@
|
|
|
226
226
|
strokeWidth: 1,
|
|
227
227
|
insets: stackInsets,
|
|
228
228
|
fill: s.color,
|
|
229
|
-
class: cls(
|
|
230
|
-
'transition-opacity',
|
|
231
|
-
highlightSeriesKey && highlightSeriesKey !== s.key && 'opacity-10'
|
|
232
|
-
),
|
|
233
229
|
onBarClick: (e) => onBarClick({ data: e.data, series: s }),
|
|
234
230
|
...props.bars,
|
|
235
231
|
...s.props,
|
|
232
|
+
class: cls(
|
|
233
|
+
'transition-opacity',
|
|
234
|
+
highlightSeriesKey && highlightSeriesKey !== s.key && 'opacity-10',
|
|
235
|
+
props.bars?.class,
|
|
236
|
+
s.props?.class
|
|
237
|
+
),
|
|
236
238
|
};
|
|
237
239
|
|
|
238
240
|
return barsProps;
|
|
@@ -305,6 +307,7 @@
|
|
|
305
307
|
padding,
|
|
306
308
|
tooltip,
|
|
307
309
|
series,
|
|
310
|
+
visibleSeries,
|
|
308
311
|
getBarsProps,
|
|
309
312
|
}}
|
|
310
313
|
<slot {...slotProps}>
|
|
@@ -118,13 +118,15 @@
|
|
|
118
118
|
const splineProps: ComponentProps<Spline> = {
|
|
119
119
|
data: s.data,
|
|
120
120
|
y: s.value ?? (s.data ? undefined : s.key),
|
|
121
|
-
class: cls(
|
|
122
|
-
'stroke-2 transition-opacity',
|
|
123
|
-
highlightSeriesKey && highlightSeriesKey !== s.key && 'opacity-10'
|
|
124
|
-
),
|
|
125
121
|
stroke: s.color,
|
|
126
122
|
...props.spline,
|
|
127
123
|
...s.props,
|
|
124
|
+
class: cls(
|
|
125
|
+
'transition-opacity',
|
|
126
|
+
highlightSeriesKey && highlightSeriesKey !== s.key && 'opacity-10',
|
|
127
|
+
props.spline?.class,
|
|
128
|
+
s.props?.class
|
|
129
|
+
),
|
|
128
130
|
};
|
|
129
131
|
|
|
130
132
|
return splineProps;
|
|
@@ -181,6 +183,7 @@
|
|
|
181
183
|
padding,
|
|
182
184
|
tooltip,
|
|
183
185
|
series,
|
|
186
|
+
visibleSeries,
|
|
184
187
|
getSplineProps,
|
|
185
188
|
}}
|
|
186
189
|
<slot {...slotProps}>
|
|
@@ -195,6 +195,8 @@
|
|
|
195
195
|
height,
|
|
196
196
|
padding,
|
|
197
197
|
tooltip,
|
|
198
|
+
series,
|
|
199
|
+
visibleData,
|
|
198
200
|
}}
|
|
199
201
|
<slot {...slotProps}>
|
|
200
202
|
<svelte:component this={renderContext === 'canvas' ? Canvas : Svg} {center}>
|
|
@@ -231,12 +233,14 @@
|
|
|
231
233
|
// Workaround for `tooltip={{ mode: 'manual' }}
|
|
232
234
|
onTooltipClick({ data: d });
|
|
233
235
|
}}
|
|
236
|
+
{...props.arc}
|
|
237
|
+
{...s.props}
|
|
234
238
|
class={cls(
|
|
235
239
|
'transition-opacity',
|
|
236
|
-
highlightKey && highlightKey !== keyAccessor(d) && 'opacity-50'
|
|
240
|
+
highlightKey && highlightKey !== keyAccessor(d) && 'opacity-50',
|
|
241
|
+
props.arc?.class,
|
|
242
|
+
s.props?.class
|
|
237
243
|
)}
|
|
238
|
-
{...props.arc}
|
|
239
|
-
{...s.props}
|
|
240
244
|
/>
|
|
241
245
|
{:else}
|
|
242
246
|
<Pie
|
|
@@ -103,12 +103,14 @@
|
|
|
103
103
|
stroke: s.color,
|
|
104
104
|
fill: s.color,
|
|
105
105
|
fillOpacity: 0.3,
|
|
106
|
+
...props.points,
|
|
107
|
+
...s.props,
|
|
106
108
|
class: cls(
|
|
107
109
|
'transition-opacity',
|
|
108
|
-
highlightSeriesKey && highlightSeriesKey !== s.key && 'opacity-10'
|
|
110
|
+
highlightSeriesKey && highlightSeriesKey !== s.key && 'opacity-10',
|
|
111
|
+
props.points?.class,
|
|
112
|
+
s.props?.class
|
|
109
113
|
),
|
|
110
|
-
...props.points,
|
|
111
|
-
...s.props,
|
|
112
114
|
};
|
|
113
115
|
|
|
114
116
|
return pointsProps;
|
|
@@ -154,7 +156,21 @@
|
|
|
154
156
|
let:tooltip
|
|
155
157
|
let:config
|
|
156
158
|
>
|
|
157
|
-
{@const slotProps = {
|
|
159
|
+
{@const slotProps = {
|
|
160
|
+
x,
|
|
161
|
+
xScale,
|
|
162
|
+
y,
|
|
163
|
+
yScale,
|
|
164
|
+
c,
|
|
165
|
+
cScale,
|
|
166
|
+
width,
|
|
167
|
+
height,
|
|
168
|
+
padding,
|
|
169
|
+
tooltip,
|
|
170
|
+
series,
|
|
171
|
+
visibleSeries,
|
|
172
|
+
getPointsProps,
|
|
173
|
+
}}
|
|
158
174
|
{@const activeSeries = tooltip.data
|
|
159
175
|
? (series.find((s) => s.key === tooltip.data.seriesKey) ?? series[0])
|
|
160
176
|
: null}
|