@dschz/solid-uplot 0.5.0 → 0.5.2
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.
- package/README.md +47 -49
- package/dist/plugins/index.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -33,6 +33,30 @@ yarn install solid-js uplot @dschz/solid-uplot
|
|
|
33
33
|
bun install solid-js uplot @dschz/solid-uplot
|
|
34
34
|
```
|
|
35
35
|
|
|
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
|
+
|
|
36
60
|
## 📁 Package Structure
|
|
37
61
|
|
|
38
62
|
This package provides three main export paths for different functionality:
|
|
@@ -187,6 +211,29 @@ import { AutoSizer } from "@dschz/solid-auto-sizer";
|
|
|
187
211
|
</AutoSizer>;
|
|
188
212
|
```
|
|
189
213
|
|
|
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
|
+
|
|
190
237
|
## 🔌 Enhanced Plugin System
|
|
191
238
|
|
|
192
239
|
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 = () => {
|
|
|
721
768
|
};
|
|
722
769
|
```
|
|
723
770
|
|
|
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
|
-
|
|
773
771
|
## 🤝 Contributing
|
|
774
772
|
|
|
775
773
|
Contributions are welcome! Please feel free to submit a Pull Request.
|
package/dist/plugins/index.js
CHANGED
|
@@ -192,7 +192,7 @@ var legend = (Component, options = {}) => {
|
|
|
192
192
|
"max-width": `${overRect.width - offset * 2}px`,
|
|
193
193
|
"max-height": `${overRect.height - offset * 2}px`,
|
|
194
194
|
"z-index": containerProps.zIndex,
|
|
195
|
-
"pointer-events": "
|
|
195
|
+
"pointer-events": "none",
|
|
196
196
|
overflow: "auto",
|
|
197
197
|
...containerProps.style
|
|
198
198
|
};
|
package/package.json
CHANGED