θΏ™ζ˜―indexlocζδΎ›ηš„ζœεŠ‘οΌŒδΈθ¦θΎ“ε…₯任何密码
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ export default function Tooltip({ legendColor, ...props }) {
{...props}
content={({ active, payload, label }) => {
return active && payload ? (
<div className="bg-white text-sm rounded-md border shadow-lg">
<div className="bg-theme-bg-primary text-sm rounded-md border shadow-lg">
<div className="border-b py-2 px-4">
<p className="text-elem text-gray-700 font-medium">{label}</p>
<p className="text-theme-bg-primary font-medium">{label}</p>
</div>
<div className="space-y-1 py-2 px-4">
{payload.map(({ value, name }, idx) => (
Expand All @@ -58,7 +58,7 @@ export default function Tooltip({ legendColor, ...props }) {
>
<div className="flex items-center space-x-2">
<span
className="shrink-0 h-3 w-3 border-white rounded-md rounded-full border-2 shadow-md"
className="shrink-0 h-3 w-3 border-theme-bg-primary rounded-md rounded-full border-2 shadow-md"
style={{ backgroundColor: legendColor }}
/>
<p
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,10 @@ export function Chartable({ props, workspace }) {
switch (chartType) {
case "area":
return (
<div className="bg-zinc-900 p-8 rounded-xl text-white">
<h3 className="text-lg font-medium">{title}</h3>
<div className="bg-theme-bg-primary p-8 rounded-xl text-white light:border light:border-theme-border-primary">
<h3 className="text-lg text-theme-text-primary font-medium">
{title}
</h3>
<AreaChart
className="h-[350px]"
data={data}
Expand All @@ -90,8 +92,10 @@ export function Chartable({ props, workspace }) {
);
case "bar":
return (
<div className="bg-zinc-900 p-8 rounded-xl text-white">
<h3 className="text-lg font-medium">{title}</h3>
<div className="bg-theme-bg-primary p-8 rounded-xl text-white light:border light:border-theme-border-primary">
<h3 className="text-lg text-theme-text-primary font-medium">
{title}
</h3>
<BarChart
className="h-[350px]"
data={data}
Expand All @@ -107,8 +111,10 @@ export function Chartable({ props, workspace }) {
);
case "line":
return (
<div className="bg-zinc-900 p-8 pb-12 rounded-xl text-white h-[500px] w-full">
<h3 className="text-lg font-medium">{title}</h3>
<div className="bg-theme-bg-primary p-8 pb-12 rounded-xl text-white h-[500px] w-full light:border light:border-theme-border-primary">
<h3 className="text-lg text-theme-text-primary font-medium">
{title}
</h3>
<LineChart
className="h-[400px]"
data={data}
Expand All @@ -122,8 +128,10 @@ export function Chartable({ props, workspace }) {
);
case "composed":
return (
<div className="bg-zinc-900 p-8 rounded-xl text-white">
<h3 className="text-lg font-medium">{title}</h3>
<div className="bg-theme-bg-primary p-8 rounded-xl text-white light:border light:border-theme-border-primary">
<h3 className="text-lg text-theme-text-primary font-medium">
{title}
</h3>
{showLegend && (
<Legend
categories={[value]}
Expand Down Expand Up @@ -178,8 +186,10 @@ export function Chartable({ props, workspace }) {
);
case "scatter":
return (
<div className="bg-zinc-900 p-8 rounded-xl text-white">
<h3 className="text-lg font-medium">{title}</h3>
<div className="bg-theme-bg-primary p-8 rounded-xl text-white light:border light:border-theme-border-primary">
<h3 className="text-lg text-theme-text-primary font-medium">
{title}
</h3>
{showLegend && (
<div className="flex justify-end">
<Legend
Expand Down Expand Up @@ -224,8 +234,10 @@ export function Chartable({ props, workspace }) {
);
case "pie":
return (
<div className="bg-zinc-900 p-8 rounded-xl text-white">
<h3 className="text-lg font-medium">{title}</h3>
<div className="bg-theme-bg-primary p-8 rounded-xl text-white light:border light:border-theme-border-primary">
<h3 className="text-lg text-theme-text-primary font-medium">
{title}
</h3>
<DonutChart
data={data}
category={value}
Expand All @@ -248,8 +260,10 @@ export function Chartable({ props, workspace }) {
);
case "radar":
return (
<div className="bg-zinc-900 p-8 rounded-xl text-white">
<h3 className="text-lg font-medium">{title}</h3>
<div className="bg-theme-bg-primary p-8 rounded-xl text-white light:border light:border-theme-border-primary">
<h3 className="text-lg text-theme-text-primary font-medium">
{title}
</h3>
{showLegend && (
<div className="flex justify-end">
<Legend
Expand Down Expand Up @@ -282,8 +296,10 @@ export function Chartable({ props, workspace }) {
);
case "radialbar":
return (
<div className="bg-zinc-900 p-8 rounded-xl text-white">
<h3 className="text-lg font-medium">{title}</h3>
<div className="bg-theme-bg-primary p-8 rounded-xl text-white light:border light:border-theme-border-primary">
<h3 className="text-lg text-theme-text-primary font-medium">
{title}
</h3>
{showLegend && (
<div className="flex justify-end">
<Legend
Expand Down Expand Up @@ -317,8 +333,10 @@ export function Chartable({ props, workspace }) {
);
case "treemap":
return (
<div className="bg-zinc-900 p-8 rounded-xl text-white">
<h3 className="text-lg font-medium">{title}</h3>
<div className="bg-theme-bg-primary p-8 rounded-xl text-white light:border light:border-theme-border-primary">
<h3 className="text-lg text-theme-text-primary font-medium">
{title}
</h3>
{showLegend && (
<div className="flex justify-end">
<Legend
Expand All @@ -343,8 +361,10 @@ export function Chartable({ props, workspace }) {
);
case "funnel":
return (
<div className="bg-zinc-900 p-8 rounded-xl text-white">
<h3 className="text-lg font-medium">{title}</h3>
<div className="bg-theme-bg-primary p-8 rounded-xl text-white light:border light:border-theme-border-primary">
<h3 className="text-lg text-theme-text-primary font-medium">
{title}
</h3>
{showLegend && (
<div className="flex justify-end">
<Legend
Expand Down Expand Up @@ -413,7 +433,7 @@ const customTooltip = (props) => {
const categoryPayload = payload?.[0];
if (!categoryPayload) return null;
return (
<div className="w-56 bg-zinc-400 rounded-lg border p-2 text-white">
<div className="w-56 bg-theme-bg-primary rounded-lg border p-2 text-white">
<div className="flex flex-1 space-x-2.5">
<div
className={`flex w-1.5 flex-col bg-${categoryPayload?.color}-500 rounded`}
Expand Down Expand Up @@ -447,13 +467,13 @@ function DownloadGraph({ onClick }) {
<div className="p-1 rounded-full border-none">
{loading ? (
<CircleNotch
className="text-white/50 w-5 h-5 animate-spin"
className="text-theme-text-primary w-5 h-5 animate-spin"
aria-label="Downloading image..."
/>
) : (
<DownloadSimple
weight="bold"
className="text-white/50 w-5 h-5 hover:text-white"
className="text-theme-text-primary w-5 h-5 hover:text-theme-text-primary"
onClick={handleClick}
aria-label="Download graph image"
/>
Expand Down
4 changes: 4 additions & 0 deletions frontend/src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -836,6 +836,10 @@ does not extend the close button beyond the viewport. */
fill: #fff;
}

[data-theme="light"] .recharts-text > * {
fill: #000;
}

.recharts-legend-wrapper {
margin-bottom: 10px;
}
Expand Down