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

Prevent plotly from clipping markers on axes #200

Merged
merged 2 commits into from
Oct 25, 2023
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
7 changes: 7 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
#!/bin/sh
[ -n "$CI" ] && exit 0

# This loads nvm.sh, sets the correct PATH before running hook, and ensures the project version of Node
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
if [[ -f ".nvmrc" ]]; then
nvm use
fi

. "$(dirname "$0")/_/husky.sh"

npx lint-staged
6 changes: 4 additions & 2 deletions components/graphs/IndicatorGraph.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import styled from 'styled-components';
import { useTheme } from 'common/theme';
import { transparentize } from 'polished';
import { splitLines } from 'common/utils';
import { Layout } from 'plotly.js';

const log10 = Math.log(10);

Expand All @@ -28,7 +29,7 @@ const createLayout = (
'-apple-system, BlinkMacSystemFont, avenir next, avenir, segoe ui, helvetica neue, helvetica, Ubuntu, roboto, noto, arial, sans-serif';
const hasCategories = !hasTimeDimension;

const yaxes = {
const yaxes: NonNullable<Pick<Layout, 'yaxis'>> = {
yaxis: {
automargin: true,
hoverformat: `${config.maxDigits === 0 ? '' : '.'}${config.maxDigits}r`,
Expand Down Expand Up @@ -174,7 +175,8 @@ const createTraces = (
const allXValues = [];

const newTraces = traces.map((trace, idx) => {
const modTrace = trace;
const modTrace = { ...trace, cliponaxis: false };

trace.y.forEach((value) => {
// Determine the highest number of significant digits in the dataset
// to be able to set suitable number formating.
Expand Down
1 change: 0 additions & 1 deletion components/indicators/IndicatorContent.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { Container, Row, Col } from 'reactstrap';
import styled from 'styled-components';
import { gql, useQuery } from '@apollo/client';

import { IndicatorListLink } from 'common/links';
import { usePlan } from 'context/plan';
import { getActionTermContext, useTranslation } from 'common/i18n';

Expand Down
Loading