Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Legend scroll #716

Merged
merged 41 commits into from
Oct 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
3d9557f
add number of months
mbauchet Jul 30, 2023
75a9427
add number of mnths
mbauchet Jul 30, 2023
6826c21
Merge remote-tracking branch 'upstream/main'
mbauchet Sep 9, 2023
81b6fa1
remove number of month
mbauchet Sep 13, 2023
37ac607
Merge remote-tracking branch 'tremor/main'
Sep 26, 2023
33554fa
Merge remote-tracking branch 'origin/main' into HEAD
Sep 28, 2023
4c099de
add draft scroll legend
Sep 28, 2023
677bfbb
fix lint
Sep 28, 2023
4d878ca
fix scroll and keyboard navigation + add prop to charts
Sep 29, 2023
ac9bf63
change listener for keydown
Sep 29, 2023
6de8978
fix keyboard navigation
Oct 5, 2023
6d8703f
fix: ring color for date(range)picker (#756)
mbauchet Oct 13, 2023
00cbb2f
add onValueChange prop to textinput (#736)
jzfrank Oct 13, 2023
7deb351
fix: types and story
severinlandolt Oct 13, 2023
da7ebef
Update SimpleTextInput.tsx
severinlandolt Oct 13, 2023
6a82356
Update DatePicker.tsx
severinlandolt Oct 13, 2023
8fbcf5f
Add deprecation note
severinlandolt Oct 13, 2023
ecc6e9b
feat: chore/updaterecharts (#762)
severinlandolt Oct 17, 2023
3dc17e3
add deprecate badge
severinlandolt Oct 17, 2023
360ce69
Autofull styling
severinlandolt Oct 17, 2023
e8e88af
making autofill important
severinlandolt Oct 17, 2023
f78f756
fix: merged imports
severinlandolt Oct 17, 2023
e58ab90
fix: interval type optional
severinlandolt Oct 17, 2023
4459f0b
fix: autofill shadow
severinlandolt Oct 18, 2023
564d2d9
fix: update autoprefixer
severinlandolt Oct 18, 2023
df52d83
autofill rounded
severinlandolt Oct 18, 2023
ea381b4
fix: select search on MultiSelect (#753)
Oct 18, 2023
5a96e27
feat: Switch component (#761)
AlexRousseau92 Oct 18, 2023
71897ec
fix: darkmode switch
severinlandolt Oct 18, 2023
548b9c5
fix: changed default intervaltype to equidistant
severinlandolt Oct 18, 2023
5e7b903
fix: switch id
severinlandolt Oct 19, 2023
5cca36c
fix: tremor theming
severinlandolt Oct 19, 2023
7b09ea6
removed deprecation message
severinlandolt Oct 19, 2023
25c5bdd
changed stories
severinlandolt Oct 19, 2023
0dc8f2d
Merge branch 'main' into feat/legend-scroll
severinlandolt Oct 19, 2023
beb5068
Merge branch 'beta' into feat/legend-scroll
severinlandolt Oct 19, 2023
7363301
fix stories
severinlandolt Oct 19, 2023
c835c48
fix barrel file
severinlandolt Oct 19, 2023
36987d6
Fixed effect dependencies and renamed prop
severinlandolt Oct 19, 2023
a804e2c
set enableLegendSlider to default false
severinlandolt Oct 19, 2023
25b7fb5
Merge branch 'beta' into feat/legend-scroll
severinlandolt Oct 23, 2023
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
9 changes: 9 additions & 0 deletions src/assets/ChevronLeftFill.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import React from "react";

const ChevronLeftFill = ({ ...props }) => (
<svg {...props} xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
<path d="M8 12L14 6V18L8 12Z"></path>
</svg>
);

export default ChevronLeftFill;
9 changes: 9 additions & 0 deletions src/assets/ChevronRightFill.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import React from "react";

const ChevronRightFill = ({ ...props }) => (
<svg {...props} xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
<path d="M16 12L10 18V6L16 12Z"></path>
</svg>
);

export default ChevronRightFill;
6 changes: 4 additions & 2 deletions src/assets/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ export { default as ExclamationFilledIcon } from "./ExclamationFilledIcon";
export { default as EyeIcon } from "./EyeIcon";
export { default as EyeOffIcon } from "./EyeOffIcon";
export { default as LoadingSpinner } from "./LoadingSpinner";
export { default as MinusIcon } from "./MinusIcon";
export { default as PlusIcon } from "./PlusIcon";
export { default as SearchIcon } from "./SearchIcon";
export { default as XCircleIcon } from "./XCircleIcon";
export { default as PlusIcon } from "./PlusIcon";
export { default as MinusIcon } from "./MinusIcon";
export { default as ChevronLeftFill } from "./ChevronLeftFill";
export { default as ChevronRightFill } from "./ChevronRightFill";
3 changes: 3 additions & 0 deletions src/components/chart-elements/AreaChart/AreaChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ const AreaChart = React.forwardRef<HTMLDivElement, AreaChartProps>((props, ref)
noDataText,
className,
onValueChange,
enableLegendSlider = false,
customTooltip,
...other
} = props;
Expand Down Expand Up @@ -144,6 +145,7 @@ const AreaChart = React.forwardRef<HTMLDivElement, AreaChartProps>((props, ref)
}
: undefined
}
margin={{ left: 20, right: 20 }}
>
{showGridLines ? (
<CartesianGrid
Expand Down Expand Up @@ -245,6 +247,7 @@ const AreaChart = React.forwardRef<HTMLDivElement, AreaChartProps>((props, ref)
hasOnValueChange
? (clickedLegendItem: string) => onCategoryClick(clickedLegendItem)
: undefined,
enableLegendSlider,
)
}
/>
Expand Down
3 changes: 3 additions & 0 deletions src/components/chart-elements/BarChart/BarChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ const BarChart = React.forwardRef<HTMLDivElement, BarChartProps>((props, ref) =>
onValueChange,
customTooltip,
className,
enableLegendSlider = false,
...other
} = props;
const CustomTooltip = customTooltip;
Expand Down Expand Up @@ -139,6 +140,7 @@ const BarChart = React.forwardRef<HTMLDivElement, BarChartProps>((props, ref) =>
}
: undefined
}
margin={{ left: 20, right: 20 }}
>
{showGridLines ? (
<CartesianGrid
Expand Down Expand Up @@ -290,6 +292,7 @@ const BarChart = React.forwardRef<HTMLDivElement, BarChartProps>((props, ref) =>
hasOnValueChange
? (clickedLegendItem: string) => onCategoryClick(clickedLegendItem)
: undefined,
enableLegendSlider,
)
}
/>
Expand Down
3 changes: 3 additions & 0 deletions src/components/chart-elements/LineChart/LineChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ const LineChart = React.forwardRef<HTMLDivElement, LineChartProps>((props, ref)
noDataText,
className,
onValueChange,
enableLegendSlider = false,
customTooltip,
...other
} = props;
Expand Down Expand Up @@ -141,6 +142,7 @@ const LineChart = React.forwardRef<HTMLDivElement, LineChartProps>((props, ref)
}
: undefined
}
margin={{ left: 20, right: 20 }}
>
{showGridLines ? (
<CartesianGrid
Expand Down Expand Up @@ -243,6 +245,7 @@ const LineChart = React.forwardRef<HTMLDivElement, LineChartProps>((props, ref)
hasOnValueChange
? (clickedLegendItem: string) => onCategoryClick(clickedLegendItem)
: undefined,
enableLegendSlider,
)
}
/>
Expand Down
3 changes: 3 additions & 0 deletions src/components/chart-elements/ScatterChart/ScatterChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ export interface ScatterChartProps
maxYValue?: number;
allowDecimals?: boolean;
noDataText?: string;
enableLegendSlider?: boolean;
onValueChange?: (value: EventProps) => void;
customTooltip?: React.ComponentType<CustomTooltipType>;
}
Expand Down Expand Up @@ -130,6 +131,7 @@ const ScatterChart = React.forwardRef<HTMLDivElement, ScatterChartProps>((props,
onValueChange,
customTooltip,
className,
enableLegendSlider = false,
...other
} = props;
const CustomTooltip = customTooltip;
Expand Down Expand Up @@ -338,6 +340,7 @@ const ScatterChart = React.forwardRef<HTMLDivElement, ScatterChartProps>((props,
hasOnValueChange
? (clickedLegendItem: string) => onCategoryClick(clickedLegendItem)
: undefined,
enableLegendSlider,
)
}
/>
Expand Down
1 change: 1 addition & 0 deletions src/components/chart-elements/common/BaseChartProps.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ interface BaseChartProps extends BaseAnimationTimingProps, React.HTMLAttributes<
allowDecimals?: boolean;
noDataText?: string;
onValueChange?: (value: EventProps) => void;
enableLegendSlider?: boolean;
customTooltip?: React.ComponentType<CustomTooltipType>;
}

Expand Down
2 changes: 2 additions & 0 deletions src/components/chart-elements/common/ChartLegend.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const ChartLegend = (
setLegendHeight: React.Dispatch<React.SetStateAction<number>>,
activeLegend: string | undefined,
onClick?: (category: string, color: Color) => void,
enableLegendSlider?: boolean,
) => {
const legendRef = useRef<HTMLDivElement>(null);

Expand All @@ -31,6 +32,7 @@ const ChartLegend = (
colors={filteredPayload.map((entry: any) => categoryColors.get(entry.value))}
onClickLegendItem={onClick}
activeLegend={activeLegend}
enableLegendSlider={enableLegendSlider}
/>
</div>
);
Expand Down
1 change: 0 additions & 1 deletion src/components/input-elements/Switch/Switch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ const Switch = React.forwardRef<HTMLDivElement, SwitchProps>((props, ref) => {
"translate-x-5 border-white",
)
: "translate-x-0 bg-tremor-border dark:bg-dark-tremor-border border-white",

"pointer-events-none absolute left-0 inline-block h-5 w-5 transform rounded-tremor-full border-2 shadow-tremor-input duration-100 ease-in-out transition",
isFocused ? tremorTwMerge("ring-2 ring-blue-200") : "",
)}
Expand Down
Loading
Loading