File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -39,12 +39,14 @@ export type SolidUplotPlugin<T extends VoidStruct = VoidStruct> =
3939 */
4040export type SolidUplotOptions < T extends VoidStruct = VoidStruct > = Omit <
4141 uPlot . Options ,
42- "plugins" | "width" | "height"
42+ "plugins" | "width" | "height" | "data"
4343> & {
4444 /** Chart width in pixels */
4545 readonly width ?: number ;
4646 /** Chart height in pixels */
4747 readonly height ?: number ;
48+ /** Chart data - accepts AlignedData or number[][] */
49+ readonly data ?: uPlot . AlignedData | number [ ] [ ] ;
4850 /** Plugin communication bus for coordinating between plugins */
4951 readonly pluginBus ?: SolidUplotPluginBus < T > ;
5052 /** Array of plugins to apply to the chart */
@@ -210,7 +212,7 @@ export const SolidUplot = <T extends VoidStruct = VoidStruct>(
210212 } ;
211213
212214 const initialSize = getInitialSize ( ) ;
213- const initialData = untrack ( ( ) => updateableOptions . data ) ;
215+ const initialData = untrack ( ( ) => updateableOptions . data ) as uPlot . AlignedData ;
214216
215217 const chart = new uPlot (
216218 {
@@ -247,7 +249,7 @@ export const SolidUplot = <T extends VoidStruct = VoidStruct>(
247249 } ) ;
248250
249251 createEffect ( ( ) => {
250- chart . setData ( updateableOptions . data , updateableOptions . resetScales ) ;
252+ chart . setData ( updateableOptions . data as uPlot . AlignedData , updateableOptions . resetScales ) ;
251253 } ) ;
252254
253255 onCleanup ( ( ) => {
You can’t perform that action at this time.
0 commit comments