Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: add delta calculation#675

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
mbauchet wants to merge19 commits intotremorlabs:main
base:main
Choose a base branch
Loading
frommbauchet:feat/two-points-selection
Draft
Show file tree
Hide file tree
Changes from1 commit
Commits
Show all changes
19 commits
Select commitHold shift + click to select a range
3d9557f
add number of months
mbauchetJul 30, 2023
75a9427
add number of mnths
mbauchetJul 30, 2023
6826c21
Merge remote-tracking branch 'upstream/main'
mbauchetSep 9, 2023
d29e907
test for line chart
mbauchetSep 13, 2023
2faf271
add range selection on line & area
mbauchetSep 13, 2023
ff3feea
fix dot svg
mbauchetSep 13, 2023
a7fcef8
add to barchart and add enableDeltaCalculation prop
mbauchetSep 13, 2023
7a41a3b
fix lint
mbauchetSep 13, 2023
d9bac25
remove numberofmonth (error)
mbauchetSep 13, 2023
978ed50
Merge remote-tracking branch 'origin/main' into feat/two-points-selec…
Sep 28, 2023
963156a
fix mouse event propagation
Sep 28, 2023
e02d536
update style
Sep 29, 2023
ec9a857
fix percentage calculation
Sep 29, 2023
df03e71
add area for range selection
Sep 29, 2023
1958359
fix line click
Sep 29, 2023
12216f3
fix mouseMove
Sep 29, 2023
08c4197
fix tootip, reference area stroke color and position
Sep 29, 2023
ad96573
fix curve type delta for area
mbauchetOct 1, 2023
3de7335
add isIncreasePositive prop
mbauchetOct 2, 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
PrevPrevious commit
NextNext commit
fix tootip, reference area stroke color and position
  • Loading branch information
Maxime BAUCHET committedSep 29, 2023
commit08c41970363f61c02b09d9e3ed330d60853be65d
32 changes: 16 additions & 16 deletionssrc/components/chart-elements/AreaChart/AreaChart.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -344,6 +344,22 @@ const AreaChart = React.forwardRef<HTMLDivElement, AreaChartProps>((props, ref)
</defs>
);
})}
{hasDeltaCalculation ? (
<ReferenceArea
x1={deltaCalculation.leftArea.activeLabel}
x2={deltaCalculation.rightArea.activeLabel}
fillOpacity={0.2}
shape={({ x, y, width, height }) => (
<DeltaCalculationReferenceShape
x={x}
y={y}
width={width}
height={height}
fill={false}
/>
)}
/>
) : null}
{categories.map((category) => (
<Area
className={
Expand DownExpand Up@@ -439,22 +455,6 @@ const AreaChart = React.forwardRef<HTMLDivElement, AreaChartProps>((props, ref)
connectNulls={connectNulls}
/>
))}
{hasDeltaCalculation ? (
<ReferenceArea
x1={deltaCalculation.leftArea.activeLabel}
x2={deltaCalculation.rightArea.activeLabel}
fillOpacity={0.2}
shape={({ x, y, width, height }) => (
<DeltaCalculationReferenceShape
x={x}
y={y}
width={width}
height={height}
fill={false}
/>
)}
/>
) : null}
{hasDeltaCalculation
? categories.map((category) => (
<Area
Expand Down
21 changes: 10 additions & 11 deletionssrc/components/chart-elements/LineChart/LineChart.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -244,7 +244,6 @@ const LineChart = React.forwardRef<HTMLDivElement, LineChartProps>((props, ref)
}
position={{ y: 0 }}
/>

{showLegend ? (
<Legend
verticalAlign="top"
Expand All@@ -262,6 +261,16 @@ const LineChart = React.forwardRef<HTMLDivElement, LineChartProps>((props, ref)
}
/>
) : null}
{hasDeltaCalculation ? (
<ReferenceArea
x1={deltaCalculation.leftArea.activeLabel}
x2={deltaCalculation.rightArea.activeLabel}
fillOpacity={0.2}
shape={({ x, y, width, height }) => (
<DeltaCalculationReferenceShape x={x} y={y} width={width} height={height} />
)}
/>
) : null}
{categories.map((category) => (
<Line
className={tremorTwMerge(
Expand DownExpand Up@@ -351,16 +360,6 @@ const LineChart = React.forwardRef<HTMLDivElement, LineChartProps>((props, ref)
connectNulls={connectNulls}
/>
))}
{hasDeltaCalculation ? (
<ReferenceArea
x1={deltaCalculation.leftArea.activeLabel}
x2={deltaCalculation.rightArea.activeLabel}
fillOpacity={0.2}
shape={({ x, y, width, height }) => (
<DeltaCalculationReferenceShape x={x} y={y} width={width} height={height} />
)}
/>
) : null}
{onValueChange
? categories.map((category) => (
<Line
Expand Down
2 changes: 1 addition & 1 deletionsrc/components/chart-elements/common/ChartTooltip.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -177,7 +177,7 @@ const ChartTooltip = ({
return (
<ChartTooltipRow
key={`id-${idx}`}
value={`${displayedValue > 0 ? "+" : ""}${valueFormatter(
value={`${displayedValue > 0&& hasRange? "+" : ""}${valueFormatter(
displayedValue,
)} ${percentageValue}`}
name={name}
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -43,9 +43,9 @@ const DeltaCalculationReferenceShape = (props: DeltaCalculationReferenceShapePro
// common
"stroke-1",
// light
"stroke-tremor-content-subtle",
"stroke-tremor-border",
// dark
"dark:stroke-dark-tremor-content-subtle",
"dark:stroke-dark-tremor-border",
)}
/>
<line
Expand All@@ -58,9 +58,9 @@ const DeltaCalculationReferenceShape = (props: DeltaCalculationReferenceShapePro
// common
"stroke-1",
// light
"stroke-tremor-content-subtle",
"stroke-tremor-border",
// dark
"dark:stroke-dark-tremor-content-subtle",
"dark:stroke-dark-tremor-border",
)}
/>
</>
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp