@neo4j-ndl/react-charts 1.4.2 → 2.0.0-alpha.0.3d763f7

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.
Files changed (32) hide show
  1. package/lib/cjs/charts/Chart.js +5 -5
  2. package/lib/cjs/charts/Chart.js.map +1 -1
  3. package/lib/cjs/charts/Legend.js +2 -2
  4. package/lib/cjs/charts/Legend.js.map +1 -1
  5. package/lib/cjs/charts/LegendItem.js +5 -5
  6. package/lib/cjs/charts/LegendItem.js.map +1 -1
  7. package/lib/cjs/charts/tests/PieChartWithRerender.js +1 -1
  8. package/lib/cjs/charts/tests/PieChartWithRerender.js.map +1 -1
  9. package/lib/cjs/charts/tests/chart-test-utils.js +5 -5
  10. package/lib/cjs/charts/tests/chart-test-utils.js.map +1 -1
  11. package/lib/cjs/charts/utils/chart-types.js.map +1 -1
  12. package/lib/esm/charts/Chart.js +5 -5
  13. package/lib/esm/charts/Chart.js.map +1 -1
  14. package/lib/esm/charts/Legend.js +2 -2
  15. package/lib/esm/charts/Legend.js.map +1 -1
  16. package/lib/esm/charts/LegendItem.js +5 -5
  17. package/lib/esm/charts/LegendItem.js.map +1 -1
  18. package/lib/esm/charts/tests/PieChartWithRerender.js +1 -1
  19. package/lib/esm/charts/tests/PieChartWithRerender.js.map +1 -1
  20. package/lib/esm/charts/tests/chart-test-utils.js +5 -5
  21. package/lib/esm/charts/tests/chart-test-utils.js.map +1 -1
  22. package/lib/esm/charts/utils/chart-types.js.map +1 -1
  23. package/lib/types/charts/Chart.d.ts.map +1 -1
  24. package/lib/types/charts/LegendItem.d.ts +1 -1
  25. package/lib/types/charts/LegendItem.d.ts.map +1 -1
  26. package/lib/types/charts/tests/chart-test-utils.d.ts +5 -5
  27. package/lib/types/charts/utils/chart-types.d.ts +13 -9
  28. package/lib/types/charts/utils/chart-types.d.ts.map +1 -1
  29. package/package.json +6 -4
  30. package/skills/ndl-react-charts/SKILL.md +3 -3
  31. package/skills/ndl-react-charts/components/charts.md +23 -29
  32. package/skills/ndl-react-charts/references/styling.md +28 -21
@@ -15,7 +15,7 @@ Import: `import { Chart } from '@neo4j-ndl/react-charts'`
15
15
  | `dataZoom` | `DataZoomComponentOption \| DataZoomComponentOption[]` | | | Data zoom configuration for the chart. |
16
16
  | `isChartZoomDisabled` | `boolean` | | | Whether the zoom in the chart is disabled |
17
17
  | `isLoading` | `boolean` | | | Whether the chart is in a loading state. |
18
- | `legend` | `{ show?: boolean; wrappingType?: "wrapping" \| "truncation" \| "overflow"; } \| undefined` | | | Legend configuration for the chart. `wrappingType` is deprecated and no longer has any effect since wrapping is now automatic, will be removed in v 5 |
18
+ | `legend` | `{ isVisible?: boolean; }` | | | Legend configuration for the chart. |
19
19
  | `option` | `Omit<EChartsOption, "legend" \| "dataset" \| "series" \| "xAxis" \| "yAxis">` | | | Additional ECharts options to merge with the chart configuration. |
20
20
  | `palette` | `` `#${string}`[] `` | | | Custom color palette that overrides the default categorical colors. |
21
21
  | `series` | `NeedleSeries` | ✅ | | The series configuration for the chart. Defines what data to display and how to display it. |
