Skip to content

Commit 1dff5d0

Browse files
committed
Make some chart props optional; remove hardcoded strokes
Document QuadrantChart `quadrants` as optional overrides and mark LikertChart `levels` as optional across rule/docs files (.clinerules, .cursorrules, .windsurfrules, .github/copilot-instructions.md). Also remove hardcoded `stroke: "#007bff"` from several examples in integration-tests/xy-examples/index.js so examples rely on the configured colorScheme instead. These changes improve consistency and configurability of examples and docs.
1 parent ba84c51 commit 1dff5d0

5 files changed

Lines changed: 8 additions & 14 deletions

File tree

.clinerules

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
**Scatterplot** — `data`, `xAccessor`, `yAccessor`, `colorBy`, `sizeBy`, `sizeRange`, `pointRadius` (5), `pointOpacity` (0.8), `marginalGraphics`, `regression` (boolean | "linear" | "polynomial" | "loess" | RegressionConfig — sugar for a trend-annotation overlay; sits underneath user annotations)
3131
**BubbleChart** — Scatterplot + `sizeBy` (required), `sizeRange` ([5,40]), `regression`
3232
**ConnectedScatterplot** — + `orderAccessor`, `regression`
33-
**QuadrantChart** — Scatterplot + `quadrants` (required), `xCenter`, `yCenter`
33+
**QuadrantChart** — Scatterplot + optional `quadrants` overrides, `xCenter`, `yCenter`
3434
**MultiAxisLineChart** — Dual Y-axis. `series` (required: `[{ yAccessor, label?, color?, format?, extent? }]`). Falls back to multi-line if not 2 series.
3535
**Heatmap** — `data`, `xAccessor`, `yAccessor`, `valueAccessor`, `colorScheme`, `showValues`, `cellBorderColor`
3636
**ScatterplotMatrix** — `data`, `fields` (array of numeric field names for grid)
@@ -52,7 +52,7 @@
5252
**DonutChart** — PieChart + `innerRadius` (60), `centerContent`
5353
**FunnelChart** — `stepAccessor`, `valueAccessor`, `categoryAccessor` (optional), `connectorOpacity`, `orientation`
5454
**SwimlaneChart** — `categoryAccessor`, `subcategoryAccessor` (required), `valueAccessor`, `colorBy` (defaults to subcategoryAccessor), `orientation`, `roundedTop` (pixel radius applied to both outer ends of each lane — left+right for horizontal, top+bottom for vertical. Middle segments stay square so adjacent pieces butt against each other; single-segment lanes round all four corners.)
55-
**LikertChart** — `categoryAccessor`, `valueAccessor`|`levelAccessor`+`countAccessor`, `levels` (required), `orientation`, `colorScheme`
55+
**LikertChart** — `categoryAccessor`, `valueAccessor`|`levelAccessor`+`countAccessor`, optional `levels`, `orientation`, `colorScheme`
5656
**GaugeChart** — `value` (required), `min`, `max`, `thresholds`, `arcWidth`, `cornerRadius` (pixel radius for rounded segment ends — same semantics as DonutChart), `sweep`, `fillZones`, `showNeedle`, `centerContent`
5757

5858
All ordinal: `colorBy`, `colorScheme`, `categoryFormat` (string|ReactNode), `showCategoryTicks` (true).

