Skip to content

Commit de48952

Browse files
committed
docs: update readme
1 parent 4558b53 commit de48952

File tree

3 files changed

+95
-98
lines changed

3 files changed

+95
-98
lines changed

README.md

Lines changed: 47 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,30 @@ yarn install solid-js uplot @dschz/solid-uplot
3333
bun install solid-js uplot @dschz/solid-uplot
3434
```
3535

36+
## 🎮 Live Demo
37+
38+
This repo ships with a **live, running playground** — a full showcase of every feature in the library. It's the fastest way to see `solid-uplot` in action and explore real, working examples of charts, plugins, responsive sizing, and external integrations.
39+
40+
### Running the Playground
41+
42+
```bash
43+
git clone https://github.com/dsnchz/solid-uplot.git
44+
cd solid-uplot
45+
46+
# Install dependencies
47+
bun install
48+
49+
# Start the playground
50+
bun dev
51+
```
52+
53+
The playground runs at `http://localhost:3000` and includes interactive demos for:
54+
55+
- All built-in plugins (cursor, tooltip, legend, focus series)
56+
- Responsive and auto-resize chart patterns
57+
- Custom plugin development
58+
- External component integration via the plugin bus
59+
3660
## 📁 Package Structure
3761

3862
This package provides three main export paths for different functionality:
@@ -187,6 +211,29 @@ import { AutoSizer } from "@dschz/solid-auto-sizer";
187211
</AutoSizer>;
188212
```
189213

214+
Alternatively, you can use [`createElementSize`](https://github.com/solidjs-community/solid-primitives/tree/main/packages/resize-observer) from `@solid-primitives/resize-observer` for a signal-based approach:
215+
216+
```bash
217+
npm install @solid-primitives/resize-observer
218+
```
219+
220+
```tsx
221+
import { createElementSize } from "@solid-primitives/resize-observer";
222+
223+
const ResponsiveChart = () => {
224+
let container!: HTMLDivElement;
225+
const size = createElementSize(() => container);
226+
227+
return (
228+
<div style={{ width: "100%", height: "400px" }}>
229+
<div ref={container} style={{ width: "100%", height: "100%" }}>
230+
<SolidUplot data={data} width={size.width ?? 0} height={size.height ?? 0} series={series} />
231+
</div>
232+
</div>
233+
);
234+
};
235+
```
236+
190237
## 🔌 Enhanced Plugin System
191238

192239
The cornerstone feature of `SolidUplot` is its refined plugin system that enables extensible functionality and inter-plugin communication through a reactive message bus.
@@ -721,55 +768,6 @@ const Dashboard = () => {
721768
};
722769
```
723770

724-
## 🎮 Interactive Playground
725-
726-
This library includes a comprehensive playground application that demonstrates all features and provides interactive examples. The playground showcases:
727-
728-
- **Basic Charts**: Simple line charts with different configurations
729-
- **Plugin Examples**: All built-in plugins working together
730-
- **Legend Showcase**: Various legend patterns and interactions
731-
- **Responsive Sizing**: Auto-resize and manual sizing examples
732-
- **Custom Plugins**: Examples of creating your own plugins
733-
- **External Integration**: Charts interacting with external components
734-
735-
### Running the Playground Locally
736-
737-
To explore the playground and see the library in action:
738-
739-
```bash
740-
# Clone the repository
741-
git clone https://github.com/dsnchz/solid-uplot.git
742-
cd solid-uplot
743-
744-
# Install dependencies
745-
npm install
746-
# or
747-
pnpm install
748-
# or
749-
yarn install
750-
# or
751-
bun install
752-
753-
# Start the playground development server
754-
npm run start
755-
# or
756-
pnpm start
757-
# or
758-
yarn start
759-
# or
760-
bun start
761-
```
762-
763-
The playground will be available at `http://localhost:3000` and includes:
764-
765-
- **Live code examples** with syntax highlighting
766-
- **Interactive demos** you can modify in real-time
767-
- **Performance comparisons** between different configurations
768-
- **Best practices** and common patterns
769-
- **Plugin development examples** with step-by-step guides
770-
771-
The playground source code also serves as a comprehensive reference for implementing various chart patterns and plugin combinations.
772-
773771
## 🤝 Contributing
774772

