Skip to content

Commit 8d1dc2a

Browse files
committed
fix(ci): fix ci build, update nodejs and fix react jsx
1 parent 1a300c7 commit 8d1dc2a

File tree

9 files changed

+263
-12072
lines changed

9 files changed

+263
-12072
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313

1414
strategy:
1515
matrix:
16-
node-version: [16.x]
16+
node-version: [20.x]
1717

1818
steps:
1919
- uses: actions/checkout@v2

.github/workflows/github-pages.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
- name: Setup NodeJS
1515
uses: actions/setup-node@v2.4.1
1616
with:
17-
node-version: 16
17+
node-version: 20
1818
registry-url: https://registry.npmjs.org/
1919

2020
- name: Checkout

.github/workflows/tagged-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
- uses: actions/checkout@v1
2222
- uses: actions/setup-node@v1
2323
with:
24-
node-version: 16
24+
node-version: 20
2525
registry-url: https://registry.npmjs.org/
2626
- run: npm ci
2727
- run: npm run build:npm

.stylelintrc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
"plugins": ["stylelint-prettier"],
33
"extends": [
44
"stylelint-config-standard",
5-
"stylelint-config-prettier",
65
"stylelint-config-css-modules"
76
],
87
"ignoreFiles": [

README.md

Lines changed: 58 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,64 @@ const flameChart = new FlameChartContainer({
141141

142142
#### Usage with React
143143

144-
You can use the [classic flame chart with react like this](https://github.com/pyatyispyatil/flame-chart-js/blob/master/example/src/components/charts/flame-chart-wrapper.tsx) or [like this with pluggins](https://github.com/pyatyispyatil/flame-chart-js/blob/master/example/src/components/charts/flame-chart-container-wrapper.tsx).
144+
Default flame chart:
145+
```tsx
146+
import { FlameChartWrapper } from 'flame-chart-js/react';
147+
148+
export const DefaultFlameChart = ({
149+
flameChartData,
150+
stylesSettings,
151+
onSelect,
152+
}) => {
153+
const settings = useMemo(
154+
() => ({
155+
styles: stylesSettings,
156+
}),
157+
[stylesSettings],
158+
);
159+
160+
return (
161+
<FlameChartWrapper
162+
data={flameChartData}
163+
settings={settings}
164+
onSelect={onSelect}
165+
className={styles.flameChart}
166+
/>
167+
);
168+
};
169+
```
170+
171+
Custom flame chart:
172+
```tsx
173+
import { FlameChartContainerWrapper } from 'flame-chart-js/react';
174+
175+
const CustomFlameChart = ({ flameChartData, stylesSettings }) => {
176+
const plugins = useMemo(() => {
177+
return [
178+
new TimeGridPlugin(),
179+
new TogglePlugin('FlameChart 1'),
180+
new FlameChartPlugin({
181+
name: 'flameChart1',
182+
data: flameChartData[0],
183+
}),
184+
new TogglePlugin('FlameChart 2'),
185+
new FlameChartPlugin({
186+
name: 'flameChart2',
187+
data: flameChartData[1],
188+
}),
189+
];
190+
}, [flameChartData]);
191+
192+
const settings = useMemo(
193+
() => ({
194+
styles: stylesSettings,
195+
}),
196+
[stylesSettings],
197+
);
198+
199+
return <FlameChartContainerWrapper settings={settings} plugins={plugins} className={styles.flameChart} />;
200+
};
201+
```
145202

146203
#### Settings
147204

0 commit comments

Comments
 (0)