diff --git a/packages/annotations/src/compute.ts b/packages/annotations/src/compute.ts index 3a4af9f5f..3feaa44ac 100644 --- a/packages/annotations/src/compute.ts +++ b/packages/annotations/src/compute.ts @@ -1,4 +1,6 @@ -import { filter, isNumber, omit } from 'lodash' +import filter from 'lodash/filter' +import isNumber from 'lodash/isNumber' +import omit from 'lodash/omit' import { radiansToDegrees, absoluteAngleDegrees, diff --git a/packages/bar/src/compute/legends.ts b/packages/bar/src/compute/legends.ts index 0a4fade18..7099b0894 100644 --- a/packages/bar/src/compute/legends.ts +++ b/packages/bar/src/compute/legends.ts @@ -7,7 +7,7 @@ import { LegendLabelDatum, } from '../types' import { getPropertyAccessor } from '@nivo/core' -import { uniqBy } from 'lodash' +import uniqBy from 'lodash/uniqBy' export const getLegendDataForKeys = ( bars: BarsWithHidden, diff --git a/packages/boxplot/src/compute/legends.ts b/packages/boxplot/src/compute/legends.ts index 37374e012..cd9923823 100644 --- a/packages/boxplot/src/compute/legends.ts +++ b/packages/boxplot/src/compute/legends.ts @@ -1,6 +1,7 @@ import { BoxPlotDatum, BoxPlotCommonProps, ComputedBoxPlotSummary, LegendData } from '../types' import { getPropertyAccessor } from '@nivo/core' -import { uniqBy, sortBy } from 'lodash' +import uniqBy from 'lodash/uniqBy' +import sortBy from 'lodash/sortBy' export const getLegendData = ({ boxPlots, diff --git a/packages/calendar/src/compute/calendar.ts b/packages/calendar/src/compute/calendar.ts index b5ece292b..248b22961 100644 --- a/packages/calendar/src/compute/calendar.ts +++ b/packages/calendar/src/compute/calendar.ts @@ -1,4 +1,6 @@ -import { isDate, memoize, range } from 'lodash' +import isDate from 'lodash/isDate' +import memoize from 'lodash/memoize' +import range from 'lodash/range' import { alignBox } from '@nivo/core' import { timeFormat } from 'd3-time-format' import { timeDays, timeWeek, timeWeeks, timeMonths, timeYear } from 'd3-time' diff --git a/packages/calendar/src/compute/timeRange.ts b/packages/calendar/src/compute/timeRange.ts index 0cfbbb4f6..94c6e553c 100644 --- a/packages/calendar/src/compute/timeRange.ts +++ b/packages/calendar/src/compute/timeRange.ts @@ -11,7 +11,7 @@ import { } from 'd3-time' import { timeFormat } from 'd3-time-format' import { DateOrString, Weekday } from '../types' -import { isDate } from 'lodash' +import isDate from 'lodash/isDate' // Interfaces interface ComputeBaseProps { diff --git a/packages/colors/src/inheritedColor.ts b/packages/colors/src/inheritedColor.ts index fbd73fdf8..c79a169c5 100644 --- a/packages/colors/src/inheritedColor.ts +++ b/packages/colors/src/inheritedColor.ts @@ -1,5 +1,6 @@ import { useMemo } from 'react' -import { get, isPlainObject } from 'lodash' +import get from 'lodash/get' +import isPlainObject from 'lodash/isPlainObject' import { rgb, RGBColor } from 'd3-color' import { Theme } from '@nivo/core' diff --git a/packages/colors/src/scales/ordinalColorScale.ts b/packages/colors/src/scales/ordinalColorScale.ts index f0fb682b1..6d71bedb4 100644 --- a/packages/colors/src/scales/ordinalColorScale.ts +++ b/packages/colors/src/scales/ordinalColorScale.ts @@ -1,5 +1,6 @@ import { useMemo } from 'react' -import { get, isPlainObject } from 'lodash' +import get from 'lodash/get' +import isPlainObject from 'lodash/isPlainObject' import { scaleOrdinal } from 'd3-scale' import { ColorSchemeId, diff --git a/packages/core/src/motion/context.js b/packages/core/src/motion/context.js index e5c4c7606..dbd7aa25b 100644 --- a/packages/core/src/motion/context.js +++ b/packages/core/src/motion/context.js @@ -1,5 +1,5 @@ import { createContext, useMemo } from 'react' -import { isString } from 'lodash' +import isString from 'lodash/isString' import PropTypes from 'prop-types' import { config as presets } from '@react-spring/web' diff --git a/packages/express/src/index.ts b/packages/express/src/index.ts index 2685928de..eb6f5a753 100644 --- a/packages/express/src/index.ts +++ b/packages/express/src/index.ts @@ -1,6 +1,6 @@ import { Router } from 'express' import * as uuid from 'uuid' -import { forOwn } from 'lodash' +import forOwn from 'lodash/forOwn' import { chartsMapping, ChartType, renderChart, samples } from '@nivo/static' import { validate } from './validation' import * as storage from './memory-storage' diff --git a/packages/express/src/validation.ts b/packages/express/src/validation.ts index aedcb4fe9..d3b4034e1 100644 --- a/packages/express/src/validation.ts +++ b/packages/express/src/validation.ts @@ -1,5 +1,5 @@ import { Request, Response, NextFunction } from 'express' -import { omit } from 'lodash' +import omit from 'lodash/omit' import Joi from 'joi' export const validate = ( diff --git a/packages/geo/src/hooks.js b/packages/geo/src/hooks.js index afc18d610..11ba092c2 100644 --- a/packages/geo/src/hooks.js +++ b/packages/geo/src/hooks.js @@ -7,7 +7,8 @@ * file that was distributed with this source code. */ import { useMemo } from 'react' -import { isFunction, get } from 'lodash' +import isFunction from 'lodash/isFunction' +import get from 'lodash/get' import { format } from 'd3-format' import { geoPath, diff --git a/packages/marimekko/src/hooks.ts b/packages/marimekko/src/hooks.ts index 3c78f8f11..d63a03ce3 100644 --- a/packages/marimekko/src/hooks.ts +++ b/packages/marimekko/src/hooks.ts @@ -1,5 +1,5 @@ import { useMemo } from 'react' -import { get } from 'lodash' +import get from 'lodash/get' import { stack as d3Stack, Stack, Series } from 'd3-shape' import { useValueFormatter, useTheme } from '@nivo/core' import { InheritedColorConfig, useInheritedColor, useOrdinalColorScale } from '@nivo/colors' diff --git a/packages/sankey/src/Sankey.tsx b/packages/sankey/src/Sankey.tsx index 7cd3b72a5..db7382bf2 100644 --- a/packages/sankey/src/Sankey.tsx +++ b/packages/sankey/src/Sankey.tsx @@ -1,5 +1,5 @@ import { createElement, Fragment, ReactNode } from 'react' -import { uniq } from 'lodash' +import uniq from 'lodash/uniq' import { SvgWrapper, useDimensions, Container } from '@nivo/core' import { BoxLegendSvg } from '@nivo/legends' import { svgDefaultProps } from './props' diff --git a/packages/sankey/src/hooks.ts b/packages/sankey/src/hooks.ts index c01ed6dd4..868fab6cf 100644 --- a/packages/sankey/src/hooks.ts +++ b/packages/sankey/src/hooks.ts @@ -1,5 +1,5 @@ import { useState, useMemo } from 'react' -import { cloneDeep } from 'lodash' +import cloneDeep from 'lodash/cloneDeep' import { sankey as d3Sankey } from 'd3-sankey' import { useTheme, usePropertyAccessor, useValueFormatter } from '@nivo/core' import { useOrdinalColorScale, useInheritedColor } from '@nivo/colors' diff --git a/packages/static/src/renderer.ts b/packages/static/src/renderer.ts index 37913fd6e..bd315696b 100644 --- a/packages/static/src/renderer.ts +++ b/packages/static/src/renderer.ts @@ -1,4 +1,4 @@ -import { pick } from 'lodash' +import pick from 'lodash/pick' import { createElement } from 'react' import { renderToStaticMarkup } from 'react-dom/server' import { ChartProps, chartsMapping, ChartType } from './mappings'