.cursorrules

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
**Scatterplot** — `data`, `xAccessor`, `yAccessor`, `colorBy`, `sizeBy`, `sizeRange`, `pointRadius` (5), `pointOpacity` (0.8), `marginalGraphics`, `regression` (boolean | "linear" | "polynomial" | "loess" | RegressionConfig — sugar for a trend-annotation overlay; sits underneath user annotations)
3131
**BubbleChart** — Scatterplot + `sizeBy` (required), `sizeRange` ([5,40]), `regression`
3232
**ConnectedScatterplot** — + `orderAccessor`, `regression`
33-
**QuadrantChart** — Scatterplot + `quadrants` (required), `xCenter`, `yCenter`
33+
**QuadrantChart** — Scatterplot + optional `quadrants` overrides, `xCenter`, `yCenter`
3434
**MultiAxisLineChart** — Dual Y-axis. `series` (required: `[{ yAccessor, label?, color?, format?, extent? }]`). Falls back to multi-line if not 2 series.
3535
**Heatmap** — `data`, `xAccessor`, `yAccessor`, `valueAccessor`, `colorScheme`, `showValues`, `cellBorderColor`
3636
**ScatterplotMatrix** — `data`, `fields` (array of numeric field names for grid)
@@ -52,7 +52,7 @@
5252
**DonutChart** — PieChart + `innerRadius` (60), `centerContent`
5353
**FunnelChart** — `stepAccessor`, `valueAccessor`, `categoryAccessor` (optional), `connectorOpacity`, `orientation`
5454
**SwimlaneChart** — `categoryAccessor`, `subcategoryAccessor` (required), `valueAccessor`, `colorBy` (defaults to subcategoryAccessor), `orientation`, `roundedTop` (pixel radius applied to both outer ends of each lane — left+right for horizontal, top+bottom for vertical. Middle segments stay square so adjacent pieces butt against each other; single-segment lanes round all four corners.)
55-
**LikertChart** — `categoryAccessor`, `valueAccessor`|`levelAccessor`+`countAccessor`, `levels` (required), `orientation`, `colorScheme`
55+
**LikertChart** — `categoryAccessor`, `valueAccessor`|`levelAccessor`+`countAccessor`, optional `levels`, `orientation`, `colorScheme`
5656
**GaugeChart** — `value` (required), `min`, `max`, `thresholds`, `arcWidth`, `cornerRadius` (pixel radius for rounded segment ends — same semantics as DonutChart), `sweep`, `fillZones`, `showNeedle`, `centerContent`
5757

5858
All ordinal: `colorBy`, `colorScheme`, `categoryFormat` (string|ReactNode), `showCategoryTicks` (true).

.github/copilot-instructions.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
**Scatterplot**`data`, `xAccessor`, `yAccessor`, `colorBy`, `sizeBy`, `sizeRange`, `pointRadius` (5), `pointOpacity` (0.8), `marginalGraphics`, `regression` (boolean | "linear" | "polynomial" | "loess" | RegressionConfig — sugar for a trend-annotation overlay; sits underneath user annotations)
3131
**BubbleChart** — Scatterplot + `sizeBy` (required), `sizeRange` ([5,40]), `regression`
3232
**ConnectedScatterplot** — + `orderAccessor`, `regression`
33-
**QuadrantChart** — Scatterplot + `quadrants` (required), `xCenter`, `yCenter`
33+
**QuadrantChart** — Scatterplot + optional `quadrants` overrides, `xCenter`, `yCenter`
3434
**MultiAxisLineChart** — Dual Y-axis. `series` (required: `[{ yAccessor, label?, color?, format?, extent? }]`). Falls back to multi-line if not 2 series.
3535
**Heatmap**`data`, `xAccessor`, `yAccessor`, `valueAccessor`, `colorScheme`, `showValues`, `cellBorderColor`
3636
**ScatterplotMatrix**`data`, `fields` (array of numeric field names for grid)
@@ -52,7 +52,7 @@
5252
**DonutChart** — PieChart + `innerRadius` (60), `centerContent`
5353
**FunnelChart**`stepAccessor`, `valueAccessor`, `categoryAccessor` (optional), `connectorOpacity`, `orientation`
5454
**SwimlaneChart**`categoryAccessor`, `subcategoryAccessor` (required), `valueAccessor`, `colorBy` (defaults to subcategoryAccessor), `orientation`, `roundedTop` (pixel radius applied to both outer ends of each lane — left+right for horizontal, top+bottom for vertical. Middle segments stay square so adjacent pieces butt against each other; single-segment lanes round all four corners.)
55-
**LikertChart**`categoryAccessor`, `valueAccessor`|`levelAccessor`+`countAccessor`, `levels` (required), `orientation`, `colorScheme`
55+
**LikertChart**`categoryAccessor`, `valueAccessor`|`levelAccessor`+`countAccessor`, optional `levels`, `orientation`, `colorScheme`
5656
**GaugeChart**`value` (required), `min`, `max`, `thresholds`, `arcWidth`, `cornerRadius` (pixel radius for rounded segment ends — same semantics as DonutChart), `sweep`, `fillZones`, `showNeedle`, `centerContent`
5757

5858
All ordinal: `colorBy`, `colorScheme`, `categoryFormat` (string|ReactNode), `showCategoryTicks` (true).

