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

Bar chart #1920

Merged
merged 56 commits into from
Dec 12, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
1bfa2e2
chore 🧹: add .vercel to gitignore
squiles Nov 26, 2024
b1ea69a
feat ⚡️: replicate column chart as bar chart
squiles Nov 26, 2024
c85ea40
feat ⚡️: .
squiles Nov 29, 2024
fffca2f
feat ⚡️: remove rotation from left axis
squiles Nov 29, 2024
4d791db
feat ⚡️: adjust left margin
squiles Nov 29, 2024
db39b8d
fix 🐛: adjust interaction scale
squiles Nov 29, 2024
e63474e
fix 🐛: x scale on grouped bar charts
squiles Nov 29, 2024
d437b9c
fix 🐛: adjust grouped/stacked chart width and height
squiles Nov 29, 2024
4f4165c
refactor ♻️: addressed some of the feedback
squiles Dec 2, 2024
b670ce4
feat ⚡️: show stacked bar charts
squiles Dec 2, 2024
5852281
refactor ♻️: var adjustment
squiles Dec 2, 2024
4ba3b89
feat ⚡️: change id name
squiles Dec 2, 2024
d4209bb
docs 📑: corrected var name
squiles Dec 2, 2024
3757b40
feat ⚡️: adjusted xScale
squiles Dec 2, 2024
ac817c7
Merge branch 'main' into feat/bar-chart
squiles Dec 2, 2024
51f4602
feat ⚡️: column, bar, line, area and scaterplot added to chartConfigs…
squiles Dec 3, 2024
5300dda
fix 🐛: bad merge conflict resolution
squiles Dec 3, 2024
535f4e6
fix 🐛: tests
squiles Dec 3, 2024
51114bd
fix 🐛: PR reviews
squiles Dec 3, 2024
ebf6dcf
feat ⚡️: add map and pie configs
squiles Dec 3, 2024
4e6bf4f
fix: Bars enter animation
bprusinowski Dec 3, 2024
dda2553
fix 🐛: bar <-> pie adjuster
squiles Dec 3, 2024
65ed293
fix: Bar -> pie adjuster (pie doesn't have x field, segment is carrie…
bprusinowski Dec 3, 2024
0702e19
fix: Bar -> combo chart adjusters
bprusinowski Dec 3, 2024
1321900
fix 🐛: y label cutoff
squiles Dec 3, 2024
eadab83
refactor ♻️: ditch tooltip inverted
squiles Dec 5, 2024
893470d
refactor ♻️: got rid of getWideDataInverted
squiles Dec 5, 2024
8cf0207
refactor ♻️: got rid of unused code
squiles Dec 5, 2024
adc84a8
refactor ♻️: got rid of normalizeDataInverted
squiles Dec 5, 2024
b40eb69
refactor ♻️: got rid of getStackedTooltipValueFormatterInverted
squiles Dec 5, 2024
98d0981
refactor ♻️: got rid of useBarChartData
squiles Dec 9, 2024
f70052e
feat ⚡️: adjust margins and scroll on bar charts
squiles Dec 9, 2024
987131f
feat ⚡️: align left margin when axes are flipped
squiles Dec 9, 2024
c899526
feat ⚡️: add missing types
squiles Dec 10, 2024
befb5f5
fix 🐛: animate the correct axis
squiles Dec 10, 2024
ba28224
fix 🐛: remove unwanted animation
squiles Dec 10, 2024
468ff64
fix 🐛: label change
squiles Dec 10, 2024
1b90124
feat ⚡️: add i18n to bar sorting
squiles Dec 10, 2024
efc90bd
refactor ♻️: extracted MIN_BAR_HEIGHT into constants file
squiles Dec 10, 2024
cb28a3a
feat ⚡️: adjust stacked bars height
squiles Dec 10, 2024
90f3132
feat ⚡️: adjust bottom margin
squiles Dec 10, 2024
5d2b5fb
feat ⚡️: adjust horizontal whiskers
squiles Dec 10, 2024
f291994
feat ⚡️: adjust xScale on grouped bar charts
squiles Dec 10, 2024
f3ae19c
feat ⚡️: adjust margins on grouped bar chart
squiles Dec 10, 2024
43ec60b
feat ⚡️: adjust bottom axis according to design
squiles Dec 10, 2024
b479cd1
fix 🐛: animation on bar chart coming from pie
squiles Dec 11, 2024
49f7756
fix 🐛: remove middle circle from horizontal bar whiskers
squiles Dec 11, 2024
52cd631
refactor ♻️: rename vars
squiles Dec 11, 2024
19f50a0
fix 🐛: adjust error whiskers position
squiles Dec 11, 2024
f938a52
fix 🐛: var import
squiles Dec 11, 2024
7695a01
fix 🐛: min x value came from the data instead of 0
squiles Dec 11, 2024
7cdff4f
feat ⚡️: add missing bar fields on 18n
squiles Dec 11, 2024
d08a9ba
Merge branch 'main' into feat/bar-chart
squiles Dec 11, 2024
9c902df
feat ⚡️: remove bar instead of hiding it
squiles Dec 11, 2024
a3ef3e3
fix 🐛: bars not adjusting when width changed
squiles Dec 11, 2024
e7e620a
fix 🐛: don't reverse yScale
squiles Dec 11, 2024
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
11 changes: 2 additions & 9 deletions app/charts/bar/bars-grouped-state.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import {
PADDING_WITHIN,
} from "@/charts/bar/constants";
import {
useAxisLabelHeightOffset,
useChartBounds,
useChartPadding,
} from "@/charts/shared/chart-dimensions";
Expand Down Expand Up @@ -341,17 +340,11 @@ const useBarsGroupedState = (
: yTimeRangeDomainLabels,
});
const right = 40;
const { offset: yAxisLabelMargin } = useAxisLabelHeightOffset({
label: xMeasure.label,
width,
marginLeft: left,
marginRight: right,
});
const margins = {
top: 50 + yAxisLabelMargin,
top: 0,
right,
bottom,
left,
left: 50 + left,
bprusinowski marked this conversation as resolved.
Show resolved Hide resolved
};
const bounds = useChartBounds(width, margins, height);
const { chartWidth, chartHeight } = bounds;
Expand Down
11 changes: 2 additions & 9 deletions app/charts/bar/bars-stacked-state.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import {
} from "@/charts/bar/bars-stacked-state-props";
import { PADDING_INNER, PADDING_OUTER } from "@/charts/bar/constants";
import {
useAxisLabelHeightOffset,
useChartBounds,
useChartPadding,
} from "@/charts/shared/chart-dimensions";
Expand Down Expand Up @@ -401,17 +400,11 @@ const useBarsStackedState = (
normalize,
});
const right = 40;
const { offset: yAxisLabelMargin } = useAxisLabelHeightOffset({
label: xMeasure.label,
width,
marginLeft: left,
marginRight: right,
});
const margins = {
top: 50 + yAxisLabelMargin,
top: 0,
right,
bottom,
left,
left: 50 + left,
};
const bounds = useChartBounds(width, margins, height);
const { chartWidth, chartHeight } = bounds;
Expand Down
12 changes: 3 additions & 9 deletions app/charts/bar/bars-state.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import {
} from "@/charts/bar/bars-state-props";
import { PADDING_INNER, PADDING_OUTER } from "@/charts/bar/constants";
import {
useAxisLabelHeightOffset,
useChartBounds,
useChartPadding,
} from "@/charts/shared/chart-dimensions";
Expand Down Expand Up @@ -203,17 +202,12 @@ const useBarsState = (
: yTimeRangeDomainLabels,
});
const right = 40;
const { offset: xAxisLabelMargin } = useAxisLabelHeightOffset({
label: xMeasure.label,
width,
marginLeft: left,
marginRight: right,
});
const margins = {
top: 50 + xAxisLabelMargin,
top: 0,
right,
bottom,
left,
//NOTE: hardcoded for the moment
left: 50 + left,
};

const bounds = useChartBounds(width, margins, height);
Expand Down
Loading