Skip to content

Commit 95f2a92

Browse files
authored
fix : Update license in package.json and added SSR support (#13)
1 parent 5ba8670 commit 95f2a92

File tree

6 files changed

+24
-16
lines changed

6 files changed

+24
-16
lines changed

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2023 aarathyKeyvalue
3+
Copyright (c) 2023 keyvalue software systems
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ npm install @keyvaluesystems/react-dot-matrix-chart
2020

2121
You’ll need to install React separately since it isn't included in the package.
2222

23+
Note for **Next.js** users, if you are using Next.js version 13 or later, you will have to use the `use client` feature to ensure proper compatibility.
24+
2325
## Usage
2426

2527
React Dot Matrix Chart can run in a very basic mode by just providing the `dataPoints` like given below:
@@ -153,9 +155,9 @@ the below code shows all the overridable styles:
153155
/>
154156
```
155157

156-
- `Container` - overrides the dot matrix chart container style
157-
- `DotsContainer` - overrides the dot matrix chart dots container style
158-
- `Dot` - overrides the style of each dot in the chart
159-
- `LegendContainer` - overrides the legend (details) container style
160-
- `LegendName` - overrides the legend name style
161-
- `LegendDot` - overrides the legend dot style
158+
- `Container` - Overrides the dot matrix chart container style
159+
- `DotsContainer` - Overrides the dot matrix chart dots container style
160+
- `Dot` - Overrides the style of each dot in the chart
161+
- `LegendContainer` - Overrides the legend (details) container style
162+
- `LegendName` - Overrides the legend name style
163+
- `LegendDot` - Overrides the legend dot style

package-lock.json

Lines changed: 5 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,14 @@
2424
"url": "https://github.com/KeyValueSoftwareSystems/react-dot-matrix-chart"
2525
},
2626
"author": "Keyvalue",
27-
"license": "",
27+
"license": "MIT",
2828
"homepage": "https://github.com/KeyValueSoftwareSystems/react-dot-matrix-chart",
2929
"keywords": [
3030
"library",
3131
"starter",
32-
"es6"
32+
"es6",
33+
"react",
34+
"nextjs"
3335
],
3436
"devDependencies": {
3537
"@babel/cli": "^7.20.7",
@@ -71,7 +73,7 @@
7173
"react-scripts": "5.0.1",
7274
"sass": "^1.58.3",
7375
"sass-loader": "^13.2.0",
74-
"style-loader": "^3.3.1",
76+
"style-loader": "^3.3.3",
7577
"terser-webpack-plugin": "^5.3.5",
7678
"ts-jest": "^29.0.5",
7779
"ts-loader": "^9.4.2",

src/lib/dot-matrix/custom-hooks/useChartContainerWidth.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const useChartContainerWidth = (
1818
}, [...dependencyArray]);
1919

2020
useEffect(() => {
21-
if (typeof window !== "undefined") {
21+
if (typeof window !== undefined) {
2222
window.addEventListener("resize", updateContainerWidth);
2323

2424
return () => {
@@ -29,7 +29,7 @@ const useChartContainerWidth = (
2929

3030
const updateContainerWidth = (): void => {
3131
let widthValue;
32-
if (typeof window !== "undefined") widthValue = findContainerWidth(id);
32+
if (typeof window !== undefined) widthValue = findContainerWidth(id);
3333
if (widthValue) setWidth(widthValue);
3434
};
3535
return width;

webpack.config.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ module.exports = {
3333
path: path.resolve(__dirname, 'build'),
3434
library: "DotMatrixChart",
3535
libraryTarget: 'umd',
36-
clean: true
36+
clean: true,
37+
globalObject: 'this'
38+
3739
},
3840
externals: {
3941
'react': 'react'

0 commit comments

Comments
 (0)