.windsurfrules

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
**Scatterplot** — `data`, `xAccessor`, `yAccessor`, `colorBy`, `sizeBy`, `sizeRange`, `pointRadius` (5), `pointOpacity` (0.8), `marginalGraphics`, `regression` (boolean | "linear" | "polynomial" | "loess" | RegressionConfig — sugar for a trend-annotation overlay; sits underneath user annotations)
3131
**BubbleChart** — Scatterplot + `sizeBy` (required), `sizeRange` ([5,40]), `regression`
3232
**ConnectedScatterplot** — + `orderAccessor`, `regression`
33-
**QuadrantChart** — Scatterplot + `quadrants` (required), `xCenter`, `yCenter`
33+
**QuadrantChart** — Scatterplot + optional `quadrants` overrides, `xCenter`, `yCenter`
3434
**MultiAxisLineChart** — Dual Y-axis. `series` (required: `[{ yAccessor, label?, color?, format?, extent? }]`). Falls back to multi-line if not 2 series.
3535
**Heatmap** — `data`, `xAccessor`, `yAccessor`, `valueAccessor`, `colorScheme`, `showValues`, `cellBorderColor`
3636
**ScatterplotMatrix** — `data`, `fields` (array of numeric field names for grid)
@@ -52,7 +52,7 @@
5252
**DonutChart** — PieChart + `innerRadius` (60), `centerContent`
5353
**FunnelChart** — `stepAccessor`, `valueAccessor`, `categoryAccessor` (optional), `connectorOpacity`, `orientation`
5454
**SwimlaneChart** — `categoryAccessor`, `subcategoryAccessor` (required), `valueAccessor`, `colorBy` (defaults to subcategoryAccessor), `orientation`, `roundedTop` (pixel radius applied to both outer ends of each lane — left+right for horizontal, top+bottom for vertical. Middle segments stay square so adjacent pieces butt against each other; single-segment lanes round all four corners.)
55-
**LikertChart** — `categoryAccessor`, `valueAccessor`|`levelAccessor`+`countAccessor`, `levels` (required), `orientation`, `colorScheme`
55+
**LikertChart** — `categoryAccessor`, `valueAccessor`|`levelAccessor`+`countAccessor`, optional `levels`, `orientation`, `colorScheme`
5656
**GaugeChart** — `value` (required), `min`, `max`, `thresholds`, `arcWidth`, `cornerRadius` (pixel radius for rounded segment ends — same semantics as DonutChart), `sweep`, `fillZones`, `showNeedle`, `centerContent`
5757

5858
All ordinal: `colorBy`, `colorScheme`, `categoryFormat` (string|ReactNode), `showCategoryTicks` (true).

integration-tests/xy-examples/index.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,6 @@ const examples = [
483483
lineBy: "series",
484484
yExtent: [0, 50],
485485
showLegend: false,
486-
stroke: "#007bff",
487486
width: 400, height: 280, colorScheme: colors,
488487
})
489488
}),
@@ -498,7 +497,6 @@ const examples = [
498497
// Anchor min to 0; max stays data-derived (~20).
499498
yExtent: [0, undefined],
500499
showLegend: false,
501-
stroke: "#007bff",
502500
width: 400, height: 280, colorScheme: colors,
503501
})
504502
}),
@@ -512,7 +510,6 @@ const examples = [
512510
lineBy: "series",
513511
yExtent: [undefined, 50],
514512
showLegend: false,
515-
stroke: "#007bff",
516513
width: 400, height: 280, colorScheme: colors,
517514
})
518515
}),
@@ -526,7 +523,6 @@ const examples = [
526523
lineBy: "series",
527524
xExtent: [-2, 8],
528525
showLegend: false,
529-
stroke: "#007bff",
530526
width: 400, height: 280, colorScheme: colors,
531527
})
532528
}),
@@ -540,7 +536,6 @@ const examples = [
540536
lineBy: "series",
541537
xExtent: [-2, undefined],
542538
showLegend: false,
543-
stroke: "#007bff",
544539
width: 400, height: 280, colorScheme: colors,
545540
})
546541
}),
@@ -554,7 +549,6 @@ const examples = [
554549
lineBy: "series",
555550
xExtent: [undefined, 8],
556551
showLegend: false,
557-
stroke: "#007bff",
558552
width: 400, height: 280, colorScheme: colors,
559553
})
560554
}),

0 commit comments

Comments
 (0)