@@ -73,7 +73,7 @@ const Component = () => {
73
73
  >
74
74
  <Chart
75
75
  legend={{
76
- show: true,
76
+ isVisible: true,
77
77
  }}
78
78
  dataset={[
79
79
  {
@@ -218,9 +218,7 @@ const Component = () => {
218
218
  }}
219
219
  >
220
220
  <Chart
221
- legend={{
222
- show: true,
223
- }}
221
+ legend={{ isVisible: true }}
224
222
  dataset={[
225
223
  {
226
224
  source: [
@@ -353,7 +351,7 @@ const Component = () => {
353
351
  nameLocation: 'middle',
354
352
  type: 'value',
355
353
  }}
356
- legend={{ show: true }}
354
+ legend={{ isVisible: true }}
357
355
  />
358
356
  </div>
359
357
  );
@@ -382,9 +380,7 @@ const Component = () => {
382
380
  }}
383
381
  >
384
382
  <Chart
385
- legend={{
386
- show: true,
387
- }}
383
+ legend={{ isVisible: true }}
388
384
  dataset={{
389
385
  dimensions: ['day', 'First', 'Second', 'Third'],
390
386
  source: [
@@ -463,9 +459,7 @@ const Component = () => {
463
459
  ],
464
460
  },
465
461
  ]}
466
- legend={{
467
- show: true,
468
- }}
462
+ legend={{ isVisible: true }}
469
463
  yAxis={{
470
464
  data: ['Friday', 'Saturday', 'Sunday'],
471
465
  splitLine: { show: true },
@@ -523,7 +517,7 @@ const Component = () => {
523
517
  >
524
518
  <Chart
525
519
  legend={{
526
- show: true,
520
+ isVisible: true,
527
521
  }}
528
522
  dataset={{
529
523
  source: [
@@ -579,7 +573,7 @@ const Component = () => {
579
573
  >
580
574
  <Chart
581
575
  legend={{
582
- show: true,
576
+ isVisible: true,
583
577
  }}
584
578
  dataset={{
585
579
  source: [
@@ -641,7 +635,7 @@ const Component = () => {
641
635
  >
642
636
  <Chart
643
637
  legend={{
644
- show: true,
638
+ isVisible: true,
645
639
  }}
646
640
  dataset={{
647
641
  dimensions: ['Country', 'Sales'],
@@ -702,7 +696,7 @@ const Component = () => {
702
696
  <Chart
703
697
  palette={['#E63946', '#457B9D', '#2A9D8F', '#E9C46A', '#F4A261']}
704
698
  legend={{
705
- show: true,
699
+ isVisible: true,
706
700
  }}
707
701
  dataset={[
708
702
  {
@@ -822,7 +816,7 @@ const Component = () => {
822
816
  >
823
817
  <Chart
824
818
  legend={{
825
- show: true,
819
+ isVisible: true,
826
820
  }}
827
821
  dataset={[
828
822
  {
@@ -921,7 +915,7 @@ const Component = () => {
921
915
  >
922
916
  <Chart
923
917
  legend={{
924
- show: true,
918
+ isVisible: true,
925
919
  }}
926
920
  dataset={[
927
921
  {
@@ -1103,7 +1097,7 @@ const Component = () => {
1103
1097
  yAxis={chartData.yAxis}
1104
1098
  series={chartData.series}
1105
1099
  legend={{
1106
- show: true,
1100
+ isVisible: true,
1107
1101
  }}
1108
1102
  />
1109
1103
  </div>
@@ -1134,7 +1128,7 @@ const Component = () => {
1134
1128
  >
1135
1129
  <Chart
1136
1130
  legend={{
1137
- show: true,
1131
+ isVisible: true,
1138
1132
  }}
1139
1133
  isLoading
1140
1134
  dataset={[
@@ -1281,7 +1275,7 @@ const Component = () => {
1281
1275
  >
1282
1276
  <Chart
1283
1277
  legend={{
1284
- show: true,
1278
+ isVisible: true,
1285
1279
  }}
1286
1280
  dataset={[
1287
1281
  {
@@ -1515,7 +1509,7 @@ const Component = () => {
1515
1509
  },
1516
1510
  ],
1517
1511
  legend: {
1518
- show: true,
1512
+ isVisible: true,
1519
1513
  },
1520
1514
  option: {
1521
1515
  tooltip: {
@@ -1564,7 +1558,7 @@ const Component = () => {
1564
1558
 
1565
1559
  return (
1566
1560
  <>
1567
- <div className="n-flex n-flex-row n-gap-4 n-mb-4">
1561
+ <div className="flex flex-row gap-4 mb-4">
1568
1562
  {yDimensions.map((yDimension) => (
1569
1563
  <Checkbox
1570
1564
  key={yDimension}
@@ -1617,7 +1611,7 @@ const Component = () => {
1617
1611
  >
1618
1612
  <Chart
1619
1613
  legend={{
1620
- show: true,
1614
+ isVisible: true,
1621
1615
  }}
1622
1616
  dataset={[
1623
1617
  {
@@ -1747,7 +1741,7 @@ const Component = () => {
1747
1741
  >
1748
1742
  <Chart
1749
1743
  legend={{
1750
- show: true,
1744
+ isVisible: true,
1751
1745
  }}
1752
1746
  option={{
1753
1747
  tooltip: {
@@ -2153,7 +2147,7 @@ const Component = () => {
2153
2147
  >
2154
2148
  <Chart
2155
2149
  legend={{
2156
- show: true,
2150
+ isVisible: true,
2157
2151
  }}
2158
2152
  dataset={[
2159
2153
  {
@@ -2302,7 +2296,7 @@ const Component = () => {
2302
2296
  >
2303
2297
  <Chart
2304
2298
  legend={{
2305
- show: true,
2299
+ isVisible: true,
2306
2300
  }}
2307
2301
  dataset={{
2308
2302
  dimensions: ['language', 'Repositories'],
@@ -2406,7 +2400,7 @@ const Component = () => {
2406
2400
  >
2407
2401
  <Chart
2408
2402
  legend={{
2409
- show: true,
2403
+ isVisible: true,
2410
2404
  }}
2411
2405
  dataset={[
2412
2406
  {
@@ -2482,7 +2476,7 @@ const Component = () => {
2482
2476
  >
2483
2477
  <Chart
2484
2478
  legend={{
2485
- show: true,
2479
+ isVisible: true,
2486
2480
  }}
2487
2481
  dataset={[
2488
2482
  {
@@ -16,28 +16,34 @@ file uses.
16
16
 
17
17
  ### What the prebuilt stylesheet contains
18
18
 
19
- Besides the `ndl-*` component classes and the CSS custom properties, the
20
- prebuilt stylesheet ships only two groups of `n-` classes:
21
-
22
- - **Typography** — `n-display`, `n-title-1` … `n-title-4`,
23
- `n-subheading-large/medium/small`, `n-body-large/medium/small`, `n-label`,
24
- `n-code`.
25
- - **Semantic colors** — `n-text-*`, `n-bg-*`, `n-border-*` for the color
26
- families below, plus `hover:` variants (and `active:` for `n-bg-*`). These
27
- are safelisted in the Tailwind preset.
19
+ Besides the component-internal `ndl-*` classes and the CSS custom properties,
20
+ the prebuilt stylesheet ships only two groups of classes meant for consumers:
21
+
22
+ - **Typography** — `ndl-typography-display`, `ndl-typography-title-1` …
23
+ `ndl-typography-title-4`, `ndl-typography-subheading-large/medium/small`,
24
+ `ndl-typography-body-large/medium/small`, `ndl-typography-label`,
25
+ `ndl-typography-code` (the legacy `n-body-medium`-style names still work as
26
+ aliases).
27
+ - **Semantic colors** — `text-*`, `bg-*`, `border-*` for the color families
28
+ below, plus `hover:` variants (and `active:` for `bg-*`). These are
29
+ safelisted in the Tailwind preset.
30
+
31
+ Only `ndl-typography-*` and `ndl-theme-light`/`ndl-theme-dark` are public
32
+ `ndl-*` classes; every other `ndl-*` class belongs to a component and must not
33
+ be styled against.
28
34
 
29
35
  **No other Tailwind utility is guaranteed to be in the prebuilt stylesheet.**
30
36
  A utility only ships if Needle's component source uses it, and component
31
37
  source no longer uses Tailwind utilities. Layout, spacing, sizing, radius and
32
- shadow utilities (`n-flex`, `n-items-center`, `n-gap-token-8`, `n-p-4`,
33
- `n-w-full`, `n-rounded-lg`, …) are absent and silently render nothing unless
34
- the consuming app runs its own Tailwind build with the Needle preset.
38
+ shadow utilities (`flex`, `items-center`, `gap-token-8`, `p-4`, `w-full`,
39
+ `rounded-lg`, …) are absent and silently render nothing unless the consuming
40
+ app runs its own Tailwind build with the Needle preset.
35
41
 
36
42
  ### Quick verification
37
43
 
38
44
  ```sh
39
45
  CSS=node_modules/@neo4j-ndl/base/lib/neo4j-ds-styles.css
40
- grep -qE '\.n-body-medium\b' "$CSS" && echo "exists" || echo "MISSING"
46
+ grep -qE '\.ndl-typography-body-medium\b' "$CSS" && echo "exists" || echo "MISSING"
41
47
  grep -qE -- '--space-8:' "$CSS" && echo "exists" || echo "MISSING"
42
48
  ```
43
49
 
@@ -125,7 +131,7 @@ props over raw utility classes for layout. Without an app Tailwind build they
125
131
  are the only reliable option; for anything they don't cover, use an inline
126
132
  `style` with a token, e.g. `style={{ margin: 'var(--space-8)' }}`.
127
133
 
128
- ## Tailwind builds and the `n-` prefix
134
+ ## Tailwind builds and the class prefix
129
135
 
130
136
  Whether a utility class works depends on the consuming app:
131
137
 
@@ -133,9 +139,10 @@ Whether a utility class works depends on the consuming app:
133
139
  the [typography and color classes](#what-the-prebuilt-stylesheet-contains)
134
140
  exist.
135
141
  - **Tailwind build with the Needle preset** — any standard utility is generated
136
- on demand. The preset sets `prefix: 'n-'`, so `n-flex`, `n-gap-4` and
137
- `n-bg-primary-bg-weak` work. If the app sets its own `prefix` (including
138
- `prefix: ''`), the app's config wins.
142
+ on demand. Since `@neo4j-ndl/base` v5 the preset sets no prefix, so `flex`,
143
+ `gap-4` and `bg-primary-bg-weak` work. If the app sets its own `prefix`
144
+ (apps on base v4 got `n-` by default), the app's config wins and every
145
+ utility carries that prefix (`n-flex`).
139
146
 
140
147
  Check the app's `tailwind.config` — whether it exists, and its `prefix` —
141
148
  before writing any utility class.
@@ -163,10 +170,10 @@ order. Each level is more error-prone than the one before it:
163
170
  `size="small"`, `ariaLabel`.
164
171
 
165
172
  2. **`className`** — for utility classes the component doesn't cover (e.g.
166
- `n-text-neutral-text-weak` or `n-body-small`). Verify every class against
167
- `node_modules/@neo4j-ndl/base/lib/neo4j-ds-styles.css`, or against the app's
168
- own Tailwind build. Layout utilities such as `n-flex` work only with an app
169
- Tailwind build. A wrong class compiles and silently renders nothing.
173
+ `text-neutral-text-weak` or `ndl-typography-body-small`). Verify every class
174
+ against `node_modules/@neo4j-ndl/base/lib/neo4j-ds-styles.css`, or against
175
+ the app's own Tailwind build. Layout utilities such as `flex` work only with
176
+ an app Tailwind build. A wrong class compiles and silently renders nothing.
170
177
 
171
178
  3. **`htmlAttributes`** — escape hatch for native HTML attributes, `aria-*`, and
172
179
  `data-*` the component doesn't expose as props (e.g. `id` for