From 1ee54eeb1a2f0d4cc734fdcdc182ab02cc39b6b5 Mon Sep 17 00:00:00 2001 From: Alan Buscaglia Date: Tue, 21 Oct 2025 16:04:11 +0200 Subject: [PATCH] refactor: rename graph components to kebab-case --- .../graphs/{DonutChart.tsx => donut-chart.tsx} | 2 +- ...alBarChart.tsx => horizontal-bar-chart.tsx} | 0 ui/components/graphs/index.ts | 18 +++++++++--------- .../graphs/{LineChart.tsx => line-chart.tsx} | 4 ++-- .../graphs/{RadarChart.tsx => radar-chart.tsx} | 2 +- .../{RadialChart.tsx => radial-chart.tsx} | 0 .../{SankeyChart.tsx => sankey-chart.tsx} | 2 +- .../{ScatterPlot.tsx => scatter-plot.tsx} | 4 ++-- .../shared/{AlertPill.tsx => alert-pill.tsx} | 0 .../{ChartLegend.tsx => chart-legend.tsx} | 0 .../{ChartTooltip.tsx => chart-tooltip.tsx} | 0 .../graphs/{ThreatMap.tsx => threat-map.tsx} | 2 +- 12 files changed, 17 insertions(+), 17 deletions(-) rename ui/components/graphs/{DonutChart.tsx => donut-chart.tsx} (98%) rename ui/components/graphs/{HorizontalBarChart.tsx => horizontal-bar-chart.tsx} (100%) rename ui/components/graphs/{LineChart.tsx => line-chart.tsx} (98%) rename ui/components/graphs/{RadarChart.tsx => radar-chart.tsx} (98%) rename ui/components/graphs/{RadialChart.tsx => radial-chart.tsx} (100%) rename ui/components/graphs/{SankeyChart.tsx => sankey-chart.tsx} (99%) rename ui/components/graphs/{ScatterPlot.tsx => scatter-plot.tsx} (97%) rename ui/components/graphs/shared/{AlertPill.tsx => alert-pill.tsx} (100%) rename ui/components/graphs/shared/{ChartLegend.tsx => chart-legend.tsx} (100%) rename ui/components/graphs/shared/{ChartTooltip.tsx => chart-tooltip.tsx} (100%) rename ui/components/graphs/{ThreatMap.tsx => threat-map.tsx} (99%) diff --git a/ui/components/graphs/DonutChart.tsx b/ui/components/graphs/donut-chart.tsx similarity index 98% rename from ui/components/graphs/DonutChart.tsx rename to ui/components/graphs/donut-chart.tsx index 57713cc2f6..e92cc30962 100644 --- a/ui/components/graphs/DonutChart.tsx +++ b/ui/components/graphs/donut-chart.tsx @@ -5,7 +5,7 @@ import { Cell, Label, Pie, PieChart, Tooltip } from "recharts"; import { ChartConfig, ChartContainer } from "@/components/ui/chart/Chart"; -import { ChartLegend } from "./shared/ChartLegend"; +import { ChartLegend } from "./shared/chart-legend"; import { DonutDataPoint } from "./types"; interface DonutChartProps { diff --git a/ui/components/graphs/HorizontalBarChart.tsx b/ui/components/graphs/horizontal-bar-chart.tsx similarity index 100% rename from ui/components/graphs/HorizontalBarChart.tsx rename to ui/components/graphs/horizontal-bar-chart.tsx diff --git a/ui/components/graphs/index.ts b/ui/components/graphs/index.ts index 2f3671c293..2c26df99db 100644 --- a/ui/components/graphs/index.ts +++ b/ui/components/graphs/index.ts @@ -1,9 +1,9 @@ -export { DonutChart } from "./DonutChart"; -export { HorizontalBarChart } from "./HorizontalBarChart"; -export { LineChart } from "./LineChart"; -export { RadarChart } from "./RadarChart"; -export { RadialChart } from "./RadialChart"; -export { SankeyChart } from "./SankeyChart"; -export { ScatterPlot } from "./ScatterPlot"; -export { ChartLegend, type ChartLegendItem } from "./shared/ChartLegend"; -export { ThreatMap } from "./ThreatMap"; +export { DonutChart } from "./donut-chart"; +export { HorizontalBarChart } from "./horizontal-bar-chart"; +export { LineChart } from "./line-chart"; +export { RadarChart } from "./radar-chart"; +export { RadialChart } from "./radial-chart"; +export { SankeyChart } from "./sankey-chart"; +export { ScatterPlot } from "./scatter-plot"; +export { ChartLegend, type ChartLegendItem } from "./shared/chart-legend"; +export { ThreatMap } from "./threat-map"; diff --git a/ui/components/graphs/LineChart.tsx b/ui/components/graphs/line-chart.tsx similarity index 98% rename from ui/components/graphs/LineChart.tsx rename to ui/components/graphs/line-chart.tsx index b19c9591f5..ce4327010d 100644 --- a/ui/components/graphs/LineChart.tsx +++ b/ui/components/graphs/line-chart.tsx @@ -14,8 +14,8 @@ import { YAxis, } from "recharts"; -import { AlertPill } from "./shared/AlertPill"; -import { ChartLegend } from "./shared/ChartLegend"; +import { AlertPill } from "./shared/alert-pill"; +import { ChartLegend } from "./shared/chart-legend"; import { CHART_COLORS } from "./shared/constants"; import { LineConfig, LineDataPoint } from "./types"; diff --git a/ui/components/graphs/RadarChart.tsx b/ui/components/graphs/radar-chart.tsx similarity index 98% rename from ui/components/graphs/RadarChart.tsx rename to ui/components/graphs/radar-chart.tsx index 2589c9ea6c..5855f624b0 100644 --- a/ui/components/graphs/RadarChart.tsx +++ b/ui/components/graphs/radar-chart.tsx @@ -13,7 +13,7 @@ import { ChartTooltip, } from "@/components/ui/chart/Chart"; -import { AlertPill } from "./shared/AlertPill"; +import { AlertPill } from "./shared/alert-pill"; import { CHART_COLORS } from "./shared/constants"; import { RadarDataPoint } from "./types"; diff --git a/ui/components/graphs/RadialChart.tsx b/ui/components/graphs/radial-chart.tsx similarity index 100% rename from ui/components/graphs/RadialChart.tsx rename to ui/components/graphs/radial-chart.tsx diff --git a/ui/components/graphs/SankeyChart.tsx b/ui/components/graphs/sankey-chart.tsx similarity index 99% rename from ui/components/graphs/SankeyChart.tsx rename to ui/components/graphs/sankey-chart.tsx index 75750c2a53..c93deb8353 100644 --- a/ui/components/graphs/SankeyChart.tsx +++ b/ui/components/graphs/sankey-chart.tsx @@ -4,7 +4,7 @@ import { useState } from "react"; import { Rectangle, ResponsiveContainer, Sankey, Tooltip } from "recharts"; import { CHART_COLORS } from "./shared/constants"; -import { ChartTooltip } from "./shared/ChartTooltip"; +import { ChartTooltip } from "./shared/chart-tooltip"; interface SankeyNode { name: string; diff --git a/ui/components/graphs/ScatterPlot.tsx b/ui/components/graphs/scatter-plot.tsx similarity index 97% rename from ui/components/graphs/ScatterPlot.tsx rename to ui/components/graphs/scatter-plot.tsx index e90d56dc33..d137a6ccdf 100644 --- a/ui/components/graphs/ScatterPlot.tsx +++ b/ui/components/graphs/scatter-plot.tsx @@ -11,8 +11,8 @@ import { YAxis, } from "recharts"; -import { AlertPill } from "./shared/AlertPill"; -import { ChartLegend } from "./shared/ChartLegend"; +import { AlertPill } from "./shared/alert-pill"; +import { ChartLegend } from "./shared/chart-legend"; import { CHART_COLORS } from "./shared/constants"; import { getSeverityColorByRiskScore } from "./shared/utils"; diff --git a/ui/components/graphs/shared/AlertPill.tsx b/ui/components/graphs/shared/alert-pill.tsx similarity index 100% rename from ui/components/graphs/shared/AlertPill.tsx rename to ui/components/graphs/shared/alert-pill.tsx diff --git a/ui/components/graphs/shared/ChartLegend.tsx b/ui/components/graphs/shared/chart-legend.tsx similarity index 100% rename from ui/components/graphs/shared/ChartLegend.tsx rename to ui/components/graphs/shared/chart-legend.tsx diff --git a/ui/components/graphs/shared/ChartTooltip.tsx b/ui/components/graphs/shared/chart-tooltip.tsx similarity index 100% rename from ui/components/graphs/shared/ChartTooltip.tsx rename to ui/components/graphs/shared/chart-tooltip.tsx diff --git a/ui/components/graphs/ThreatMap.tsx b/ui/components/graphs/threat-map.tsx similarity index 99% rename from ui/components/graphs/ThreatMap.tsx rename to ui/components/graphs/threat-map.tsx index 992bd221a1..ee74f7426f 100644 --- a/ui/components/graphs/ThreatMap.tsx +++ b/ui/components/graphs/threat-map.tsx @@ -16,7 +16,7 @@ import type { Topology, } from "topojson-specification"; -import { HorizontalBarChart } from "./HorizontalBarChart"; +import { HorizontalBarChart } from "./horizontal-bar-chart"; import { BarDataPoint } from "./types"; // Constants