775773
Contributions are welcome! Please feel free to submit a Pull Request.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
"pkg:changeset": "changeset",
2020
"pkg:version": "changeset version",
2121
"pkg:publish": "bun run build && changeset publish",
22+
"start": "bun run dev",
2223
"test": "bun run --filter @dschz/solid-uplot test",
2324
"test:cov": "bun run --filter @dschz/solid-uplot test:cov",
2425
"test:e2e": "bun run --filter e2e test:e2e",

packages/solid-uplot/README.md

Lines changed: 47 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,30 @@ yarn install solid-js uplot @dschz/solid-uplot
3333
bun install solid-js uplot @dschz/solid-uplot
3434
```
3535

36+
## 🎮 Live Demo
37+
38+
This repo ships with a **live, running playground** — a full showcase of every feature in the library. It's the fastest way to see `solid-uplot` in action and explore real, working examples of charts, plugins, responsive sizing, and external integrations.
39+
40+
### Running the Playground
41+
42+
```bash
43+
git clone https://github.com/dsnchz/solid-uplot.git
44+
cd solid-uplot
45+
46+
# Install dependencies
47+
bun install
48+
49+
# Start the playground
50+
bun start
51+
```
52+
53+
The playground runs at `http://localhost:3000` and includes interactive demos for:
54+
55+
- All built-in plugins (cursor, tooltip, legend, focus series)
56+
- Responsive and auto-resize chart patterns
57+
- Custom plugin development
58+
- External component integration via the plugin bus
59+
3660
## 📁 Package Structure
3761

3862
This package provides three main export paths for different functionality:
@@ -187,6 +211,29 @@ import { AutoSizer } from "@dschz/solid-auto-sizer";
187211
</AutoSizer>;
188212
```
189213

214+
Alternatively, you can use [`createElementSize`](https://github.com/solidjs-community/solid-primitives/tree/main/packages/resize-observer) from `@solid-primitives/resize-observer` for a signal-based approach:
215+
216+
```bash
217+
npm install @solid-primitives/resize-observer
218+
```
219+
220+
```tsx
221+
import { createElementSize } from "@solid-primitives/resize-observer";
222+
223+
const ResponsiveChart = () => {
224+
let container!: HTMLDivElement;
225+
const size = createElementSize(() => container);
226+
227+
return (
228+
<div style={{ width: "100%", height: "400px" }}>
229+
<div ref={container} style={{ width: "100%", height: "100%" }}>
230+
<SolidUplot data={data} width={size.width ?? 0} height={size.height ?? 0} series={series} />
231+
</div>
232+
</div>
233+
);
234+
};
235+
```
236+
190237
## 🔌 Enhanced Plugin System
191238

192239
The cornerstone feature of `SolidUplot` is its refined plugin system that enables extensible functionality and inter-plugin communication through a reactive message bus.
@@ -721,55 +768,6 @@ const Dashboard = () => {
721768
};
722769
```
723770

724-
## 🎮 Interactive Playground
725-
726-
This library includes a comprehensive playground application that demonstrates all features and provides interactive examples. The playground showcases:
727-
728-
- **Basic Charts**: Simple line charts with different configurations
729-
- **Plugin Examples**: All built-in plugins working together
730-
- **Legend Showcase**: Various legend patterns and interactions
731-
- **Responsive Sizing**: Auto-resize and manual sizing examples
732-
- **Custom Plugins**: Examples of creating your own plugins
733-
- **External Integration**: Charts interacting with external components
734-
735-
### Running the Playground Locally
736-
737-
To explore the playground and see the library in action:
738-
739-
```bash
740-
# Clone the repository
741-
git clone https://github.com/dsnchz/solid-uplot.git
742-
cd solid-uplot
743-
744-
# Install dependencies
745-
npm install
746-
# or
747-
pnpm install
748-
# or
749-
yarn install
750-
# or
751-
bun install
752-
753-
# Start the playground development server
754-
npm run start
755-
# or
756-
pnpm start
757-
# or
758-
yarn start
759-
# or
760-
bun start
761-
```
762-
763-
The playground will be available at `http://localhost:3000` and includes:
764-
765-
- **Live code examples** with syntax highlighting
766-
- **Interactive demos** you can modify in real-time
767-
- **Performance comparisons** between different configurations
768-
- **Best practices** and common patterns
769-
- **Plugin development examples** with step-by-step guides
770-
771-
The playground source code also serves as a comprehensive reference for implementing various chart patterns and plugin combinations.
772-
773771
## 🤝 Contributing
774772

775773
Contributions are welcome! Please feel free to submit a Pull Request.

0 commit comments

Comments
 (0)