{"size": 862, "ext": "js", "max_stars_repo_path": "packages/parallel-coordinates/src/enhance.js", "max_stars_repo_name": "yuxal/nivo", "max_stars_repo_stars_event_min_datetime": "2021-11-19T05:58:40.000Z", "max_stars_repo_stars_event_max_datetime": "2021-11-19T05:58:40.000Z", "max_issues_repo_path": "packages/parallel-coordinates/src/enhance.js", "max_issues_repo_name": "yuxal/nivo", "max_issues_repo_issues_event_min_datetime": "2021-09-02T22:09:50.000Z", "max_issues_repo_issues_event_max_datetime": "2022-03-08T23:36:37.000Z", "max_forks_repo_path": "packages/parallel-coordinates/src/enhance.js", "max_forks_repo_name": "yuxal/nivo", "max_forks_repo_forks_event_min_datetime": "2021-05-11T10:29:20.000Z", "max_forks_repo_forks_event_max_datetime": "2021-05-11T10:29:20.000Z"}
{"max_stars_count": 1, "max_issues_count": 11, "max_forks_count": 1, "avg_line_length": 29.724137931, "max_line_length": 81, "alphanum_fraction": 0.6531322506}
/*
 * This file is part of the nivo project.
 *
 * Copyright 2016-present, Raphaël Benitte.
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
import { withDimensions, withTheme, withColors, curveFromProp } from '@nivo/core'
import * as props from './props'
import withPropsOnChange from 'recompose/withPropsOnChange'
import { line } from 'd3-shape'

export const commonEnhancers = [
    withDimensions(),
    withColors({
        defaultColors: props.commonDefaultProps.colors,
        defaultColorBy: props.commonDefaultProps.colorBy,
        destKey: 'getLineColor',
    }),
    withTheme(),
    withPropsOnChange(['curve'], ({ curve }) => ({
        lineGenerator: line()
            .x(d => d.x)
            .y(d => d.y)
            .curve(curveFromProp(curve)),
    })),
]
