Skip to content

Commit b0e7a88

Browse files
author
Tom Softreck
committed
Release version 0.3.95
### Changes since v0.3.94
1 parent 9dc5384 commit b0e7a88

35 files changed

Lines changed: 1273 additions & 19 deletions

.babelrc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"presets": [
3+
"@babel/preset-env",
4+
"@babel/preset-react"
5+
],
6+
"plugins": [
7+
"@babel/plugin-transform-runtime"
8+
]
9+
}

MyComponent2.js

Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
import React from 'react';
2+
import { LineChart, Line, XAxis, YAxis, CartesianGrid, Tooltip, Legend, ResponsiveContainer } from 'recharts';
3+
4+
// Generate data points for f(AGE) = 1 + mod(AGE - 18) functions
5+
const generateData = (modBase) => {
6+
const data = [];
7+
8+
for (let age = 1; age <= 100; age++) {
9+
// Calculate different mod variations
10+
const standardMod = Math.abs(age - 18);
11+
const moduloTenMod = (age - 18) % 10;
12+
const moduloFiveMod = (age - 18) % 5;
13+
14+
const standardBenefit = 1 / (1 + standardMod);
15+
const moduloTenBenefit = 1 / (1 + Math.abs(moduloTenMod));
16+
const moduloFiveBenefit = 1 / (1 + Math.abs(moduloFiveMod));
17+
18+
data.push({
19+
age: age,
20+
standardMod: standardMod,
21+
moduloTenMod: moduloTenMod,
22+
moduloFiveMod: moduloFiveMod,
23+
standardBenefit: Number(standardBenefit.toFixed(4)),
24+
moduloTenBenefit: Number(moduloTenBenefit.toFixed(4)),
25+
moduloFiveBenefit: Number(moduloFiveBenefit.toFixed(4))
26+
});
27+
}
28+
return data;
29+
};
30+
31+
export default function ModFunctionChart() {
32+
const data = generateData();
33+
34+
return (
35+
<div className="w-full h-[800px] p-4">
36+
<h2 className="text-center text-xl font-bold mb-4">Funkcje MOD różnych typów</h2>
37+
38+
<ResponsiveContainer width="100%" height="30%">
39+
<LineChart
40+
data={data}
41+
margin={{ top: 5, right: 30, left: 20, bottom: 5 }}
42+
>
43+
<CartesianGrid strokeDasharray="3 3" />
44+
<XAxis
45+
dataKey="age"
46+
label={{ value: 'Wiek', position: 'insideBottomRight', offset: -10 }}
47+
/>
48+
<YAxis
49+
label={{ value: 'Wartość MOD', angle: -90, position: 'insideLeft' }}
50+
/>
51+
<Tooltip />
52+
<Legend />
53+
<Line
54+
type="monotone"
55+
dataKey="standardMod"
56+
stroke="#8884d8"
57+
name="Wartość bezwzględna |AGE - 18|"
58+
/>
59+
<Line
60+
type="monotone"
61+
dataKey="moduloTenMod"
62+
stroke="#82ca9d"
63+
name="MOD(AGE - 18, 10)"
64+
/>
65+
<Line
66+
type="monotone"
67+
dataKey="moduloFiveMod"
68+
stroke="#ff7300"
69+
name="MOD(AGE - 18, 5)"
70+
/>
71+
</LineChart>
72+
</ResponsiveContainer>
73+
74+
<ResponsiveContainer width="100%" height="30%">
75+
<LineChart
76+
data={data}
77+
margin={{ top: 5, right: 30, left: 20, bottom: 5 }}
78+
>
79+
<CartesianGrid strokeDasharray="3 3" />
80+
<XAxis
81+
dataKey="age"
82+
label={{ value: 'Wiek', position: 'insideBottomRight', offset: -10 }}
83+
/>
84+
<YAxis
85+
label={{ value: 'Korzyść', angle: -90, position: 'insideLeft' }}
86+
/>
87+
<Tooltip />
88+
<Legend />
89+
<Line
90+
type="monotone"
91+
dataKey="standardBenefit"
92+
stroke="#8884d8"
93+
name="Korzyść (standardowa)"
94+
/>
95+
<Line
96+
type="monotone"
97+
dataKey="moduloTenBenefit"
98+
stroke="#82ca9d"
99+
name="Korzyść (MOD 10)"
100+
/>
101+
<Line
102+
type="monotone"
103+
dataKey="moduloFiveBenefit"
104+
stroke="#ff7300"
105+
name="Korzyść (MOD 5)"
106+
/>
107+
</LineChart>
108+
</ResponsiveContainer>
109+
110+
<div className="text-center mt-4">
111+
<h3 className="font-bold">Wzory funkcji MOD</h3>
112+
<ul className="list-disc list-inside text-left inline-block">
113+
<li>f(x) = 1 + |x - 18|</li>
114+
<li>f(x) = 1 + mod(x - 18, 10)</li>
115+
<li>f(x) = 1 + mod(x - 18, 5)</li>
116+
</ul>
117+
<p className="mt-2">Różne sposoby obliczania MOD:</p>
118+
<ul className="list-disc list-inside text-left inline-block">
119+
<li>Wartość bezwzględna: |x - 18|</li>
120+
<li>Modulo 10: reszta z dzielenia przez 10</li>
121+
<li>Modulo 5: reszta z dzielenia przez 5</li>
122+
</ul>
123+
</div>
124+
</div>
125+
);
126+
}

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,14 @@ reactstream serve <component1.js> [component2.js...] [options]
141141
reactstream serve MyComponent.js
142142
```
143143

144+
```bash
145+
npm run serve MyComponent.js
146+
```
147+
148+
```bash
149+
node src/reactstream.js serve MyComponent.js
150+
```
151+
144152
![img_1.png](img/img_1.png)
145153

146154

img/img.png

-140 KB
Binary file not shown.

package.json

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"version": "0.3.95",
44
"description": "CLI tool for React component development and debugging",
55
"main": "index.js",
6+
"type": "commonjs",
67
"bin": {
78
"reactstream": "./bin/reactstream.js",
89
"reactstream-analyze": "./bin/reactstream-analyze.js"
@@ -15,7 +16,7 @@
1516
"increment": "bash version.sh",
1617
"publish-npm": "bash version.sh --no-publish && npm publish --access=public",
1718
"analyze": "node bin/reactstream-analyze.js",
18-
"serve": "node index.js serve",
19+
"serve": "node bin/reactstream.js serve",
1920
"clean": "bash start.sh clean",
2021
"build": "echo \"No build step required\"",
2122
"release:patch": "bash version.sh --patch",
@@ -24,29 +25,30 @@
2425
"release": "bash version.sh"
2526
},
2627
"dependencies": {
27-
"@babel/core": "^7.23.7",
28-
"@babel/eslint-parser": "^7.23.3",
29-
"@babel/preset-env": "^7.23.7",
30-
"@babel/preset-react": "^7.23.3",
31-
"babel-loader": "^9.1.3",
28+
"@babel/core": "^7.26.10",
29+
"@babel/eslint-parser": "^7.27.0",
30+
"@babel/preset-env": "^7.26.9",
31+
"@babel/preset-react": "^7.26.3",
32+
"babel-loader": "^10.0.0",
3233
"chalk": "^4.1.2",
33-
"css-loader": "^6.8.1",
34+
"css-loader": "^7.1.2",
3435
"escodegen": "^2.1.0",
35-
"eslint": "^8.56.0",
36-
"eslint-plugin-react": "^7.33.2",
37-
"eslint-plugin-react-hooks": "^4.6.0",
36+
"eslint": "^9.23.0",
37+
"eslint-plugin-react": "^7.37.4",
38+
"eslint-plugin-react-hooks": "^5.2.0",
3839
"esprima": "^4.0.1",
3940
"estraverse": "^5.3.0",
40-
"express": "^4.18.2",
41+
"express": "^5.1.0",
4142
"minimist": "^1.2.8",
42-
"react": "^18.2.0",
43-
"react-dom": "^18.2.0",
44-
"style-loader": "^3.3.3",
45-
"uuid": "^9.0.1",
46-
"webpack": "^5.89.0",
47-
"webpack-dev-server": "^4.15.1",
48-
"webpack-cli": "^5.1.4",
49-
"rimraf": "^5.0.5"
43+
"react": "^19.1.0",
44+
"react-dom": "^19.1.0",
45+
"recharts": "^2.15.1",
46+
"rimraf": "^6.0.1",
47+
"style-loader": "^4.0.0",
48+
"uuid": "^11.1.0",
49+
"webpack": "^5.98.0",
50+
"webpack-cli": "^6.0.1",
51+
"webpack-dev-server": "^5.2.1"
5052
},
5153
"engines": {
5254
"node": ">=14.0.0"

web/.env

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Server Configuration
2+
SERVER_PORT=80
3+
DEV_SERVER_PORT=3000
4+
NODE_ENV=production
5+
6+
# Application Settings
7+
ENABLE_DEBUG=false
8+
AUTO_FIX=false
9+
VERBOSE_OUTPUT=true
10+
11+
# MongoDB Connection (if needed in the future)
12+
# MONGODB_URI=mongodb://localhost:27017/reactstream
13+
14+
# Redis Connection (if needed in the future)
15+
# REDIS_URL=redis://localhost:6379
16+
17+
# Security Settings
18+
SESSION_SECRET=reactstream-secret-key-change-in-production
19+
CORS_ORIGIN=*
20+
21+
# Docker Settings
22+
VIRTUAL_HOST=www.reactstream.com
23+
LETSENCRYPT_HOST=www.reactstream.com
24+
LETSENCRYPT_EMAIL=admin@reactstream.com
25+
26+
# Paths
27+
TEMP_DIR=./temp
28+
COMPONENTS_DIR=./components
29+
LOGS_DIR=./logs

web/.env.example

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Server Configuration
2+
SERVER_PORT=80
3+
DEV_SERVER_PORT=3000
4+
NODE_ENV=production
5+
6+
# Application Settings
7+
ENABLE_DEBUG=false
8+
AUTO_FIX=false
9+
VERBOSE_OUTPUT=true
10+
11+
# MongoDB Connection (if needed in the future)
12+
# MONGODB_URI=mongodb://localhost:27017/reactstream
13+
14+
# Redis Connection (if needed in the future)
15+
# REDIS_URL=redis://localhost:6379
16+
17+
# Security Settings
18+
SESSION_SECRET=reactstream-secret-key-change-in-production
19+
CORS_ORIGIN=*
20+
21+
# Docker Settings
22+
VIRTUAL_HOST=www.reactstream.com
23+
LETSENCRYPT_HOST=www.reactstream.com
24+
LETSENCRYPT_EMAIL=admin@reactstream.com
25+
26+
# Paths
27+
TEMP_DIR=./temp
28+
COMPONENTS_DIR=./components
29+
LOGS_DIR=./logs

web/Dockerfile

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
FROM node:16-alpine
2+
3+
WORKDIR /app
4+
5+
# Install dependencies
6+
COPY package*.json ./
7+
RUN npm install
8+
9+
# Copy application code
10+
COPY .. .
11+
12+
# Install global dependencies
13+
RUN npm install -g @babel/core @babel/preset-env @babel/preset-react eslint
14+
15+
# Build the application
16+
RUN npm run build
17+
18+
# Expose ports for the web interface and development server
19+
EXPOSE 80 3000
20+
21+
# Start the application
22+
CMD ["npm", "start"]

0 commit comments

Comments
 (0)