@statisticsfinland/pxvisualizer 1.2.0-d.1 → 1.2.0-d.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 +11 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -4,9 +4,19 @@ PxVisualizer is used to draw visualizations of PxGraf visualization API response
|
|
|
4
4
|
|
|
5
5
|
The software is provided as is and Statistics Finland will **not** offer any support for setting up PxVisualizer or solving issues related to it.
|
|
6
6
|
|
|
7
|
-
**IMPORTANT:**
|
|
7
|
+
## **IMPORTANT:**
|
|
8
|
+
|
|
9
|
+
### HighCharts license
|
|
10
|
+
PxVisualizer package uses HighCharts for rendering the visualizations. Please note that commercial use of HighCharts requires a commercial license. Non-commercial use may qualify for a free educational or personal license. Read more about licenses
|
|
8
11
|
in the [HighCharts shop](https://shop.highsoft.com/?utm_source=npmjs&utm_medium=referral&utm_campaign=highchartspage&utm_content=licenseinfo).
|
|
9
12
|
|
|
13
|
+
### HighCharts and Server-Side Rendering
|
|
14
|
+
PxVisualizer uses a module from HighCharts (fill-pattern) that is incompatible with server-side rendering. If you use a framework such as Next.js, you need to ensure that the PxVisualizer exports are only loaded in client side components. This can be done by using dynamic imports with the `ssr: false` option. For example:
|
|
15
|
+
```javascript
|
|
16
|
+
import dynamic from 'next/dynamic';
|
|
17
|
+
const Chart = dynamic(() => import('@statisticsfinland/pxvisualizer').then(mod => mod.Chart), { ssr: false });
|
|
18
|
+
```
|
|
19
|
+
|
|
10
20
|
## Implementation
|
|
11
21
|
Implementing a visualization requires importing either the Chart or drawChart component from the PxVisualizer package and passing required and optional props to it. The Chart component will then render the visualization based on the provided data.
|
|
12
22
|
|