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

docs: create more log axis examples #277

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
feat: default d3 tick format in logscale
  • Loading branch information
wadjih-bencheikh18 committed Jan 29, 2022
commit f215a8661919e64a934090784895d739c0de0ef6
2 changes: 1 addition & 1 deletion src/components/Axis/Axis.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export function Axis({
labelStyle,
hidden = false,
tickLabelStyle,
tickLabelFormat = (value) => String(value),
tickLabelFormat,
hiddenLine = false,
lineStyle,
primaryGridLineStyle,
Expand Down
7 changes: 6 additions & 1 deletion src/components/Axis/LinearAxis.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,12 @@ interface LinearAxisProps extends AxisChildProps {
}

export default function LinearAxis(props: LinearAxisProps) {
const { position, tickLabelFormat, scale, ...otherProps } = props;
const {
position,
tickLabelFormat = (value) => String(value),
scale,
...otherProps
} = props;

const axisRef = useRef<SVGGElement>(null);

Expand Down
7 changes: 6 additions & 1 deletion src/components/Axis/LogAxis.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,12 @@ interface LogAxisProps extends AxisChildProps {
}

export default function LinearAxis(props: LogAxisProps) {
const { position, tickLabelFormat, scale, ...otherProps } = props;
const {
position,
scale,
tickLabelFormat = scale.tickFormat(),
...otherProps
} = props;

const axisRef = useRef<SVGGElement>(null);

Expand Down