Skip to content

Commit ad824d2

Browse files
committed
docs: updates README
1 parent 4f0826e commit ad824d2

File tree

1 file changed

+23
-14
lines changed

1 file changed

+23
-14
lines changed

README.md

Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -462,26 +462,35 @@ const MyDashboard = () => {
462462
### SolidUplot Component
463463

464464
```tsx
465+
type SolidUplotEvents = {
466+
/** Callback fired when the uPlot instance is created */
467+
readonly onCreate?: (u: uPlot, meta: OnCreateMeta) => void;
468+
/** Callback fired when the cursor moves */
469+
readonly onCursorMove?: (params: OnCursorMoveParams) => void;
470+
};
471+
465472
// Main component props (extends all uPlot.Options except plugins, width, height)
466-
type SolidUplotProps<T extends VoidStruct = VoidStruct> = SolidUplotOptions<T> & {
467-
// Ref callback to access the chart container element
468-
ref?: (el: HTMLDivElement) => void;
473+
type SolidUplotProps<T extends VoidStruct = VoidStruct> = SolidUplotOptions<T> &
474+
SolidUplotEvents & {
475+
// Ref callback to access the chart container element
476+
ref?: Ref<HTMLDivElement>;
469477

470-
// Callback fired when the uPlot instance is created
471-
onCreate?: (u: uPlot, meta: { seriesData: SeriesDatum[] }) => void;
478+
// CSS class name for the chart container (default: "solid-uplot")
479+
// Additional classes will be appended to the default class
480+
class?: string;
472481

473-
// Whether to reset scales when chart data is updated (default: true)
474-
resetScales?: boolean;
482+
// CSS styles for the chart container (position is managed internally)
483+
style?: Omit<JSX.CSSProperties, "position">;
475484

476-
// CSS styles for the chart container (position is managed internally)
477-
style?: Omit<JSX.CSSProperties, "position">;
485+
// Enable automatic resizing to fit container (default: false)
486+
autoResize?: boolean;
478487

479-
// Where to place children components relative to the chart (default: "top")
480-
childrenPlacement?: "top" | "bottom";
488+
// Whether to reset scales when chart data is updated (default: true)
489+
resetScales?: boolean;
481490

482-
// Enable automatic resizing to fit container (default: false)
483-
autoResize?: boolean;
484-
};
491+
// Where to place children components relative to the chart (default: "top")
492+
childrenPlacement?: "top" | "bottom";
493+
};
485494

486495
// Configuration options extending uPlot.Options with SolidJS enhancements
487496
type SolidUplotOptions<T extends VoidStruct = VoidStruct> = Omit<

0 commit comments

Comments
 (0)